[HandBrakeCLI] Input and Output files not found when path and/or filename contain space

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
paikuhan
Posts: 2
Joined: Fri Sep 17, 2021 6:05 pm

[HandBrakeCLI] Input and Output files not found when path and/or filename contain space

Post by paikuhan »

Description of problem or question:
Hi, When I use HandBrakeCLI to convert a file if either or both the filename or path of the input and output contain a space character I get a "Could not open input:" error



Steps to reproduce the problem (If Applicable):

just run:

Code: Select all

path/to/handbrakeCLI.exe -i path/with space/to/input.mp4 -o other/path/with space/to/output.mp4

HandBrake version (e.g., 1.0.0):

version 1.4.1

Operating system and version (e.g., Ubuntu 16.04 LTS, macOS 10.13 High Sierra, Windows 10 Creators Update):

Windows 10 x64 JP

HandBrakeCLI Activity Log ***required*** (see How-to get an activity log)

Code: Select all


[03:10:52] Compile-time hardening features are enabled
[03:10:52] hb_init: starting libhb thread
[03:10:52] thread 1 started ("libhb")
HandBrake 1.4.1 (2021081500) - MinGW x86_64 - https://handbrake.fr
8 CPUs detected
Opening "G:\Videos\Vacation\[...
[03:10:52] CPU:
[03:10:52]  - logical processor count: 8
[03:10:52] Intel Quick Sync Video support: no
[03:10:52] hb_scan: path="G:\Videos\Vacation\[, title_index=1
src/libbluray/disc/disc.c:333: failed opening UDF image "G:\Videos\Vacation\[
src/libbluray/disc/disc.c:437: error opening file BDMV\index.bdmv
src/libbluray/disc/disc.c:437: error opening file BDMV\BACKUP\index.bdmv
src/libbluray/bluray.c:2646: nav_get_title_list("G:\Videos\Vacation\[\) failed
[03:10:52] bd: not a bd - trying as a stream/file instead
libdvdread: Could not open input:
libdvdread: Can't open "G:\Videos\Vacation\[ for reading
libdvdnav: vm: failed to open/read the DVD
[03:10:52] dvd: not a dvd - trying as a stream/file instead
[03:10:52] hb_stream_open: open "G:\Videos\Vacation\[ failed
[03:10:52] scan: unrecognized file type
[03:10:53] libhb: scan thread found 0 valid title(s)
No title found.
HandBrake has exited.

User avatar
s55
HandBrake Team
Posts: 10347
Joined: Sun Dec 24, 2006 1:05 pm

Re: [HandBrakeCLI] Input and Output files not found when path and/or filename contain space

Post by s55 »

You need to escape the paths when using paths with spaces in command prompt.
paikuhan
Posts: 2
Joined: Fri Sep 17, 2021 6:05 pm

Re: [HandBrakeCLI] Input and Output files not found when path and/or filename contain space

Post by paikuhan »

s55 wrote: Fri Sep 17, 2021 6:27 pm You need to escape the paths when using paths with spaces in command prompt.
Usually "escaping" a character means using a backslash. I don't know if it would work on the Nix-like but I had to surround the whole path with double quotes. now it works!

Thanks!
Post Reply