HB CLI 0.10.0: Bug with Forced Subs

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
nick24
Posts: 35
Joined: Fri Dec 19, 2014 4:38 pm

HB CLI 0.10.0: Bug with Forced Subs

Post by nick24 »

First of all I want to thank you for HandBrake CLI. I like it very much and it generally does a very good job.

I use HB on Windows since version 0.9.6 for creating mp4 files and unfortunately there was always a problem with certain (forced) subtitles, i.e. during playback the last subtitle stayed on screen till the end of the movie (with e.g. WD TV Live as media player). This problem could be handled by adding a dummy sample at the end of the subtitlte track by using mp4v2 afterwards.

But now with version 0.10.0 I encountered an error during encoding with a forced subtitle and passthrough. This means that 'avformatMux' quits the encoding process with error -22. When using 'subtitle-burned' the encoding succeeds but the last subtitle is visible in the movie till the end (this happens with mkv too). Therefore neither passthrough (ERROR) nor burned (stay forever) work with 0.10.0/mp4. With 0.9.9 the encoding process finishes for passthrough.

Below is the log.
Thanks in advance.

--- LOG ---

PS C:\Temp> HandBrakeCLI -i d:\ -o test.mp4 -t 1 -a 4 -E copy -s 4 -F -m --angle 3
[19:15:15] hb_init: starting libhb thread
HandBrake 0.10.0 (2014112200) - MinGW i686 - https://handbrake.fr
4 CPUs detected
Opening d:\...
[19:15:15] CPU: Intel(R) Core(TM) i5 CPU M 460 @ 2.53GHz
[19:15:15] - logical processor count: 4
[19:15:15] OpenCL device #1: NVIDIA Corporation NVS 3100M
[19:15:15] - OpenCL version: 1.0 CUDA
[19:15:15] - driver version: 312.69
[19:15:15] - device type: GPU
[19:15:15] - supported: no
[19:15:15] Intel Quick Sync Video support: no
[19:15:15] hb_scan: path=d:\, title_index=1
libbluray/bdnav/index_parse.c:162: indx_parse(): error opening d:\/BDMV/index.bdmv
libbluray/bdnav/index_parse.c:162: indx_parse(): error opening d:\/BDMV/BACKUP/index.bdmv
libbluray/bluray.c:2182: nav_get_title_list(d:\) failed
[19:15:15] 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: No such file or directory
libdvdread: Can't open d:\ for reading
libdvdread: Device d:\ 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: No such file or directory
libdvdread: Can't open d:\ for reading
libdvdread: Device d:\ inaccessible, CSS authentication not available.
[19:15:15] scan: DVD has 92 title(s)
[19:15:15] scan: scanning title 1
[19:15:15] scan: opening IFO for VTS 1
[19:15:15] dvd: Skipping multi-angle cells 1-3
[19:15:15] dvd: Skipping multi-angle cells 6-8
[19:15:15] dvd: Skipping multi-angle cells 21-23
[19:15:15] dvd: Skipping multi-angle cells 29-31
[19:15:15] dvd: Skipping multi-angle cells 6-8
[19:15:15] dvd: Skipping multi-angle cells 21-23
[19:15:15] dvd: Skipping multi-angle cells 29-31
[19:15:15] dvd: Skipping multi-angle cells 21-23
[19:15:15] dvd: Skipping multi-angle cells 29-31
[19:15:15] dvd: Skipping multi-angle cells 21-23
[19:15:15] dvd: Skipping multi-angle cells 29-31
[19:15:15] dvd: Skipping multi-angle cells 21-23
[19:15:15] dvd: Skipping multi-angle cells 29-31
[19:15:15] dvd: Skipping multi-angle cells 21-23
[19:15:15] dvd: Skipping multi-angle cells 29-31
[19:15:15] dvd: Skipping multi-angle cells 21-23
[19:15:15] dvd: Skipping multi-angle cells 29-31
[19:15:15] dvd: Skipping multi-angle cells 21-23
[19:15:15] dvd: Skipping multi-angle cells 29-31
[19:15:15] dvd: Skipping multi-angle cells 21-23
[19:15:15] dvd: Skipping multi-angle cells 29-31
[19:15:15] dvd: Skipping multi-angle cells 21-23
[19:15:15] dvd: Skipping multi-angle cells 29-31
[19:15:15] dvd: Skipping multi-angle cells 21-23
[19:15:15] dvd: Skipping multi-angle cells 29-31
[19:15:15] dvd: Skipping multi-angle cells 21-23
[19:15:15] dvd: Skipping multi-angle cells 29-31
[19:15:15] dvd: Skipping multi-angle cells 21-23
[19:15:15] dvd: Skipping multi-angle cells 29-31
[19:15:15] dvd: Skipping multi-angle cells 29-31
[19:15:15] dvd: Skipping multi-angle cells 29-31
[19:15:15] dvd: Skipping multi-angle cells 29-31
[19:15:15] scan: duration is 01:40:36 (6036000 ms)
[19:15:15] pgc_id: 1, pgn: 1: pgc: 02E10DE8
[19:15:15] scan: vts=1, ttn=1, cells=0->32, blocks=0->2721722, 2718603 blocks
[19:15:15] scan: checking audio 1
[19:15:15] scan: id=0x80bd, lang=English (AC3), 3cc=eng ext=0
[19:15:15] scan: checking audio 2
[19:15:15] scan: id=0x81bd, lang=Dansk (AC3), 3cc=dan ext=0
[19:15:15] scan: checking audio 3
[19:15:15] scan: id=0x82bd, lang=Suomi (AC3), 3cc=fin ext=0
[19:15:15] scan: checking audio 4
[19:15:15] scan: id=0x83bd, lang=Deutsch (AC3), 3cc=deu ext=0
[19:15:15] scan: checking audio 5
[19:15:15] scan: id=0x84bd, lang=Norsk (AC3), 3cc=nor ext=0
[19:15:15] scan: checking audio 6
[19:15:15] scan: id=0x85bd, lang=Svenska (AC3), 3cc=swe ext=0
[19:15:15] scan: checking subtitle 1
[19:15:15] scan: id=0x20bd, lang=English, 3cc=eng ext=1
[19:15:15] scan: checking subtitle 2
[19:15:15] scan: id=0x21bd, lang=Dansk, 3cc=dan ext=1
[19:15:15] scan: checking subtitle 3
[19:15:15] scan: id=0x22bd, lang=Suomi, 3cc=fin ext=1
[19:15:15] scan: checking subtitle 4
[19:15:15] scan: id=0x23bd, lang=Deutsch, 3cc=deu ext=1
[19:15:15] scan: checking subtitle 5
[19:15:15] scan: id=0x24bd, lang=Norsk, 3cc=nor ext=1
[19:15:15] scan: checking subtitle 6
[19:15:15] scan: id=0x25bd, lang=Svenska, 3cc=swe ext=1
[19:15:15] scan: checking subtitle 7
[19:15:15] scan: id=0x26bd, lang=Turkish, 3cc=tur ext=1
[19:15:15] scan: title 1 has 16 chapters
[19:15:15] dvd: Skipping multi-angle cells 1-3
[19:15:15] dvd: Skipping multi-angle cells 6-8
[19:15:15] dvd: Skipping multi-angle cells 21-23
[19:15:15] dvd: Skipping multi-angle cells 29-31
[19:15:15] scan: chap 1 c=0->4, b=0->193070 (192157), 287840 ms
[19:15:15] scan: chap 2 c=5->9, b=193071->391029 (197493), 357440 ms
[19:15:15] scan: chap 3 c=10->10, b=391030->564456 (173427), 404080 ms
[19:15:15] scan: chap 4 c=11->11, b=564457->701422 (136966), 291920 ms
[19:15:15] scan: chap 5 c=12->12, b=701423->814693 (113271), 264800 ms
[19:15:15] scan: chap 6 c=13->13, b=814694->976087 (161394), 374880 ms
[19:15:15] scan: chap 7 c=14->14, b=976088->1146412 (170325), 387320 ms
[19:15:15] scan: chap 8 c=15->15, b=1146413->1277147 (130735), 288760 ms
[19:15:15] scan: chap 9 c=16->16, b=1277148->1401101 (123954), 276840 ms
[19:15:15] scan: chap 10 c=17->17, b=1401102->1533424 (132323), 334480 ms
[19:15:15] scan: chap 11 c=18->18, b=1533425->1667180 (133756), 331840 ms
[19:15:15] scan: chap 12 c=19->19, b=1667181->1771491 (104311), 261720 ms
[19:15:15] scan: chap 13 c=20->25, b=1771492->1942995 (170568), 406080 ms
[19:15:15] scan: chap 14 c=26->26, b=1942996->2111381 (168386), 398600 ms
[19:15:15] scan: chap 15 c=27->27, b=2111382->2294943 (183562), 420800 ms
[19:15:15] scan: chap 16 c=28->32, b=2294944->2721722 (425975), 948600 ms
[19:15:15] scan: aspect = 1.77778
[19:15:15] scan: decoding previews for title 1
libdvdnav: DVD disk reports itself with Region mask 0x00000000. Regions: 1 2 3 4 5 6 7 8
[19:15:15] scan: title angle(s) 3
[ac3 @ 02e2dc00] frame sync error
[ac3 @ 02e2e500] frame sync error
[ac3 @ 02e2ee00] frame sync error
[19:15:15] scan: audio 0x80bd: ac3, rate=48000Hz, bitrate=448000 English (AC3) (5.1 ch)
[ac3 @ 02e2ee00] frame sync error
[19:15:15] scan: audio 0x83bd: ac3, rate=48000Hz, bitrate=384000 Deutsch (AC3) (5.1 ch)
[19:15:15] scan: audio 0x81bd: ac3, rate=48000Hz, bitrate=192000 Dansk (AC3) (2.0 ch) (Dolby Surround)
[19:15:15] scan: audio 0x82bd: ac3, rate=48000Hz, bitrate=192000 Suomi (AC3) (2.0 ch) (Dolby Surround)
[19:15:15] scan: audio 0x84bd: ac3, rate=48000Hz, bitrate=192000 Norsk (AC3) (2.0 ch) (Dolby Surround)
[19:15:15] scan: audio 0x85bd: ac3, rate=48000Hz, bitrate=192000 Svenska (AC3) (2.0 ch) (Dolby Surround)
Scanning title 1 of 1, preview 8, 80.00 %[19:15:16] Broken timestamps detected. Reordering.
[19:15:16] scan: 10 previews, 720x576, 25.000 fps, autocrop = 12/12/0/0, aspect 16:9, PAR 64:45
[19:15:16] libhb: scan thread found 1 valid title(s)
+ title 1:
+ vts 1, ttn 1, cells 0->32 (2718603 blocks)
+ angle(s) 3
+ duration: 01:40:36
+ size: 720x576, pixel aspect: 64/45, display aspect: 1.78, 25.000 fps
+ autocrop: 12/12/0/0
+ support opencl: no
+ support hwd: no
+ chapters:
+ 1: cells 0->4, 192157 blocks, duration 00:04:48
+ 2: cells 5->9, 197493 blocks, duration 00:05:57
+ 3: cells 10->10, 173427 blocks, duration 00:06:44
+ 4: cells 11->11, 136966 blocks, duration 00:04:52
+ 5: cells 12->12, 113271 blocks, duration 00:04:25
+ 6: cells 13->13, 161394 blocks, duration 00:06:15
+ 7: cells 14->14, 170325 blocks, duration 00:06:27
+ 8: cells 15->15, 130735 blocks, duration 00:04:49
+ 9: cells 16->16, 123954 blocks, duration 00:04:37
+ 10: cells 17->17, 132323 blocks, duration 00:05:34
+ 11: cells 18->18, 133756 blocks, duration 00:05:32
+ 12: cells 19->19, 104311 blocks, duration 00:04:22
+ 13: cells 20->25, 170568 blocks, duration 00:06:46
+ 14: cells 26->26, 168386 blocks, duration 00:06:39
+ 15: cells 27->27, 183562 blocks, duration 00:07:01
+ 16: cells 28->32, 425975 blocks, duration 00:15:49
+ audio tracks:
+ 1, English (AC3) (5.1 ch) (iso639-2: eng), 48000Hz, 448000bps
+ 2, Dansk (AC3) (2.0 ch) (Dolby Surround) (iso639-2: dan), 48000Hz, 192000bps
+ 3, Suomi (AC3) (2.0 ch) (Dolby Surround) (iso639-2: fin), 48000Hz, 192000bps
+ 4, Deutsch (AC3) (5.1 ch) (iso639-2: deu), 48000Hz, 384000bps
+ 5, Norsk (AC3) (2.0 ch) (Dolby Surround) (iso639-2: nor), 48000Hz, 192000bps
+ 6, Svenska (AC3) (2.0 ch) (Dolby Surround) (iso639-2: swe), 48000Hz, 192000bps
+ subtitle tracks:
+ 1, English (iso639-2: eng) (Bitmap)(VOBSUB)
+ 2, Dansk (iso639-2: dan) (Bitmap)(VOBSUB)
+ 3, Suomi (iso639-2: fin) (Bitmap)(VOBSUB)
+ 4, Deutsch (iso639-2: deu) (Bitmap)(VOBSUB)
+ 5, Norsk (iso639-2: nor) (Bitmap)(VOBSUB)
+ 6, Svenska (iso639-2: swe) (Bitmap)(VOBSUB)
+ 7, Turkish (iso639-2: tur) (Bitmap)(VOBSUB)
[19:15:16] 1 job(s) to process
[19:15:16] starting job
[19:15:16] Auto Passthru: allowed codecs are AAC, AC3, DTS, DTS-HD, MP3
[19:15:16] Auto Passthru: no valid fallback specified
[19:15:16] Auto Passthru: using AC3 Passthru for track 1
[19:15:16] sync: expecting 150900 video frames
[19:15:16] job configuration:
[19:15:16] * source
[19:15:16] + d:\
[19:15:16] + title 1, chapter(s) 1 to 16
[19:15:16] * destination
[19:15:16] + test.mp4
[19:15:16] + container: MPEG-4 (libavformat)
[19:15:16] + chapter markers
[19:15:16] * video track
[19:15:16] + decoder: mpeg2video
[19:15:16] + bitrate 9800 kbps
[19:15:16] + filters
[19:15:16] + Framerate Shaper (0:27000000:1080000)
[19:15:16] + frame rate: same as source (around 25.000 fps)
[19:15:16] + Crop and Scale (720:388:12:12:0:0)
[19:15:16] + source: 720 * 576, crop (12/12/0/0): 720 * 552, scale: 720 * 388
[19:15:16] + dimensions: 720 * 388, mod 0
[19:15:16] + encoder: MPEG-4 (libavcodec)
[19:15:16] + bitrate: 1000 kbps, pass: 0
[19:15:16] * subtitle track 1, Deutsch (track 4, id 0x23bd) Picture [VOBSUB] -> Passthrough, Forced Only
[19:15:16] * audio track 1
[19:15:16] + decoder: Deutsch (AC3) (5.1 ch) (track 4, id 0x83bd)
[19:15:16] + bitrate: 384 kbps, samplerate: 48000 Hz
[19:15:16] + AC3 Passthru
libdvdnav: Using dvdnav version 5.0.1
libdvdread: Encrypted DVD support unavailable.
libdvdread: Could not open input: No such file or directory
libdvdread: Can't open d:\ for reading
libdvdread: Device d:\ 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: No such file or directory
libdvdread: Can't open d:\ for reading
libdvdread: Device d:\ inaccessible, CSS authentication not available.
libdvdnav: DVD disk reports itself with Region mask 0x00000000. Regions:[19:15:16] encavcodecInit: MPEG-4 ASP encoder
1 2 3 4 5 6 7 8
Encoding: task 1 of 1, 0.00 %[19:15:16] reader: first SCR 146 id 0xe0 DTS 22254
[19:15:16] mpeg2video: "Chapter 1" (1) at frame 0 time 3600
[19:15:16] sync: first pts is 3600
[19:15:16] sync: audio 0x83bd time went backwards 31 ms, dropped 1 frames (start 158447, next 161280)
Encoding: task 1 of 1, 1.80 % (274.20 fps, avg 278.54 fps, ETA 00h08m52s)[19:15:26] sync: audio 0x83bd time went backwards 31 ms, dropped 1 frames (start 9950447, next 9953280)
Encoding: task 1 of 1, 4.75 % (278.59 fps, avg 274.10 fps, ETA 00h08m44s)[19:15:43] mpeg2video: "Chapter 2" (2) at frame 7196 time 25903487
Encoding: task 1 of 1, 10.65 % (264.85 fps, avg 273.38 fps, ETA 00h08m13s)[19:16:15] mpeg2video: "Chapter 3" (3) at frame 16132 time 58073087
Encoding: task 1 of 1, 17.37 % (268.26 fps, avg 275.13 fps, ETA 00h07m33s)[19:16:52] mpeg2video: "Chapter 4" (4) at frame 26234 time 94440287
Encoding: task 1 of 1, 22.20 % (247.33 fps, avg 272.70 fps, ETA 00h07m11s)[19:17:19] mpeg2video: "Chapter 5" (5) at frame 33532 time 120713087
Encoding: task 1 of 1, 26.59 % (242.44 fps, avg 269.66 fps, ETA 00h06m51s)[19:17:45] mpeg2video: "Chapter 6" (6) at frame 40152 time 144545087
Encoding: task 1 of 1, 32.79 % (278.85 fps, avg 266.50 fps, ETA 00h06m21s)[19:18:22] mpeg2video: "Chapter 7" (7) at frame 49524 time 178284287
Encoding: task 1 of 1, 39.21 % (280.19 fps, avg 268.05 fps, ETA 00h05m42s)[19:18:57] mpeg2video: "Chapter 8" (8) at frame 59207 time 213143087
Encoding: task 1 of 1, 43.99 % (285.67 fps, avg 267.60 fps, ETA 00h05m16s)[19:19:24] mpeg2video: "Chapter 9" (9) at frame 66426 time 239131487
Encoding: task 1 of 1, 48.59 % (207.17 fps, avg 266.88 fps, ETA 00h04m50s)[19:19:51] mpeg2video: "Chapter 10" (10) at frame 73347 time 264047087
Encoding: task 1 of 1, 54.10 % (286.41 fps, avg 267.98 fps, ETA 00h04m19s)[19:20:21] mpeg2video: "Chapter 11" (11) at frame 81709 time 294150287
Encoding: task 1 of 1, 59.62 % (295.76 fps, avg 270.09 fps, ETA 00h03m46s)[19:20:49] mpeg2video: "Chapter 12" (12) at frame 90005 time 324015887
Encoding: task 1 of 1, 63.94 % (298.43 fps, avg 272.51 fps, ETA 00h03m19s)[19:21:11] mpeg2video: "Chapter 13" (13) at frame 96548 time 347570687
Encoding: task 1 of 1, 66.86 % (299.28[19:21:25] sync: audio 0x83bd time went backwards 31 ms, dropped 1 frames (start 363260207, next 363263040)
Encoding: task 1 of 1, 68.03 % (320.72 fps, avg 274.59 fps, ETA 00h02m56s)ERROR: avformatMux: track 2, av_interleaved_write_frame failed with error 'Error number -22 occurred'
[19:21:30] work: average encoding speed for job is 274.585327 fps
Encoding: task 1 of 1, 68.07 % (320.72 fps, avg 274.59 fps, ETA 00h02m56s)[19:21:30] sync: got 102713 frames, 150900 exp
ected
[19:21:30] render: lost time: 0 (0 frames)
[19:21:30] render: gained time: 0 (0 frames) (0 not accounted for)
[19:21:30] reader: done. 7 scr changes
[19:21:30] mpeg2video-decoder done: 102731 frames, 0 decoder errors, 0 drops
[19:21:30] ac3-decoder done: 0 frames, 0 decoder errors, 0 drops
Muxing: this may take awhile...[19:21:31] mux: track 0, 100985 frames, 505462508 bytes, 1001.08 kbps, fifo 2048
[19:21:31] mux: track 1, 126228 frames, 193886208 bytes, 384.00 kbps, fifo 4096
[19:21:31] mux: track 2, 4 frames, 9716 bytes, 0.02 kbps, fifo 8
[19:21:31] libhb: work result = 4

Encode failed (error 4).

HandBrake has exited.
PS C:\Temp>
User avatar
JohnAStebbins
HandBrake Team
Posts: 5723
Joined: Sat Feb 09, 2008 7:21 pm

Re: HB CLI 0.10.0: Bug with Forced Subs

Post by JohnAStebbins »

We've gotten a couple reports of this problem with dvd subtitles, but I've not found a DVD I can reproduce the problem with yet. Which DVD title is this?
nick24
Posts: 35
Joined: Fri Dec 19, 2014 4:38 pm

Re: HB CLI 0.10.0: Bug with Forced Subs

Post by nick24 »

Thanks for the quick response.
It's 'The Smurfs 2'

Btw is there any way to automatically choose the right/default angle for the chosen audio language for encoding? When playing the DVD the right angle will automatically be used. Why not also with HB?
Deleted User 11865

Re: HB CLI 0.10.0: Bug with Forced Subs

Post by Deleted User 11865 »

Because that information is controlled by the menu, and that requires user intervention. HandBrake is not a DVD player :P
nick24
Posts: 35
Joined: Fri Dec 19, 2014 4:38 pm

Re: HB CLI 0.10.0: Bug with Forced Subs

Post by nick24 »

Hmm, I thought that somewhere in the dvd's data files there must be a link: if you choose language x then use angle y for playback. Would be nice if dvdnav could extract this information. Actually i'm not familiar with DVD structures. Just an idea.
Woodstock
Veteran User
Posts: 4619
Joined: Tue Aug 27, 2013 6:39 am

Re: HB CLI 0.10.0: Bug with Forced Subs

Post by Woodstock »

When using MakeMKV to do the rip, different angles are saved to different files, so you'd have to select the file that has the correct angle, along with the correct audio track(s) when you go to encode them with Handbrake.
nick24
Posts: 35
Joined: Fri Dec 19, 2014 4:38 pm

Re: HB CLI 0.10.0: Bug with Forced Subs

Post by nick24 »

But the problem is: what is the correct angle for the desired audio track? I know no other way than watching the movie and checking it for language specific visual hints. This is quite time consuming and not obvious. Often the angle number is the same as the audio track number, but this is not always the case. The DVD/VLC player knows it, why not dvdnav/HB?
nick24
Posts: 35
Joined: Fri Dec 19, 2014 4:38 pm

Re: HB CLI 0.10.0: Bug with Forced Subs (with subtopic angle)

Post by nick24 »

HandBrake is no DVD player, but it's quite simple to simulate a DVD player. At least I managed it to get the desired information automatically within a few seconds now: The default angle and (as a side effect) the default subtitle track for foreign language segments.

Using the Windows IDvd* Interfaces, I wrote a little command line tool (i.e. without any (output-)windows) to get the default angle and subtitle track for a certain language. Therefore its no longer necessary to have an additional pass in HandBrake to search for an appropriate subtitle track, i.e. the overall encoding process is faster.

For my DVD collection this works. But perhaps there are DVDs for which this does not work, e.g. the implemented approach is not general enough!? Does anybody has any experience on that? Of course I'm happy to share any details with anybody who is interested on that.

Next step would be to make this for Blu-Rays, too. Perhaps with the libbluray.

PS: Any progress on the bug with forced subs?
Post Reply