Will nonexistent source tracks be ignored?

Discussion of the HandBrake command line interface (CLI)
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
Gnd0
Posts: 11
Joined: Sun Jul 19, 2015 9:27 am

Will nonexistent source tracks be ignored?

Post by Gnd0 »

Hello,

I'd like to batch convert a TV show using a Windows batch file. A few episodes come with extra commentary audio + subtitle tracks which I want to preserve.

If I use the same cli command on all episodes, what happens to episodes with nonexistent extra tracks?

Will there be empty tracks or in the resulting mkv or are they just ignored. I want to avoid having useless, blank tracks in the files and on the other hand, I want to avoid having to examine the DVD sources in detail to adapt my script for every single episode accordingly.

Thanks for any input, any help will be appreciated.
AlBundy
Bright Spark User
Posts: 377
Joined: Mon Dec 31, 2012 4:47 am

Re: Will nonexistent source tracks be ignored?

Post by AlBundy »

I'm not sure but simply add a non existing track an test it. ;-)

For converting episodes you can also use my script: viewtopic.php?f=10&t=26163

Al
Gnd0
Posts: 11
Joined: Sun Jul 19, 2015 9:27 am

Re: Will nonexistent source tracks be ignored?

Post by Gnd0 »

Learning by doing :D Made a few tests an found out that nonexisting audio tracks are replaced by the last valid track in my selection and encoded with the settings of the missing track. Haven't tested subtitle tracks though.

Don't know whether this is intended behaviour or just a CLI bug. But my question is answered.

This is the encode log in case someone is interested. The log file even says that track number 4 could not be found.

Code: Select all

[22:59:45] hb_init: starting libhb thread
HandBrake 0.10.2 (2015060900) - MinGW x86_64 - https://handbrake.fr
4 CPUs detected
Opening C:\_MKV\TVShowWithEpisodes...
[22:59:45] CPU: Intel(R) Core(TM) i5-2500 CPU @ 3.30GHz
[22:59:45]  - Intel microarchitecture Sandy Bridge
[22:59:45]  - logical processor count: 4
[22:59:45] OpenCL device #1: NVIDIA Corporation GeForce GTX 750 Ti
[22:59:45]  - OpenCL version: 1.2 CUDA
[22:59:45]  - driver version: 353.30
[22:59:45]  - device type:    GPU
[22:59:45]  - supported:      no
[22:59:45] Intel Quick Sync Video support: no
[22:59:45] hb_scan: path=C:\_MKV\TVShowWithEpisodes, title_index=4
libbluray/bdnav/index_parse.c:162: indx_parse(): error opening C:\_MKV\TVShowWithEpisodes/BDMV/index.bdmv
libbluray/bdnav/index_parse.c:162: indx_parse(): error opening C:\_MKV\TVShowWithEpisodes/BDMV/BACKUP/index.bdmv
libbluray/bluray.c:2182: nav_get_title_list(C:\_MKV\TVShowWithEpisodes) failed
[22:59:45] bd: not a bd - trying as a stream/file instead
libdvdnav: Using dvdnav version 5.0.1
libdvdread: Encrypted DVD support unavailable.
libdvdread: Could not open input: Permission denied
libdvdread: Can't open C:\_MKV\TVShowWithEpisodes for reading
libdvdread: Device C:\_MKV\TVShowWithEpisodes inaccessible, CSS authentication not available.
libdvdnav: DVD disk reports itself with Region mask 0x00000000. Regions: 1 2 3 4 5 6 7 8
libdvdread: Encrypted DVD support unavailable.
libdvdread: Could not open input: Permission denied
libdvdread: Can't open C:\_MKV\TVShowWithEpisodes for reading
libdvdread: Device C:\_MKV\TVShowWithEpisodes inaccessible, CSS authentication not available.
[22:59:45] scan: DVD has 10 title(s)
[22:59:45] scan: scanning title 4
[22:59:45] scan: opening IFO for VTS 1
[22:59:45] scan: duration is 00:21:07 (1267480 ms)
[22:59:45] pgc_id: 3, pgn: 1: pgc: 0000000001FF0360
[22:59:45] scan: vts=1, ttn=3, cells=0->5, blocks=446305->3451473, 429013 blocks
[22:59:45] scan: checking audio 1
[22:59:45] scan: id=0x80bd, lang=English (AC3), 3cc=eng ext=0
[22:59:45] scan: checking audio 2
[22:59:45] scan: id=0x81bd, lang=Deutsch (AC3), 3cc=deu ext=0
[22:59:45] scan: checking audio 3
[22:59:45] scan: id=0x82bd, lang=Italiano (AC3), 3cc=ita ext=0
[22:59:45] scan: checking audio 4
[22:59:45] scan: audio channel is not active
[22:59:45] scan: checking subtitle 1
[22:59:45] scan: id=0x20bd, lang=English, 3cc=eng ext=0
[22:59:45] scan: checking subtitle 2
[22:59:45] scan: id=0x21bd, lang=Deutsch, 3cc=deu ext=0
[22:59:45] scan: checking subtitle 3
[22:59:45] scan: id=0x22bd, lang=Italiano, 3cc=ita ext=0
[22:59:45] scan: checking subtitle 4
[22:59:45] scan: id=0x23bd, lang=Portugues, 3cc=por ext=0
[22:59:45] scan: checking subtitle 5
[22:59:45] scan: id=0x24bd, lang=Deutsch, 3cc=deu ext=0
[22:59:45] scan: checking subtitle 6
[22:59:45] scan: id=0x25bd, lang=Italiano, 3cc=ita ext=0
[22:59:45] scan: checking subtitle 7
[22:59:45] scan: id=0x28bd, lang=Deutsch, 3cc=deu ext=0
[22:59:45] scan: checking subtitle 8
[22:59:45] scan: id=0x28bd, lang=Italiano, 3cc=ita ext=0
[22:59:45] scan: title 4 has 6 chapters
[22:59:45] scan: chap 1 c=0->0, b=446305->519175 (72871), 213520 ms
[22:59:45] scan: chap 2 c=1->1, b=519176->571570 (52395), 146080 ms
[22:59:45] scan: chap 3 c=2->2, b=571571->702829 (131259), 369160 ms
[22:59:45] scan: chap 4 c=3->3, b=702830->769333 (66504), 197680 ms
[22:59:45] scan: chap 5 c=4->4, b=769334->875265 (105932), 340560 ms
[22:59:45] scan: chap 6 c=5->5, b=3451422->3451473 (52), 480 ms
[22:59:45] scan: aspect = 1.33333
[22:59:45] scan: decoding previews for title 4
libdvdnav: DVD disk reports itself with Region mask 0x00000000. Regions: 1 2 3 4 5 6 7 8
libdvdnav: Language 'en' not found, using 'ÿÿ' instead
libdvdnav: Menu Languages available: ÿÿ 
[22:59:45] scan: title angle(s) 1
[ac3 @ 00000000050cb320] frame sync error
[ac3 @ 0000000005151680] frame sync error
[22:59:45] scan: audio 0x80bd: ac3, rate=48000Hz, bitrate=448000 English (AC3) (5.1 ch)
[ac3 @ 00000000020a6a20] frame sync error
[22:59:45] scan: audio 0x82bd: ac3, rate=48000Hz, bitrate=192000 Italiano (AC3) (2.0 ch) (Dolby Surround)
[ac3 @ 00000000020a6a20] frame sync error
[22:59:45] scan: audio 0x81bd: ac3, rate=48000Hz, bitrate=192000 Deutsch (AC3) (2.0 ch) (Dolby Surround)
[22:59:45] scan: 10 previews, 720x576, 25.000 fps, autocrop = 0/0/0/0, aspect 4:3, PAR 16:15
[22:59:45] libhb: scan thread found 1 valid title(s)
+ title 4:
  + vts 1, ttn 3, cells 0->5 (429013 blocks)
  + duration: 00:21:07
  + size: 720x576, pixel aspect: 16/15, display aspect: 1.33, 25.000 fps
  + autocrop: 0/0/0/0
  + support opencl: no
  + support hwd: no
  + chapters:
    + 1: cells 0->0, 72871 blocks, duration 00:03:34
    + 2: cells 1->1, 52395 blocks, duration 00:02:26
    + 3: cells 2->2, 131259 blocks, duration 00:06:09
    + 4: cells 3->3, 66504 blocks, duration 00:03:18
    + 5: cells 4->4, 105932 blocks, duration 00:05:41
    + 6: cells 5->5, 52 blocks, duration 00:00:00
  + audio tracks:
    + 1, English (AC3) (5.1 ch) (iso639-2: eng), 48000Hz, 448000bps
    + 2, Deutsch (AC3) (2.0 ch) (Dolby Surround) (iso639-2: deu), 48000Hz, 192000bps
    + 3, Italiano (AC3) (2.0 ch) (Dolby Surround) (iso639-2: ita), 48000Hz, 192000bps
  + subtitle tracks:
    + 1, English (iso639-2: eng) (Bitmap)(VOBSUB)
    + 2, Deutsch (iso639-2: deu) (Bitmap)(VOBSUB)
    + 3, Italiano (iso639-2: ita) (Bitmap)(VOBSUB)
    + 4, Portugues (iso639-2: por) (Bitmap)(VOBSUB)
    + 5, Deutsch (iso639-2: deu) (Bitmap)(VOBSUB)
    + 6, Italiano (iso639-2: ita) (Bitmap)(VOBSUB)
    + 7, Deutsch (iso639-2: deu) (Bitmap)(VOBSUB)
    + 8, Italiano (iso639-2: ita) (Bitmap)(VOBSUB)
Warning: Could not find audio track '4', skipped
More audio codecs than audio tracks, copying track 2 and using encoder fdk_aac
[22:59:46] 1 job(s) to process
[22:59:46] starting job
[22:59:46] work: sanitizing track 2 mixdown Dolby Pro Logic II to Dolby Surround
[22:59:46] sync: expecting 31687 video frames
[22:59:46] job configuration:
[22:59:46]  * source
[22:59:46]    + C:\_MKV\TVShowWithEpisodes
[22:59:46]    + title 4, chapter(s) 1 to 6
[22:59:46]  * destination
[22:59:46]    + C:\_MKV\_MKV\Testepisode.mkv
[22:59:46]    + container: Matroska (libavformat)
[22:59:46]      + chapter markers
[22:59:46]  * video track
[22:59:46]    + decoder: mpeg2video
[22:59:46]      + bitrate 7500 kbps
[22:59:46]    + filters
[22:59:46]      + Framerate Shaper (1:27000000:1080000)
[22:59:46]        + frame rate: 25.000 fps -> constant 25.000 fps
[22:59:46]      + Crop and Scale (720:576:0:0:0:0)
[22:59:46]        + source: 720 * 576, crop (0/0/0/0): 720 * 576, scale: 720 * 576
[22:59:46]    + strict anamorphic
[22:59:46]      + storage dimensions: 720 * 576, mod 2
[22:59:46]      + pixel aspect ratio: 16 / 15
[22:59:46]      + display dimensions: 768 * 576
[22:59:46]    + encoder: H.264 (libx264)
[22:59:46]      + preset:  ultrafast
[22:59:46]      + tune:    film
[22:59:46]      + profile: high
[22:59:46]      + level:   4.1
[22:59:46]      + quality: 18.00 (RF)
[22:59:46]  * subtitle track 1, English (track 1, id 0x20bd) Picture [VOBSUB] -> Passthrough
[22:59:46]  * subtitle track 2, Deutsch (track 7, id 0x28bd) Picture [VOBSUB] -> Passthrough
[22:59:46]  * audio track 1
[22:59:46]    + name: Dolby Surround
[22:59:46]    + decoder: English (AC3) (5.1 ch) (track 1, id 0x80bd)
[22:59:46]      + bitrate: 448 kbps, samplerate: 48000 Hz
[22:59:46]    + mixdown: Dolby Surround
[22:59:46]    + dynamic range compression: 1.000000
[22:59:46]    + dither: triangular
[22:59:46]    + encoder: AAC (libfdk_aac)
[22:59:46]      + bitrate: 160 kbps, samplerate: 48000 Hz
[22:59:46]  * audio track 2
[22:59:46]    + name: Dolby Pro Logic II
[22:59:46]    + decoder: Deutsch (AC3) (2.0 ch) (Dolby Surround) (track 2, id 0x81bd)
[22:59:46]      + bitrate: 192 kbps, samplerate: 48000 Hz
[22:59:46]    + mixdown: Dolby Surround
[22:59:46]    + dynamic range compression: 1.000000
[22:59:46]    + dither: triangular
[22:59:46]    + encoder: AAC (libfdk_aac)
[22:59:46]      + bitrate: 160 kbps, samplerate: 48000 Hz
[22:59:46]  * audio track 3
[22:59:46]    + name: Kommentar
[22:59:46]    + decoder: Deutsch (AC3) (2.0 ch) (Dolby Surround) (track 2, id 0x81bd)
[22:59:46]      + bitrate: 192 kbps, samplerate: 48000 Hz
[22:59:46]    + mixdown: Mono
[22:59:46]    + dynamic range compression: 1.000000
[22:59:46]    + dither: triangular
[22:59:46]    + encoder: AAC (libfdk_aac)
[22:59:46]      + bitrate: 80 kbps, samplerate: 48000 Hz
libdvdnav: Using dvdnav version 5.0.1
libdvdread: Encrypted DVD support unavailable.
libdvdread: Could not open input: Permission denied
libdvdread: Can't open C:\_MKV\TVShowWithEpisodes for reading
libdvdread: Device C:\_MKV\TVShowWithEpisodes inaccessible, CSS authentication not available.
libdvdnav: DVD disk reports itself with Region mask 0x00000000. Regions: 1 2 3 4 5 6 7 8
libdvdread: Encrypted DVD support unavailable.
libdvdread: Could not open input: Permission denied
libdvdread: Can't open C:\_MKV\TVShowWithEpisodes for reading
libdvdread: Device C:\_MKV\TVShowWithEpisodes inaccessible, CSS authentication not available.
libdvdnav: DVD disk reports itself with Region mask 0x00000000. Regions: 1 2 3 4 5 6 7 8
libdvdnav: Language 'en' not found, using 'ÿÿ' instead
libdvdnav: Menu Languages available: ÿÿ 
[22:59:46] encx264: encoding at constant RF 18.000000
[22:59:46] encx264: unparsed options: level=4.1:ref=1:scenecut=0:bframes=0:no-deblock=1:cabac=0:analyse=none:8x8dct=0:weightp=0:me=dia:subme=0:mixed-refs=0:trellis=0:psy-rd=1.00,0.15:vbv-bufsize=62500:vbv-maxrate=50000:aq-mode=0:mbtree=0:rc-lookahead=0
x264 [info]: using SAR=16/15
[22:59:46] reader: first SCR 146 id 0xe0 DTS 1226
x264 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX
[22:59:46] mpeg2video: "Chapter 1" (1) at frame 0 time 0
x264 [info]: profile Constrained Baseline, level 4.1
[22:59:57] mpeg2video: "Chapter 2" (2) at frame 5338 time 19220400
[23:00:04] mpeg2video: "Chapter 3" (3) at frame 8990 time 32367600
[23:00:24] mpeg2video: "Chapter 4" (4) at frame 18219 time 65592000
[23:00:34] mpeg2video: "Chapter 5" (5) at frame 23161 time 83383200
[23:00:51] mpeg2video: "Chapter 6" (6) at frame 31673 time 114026400
libdvdnav: Language 'en' not found, using 'ÿÿ' instead
libdvdnav: Menu Languages available: ÿÿ 
libdvdnav: Language 'en' not found, using 'ÿÿ' instead
libdvdnav: Menu Languages available: ÿÿ 
[23:00:51] reader: done. 2 scr changes
[23:00:51] 1267.040039s: Video -> Film
[23:00:51] work: average encoding speed for job is 481.411774 fps
[23:00:52] sync: got 31676 frames, 31687 expected
[23:00:52] render: 31677 frames output, 0 dropped and 1 duped for CFR/PFR
[23:00:52] render: lost time: 0 (0 frames)
[23:00:52] render: gained time: 0 (0 frames) (0 not accounted for)
[23:00:52] mpeg2video-decoder done: 31676 frames, 0 decoder errors, 0 drops
x264 [info]: frame I:130   Avg QP:14.45  size: 69032
x264 [info]: frame P:31547 Avg QP:17.58  size: 19080
x264 [info]: mb I  I16..4: 100.0%  0.0%  0.0%
x264 [info]: mb P  I16..4:  7.9%  0.0%  0.0%  P16..4: 81.9%  0.0%  0.0%  0.0%  0.0%    skip:10.2%
x264 [info]: coded y,uvDC,uvAC intra: 53.1% 78.1% 36.8% inter: 53.5% 59.8% 9.2%
x264 [info]: i16 v,h,dc,p: 44% 23% 24%  9%
x264 [info]: i8c dc,h,v,p: 35% 23% 32%  9%
x264 [info]: kb/s:3856.95
[23:00:52] ac3-decoder done: 0 frames, 0 decoder errors, 0 drops
[23:00:52] ac3-decoder done: 0 frames, 0 decoder errors, 0 drops
[23:00:52] ac3-decoder done: 0 frames, 0 decoder errors, 0 drops
[23:00:52] mux: track 0, 31677 frames, 610877920 bytes, 3856.92 kbps, fifo 1024
[23:00:52] mux: track 1, 59389 frames, 25339307 bytes, 159.99 kbps, fifo 2048
[23:00:52] mux: track 2, 59391 frames, 25340161 bytes, 159.99 kbps, fifo 2048
[23:00:52] mux: track 3, 59391 frames, 12670081 bytes, 80.00 kbps, fifo 2048
[23:00:52] mux: track 4, 312 frames, 710964 bytes, 4.49 kbps, fifo 16
[23:00:52] mux: track 5, 0 frames, 0 bytes, 0.00 kbps, fifo 8
[23:00:52] libhb: work result = 0

Encode done!
HandBrake has exited.
AlBundy
Bright Spark User
Posts: 377
Joined: Mon Dec 31, 2012 4:47 am

Re: Will nonexistent source tracks be ignored?

Post by AlBundy »

If you use my script you don't have to care about track numbers - you can select them by duration intervalls.
Post Reply