Detelecine option is broken with EveTV HD capture files

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.

*******************************
Post Reply
Elan
Posts: 35
Joined: Wed Jan 30, 2008 6:32 am

Detelecine option is broken with EveTV HD capture files

Post by Elan »

Hi,

I have a video file with a clear 3:2 hard telecine pattern but Handbrake detelecine option fail to remove them.

I guess as it's a file from an EveTV HD capture box the duplicate frames causing telecine may not be exactly identical so the detelecine option fail to identify and drop them.

I hope you can solve that one to be able to retrieve the 23.976 original progressive frames from a NTSC 29.97 telecined footage.

Thank you,

Sample Video File (1:30 mins / 150Mb)

Encoding log :

Code: Select all

HandBrake Activity Log for /Volumes/USERS/elan/Desktop/BrokenTelecine.m4v: 2010-08-01 13:49:17 -0400
Handbrake Version: svn3466 x86_64 (2010080101)

[13:49:17] macgui: Rip: Pending queue count is 0
[13:49:17] macgui: getNextPendingQueueIndex next pending encod index is:0
[13:49:17] macgui: scanning specifically for title: 1
[13:49:17] hb_scan: path=/Volumes/USERS/elan/Desktop/BrokenTelecine.mpg, title_index=1
[13:49:17] thread 121dfc000 started ("scan")
[13:49:17] scan: trying to open with libdvdread
libdvdnav: Using dvdnav version 4.1.3
libdvdread: Using libdvdcss version 1.2.10 for DVD access
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.
libdvdnav: vm: failed to read VIDEO_TS.IFO
[13:49:17] dvd: not a dvd - trying as a stream/file instead
[13:49:17] file is MPEG Transport Stream with 188 byte packets offset 0 bytes
[13:49:17] hb_ts_stream_find_pids - found the following PIDS
[13:49:17]     Video PIDS : 
[13:49:17]       0x23 type H.264 (0x1b)
[13:49:17]     Audio PIDS : 
[13:49:17]       0x22 type ISO 13818-7 AAC Audio (0xf)
[13:49:17] transport stream pid 0x22 (type 0xf) may be ISO 13818-7 AAC Audio audio (id 0x1)
[13:49:17] scan: decoding previews for title 1
[13:49:17] scan: preview 1
[13:49:17] fifo_close: trashing 0 buffer(s)
[13:49:17] scan: audio 0x1: aac, rate=48000Hz, bitrate=222750 Unknown (aac) (2.0 ch)
[13:49:17] scan: preview 2
[13:49:17] Interlacing detected in preview frame 2
[13:49:17] scan: preview 3
[13:49:17] scan: preview 4
[13:49:17] scan: preview 5
[13:49:17] scan: preview 6
[13:49:17] scan: preview 7
[13:49:17] scan: preview 8
[13:49:17] scan: preview 9
[13:49:17] scan: preview 10
[13:49:17] scan: preview 11
[13:49:17] scan: preview 12
[13:49:17] scan: preview 13
[13:49:18] scan: preview 14
[13:49:18] scan: preview 15
[13:49:18] scan: preview 16
[13:49:18] scan: preview 17
[13:49:18] scan: preview 18
[13:49:18] scan: preview 19
[13:49:18] scan: preview 20
[13:49:18] scan: preview 21
[13:49:18] scan: preview 22
[13:49:18] scan: preview 23
[13:49:18] scan: preview 24
[13:49:18] scan: preview 25
[13:49:18] scan: preview 26
[13:49:18] scan: preview 27
[13:49:18] scan: preview 28
[13:49:18] scan: preview 29
[13:49:19] scan: preview 30
[13:49:19] scan: 30 previews, 1920x1080, 29.970 fps, autocrop = 144/136/0/6, aspect 16:9, PAR 1:1
[13:49:19] scan: title (0) job->width:1920, job->height:800
[13:49:19] stream: 3 good frames, 0 errors (0%)
[13:49:19] thread 121dfc000 exited ("scan")
[13:49:19] thread 121dfc000 joined ("scan")
[13:49:19] libhb: scan thread found 1 valid title(s)
[13:49:19] macgui: ScanDone state received from fQueueEncodeLibhb
[13:49:19] macgui: Preset: Custom
[13:49:19] macgui: processNewQueueEncode number of passes expected is: 1
[13:49:19] macgui: Start / Stop set to chapters
[13:49:19] macgui: prepareJob exiting
[13:49:19] thread 11e633000 started ("work")
[13:49:19] 1 job(s) to process
[13:49:19] starting job
[13:49:19] sync: expecting 2798 video frames
[13:49:19] job configuration:
[13:49:19]  * source
[13:49:19]    + /Volumes/USERS/elan/Desktop/BrokenTelecine.mpg
[13:49:19]    + title 1, chapter(s) 1 to 1
[13:49:19]  * destination
[13:49:19]    + /Volumes/USERS/elan/Desktop/BrokenTelecine.m4v
[13:49:19]    + container: MPEG-4 (.mp4 and .m4v)
[13:49:19]      + 64-bit formatting
[13:49:19]      + optimized for progressive web downloads
[13:49:19]  * video track
[13:49:19]    + decoder: h264
[13:49:19]      + bitrate 200 kbps
[13:49:19]    + frame rate: same as source (around 29.970 fps)
[13:49:19]    + strict anamorphic
[13:49:19]      + storage dimensions: 1920 * 1080 -> 1914 * 800, crop 144/136/0/6, mod 16
[13:49:19]      + pixel aspect ratio: 1 / 1
[13:49:19]      + display dimensions: 1914 * 800
[13:49:19]    + filter
[13:49:19]      + Detelecine (pullup) (default settings)
[13:49:19]    + encoder: x264
[13:49:19]      + options: ref=6:bframes=6:subq=10:trellis=2:b-adapt=2:direct=spatial:me=esa:merange=32:psy-rd=1.0,0.15:no-dct-decimate=1:mbtree=0
[13:49:19]      + quality: 18.00 (RF)
[13:49:19]  * audio track 0
[13:49:19]    + decoder: Unknown (aac) (2.0 ch) (track 1, id 1)
[13:49:19]    + mixdown: Stereo
[13:49:19]    + encoder: ca_aac
[13:49:19]      + bitrate: 160 kbps, samplerate: 48000 Hz
[13:49:19] thread 11e6b6000 started ("reader")
[13:49:19] thread 11e739000 started ("AudioSynchronization")
[13:49:19] thread 11e7bc000 started ("Video decoder (libavcodec)")
[13:49:19] reader: first SCR 65810745 id 1 DTS 65824443
[13:49:19] thread 11f1de000 started ("Renderer")
[13:49:19] encx264: min-keyint: 30, keyint: 300
[13:49:19] encx264: encoding with stored aspect 1/1
[13:49:19] encx264: Encoding at constant RF 18.000000
[13:49:19] encx264: opening libx264 (pass 0)
x264 [info]: using SAR=1/1
x264 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 FastShuffle SSE4.1 Cache64
x264 [info]: profile High, level 5.0
[13:49:19] thread 1311c1000 started ("H.264/AVC encoder (libx264)")
[13:49:19] thread 131244000 started ("MPGA decoder (libavcodec)")
[13:49:19] thread 13455f000 started ("AAC encoder (Apple)")
[13:49:19] thread 1345e2000 started ("Video Synchronization")
[13:49:19] sync: video time didn't advance - dropped 2 frames (delta 35 ms, current 4504, next 7323, dur 2819)
[13:49:19] muxmp4: using 64-bit MP4 formatting.
[13:49:19] muxmp4: track 0, chunk duration 12012
[13:49:19] muxmp4: track 1, chunk duration 6407
[13:49:19] thread 134725000 started ("Muxer")
    Last message repeated 3902 times
[h264 @ 0x10383aa00]error while decoding MB 3 50, bytestream (-8)
[14:10:11] hb_ts_stream_decode - eof
[14:10:11] stream: 2767 good frames, 0 errors (0%)
[14:10:11] reader: done. 2 scr changes
[14:10:11] reader: 1 drops because DTS out of range
[14:10:11] thread 11e6b6000 exited ("reader")
[14:11:32] work: average encoding speed for job is 2.144594 fps
[14:11:32] thread 134725000 exited ("Muxer")
[14:11:32] thread 13455f000 exited ("AAC encoder (Apple)")
[14:11:32] thread 1345e2000 exited ("Video Synchronization")
[14:11:32] thread 1345e2000 joined ("Video Synchronization")
[14:11:32] sync: got 2762 frames, 2798 expected
[14:11:32] thread 11f1de000 exited ("Renderer")
[14:11:32] thread 11e739000 exited ("AudioSynchronization")
[14:11:32] thread 11e739000 joined ("AudioSynchronization")
[14:11:32] thread 11e7bc000 exited ("Video decoder (libavcodec)")
[14:11:32] thread 11e7bc000 joined ("Video decoder (libavcodec)")
[14:11:32] h264-decoder done: 2764 frames, 0 decoder errors, 0 drops
[14:11:32] thread 11f1de000 joined ("Renderer")
[14:11:32] render: lost time: 244745 (82 frames)
[14:11:32] render: gained time: 244745 (328 frames) (0 not accounted for)
[14:11:32] render: average dropped frame duration: 2984
[14:11:32] fifo_close: trashing 0 buffer(s)
[14:11:32] fifo_close: trashing 0 buffer(s)
[14:11:32] thread 1311c1000 exited ("H.264/AVC encoder (libx264)")
[14:11:32] thread 1311c1000 joined ("H.264/AVC encoder (libx264)")
[14:11:32] thread 131244000 exited ("MPGA decoder (libavcodec)")
x264 [info]: frame I:14    Avg QP:13.70  size:135050  PSNR Mean Y:52.02 U:55.32 V:55.11 Avg:52.83 Global:51.79
x264 [info]: frame P:727   Avg QP:15.44  size: 97699  PSNR Mean Y:48.38 U:51.44 V:51.85 Avg:49.21 Global:48.76
x264 [info]: frame B:1939  Avg QP:16.74  size: 45268  PSNR Mean Y:47.14 U:49.96 V:50.41 Avg:47.91 Global:47.50
x264 [info]: consecutive B-frames:  0.6%  9.5% 18.5% 39.8% 17.3% 12.6%  1.8%
x264 [info]: mb I  I16..4: 31.1% 39.0% 29.9%
x264 [info]: mb P  I16..4: 11.0% 22.0%  6.9%  P16..4: 27.4% 21.6%  9.1%  0.0%  0.0%    skip: 1.9%
x264 [info]: mb B  I16..4:  3.3%  6.2%  1.4%  B16..8: 33.4% 12.6%  3.1%  direct:21.2%  skip:18.7%  L0:48.2% L1:38.7% BI:13.1%
x264 [info]: 8x8 transform intra:55.4% inter:46.1%
x264 [info]: coded y,uvDC,uvAC intra: 91.2% 92.6% 78.4% inter: 43.2% 61.0% 26.9%
x264 [info]: i16 v,h,dc,p: 20% 17% 44% 19%
x264 [info]: i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 16% 20% 31%  4%  4%  6%  6%  6%  8%
x264 [info]: i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 18% 40% 16%  4%  4%  6%  5%  4%  5%
x264 [info]: i8c dc,h,v,p: 34% 33% 25%  9%
x264 [info]: Weighted P-Frames: Y:3.3%
x264 [info]: ref P L0: 55.6%  7.5% 18.9%  6.6%  6.1%  4.5%  0.8%  0.0%
x264 [info]: ref B L0: 67.9% 15.3% 13.7%  1.9%  1.2%
x264 [info]: ref B L1: 93.7%  6.3%
x264 [info]: SSIM Mean Y:0.9890015 (19.587db)
x264 [info]: PSNR Mean Y:47.500 U:50.387 V:50.827 Avg:48.291 Global:47.825 kb/s:13938.23
[14:11:33] thread 131244000 joined ("MPGA decoder (libavcodec)")
[14:11:33] aac-decoder done: 0 frames, 0 decoder errors, 0 drops
[14:11:33] thread 13455f000 joined ("AAC encoder (Apple)")
[14:11:33] thread 134725000 joined ("Muxer")
[14:11:33] muxmp4: optimizing file
[14:11:37] mux: file size, 162663870 bytes
[14:11:37] mux: track 0, 2680 frames, 160690707 bytes, 13928.87 kbps, fifo 8
[14:11:37] mux: video bitrate error, +160690707 bytes
[14:11:37] mux: track 1, 4327 frames, 1909336 bytes, 165.50 kbps, fifo 256
[14:11:37] mux: overhead, 9.11 bytes per frame
[14:11:37] thread 11e6b6000 joined ("reader")
[14:11:37] fifo_close: trashing 0 buffer(s)
[14:11:37] fifo_close: trashing 0 buffer(s)
[14:11:37] fifo_close: trashing 0 buffer(s)
[14:11:37] fifo_close: trashing 0 buffer(s)
[14:11:37] fifo_close: trashing 0 buffer(s)
[14:11:37] fifo_close: trashing 0 buffer(s)
[14:11:37] fifo_close: trashing 0 buffer(s)
[14:11:37] fifo_close: trashing 0 buffer(s)
[14:11:37] fifo_close: trashing 0 buffer(s)
[14:11:37] Freed 1 buffers of size 1024
[14:11:37] Freed 32 buffers of size 2048
[14:11:37] Freed 32 buffers of size 8192
[14:11:37] Freed 32 buffers of size 262144
[14:11:37] Freed 32 buffers of size 4194304
[14:11:37] Allocated 142935040 bytes of buffers on this pass and Freed 142935040 bytes, 0 bytes leaked
[14:11:37] thread 11e633000 exited ("work")
[14:11:37] thread 11e633000 joined ("work")
[14:11:37] libhb: work result = 0
Deleted User 11865

Re: Detelecine option is broken with EveTV HD capture files

Post by Deleted User 11865 »

HandBrake's filters (decomb/deinterlace/detelecine) can only reliably detect parity for MPEG-2 sources. If assumes bottom field first for other sources.

Did you try setting the parity manually? Custom detelecine, settings 1:1:4:4:-1:0:0 (defaults except with 0 instead of -1 for the last value - TFF instead of autodetect parity).
Deleted User 11865

Re: Detelecine option is broken with EveTV HD capture files

Post by Deleted User 11865 »

The problem is with the incorrect parity. With detelecine defaults (parity set to -1, i.e. autodetect) or parity set to 1 (BFF), the output is 29.07 fps; with parity set to 0 (TFF), the output is 24.28 fps (suggesting detelecine worked).

The workaround is to manually set the parity via a custom detelecine options string (parity is the last parameter).

http://handbrake.fr/pastebin/pastebin.php?show=1565
Elan
Posts: 35
Joined: Wed Jan 30, 2008 6:32 am

Re: Detelecine option is broken with EveTV HD capture files

Post by Elan »

Thank you,

I try it and it works quite well but some frames still remains combed. That's strange because it's a clear 3:2 pattern and there is no "hybrid" section in that clip. I thought it wouldn't be hard to correctly identify and drop telecined frames.

Maybe that's just another tweak I might do with the detelecine custom options but I didn't find any doc in the wiki explaining the parameters behind each value.

As a workaround I applied the last Decomb patch from Jbrjake on a clean SVN checkout then I enable it using the custom options 395:2:3:3:2:40. Looking at the decomb stats in the log, I realize that it find more combed frames than the few I saw in a detelecine only output file. Here is the stats from the 90 seconds posted clip :

Code: Select all

decomb: deinterlaced 237 | blended 322 | unfiltered 1679 | total 2238
It would be great if the detelecine filter can do all the work without missing somes frames. In my understanding, it's job is to recover the original 24p footage without the need to use decomb, throwing away some quality by deinterlacing them.
Post Reply