HandBrakeCLI with blu-ray iso

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
Eelisland
Posts: 9
Joined: Thu Jan 23, 2014 2:21 pm

HandBrakeCLI with blu-ray iso

Post by Eelisland »

Hello,

I'm trying to kind of automate HandBrakeCLI usage from a bash script, does HandBrakeCLI can recognize blu-ray iso or did i miss something? i'm using HandBrake rev5474 (x86_64)

Code: Select all

HandBrakeCLI --input file --scan

Code: Select all

[15:19:36] hb_init: starting libhb thread
HandBrake rev5474 (2014012299) - Linux x86_64 - http://handbrake.fr
4 CPUs detected
Opening /home/user/some_movie-bluray.iso...
[15:19:36] hb_scan: path=/home/user/some_movie-bluray.iso, title_index=1
libbluray/bdnav/index_parse.c:162: indx_parse(): error opening /home/user/some_movie-bluray.iso/BDMV/index.bdmv
libbluray/bdnav/index_parse.c:162: indx_parse(): error opening /home/user/some_movie-bluray.iso/BDMV/BACKUP/index.bdmv
libbluray/bluray.c:1725: nav_get_title_list(/home/user/some_movie-bluray.iso) failed (0x7f5df8000900)
[15:19:36] bd: not a bd - trying as a stream/file instead
libdvdnav: Using dvdnav version 4.1.3
libdvdread: Encrypted DVD support unavailable.
libdvdnav:DVDOpenFileUDF:UDFFindFile /VIDEO_TS/VIDEO_TS.IFO failed
libdvdnav:DVDOpenFileUDF:UDFFindFile /VIDEO_TS/VIDEO_TS.BUP failed
libdvdread: Can't open file VIDEO_TS.IFO.
libdvdnav: vm: failed to read VIDEO_TS.IFO
[15:19:36] dvd: not a dvd - trying as a stream/file instead
[15:19:36] hb_stream_open: open /home/user/some_movie-bluray.iso failed
[15:19:36] scan: unrecognized file type
[15:19:36] libhb: scan thread found 0 valid title(s)
No title found.
HandBrake has exited.
DVD isos are well recognized.

And a more off topic/general question(sorry for that), does anyone know a valid way to determine an ISO format on linux, for example running HandBrakeCLI scan on games iso can take age :wink: actually i have this as a starting point:

Code: Select all

isoinfo -d -i file
returning if it's an ISO 9660 or not.

Any suggestion welcome. thanks in advance.
User avatar
JohnAStebbins
HandBrake Team
Posts: 5726
Joined: Sat Feb 09, 2008 7:21 pm

Re: HandBrakeCLI with blu-ray iso

Post by JohnAStebbins »

HandBrake can't read iso files. You must mount the iso first. How you do this depends on which OS you run.

On linux

Code: Select all

sudo mount -o loop,dmode=0555,mode=0444,ro bd.iso /some/mount/point
dmode and mode override file permissions on the disc because I ran across some discs that had permissions set such that the dics was unreadable.

I created a script for myself that mounts any number of iso files specified on the command line in $HOME/ISO

Code: Select all

#!/bin/bash

while [ -n "$1" ]
do
	dir=${HOME}/ISO/$(basename "$1" | sed -e 's/\.iso$//')
	echo Mounting ${dir}
	mkdir -p "${dir}"
	sudo mount -o loop,dmode=0555,mode=0444,ro "$1" "${dir}"
	ERR=$?
	if [ ${ERR} -ne 0 ]
	then
		rmdir "${dir}"
		exit ${ERR}
	fi
	shift
done
and another script to unmount

Code: Select all

#!/bin/bash

while [ -n "$1" ]
do
	dir=${HOME}/ISO/$(basename "$1" | sed -e 's/\.iso$//')

	echo Unmounting ${dir}
	sudo umount "${dir}"
	rmdir "${dir}"
	shift
done
Since '*' expands before passing to scripts, unmounting all is just "umt.sh ~/ISO/*"
Eelisland
Posts: 9
Joined: Thu Jan 23, 2014 2:21 pm

Re: HandBrakeCLI with blu-ray iso

Post by Eelisland »

Hey, thanks for your feedback.

I don't want to execute the script as root, wich is needed for mounting a disc or image. I finally manage this way:
isoinfo -d -i "$iso"
iso 9660(CD-ROM is in ISO 9660 format) or (CD-ROM is NOT in ISO 9660 format) considering iso is UDF ?

dvd case
echo "" | HandBrakeCLI --input "$iso" --scan
blu-ray case
makemkvcon info iso:"$iso"
wich will return if valid title is found.
Post Reply