Subtitle File Path Parsing causing Error

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
marjiea1
Posts: 3
Joined: Tue Aug 17, 2010 5:23 pm

Subtitle File Path Parsing causing Error

Post by marjiea1 »

In the GUI we can now hard code external SRT files during conversion (works great.)
In the CLI the same commands cause an Error: Could not open the SRT subtitle file.
It is obvious in the execution output that the path to the subtitle file is missing (has lost) all the slashes.

The problem is reproducible. It happens every time with any subtitle file that is not in the same directory as the Handbrake CLI. It works when subtitle files do not need a path (are placed in the Program Files/Handbrake directory .)

-Command used:

"C:\Program Files\Handbrake\HandBrakeCLI.exe" -i "G:\Home Movies\Jessicas First Two Wheel Bike Ride.mpg" -t 1 --angle 1 -o "G:\Home Movies\Jessicas First Two Wheel Bike Ride.OC.mp4" -f mp4 -w 720 --loose-anamorphic --modulus 2 -e x264 -q 20 -r 30 --pfr -a 1 -E av_aac -6 dpl2 -R Auto -B 160 -D 0 --gain 0 --audio-fallback ac3 --srt-file "G:\Home Movies\Jessicas First Two Wheel Bike Ride.srt" --srt-codeset UTF-8 --srt-offset 0 --srt-lang eng --srt-burn=1 --encoder-profile=high --encoder-level="3.1" --verbose=1

Date of download: 02/09/2015 (version 0.10.0.6534 -64bit Windows) (also still occurred in CLI Windows 64bit nightly build on 2/16/2015)
Location of Download: HandBrake Site
Operating System version (64 bit Windows 7 Ultimate Service Pack 1)

Output:

[01:07:38] hb_init: starting libhb thread
HandBrake 0.10.0 (2014112200) - MinGW x86_64 - https://handbrake.fr
4 CPUs detected
Opening G:\Home Movies\Jessicas First Two Wheel Bike Ride.mpg...
[01:07:38] CPU: Intel(R) Core(TM) i5 CPU 750 @ 2.67GHz
[01:07:38] - logical processor count: 4
[01:07:38] OpenCL device #1: NVIDIA Corporation GeForce GT 730
[01:07:38] - OpenCL version: 1.1 CUDA
[01:07:38] - driver version: 340.52
[01:07:38] - device type: GPU
[01:07:38] - supported: no
[01:07:38] Intel Quick Sync Video support: no
[01:07:38] hb_scan: path=G:\Home Movies\Jessicas First Two Wheel Bike Ride.mpg, title_index=1
libbluray/bdnav/index_parse.c:162: indx_parse(): error opening G:\Home Movies\Jessicas First Two Wheel Bike Ride.mpg/BDMV/index.bdmv
libbluray/bdnav/index_parse.c:162: indx_parse(): error opening G:\Home Movies\Jessicas First Two Wheel Bike Ride.mpg/BDMV/BACKUP/index.bdmv
libbluray/bluray.c:2182: nav_get_title_list(G:\Home Movies\Jessicas First Two Wheel Bike Ride.mpg) failed
[01:07:38] bd: not a bd - trying as a stream/file instead
libdvdnav: Using dvdnav version 5.0.1
libdvdread: Encrypted DVD support unavailable.
libdvdread:DVDOpenFileUDF:UDFFindFile /VIDEO_TS/VIDEO_TS.IFO failed
libdvdread:DVDOpenFileUDF:UDFFindFile /VIDEO_TS/VIDEO_TS.BUP failed
libdvdread: Can't open file VIDEO_TS.IFO.
libdvdnav: vm: failed to read VIDEO_TS.IFO
[01:07:38] dvd: not a dvd - trying as a stream/file instead
[01:07:38] file is MPEG Program Stream
[01:07:38] Probing 1 unknown stream
[01:07:38] Probe: Found stream mpeg2video. stream id 0xe0-0x0
[01:07:38] Found the following streams
[01:07:38] Video Streams :
[01:07:38] 0xe0-0x0 type MPEG2 (0x2)
[01:07:38] Audio Streams :
[01:07:38] 0xbd-0xa0 type LPCM (0x83)
[01:07:38] Subtitle Streams :
[01:07:38] Other Streams :
[01:07:38] stream id 0xbd (type 0x83 substream 0xa0) audio 0xa000bd
[01:07:39] scan: decoding previews for title 1
[01:07:39] file is MPEG Program Stream
[01:07:39] Probing 1 unknown stream
[01:07:39] Probe: Found stream mpeg2video. stream id 0xe0-0x0
[01:07:39] scan: audio 0xa000bd: LPCM, rate=48000Hz, bitrate=1536000 Unknown (LPCM) (2.0 ch)
[01:07:39] stream: 75 good frames, 0 errors (0%)
[01:07:39] scan: 10 previews, 720x480, 29.970 fps, autocrop = 0/0/0/0, aspect 4:3, PAR 8:9
[01:07:39] libhb: scan thread found 1 valid title(s)
+ title 1:
+ stream: G:\Home Movies\Jessicas First Two Wheel Bike Ride.mpg
+ duration: 00:02:08
+ size: 720x480, pixel aspect: 8/9, display aspect: 1.33, 29.970 fps
+ autocrop: 0/0/0/0
+ support opencl: no
+ support hwd: yes
+ chapters:
+ 1: cells 0->0, 0 blocks, duration 00:02:08
+ audio tracks:
+ 1, Unknown (LPCM) (2.0 ch) (iso639-2: und)
+ subtitle tracks:
[01:07:39] 1 job(s) to process
[01:07:39] starting job
[01:07:39] work: sanitizing track 1 mixdown Dolby Pro Logic II to Stereo
[01:07:39] sync: expecting 3836 video frames
[01:07:39] job configuration:
[01:07:39] * source
[01:07:39] + G:\Home Movies\Jessicas First Two Wheel Bike Ride.mpg
[01:07:39] + title 1, chapter(s) 1 to 1
[01:07:39] * destination
[01:07:39] + G:\Home Movies\Jessicas First Two Wheel Bike Ride.OC.mp4
[01:07:39] + container: MPEG-4 (libavformat)
[01:07:39] * video track
[01:07:39] + decoder: mpeg2video
[01:07:39] + bitrate 7000 kbps
[01:07:39] + filters
[01:07:39] + Framerate Shaper (2:27000000:900000)
[01:07:39] + frame rate: 29.970 fps -> peak rate limited to 30.000 fps
[01:07:39] + Subtitle renderer (0:0:0:0)
[01:07:39] + Crop and Scale (720:480:0:0:0:0)
[01:07:39] + source: 720 * 480, crop (0/0/0/0): 720 * 480, scale: 720 * 480
[01:07:39] + loose anamorphic
[01:07:39] + storage dimensions: 720 * 480, mod 2
[01:07:39] + pixel aspect ratio: 8 / 9
[01:07:39] + display dimensions: 640 * 480
[01:07:39] + encoder: H.264 (libx264)
[01:07:39] + profile: high
[01:07:39] + level: 3.1
[01:07:39] + quality: 20.00 (RF)
[01:07:39] * subtitle track 1, English (track 0, id 0xff) Text [SRT] -> Render/Burn-in, offset: 0, charset: UTF-8
[01:07:39] * audio track 1
[01:07:39] + decoder: Unknown (LPCM) (2.0 ch) (track 1, id 0xa000bd)
[01:07:39] + bitrate: 1536 kbps, samplerate: 48000 Hz
[01:07:39] + mixdown: Stereo
[01:07:39] + encoder: AAC (libavcodec)
[01:07:39] + bitrate: 160 kbps, samplerate: 48000 Hz
[01:07:39] file is MPEG Program Stream
[01:07:39] Probing 1 unknown stream
[01:07:39] Probe: Found stream mpeg2video. stream id 0xe0-0x0
[01:07:39] reader: first SCR 169 id 0xe0 DTS 4208
ERROR: Could not open the SRT subtitle file 'G:Home MoviesJessicas First Two Wheel Bike Ride.srt'

ERROR: Failure to initialise thread 'SRT Subtitle Decoder'
[01:07:39] reader: done. 1 scr changes
[01:07:39] render: 0 frames output, 0 dropped and 0 duped for CFR/PFR
[01:07:39] render: lost time: 0 (0 frames)
[01:07:39] render: gained time: 0 (0 frames) (0 not accounted for)
[01:07:39] mpeg2video-decoder done: 0 frames, 0 decoder errors, 0 drops
[01:07:39] stream: 33 good frames, 0 errors (0%)
[01:07:39] libhb: work result = 3

Encode failed (error 3).
HandBrake has exited.
Woodstock
Veteran User
Posts: 4619
Joined: Tue Aug 27, 2013 6:39 am

Re: Subtitle File Path Parsing causing Error

Post by Woodstock »

Given the error, it would seem that the \ characters were stripped out somewhere along the line.

Two ways to test for that, by changing the command to either of these:

--srt-file "G:\\Home Movies\\Jessicas First Two Wheel Bike Ride.srt"
--srt-file "G:/Home Movies/Jessicas First Two Wheel Bike Ride.srt"

If it works with either or both of those, that will be a clue to the fix.
marjiea1
Posts: 3
Joined: Tue Aug 17, 2010 5:23 pm

Re: Subtitle File Path Parsing causing Error

Post by marjiea1 »

Yes, both of those solutions work along with the one I mentioned (putting the file in the same directory with the CLI.)

It still needs to be fixed for batch processing when the paths are being put together programmatically.

I use powershell and my variable $srtfile = $subpath + "\" + $file.BaseName + ".srt" won't work because I can only easily change the one slash between the path and filename, not between the drive letter and subdirectory/subdirectories. I can however, process in batch until this is fixed by putting the CLI, my powershell script and all of my subs in the same directory and just use $srtfile = $file.BaseName + ".srt"
Post Reply