Sunday, June 4, 2017

fixing B-frames ('packed B-frames') vids

mplayer warning

[mpeg4 @ 0xb7411fe0]Video uses a non-standard and wasteful way to store B-frames ('packed B-frames'). Consider using a tool like VirtualDub or avidemux to fix it.

You'd get this warning, and video wouldn't be playable (it'd be super slow in the video stream, while the audio is OK).

Suggested fix

ffmpeg -i input_vid.avi -codec copy -bsf:v mpeg4_unpack_bframes   output_vid.avi

(didn't work, still was super slow)

Work-around

You'll need: avidemux, ffmpeg

Steps
1. convert file to avi (mine were in ogm format)

ffmpeg -i $INPUT_FILE -codec copy $OUTPUT_FILE

2. separate audio

ffmpeg -i $INPUT_FILE  -vn $OUTPUT_FILE

3. open the avi file on avidemux -> choose audio -> disable sound tracks

4. merge audio and video in one final vid

ffmpeg -i $VID_FILE -i $AUDIO_FILE -codec copy -shortest $OUTPUT_FILE

You can then just remove all remaining files created during the process and just the one on step 4. It'll still show the warning, but the video will be watchable (it was for me at least).

Sociable