Using avconv, when remuxing to MKV, is there a way to fix packed AVI input files?

A workaround is to convert to .mp4 first:

avconv -i input.avi -c copy temp.mp4
avconv -i temp.mp4 -c copy output.mkv
rm temp.mp4

Sadly, one cannot simply pipe the mp4 format between avconv instances: "[mp4 @ 0x80846c0] muxer does not support non seekable output"


As of this ticket #1979 at ffmpeg bugtracker the simplest solution is to have this bug fixed or to manually add -fflags +genpts to the command line.

I.e. change

ffmpeg -i inputfile_that_cant_be_muxed_into_mkv.ext -c copy out.mkv

to

ffmpeg -fflags +genpts -i inputfile_that_cant_be_muxed_into_mkv.ext -c copy out.mkv

Thanks to Andreas Cadhalpun ffmpeg now has new filter: mpeg4_unpack_bframes (see ref). This will allow you to get rid of the message: Invalid and inefficient vfw-avi packed B frames detected.

Usage is as simple as:

ffmpeg -i INPUT.avi -codec copy -bsf:v mpeg4_unpack_bframes OUTPUT.avi