News:

--

Main Menu

Bug: Wrong FPS (r8473)

Started by Spellbinder, February 21, 2013, 01:01:53 PM

Previous topic - Next topic

Spellbinder

x264 Encoder messes up the Framerate of a file:

Avidemux 2.6.1 SVN r8473 (32-bit)

#PY  <- Needed to identify #
#--automatically built--

adm = Avidemux()
adm.loadVideo("I:/TEST/test_ORIGINAL.mp4")
adm.clearSegments()
adm.addSegment(0, 0, 147984000)
adm.markerA = 0
adm.markerB = 147984000
adm.videoCodec("x264", "general.params=2PASSBITRATE=1000", "general.threads=99", "general.fast_first_pass=True", "level=4294967295", "vui.sar_height=1", "vui.sar_width=1", "MaxRefFrames=3", "MinIdr=25", "MaxIdr=250", "i_scenecut_threshold=30"
, "intra_refresh=False", "MaxBFrame=16", "i_bframe_adaptive=2", "i_bframe_bias=0", "i_bframe_pyramid=2", "b_deblocking_filter=True", "i_deblocking_filter_alphac0=0", "i_deblocking_filter_beta=0", "cabac=True"
, "interlaced=False", "constrained_intra=False", "tff=True", "fake_interlaced=False", "analyze.b_8x8=True", "analyze.b_i4x4=True", "analyze.b_i8x8=True", "analyze.b_p8x8=False", "analyze.b_p16x16=True"
, "analyze.b_b16x16=True", "analyze.weighted_pred=2", "analyze.weighted_bipred=True", "analyze.direct_mv_pred=3", "analyze.chroma_offset=0", "analyze.me_method=2", "analyze.me_range=16", "analyze.mv_range=32"
, "analyze.mv_range_thread=-1", "analyze.subpel_refine=8", "analyze.chroma_me=True", "analyze.mixed_references=True", "analyze.trellis=2", "analyze.psy_rd=0.000000", "analyze.psy_trellis=0.000000", "analyze.fast_pskip=False"
, "analyze.dct_decimate=True", "analyze.noise_reduction=0", "analyze.psy=True", "analyze.intra_luma=21", "analyze.inter_luma=21", "ratecontrol.rc_method=0", "ratecontrol.qp_constant=0", "ratecontrol.qp_min=0"
, "ratecontrol.qp_max=69", "ratecontrol.qp_step=4", "ratecontrol.bitrate=0", "ratecontrol.rate_tolerance=1.000000", "ratecontrol.vbv_max_bitrate=0", "ratecontrol.vbv_buffer_size=0", "ratecontrol.vbv_buffer_init=0"
, "ratecontrol.ip_factor=1.400000", "ratecontrol.pb_factor=1.300000", "ratecontrol.aq_mode=2", "ratecontrol.aq_strength=1.000000", "ratecontrol.mb_tree=True", "ratecontrol.lookahead=50")
adm.audioClearTracks()
adm.audioAddTrack(0)
adm.audioCodec(0, "copy");
adm.audioSetDrc(0, 0)
adm.audioSetShift(0, 0,0)
adm.setContainer("MP4V2", "optimize=0", "add_itunes_metadata=0")

Original: http://rapidshare.com/files/3287447012/original_short.mp4
Encode: http://rapidshare.com/files/3639512902/test_x264_short.mp4

Frame rate mode                          : Variable
Frame rate                               : 13.220 fps
Original frame rate                      : 29.970 fps
Minimum frame rate                       : 9.986 fps
Maximum frame rate                       : 29.990 fps

twinsun

FPS are not wrong, both in original and encode files.
They just describe the files situation.
( see Topic 'B-Frames dropped' )

What is wrong, the bug, is B-frame dropped, when encode the file.
Some frames have double (or more) time length to keep time stamp, and thus can have 12,5 FPS instead of 25 FPS for example when original video is Constant Frame Rate.
If the original video have Variable Frame Rate, the result is what you have.

Your mp4 is another example of what I observe, and summarise here :
'Reply 25' in :  http://www.avidemux.org/smf/index.php?topic=11822

mean


Jan Gruuthuse

#3
.

mean

Try version > 8485 with preference -> trust timestamp -> dont trust

Spellbinder

#5
That worked!

http://rapidshare.com/files/4250121282/test_x264_notrust.mp4

Partial Trust worked as well

Spellbinder

Well, I celebrated to early, I just tried to encode a cut version of the complete file. No luck. Encoding looks fine up until the first cut point (I think). I will do some more tests tomorror...

mean

avoid cutting on b frame when trust = partial
only cut on intra when trust=no

Spellbinder

Thats the problem. I want to cut advertisment out of a video and have to cut at non I-Frames.

While cuttung under "no-trust" I had some strange frame behavior:

I could not navigate to certain frames I knew that where there. Or pressing the "Frame Foreward" and "Frame Backward" button right after another wouldnt end up at the same frame you started in.

So I tried this workaround:

1. Cut the video in "Trust" mode
2. Save Project
3. Set to "Dont Trust" mode and restart
4. Load Project and encode

The first video I did this way was fine! But the second one ended premeturly at one of the cut points.

So we are getting closer to solving the problem, but are not there yet :)

BTW: Thanks for all the great work you guys do on avidemux!

mean

The problem is that at the moment, only the decoding part is doing the trust/no trust part, but not the seeking part
I'm changing it so that it's global and automatic (i.e. no need to change settings)

mean

8487 contains most of the code to do it properly
Does it work ok ? including editing ?
If yes, i'll finish the code

Spellbinder

Appart from the cutting issues in "no Trust" mode mentioned above everything seemd to work fine.

mean

8487 has trust removed, now it is done in depth and should work including cutting

Spellbinder

great. i cant wait for the nightly build to test it :)

mean