Does Handbrake automatically detect telecine and detelecine?

HandBrake for Windows support
Forum rules
An Activity Log is required for support requests. Please read How-to get an activity log? for details on how and why this should be provided.
Post Reply
jockohomo
Posts: 2
Joined: Sun Apr 21, 2019 1:19 am

Does Handbrake automatically detect telecine and detelecine?

Post by jockohomo »

Description of problem or question:

I just encoded some DVD content using the CLI version of handbrake and had noticed that I forgot to specify that the content was telecined. However, I've been watching the content and it looks fine, as if it were detelecined. I did a test where I specifically detelecined and, while the file wasn't identical, it was nearly identical (the file sizes were off by about 13 kB) and the image quality is, as far as I can tell, identical.

My question is: how is this possible? Does the CLI program automatically detect telecine and detelecine before encoding?

Using handbrake version 1.2.2 on Windows 10, 64 bit.

Since this is the CLI, I don't know about logs but here's the CLI output with the actual encoding removed for brevity:

Code: Select all

[21:35:26] hb_init: starting libhb thread
[21:35:26] thread 68b5660 started ("libhb")
HandBrake 1.2.2 (2019022300) - MinGW x86_64 - https://handbrake.fr
4 CPUs detected
Opening E:...
[21:35:26] CPU: Intel(R) Core(TM) i5-6600 CPU @ 3.30GHz
[21:35:26]  - Intel microarchitecture Skylake
[21:35:26]  - logical processor count: 4
[21:35:26] Intel Quick Sync Video support: no
[21:35:26] hb_scan: path=E:, title_index=2
src/libbluray/disc/disc.c:424: error opening file BDMV\index.bdmv
src/libbluray/disc/disc.c:424: error opening file BDMV\BACKUP\index.bdmv
[21:35:26] bd: not a bd - trying as a stream/file instead
libdvdnav: Using dvdnav version 6.0.0

Scanning title 1 of 1, 0.00 %libdvdnav: Unable to open device file E:.
libdvdnav: vm: dvd_read_name failed
libdvdnav: DVD disk reports itself with Region mask 0x00fe0000. Regions: 1

libdvdread: Attempting to retrieve all CSS keys
libdvdread: This can take a _long_ time, please be patient

libdvdread: Get key for /VIDEO_TS/VIDEO_TS.VOB at 0x00000136
libdvdread: Elapsed time 0
libdvdread: Get key for /VIDEO_TS/VTS_01_0.VOB at 0x0000d564
libdvdread: Elapsed time 0
libdvdread: Get key for /VIDEO_TS/VTS_01_1.VOB at 0x0000d568
libdvdread: Elapsed time 0
libdvdread: Get key for /VIDEO_TS/VTS_02_0.VOB at 0x000280cb
libdvdread: Elapsed time 0
libdvdread: Get key for /VIDEO_TS/VTS_02_1.VOB at 0x0002bc06
libdvdread: Elapsed time 0
libdvdread: Get key for /VIDEO_TS/VTS_03_0.VOB at 0x003e20e1
libdvdread: Elapsed time 0
libdvdread: Get key for /VIDEO_TS/VTS_03_1.VOB at 0x003e20e5
libdvdread: Elapsed time 0
libdvdread: Get key for /VIDEO_TS/VTS_04_0.VOB at 0x003e42f4
libdvdread: Elapsed time 0
libdvdread: Get key for /VIDEO_TS/VTS_04_1.VOB at 0x003e42f8
libdvdread: Elapsed time 0
libdvdread: Found 4 VTS's
libdvdread: Elapsed time 0

Scanning title 1 of 1, 0.00 %[21:35:27] scan: DVD has 9 title(s)
[21:35:27] scan: scanning title 2

Scanning title 1 of 1, 0.00 %[21:35:27] scan: opening IFO for VTS 2

Scanning title 1 of 1, 0.00 %
Scanning title 1 of 1, 0.00 %[21:35:27] scan: duration is 00:46:48 (2808867 ms)
[21:35:27] pgc_id: 1, pgn: 1: pgc: 00000000068FE250
[21:35:27] scan: vts=2, ttn=1, cells=0->4, blocks=0->2338151, 790302 blocks
[21:35:27] scan: checking audio 1
[21:35:27] scan: id=0x80bd, lang=English (AC3), 3cc=eng ext=0
[21:35:27] scan: checking subtitle 1
[21:35:27] scan: id=0x20bd, lang=English (Wide Screen) [VOBSUB], 3cc=eng ext=0
[21:35:27] scan: checking subtitle 2
[21:35:27] scan: id=0x21bd, lang=espa¤ol (Wide Screen) [VOBSUB], 3cc=spa ext=0
[21:35:27] scan: title 2 has 5 chapters
[21:35:27] scan: chap 1 c=0->0, b=0->54226 (54227), 193033 ms
[21:35:27] scan: chap 2 c=1->1, b=54227->367891 (313665), 1106000 ms
[21:35:27] scan: chap 3 c=2->2, b=367892->559266 (191375), 688633 ms
[21:35:27] scan: chap 4 c=3->3, b=559267->790296 (231030), 820200 ms
[21:35:27] scan: chap 5 c=4->4, b=2338147->2338151 (5), 1000 ms
[21:35:27] scan: aspect = 16:9
[21:35:27] scan: decoding previews for title 2
libdvdnav: DVD disk reports itself with Region mask 0x00fe0000. Regions: 1

Scanning title 1 of 1, preview 1, 0.00 %[21:35:28] scan: title angle(s) 1

Scanning title 1 of 1, preview 1, 10.00 %[ac3 @ 0000000006706680] frame sync error
[21:35:28] scan: audio 0x80bd: ac3, rate=48000Hz, bitrate=192000 English (AC3) (2.0 ch)

Scanning title 1 of 1, preview 2, 20.00 %
Scanning title 1 of 1, preview 4, 40.00 %
Scanning title 1 of 1, preview 5, 50.00 %
Scanning title 1 of 1, preview 7, 70.00 %
Scanning title 1 of 1, preview 8, 80.00 %
Scanning title 1 of 1, preview 10, 100.00 %[21:35:29] scan: 10 previews, 720x480, 23.976 fps, autocrop = 0/2/0/0, aspect 16:9, PAR 32:27
[21:35:29] libhb: scan thread found 1 valid title(s)
+ Using preset: CLI Default
+ title 2:
  + vts 2, ttn 1, cells 0->4 (790302 blocks)
  + duration: 00:46:48
  + size: 720x480, pixel aspect: 32/27, display aspect: 1.78, 23.976 fps
  + autocrop: 0/2/0/0
  + chapters:
    + 1: cells 0->0, 54227 blocks, duration 00:03:13
    + 2: cells 1->1, 313665 blocks, duration 00:18:26
    + 3: cells 2->2, 191375 blocks, duration 00:11:29
    + 4: cells 3->3, 231030 blocks, duration 00:13:40
    + 5: cells 4->4, 5 blocks, duration 00:00:01
  + audio tracks:
    + 1, English (AC3) (2.0 ch) (iso639-2: eng), 48000Hz, 192000bps
  + subtitle tracks:
    + 1, English (Wide Screen) [VOBSUB]
    + 2, español (Wide Screen) [VOBSUB]
[21:35:29] 1 job(s) to process
[21:35:29] json job:
{
    "Audio": {
        "AudioList": [
            {
                "Bitrate": 128,
                "CompressionLevel": -1.0,
                "DRC": 0.0,
                "DitherMethod": "auto",
                "Encoder": "av_aac",
                "Gain": 8.0,
                "Mixdown": "stereo",
                "NormalizeMixLevel": false,
                "PresetEncoder": "av_aac",
                "Quality": -3.0,
                "Samplerate": 0,
                "Track": 0
            }
        ],
        "CopyMask": [
            "copy:aac",
            "copy:ac3",
            "copy:eac3",
            "copy:dtshd",
            "copy:dts",
            "copy:mp3",
            "copy:truehd",
            "copy:flac"
        ],
        "FallbackEncoder": "av_aac"
    },
    "Destination": {
        "AlignAVStart": false,
        "ChapterList": [
            {
                "Name": "Chapter 1"
            },
            {
                "Name": "Chapter 2"
            },
            {
                "Name": "Chapter 3"
            },
            {
                "Name": "Chapter 4"
            },
            {
                "Name": "Chapter 5"
            }
        ],
        "ChapterMarkers": true,
        "File": "actual_filename_redacted.mp4",
        "InlineParameterSets": false,
        "Mp4Options": {
            "IpodAtom": false,
            "Mp4Optimize": false
        },
        "Mux": "m4v"
    },
    "Filters": {
        "FilterList": [
            {
                "ID": 6,
                "Settings": {
                    "mode": 0
                }
            },
            {
                "ID": 11,
                "Settings": {
                    "crop-bottom": 2,
                    "crop-left": 0,
                    "crop-right": 0,
                    "crop-top": 0,
                    "height": 480,
                    "width": 852
                }
            }
        ]
    },
    "Metadata": {},
    "PAR": {
        "Den": 1,
        "Num": 1
    },
    "SequenceID": 0,
    "Source": {
        "Angle": 0,
        "Path": "E:",
        "Range": {
            "End": 5,
            "Start": 1,
            "Type": "chapter"
        },
        "Title": 2
    },
    "Subtitle": {
        "Search": {
            "Burn": true,
            "Default": false,
            "Enable": false,
            "Forced": false
        },
        "SubtitleList": []
    },
    "Video": {
        "ColorMatrix": 6,
        "ColorPrimaries": 6,
        "ColorTransfer": 1,
        "Encoder": "nvenc_h265",
        "QSV": {
            "AsyncDepth": 4,
            "Decode": false
        },
        "Quality": 28.0,
        "Turbo": false,
        "TwoPass": false
    }
}
[21:35:29] starting job
[21:35:29] job configuration:
[21:35:29]  * source
[21:35:29]    + E:
[21:35:29]    + title 2, chapter(s) 1 to 5
[21:35:29]  * destination
[21:35:29]    + actual_filename_redacted.mp4
[21:35:29]    + container: MPEG-4 (libavformat)
[21:35:29]      + chapter markers
[21:35:29]  * video track
[21:35:29]    + decoder: mpeg2video
[21:35:29]      + bitrate 200 kbps
[21:35:29]    + filters
[21:35:29]      + Framerate Shaper (mode=0)
[21:35:29]        + frame rate: same as source (around 23.976 fps)
[21:35:29]      + Crop and Scale (width=852:height=480:crop-top=0:crop-bottom=2:crop-left=0:crop-right=0)
[21:35:29]        + source: 720 * 480, crop (0/2/0/0): 720 * 478, scale: 852 * 480
[21:35:29]    + Output geometry
[21:35:29]      + storage dimensions: 852 x 480
[21:35:29]      + pixel aspect ratio: 1 : 1
[21:35:29]      + display dimensions: 852 x 480
[21:35:29]    + encoder: H.265 (NVEnc)
[21:35:29]      + quality: 28.00 (CQ)
[21:35:29]      + color profile: 6-1-6
[21:35:29]  * audio track 1
[21:35:29]    + decoder: English (AC3) (2.0 ch) (track 1, id 0x80bd)
[21:35:29]      + bitrate: 192 kbps, samplerate: 48000 Hz
[21:35:29]    + mixdown: Stereo
[21:35:29]    + gain: 8dB
[21:35:29]    + dither: triangular
[21:35:29]    + encoder: AAC (libavcodec)
[21:35:29]      + bitrate: 128 kbps, samplerate: 48000 Hz
libdvdnav: Using dvdnav version 6.0.0
libdvdnav: Unable to open device file E:.
libdvdnav: vm: dvd_read_name failed
libdvdnav: DVD disk reports itself with Region mask 0x00fe0000. Regions: 1

libdvdread: Attempting to retrieve all CSS keys
libdvdread: This can take a _long_ time, please be patient

libdvdread: Get key for /VIDEO_TS/VIDEO_TS.VOB at 0x00000136
libdvdread: Elapsed time 0
libdvdread: Get key for /VIDEO_TS/VTS_01_0.VOB at 0x0000d564
libdvdread: Elapsed time 0
libdvdread: Get key for /VIDEO_TS/VTS_01_1.VOB at 0x0000d568
libdvdread: Elapsed time 0
libdvdread: Get key for /VIDEO_TS/VTS_02_0.VOB at 0x000280cb
libdvdread: Elapsed time 0
libdvdread: Get key for /VIDEO_TS/VTS_02_1.VOB at 0x0002bc06
libdvdread: Elapsed time 0
libdvdread: Get key for /VIDEO_TS/VTS_03_0.VOB at 0x003e20e1
libdvdread: Elapsed time 0
libdvdread: Get key for /VIDEO_TS/VTS_03_1.VOB at 0x003e20e5
libdvdread: Elapsed time 0
libdvdread: Get key for /VIDEO_TS/VTS_04_0.VOB at 0x003e42f4
libdvdread: Elapsed time 0
libdvdread: Get key for /VIDEO_TS/VTS_04_1.VOB at 0x003e42f8
libdvdread: Elapsed time 0
libdvdread: Found 4 VTS's
libdvdread: Elapsed time 0
libdvdnav: DVD disk reports itself with Region mask 0x00fe0000. Regions: 1

Thank you...
User avatar
BradleyS
Moderator
Posts: 1860
Joined: Thu Aug 09, 2007 12:16 pm

Re: Does Handbrake automatically detect telecine and detelecine?

Post by BradleyS »

The official presets have combing detection and decomb on by default, so the combing artifacts created by telecine are removed. This does not automatically restore the frame rate to film; to do so you must enable the detelecine filter (NTSC only).
jockohomo
Posts: 2
Joined: Sun Apr 21, 2019 1:19 am

Re: Does Handbrake automatically detect telecine and detelecine?

Post by jockohomo »

But the frame rate of the encoded video is 23.976, despite it being from a DVD of a television show. Decombing also has obvious side effects that I didn't notice when looking at the video...
User avatar
BradleyS
Moderator
Posts: 1860
Joined: Thu Aug 09, 2007 12:16 pm

Re: Does Handbrake automatically detect telecine and detelecine?

Post by BradleyS »

It's possible the source is soft telecine'd, meaning it's actually progressive but the stream tells the player to telecine on the fly. HandBrake, in this case, will ignore the soft telecine flags and work from the progressive frames.
User avatar
JohnAStebbins
HandBrake Team
Posts: 5712
Joined: Sat Feb 09, 2008 7:21 pm

Re: Does Handbrake automatically detect telecine and detelecine?

Post by JohnAStebbins »

BradleyS wrote: Sun Apr 21, 2019 6:42 am HandBrake, in this case, will ignore the soft telecine flags and work from the progressive frames.
Actually, it's the other way around. The video is encoded as telecined content, i.e. it's interlaced 29.97 fps with the 3:2 pulldown pattern of fields. The flags tell us which fields to repeat and when to repeat them in order to detelecine. After detelecine using the flags, the output is 23.976 fps.
User avatar
JohnAStebbins
HandBrake Team
Posts: 5712
Joined: Sat Feb 09, 2008 7:21 pm

Re: Does Handbrake automatically detect telecine and detelecine?

Post by JohnAStebbins »

Umm, I'm making total dog food of the explanation. Bradley is more right than I am. But the flags are not ignored either. The flags do tell how to create telecine from progressive frames by telling how to repeat fields (as Bradley said). But we use those repeat flags to tell us what the actual duration of the frame is. The header in the stream says the framerate is 29.97 because if you interpret the flags as you should, that would be the output framerate. When we see enough frames with the repeat flags, we adjust the reported framerate to 23.976.

Normally the timestamps in the stream will tell us the duration of each frame. But in mpeg PS and TS streams, not every frame has a timestamp and they have to be interpolated between the frames that do have timestamps. The repeat flags till us how to extend the nominal frame duration computed from the header framerate.
Post Reply