FallingSnow / h265ize

A node utility utilizing ffmpeg to encode videos with the hevc codec.
MIT License
527 stars 81 forks source link

Unable to execute on Fedora 31 #150

Open sorvani opened 4 years ago

sorvani commented 4 years ago

Versions:

$ h265ize --version
h265ize 0.4.3-r2
$ ffmpeg -version
ffmpeg version 4.2.2 Copyright (c) 2000-2019 the FFmpeg developers
built with gcc 9 (GCC)
configuration: --prefix=/usr --bindir=/usr/bin --datadir=/usr/share/ffmpeg --docdir=/usr/share/doc/ffmpeg --incdir=/usr/include/ffmpeg --libdir=/usr/lib64 --mandir=/usr/share/man --arch=x86_64 --optflags='-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection' --extra-ldflags='-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld ' --extra-cflags=' ' --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libvo-amrwbenc --enable-version3 --enable-bzlib --disable-crystalhd --enable-fontconfig --enable-frei0r --enable-gcrypt --enable-gnutls --enable-ladspa --enable-libaom --enable-libdav1d --enable-libass --enable-libbluray --enable-libcdio --enable-libdrm --enable-libjack --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libmp3lame --enable-nvenc --enable-openal --enable-opencl --enable-opengl --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librsvg --enable-libsrt --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libvorbis --enable-libv4l2 --enable-libvidstab --enable-libvmaf --enable-libvpx --enable-libx264 --enable-libx265 --enable-libxvid --enable-libzimg --enable-libzvbi --enable-avfilter --enable-avresample --enable-postproc --enable-pthreads --disable-static --enable-shared --enable-gpl --disable-debug --disable-stripping --shlibdir=/usr/lib64 --enable-libmfx --enable-runtime-cpudetect
libavutil      56. 31.100 / 56. 31.100
libavcodec     58. 54.100 / 58. 54.100
libavformat    58. 29.100 / 58. 29.100
libavdevice    58.  8.100 / 58.  8.100
libavfilter     7. 57.100 /  7. 57.100
libavresample   4.  0.  0 /  4.  0.  0
libswscale      5.  5.100 /  5.  5.100
libswresample   3.  5.100 /  3.  5.100
libpostproc    55.  5.100 / 55.  5.100

Test run

$ h265ize -v -d ../H265_Converted/ --as-preset anime --stats --debug Natsunagu-01.mkv 
[h265ize]: [debug] Log file location: /home/jbusch/hdd/Torrents/Anime/h265ize.log
[h265ize]: [verbose] Handling keypresses...
[h265ize]: [verbose] Setting as-preset options...
[h265ize]: Processing Natsunagu-01.mkv...
----------------------------------------------------------------------------------------------------------------------------------
[h265ize]: [verbose] Encoding started at Tue, 10:41 PM
[h265ize]: [debug] Path: Natsunagu-01.mkv
[h265ize]: [verbose] Getting metadata...
[h265ize]: [debug] Container data:
    - duration: 00:04:00
    - size: 50.55 MB
[h265ize]: [verbose] Resolving video streams...
[h265ize]: [debug] Working on stream:
[h265ize]: [debug] Working on stream: 1
[h265ize]: [debug] Working on stream: 2
[h265ize]: [debug] Working on stream: 3
[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: 1280x720
    - codec: H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
    - profile: Main
    - bit depth: 8
[h265ize]: [alert] Audio does not have a title. Title set to "Japanese AAC LC (Stereo)".
[h265ize]: [debug] Audio stream 0:1 mapped.
    - title: undefined
    - language: Japanese
    - codec: AAC (Advanced Audio Coding)
    - channels: 2
    - profile: LC
[h265ize]: English
[h265ize]: [alert] Subtitle does not have a title. Title set to English.
[h265ize]: [debug] Subtitle stream 0:2 mapped.
    - title: undefined
    - language: English
    - codec: ASS (Advanced SSA) subtitle
[h265ize]: [debug] Other stream 0:3 mapped.
[h265ize]: [verbose] Detecting auto crop...
[h265ize]: Crop Detection: 1/12
[h265ize]: [debug] Running Query: ffmpeg -ss 221.59753846153845 -i Natsunagu-01.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 203.1310769230769 -i Natsunagu-01.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 184.6646153846154 -i Natsunagu-01.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 166.19815384615384 -i Natsunagu-01.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 147.7316923076923 -i Natsunagu-01.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 129.26523076923075 -i Natsunagu-01.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 110.79876923076922 -i Natsunagu-01.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 92.3323076923077 -i Natsunagu-01.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 73.86584615384615 -i Natsunagu-01.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 55.39938461538461 -i Natsunagu-01.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 36.932923076923075 -i Natsunagu-01.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 18.466461538461537 -i Natsunagu-01.mkv -y -vframes 2 -filter:v cropdetect=0.094:16:0 -map 0:0 -f null -
[h265ize]: [verbose] Mapping HE Audio streams...
[h265ize]: [verbose] Setting ffmpeg settings...
[h265ize]: [verbose] Encoding video...
[h265ize]: [debug] Running Query: ffmpeg -n 10 /usr/bin/ffmpeg -i Natsunagu-01.mkv -y -acodec copy -vcodec libx265 -c:s copy -pix_fmt yuv420p -map 0:0 -map 0:1 -metadata:s:a:1 title="Japanese AAC LC (Stereo)" -map 0:2 -metadata:s:0:2 title=English -metadata:s:0:2 DISPOSITION:default=0 -map 0:3 -preset medium -x265-params crf=19:allow-non-conformance:ref=8:bframes=8:rd=6:me=star:b-adapt=2:qg-size=64:rc-lookahead=40:scenecut=45:weightb=1:psy-rd=2.0: /tmp/h265ize/Natsunagu-01.encoding-in-progress.mkv
[h265ize]: [debug] Error: ffmpeg exited with code 1: 
    at ChildProcess.<anonymous> (/usr/local/lib/node_modules/h265ize/node_modules/fluent-ffmpeg/lib/processor.js:182:22)
    at ChildProcess.emit (events.js:311:20)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
[h265ize]: ffmpeg exited with code 1: 
[h265ize]: [verbose] Finished encoding at Tue, 10:41 PM (a few seconds)
[h265ize]: [debug] Finished encoding in 1.501 seconds.
[h265ize]: Folder encoding finished at Tuesday, April 28th 2020, 10:41:06 PM
----------------------------------------------------------------------------------------------------------------------------------
[h265ize]: [alert] The following videos (1) were not encoded:
    - Natsunagu-01.mkv: ffmpeg exited with code 1: 
[h265ize]: Process exited.

A stand alone ffmpeg worked though.

$ ffmpeg -i Natsunagu-01.mkv -c:v libx265 -preset medium -x265-params crf=22:qcomp=0.8:aq-mode=1:aq_strength=1.0:qg-size=16:psy-rd=0.7:psy-rdoq=5.0:rdoq-level=1:merange=44 -c:a copy -c:s copy OutTest.mkv
ffmpeg version 4.2.2 Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 9 (GCC)
  configuration: --prefix=/usr --bindir=/usr/bin --datadir=/usr/share/ffmpeg --docdir=/usr/share/doc/ffmpeg --incdir=/usr/include/ffmpeg --libdir=/usr/lib64 --mandir=/usr/share/man --arch=x86_64 --optflags='-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection' --extra-ldflags='-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld ' --extra-cflags=' ' --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libvo-amrwbenc --enable-version3 --enable-bzlib --disable-crystalhd --enable-fontconfig --enable-frei0r --enable-gcrypt --enable-gnutls --enable-ladspa --enable-libaom --enable-libdav1d --enable-libass --enable-libbluray --enable-libcdio --enable-libdrm --enable-libjack --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libmp3lame --enable-nvenc --enable-openal --enable-opencl --enable-opengl --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librsvg --enable-libsrt --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libvorbis --enable-libv4l2 --enable-libvidstab --enable-libvmaf --enable-libvpx --enable-libx264 --enable-libx265 --enable-libxvid --enable-libzimg --enable-libzvbi --enable-avfilter --enable-avresample --enable-postproc --enable-pthreads --disable-static --enable-shared --enable-gpl --disable-debug --disable-stripping --shlibdir=/usr/lib64 --enable-libmfx --enable-runtime-cpudetect
  libavutil      56. 31.100 / 56. 31.100
  libavcodec     58. 54.100 / 58. 54.100
  libavformat    58. 29.100 / 58. 29.100
  libavdevice    58.  8.100 / 58.  8.100
  libavfilter     7. 57.100 /  7. 57.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  5.100 /  5.  5.100
  libswresample   3.  5.100 /  3.  5.100
  libpostproc    55.  5.100 / 55.  5.100
Input #0, matroska,webm, from 'Natsunagu-01.mkv':
  Metadata:
    encoder         : libebml v1.3.10 + libmatroska v1.5.2
    creation_time   : 2020-02-03T17:37:17.000000Z
  Duration: 00:04:00.06, start: 0.000000, bitrate: 1766 kb/s
    Stream #0:0: Video: h264 (Main), yuv420p(tv, bt709, progressive), 1280x720 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc (default)
    Metadata:
      BPS-eng         : 1551044
      DURATION-eng    : 00:03:59.990000000
      NUMBER_OF_FRAMES-eng: 5754
      NUMBER_OF_BYTES-eng: 46529396
      _STATISTICS_WRITING_APP-eng: mkvmerge v43.0.0 ('The Quartermaster') 64-bit
      _STATISTICS_WRITING_DATE_UTC-eng: 2020-02-03 17:37:17
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
    Stream #0:1(jpn): Audio: aac (LC), 48000 Hz, stereo, fltp (default)
    Metadata:
      BPS-eng         : 197907
      DURATION-eng    : 00:04:00.064000000
      NUMBER_OF_FRAMES-eng: 11253
      NUMBER_OF_BYTES-eng: 5938795
      _STATISTICS_WRITING_APP-eng: mkvmerge v43.0.0 ('The Quartermaster') 64-bit
      _STATISTICS_WRITING_DATE_UTC-eng: 2020-02-03 17:37:17
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
    Stream #0:2(eng): Subtitle: ass (default) (forced)
    Metadata:
      BPS-eng         : 93
      DURATION-eng    : 00:03:55.380000000
      NUMBER_OF_FRAMES-eng: 56
      NUMBER_OF_BYTES-eng: 2758
      _STATISTICS_WRITING_APP-eng: mkvmerge v43.0.0 ('The Quartermaster') 64-bit
      _STATISTICS_WRITING_DATE_UTC-eng: 2020-02-03 17:37:17
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
    Stream #0:3: Attachment: ttf
    Metadata:
      filename        : NotoSans-Bold.ttf
      mimetype        : application/x-truetype-font
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> hevc (libx265))
  Stream #0:1 -> #0:1 (copy)
  Stream #0:2 -> #0:2 (copy)
Press [q] to stop, [?] for help
x265 [info]: HEVC encoder version 0.0
x265 [info]: build info [Linux][GCC 9.1.1][64 bit] 8bit
x265 [info]: using cpu capabilities: MMX2 SSE2Fast LZCNT SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
x265 [info]: Main profile, Level-3.1 (Main tier)
x265 [info]: Thread pool created using 8 threads
x265 [info]: Slices                              : 1
x265 [info]: frame threads / pool features       : 3 / wpp(12 rows)
x265 [info]: Coding QT: max CU size, min CU size : 64 / 8
x265 [info]: Residual QT: max TU size, max depth : 32 / 1 inter / 1 intra
x265 [info]: ME / range / subpel / merge         : hex / 44 / 2 / 3
x265 [info]: Keyframe min / max / scenecut / bias: 23 / 250 / 40 / 5.00
x265 [info]: Lookahead / bframes / badapt        : 20 / 4 / 2
x265 [info]: b-pyramid / weightp / weightb       : 1 / 1 / 0
x265 [info]: References / ref-limit  cu / depth  : 3 / off / on
x265 [info]: AQ: mode / str / qg-size / cu-tree  : 1 / 1.0 / 16 / 1
x265 [info]: Rate Control / qCompress            : CRF-22.0 / 0.80
x265 [info]: tools: rd=3 psy-rd=0.70 rdoq=1 psy-rdoq=5.00 early-skip rskip
x265 [info]: tools: signhide tmvp b-intra strong-intra-smoothing lslices=4
x265 [info]: tools: deblock sao
Output #0, matroska, to 'OutTest.mkv':
  Metadata:
    encoder         : Lavf58.29.100
    Stream #0:0: Video: hevc (libx265), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], q=2-31, 23.98 fps, 1k tbn, 23.98 tbc (default)
    Metadata:
      BPS-eng         : 1551044
      DURATION-eng    : 00:03:59.990000000
      NUMBER_OF_FRAMES-eng: 5754
      NUMBER_OF_BYTES-eng: 46529396
      _STATISTICS_WRITING_APP-eng: mkvmerge v43.0.0 ('The Quartermaster') 64-bit
      _STATISTICS_WRITING_DATE_UTC-eng: 2020-02-03 17:37:17
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
      encoder         : Lavc58.54.100 libx265
    Side data:
      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
    Stream #0:1(jpn): Audio: aac (LC) ([255][0][0][0] / 0x00FF), 48000 Hz, stereo, fltp (default)
    Metadata:
      BPS-eng         : 197907
      DURATION-eng    : 00:04:00.064000000
      NUMBER_OF_FRAMES-eng: 11253
      NUMBER_OF_BYTES-eng: 5938795
      _STATISTICS_WRITING_APP-eng: mkvmerge v43.0.0 ('The Quartermaster') 64-bit
      _STATISTICS_WRITING_DATE_UTC-eng: 2020-02-03 17:37:17
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
    Stream #0:2(eng): Subtitle: ass (default) (forced)
    Metadata:
      BPS-eng         : 93
      DURATION-eng    : 00:03:55.380000000
      NUMBER_OF_FRAMES-eng: 56
      NUMBER_OF_BYTES-eng: 2758
      _STATISTICS_WRITING_APP-eng: mkvmerge v43.0.0 ('The Quartermaster') 64-bit
      _STATISTICS_WRITING_DATE_UTC-eng: 2020-02-03 17:37:17
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
frame= 5754 fps= 68 q=-0.0 Lsize=   26435kB time=00:04:00.04 bitrate= 902.2kbits/s speed=2.83x    
video:20509kB audio:5800kB subtitle:3kB other streams:0kB global headers:3kB muxing overhead: 0.470642%
x265 [info]: frame I:     39, Avg QP:18.51  kb/s: 12149.64
x265 [info]: frame P:   1525, Avg QP:21.13  kb/s: 1809.88 
x265 [info]: frame B:   4190, Avg QP:26.09  kb/s: 188.51  
x265 [info]: Weighted P-Frames: Y:4.8% UV:4.1%
x265 [info]: consecutive B-frames: 6.1% 9.0% 5.6% 69.8% 9.6% 

encoded 5754 frames in 84.76s (67.88 fps), 699.30 kb/s, Avg QP:24.72
FallingSnow commented 4 years ago

Try

ffmpeg -i Natsunagu-01.mkv -y -acodec copy -vcodec libx265 -c:s copy -pix_fmt yuv420p -map 0:0 -map 0:1 -metadata:s:a:1 title="Japanese AAC LC (Stereo)" -map 0:2 -metadata:s:0:2 title=English -metadata:s:0:2 DISPOSITION:default=0 -map 0:3 -preset medium -x265-params crf=19:allow-non-conformance:ref=8:bframes=8:rd=6:me=star:b-adapt=2:qg-size=64:rc-lookahead=40:scenecut=45:weightb=1:psy-rd=2.0: /tmp/h265ize/Natsunagu-01.encoding-in-progress.mkv

and let me know if that works. That's the command h265ize is using.

sorvani commented 4 years ago

First it said

/tmp/h265ize/Natsunagu-01.encoding-in-progress.mkv: No such file or directory

So I created the h265ize subfolder in /tmp

$ mkdir /tmp/h265ize

Then it gave this

[matroska @ 0x55dfe4ab9600] Invalid stream specifier: 0:2.

Full error:

$ ffmpeg -i Natsunagu-01.mkv -y -acodec copy -vcodec libx265 -c:s copy -pix_fmt yuv420p -map 0:0 -map 0:1 -metadata:s:a:1 title="Japanese AAC LC (Stereo)" -map 0:2 -metadata:s:0:2 title=English -metadata:s:0:2 DISPOSITION:default=0 -map 0:3 -preset medium -x265-params crf=19:allow-non-conformance:ref=8:bframes=8:rd=6:me=star:b-adapt=2:qg-size=64:rc-lookahead=40:scenecut=45:weightb=1:psy-rd=2.0: /tmp/h265ize/Natsunagu-01.encoding-in-progress.mkv
ffmpeg version 4.2.2 Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 10 (GCC)
  configuration: --prefix=/usr --bindir=/usr/bin --datadir=/usr/share/ffmpeg --docdir=/usr/share/doc/ffmpeg --incdir=/usr/include/ffmpeg --libdir=/usr/lib64 --mandir=/usr/share/man --arch=x86_64 --optflags='-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection' --extra-ldflags='-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld ' --extra-cflags=' ' --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libvo-amrwbenc --enable-version3 --enable-bzlib --disable-crystalhd --enable-fontconfig --enable-frei0r --enable-gcrypt --enable-gnutls --enable-ladspa --enable-libaom --enable-libdav1d --enable-libass --enable-libbluray --enable-libcdio --enable-libdrm --enable-libjack --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libmp3lame --enable-nvenc --enable-openal --enable-opencl --enable-opengl --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librsvg --enable-libsrt --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libvorbis --enable-libv4l2 --enable-libvidstab --enable-libvmaf --enable-libvpx --enable-libx264 --enable-libx265 --enable-libxvid --enable-libzimg --enable-libzvbi --enable-avfilter --enable-avresample --enable-postproc --enable-pthreads --disable-static --enable-shared --enable-gpl --disable-debug --disable-stripping --shlibdir=/usr/lib64 --enable-libmfx --enable-runtime-cpudetect
  libavutil      56. 31.100 / 56. 31.100
  libavcodec     58. 54.100 / 58. 54.100
  libavformat    58. 29.100 / 58. 29.100
  libavdevice    58.  8.100 / 58.  8.100
  libavfilter     7. 57.100 /  7. 57.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  5.100 /  5.  5.100
  libswresample   3.  5.100 /  3.  5.100
  libpostproc    55.  5.100 / 55.  5.100
Input #0, matroska,webm, from 'Natsunagu-01.mkv':
  Metadata:
    encoder         : libebml v1.3.10 + libmatroska v1.5.2
    creation_time   : 2020-02-03T17:37:17.000000Z
  Duration: 00:04:00.06, start: 0.000000, bitrate: 1766 kb/s
    Stream #0:0: Video: h264 (Main), yuv420p(tv, bt709, progressive), 1280x720 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc (default)
    Metadata:
      BPS-eng         : 1551044
      DURATION-eng    : 00:03:59.990000000
      NUMBER_OF_FRAMES-eng: 5754
      NUMBER_OF_BYTES-eng: 46529396
      _STATISTICS_WRITING_APP-eng: mkvmerge v43.0.0 ('The Quartermaster') 64-bit
      _STATISTICS_WRITING_DATE_UTC-eng: 2020-02-03 17:37:17
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
    Stream #0:1(jpn): Audio: aac (LC), 48000 Hz, stereo, fltp (default)
    Metadata:
      BPS-eng         : 197907
      DURATION-eng    : 00:04:00.064000000
      NUMBER_OF_FRAMES-eng: 11253
      NUMBER_OF_BYTES-eng: 5938795
      _STATISTICS_WRITING_APP-eng: mkvmerge v43.0.0 ('The Quartermaster') 64-bit
      _STATISTICS_WRITING_DATE_UTC-eng: 2020-02-03 17:37:17
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
    Stream #0:2(eng): Subtitle: ass (default) (forced)
    Metadata:
      BPS-eng         : 93
      DURATION-eng    : 00:03:55.380000000
      NUMBER_OF_FRAMES-eng: 56
      NUMBER_OF_BYTES-eng: 2758
      _STATISTICS_WRITING_APP-eng: mkvmerge v43.0.0 ('The Quartermaster') 64-bit
      _STATISTICS_WRITING_DATE_UTC-eng: 2020-02-03 17:37:17
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
    Stream #0:3: Attachment: ttf
    Metadata:
      filename        : NotoSans-Bold.ttf
      mimetype        : application/x-truetype-font
[matroska @ 0x55dfe4ab9600] Invalid stream specifier: 0:2.
    Last message repeated 1 times
sorvani commented 4 years ago

Came back to this today because I am getting tired of Handbrake.

Same issue. Currently on Fedora 32.

sorvani commented 4 years ago

If I remove the data for 0:2 form the ffmpeg command the encode runs. I removed this: -map 0:2 -metadata:s:0:2 title=English -metadata:s:0:2 DISPOSITION:default=0

ffmpeg -i Amachan_030.mkv -y -acodec copy -vcodec libx265 -filter:v crop=1264:720:6:0 -c:s copy -pix_fmt yuv420p -map 0:0 -map 0:1 -metadata:s:a:1 title="Japanese AAC LC (Stereo)" -map 0:2 -metadata:s:0:2 title=English -metadata:s:0:2 DISPOSITION:default=0 -preset medium -x265-params crf=19:allow-non-conformance:ref=8:bframes=8:rd=6:me=star:b-adapt=2:qg-size=64:rc-lookahead=40:scenecut=45:weightb=1:psy-rd=2.0: ./Amachan_030.encoding-in-progress.mkv

results in

Input #0, matroska,webm, from 'Amachan_030.mkv':
  Metadata:
    title           : あまちゃん
    encoder         : libebml v1.3.0 + libmatroska v1.4.0
    creation_time   : 2013-08-07T23:49:20.000000Z
  Duration: 00:15:00.00, start: 0.000000, bitrate: 3770 kb/s
    Stream #0:0: Video: h264 (High), yuv420p(progressive), 1280x720, SAR 1:1 DAR 16:9, 29.97 fps, 29.97 tbr, 1k tbn, 59.94 tbc (default)
    Stream #0:1(jpn): Audio: aac (LC), 48000 Hz, stereo, fltp (default)
    Stream #0:2(eng): Subtitle: subrip (default)
[matroska @ 0x563711029640] Invalid stream specifier: 0:2.
    Last message repeated 1 times

Removing the data for stream 0:2

ffmpeg -i Amachan_030.mkv -y -acodec copy -vcodec libx265 -filter:v crop=1264:720:6:0 -c:s copy -pix_fmt yuv420p -map 0:0 -map 0:1 -metadata:s:a:1 title="Japanese AAC LC (Stereo)" -preset medium -x265-params crf=19:allow-non-conformance:ref=8:bframes=8:rd=6:me=star:b-adapt=2:qg-size=64:rc-lookahead=40:scenecut=45:weightb=1:psy-rd=2.0: ./Amachan_030.encoding-in-progress.mkv

results in image

FallingSnow commented 4 years ago

Try master branch version.

npm install FallingSnow/h265ize --global
h265ize --version