0

I am trying to convert flv video to mp4 using ffmpeg.

I have checked questions about converting from flv like this one and this one but it didn't help.

Commands I have executed:

ffmpeg -i input.flv -c:v libx264 output.mp4

also:

ffmpeg -i input.flv -c:v libx264 -crf 19 -strict experimental output.mp4

also:

ffmpeg -i input.flv -codec copy output.mp4

also:

ffmpeg -i input.flv -c copy -copyts output.mp4

also:

ffmpeg -i input.flv -vcodec libvpx -acodec libvorbis output.mp4

also:

ffmpeg -analyzeduration 2147483647 -probesize 2147483647 -i input.flv -c:v libx264 output.mp4

I get below error from all above variants:

[flv @ 0xaaab0f4ec060] Packet mismatch 1703445535 198421 198574

[flv @0xaaab0f4ec060] Could not find codec parameters for stream 0 (Video: h264, none): unspecified size Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options

Input #0, flv, from 'input.flv': Duration: 00:00:07.12, start: 0.000000, bitrate: 16070 kb/s Stream #0:0: Video: h264, none, 1k tbr, 1k tbn

Output #0, mp4, to 'output.mp4': Output file #0 does not contain any stream

Please note that I cannot reproduce the video using vlc. I managed to reproduce the video after downloading FLV-Media-Player

I think my video needs some kind of pre-processing but have no idea how to go about this.

UPDATE:

Using MediaInfoOnline tool to process my flv video I got below information (no errors reported from the tool):

General
Complete name                            : input.flv
Format                                   : Flash Video
File size                                : 12.2 MiB
Overall bit rate mode                    : Constant
Video
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : High@L4
Format settings                          : CABAC / 1 Ref Frames
Format settings, CABAC                   : Yes
Format settings, Reference frames        : 1 frame
Codec ID                                 : 7
Bit rate mode                            : Constant
Bit rate                                 : 16.0 Mb/s
Width                                    : 1 920 pixels
Height                                   : 1 080 pixels
Display aspect ratio                     : 16:9
Frame rate mode                          : Variable
Standard                                 : NTSC
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Color range                              : Full
Color primaries                          : BT.709
Transfer characteristics                 : BT.709
Matrix coefficients                      : BT.709
9
  • You could try ffmpeg -analyzeduration 2147483647 -probesize 2147483647 -i input.flv -c:v libx264 output.mp4 which might work out here ?? Commented Sep 16, 2024 at 9:32
  • 1
    @Prem I have tried this as well. Same result. Commented Sep 16, 2024 at 12:27
  • (1) You could try online tools like mediaarea.net/MediaInfoOnline to check what is wrong with the media. (2) You could try to make the FLV Player make a copy with minor modifications , where the error may get automatically rectified, Commented Sep 16, 2024 at 15:21
  • 1
    It is then definitely confirmed that your media file is faulty. It is not related to ffmpeg. You could try converting with handbrake tool. Commented Sep 18, 2024 at 16:02
  • 1
    Best Course Of Action : [[1]] you could try to make flv player save a copy with minor modifications ( size , quality , volume , some thing else ) where that copy will not have the error , hence you can convert that later. [[2]] you could record the output of flv player to make a new media file. Commented Sep 20, 2024 at 7:36

1 Answer 1

1

I finally managed to get a working solution. I first installed flvmeta

$ git clone https://github.com/noirotm/flvmeta.git
$ cd flvmeta
$ cmake .
$ make
$ sudo make install

I then executed following command:

$ flvmeta -t -f input.flv output_meta.flv

After this, following command works as expected:

$ ffmpeg -i output_meta.flv -c:v libx264 -crf 19 -strict experimental output.mp4

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.