[Invalid] [SVN 2263] Incorrect Framerate

Archive of historical bug reports.
Please use the GitHub link above to report issues.
Forum rules
*******************************
Please be aware we are now using GitHub for issue tracking and feature requests.
- This section of the forum is now closed to new topics.

*******************************
downinitjr
Posts: 18
Joined: Wed Oct 01, 2008 1:23 am

[Invalid] [SVN 2263] Incorrect Framerate

Post by downinitjr »

Have noticed this with several files now. MediaInfo for mac reports source file as 23.976 fps. TV preset is being used with the exception of changing RF: value to 22, picture size to 1280 x * and turning off create chapter markers. The resulting .m4v file comes out as 40.961 fps? Anyone else seeing this, or knows whats happening here?

Code: Select all

HandBrake Activity Log for /Users/me/video1.m4v: 2009-03-23 05:55:23 -0500
Handbrake Version: svn2263 i386 (2009031701)

[05:55:23] macgui: incrementQueueItemDone currentQueueEncodeIndex is incremented to: 4
[05:55:23] macgui: incrementQueueItemDone currentQueueEncodeIndex is incremented to: 4
[05:55:23] macgui: scanning specifically for title: 1
[05:55:23] macgui: performNewQueueScan currentQueueEncodeIndex is: 4
[05:55:23] hb_scan: path=/Users/me/video1.mkv, title_index=1
[05:55:23] scan: trying to open with libdvdread
[05:55:23] dvd: not a dvd - trying as a stream/file instead
Input #0, matroska, from '/Users/me/video1.mkv':
  Duration: 01:31:55.55, start: 0.000000, bitrate: N/A
    Stream #0.0(eng): Video: h264, yuv420p, 1280x688, PAR 1:1 DAR 80:43, 24 tbr, 1k tbn, 47.95 tbc
    Stream #0.1: Audio: ac3, 48000 Hz, 5.1, s16
[05:55:24] scan: decoding previews for title 1
[05:55:24] scan: audio 0x1: AC-3, rate=48000Hz, bitrate=640000 Unknown (AC3) (5.1 ch)
[05:55:25] scan: 10 previews, 1280x688, 24.000 fps, autocrop = 0/0/0/0, aspect 16:9, PAR 1:1
[05:55:25] scan: title (0) job->width:1280, job->height:688
[05:55:25] libhb: scan thread found 1 valid title(s)
[05:55:25] macgui: currentScanCount received from fQueueEncodeLibhb
[05:55:25] macgui: ScanDone state received from fQueueEncodeLibhb
[05:55:25] macgui: processNewQueueEncode title list is: 1
[05:55:25] macgui: Preset: Custom
[05:55:25] macgui: processNewQueueEncode number of passes expected is: 1
[05:55:25] macgui: prepareJob audiotrack 2 is: 0
[05:55:25] macgui: prepareJob exiting
[05:55:25] 1 job(s) to process
[05:55:25] starting job
[05:55:25] job configuration:
[05:55:25]  * source
[05:55:25]    + /Users/me/video1.mkv
[05:55:25]    + title 1, chapter(s) 1 to 1
[05:55:25]    + container: matroska
[05:55:25]  * destination
[05:55:25]    + /Users/me/video1.m4v
[05:55:25]    + container: MPEG-4 (.mp4 and .m4v)
[05:55:25]      + 64-bit formatting
[05:55:25]  * video track
[05:55:25]    + decoder: h264
[05:55:25]    + frame rate: same as source (around 24.000 fps)
[05:55:25]    + loose anamorphic
[05:55:25]      + storage dimensions: 1280 * 688 -> 1280 * 688, crop 0/0/0/0
[05:55:25]      + pixel aspect ratio: 1 / 1
[05:55:25]      + display dimensions: 1280 * 688
[05:55:25]    + encoder: x264
[05:55:25]      + options: level=30:cabac=0:ref=3:mixed-refs=1:bframes=6:weightb=1:direct=auto:no-fast-pskip=1:me=umh:subq=7:analyse=all
[05:55:25]      + quality: 22.00 (RF)
[05:55:25]  * audio track 0
[05:55:25]    + decoder: Unknown (AC3) (5.1 ch) (track 1, id 1)
[05:55:25]      + bitrate: 640 kbps, samplerate: 48000 Hz
[05:55:25]    + mixdown: Dolby Pro Logic II
[05:55:25]    + dynamic range compression: 1.000000
[05:55:25]    + encoder: faac
[05:55:25]      + bitrate: 160 kbps, samplerate: 48000 Hz
[05:55:25]  * audio track 1
[05:55:25]    + decoder: Unknown (AC3) (5.1 ch) (track 1, id 1)
[05:55:25]      + bitrate: 640 kbps, samplerate: 48000 Hz
[05:55:25]    + AC3 passthrough
[05:55:25] dvd: not a dvd - trying as a stream/file instead
[05:55:25] encx264: keyint-min: 25, keyint-max: 241
[05:55:25] encx264: encoding with stored aspect 1/1
[05:55:25] encx264: Encoding at constant RF 22.000000
x264 [info]: using SAR=1/1
x264 [warning]: frame MB size (80x43) > level limit (1620)
x264 [warning]: DPB size (3 frames, 3962880 bytes) > level limit (2 frames, 3110400 bytes)
x264 [warning]: MB rate (82560) > level limit (40500)
x264 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 Cache64
x264 [info]: profile Main, level 3.0
No accelerated IMDCT transform found
[05:55:25] reader: first SCR 0
No accelerated IMDCT transform found
[05:55:25] sync: expecting 132397 video frames
[13:01:41] reader: done. 1 scr changes
[13:02:07] sync: got 132203 frames, 132397 expected
[13:02:07] work: average encoding speed for job is 5.163885 fps
[13:02:11] h264-decoder done: 132204 frames, 0 decoder errors, 0 drops
[13:02:11] render: lost time: 0 (0 frames)
[13:02:11] render: gained time: 0 (0 frames) (0 not accounted for)
x264 [info]: slice I:1757  Avg QP:17.54  size:103424  PSNR Mean Y:46.25 U:53.37 V:54.68 Avg:47.48 Global:46.45
x264 [info]: slice P:147687 Avg QP:19.96  size: 17514  PSNR Mean Y:43.64 U:50.59 V:51.66 Avg:44.85 Global:43.95
x264 [info]: slice B:76412 Avg QP:22.19  size:  6008  PSNR Mean Y:43.37 U:50.41 V:51.51 Avg:44.58 Global:43.99
x264 [info]: consecutive B-frames: 51.5%  7.3% 14.4% 13.2% 12.8%  0.8%  0.1%
x264 [info]: mb I  I16..4: 15.2%  0.0% 84.8%
x264 [info]: mb P  I16..4:  1.8%  0.0%  4.3%  P16..4: 41.6% 14.0%  5.1%  0.2%  0.3%    skip:32.8%
x264 [info]: mb B  I16..4:  0.5%  0.0%  0.7%  B16..8: 36.2%  1.3%  1.4%  direct: 3.5%  skip:56.5%  L0:29.6% L1:60.5% BI: 9.9%
x264 [info]: direct mvs  spatial:100.0%  temporal:0.0%
x264 [info]: ref P L0  81.4%  8.9%  9.7%
x264 [info]: ref B L0  76.0% 24.0%
x264 [info]: SSIM Mean Y:0.9822894
x264 [info]: PSNR Mean Y:43.568 U:50.553 V:51.632 Avg:44.784 Global:43.974 kb/s:2743.59
[13:02:11] libhb: work result = 0
jbrjake
Veteran User
Posts: 4805
Joined: Wed Dec 13, 2006 1:38 am

Re: [SVN 2263] Incorrect Framerate

Post by jbrjake »

....if you want a constant FPS, then select a constant FPS.

This is not a bug. Your source file must be VFR.
User avatar
Rodeo
HandBrake Team
Posts: 12619
Joined: Tue Mar 03, 2009 8:55 pm

Re: [Invalid] [SVN 2263] Incorrect Framerate

Post by Rodeo »

I've experienced similar results with Same as source frame rate.

I ran a test on a very short clip, from what was supposed to be a 23.976 fps source, and the resulting file is reported as 35.82 fps by QuickTime.

Code: Select all

HandBrake Activity Log for /Users/tim/Desktop/Test.mp4: 2009-03-24 20:03:17 +0100
Handbrake Version: 0.9.3 (2008112300)

[20:03:17] macgui: Rip: Pending queue count is 0
[20:03:17] macgui: Rip: No pending jobs, so sending this one to doAddToQueue
[20:03:17] macgui: Rip: Going right to performNewQueueScan
[20:03:17] macgui: scanning specifically for title: 1
[20:03:17] macgui: performNewQueueScan currentQueueEncodeIndex is: 0
[20:03:17] hb_scan: path=/Users/tim/Desktop/Test.mpeg, title_index=1
[20:03:17] scan: trying to open with libdvdread
[20:03:17] dvd: not a dvd - trying as a stream/file instead
Input #0, mpeg, from '/Users/tim/Desktop/Test.mpeg':
  Duration: 00:00:06.97, start: 563.731600, bitrate: 4231 kb/s
    Stream #0.0[0x1e0]: Video: mpeg2video, yuv420p, 720x480 [PAR 32:27 DAR 16:9], 9801 kb/s, 59.94 tb(r)
    Stream #0.1[0x80]: Audio: ac3, 48000 Hz, stereo, s16, 192 kb/s
    Stream #0.2[0x81]: Audio: ac3, 48000 Hz, stereo, s16, 192 kb/s
    Stream #0.3[0x82]: Audio: ac3, 48000 Hz, stereo, s16, 192 kb/s
[20:03:17] scan: decoding previews for title 1
[20:03:17] scan: audio 0x1: AC-3, rate=48000Hz, bitrate=192000 Unknown (AC3) (Dolby Surround)
[20:03:17] scan: audio 0x2: AC-3, rate=48000Hz, bitrate=192000 Unknown (AC3) (Dolby Surround)
[20:03:17] scan: audio 0x3: AC-3, rate=48000Hz, bitrate=192000 Unknown (AC3) (Dolby Surround)
[20:03:17] scan: 10 previews, 720x480, 59.940 fps, autocrop = 0/0/0/0, aspect 16:9, PAR 32:27
[20:03:17] scan: title (0) job->width:720, job->height:400
[20:03:17] libhb: scan thread found 1 valid title(s)
[20:03:17] macgui: ScanDone state received from fQueueEncodeLibhb
[20:03:17] macgui: processNewQueueEncode title list is: 1
[20:03:17] macgui: Preset: Constant Quality
[20:03:17] macgui: processNewQueueEncode number of passes expected is: 1
[20:03:17] macgui: prepareJob exiting
[20:03:17] 1 job(s) to process
[20:03:17] starting job
[20:03:17] job configuration:
[20:03:17]  * source
[20:03:17]    + /Users/tim/Desktop/Test.mpeg
[20:03:17]    + title 1, chapter(s) 1 to 1
[20:03:17]    + container: mpeg
[20:03:17]    + data rate: 4231 kbps
[20:03:17]  * destination
[20:03:17]    + /Users/tim/Desktop/Test.mp4
[20:03:17]    + container: MPEG-4 (.mp4 and .m4v)
[20:03:17]  * video track
[20:03:17]    + decoder: mpeg2video
[20:03:17]      + bitrate 9801 kbps
[20:03:17]    + frame rate: same as source (around 59.940 fps)
[20:03:17]    + strict anamorphic
[20:03:17]      + storage dimensions: 720 * 480 -> 720 * 480, crop 0/0/0/0
[20:03:17]      + pixel aspect ratio: 32 / 27
[20:03:17]      + display dimensions: 853 * 480
[20:03:17]    + filter
[20:03:17]      + Deinterlaces selectively with yadif/mcdeint and lowpass5 blending (1:2:6:9:80:16:16)
[20:03:17]    + encoder: x264
[20:03:17]      + options: ref=3:me=umh:mixed-refs=1:subq=7:bframes=3:no-fast-pskip=1:psy-rd=0.2,0:b-adapt=1:no-psnr=1:analyse=all:b-pyramid=1
[20:03:17]      + quality: 0.65
[20:03:17] dvd: not a dvd - trying as a stream/file instead
[20:03:17] yadif thread started for segment 0
[20:03:17] yadif thread started for segment 1
[20:03:17] encx264: keyint-min: 60, keyint-max: 600
[20:03:17] reader: first SCR 50735844
[20:03:17] decomb thread started for segment 0
[20:03:17] decomb thread started for segment 1
[20:03:17] encx264: encoding with stored aspect 32/27
[20:03:17] encx264: Encoding at constant RF 17.850002
x264 [info]: using SAR=32/27
x264 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 Cache64
x264 [info]: profile Main, level 3.1
[20:03:17] sync: expecting 478 video frames
[20:03:17] reader: done. 1 scr changes
[20:03:17] sync: first pts is 10510
[20:03:27] sync: video time didn't advance - dropped 1 frames (delta 0 ms, current 618620, next 623125, dur 4505)
[20:03:27] sync: got 164 frames, 478 expected
[20:03:27] work: average encoding speed for job is 17.178442 fps
[20:03:30] mpeg2video-decoder done: 166 frames, 0 decoder errors, 0 drops
[20:03:30] render: lost time: 0 (0 frames)
[20:03:30] render: gained time: 0 (0 frames) (0 not accounted for)
x264 [info]: slice I:1     Avg QP:12.95  size: 65780
x264 [info]: slice P:122   Avg QP:14.09  size: 17114
x264 [info]: slice B:125   Avg QP:16.28  size:  2514
x264 [info]: consecutive B-frames: 32.4%  0.0%  1.2% 66.4%
x264 [info]: mb I  I16..4: 30.3%  0.0% 69.7%
x264 [info]: mb P  I16..4:  7.3%  0.0%  3.1%  P16..4: 35.2% 15.4% 11.8%  0.3%  0.9%    skip:26.0%
x264 [info]: mb B  I16..4:  0.1%  0.0%  0.0%  B16..8: 33.6%  0.8%  1.9%  direct: 5.3%  skip:58.2%  L0:34.5% L1:55.0% BI:10.6%
x264 [info]: ref P L0  77.7% 11.1% 11.2%
x264 [info]: ref B L0  96.3%  3.7%
x264 [info]: ref B L1  92.9%  7.1%
x264 [info]: SSIM Mean Y:0.9888166
x264 [info]: kb/s:4771.9
[20:03:30] decomb: yadif deinterlaced 0 | blend deinterlaced 0 | unfiltered 163 | total 163
[20:03:30] libhb: work result = 0
So my source is VFR, OK.

But then, I ran a deinterlace with JES Deinterlacer (because it reports what appears to be the total number of frames while deinterlacing), on the source Test.mpeg file and on the Test.mp4 produced by HandBrake. It seems that they could have a different number of frames: 163 frames are reported for the original, and 248 for the file produced by HandBrake. The HandBrake encode log, however, seems to report 163 frames like the source.

But then why is JES Deinterlacer trying to deinterlace 248 frames? What other utility can I use to check the total number of frames for the source and destination files (I used JES Deinterlacer because I don't know anything else, but it's not designed for that purpose)?

Also, I've noticed that Test.mp4 gives a "No valid title found" error when you try to select it as a source in HandBrake.
User avatar
Rodeo
HandBrake Team
Posts: 12619
Joined: Tue Mar 03, 2009 8:55 pm

Re: [Invalid] [SVN 2263] Incorrect Framerate

Post by Rodeo »

I just did an encode of Test.mpeg with FFmpeg instead of x264 and QuickTime reports the file as being 23.54 fps?

Code: Select all

HandBrake Activity Log for /Users/tim/Desktop/Test ffmpeg.mp4: 2009-03-24 20:41:39 +0100
Handbrake Version: 0.9.3 (2008112300)

[20:41:39] macgui: Rip: Pending queue count is 0
[20:41:39] macgui: Rip: No pending jobs, so sending this one to doAddToQueue
[20:41:39] macgui: Rip: Going right to performNewQueueScan
[20:41:39] macgui: scanning specifically for title: 1
[20:41:39] macgui: performNewQueueScan currentQueueEncodeIndex is: 6
[20:41:39] hb_scan: path=/Users/tim/Desktop/Test.mpeg, title_index=1
[20:41:39] scan: trying to open with libdvdread
[20:41:39] dvd: not a dvd - trying as a stream/file instead
Input #0, mpeg, from '/Users/tim/Desktop/Test.mpeg':
  Duration: 00:00:06.97, start: 563.731600, bitrate: 4231 kb/s
    Stream #0.0[0x1e0]: Video: mpeg2video, yuv420p, 720x480 [PAR 32:27 DAR 16:9], 9801 kb/s, 59.94 tb(r)
    Stream #0.1[0x80]: Audio: ac3, 48000 Hz, stereo, s16, 192 kb/s
    Stream #0.2[0x81]: Audio: ac3, 48000 Hz, stereo, s16, 192 kb/s
    Stream #0.3[0x82]: Audio: ac3, 48000 Hz, stereo, s16, 192 kb/s
[20:41:39] scan: decoding previews for title 1
[20:41:39] scan: audio 0x1: AC-3, rate=48000Hz, bitrate=192000 Unknown (AC3) (Dolby Surround)
[20:41:39] scan: audio 0x2: AC-3, rate=48000Hz, bitrate=192000 Unknown (AC3) (Dolby Surround)
[20:41:39] scan: audio 0x3: AC-3, rate=48000Hz, bitrate=192000 Unknown (AC3) (Dolby Surround)
[20:41:39] scan: 10 previews, 720x480, 59.940 fps, autocrop = 0/0/0/0, aspect 16:9, PAR 32:27
[20:41:39] scan: title (0) job->width:720, job->height:400
[20:41:39] libhb: scan thread found 1 valid title(s)
[20:41:39] macgui: currentScanCount received from fQueueEncodeLibhb
[20:41:39] macgui: ScanDone state received from fQueueEncodeLibhb
[20:41:39] macgui: processNewQueueEncode title list is: 1
[20:41:39] macgui: Preset: Custom
[20:41:39] macgui: processNewQueueEncode number of passes expected is: 1
[20:41:39] macgui: prepareJob exiting
[20:41:39] 1 job(s) to process
[20:41:39] starting job
[20:41:39] job configuration:
[20:41:39]  * source
[20:41:39]    + /Users/tim/Desktop/Test.mpeg
[20:41:39]    + title 1, chapter(s) 1 to 1
[20:41:39]    + container: mpeg
[20:41:39]    + data rate: 4231 kbps
[20:41:39]  * destination
[20:41:39]    + /Users/tim/Desktop/Test ffmpeg.mp4
[20:41:39]    + container: MPEG-4 (.mp4 and .m4v)
[20:41:39]  * video track
[20:41:39]    + decoder: mpeg2video
[20:41:39]      + bitrate 9801 kbps
[20:41:39]    + frame rate: same as source (around 59.940 fps)
[20:41:39]    + strict anamorphic
[20:41:39]      + storage dimensions: 720 * 480 -> 720 * 480, crop 0/0/0/0
[20:41:39]      + pixel aspect ratio: 32 / 27
[20:41:39]      + display dimensions: 853 * 480
[20:41:39]    + filter
[20:41:39]      + Deinterlaces selectively with yadif/mcdeint and lowpass5 blending (1:2:6:9:80:16:16)
[20:41:39]    + encoder: FFmpeg
[20:41:39]      + quality: 1.00
[20:41:39] dvd: not a dvd - trying as a stream/file instead
[20:41:39] yadif thread started for segment 0
[20:41:39] decomb thread started for segment 0
[20:41:39] yadif thread started for segment 1
[20:41:39] decomb thread started for segment 1
[20:41:39] encavcodec: encoding at constant quantizer 118
[20:41:39] encavcodec: encoding with stored aspect 32/27
[20:41:39] sync: expecting 478 video frames
[20:41:39] reader: first SCR 50735844
[20:41:40] reader: done. 1 scr changes
[20:41:40] sync: first pts is 10510
[20:41:41] sync: video time didn't advance - dropped 1 frames (delta 0 ms, current 618620, next 623125, dur 4505)
[20:41:41] sync: got 164 frames, 478 expected
[20:41:41] work: average encoding speed for job is 0.000000 fps
[20:41:41] mpeg2video-decoder done: 166 frames, 0 decoder errors, 0 drops
[20:41:41] render: lost time: 0 (0 frames)
[20:41:41] render: gained time: 0 (0 frames) (0 not accounted for)
[20:41:41] decomb: yadif deinterlaced 0 | blend deinterlaced 0 | unfiltered 163 | total 163
[20:41:42] libhb: work result = 0
jbrjake
Veteran User
Posts: 4805
Joined: Wed Dec 13, 2006 1:38 am

Re: [Invalid] [SVN 2263] Incorrect Framerate

Post by jbrjake »

Rodeo wrote:supposed to be a 23.976 fps source
Rodeo wrote: Stream #0.0[0x1e0]: Video: mpeg2video, yuv420p, 720x480 [PAR 32:27 DAR 16:9], 9801 kb/s, 59.94 tb(r)
Rodeo wrote:[20:03:17] + frame rate: same as source (around 59.940 fps)
User avatar
Rodeo
HandBrake Team
Posts: 12619
Joined: Tue Mar 03, 2009 8:55 pm

Re: [Invalid] [SVN 2263] Incorrect Framerate

Post by Rodeo »

I noticed that (around 59.940 fps), but couldn't it be that this is incorrect? The data rate clearly isn't 9.8 Mbps either.

What does this line mean, for example?

Code: Select all

[20:41:41] sync: got 164 frames, 478 expected
Also, why do I get a different framerate for the destination file when I encode using ffmpeg (23.54 fps) vs. x264 (35.82 fps, or 23.54*248/163)?
jbrjake
Veteran User
Posts: 4805
Joined: Wed Dec 13, 2006 1:38 am

Re: [Invalid] [SVN 2263] Incorrect Framerate

Post by jbrjake »

Rodeo wrote:I noticed that (around 59.940 fps), but couldn't it be that this is incorrect? The data rate clearly isn't 9.8 Mbps either.
The data rate field is inaccurate (I just haven't gotten rid of removing it yet) but that has nothing to do with the FPS. My question is, why are you saying the source is "supposed" to be 23.976 when there's nothing to indicate that?
What does this line mean, for example?

Code: Select all

[20:41:41] sync: got 164 frames, 478 expected
It means that based on the stated framerate and duration of the file, 478 frames were expected, and it didn't get anywhere near that many, since your source doesn't follow the stated framerate, because it's VFR.
Also, why do I get a different framerate for the destination file when I encode using ffmpeg (23.54 fps) vs. x264 (35.82 fps, or 23.54*248/163)?
I would assume something to do with the init_delay and track edit used to maintain AV sync when using B-frames having a large influence on the calculated FPS in QuickTime, averaging over such a small total number of frames.
User avatar
Rodeo
HandBrake Team
Posts: 12619
Joined: Tue Mar 03, 2009 8:55 pm

Re: [Invalid] [SVN 2263] Incorrect Framerate

Post by Rodeo »

jbrjake wrote:
Rodeo wrote:I noticed that (around 59.940 fps), but couldn't it be that this is incorrect? The data rate clearly isn't 9.8 Mbps either.
The data rate field is inaccurate (I just haven't gotten rid of removing it yet) but that has nothing to do with the FPS. My question is, why are you saying the source is "supposed" to be 23.976 when there's nothing to indicate that?
It's the Stargate SG-1 pilot episode (again), which I ripped from an NTSC DVD. First, I opened it in Streamclip and extracted a very short clip which I saved using "Convert to MPEG". That MPEG file is reported as 23.976 fps in QuickTime.
jbrjake
Veteran User
Posts: 4805
Joined: Wed Dec 13, 2006 1:38 am

Re: [Invalid] [SVN 2263] Incorrect Framerate

Post by jbrjake »

Then I must presume your issue is with your choice of extraction tools.
User avatar
Rodeo
HandBrake Team
Posts: 12619
Joined: Tue Mar 03, 2009 8:55 pm

Re: [Invalid] [SVN 2263] Incorrect Framerate

Post by Rodeo »

jbrjake wrote:Then I must presume your issue is with your choice of extraction tools.
So you're saying my file is not even around 23.976 fps?
jbrjake
Veteran User
Posts: 4805
Joined: Wed Dec 13, 2006 1:38 am

Re: [Invalid] [SVN 2263] Incorrect Framerate

Post by jbrjake »

I'm saying that, apparently, Streamclip is signaling an incorrect FPS for its output, leading sync to expect a wildly increased number of frames.

As I already told you, QuickTime does not work off the signaled FPS, but rather displays an accurate calculation of the average fps based on individual frame durations and total frame count.
User avatar
Rodeo
HandBrake Team
Posts: 12619
Joined: Tue Mar 03, 2009 8:55 pm

Re: [Invalid] [SVN 2263] Incorrect Framerate

Post by Rodeo »

Interestingly, I hadn't though of Streamclip as the source of the issue. I've only used it to get a very short sample of the episode out of the VIDEO_TS folder. I guess it could be the reason my video is reported as 59.94 fps.

However, I don't think that's causing the issue. I've done 4 more encodes:

First, using x264 defaults

Code: Select all

HandBrake Activity Log for /Users/tim/Desktop/Test.mp4: 2009-03-27 23:37:02 +0100
Handbrake Version: 0.9.3 (2008112300)

[23:37:02] macgui: Rip: Pending queue count is 0
[23:37:02] macgui: Rip: No pending jobs, so sending this one to doAddToQueue
[23:37:02] macgui: Rip: Going right to performNewQueueScan
[23:37:02] macgui: scanning specifically for title: 1
[23:37:02] macgui: performNewQueueScan currentQueueEncodeIndex is: 0
[23:37:02] hb_scan: path=/Users/tim/Desktop/Frames/Test.mpeg, title_index=1
[23:37:02] scan: trying to open with libdvdread
[23:37:02] dvd: not a dvd - trying as a stream/file instead
Input #0, mpeg, from '/Users/tim/Desktop/Frames/Test.mpeg':
  Duration: 00:00:06.97, start: 563.731600, bitrate: 4231 kb/s
    Stream #0.0[0x1e0]: Video: mpeg2video, yuv420p, 720x480 [PAR 32:27 DAR 16:9], 9801 kb/s, 59.94 tb(r)
    Stream #0.1[0x80]: Audio: ac3, 48000 Hz, stereo, s16, 192 kb/s
    Stream #0.2[0x81]: Audio: ac3, 48000 Hz, stereo, s16, 192 kb/s
    Stream #0.3[0x82]: Audio: ac3, 48000 Hz, stereo, s16, 192 kb/s
[23:37:02] scan: decoding previews for title 1
[23:37:02] scan: audio 0x1: AC-3, rate=48000Hz, bitrate=192000 Unknown (AC3) (Dolby Surround)
[23:37:02] scan: audio 0x2: AC-3, rate=48000Hz, bitrate=192000 Unknown (AC3) (Dolby Surround)
[23:37:02] scan: audio 0x3: AC-3, rate=48000Hz, bitrate=192000 Unknown (AC3) (Dolby Surround)
[23:37:02] scan: 10 previews, 720x480, 59.940 fps, autocrop = 0/0/0/0, aspect 16:9, PAR 32:27
[23:37:02] scan: title (0) job->width:720, job->height:400
[23:37:02] libhb: scan thread found 1 valid title(s)
[23:37:02] macgui: ScanDone state received from fQueueEncodeLibhb
[23:37:02] macgui: processNewQueueEncode title list is: 1
[23:37:02] macgui: Preset: Constant Quality
[23:37:02] macgui: processNewQueueEncode number of passes expected is: 1
[23:37:02] macgui: prepareJob exiting
[23:37:02] 1 job(s) to process
[23:37:02] starting job
[23:37:02] job configuration:
[23:37:02]  * source
[23:37:02]    + /Users/tim/Desktop/Frames/Test.mpeg
[23:37:02]    + title 1, chapter(s) 1 to 1
[23:37:02]    + container: mpeg
[23:37:02]    + data rate: 4231 kbps
[23:37:02]  * destination
[23:37:02]    + /Users/tim/Desktop/Test.mp4
[23:37:02]    + container: MPEG-4 (.mp4 and .m4v)
[23:37:02]  * video track
[23:37:02]    + decoder: mpeg2video
[23:37:02]      + bitrate 9801 kbps
[23:37:02]    + frame rate: same as source (around 59.940 fps)
[23:37:02]    + strict anamorphic
[23:37:02]      + storage dimensions: 720 * 480 -> 720 * 480, crop 0/0/0/0
[23:37:02]      + pixel aspect ratio: 32 / 27
[23:37:02]      + display dimensions: 853 * 480
[23:37:02]    + filter
[23:37:02]      + Deinterlaces selectively with yadif/mcdeint and lowpass5 blending (1:2:6:9:80:16:16)
[23:37:02]    + encoder: x264
[23:37:02]      + quality: 0.65
[23:37:02]  * audio track 0
[23:37:02]    + decoder: Unknown (AC3) (Dolby Surround) (track 1, id 1)
[23:37:02]      + bitrate: 192 kbps, samplerate: 48000 Hz
[23:37:02]    + mixdown: Dolby Surround
[23:37:02]    + encoder: faac
[23:37:02]      + bitrate: 128 kbps, samplerate: 48000 Hz
[23:37:02] dvd: not a dvd - trying as a stream/file instead
[23:37:02] yadif thread started for segment 0
[23:37:02] yadif thread started for segment 1
[23:37:02] decomb thread started for segment 0
[23:37:02] decomb thread started for segment 1
[23:37:02] encx264: keyint-min: 60, keyint-max: 600
[23:37:02] encx264: encoding with stored aspect 32/27
[23:37:02] encx264: Encoding at constant RF 17.850002
x264 [info]: using SAR=32/27
x264 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 Cache64
x264 [info]: profile Main, level 3.1
No accelerated IMDCT transform found
[23:37:02] reader: first SCR 50735844
[23:37:02] sync: expecting 478 video frames
[23:37:02] sync: first pts is 10510
[23:37:04] reader: done. 1 scr changes
[23:37:08] sync: video time didn't advance - dropped 1 frames (delta 0 ms, current 618620, next 623125, dur 4505)
[23:37:09] sync: got 164 frames, 478 expected
[23:37:09] work: average encoding speed for job is 26.466263 fps
[23:37:10] mpeg2video-decoder done: 166 frames, 0 decoder errors, 0 drops
[23:37:10] render: lost time: 0 (0 frames)
[23:37:10] render: gained time: 0 (0 frames) (0 not accounted for)
x264 [info]: slice I:1     Avg QP:12.95  size: 67877  PSNR Mean Y:49.24 U:51.68 V:52.64 Avg:50.01 Global:50.01
x264 [info]: slice P:162   Avg QP:15.04  size: 16086  PSNR Mean Y:46.60 U:48.00 V:49.18 Avg:47.15 Global:47.15
x264 [info]: mb I  I16..4: 20.9%  0.0% 79.1%
x264 [info]: mb P  I16..4:  0.7%  0.0%  1.6%  P16..4: 48.3% 24.4% 21.3%  0.0%  0.0%    skip: 3.7%
x264 [info]: SSIM Mean Y:0.9872625
x264 [info]: PSNR Mean Y:46.615 U:48.019 V:49.198 Avg:47.172 Global:47.162 kb/s:7865.87
[23:37:10] decomb: yadif deinterlaced 0 | blend deinterlaced 0 | unfiltered 163 | total 163
[23:37:10] libhb: work result = 0
QuickTime reports 23.54 fps for this encode.

Then, adding b-frames

Code: Select all

HandBrake Activity Log for /Users/tim/Desktop/Test bframes.mp4: 2009-03-27 23:37:57 +0100
Handbrake Version: 0.9.3 (2008112300)

[23:37:57] macgui: Rip: Pending queue count is 0
[23:37:57] macgui: Rip: No pending jobs, so sending this one to doAddToQueue
[23:37:57] macgui: Rip: Going right to performNewQueueScan
[23:37:57] macgui: scanning specifically for title: 1
[23:37:57] macgui: performNewQueueScan currentQueueEncodeIndex is: 1
[23:37:57] hb_scan: path=/Users/tim/Desktop/Frames/Test.mpeg, title_index=1
[23:37:57] scan: trying to open with libdvdread
[23:37:57] dvd: not a dvd - trying as a stream/file instead
Input #0, mpeg, from '/Users/tim/Desktop/Frames/Test.mpeg':
  Duration: 00:00:06.97, start: 563.731600, bitrate: 4231 kb/s
    Stream #0.0[0x1e0]: Video: mpeg2video, yuv420p, 720x480 [PAR 32:27 DAR 16:9], 9801 kb/s, 59.94 tb(r)
    Stream #0.1[0x80]: Audio: ac3, 48000 Hz, stereo, s16, 192 kb/s
    Stream #0.2[0x81]: Audio: ac3, 48000 Hz, stereo, s16, 192 kb/s
    Stream #0.3[0x82]: Audio: ac3, 48000 Hz, stereo, s16, 192 kb/s
[23:37:57] scan: decoding previews for title 1
[23:37:57] scan: audio 0x1: AC-3, rate=48000Hz, bitrate=192000 Unknown (AC3) (Dolby Surround)
[23:37:57] scan: audio 0x2: AC-3, rate=48000Hz, bitrate=192000 Unknown (AC3) (Dolby Surround)
[23:37:57] scan: audio 0x3: AC-3, rate=48000Hz, bitrate=192000 Unknown (AC3) (Dolby Surround)
[23:37:57] scan: 10 previews, 720x480, 59.940 fps, autocrop = 0/0/0/0, aspect 16:9, PAR 32:27
[23:37:57] scan: title (0) job->width:720, job->height:400
[23:37:57] libhb: scan thread found 1 valid title(s)
[23:37:57] macgui: currentScanCount received from fQueueEncodeLibhb
[23:37:57] macgui: ScanDone state received from fQueueEncodeLibhb
[23:37:57] macgui: processNewQueueEncode title list is: 1
[23:37:57] macgui: Preset: Constant Quality
[23:37:57] macgui: processNewQueueEncode number of passes expected is: 1
[23:37:57] macgui: prepareJob exiting
[23:37:57] 1 job(s) to process
[23:37:57] starting job
[23:37:57] job configuration:
[23:37:57]  * source
[23:37:57]    + /Users/tim/Desktop/Frames/Test.mpeg
[23:37:57]    + title 1, chapter(s) 1 to 1
[23:37:57]    + container: mpeg
[23:37:57]    + data rate: 4231 kbps
[23:37:57]  * destination
[23:37:57]    + /Users/tim/Desktop/Test bframes.mp4
[23:37:57]    + container: MPEG-4 (.mp4 and .m4v)
[23:37:57]  * video track
[23:37:57]    + decoder: mpeg2video
[23:37:57]      + bitrate 9801 kbps
[23:37:57]    + frame rate: same as source (around 59.940 fps)
[23:37:57]    + strict anamorphic
[23:37:57]      + storage dimensions: 720 * 480 -> 720 * 480, crop 0/0/0/0
[23:37:57]      + pixel aspect ratio: 32 / 27
[23:37:57]      + display dimensions: 853 * 480
[23:37:57]    + filter
[23:37:57]      + Deinterlaces selectively with yadif/mcdeint and lowpass5 blending (1:2:6:9:80:16:16)
[23:37:57]    + encoder: x264
[23:37:57]      + options: bframes=2
[23:37:57]      + quality: 0.65
[23:37:57]  * audio track 0
[23:37:57]    + decoder: Unknown (AC3) (Dolby Surround) (track 1, id 1)
[23:37:57]      + bitrate: 192 kbps, samplerate: 48000 Hz
[23:37:57]    + mixdown: Dolby Surround
[23:37:57]    + encoder: faac
[23:37:57]      + bitrate: 128 kbps, samplerate: 48000 Hz
[23:37:57] dvd: not a dvd - trying as a stream/file instead
[23:37:57] yadif thread started for segment 0
[23:37:57] decomb thread started for segment 0
[23:37:57] decomb thread started for segment 1
[23:37:57] encx264: keyint-min: 60, keyint-max: 600
[23:37:57] encx264: encoding with stored aspect 32/27
[23:37:57] encx264: Encoding at constant RF 17.850002
x264 [info]: using SAR=32/27
x264 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 Cache64
[23:37:57] yadif thread started for segment 1
x264 [info]: profile Main, level 3.1
[23:37:57] reader: first SCR 50735844
No accelerated IMDCT transform found
[23:37:57] sync: expecting 478 video frames
[23:37:57] sync: first pts is 10510
[23:37:58] reader: done. 1 scr changes
[23:38:07] sync: video time didn't advance - dropped 1 frames (delta 0 ms, current 618620, next 623125, dur 4505)
[23:38:07] sync: got 164 frames, 478 expected
[23:38:07] work: average encoding speed for job is 16.142557 fps
[23:38:10] mpeg2video-decoder done: 166 frames, 0 decoder errors, 0 drops
[23:38:10] render: lost time: 0 (0 frames)
[23:38:10] render: gained time: 0 (0 frames) (0 not accounted for)
x264 [info]: slice I:1     Avg QP:12.95  size: 67877  PSNR Mean Y:49.24 U:51.68 V:52.64 Avg:50.01 Global:50.01
x264 [info]: slice P:247   Avg QP:13.02  size: 17193  PSNR Mean Y:48.01 U:49.42 V:50.45 Avg:48.55 Global:48.54
x264 [info]: slice B:167   Avg QP:14.48  size:  1369  PSNR Mean Y:48.18 U:49.62 V:50.61 Avg:48.72 Global:48.71
x264 [info]: consecutive B-frames: 39.4%  0.5% 60.1%
x264 [info]: mb I  I16..4: 20.9%  0.0% 79.1%
x264 [info]: mb P  I16..4:  1.2%  0.0%  2.0%  P16..4: 49.6% 16.0% 17.3%  0.0%  0.0%    skip:14.0%
x264 [info]: mb B  I16..4:  0.1%  0.0%  0.0%  B16..8: 21.2%  0.4%  0.3%  direct:28.2%  skip:49.8%  L0:85.9% L1: 6.1% BI: 8.1%
x264 [info]: SSIM Mean Y:0.9906284
x264 [info]: PSNR Mean Y:48.078 U:49.508 V:50.522 Avg:48.624 Global:48.614 kb/s:5249.43
[23:38:10] decomb: yadif deinterlaced 0 | blend deinterlaced 0 | unfiltered 163 | total 163
[23:38:10] libhb: work result = 0
QuickTime reports 59.94 fps for this encode.

Keep b-frames and add b-pyramid

Code: Select all

HandBrake Activity Log for /Users/tim/Desktop/Test bframes bpyramid.mp4: 2009-03-27 23:46:58 +0100
Handbrake Version: 0.9.3 (2008112300)

[23:46:58] macgui: Rip: Pending queue count is 0
[23:46:58] macgui: Rip: No pending jobs, so sending this one to doAddToQueue
[23:46:58] macgui: Rip: Going right to performNewQueueScan
[23:46:58] macgui: scanning specifically for title: 1
[23:46:58] macgui: performNewQueueScan currentQueueEncodeIndex is: 0
[23:46:58] hb_scan: path=/Users/tim/Desktop/Frames/Test.mpeg, title_index=1
[23:46:58] scan: trying to open with libdvdread
[23:46:58] dvd: not a dvd - trying as a stream/file instead
Input #0, mpeg, from '/Users/tim/Desktop/Frames/Test.mpeg':
  Duration: 00:00:06.97, start: 563.731600, bitrate: 4231 kb/s
    Stream #0.0[0x1e0]: Video: mpeg2video, yuv420p, 720x480 [PAR 32:27 DAR 16:9], 9801 kb/s, 59.94 tb(r)
    Stream #0.1[0x80]: Audio: ac3, 48000 Hz, stereo, s16, 192 kb/s
    Stream #0.2[0x81]: Audio: ac3, 48000 Hz, stereo, s16, 192 kb/s
    Stream #0.3[0x82]: Audio: ac3, 48000 Hz, stereo, s16, 192 kb/s
[23:46:58] scan: decoding previews for title 1
[23:46:58] scan: audio 0x1: AC-3, rate=48000Hz, bitrate=192000 Unknown (AC3) (Dolby Surround)
[23:46:58] scan: audio 0x2: AC-3, rate=48000Hz, bitrate=192000 Unknown (AC3) (Dolby Surround)
[23:46:58] scan: audio 0x3: AC-3, rate=48000Hz, bitrate=192000 Unknown (AC3) (Dolby Surround)
[23:46:59] scan: 10 previews, 720x480, 59.940 fps, autocrop = 0/0/0/0, aspect 16:9, PAR 32:27
[23:46:59] scan: title (0) job->width:720, job->height:400
[23:46:59] libhb: scan thread found 1 valid title(s)
[23:46:59] macgui: ScanDone state received from fQueueEncodeLibhb
[23:46:59] macgui: processNewQueueEncode title list is: 1
[23:46:59] macgui: Preset: Constant Quality
[23:46:59] macgui: processNewQueueEncode number of passes expected is: 1
[23:46:59] macgui: prepareJob exiting
[23:46:59] 1 job(s) to process
[23:46:59] starting job
[23:46:59] job configuration:
[23:46:59]  * source
[23:46:59]    + /Users/tim/Desktop/Frames/Test.mpeg
[23:46:59]    + title 1, chapter(s) 1 to 1
[23:46:59]    + container: mpeg
[23:46:59]    + data rate: 4231 kbps
[23:46:59]  * destination
[23:46:59]    + /Users/tim/Desktop/Test bframes bpyramid.mp4
[23:46:59]    + container: MPEG-4 (.mp4 and .m4v)
[23:46:59]  * video track
[23:46:59]    + decoder: mpeg2video
[23:46:59]      + bitrate 9801 kbps
[23:46:59]    + frame rate: same as source (around 59.940 fps)
[23:46:59]    + strict anamorphic
[23:46:59]      + storage dimensions: 720 * 480 -> 720 * 480, crop 0/0/0/0
[23:46:59]      + pixel aspect ratio: 32 / 27
[23:46:59]      + display dimensions: 853 * 480
[23:46:59]    + filter
[23:46:59]      + Deinterlaces selectively with yadif/mcdeint and lowpass5 blending (1:2:6:9:80:16:16)
[23:46:59]    + encoder: x264
[23:46:59]      + options: bframes=2:b-pyramid=1
[23:46:59]      + quality: 0.65
[23:46:59]  * audio track 0
[23:46:59]    + decoder: Unknown (AC3) (Dolby Surround) (track 1, id 1)
[23:46:59]      + bitrate: 192 kbps, samplerate: 48000 Hz
[23:46:59]    + mixdown: Dolby Surround
[23:46:59]    + encoder: faac
[23:46:59]      + bitrate: 128 kbps, samplerate: 48000 Hz
[23:46:59] dvd: not a dvd - trying as a stream/file instead
[23:46:59] yadif thread started for segment 0
[23:46:59] yadif thread started for segment 1
[23:46:59] decomb thread started for segment 0
[23:46:59] decomb thread started for segment 1
[23:46:59] encx264: keyint-min: 60, keyint-max: 600
[23:46:59] encx264: encoding with stored aspect 32/27
[23:46:59] encx264: Encoding at constant RF 17.850002
x264 [info]: using SAR=32/27
x264 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 Cache64
x264 [info]: profile Main, level 3.1
No accelerated IMDCT transform found
[23:46:59] reader: first SCR 50735844
[23:46:59] sync: expecting 478 video frames
[23:46:59] sync: first pts is 10510
[23:47:00] reader: done. 1 scr changes
[23:47:06] sync: video time didn't advance - dropped 1 frames (delta 0 ms, current 618620, next 623125, dur 4505)
[23:47:06] sync: got 164 frames, 478 expected
[23:47:06] work: average encoding speed for job is 23.374146 fps
[23:47:08] mpeg2video-decoder done: 166 frames, 0 decoder errors, 0 drops
[23:47:08] render: lost time: 0 (0 frames)
[23:47:08] render: gained time: 0 (0 frames) (0 not accounted for)
x264 [info]: slice I:1     Avg QP:12.95  size: 67877  PSNR Mean Y:49.24 U:51.68 V:52.64 Avg:50.01 Global:50.01
x264 [info]: slice P:83    Avg QP:14.44  size: 22983  PSNR Mean Y:46.99 U:48.54 V:49.62 Avg:47.57 Global:47.55
x264 [info]: slice B:164   Avg QP:15.53  size:  3822  PSNR Mean Y:46.69 U:48.31 V:49.57 Avg:47.31 Global:47.28
x264 [info]: consecutive B-frames:  0.4%  0.0% 99.6%
x264 [info]: mb I  I16..4: 20.9%  0.0% 79.1%
x264 [info]: mb P  I16..4:  2.2%  0.0%  4.2%  P16..4: 39.7% 28.5% 22.4%  0.0%  0.0%    skip: 3.0%
x264 [info]: mb B  I16..4:  1.6%  0.0%  0.0%  B16..8: 20.4%  1.4%  1.5%  direct:38.4%  skip:36.6%  L0:26.9% L1:58.3% BI:14.8%
x264 [info]: SSIM Mean Y:0.9878823
x264 [info]: PSNR Mean Y:46.799 U:48.401 V:49.602 Avg:47.405 Global:47.377 kb/s:5031.73
[23:47:08] decomb: yadif deinterlaced 0 | blend deinterlaced 0 | unfiltered 163 | total 163
[23:47:08] libhb: work result = 0
QuickTime reports 35.82 fps for this encode.

Then, using another source file (exisitng x264 encode of Big Buck Bunny). Streamclip wasn't used at all; I used QuickTime to trim the file to 1 minute and save it in a QuickTime .mov container. For x264 settings, I used 2 ref frames, 2 b-frames and umh

Code: Select all

HandBrake Activity Log for /Users/tim/Desktop/BigBuckBunny.mp4: 2009-03-27 23:27:53 +0100
Handbrake Version: 0.9.3 (2008112300)

[23:27:53] macgui: Rip: Pending queue count is 0
[23:27:53] macgui: Rip: No pending jobs, so sending this one to doAddToQueue
[23:27:53] macgui: Rip: Going right to performNewQueueScan
[23:27:53] macgui: scanning specifically for title: 1
[23:27:53] macgui: performNewQueueScan currentQueueEncodeIndex is: 0
[23:27:53] hb_scan: path=/Users/tim/Desktop/BigBuckBunny.mov, title_index=1
[23:27:53] scan: trying to open with libdvdread
[23:27:53] dvd: not a dvd - trying as a stream/file instead
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/Users/tim/Desktop/BigBuckBunny.mov':
  Duration: 00:01:00.62, start: 0.000000, bitrate: 1898 kb/s
    Stream #0.0(): Audio: aac, 48000 Hz, stereo, s16
    Stream #0.1(): Video: h264, yuv420p, 1920x1080, 24.00 tb(r)
[23:27:53] scan: decoding previews for title 1
[23:27:54] scan: 10 previews, 1920x1080, 24.000 fps, autocrop = 0/0/0/0, aspect 16:9, PAR 1:1
[23:27:54] scan: title (0) job->width:1936, job->height:1088
[23:27:54] libhb: scan thread found 1 valid title(s)
[23:27:54] macgui: ScanDone state received from fQueueEncodeLibhb
[23:27:54] macgui: processNewQueueEncode title list is: 1
[23:27:54] macgui: Preset: Custom
[23:27:54] macgui: processNewQueueEncode number of passes expected is: 1
[23:27:54] macgui: prepareJob exiting
[23:27:54] 1 job(s) to process
[23:27:54] starting job
[23:27:54] job configuration:
[23:27:54]  * source
[23:27:54]    + /Users/tim/Desktop/BigBuckBunny.mov
[23:27:54]    + title 1, chapter(s) 1 to 1
[23:27:54]    + container: mov,mp4,m4a,3gp,3g2,mj2
[23:27:54]    + data rate: 1898 kbps
[23:27:54]  * destination
[23:27:54]    + /Users/tim/Desktop/BigBuckBunny.mp4
[23:27:54]    + container: MPEG-4 (.mp4 and .m4v)
[23:27:54]  * video track
[23:27:54]    + decoder: h264
[23:27:54]    + frame rate: same as source (around 24.000 fps)
[23:27:54]    + strict anamorphic
[23:27:54]      + storage dimensions: 1920 * 1080 -> 1920 * 1080, crop 0/0/0/0
[23:27:54]      + pixel aspect ratio: 1 / 1
[23:27:54]      + display dimensions: 1920 * 1080
[23:27:54]    + encoder: x264
[23:27:54]      + options: ref=2:bframes=2:me=umh
[23:27:54]      + quality: 0.65
[23:27:54] dvd: not a dvd - trying as a stream/file instead
[23:27:54] reader: first SCR 0
[23:27:55] encx264: keyint-min: 25, keyint-max: 241
[23:27:55] encx264: encoding with stored aspect 1/1
[23:27:55] encx264: Encoding at constant RF 17.850002
x264 [info]: using SAR=1/1
x264 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 PHADD SSE4.1 Cache64
x264 [info]: profile Main, level 4.0
[23:27:55] sync: expecting 1479 video frames
[23:31:55] reader: done. 1 scr changes
[23:32:50] sync: got 1454 frames, 1479 expected
[23:32:50] work: average encoding speed for job is 4.926560 fps
[23:32:55] h264-decoder done: 1455 frames, 0 decoder errors, 0 drops
[23:32:55] render: lost time: 0 (0 frames)
[23:32:55] render: gained time: 0 (0 frames) (0 not accounted for)
x264 [info]: slice I:13    Avg QP:12.45  size:352100  PSNR Mean Y:57.12 U:60.42 V:61.08 Avg:58.02 Global:50.90
x264 [info]: slice P:1561  Avg QP:14.64  size: 40339  PSNR Mean Y:48.55 U:52.32 V:53.04 Avg:49.49 Global:47.91
x264 [info]: slice B:850   Avg QP:16.31  size: 10609  PSNR Mean Y:47.66 U:51.28 V:52.22 Avg:48.62 Global:47.31
x264 [info]: consecutive B-frames: 47.0%  0.5% 52.5%
x264 [info]: mb I  I16..4: 30.9%  0.0% 69.1%
x264 [info]: mb P  I16..4:  3.2%  0.0%  1.8%  P16..4: 42.4%  7.6%  8.8%  0.0%  0.0%    skip:36.1%
x264 [info]: mb B  I16..4:  0.6%  0.0%  0.0%  B16..8: 21.8%  1.0%  0.8%  direct:15.5%  skip:60.4%  L0:38.6% L1:52.7% BI: 8.7%
x264 [info]: ref P L0  83.1% 16.9%
x264 [info]: SSIM Mean Y:0.9936200
x264 [info]: PSNR Mean Y:48.283 U:52.000 V:52.792 Avg:49.234 Global:47.701 kb/s:6064.46
[23:32:56] libhb: work result = 0
QuickTime (with Perian) reports 24 fps for this source, and apparently so does HandBrake:

Code: Select all

[23:27:54]    + frame rate: same as source (around 24.000 fps)
Yet, QuickTime reports 40.01 fps for the encoded .mp4 file! I wonder whether this is a QuickTime issue?
User avatar
Rodeo
HandBrake Team
Posts: 12619
Joined: Tue Mar 03, 2009 8:55 pm

Re: [Invalid] [SVN 2263] Incorrect Framerate

Post by Rodeo »

Here's another log for a full encode of Big Buck Bunny, directly from the source mkv:

Code: Select all

HandBrake Activity Log for /Users/tim/Desktop/BigBuckBunny.mp4: 2009-03-27 23:34:39 +0100
Handbrake Version: 0.9.3 (2008112300)

[23:34:39] macgui: Rip: Pending queue count is 0
[23:34:39] macgui: Rip: No pending jobs, so sending this one to doAddToQueue
[23:34:39] macgui: Rip: Going right to performNewQueueScan
[23:34:39] macgui: scanning specifically for title: 1
[23:34:39] macgui: performNewQueueScan currentQueueEncodeIndex is: 1
[23:34:39] hb_scan: path=/Users/tim/Movies/BigBuckBunny.mkv, title_index=1
[23:34:39] scan: trying to open with libdvdread
[23:34:39] dvd: not a dvd - trying as a stream/file instead
Input #0, matroska, from '/Users/tim/Movies/BigBuckBunny.mkv':
  Duration: 00:09:56.52, start: 0.000000, bitrate: N/A
    Stream #0.0: Audio: aac, 48000 Hz, stereo, s16
    Stream #0.1: Video: h264, yuv420p, 1920x1080, 24.00 tb(r)
[23:34:39] scan: decoding previews for title 1
[23:34:41] scan: 10 previews, 1920x1080, 24.000 fps, autocrop = 0/0/0/0, aspect 16:9, PAR 1:1
[23:34:41] scan: title (0) job->width:1936, job->height:1088
[23:34:41] libhb: scan thread found 1 valid title(s)
[23:34:41] macgui: ScanDone state received from fQueueEncodeLibhb
[23:34:41] macgui: processNewQueueEncode title list is: 1
[23:34:41] macgui: Preset: Custom
[23:34:41] macgui: processNewQueueEncode number of passes expected is: 1
[23:34:41] macgui: prepareJob exiting
[23:34:41] 1 job(s) to process
[23:34:41] starting job
[23:34:41] job configuration:
[23:34:41]  * source
[23:34:41]    + /Users/tim/Movies/BigBuckBunny.mkv
[23:34:41]    + title 1, chapter(s) 1 to 1
[23:34:41]    + container: matroska
[23:34:41]  * destination
[23:34:41]    + /Users/tim/Desktop/BigBuckBunny.mp4
[23:34:41]    + container: MPEG-4 (.mp4 and .m4v)
[23:34:41]  * video track
[23:34:41]    + decoder: h264
[23:34:41]    + frame rate: same as source (around 24.000 fps)
[23:34:41]    + strict anamorphic
[23:34:41]      + storage dimensions: 1920 * 1080 -> 1920 * 1080, crop 0/0/0/0
[23:34:41]      + pixel aspect ratio: 1 / 1
[23:34:41]      + display dimensions: 1920 * 1080
[23:34:41]    + encoder: x264
[23:34:41]      + options: ref=2:bframes=2:me=umh
[23:34:41]      + quality: 0.60
[23:34:41]  * audio track 0
[23:34:41]    + decoder: Unknown (AAC) (track 1, id 0)
[23:34:41]    + mixdown: Stereo
[23:34:41]    + encoder: faac
[23:34:41]      + bitrate: 128 kbps, samplerate: 48000 Hz
[23:34:41] dvd: not a dvd - trying as a stream/file instead
[23:34:41] encx264: keyint-min: 25, keyint-max: 241
[23:34:41] encx264: encoding with stored aspect 1/1
[23:34:41] encx264: Encoding at constant RF 20.400000
x264 [info]: using SAR=1/1
x264 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 PHADD SSE4.1 Cache64
[23:34:41] reader: first SCR 0
x264 [info]: profile Main, level 4.0
[23:34:41] sync: expecting 14340 video frames
[23:34:41] sync: adding 171 ms of silence to audio 0  start 15390, next 0
[00:17:06] reader: done. 1 scr changes
[00:17:44] sync: got 14314 frames, 14340 expected
[00:17:44] work: average encoding speed for job is 5.542304 fps
[00:17:48] h264-decoder done: 14315 frames, 0 decoder errors, 0 drops
[00:17:48] render: lost time: 0 (0 frames)
[00:17:48] render: gained time: 0 (0 frames) (0 not accounted for)
x264 [info]: slice I:176   Avg QP:12.93  size:268122  PSNR Mean Y:51.95 U:56.37 V:57.00 Avg:52.94 Global:50.58
x264 [info]: slice P:15129 Avg QP:15.01  size: 27453  PSNR Mean Y:48.69 U:53.48 V:54.13 Avg:49.68 Global:47.81
x264 [info]: slice B:8552  Avg QP:16.25  size:  7001  PSNR Mean Y:48.62 U:53.08 V:53.80 Avg:49.62 Global:47.68
x264 [info]: consecutive B-frames: 44.7%  4.6% 50.7%
x264 [info]: mb I  I16..4: 25.0%  0.0% 75.0%
x264 [info]: mb P  I16..4:  2.0%  0.0%  3.3%  P16..4: 32.1%  6.6%  5.6%  0.0%  0.0%    skip:50.5%
x264 [info]: mb B  I16..4:  0.8%  0.0%  0.0%  B16..8: 13.0%  0.8%  0.6%  direct:10.5%  skip:74.3%  L0:35.6% L1:57.7% BI: 6.8%
x264 [info]: ref P L0  84.8% 15.2%
x264 [info]: SSIM Mean Y:0.9933365
x264 [info]: PSNR Mean Y:48.687 U:53.358 V:54.037 Avg:49.681 Global:47.781 kb/s:4204.25
[00:17:48] aac-decoder done: 0 frames, 0 decoder errors, 0 drops
[00:17:48] libhb: work result = 0
The encoded BigBuckBunny.mp4 file is reported as 40.00 fps in QuickTime.
jbrjake
Veteran User
Posts: 4805
Joined: Wed Dec 13, 2006 1:38 am

Re: [Invalid] [SVN 2263] Incorrect Framerate

Post by jbrjake »

...really don't know what you're trying to show with all those logs.
I guess it could be the reason my video is reported as 59.94 fps.

However, I don't think that's causing the issue.
You're ignoring the other half of my explanation:
I would assume something to do with the init_delay and track edit used to maintain AV sync when using B-frames having a large influence on the calculated FPS in QuickTime, averaging over such a small total number of frames.
User avatar
Rodeo
HandBrake Team
Posts: 12619
Joined: Tue Mar 03, 2009 8:55 pm

Re: [Invalid] [SVN 2263] Incorrect Framerate

Post by Rodeo »

jbrjake wrote:You're ignoring the other half of my explanation:
I would assume something to do with the init_delay and track edit used to maintain AV sync when using B-frames having a large influence on the calculated FPS in QuickTime, averaging over such a small total number of frames.
The last log corresponds to a 10-minute source, not 6 seconds like my other test clip.
jbrjake
Veteran User
Posts: 4805
Joined: Wed Dec 13, 2006 1:38 am

Re: [Invalid] [SVN 2263] Incorrect Framerate

Post by jbrjake »

...and are you going to test it without b-frames? That's what I was implying you should do by reminding you that using b-frames can confuse the FPS calculation in QT....

Overall, you seem to be really focused on the difference between the FPS scan reports and the FPS QT reports, and I'm trying to remind you that they are different things calculated totally different ways. That a stream signals that it's 24.00 means absolutely nothing. It's just metadata used to estimate the expected number of frames. What's important are the actual differences between each PTS in the file. The init_delay is not changing based on the signaled FPS, when you use Same as source.

I'm still not sure what this bug thread is a*bout*. What is the problem here? Is your output not playing correctly? If not, what are you concerned about?
downinitjr
Posts: 18
Joined: Wed Oct 01, 2008 1:23 am

Re: [Invalid] [SVN 2263] Incorrect Framerate

Post by downinitjr »

I don't know about rodeo, but the reason I started this thread was because after using the tv preset on many different .mkv files, I have just recently started seeing the issue reported. Up until now all of the re-encodes I have done have worked fine on my tv without ever having to change <same as source> to a specified frame-rate. I was under the assumption that when mediaInfo was telling me it's 23.976 fps, that same as source would produce 23.976 fps as well. It has only been recently that I have been getting files on occasion that will not show up or sync to the tv, and after opening the files in quicktime find the reported framerate different than what I thought it would produce. I suppose it could have been just blind luck that I never experienced this up until now which is why I was checking here.
User avatar
Rodeo
HandBrake Team
Posts: 12619
Joined: Tue Mar 03, 2009 8:55 pm

Re: [Invalid] [SVN 2263] Incorrect Framerate

Post by Rodeo »

jbrjake wrote:...and are you going to test it without b-frames? That's what I was implying you should do by reminding you that using b-frames can confuse the FPS calculation in QT....
OK, here's the log:

Code: Select all

HandBrake Activity Log for /Users/tim/Desktop/BigBuckBunny.mp4: 2009-03-30 19:30:32 +0200
Handbrake Version: 0.9.3 (2008112300)

[19:30:32] macgui: Rip: Pending queue count is 0
[19:30:32] macgui: Rip: No pending jobs, so sending this one to doAddToQueue
[19:30:32] macgui: Rip: Going right to performNewQueueScan
[19:30:32] macgui: scanning specifically for title: 1
[19:30:32] macgui: performNewQueueScan currentQueueEncodeIndex is: 0
[19:30:32] hb_scan: path=/Users/tim/Desktop/BigBuckBunny.mkv, title_index=1
[19:30:32] scan: trying to open with libdvdread
[19:30:32] dvd: not a dvd - trying as a stream/file instead
Input #0, matroska, from '/Users/tim/Desktop/BigBuckBunny.mkv':
  Duration: 00:09:56.52, start: 0.000000, bitrate: N/A
    Stream #0.0: Audio: aac, 48000 Hz, stereo, s16
    Stream #0.1: Video: h264, yuv420p, 1920x1080, 24.00 tb(r)
[19:30:33] scan: decoding previews for title 1
[19:30:34] scan: 10 previews, 1920x1080, 24.000 fps, autocrop = 0/0/0/0, aspect 16:9, PAR 1:1
[19:30:34] scan: title (0) job->width:1936, job->height:1088
[19:30:34] libhb: scan thread found 1 valid title(s)
[19:30:34] macgui: ScanDone state received from fQueueEncodeLibhb
[19:30:34] macgui: processNewQueueEncode title list is: 1
[19:30:34] macgui: Preset: Custom
[19:30:34] macgui: processNewQueueEncode number of passes expected is: 1
[19:30:34] macgui: prepareJob exiting
[19:30:34] 1 job(s) to process
[19:30:34] starting job
[19:30:34] job configuration:
[19:30:34]  * source
[19:30:34]    + /Users/tim/Desktop/BigBuckBunny.mkv
[19:30:34]    + title 1, chapter(s) 1 to 1
[19:30:34]    + container: matroska
[19:30:34]  * destination
[19:30:34]    + /Users/tim/Desktop/BigBuckBunny.mp4
[19:30:34]    + container: MPEG-4 (.mp4 and .m4v)
[19:30:34]  * video track
[19:30:34]    + decoder: h264
[19:30:34]    + frame rate: same as source (around 24.000 fps)
[19:30:34]    + strict anamorphic
[19:30:34]      + storage dimensions: 1920 * 1080 -> 1920 * 1080, crop 0/0/0/0
[19:30:34]      + pixel aspect ratio: 1 / 1
[19:30:34]      + display dimensions: 1920 * 1080
[19:30:34]    + encoder: x264
[19:30:34]      + options: ref=2:me=umh
[19:30:34]      + quality: 0.60
[19:30:34]  * audio track 0
[19:30:34]    + decoder: Unknown (AAC) (track 1, id 0)
[19:30:34]    + mixdown: Stereo
[19:30:34]    + encoder: faac
[19:30:34]      + bitrate: 128 kbps, samplerate: 48000 Hz
[19:30:34] dvd: not a dvd - trying as a stream/file instead
[19:30:34] reader: first SCR 0
[19:30:34] encx264: keyint-min: 25, keyint-max: 241
[19:30:34] encx264: encoding with stored aspect 1/1
[19:30:34] encx264: Encoding at constant RF 20.400000
x264 [info]: using SAR=1/1
x264 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 Cache64
x264 [info]: profile Main, level 4.0
[19:30:34] sync: expecting 14340 video frames
[19:30:34] sync: adding 171 ms of silence to audio 0  start 15390, next 0
[20:10:21] reader: done. 1 scr changes
[20:10:55] sync: got 14314 frames, 14340 expected
[20:10:55] work: average encoding speed for job is 5.913789 fps
[20:10:58] h264-decoder done: 14315 frames, 0 decoder errors, 0 drops
[20:10:58] render: lost time: 0 (0 frames)
[20:10:58] render: gained time: 0 (0 frames) (0 not accounted for)
x264 [info]: slice I:146   Avg QP:13.37  size:252930  PSNR Mean Y:51.61 U:56.36 V:57.15 Avg:52.64 Global:50.35
x264 [info]: slice P:14168 Avg QP:16.56  size: 26152  PSNR Mean Y:47.70 U:52.67 V:53.37 Avg:48.74 Global:46.57
x264 [info]: mb I  I16..4: 25.5%  0.0% 74.5%
x264 [info]: mb P  I16..4:  2.3%  0.0%  3.1%  P16..4: 37.9%  7.0%  5.0%  0.0%  0.0%    skip:44.7%
x264 [info]: ref P L0  75.3% 24.7%
x264 [info]: SSIM Mean Y:0.9920305
x264 [info]: PSNR Mean Y:47.745 U:52.709 V:53.406 Avg:48.778 Global:46.596 kb/s:5465.34
[20:10:58] aac-decoder done: 0 frames, 0 decoder errors, 0 drops
[20:10:58] libhb: work result = 0
Without b-frames, QuickTime reports the file as 24.00 fps.
jbrjake wrote:I'm still not sure what this bug thread is a*bout*. What is the problem here? Is your output not playing correctly? If not, what are you concerned about?
I posted in this thread because it seemed related to what I was experiencing (weird fps being reported). Also, after the "test" I did with JES Deinterlacer, I was worried that maybe HandBrake was actually adding frames to the files it created (although, being QuickTime-based, JES Deinterlacer was probably just confused like QuickTime appears to be).

I did notice, however, that encoding with same as source fps and b-frames may sometimes unnecessarily increase the bitrate.

I did two more encodes of Big Buck Bunny: one with b-frames and constant 24 fps, and one without b-frames with constant 24 fps. So now I have 4 encodes of Big Buck Bunny to compare:

1) Constant 24 fps & no b-frames
Log:

Code: Select all

HandBrake Activity Log for /Users/tim/Desktop/BigBuckBunny 24 fps nobframes.mp4: 2009-03-30 21:46:02 +0200
Handbrake Version: 0.9.3 (2008112300)

[21:46:02] macgui: Rip: Pending queue count is 0
[21:46:02] macgui: Rip: No pending jobs, so sending this one to doAddToQueue
[21:46:02] macgui: Rip: Going right to performNewQueueScan
[21:46:02] macgui: scanning specifically for title: 1
[21:46:02] macgui: performNewQueueScan currentQueueEncodeIndex is: 1
[21:46:02] hb_scan: path=/Users/tim/Movies/BigBuckBunny.mkv, title_index=1
[21:46:02] scan: trying to open with libdvdread
[21:46:02] dvd: not a dvd - trying as a stream/file instead
Input #0, matroska, from '/Users/tim/Movies/BigBuckBunny.mkv':
  Duration: 00:09:56.52, start: 0.000000, bitrate: N/A
    Stream #0.0: Audio: aac, 48000 Hz, stereo, s16
    Stream #0.1: Video: h264, yuv420p, 1920x1080, 24.00 tb(r)
[21:46:02] scan: decoding previews for title 1
[21:46:04] scan: 10 previews, 1920x1080, 24.000 fps, autocrop = 0/0/0/0, aspect 16:9, PAR 1:1
[21:46:04] scan: title (0) job->width:1936, job->height:1088
[21:46:04] libhb: scan thread found 1 valid title(s)
[21:46:04] macgui: currentScanCount received from fQueueEncodeLibhb
[21:46:04] macgui: ScanDone state received from fQueueEncodeLibhb
[21:46:04] macgui: processNewQueueEncode title list is: 1
[21:46:04] macgui: Preset: Custom
[21:46:04] macgui: processNewQueueEncode number of passes expected is: 1
[21:46:04] macgui: prepareJob exiting
[21:46:04] 1 job(s) to process
[21:46:04] starting job
[21:46:04] job configuration:
[21:46:04]  * source
[21:46:04]    + /Users/tim/Movies/BigBuckBunny.mkv
[21:46:04]    + title 1, chapter(s) 1 to 1
[21:46:04]    + container: matroska
[21:46:04]  * destination
[21:46:04]    + /Users/tim/Desktop/BigBuckBunny 24 fps nobframes.mp4
[21:46:04]    + container: MPEG-4 (.mp4 and .m4v)
[21:46:04]  * video track
[21:46:04]    + decoder: h264
[21:46:04]    + frame rate: 24.000 fps -> constant 24.000 fps
[21:46:04]    + strict anamorphic
[21:46:04]      + storage dimensions: 1920 * 1080 -> 1920 * 1080, crop 0/0/0/0
[21:46:04]      + pixel aspect ratio: 1 / 1
[21:46:04]      + display dimensions: 1920 * 1080
[21:46:04]    + encoder: x264
[21:46:04]      + options: ref=2:me=umh
[21:46:04]      + quality: 0.60
[21:46:04]  * audio track 0
[21:46:04]    + decoder: Unknown (AAC) (track 1, id 0)
[21:46:04]    + mixdown: Stereo
[21:46:04]    + encoder: faac
[21:46:04]      + bitrate: 128 kbps, samplerate: 48000 Hz
[21:46:04] dvd: not a dvd - trying as a stream/file instead
[21:46:04] reader: first SCR 0
[21:46:04] encx264: keyint-min: 25, keyint-max: 241
[21:46:04] encx264: encoding with stored aspect 1/1
[21:46:04] encx264: Encoding at constant RF 20.400000
x264 [info]: using SAR=1/1
x264 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 PHADD SSE4.1 Cache64
x264 [info]: profile Main, level 4.0
[21:46:04] sync: expecting 14340 video frames
[21:46:04] sync: adding 171 ms of silence to audio 0  start 15390, next 0
[22:16:04] reader: done. 1 scr changes
[22:16:29] sync: got 14314 frames, 14340 expected
[22:16:29] work: average encoding speed for job is 7.845747 fps
[22:16:31] h264-decoder done: 14315 frames, 0 decoder errors, 0 drops
[22:16:31] render: lost time: 0 (0 frames)
[22:16:31] render: gained time: 0 (0 frames) (0 not accounted for)
x264 [info]: slice I:146   Avg QP:13.37  size:252930  PSNR Mean Y:51.61 U:56.36 V:57.15 Avg:52.64 Global:50.35
x264 [info]: slice P:14168 Avg QP:16.56  size: 26152  PSNR Mean Y:47.70 U:52.67 V:53.37 Avg:48.74 Global:46.57
x264 [info]: mb I  I16..4: 25.5%  0.0% 74.5%
x264 [info]: mb P  I16..4:  2.3%  0.0%  3.1%  P16..4: 37.9%  7.0%  5.0%  0.0%  0.0%    skip:44.7%
x264 [info]: ref P L0  75.3% 24.7%
x264 [info]: SSIM Mean Y:0.9920305
x264 [info]: PSNR Mean Y:47.745 U:52.709 V:53.406 Avg:48.778 Global:46.596 kb/s:5465.34
[22:16:31] aac-decoder done: 0 frames, 0 decoder errors, 0 drops
[22:16:31] libhb: work result = 0
2) Same as source & no b-frames (first log in this post)

3) Constant 24 fps & 2 b-frames
Log:

Code: Select all

HandBrake Activity Log for /Users/tim/Desktop/BigBuckBunny Constant 24 fps.mp4: 2009-03-29 13:52:34 +0200
Handbrake Version: 0.9.3 (2008112300)

[13:52:34] macgui: Rip: Pending queue count is 0
[13:52:34] macgui: Rip: No pending jobs, so sending this one to doAddToQueue
[13:52:34] macgui: Rip: Going right to performNewQueueScan
[13:52:34] macgui: scanning specifically for title: 1
[13:52:34] macgui: performNewQueueScan currentQueueEncodeIndex is: 0
[13:52:34] hb_scan: path=/Users/tim/Movies/BigBuckBunny.mkv, title_index=1
[13:52:34] scan: trying to open with libdvdread
[13:52:34] dvd: not a dvd - trying as a stream/file instead
Input #0, matroska, from '/Users/tim/Movies/BigBuckBunny.mkv':
  Duration: 00:09:56.52, start: 0.000000, bitrate: N/A
    Stream #0.0: Audio: aac, 48000 Hz, stereo, s16
    Stream #0.1: Video: h264, yuv420p, 1920x1080, 24.00 tb(r)
[13:52:34] scan: decoding previews for title 1
[13:52:35] scan: 10 previews, 1920x1080, 24.000 fps, autocrop = 0/0/0/0, aspect 16:9, PAR 1:1
[13:52:35] scan: title (0) job->width:1936, job->height:1088
[13:52:35] libhb: scan thread found 1 valid title(s)
[13:52:36] macgui: ScanDone state received from fQueueEncodeLibhb
[13:52:36] macgui: processNewQueueEncode title list is: 1
[13:52:36] macgui: Preset: Custom
[13:52:36] macgui: processNewQueueEncode number of passes expected is: 1
[13:52:36] macgui: prepareJob exiting
[13:52:36] 1 job(s) to process
[13:52:36] starting job
[13:52:36] job configuration:
[13:52:36]  * source
[13:52:36]    + /Users/tim/Movies/BigBuckBunny.mkv
[13:52:36]    + title 1, chapter(s) 1 to 1
[13:52:36]    + container: matroska
[13:52:36]  * destination
[13:52:36]    + /Users/tim/Desktop/BigBuckBunny Constant 24 fps.mp4
[13:52:36]    + container: MPEG-4 (.mp4 and .m4v)
[13:52:36]  * video track
[13:52:36]    + decoder: h264
[13:52:36]    + frame rate: 24.000 fps -> constant 24.000 fps
[13:52:36]    + strict anamorphic
[13:52:36]      + storage dimensions: 1920 * 1080 -> 1920 * 1080, crop 0/0/0/0
[13:52:36]      + pixel aspect ratio: 1 / 1
[13:52:36]      + display dimensions: 1920 * 1080
[13:52:36]    + encoder: x264
[13:52:36]      + options: ref=2:bframes=2:me=umh
[13:52:36]      + quality: 0.60
[13:52:36]  * audio track 0
[13:52:36]    + decoder: Unknown (AAC) (track 1, id 0)
[13:52:36]    + mixdown: Stereo
[13:52:36]    + encoder: faac
[13:52:36]      + bitrate: 128 kbps, samplerate: 48000 Hz
[13:52:36] dvd: not a dvd - trying as a stream/file instead
[13:52:36] reader: first SCR 0
[13:52:36] encx264: keyint-min: 25, keyint-max: 241
[13:52:36] encx264: encoding with stored aspect 1/1
[13:52:36] encx264: Encoding at constant RF 20.400000
x264 [info]: using SAR=1/1
x264 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 PHADD SSE4.1 Cache64
x264 [info]: profile Main, level 4.0
[13:52:36] sync: expecting 14340 video frames
[13:52:36] sync: adding 171 ms of silence to audio 0  start 15390, next 0
[14:22:40] reader: done. 1 scr changes
[14:23:05] sync: got 14314 frames, 14340 expected
[14:23:05] work: average encoding speed for job is 7.824080 fps
[14:23:09] h264-decoder done: 14315 frames, 0 decoder errors, 0 drops
[14:23:09] render: lost time: 0 (0 frames)
[14:23:09] render: gained time: 0 (0 frames) (0 not accounted for)
x264 [info]: slice I:146   Avg QP:14.25  size:230220  PSNR Mean Y:50.91 U:55.86 V:56.69 Avg:51.97 Global:49.76
x264 [info]: slice P:5509  Avg QP:16.39  size: 39937  PSNR Mean Y:47.81 U:53.00 V:53.69 Avg:48.87 Global:46.92
x264 [info]: slice B:8659  Avg QP:18.32  size: 10710  PSNR Mean Y:47.12 U:52.37 V:53.12 Avg:48.20 Global:46.46
x264 [info]: consecutive B-frames:  5.7% 10.7% 83.7%
x264 [info]: mb I  I16..4: 25.6%  0.0% 74.4%
x264 [info]: mb P  I16..4:  4.7%  0.0%  6.8%  P16..4: 37.5%  9.5%  6.2%  0.0%  0.0%    skip:35.4%
x264 [info]: mb B  I16..4:  1.7%  0.0%  0.0%  B16..8: 20.0%  1.4%  1.0%  direct: 9.0%  skip:66.9%  L0:40.0% L1:51.2% BI: 8.9%
x264 [info]: ref P L0  81.1% 18.9%
x264 [info]: SSIM Mean Y:0.9916316
x264 [info]: PSNR Mean Y:47.423 U:52.651 V:53.374 Avg:48.498 Global:46.656 kb/s:4645.96
[14:23:09] aac-decoder done: 0 frames, 0 decoder errors, 0 drops
[14:23:09] libhb: work result = 0
4) Same as source & 2 b-frames (log can be found in my previous post)

All other settings should be the same (60% quality, 128 Kbps AAC, ref=2:me=umh etc.).

File (1) gets reported by QuickTime as "24 fps".
From log:

Code: Select all

x264 [info]: PSNR Mean Y:47.745 U:52.709 V:53.406 Avg:48.778 Global:46.596 kb/s:5465.34
File (2) gets reported by QuickTime as "24.00 fps".
From log:

Code: Select all

x264 [info]: PSNR Mean Y:47.745 U:52.709 V:53.406 Avg:48.778 Global:46.596 kb/s:5465.34
Here, the only apparent difference is that QuickTime reports 24.00 fps instead of 24 for the same as source encode. Other than that, choosing constant 24 fps instead of same as source doesn't appear to have any obvious effect.

File (3) gets reported by QuickTime as "24 fps".
From log:

Code: Select all

x264 [info]: PSNR Mean Y:47.423 U:52.651 V:53.374 Avg:48.498 Global:46.656 kb/s:4645.96
Here it appears that b-frames help reduce the bitrate (FWIW).

Finally, file (4) gets reported by QuickTime as "40.00 fps".
From log:

Code: Select all

x264 [info]: PSNR Mean Y:48.687 U:53.358 V:54.037 Avg:49.681 Global:47.781 kb/s:4204.25
Now here's the interesting part. While for files (1), (2) and (3), the bitrate found in the encode logs matches what's reported by QuickTime and MediaInfo, for file (4), this is not the case. I mean, the bitrate is nowhere near 4204.25 Kbps; in fact, it's 7007 Kbps (according to MediaInfo - QuickTime reports 7142 Kbps but that includes the audio). The size on disk corresponds to the MediaInfo- and QuickTime-reported bitrate.

At first I though I got my logs and encodes mixed up, but I double checked and triple checked, and the log (the one in my previous post of Sat Mar 28, 2009 12:40 am) corresponds to the file that's 7007 Kbps. I'll run another encode soon with the same settings, just to be sure…
User avatar
Rodeo
HandBrake Team
Posts: 12619
Joined: Tue Mar 03, 2009 8:55 pm

Re: [Invalid] [SVN 2263] Incorrect Framerate

Post by Rodeo »

Here's another log (sorry), which confirms the log vs. real bitrate discrepancy:

Code: Select all

HandBrake Activity Log for /Users/tim/Desktop/BigBuckBunny 7 Mbps?.mp4: 2009-03-30 23:29:58 +0200
Handbrake Version: 0.9.3 (2008112300)

[23:29:57] macgui: Rip: Pending queue count is 0
[23:29:57] macgui: Rip: No pending jobs, so sending this one to doAddToQueue
[23:29:58] macgui: Rip: Going right to performNewQueueScan
[23:29:58] macgui: scanning specifically for title: 1
[23:29:58] macgui: performNewQueueScan currentQueueEncodeIndex is: 0
[23:29:58] hb_scan: path=/Users/tim/Movies/BigBuckBunny.mkv, title_index=1
[23:29:58] scan: trying to open with libdvdread
[23:29:58] dvd: not a dvd - trying as a stream/file instead
Input #0, matroska, from '/Users/tim/Movies/BigBuckBunny.mkv':
  Duration: 00:09:56.52, start: 0.000000, bitrate: N/A
    Stream #0.0: Audio: aac, 48000 Hz, stereo, s16
    Stream #0.1: Video: h264, yuv420p, 1920x1080, 24.00 tb(r)
[23:29:58] scan: decoding previews for title 1
[23:29:59] scan: 10 previews, 1920x1080, 24.000 fps, autocrop = 0/0/0/0, aspect 16:9, PAR 1:1
[23:29:59] scan: title (0) job->width:1936, job->height:1088
[23:29:59] libhb: scan thread found 1 valid title(s)
[23:29:59] macgui: ScanDone state received from fQueueEncodeLibhb
[23:29:59] macgui: processNewQueueEncode title list is: 1
[23:29:59] macgui: Preset: Custom
[23:29:59] macgui: processNewQueueEncode number of passes expected is: 1
[23:29:59] macgui: prepareJob exiting
[23:29:59] 1 job(s) to process
[23:29:59] starting job
[23:29:59] job configuration:
[23:29:59]  * source
[23:29:59]    + /Users/tim/Movies/BigBuckBunny.mkv
[23:29:59]    + title 1, chapter(s) 1 to 1
[23:29:59]    + container: matroska
[23:29:59]  * destination
[23:29:59]    + /Users/tim/Desktop/BigBuckBunny 7 Mbps?.mp4
[23:29:59]    + container: MPEG-4 (.mp4 and .m4v)
[23:29:59]  * video track
[23:29:59]    + decoder: h264
[23:29:59]    + frame rate: same as source (around 24.000 fps)
[23:29:59]    + strict anamorphic
[23:29:59]      + storage dimensions: 1920 * 1080 -> 1920 * 1080, crop 0/0/0/0
[23:29:59]      + pixel aspect ratio: 1 / 1
[23:29:59]      + display dimensions: 1920 * 1080
[23:29:59]    + encoder: x264
[23:29:59]      + options: ref=2:bframes=2:me=umh
[23:29:59]      + quality: 0.60
[23:29:59]  * audio track 0
[23:29:59]    + decoder: Unknown (AAC) (track 1, id 0)
[23:29:59]    + mixdown: Stereo
[23:29:59]    + encoder: faac
[23:29:59]      + bitrate: 128 kbps, samplerate: 48000 Hz
[23:29:59] dvd: not a dvd - trying as a stream/file instead
[23:29:59] reader: first SCR 0
[23:29:59] encx264: keyint-min: 25, keyint-max: 241
[23:29:59] encx264: encoding with stored aspect 1/1
[23:29:59] encx264: Encoding at constant RF 20.400000
x264 [info]: using SAR=1/1
x264 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 PHADD SSE4.1 Cache64
x264 [info]: profile Main, level 4.0
[23:29:59] sync: expecting 14340 video frames
[23:29:59] sync: adding 171 ms of silence to audio 0  start 15390, next 0
[00:11:44] reader: done. 1 scr changes
[00:12:22] sync: got 14314 frames, 14340 expected
[00:12:22] work: average encoding speed for job is 5.629764 fps
[00:12:27] h264-decoder done: 14315 frames, 0 decoder errors, 0 drops
[00:12:27] render: lost time: 0 (0 frames)
[00:12:27] render: gained time: 0 (0 frames) (0 not accounted for)
x264 [info]: slice I:176   Avg QP:12.93  size:268122  PSNR Mean Y:51.95 U:56.37 V:57.00 Avg:52.94 Global:50.58
x264 [info]: slice P:15129 Avg QP:15.01  size: 27453  PSNR Mean Y:48.69 U:53.48 V:54.13 Avg:49.68 Global:47.81
x264 [info]: slice B:8552  Avg QP:16.25  size:  7001  PSNR Mean Y:48.62 U:53.08 V:53.80 Avg:49.62 Global:47.68
x264 [info]: consecutive B-frames: 44.7%  4.6% 50.7%
x264 [info]: mb I  I16..4: 25.0%  0.0% 75.0%
x264 [info]: mb P  I16..4:  2.0%  0.0%  3.3%  P16..4: 32.1%  6.6%  5.6%  0.0%  0.0%    skip:50.5%
x264 [info]: mb B  I16..4:  0.8%  0.0%  0.0%  B16..8: 13.0%  0.8%  0.6%  direct:10.5%  skip:74.3%  L0:35.6% L1:57.7% BI: 6.8%
x264 [info]: ref P L0  84.8% 15.2%
x264 [info]: SSIM Mean Y:0.9933365
x264 [info]: PSNR Mean Y:48.687 U:53.358 V:54.037 Avg:49.681 Global:47.781 kb/s:4204.25
[00:12:27] aac-decoder done: 0 frames, 0 decoder errors, 0 drops
[00:12:27] libhb: work result = 0
Again, the log says 4204.25 Kbps, but the file actually is 7007 Kbps…
jbrjake
Veteran User
Posts: 4805
Joined: Wed Dec 13, 2006 1:38 am

Re: [Invalid] [SVN 2263] Incorrect Framerate

Post by jbrjake »

You're getting different numbers of frames processed by x264 than are rendered by libhb. Odd, to say the least. The vfr encode has waaaaaaay more P-frames that it should.
ragboy
Regular User
Posts: 82
Joined: Mon Apr 09, 2007 4:03 pm

Re: [Invalid] [SVN 2263] Incorrect Framerate

Post by ragboy »

This looks resolved in 2288.
User avatar
Rodeo
HandBrake Team
Posts: 12619
Joined: Tue Mar 03, 2009 8:55 pm

Re: [Invalid] [SVN 2263] Incorrect Framerate

Post by Rodeo »

ragboy wrote:This looks resolved in 2288.
With svn2288, HandBrake now detects the framerate of my Test.mpeg clip properly ("around 23.976 fps" instead of "around 59.940 fps").

I still have the same issue with Big Buck Bunny though (bitrate discrepancy and 40.00fps when using same as source combined with bframes).
User avatar
Rodeo
HandBrake Team
Posts: 12619
Joined: Tue Mar 03, 2009 8:55 pm

Re: [Invalid] [SVN 2263] Incorrect Framerate

Post by Rodeo »

OK. Here's what I've seen so far in my tests (using HandBrake 0.9.3):

1) When encoding using x264 and "Same as source" framerate, QuickTime reports a different framerate depending on whether
a) b-frames are disabled
b) b-frames are enabled, b-pyramid is disabled
c) b-frames and b-pyramid are enabled

2) This framerate difference (which is most obvious when using settings b) is not the only difference, as in some cases I've observed a mismatch between the encode log's reported bitrate and the actual bitrate of the file.

3) More recently, I used QuickTime to advance through the files frame by frame, comparing a "good" encode (settings a) to a "bad" one (settings b) in scenes which contain movement. In the "good" file, each frame change seemed to trigger a change in the picture (even minimal), whereas in the "bad" file, sometimes the frame would change yet look exactly identical to the previous frame.

I've compiled svn2289, but the issues when using both "Same as source" and b-frames remain.

Then I've looked at HandBrake's sources and found a reference to b-frames and b-pyramid in libhb/encx264.c. I commented out lines 160 to 182 and rebuilt (not really knowing what I was doing, though).

With this change, the issues I experienced went away (no framerate difference depending on settings, no log vs. real bitrate mismatch). Of course, that's obviously not a fix, as the resulting file doesn't playback smoothly (and if those lines of code weren't necessary, they wouldn't have been there in the first place).

However, it does seem to indicate that setting job->areBframes to true is triggering this framerate/bitrate issue.

FWIW, here are the logs for two encodes with and without my change:

svn2289 (note: with Ritsuka's Core Audio patch) (ref=2:umh:bframes=2)

Code: Select all

HandBrake Activity Log for /Users/tim/Desktop/BigBuckBunny svn2289.mp4: 2009-04-07 21:23:38 +0200
Handbrake Version: svn2289 i386 (2009040301)

[21:23:38] macgui: Rip: Pending queue count is 0
[21:23:38] macgui: Rip: No pending jobs, so sending this one to doAddToQueue
[21:23:38] macgui: Rip: Going right to performNewQueueScan
[21:23:38] macgui: scanning specifically for title: 1
[21:23:38] macgui: performNewQueueScan currentQueueEncodeIndex is: 0
[21:23:38] hb_scan: path=/Users/tim/Movies/BigBuckBunny.mkv, title_index=1
[21:23:38] scan: trying to open with libdvdread
[21:23:38] dvd: not a dvd - trying as a stream/file instead
Input #0, matroska, from '/Users/tim/Movies/BigBuckBunny.mkv':
  Duration: 00:09:56.52, start: 0.000000, bitrate: N/A
    Stream #0.0: Audio: aac, 48000 Hz, stereo, s16
    Stream #0.1: Video: h264, yuv420p, 1920x1080, PAR 1:1 DAR 16:9, 24 tbr, 1k tbn, 48 tbc
[21:23:38] scan: decoding previews for title 1
[21:23:39] scan: 10 previews, 1920x1080, 24.000 fps, autocrop = 0/0/0/0, aspect 16:9, PAR 1:1
[21:23:39] scan: title (0) job->width:1936, job->height:1088
[21:23:39] libhb: scan thread found 1 valid title(s)
[21:23:40] macgui: ScanDone state received from fQueueEncodeLibhb
[21:23:40] macgui: processNewQueueEncode title list is: 1
[21:23:40] macgui: Preset: B-Frames
[21:23:40] macgui: processNewQueueEncode number of passes expected is: 1
[21:23:40] macgui: prepareJob exiting
[21:23:40] 1 job(s) to process
[21:23:40] starting job
[21:23:40] job configuration:
[21:23:40]  * source
[21:23:40]    + /Users/tim/Movies/BigBuckBunny.mkv
[21:23:40]    + title 1, chapter(s) 1 to 1
[21:23:40]    + container: matroska
[21:23:40]  * destination
[21:23:40]    + /Users/tim/Desktop/BigBuckBunny svn2289.mp4
[21:23:40]    + container: MPEG-4 (.mp4 and .m4v)
[21:23:40]  * video track
[21:23:40]    + decoder: h264
[21:23:40]    + frame rate: same as source (around 24.000 fps)
[21:23:40]    + strict anamorphic
[21:23:40]      + storage dimensions: 1920 * 1080 -> 1920 * 1080, crop 0/0/0/0
[21:23:40]      + pixel aspect ratio: 1 / 1
[21:23:40]      + display dimensions: 1920 * 1080
[21:23:40]    + encoder: x264
[21:23:40]      + options: ref=2:me=umh:bframes=2
[21:23:40]      + quality: 22.00 (RF)
[21:23:40]  * audio track 0
[21:23:40]    + decoder: Unknown (AAC) (track 1, id 0)
[21:23:40]    + mixdown: Stereo
[21:23:40]    + dynamic range compression: 1.000000
[21:23:40]    + encoder: ca_aac
[21:23:40]      + bitrate: 256 kbps, samplerate: 48000 Hz
[21:23:40] dvd: not a dvd - trying as a stream/file instead
[21:23:40] reader: first SCR 0
[21:23:40] encx264: keyint-min: 25, keyint-max: 241
[21:23:40] encx264: encoding with stored aspect 1/1
[21:23:40] encx264: Encoding at constant RF 22.000000
x264 [info]: using SAR=1/1
x264 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 FastShuffle SSE4.1 Cache64
x264 [info]: profile Main, level 4.0
[21:23:40] sync: expecting 14340 video frames
[21:23:40] sync: adding 171 ms of silence to audio 0  start 15390, next 0
[21:59:20] reader: done. 1 scr changes
[21:59:53] sync: got 14314 frames, 14340 expected
[21:59:53] work: average encoding speed for job is 6.587075 fps
[21:59:57] h264-decoder done: 14315 frames, 0 decoder errors, 0 drops
[21:59:57] render: lost time: 0 (0 frames)
[21:59:57] render: gained time: 0 (0 frames) (0 not accounted for)
x264 [info]: slice I:176   Avg QP:13.94  size:240761  PSNR Mean Y:51.11 U:55.74 V:56.41 Avg:52.12 Global:49.56
x264 [info]: slice P:15129 Avg QP:16.26  size: 22277  PSNR Mean Y:47.81 U:52.97 V:53.66 Avg:48.85 Global:46.80
x264 [info]: slice B:8552  Avg QP:17.55  size:  5423  PSNR Mean Y:47.75 U:52.55 V:53.33 Avg:48.79 Global:46.67
x264 [info]: consecutive B-frames: 44.7%  4.7% 50.7%
x264 [info]: mb I  I16..4: 25.2%  0.0% 74.8%
x264 [info]: mb P  I16..4:  2.0%  0.0%  2.9%  P16..4: 30.7%  5.6%  4.7%  0.0%  0.0%    skip:54.1%
x264 [info]: mb B  I16..4:  0.8%  0.0%  0.0%  B16..8: 11.7%  0.6%  0.4%  direct: 8.1%  skip:78.5%  L0:34.6% L1:59.1% BI: 6.3%
x264 [info]: ref P L0  83.8% 16.2%
x264 [info]: SSIM Mean Y:0.9921465
x264 [info]: PSNR Mean Y:47.809 U:52.839 V:53.563 Avg:48.851 Global:46.767 kb/s:3426.68
[21:59:57] aac-decoder done: 0 frames, 0 decoder errors, 0 drops
[21:59:57] libhb: work result = 0
QuickTime: 40.00 fps, log: 3426.68 kb/s vs. MediaInfo: 5711 Kbps

svn2289 (with Ritsuka's Core Audio patch) and my modification (ref=2:umh:bframes=2)

Code: Select all

HandBrake Activity Log for /Users/tim/Desktop/BigBuckBunny 160-182.mp4: 2009-04-07 20:55:37 +0200
Handbrake Version: svn2289 i386 (2009040701)

[20:55:37] macgui: Rip: Pending queue count is 0
[20:55:37] macgui: Rip: No pending jobs, so sending this one to doAddToQueue
[20:55:37] macgui: Rip: Going right to performNewQueueScan
[20:55:37] macgui: scanning specifically for title: 1
[20:55:37] macgui: performNewQueueScan currentQueueEncodeIndex is: 0
[20:55:37] hb_scan: path=/Users/tim/Movies/BigBuckBunny.mkv, title_index=1
[20:55:37] scan: trying to open with libdvdread
[20:55:37] dvd: not a dvd - trying as a stream/file instead
Input #0, matroska, from '/Users/tim/Movies/BigBuckBunny.mkv':
  Duration: 00:09:56.52, start: 0.000000, bitrate: N/A
    Stream #0.0: Audio: aac, 48000 Hz, stereo, s16
    Stream #0.1: Video: h264, yuv420p, 1920x1080, PAR 1:1 DAR 16:9, 24 tbr, 1k tbn, 48 tbc
[20:55:37] scan: decoding previews for title 1
[20:55:38] scan: 10 previews, 1920x1080, 24.000 fps, autocrop = 0/0/0/0, aspect 16:9, PAR 1:1
[20:55:38] scan: title (0) job->width:1936, job->height:1088
[20:55:38] libhb: scan thread found 1 valid title(s)
[20:55:38] macgui: ScanDone state received from fQueueEncodeLibhb
[20:55:38] macgui: processNewQueueEncode title list is: 1
[20:55:38] macgui: Preset: B-Frames
[20:55:38] macgui: processNewQueueEncode number of passes expected is: 1
[20:55:38] macgui: prepareJob exiting
[20:55:38] 1 job(s) to process
[20:55:38] starting job
[20:55:38] job configuration:
[20:55:38]  * source
[20:55:38]    + /Users/tim/Movies/BigBuckBunny.mkv
[20:55:38]    + title 1, chapter(s) 1 to 1
[20:55:38]    + container: matroska
[20:55:38]  * destination
[20:55:38]    + /Users/tim/Desktop/BigBuckBunny 160-182.mp4
[20:55:38]    + container: MPEG-4 (.mp4 and .m4v)
[20:55:38]  * video track
[20:55:38]    + decoder: h264
[20:55:38]    + frame rate: same as source (around 24.000 fps)
[20:55:38]    + strict anamorphic
[20:55:38]      + storage dimensions: 1920 * 1080 -> 1920 * 1080, crop 0/0/0/0
[20:55:38]      + pixel aspect ratio: 1 / 1
[20:55:38]      + display dimensions: 1920 * 1080
[20:55:38]    + encoder: x264
[20:55:38]      + options: ref=2:me=umh:bframes=2
[20:55:38]      + quality: 22.00 (RF)
[20:55:38]  * audio track 0
[20:55:38]    + decoder: Unknown (AAC) (track 1, id 0)
[20:55:38]    + mixdown: Stereo
[20:55:38]    + dynamic range compression: 1.000000
[20:55:38]    + encoder: ca_aac
[20:55:38]      + bitrate: 256 kbps, samplerate: 48000 Hz
[20:55:38] dvd: not a dvd - trying as a stream/file instead
[20:55:38] encx264: keyint-min: 25, keyint-max: 241
[20:55:38] reader: first SCR 0
[20:55:38] encx264: encoding with stored aspect 1/1
[20:55:38] encx264: Encoding at constant RF 22.000000
x264 [info]: using SAR=1/1
x264 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 FastShuffle SSE4.1 Cache64
x264 [info]: profile Main, level 4.0
[20:55:38] sync: expecting 14340 video frames
[20:55:38] sync: adding 171 ms of silence to audio 0  start 15390, next 0
[21:21:33] reader: done. 1 scr changes
[21:21:56] sync: got 14314 frames, 14340 expected
[21:21:56] work: average encoding speed for job is 9.075645 fps
[21:21:59] h264-decoder done: 14315 frames, 0 decoder errors, 0 drops
[21:21:59] render: lost time: 0 (0 frames)
[21:21:59] render: gained time: 0 (0 frames) (0 not accounted for)
x264 [info]: slice I:146   Avg QP:15.51  size:204134  PSNR Mean Y:49.98 U:55.23 V:56.11 Avg:51.08 Global:48.72
x264 [info]: slice P:5507  Avg QP:17.81  size: 32750  PSNR Mean Y:46.87 U:52.36 V:53.13 Avg:47.97 Global:45.88
x264 [info]: slice B:8661  Avg QP:19.82  size:  8355  PSNR Mean Y:46.15 U:51.72 V:52.55 Avg:47.28 Global:45.40
x264 [info]: consecutive B-frames:  5.6% 10.7% 83.7%
x264 [info]: mb I  I16..4: 26.5%  0.0% 73.5%
x264 [info]: mb P  I16..4:  4.7%  0.0%  5.9%  P16..4: 37.7%  8.0%  5.4%  0.0%  0.0%    skip:38.3%
x264 [info]: mb B  I16..4:  1.6%  0.0%  0.0%  B16..8: 17.3%  1.1%  0.7%  direct: 7.3%  skip:72.0%  L0:39.2% L1:52.7% BI: 8.1%
x264 [info]: ref P L0  80.2% 19.8%
x264 [info]: SSIM Mean Y:0.9900188
x264 [info]: PSNR Mean Y:46.462 U:51.998 V:52.810 Avg:47.583 Global:45.602 kb/s:3789.48
[21:21:59] aac-decoder done: 0 frames, 0 decoder errors, 0 drops
[21:21:59] libhb: work result = 0
QuickTime: 24.00 fps, log: 3789.48 kb/s vs. MediaInfo: 3790 Kbps
User avatar
Rodeo
HandBrake Team
Posts: 12619
Joined: Tue Mar 03, 2009 8:55 pm

Re: [Invalid] [SVN 2263] Incorrect Framerate

Post by Rodeo »

After briefly looking at this topic, I decided to try another experiment, and instead of commenting out lines 160 to 182 of encx264.c, to increase the number by which pv->init_delay is multiplied, setting job->areBframes to a higher value of 4 instead of 1 or 2 (lines 164, 175 and 180).

With this change, I now get the same framerate whether b-frames are enabled or not (and the bitrate matches).

Also, I noticed that encoding with jbrjake's suggested test settings (in the topic above) of bframes=16:b-pyramid:no-b-adapt seems to "hide" the problem, i.e. I get the same framerate as with bframes disabled (and bitrate match) in either 0.9.3 or svn2289 (unlike when using only bframes=2).
JoeBob
Posts: 9
Joined: Sat Feb 24, 2007 8:44 am

Re: [Invalid] [SVN 2263] Incorrect Framerate

Post by JoeBob »

downinitjr wrote:I don't know about rodeo, but the reason I started this thread was because after using the tv preset on many different .mkv files, I have just recently started seeing the issue reported. Up until now all of the re-encodes I have done have worked fine on my tv without ever having to change <same as source> to a specified frame-rate. I was under the assumption that when mediaInfo was telling me it's 23.976 fps, that same as source would produce 23.976 fps as well. It has only been recently that I have been getting files on occasion that will not show up or sync to the tv, and after opening the files in quicktime find the reported framerate different than what I thought it would produce. I suppose it could have been just blind luck that I never experienced this up until now which is why I was checking here.
I've noticed this problem with several of the recent SVN builds too. Reading jbrbrake's comments is like trying to read a linux book, all theory. Man, If we want good looking video that will sync with the AppleTV, then my question is (and I think the original idea here) what setting should be used to achieve optimal quality without sacrificing compatibility? Do we need to specify FPS from this point forward with all titles? If so, why the change? I just know that manually setting the FPS makes the files play oddly and a bit jittery @ 23.976FPS. In my case, Handbrake SVN builds (recent only) are identifying my titles as 24fps instead of 23.976fps and then outputting wildly high FPS when using same as source. Like this...

Code: Select all

Input #0, matroska, from '/Volumes/**********/***************.mkv':
  Duration: 01:36:26.49, start: 0.000000, bitrate: N/A
    Stream #0.0: Video: h264, yuv420p, 1920x1080, PAR 1:1 DAR 16:9, 24 tbr, 1k tbn, 47.95 tbc
    Stream #0.1(eng): Audio: ac3, 48000 Hz, 5.1, s16
[01:30:41] scan: decoding previews for title 1
[01:30:41] scan: audio 0x1: AC-3, rate=48000Hz, bitrate=448000 English (AC3) (5.1 ch)
[01:30:45] scan: 20 previews, 1920x1080, 24.000 fps, autocrop = 134/134/2/0, aspect 16:9, PAR 1:1
[01:30:45] scan: title (0) job->width:1920, job->height:816
[01:30:45] libhb: scan thread found 1 valid title(s)
[01:30:47] macgui: ScanDone state received from fHandle
Whereas (and I can't remember the SVN build, but it is almost a month old) shows...

Code: Select all

Input #0, matroska, from '/Volumes/**********/***************.mkv':
  Duration: 01:36:26.49, start: 0.000000, bitrate: N/A
    Stream #0.0: Video: h264, yuv420p, 1920x1080, 23.98 tb(r)
    Stream #0.1(eng): Audio: ac3, 48000 Hz, 5.1, s16
[01:13:53] scan: decoding previews for title 1
[01:13:53] scan: audio 0x1: AC-3, rate=48000Hz, bitrate=448000 English (AC3) (5.1 ch)
[01:13:55] scan: 20 previews, 1920x1080, 23.976 fps, autocrop = 134/134/2/0, aspect 16:9, PAR 1:1
[01:13:55] scan: title (0) job->width:1920, job->height:816
[01:13:55] libhb: scan thread found 1 valid title(s)
So, again, should I be choosing same as source, 24FPS, or 23.976FPS for titles like these? I think that's what we all want to know so we can sync these suckers up! :D
Post Reply