FallingSnow / h265ize

A node utility utilizing ffmpeg to encode videos with the hevc codec.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ffmpeg: Invalid stream specifier: 0:1 and other issues.

markfaine opened this issue · comments

commented

ffmpeg compiled from source (yesterday) using the guide on the ffpmeg site

ffmpeg version N-94802-g4857688 Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 8 (Ubuntu 8.3.0-6ubuntu1)
  configuration: --prefix=/home/mark/ffmpeg_build --pkg-config-flags=--static --extra-cflags=-I/home/mark/ffmpeg_build/include --extra-ldflags=-L/home/mark/ffmpeg_build/lib --extra-libs='-lpthread -lm' --bindir=/home/mark/bin --enable-gpl --enable-libaom --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-nonfree
  libavutil      56. 35.100 / 56. 35.100
  libavcodec     58. 56.101 / 58. 56.101
  libavformat    58. 32.104 / 58. 32.104
  libavdevice    58.  9.100 / 58.  9.100
  libavfilter     7. 58.102 /  7. 58.102
  libswscale      5.  6.100 /  5.  6.100
  libswresample   3.  6.100 /  3.  6.100
  libpostproc    55.  6.100 / 55.  6.100

h265 installed using npm with -global option

h265ize --version
h265ize 0.4.3-r2

When I run with the following command line:
h265ize --debug -g /media/mark/Backup/h265ize_tmp -d /media/mark/Backup/h265ize -f mkv -n en --10bit -q 30 "/volume1/video/television/The 100/Season 01/02 -The 100 - Earth Skills.mkv"

The result is:

[h265ize]: [debug] Log file location: /home/mark/dotfiles/bin/video/h265ize.log
[h265ize]: [verbose] Handling keypresses...
[h265ize]: [verbose] Setting as-preset options...
[h265ize]: Processing 02  -The 100 -  Earth Skills.mkv...
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
[h265ize]: [verbose] Encoding started at Sat, 12:03 PM
[h265ize]: [debug] Path: /volume1/video/television/The 100/Season 01/02  -The 100 -  Earth Skills.mkv
[h265ize]: [verbose] Getting metadata...
[h265ize]: [debug] Container data:
	- duration: 00:42:20
	- size: 3.27 GB
[h265ize]: [verbose] Resolving video streams...
[h265ize]: [debug] Working on stream:
[h265ize]: [debug] Working on stream: 1
[h265ize]: [verbose] Upconverting...
[h265ize]: [debug] Upconverting 0 tracks.
[h265ize]: [verbose] Setting video bit depth...
[h265ize]: [verbose] Mapping streams...
[h265ize]: [debug] Video stream 0:0 mapped.
	- size: 1920x1080
	- codec: H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
	- profile: High
	- bit depth: 8
[h265ize]: [alert] Audio does not have a title. Title set to "English DTS DTS (5.1 Channel)".
[h265ize]: [debug] Audio stream 0:1 mapped.
	- title: undefined
	- language: English
	- codec: DCA (DTS Coherent Acoustics)
	- channels: 6
	- profile: DTS
[h265ize]: [verbose] Detecting auto crop...
[h265ize]: Crop Detection: 1/12
[h265ize]: [debug] Running Query: ffmpeg -ss 2345.117538461538 -i /volume1/video/television/The 100/Season 01/02  -The 100 -  Earth Skills.mkv -y -vframes 2 -filter:v cropdetect=0.094:16:0 -map 0:0 -f null -
[h265ize]: Crop Detection: 2/12
[h265ize]: [debug] Running Query: ffmpeg -ss 2149.6910769230767 -i /volume1/video/television/The 100/Season 01/02  -The 100 -  Earth Skills.mkv -y -vframes 2 -filter:v cropdetect=0.094:16:0 -map 0:0 -f null -
[h265ize]: Crop Detection: 3/12
[h265ize]: [debug] Running Query: ffmpeg -ss 1954.2646153846154 -i /volume1/video/television/The 100/Season 01/02  -The 100 -  Earth Skills.mkv -y -vframes 2 -filter:v cropdetect=0.094:16:0 -map 0:0 -f null -
[h265ize]: Crop Detection: 4/12
[h265ize]: [debug] Running Query: ffmpeg -ss 1758.8381538461538 -i /volume1/video/television/The 100/Season 01/02  -The 100 -  Earth Skills.mkv -y -vframes 2 -filter:v cropdetect=0.094:16:0 -map 0:0 -f null -
[h265ize]: Crop Detection: 5/12
[h265ize]: [debug] Running Query: ffmpeg -ss 1563.4116923076922 -i /volume1/video/television/The 100/Season 01/02  -The 100 -  Earth Skills.mkv -y -vframes 2 -filter:v cropdetect=0.094:16:0 -map 0:0 -f null -
[h265ize]: Crop Detection: 6/12
[h265ize]: [debug] Running Query: ffmpeg -ss 1367.9852307692306 -i /volume1/video/television/The 100/Season 01/02  -The 100 -  Earth Skills.mkv -y -vframes 2 -filter:v cropdetect=0.094:16:0 -map 0:0 -f null -
[h265ize]: Crop Detection: 7/12
[h265ize]: [debug] Running Query: ffmpeg -ss 1172.558769230769 -i /volume1/video/television/The 100/Season 01/02  -The 100 -  Earth Skills.mkv -y -vframes 2 -filter:v cropdetect=0.094:16:0 -map 0:0 -f null -
[h265ize]: Crop Detection: 8/12
[h265ize]: [debug] Running Query: ffmpeg -ss 977.1323076923077 -i /volume1/video/television/The 100/Season 01/02  -The 100 -  Earth Skills.mkv -y -vframes 2 -filter:v cropdetect=0.094:16:0 -map 0:0 -f null -
[h265ize]: Crop Detection: 9/12
[h265ize]: [debug] Running Query: ffmpeg -ss 781.7058461538461 -i /volume1/video/television/The 100/Season 01/02  -The 100 -  Earth Skills.mkv -y -vframes 2 -filter:v cropdetect=0.094:16:0 -map 0:0 -f null -
[h265ize]: Crop Detection: 10/12
[h265ize]: [debug] Running Query: ffmpeg -ss 586.2793846153845 -i /volume1/video/television/The 100/Season 01/02  -The 100 -  Earth Skills.mkv -y -vframes 2 -filter:v cropdetect=0.094:16:0 -map 0:0 -f null -
[h265ize]: Crop Detection: 11/12
[h265ize]: [debug] Running Query: ffmpeg -ss 390.85292307692305 -i /volume1/video/television/The 100/Season 01/02  -The 100 -  Earth Skills.mkv -y -vframes 2 -filter:v cropdetect=0.094:16:0 -map 0:0 -f null -
[h265ize]: Crop Detection: 12/12
[h265ize]: [debug] Running Query: ffmpeg -ss 195.42646153846152 -i /volume1/video/television/The 100/Season 01/02  -The 100 -  Earth Skills.mkv -y -vframes 2 -filter:v cropdetect=0.094:16:0 -map 0:0 -f null -
[h265ize]: [alert] Output will be cropped to 1920x1072. Originally 1920x1080
[h265ize]: [verbose] Mapping HE Audio streams...
[h265ize]: [verbose] Setting ffmpeg settings...
[h265ize]: [verbose] Encoding video...
[h265ize]: [debug] Running Query: ffmpeg -n 10 /home/mark/bin/ffmpeg -i /volume1/video/television/The 100/Season 01/02  -The 100 -  Earth Skills.mkv -y -acodec copy -vcodec libx265 -filter:v crop=1920:1072:0:2 -c:s copy -pix_fmt yuv420p10le -map 0:0 -map 0:1 -metadata:s:a:1 title="English DTS DTS (5.1 Channel)" -metadata:s:0:1 DISPOSITION:default=1 -preset fast -x265-params crf=30: /media/mark/Backup/h265ize_tmp/02  -The 100 -  Earth Skills.encoding-in-progress.mkv
[h265ize]: [debug] Error: ffmpeg exited with code 1: 
    at ChildProcess.<anonymous> (/home/mark/dotfiles/bin/node-v12.9.1-linux-x64/lib/node_modules/h265ize/node_modules/fluent-ffmpeg/lib/processor.js:182:22)
    at ChildProcess.emit (events.js:209:13)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
[h265ize]: ffmpeg exited with code 1: 
[h265ize]: [verbose] Finished encoding at Sat, 12:03 PM (a few seconds)
[h265ize]: [debug] Finished encoding in 6.861 seconds.
[h265ize]: Folder encoding finished at Saturday, September 7th 2019, 12:03:37 PM
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
[h265ize]: [alert] The following videos (1) were not encoded:
	- /volume1/video/television/The 100/Season 01/02  -The 100 -  Earth Skills.mkv: ffmpeg exited with code 1: 
[h265ize]: Process exited.

If I run the generated ffmpeg command manually I see the error message:

ffmpeg -n 10 /home/mark/bin/ffmpeg -i "/volume1/video/television/The 100/Season 01/02  -The 100 -  Earth Skills.mkv" -y -acodec copy -vcodec libx265 -filter:v crop=1920:1072:0:2 -c:s copy -pix_fmt yuv420p10le -map 0:0 -map 0:1 -metadata:s:a:1 title="English DTS DTS (5.1 Channel)" -metadata:s:0:1 DISPOSITION:default=1 -preset fast -x265-params crf=30: "/media/mark/Backup/h265ize_tmp/02  -The 100 -  Earth Skills.encoding-in-progress.mkv"
ffmpeg version N-94802-g4857688 Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 8 (Ubuntu 8.3.0-6ubuntu1)
  configuration: --prefix=/home/mark/ffmpeg_build --pkg-config-flags=--static --extra-cflags=-I/home/mark/ffmpeg_build/include --extra-ldflags=-L/home/mark/ffmpeg_build/lib --extra-libs='-lpthread -lm' --bindir=/home/mark/bin --enable-gpl --enable-libaom --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-nonfree
  libavutil      56. 35.100 / 56. 35.100
  libavcodec     58. 56.101 / 58. 56.101
  libavformat    58. 32.104 / 58. 32.104
  libavdevice    58.  9.100 / 58.  9.100
  libavfilter     7. 58.102 /  7. 58.102
  libswscale      5.  6.100 /  5.  6.100
  libswresample   3.  6.100 /  3.  6.100
  libpostproc    55.  6.100 / 55.  6.100
Input #0, matroska,webm, from '/volume1/video/television/The 100/Season 01/02  -The 100 -  Earth Skills.mkv':
  Metadata:
    encoder         : libebml v1.3.0 + libmatroska v1.4.0
    creation_time   : 2014-09-18T05:03:32.000000Z
  Duration: 00:42:20.54, start: 0.000000, bitrate: 11067 kb/s
    Chapter #0:0: start 0.000000, end 69.695000
    Metadata:
      title           : 00:00:00.000
    Chapter #0:1: start 69.695000, end 139.723000
    Metadata:
      title           : 00:01:09.695
    Chapter #0:2: start 139.723000, end 979.187000
    Metadata:
      title           : 00:02:19.723
    Chapter #0:3: start 979.187000, end 1281.489000
    Metadata:
      title           : 00:16:19.187
    Chapter #0:4: start 1281.489000, end 1592.674000
    Metadata:
      title           : 00:21:21.489
    Chapter #0:5: start 1592.674000, end 1854.478000
    Metadata:
      title           : 00:26:32.674
    Chapter #0:6: start 1854.478000, end 2147.145000
    Metadata:
      title           : 00:30:54.478
    Chapter #0:7: start 2147.145000, end 2511.217000
    Metadata:
      title           : 00:35:47.145
    Chapter #0:8: start 2511.217000, end 2540.544000
    Metadata:
      title           : 00:41:51.217
    Stream #0:0(eng): Video: h264 (High), yuv420p(progressive), 1920x1080, SAR 1:1 DAR 16:9, 23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc (default)
    Stream #0:1(eng): Audio: dts (DTS), 48000 Hz, 5.1(side), fltp, 1536 kb/s (default)
[NULL @ 0x5586cfbaf980] Unable to find a suitable output format for '10'
10: Invalid argument

This seems to be due to the ffmpeg -n at the beginning. I'm not sure why that is there and it looks like it should be a language value. If I remove it I get another error:

/home/mark/bin/ffmpeg -i "/volume1/video/television/The 100/Season 01/02  -The 100 -  Earth Skills.mkv" -y -acodec copy -vcodec libx265 -filter:v crop=1920:1072:0:2 -c:s copy -pix_fmt yuv420p10le -map 0:0 -map 0:1 -metadata:s:a:1 title="English DTS DTS (5.1 Channel)" -metadata:s:0:1 DISPOSITION:default=1 -preset fast -x265-params crf=30: "/media/mark/Backup/h265ize_tmp/02  -The 100 -  Earth Skills.encoding-in-progress.mkv"
ffmpeg version N-94802-g4857688 Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 8 (Ubuntu 8.3.0-6ubuntu1)
  configuration: --prefix=/home/mark/ffmpeg_build --pkg-config-flags=--static --extra-cflags=-I/home/mark/ffmpeg_build/include --extra-ldflags=-L/home/mark/ffmpeg_build/lib --extra-libs='-lpthread -lm' --bindir=/home/mark/bin --enable-gpl --enable-libaom --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-nonfree
  libavutil      56. 35.100 / 56. 35.100
  libavcodec     58. 56.101 / 58. 56.101
  libavformat    58. 32.104 / 58. 32.104
  libavdevice    58.  9.100 / 58.  9.100
  libavfilter     7. 58.102 /  7. 58.102
  libswscale      5.  6.100 /  5.  6.100
  libswresample   3.  6.100 /  3.  6.100
  libpostproc    55.  6.100 / 55.  6.100
Input #0, matroska,webm, from '/volume1/video/television/The 100/Season 01/02  -The 100 -  Earth Skills.mkv':
  Metadata:
    encoder         : libebml v1.3.0 + libmatroska v1.4.0
    creation_time   : 2014-09-18T05:03:32.000000Z
  Duration: 00:42:20.54, start: 0.000000, bitrate: 11067 kb/s
    Chapter #0:0: start 0.000000, end 69.695000
    Metadata:
      title           : 00:00:00.000
    Chapter #0:1: start 69.695000, end 139.723000
    Metadata:
      title           : 00:01:09.695
    Chapter #0:2: start 139.723000, end 979.187000
    Metadata:
      title           : 00:02:19.723
    Chapter #0:3: start 979.187000, end 1281.489000
    Metadata:
      title           : 00:16:19.187
    Chapter #0:4: start 1281.489000, end 1592.674000
    Metadata:
      title           : 00:21:21.489
    Chapter #0:5: start 1592.674000, end 1854.478000
    Metadata:
      title           : 00:26:32.674
    Chapter #0:6: start 1854.478000, end 2147.145000
    Metadata:
      title           : 00:30:54.478
    Chapter #0:7: start 2147.145000, end 2511.217000
    Metadata:
      title           : 00:35:47.145
    Chapter #0:8: start 2511.217000, end 2540.544000
    Metadata:
      title           : 00:41:51.217
    Stream #0:0(eng): Video: h264 (High), yuv420p(progressive), 1920x1080, SAR 1:1 DAR 16:9, 23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc (default)
    Stream #0:1(eng): Audio: dts (DTS), 48000 Hz, 5.1(side), fltp, 1536 kb/s (default)
[matroska @ 0x557c1b9d5fc0] Invalid stream specifier: 0:1.
    Last message repeated 1 times

Any help would be appreciated. Sorry for so much text but I just wanted to give you complete info.

Also, there seems to be a documentation issue in the readme.
https://github.com/FallingSnow/h265ize#creating-10bit--12bit-encodes

There doesn't seem to be a --bitstream option now. It looks to have been replaced with --10bit or --12bit, etc.

Your right about ffmpeg -n causing the error. But that last command you sent should work. Idk why ffmpeg is erroring out on it. Make sure your ffmpeg is up to date.

As for the documentation error, pull requests are welcome.

Just read about you compiling from source. Try a stable release.

commented

@FallingSnow I tried a stable release and it looks like I'm still getting the same error:

ffmpeg version 4.2.1-static https://johnvansickle.com/ffmpeg/  Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 6.3.0 (Debian 6.3.0-18+deb9u1) 20170516
  configuration: --enable-gpl --enable-version3 --enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --cc=gcc-6 --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gmp --enable-libgme --enable-gray --enable-libaom --enable-libfribidi --enable-libass --enable-libvmaf --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librubberband --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libvorbis --enable-libopus --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libdav1d --enable-libxvid --enable-libzvbi --enable-libzimg
[matroska @ 0x709b280] Invalid stream specifier: 0:1.
    Last message repeated 1 times

Thanks

commented

It could be specific to the videos I've been trying it on since I've found several like it that also give the same error but I just found another that does seem to be encoding.

I experience this as well on some files but not others.

commented

@mjc Yes, it's the same for me. I had to try many different files to find some that work.

Looks like it happens more often with --he-audio and/or loudnorm as well but I don't understand the code well enough to quite know what is being done wrong yet. EDIT: nevermind I was not reading the log correctly

@markfaine can you try the patch here and see if it works for you at least some of the time? I need to also apply it to subtitle defaults but this should fix videos with no subtitles.

commented

Sure. I will try it soon and report back. Thanks.

commented

It's working so far. I've only just started the first video and it worked straight away. Just one video though, I'll try a few more and get back to you. I'm using commit 6fe44eb.

commented

I was able to process over a hundred videos with only a few failures which are likely not related to this issue. I'd say it is definitely a success. Thanks

I was able to process over a hundred videos with only a few failures which are likely not related to this issue. I'd say it is definitely a success. Thanks

I found some more similar fixes and added them to the PR, can you try the newest commit there on the rest of them?

commented

Sure, no problem.