Handbrake: Getting avio_open2 failed, errno -2 when converting video on FreeBSD

4

On FreeBSD 9.2. Getting a cryptic error when converting a video using HandBrakeCLI.

$ HandBrakeCLI --preset "iPad" --input "Wolf.Totem.mkv" --output "/mnt/media/Ad Hoc/Wolf Totem.mp4"
[17:01:21] hb_init: starting libhb thread
HandBrake 0.10.1 (2015051600) - FreeBSD amd64 - https://handbrake.fr
4 CPUs detected
Opening Wolf.Totem.mkv...
[17:01:21] CPU:
[17:01:21]  - logical processor count: 4
[17:01:21] OpenCL: library not available
[17:01:21] hb_scan: path=Wolf.Totem.mkv, title_index=1
libbluray/bdnav/index_parse.c:162: indx_parse(): error opening Wolf.Totem.mkv/BDMV/index.bdmv
libbluray/bdnav/index_parse.c:162: indx_parse(): error opening Wolf.Totem.mkv/BDMV/BACKUP/index.bdmv
libbluray/bluray.c:2182: nav_get_title_list(Wolf.Totem.mkv) failed
[17:01:21] bd: not a bd - trying as a stream/file instead
libdvdnav: Using dvdnav version 5.0.1
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
[17:01:21] dvd: not a dvd - trying as a stream/file instead
Input #0, matroska,webm, from 'Wolf.Totem.mkv':
  Metadata:
    MAJOR_BRAND     : isom
    MINOR_VERSION   : 1
    COMPATIBLE_BRANDS: isomavc1
    CREATION_TIME   : 2015-03-11 15:09:29
    ENCODER         : Lavf55.37.100
  Duration: 02:01:24.39, start: 0.000000, bitrate: N/A
    Stream #0.0: Video: h264 (High), yuv420p, 1280x560 [PAR 1:1 DAR 16:7], 23.98 fps, 1k tbn, 47.95 tbc (default)
    Stream #0.1: Audio: aac, 48000 Hz, stereo, fltp (default)
[17:01:21] scan: decoding previews for title 1
[17:01:21] scan: audio 0x1: aac, rate=48000Hz, bitrate=1 Unknown (AAC) (2.0 ch)
[17:01:21] scan: 10 previews, 1280x560, 23.976 fps, autocrop = 0/0/0/0, aspect 2.29:1, PAR 1:1
[17:01:21] libhb: scan thread found 1 valid title(s)
+ title 1:
  + stream: Wolf.Totem.mkv
  + duration: 02:01:24
  + size: 1280x560, pixel aspect: 1/1, display aspect: 2.29, 23.976 fps
  + autocrop: 0/0/0/0
  + support opencl: no
    + support hwd: not built-in
  + chapters:
    + 1: cells 0->0, 0 blocks, duration 02:01:24
  + audio tracks:
    + 1, Unknown (AAC) (2.0 ch) (iso639-2: und)
  + subtitle tracks:
+ Using preset: iPad
[17:01:21] 1 job(s) to process
[17:01:21] starting job
[17:01:21] work: sanitizing track 1 mixdown Dolby Pro Logic II to Stereo
[17:01:21] sync: expecting 174650 video frames
[17:01:21] work: only 1 chapter, disabling chapter markers
[17:01:21] job configuration:
[17:01:21]  * source
[17:01:21]    + Wolf.Totem.mkv
[17:01:21]    + title 1, chapter(s) 1 to 1
[17:01:21]    + container: matroska,webm
[17:01:21]  * destination
[17:01:21]    + /mnt/media/Ad Hoc/Wolf Totem.mp4
[17:01:21]    + container: MPEG-4 (libavformat)
[17:01:21]  * video track
[17:01:21]    + decoder: h264
[17:01:21]    + filters
[17:01:21]      + Framerate Shaper (2:27000000:900000)
[17:01:21]        + frame rate: 23.976 fps -> peak rate limited to 30.000 fps
[17:01:21]      + Crop and Scale (1280:560:0:0:0:0)
[17:01:21]        + source: 1280 * 560, crop (0/0/0/0): 1280 * 560, scale: 1280 * 560
[17:01:21]    + loose anamorphic
[17:01:21]      + storage dimensions: 1280 * 560, mod 2
[17:01:21]      + pixel aspect ratio: 1 / 1
[17:01:21]      + display dimensions: 1280 * 560
[17:01:21]    + encoder: H.264 (libx264)
[17:01:21]      + preset:  medium
[17:01:21]      + profile: high
[17:01:21]      + level:   3.1
[17:01:21]      + quality: 20.00 (RF)
[17:01:21]  * audio track 1
[17:01:21]    + decoder: Unknown (AAC) (2.0 ch) (track 1, id 0x1)
[17:01:21]      + samplerate: 48000 Hz
[17:01:21]    + mixdown: Stereo
[17:01:21]    + encoder: AAC (libavcodec)
[17:01:21]      + bitrate: 160 kbps, samplerate: 48000 Hz
[17:01:21] reader: first SCR 3780 id 0x0 DTS 3780
[17:01:21] encx264: min-keyint: 24, keyint: 240
[17:01:21] encx264: encoding at constant RF 20.000000
[17:01:21] encx264: unparsed options: level=3.1:vbv-bufsize=17500:vbv-maxrate=17500
x264 [info]: using SAR=1/1
x264 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX AVX2 FMA3 LZCNT BMI2
x264 [info]: profile High, level 3.1
ERROR: avio_open2 failed, errno -2
[17:01:21] work: average encoding speed for job is 0.000000 fps
[17:01:21] sync: got 0 frames, 174650 expected
[17:01:22] render: 0 frames output, 0 dropped and 0 duped for CFR/PFR
[17:01:22] render: lost time: 0 (0 frames)
[17:01:22] render: gained time: 0 (0 frames) (0 not accounted for)
[17:01:22] h264-decoder done: 5 frames, 0 decoder errors, 0 drops
[17:01:22] aac-decoder done: 0 frames, 0 decoder errors, 0 drops
[17:01:22] reader: done. 1 scr changes
[17:01:22] libhb: work result = 3

Encode failed (error 3).

Anyone recognize this error and what can be done about it?

Axsuul

Posted 2015-05-17T00:15:21.800

Reputation: 183

Answers

6

Errno -2

2 ENOENT No such file or directory. 
A component of a specified pathname did not exist, or the pathname was an empty string.

Source: http://www.freebsd.org/cgi/man.cgi?query=errno&sektion=2


In this case it meant:

  • You did not type the right filename or file path, or
  • you do not have permission to read from the file/path you typed.

Hennes

Posted 2015-05-17T00:15:21.800

Reputation: 60 739

Yep, this was it! – Axsuul – 2015-05-19T20:26:14.880

2

Ended up being a permissions problem! It turned out I wasn't owner of the folder I was outputting to. The fix was something like

chown $USER folder

Axsuul

Posted 2015-05-17T00:15:21.800

Reputation: 183

1@Axsuul Try expanding your answer to provide details how did you fixed the permissions. Or which commands have you used. – kenorb – 2015-05-18T11:49:55.977

@kenorb hope that helps! – Axsuul – 2015-05-19T20:25:55.503

0

I had this same issue and was able to get passed the crashing by using "advanced settings" to try and slow things down.

It seems to be working

screen shot of "advanced settings"

I'm not sure if what I've changed may negatively impact the video/audio quality (very novice ;-)

Chuck

Posted 2015-05-17T00:15:21.800

Reputation: 1

1It might have slowed it down a fair amount--I will report back on performance/quality outcome – Chuck – 2017-06-30T22:30:20.420

I was able to get past the crashing and it did take a long 'ol time, and it completed, but the picture came out bad, sound seemed okay but image has random blocks of static-like noise throughout. Re-running with another preset that had previously failed and it seems to be working. Eh? I am reading straight from DVD drive (Mac stock 2011) so maybe there was a read error it couldnt overcome? I'll post next results. – Chuck – 2017-07-01T01:09:06.977

thank you for the corrections Mr. Duck--I'm not such a good tiper :-) – Chuck – 2017-07-01T01:11:57.617