converting HD 60fps capture to 24fps?

General questions or discussion about HandBrake, Video and/or audio transcoding, trends etc.
Post Reply
Conner
Posts: 38
Joined: Wed Jan 03, 2007 12:58 am

converting HD 60fps capture to 24fps?

Post by Conner » Wed Sep 30, 2009 12:32 pm

Hello,

I have a blackmagic video capture card that use to capture output from my Dish Network HD DVR. I have the DVR set to output at 1280x720 60P, and the blackmagic captures 1280x720 photo jpeg 59.94 fps. The frames are progressive, though depending on the actual source some jerkiness can be seen, but capturing at 1280x720 60P seems to work better than capturing at 1920x1080 60i. Handbrake handles these files well, but I am wondering if there is a way to handle a certain situation that has come up at times.

Most captures are 60fps, and I sometimes compress to 60fps or 30fps depending on the nature of the file. Some captures are clearly 24fps. They *look* to be HD rather than upsampled but I suppose I could be wrong about that. Frames are...
New/Dup/New/Dup/Dup/New (repeat), 2 of every 5 frames are new, so 24 new frames every 60.

With these, if I compress to 60fps or especially 30fps, the video is jerky as there are duplicate frames in the file at times. If I compress to 24fps, it's a bit of a crap shoot. Some parts look great, as every frame is new, but then parts get off and I get a new/dup/new/dup pattern. My guess is things get off due to scene changes and/or editing out commercials in the raw file.

Is there a setting I can use to handle these sorts of files?

on edit - I am using the latest snapshot on OSX 10.5
Thanks!

jbrjake
Veteran User
Posts: 4805
Joined: Wed Dec 13, 2006 1:38 am

Re: converting HD 60fps capture to 24fps?

Post by jbrjake » Wed Sep 30, 2009 1:57 pm

Are the duped frames actual duplicates, or are they blended mixtures of 2 frames? If it's the former, there are, theoretically, ways we could look at removing them by examining frame pixel content for similarity. But if they're blended frames, like dynaflash gets from his cable company's broadcasts of Lost, there's not much I can think of to fix it. There probably are clever ways to detect blending, but I don't know what they are. I assume detelecine doesn't work, even if you go to 1080i?

Conner
Posts: 38
Joined: Wed Jan 03, 2007 12:58 am

Re: converting HD 60fps capture to 24fps?

Post by Conner » Wed Sep 30, 2009 2:22 pm

to my eye they look like dupe frames. Doesn't mean they are though. Is there something specific I should be looking for to see if they're blended? I have not tried detelecine with 1080i, and I have deleted the source off the DVR so I can't try it with this one, but I should have another one I can test it on. Thanks for the suggestion, I'll see what I can find.

on edit - ok, looking at the capture very closely, I can see very slight differences between the 'duplicate' frames, so I'm guessing they are blended.

Conner
Posts: 38
Joined: Wed Jan 03, 2007 12:58 am

Re: converting HD 60fps capture to 24fps?

Post by Conner » Wed Sep 30, 2009 3:16 pm

ok, I have another file that looks to be 24fps, I've captured at 1080i, and when played back in QT it shows as 29.97fps and has frames that are ...

prog/prog/prog/interlaced/interlaced.

so it looks like a good candidate for detelecine. I set up a test using video filter detelecine (Default) and framerate of 23.976. It looks like it didn't remove/combine the proper frames, I now have...

prog/prog/prog/interlaced

I can understand that this sort of thing isn't easy, and it's not really the purpose for HandBrake, and I'm thrilled that it handles most any video file I throw at it as good as it does. 'Back in the day' it seemed that the only thing that could remotely handle video files like this was Cleaner... there was a reason they could charge what they did for it.

Happy to try different settings, the decomb/deinterlace/detelecine settings are a bit confusing to me, even after reading about them (unless I'm just not reading the latest documentation on them).

jbrjake
Veteran User
Posts: 4805
Joined: Wed Dec 13, 2006 1:38 am

Re: converting HD 60fps capture to 24fps?

Post by jbrjake » Fri Oct 02, 2009 7:30 pm

What if you don't set the fps to 23.976 and just leave it same as source when running detelecine? Are there still interlaced frames then?

Conner
Posts: 38
Joined: Wed Jan 03, 2007 12:58 am

Re: converting HD 60fps capture to 24fps?

Post by Conner » Mon Oct 05, 2009 6:20 pm

leaving the frame rate same as source, it looks like it it might have caught a few frames as the frame rate in the final compression is 29.73 fps, but for the most part it is leaving the interlaced frames there.

jbrjake
Veteran User
Posts: 4805
Joined: Wed Dec 13, 2006 1:38 am

Re: converting HD 60fps capture to 24fps?

Post by jbrjake » Tue Oct 06, 2009 2:21 pm

Could use activity logs, as well as a short (less than 30 seconds) sample of the source you're trying to encode, so I can test against it.

Conner
Posts: 38
Joined: Wed Jan 03, 2007 12:58 am

Re: converting HD 60fps capture to 24fps?

Post by Conner » Tue Oct 06, 2009 5:27 pm

the raw files are large (37.5mbits/sec, so 30 seconds = 135MB), what is the best way to get something like that to you?

Thanks again.

here is the activity log of the encode of the 30 second clip I made, starting fps of 29.97, compressed fps is 29.61

Code: Select all

[12:31:20] hb_init: checking cpu count
[12:31:21] hb_init: starting libhb thread
[12:31:21] macgui: Handbrake Version: svn2845 x86_64 (2009092801)
[12:31:21] hb_init: checking cpu count
[12:31:21] hb_init: starting libhb thread
[12:31:21] hb_init: checking cpu count
[12:31:21] hb_init: starting libhb thread
[12:31:28] macgui: trying to open video_ts folder (parent directory chosen)
[12:31:28] hb_scan: path=/Volumes/Scratch/1080iSnip.mov, title_index=0
[12:31:28] scan: trying to open with libdvdread
libdvdread: Encrypted DVD support unavailable.
libdvdnav:DVDOpenFileUDF:UDFFindFile /VIDEO_TS/VIDEO_TS.IFO failed
libdvdnav:DVDOpenFileUDF:UDFFindFile /VIDEO_TS/VIDEO_TS.BUP failed
libdvdread: Can't open file VIDEO_TS.IFO.
GUI ERROR dialog: dvd: ifoOpen failed
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/Volumes/Scratch/1080iSnip.mov':
  Duration: 00:00:30.29, start: 0.-00334, bitrate: 37456 kb/s
    Stream #0.0(eng): Video: mjpeg, yuvj422p, 1920x1080 [PAR 1:1 DAR 16:9], 29.97 tbr, 2997 tbn, 2997 tbc
    Stream #0.1(eng): Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
[12:31:28] scan: decoding previews for title 1
[12:31:30] scan: 10 previews, 1920x1080, 29.970 fps, autocrop = 0/0/0/6, aspect 16:9, PAR 1:1
[12:31:30] scan: title (0) job->width:1936, job->height:1088
[12:31:30] libhb: scan thread found 1 valid title(s)
[12:31:31] macgui: ScanDone state received from fHandle
[12:32:10] macgui: Rip: Pending queue count is 0
[12:32:10] macgui: scanning specifically for title: 1
[12:32:10] macgui: performNewQueueScan currentQueueEncodeIndex is: 0
[12:32:10] hb_scan: path=/Volumes/Scratch/1080iSnip.mov, title_index=1
[12:32:10] scan: trying to open with libdvdread
libdvdread: Encrypted DVD support unavailable.
libdvdnav:DVDOpenFileUDF:UDFFindFile /VIDEO_TS/VIDEO_TS.IFO failed
libdvdnav:DVDOpenFileUDF:UDFFindFile /VIDEO_TS/VIDEO_TS.BUP failed
libdvdread: Can't open file VIDEO_TS.IFO.
GUI ERROR dialog: dvd: ifoOpen failed
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/Volumes/Scratch/1080iSnip.mov':
  Duration: 00:00:30.29, start: 0.-00334, bitrate: 37456 kb/s
    Stream #0.0(eng): Video: mjpeg, yuvj422p, 1920x1080 [PAR 1:1 DAR 16:9], 29.97 tbr, 2997 tbn, 2997 tbc
    Stream #0.1(eng): Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
[12:32:10] scan: decoding previews for title 1
[12:32:11] scan: 10 previews, 1920x1080, 29.970 fps, autocrop = 0/0/0/6, aspect 16:9, PAR 1:1
[12:32:11] scan: title (0) job->width:1936, job->height:1088
[12:32:11] libhb: scan thread found 1 valid title(s)
[12:32:11] macgui: ScanDone state received from fQueueEncodeLibhb
[12:32:11] macgui: Preset: Custom
[12:32:11] macgui: processNewQueueEncode number of passes expected is: 1
[12:32:11] macgui: prepareJob exiting
[12:32:11] 1 job(s) to process
[12:32:11] starting job
[12:32:11] job configuration:
[12:32:11]  * source
[12:32:11]    + /Volumes/Scratch/1080iSnip.mov
[12:32:11]    + title 1, chapter(s) 1 to 1
[12:32:11]    + container: mov,mp4,m4a,3gp,3g2,mj2
[12:32:11]    + data rate: 37456 kbps
[12:32:11]  * destination
[12:32:11]    + /Volumes/Opf/handbrake/1080iSnip.mp4
[12:32:11]    + container: MPEG-4 (.mp4 and .m4v)
[12:32:11]  * video track
[12:32:11]    + decoder: mjpeg
[12:32:11]    + frame rate: same as source (around 29.970 fps)
[12:32:11]    + dimensions: 1920 * 1080 -> 1920 * 1080, crop 0/0/0/0
[12:32:11]    + filter
[12:32:11]      + Detelecine (pullup) (default settings)
[12:32:11]    + encoder: x264
[12:32:11]      + quality: 25.50 (RF)
[12:32:11]  * audio track 0
[12:32:11]    + decoder: English (PCM_S16) (track 1, id 1)
[12:32:11]    + mixdown: Stereo
[12:32:11]    + encoder: faac
[12:32:11]      + bitrate: 128 kbps, samplerate: 48000 Hz
[12:32:11] encx264: keyint-min: 30, keyint-max: 300
libdvdread: Encrypted DVD support unavailable.
[12:32:11] encx264: Encoding at constant RF 25.500000
libdvdnav:DVDOpenFileUDF:UDFFindFile /VIDEO_TS/VIDEO_TS.IFO failed
libdvdnav:DVDOpenFileUDF:UDFFindFile /VIDEO_TS/VIDEO_TS.BUP failed
libdvdread: Can't open file VIDEO_TS.IFO.
GUI ERROR dialog: dvd: ifoOpen failed
x264 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 Cache64
x264 [info]: profile High, level 4.0
[12:32:11] reader: first SCR 0 id 1 DTS 0
[12:32:11] sync: expecting 937 video frames
[12:32:11] sync: first pts is -1
[12:33:04] reader: done. 1 scr changes
[12:33:34] sync: got 907 frames, 937 expected
[12:33:34] work: average encoding speed for job is 10.935957 fps
[12:33:44] mux: track 0, 896 frames, 19385676 bytes, 5124.49 kbps, fifo 64
[12:33:44] mux: track 1, 1419 frames, 484829 bytes, 128.16 kbps, fifo 1024
[12:33:44] mjpeg-decoder done: 908 frames, 0 decoder errors, 0 drops
[12:33:44] render: lost time: 33033 (11 frames)
[12:33:44] render: gained time: 33033 (44 frames) (0 not accounted for)
[12:33:44] render: average dropped frame duration: 3003
x264 [info]: frame I:8     Avg QP:22.63  size: 77910  PSNR Mean Y:44.68 U:49.97 V:49.56 Avg:45.78 Global:44.59
x264 [info]: frame P:724   Avg QP:25.28  size: 23956  PSNR Mean Y:42.69 U:47.87 V:47.67 Avg:43.79 Global:43.43
x264 [info]: frame B:164   Avg QP:26.61  size:  8649  PSNR Mean Y:41.26 U:45.80 V:46.21 Avg:42.33 Global:42.12
x264 [info]: consecutive B-frames: 63.1% 36.9%  0.0%  0.0%
x264 [info]: mb I  I16..4: 23.3% 71.3%  5.4%
x264 [info]: mb P  I16..4: 14.0% 16.2%  1.1%  P16..4: 28.4%  2.5%  2.0%  0.0%  0.0%    skip:35.8%
x264 [info]: mb B  I16..4:  0.6%  0.9%  0.0%  B16..8: 29.9%  0.3%  0.6%  direct: 2.8%  skip:64.9%  L0:39.7% L1:58.1% BI: 2.2%
x264 [info]: 8x8 transform intra:52.5% inter:91.3%
x264 [info]: coded y,uvDC,uvAC intra: 28.1% 57.5% 8.6% inter: 11.9% 21.5% 0.6%
x264 [info]: i16 v,h,dc,p: 48% 28% 12% 11%
x264 [info]: i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 16% 17% 53%  2%  2%  3%  2%  2%  3%
x264 [info]: i4 v,h,dc,ddl,ddr,vr,hd,vl,hu:  6% 81%  5%  1%  2%  2%  2%  1%  1%
x264 [info]: ref P L0: 71.0% 15.5% 13.5%
x264 [info]: ref B L0: 82.5% 17.5%
x264 [info]: SSIM Mean Y:0.9756391
x264 [info]: PSNR Mean Y:42.447 U:47.507 V:47.419 Avg:43.538 Global:43.169 kb/s:5187.49
[12:33:45] pcm_s16le-decoder done: 0 frames, 0 decoder errors, 0 drops
[12:33:45] libhb: work result = 0
[12:33:45] macgui: incrementQueueItemDone currentQueueEncodeIndex is incremented to: 1
[12:33:45] macgui: incrementQueueItemDone the 0 item queue is complete


jbrjake
Veteran User
Posts: 4805
Joined: Wed Dec 13, 2006 1:38 am

Re: converting HD 60fps capture to 24fps?

Post by jbrjake » Wed Oct 07, 2009 1:57 pm

Hmm...a little too big for the sites I usually use -- drop.io or mediafire.com. Maybe try megashares.com?

User avatar
s55
HandBrake Team
Posts: 9523
Joined: Sun Dec 24, 2006 1:05 pm

Re: converting HD 60fps capture to 24fps?

Post by s55 » Wed Oct 07, 2009 2:00 pm

split zip archive.

Conner
Posts: 38
Joined: Wed Jan 03, 2007 12:58 am

Re: converting HD 60fps capture to 24fps?

Post by Conner » Wed Oct 07, 2009 5:35 pm

jbrjake wrote:Hmm...a little too big for the sites I usually use -- drop.io or mediafire.com. Maybe try megashares.com?
not used it before, but seems to have worked...

http://www.MegaShare.com/1507400

jbrjake
Veteran User
Posts: 4805
Joined: Wed Dec 13, 2006 1:38 am

Re: converting HD 60fps capture to 24fps?

Post by jbrjake » Thu Oct 08, 2009 2:59 pm

Thanks, will take a look at it as soon as i get a chance.

jbrjake
Veteran User
Posts: 4805
Joined: Wed Dec 13, 2006 1:38 am

Re: converting HD 60fps capture to 24fps?

Post by jbrjake » Fri Oct 09, 2009 4:36 pm

Ahhh.....the problem is that the source is MJPEG.

When the detelecine filter can't find MPEG-2 picture flags in the frame buffer, it assumes the source is BFF (bottom field first). When HandBrake reads an MJPEG source using ffmpeg, it doesn't have those picture flags. So it's trying to weave fields back together in the wrong order. I'll fix this by adding a parity parameter to the detelecine options, and changing the default assumption to Top Field First. Probably won't happen until after 0.9.4...feeling a little cautious about changing this, since I imagine Richard Felker had good reason to default to BFF instead.

Conner
Posts: 38
Joined: Wed Jan 03, 2007 12:58 am

Re: converting HD 60fps capture to 24fps?

Post by Conner » Fri Oct 09, 2009 6:08 pm

jbrjake wrote:Ahhh.....the problem is that the source is MJPEG.

When the detelecine filter can't find MPEG-2 picture flags in the frame buffer, it assumes the source is BFF (bottom field first). When HandBrake reads an MJPEG source using ffmpeg, it doesn't have those picture flags. So it's trying to weave fields back together in the wrong order. I'll fix this by adding a parity parameter to the detelecine options, and changing the default assumption to Top Field First. Probably won't happen until after 0.9.4...feeling a little cautious about changing this, since I imagine Richard Felker had good reason to default to BFF instead.
I am pretty sure that DV is BFF, while most everything else is TFF.

jbrjake
Veteran User
Posts: 4805
Joined: Wed Dec 13, 2006 1:38 am

Re: converting HD 60fps capture to 24fps?

Post by jbrjake » Fri Oct 09, 2009 6:29 pm

Right, but it's a little more complicated than that, since there's no such thing as a BFF bit in the MPEG-2 picture flags.

Something is seen as BFF when it lacks a TFF flag. The issue is that the lack of a TFF flag does not necessarily mean a source is BFF. As with this case, it can merely mean that ffmpeg is not properly and consistently setting the fields in its AVFrame structure.

Currently, pullup handles mpeg-2 sources with either parity. This autodetection depends on the "no TFF == BFF" assumption, and there's no inverse along the lines of "No BFF == TFF"... If I merely set the filter to always use TFF, it will fail on DV, and it will fail on any other MPEG-2 sources which happen to be BFF (if it's in the spec, it can happen). I'd rather not cause a regression.

Getting this right will mean exposing the filters to more of the library's state than is currently in their purview, so this can be decided on a codec-by-codec basis.

Post Reply