0

Using ffmpeg I converted an FLV file to an MP4 file. But the MP4 file has 0 bytes. The command which i used to convert is

ffmpeg -i sample.flv -b 1104k -ab 122k sample.mp4

This is the output I got for the above ffmpeg command:

ffmpeg version 0.8.5-4:0.8.5-0ubuntu0.12.04.1, Copyright (c) 2000-2012 the Libav developers
  built on Jan 24 2013 18:01:36 with gcc 4.6.3
*** THIS PROGRAM IS DEPRECATED ***
This program is only provided for compatibility and will be removed in a future release. Please use avconv instead.
[flv @ 0x64f7a0] Estimating duration from bitrate, this may be inaccurate
Input #0, flv, from '/home/kirthiga/Desktop/videopine/test.flv':
  Metadata:
    creationdate    : Thu Mar 28 12:46:29
  Duration: 00:00:09.82, start: 0.000000, bitrate: N/A
    Stream #0.0: Video: flv, yuv420p, 320x240, 1k tbr, 1k tbn, 1k tbc
    Stream #0.1: Audio: nellymoser, 22050 Hz, mono, s16
[buffer @ 0x64f720] w:320 h:240 pixfmt:yuv420p
encoder 'aac' is experimental and might produce bad results.
Add '-strict experimental' if you want to use it.
slhck
  • 36,575
  • 28
  • 148
  • 201
user2138489
  • 77
  • 3
  • 10

1 Answers1

2

First of all, you're using an outdated, misnamed and broken version of ffmpeg that's actually not from FFmpeg, but from Libav, an FFmpeg fork. Read this for more.

The error is that your version—for some reason—doesn't seem to be configured with any additional libraries, and thus you'll have a hard time actually converting with proper quality to anything useful.

To get your command working, a -strict experimental should do, but what I propose instead is that you either download a recent static build of FFmpeg, or compile it yourself with dependencies such as libfdk_aac and libx264.

You can then do:

ffmpeg -i in.flv -crf 23 -c:v libx264 -c:a libfdk_aac -vbr 4 out.mp4

Change the CRF parameter between 18 and 28 to control the quality. Less means better, 23 is default. For audio, the quality is set with the VBR option, with 4 delivering roughly 128 kBit/s stereo, and values from 1 to 5 (higher means better).

If you really have to use constant bitrate, try this instead:

ffmpeg -i in.flv -c:v libx264 -b:v 1104K -c:a libfdk_aac -b:a 122k out.mp4

See the x264 encoding guide and AAC encoding guide on the FFmpeg wiki for more options.

Community
  • 1
  • 1
slhck
  • 36,575
  • 28
  • 148
  • 201