Avidemux and h264 (with B Frames)

Started by ansgar, April 12, 2012, 02:54:23 PM

Previous topic - Next topic

ansgar

I have the following problem when cutting AVI files produced with x264 (either mencoder or ffmpeg) using avidemux 2.5.6:

When the file contains B-frames, the result of cutting is unpredictable. Depending on the previous position, I do not see the same frame when I navigate to a certain frame number. In addition, there is the error message:

error in FFMP43/mpeg4!: got picture

It seems that the bug is related to frame reordering. Via debugging, I have found the workaround below (setting frame reordering to 0) effective, but there should be a better solution. Can someone please investigate?

Best regards

Ansgar

--

-- avidemux/ADM_libraries/ffmpeg/libavcodec/h264_ps.c~ 2010-09-04 12:05:03.000000000 +0200
+++ avidemux/ADM_libraries/ffmpeg/libavcodec/h264_ps.c  2012-04-12 16:49:52.000000000 +0200
@@ -203,7 +203,7 @@
         get_ue_golomb(&s->gb); /* max_bits_per_mb_denom */
         get_ue_golomb(&s->gb); /* log2_max_mv_length_horizontal */
         get_ue_golomb(&s->gb); /* log2_max_mv_length_vertical */
-        sps->num_reorder_frames= get_ue_golomb(&s->gb);
+        sps->num_reorder_frames= 0;
         get_ue_golomb(&s->gb); /*max_dec_frame_buffering*/

         if(s->gb.size_in_bits < get_bits_count(&s->gb)){

styrol

QuoteWhen the file contains B-frames, the result of cutting is unpredictable. Depending on the previous position, I do not see the same frame when I navigate to a certain frame number.
You're right. This is a known problem.

h.264/B-Frames in AVI  are only supported through hacks. If you don't have to stick to AVI, use MP4 or MKV as container format for dealing with h.264 content.

For h.264 content try Avidemux 2.6.