01.03.2024, 21:33
I tested the dev version of Hybrid with "vsdeoldify" support.
The generated script is working well with "vsViewer" both in preview and encoding mode.
But is not working when is used with "vsPipe".
To try to understand what is happening I used ffmpeg.
Test 1: I used ffmpeg with Vaoursynth support (like my modded version of vsViewer).
In this way the encoding was successfully.
Test 2: I used ffmpeg with Windows pipe (like "vsPipe").
In this case the encoding failed.
the main reason of the error is: Error submitting a packet to the muxer: Invalid argument
I don't know what is this wrong argument. The error happen at the 1st frame. The problem is that the starting of encoding is very slow so I don't know what is sent as 1st frame since I think that the real frame is not yet available.
This kind problems happen with windows pipe, not clear if the pipe in Unix has not this kind of problem. In in Windows is evident.
Dan
The generated script is working well with "vsViewer" both in preview and encoding mode.
But is not working when is used with "vsPipe".
To try to understand what is happening I used ffmpeg.
Test 1: I used ffmpeg with Vaoursynth support (like my modded version of vsViewer).
D:\PProjects\vs-deoldify_dev>"D:\Programs\Hybrid\64bit\Vapoursynth\ffmpeg.exe" -f vapoursynth -i "D:\PProjects\vs-deoldify_dev\encoding.vpy" -c:v libx265 -c:a copy "D:\PProjects\vs-deoldify_dev\VideoTest1_720p-1.mp4"
ffmpeg version N-113112-g548ceb9b8f-gf5f414d9c4+3 Copyright (c) 2000-2023 the FFmpeg developers
built with gcc 13.2.0 (Rev3, Built by MSYS2 project)
configuration: --pkg-config=pkgconf --cc='ccache gcc' --cxx='ccache g++' --ld='ccache g++' --extra-cxxflags=-fpermissive --extra-cflags=-Wno-int-conversion --disable-autodetect --enable-amf --enable-bzlib --enable-cuda --enable-cuvid --enable-d3d11va --enable-dxva2 --enable-iconv --enable-lzma --enable-nvenc --enable-zlib --enable-sdl2 --enable-ffnvcodec --enable-nvdec --enable-cuda-llvm --enable-libmp3lame --enable-libopus --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-libdav1d --enable-libaom --disable-debug --enable-fontconfig --enable-libass --enable-libbluray --enable-libfreetype --enable-libmfx --enable-libmysofa --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libwebp --enable-libxml2 --enable-libzimg --enable-libshine --enable-gpl --enable-avisynth --enable-libxvid --enable-libopenmpt --enable-version3 --enable-librav1e --enable-libsrt --enable-libgsm --enable-libvmaf --enable-libsvtav1 --enable-openal --enable-vapoursynth --enable-opencl --enable-opengl --enable-mbedtls --extra-cflags=-DLIBTWOLAME_STATIC --extra-libs=-lstdc++ --extra-cflags=-DLIBXML_STATIC --extra-libs=-liconv --disable-w32threads --extra-cflags=-DAL_LIBTYPE_STATIC --extra-cflags='-IH:/mabs/local64/include' --extra-cflags='-IH:/mabs/local64/include/AL'
libavutil 58. 36.100 / 58. 36.100
libavcodec 60. 36.100 / 60. 36.100
libavformat 60. 20.100 / 60. 20.100
libavdevice 60. 4.100 / 60. 4.100
libavfilter 9. 14.101 / 9. 14.101
libswscale 7. 6.100 / 7. 6.100
libswresample 4. 13.100 / 4. 13.100
libpostproc 57. 4.100 / 57. 4.100
Note: NumExpr detected 20 cores but "NUMEXPR_MAX_THREADS" not set, so enforcing safe limit of 8.
NumExpr defaulting to 8 threads.
Input #0, vapoursynth, from 'D:\PProjects\vs-deoldify_dev\encoding.vpy':
Duration: 00:01:48.19, start: 0.000000, bitrate: 0 kb/s
Stream #0:0: Video: wrapped_avframe, yuv420p10le, 1280x692, 23.98 tbr, 23.98 tbn
Stream mapping:
Stream #0:0 -> #0:0 (wrapped_avframe (native) -> hevc (libx265))
Press [q] to stop, [?] for help
x265 [info]: HEVC encoder version 3.5+113-2d109669e
x265 [info]: build info [Windows][GCC 13.2.0][64 bit] 10bit
x265 [info]: using cpu capabilities: MMX2 SSE2Fast LZCNT SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
x265 [info]: Main 10 profile, Level-3.1 (Main tier)
x265 [info]: Thread pool created using 20 threads
x265 [info]: Slices : 1
x265 [info]: frame threads / pool features : 4 / wpp(11 rows)
x265 [warning]: Source height < 720p; disabling lookahead-slices
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 / 57 / 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 : 2 / 1.0 / 32 / 1
x265 [info]: Rate Control / qCompress : CRF-28.0 / 0.60
x265 [info]: tools: rd=3 psy-rd=2.00 early-skip rskip mode=1 signhide tmvp
x265 [info]: tools: b-intra strong-intra-smoothing deblock sao
Output #0, mp4, to 'D:\PProjects\vs-deoldify_dev\VideoTest1_720p-1.mp4':
Metadata:
encoder : Lavf60.20.100
Stream #0:0: Video: hevc (hev1 / 0x31766568), yuv420p10le(bt709, progressive), 1280x692, q=2-31, 23.98 fps, 24k tbn
Metadata:
encoder : Lavc60.36.100 libx265
Side data:
cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A
[out#0/mp4 @ 000001eb5e125a40] video:6136kB audio:0kB subtitle:0kB other streams:0kB global headers:2kB muxing overhead: 0.587747%
frame= 2594 fps=6.2 q=35.5 Lsize= 6172kB time=00:01:48.10 bitrate= 467.7kbits/s speed=0.26x
x265 [info]: frame I: 14, Avg QP:26.87 kb/s: 3957.69
x265 [info]: frame P: 663, Avg QP:27.55 kb/s: 1218.26
x265 [info]: frame B: 1917, Avg QP:33.90 kb/s: 177.35
x265 [info]: Weighted P-Frames: Y:11.3% UV:10.6%
encoded 2594 frames in 416.57s (6.23 fps), 463.80 kb/s, Avg QP:32.24
In this way the encoding was successfully.
Test 2: I used ffmpeg with Windows pipe (like "vsPipe").
D:\PProjects\vs-deoldify_dev>"D:\Programs\Hybrid\64bit\Vapoursynth\ffmpeg.exe" -f vapoursynth -i "D:\PProjects\vs-deoldify_dev\encoding.vpy" -vcodec rawvideo -strict -1 -f yuv4mpegpipe - | "D:\Programs\Hybrid\64bit\x265.exe" --y4m - -o "D:\PProjects\vs-deoldify_dev\VideoTest1_720p-1.265"
ffmpeg version N-113112-g548ceb9b8f-gf5f414d9c4+3 Copyright (c) 2000-2023 the FFmpeg developers
built with gcc 13.2.0 (Rev3, Built by MSYS2 project)
configuration: --pkg-config=pkgconf --cc='ccache gcc' --cxx='ccache g++' --ld='ccache g++' --extra-cxxflags=-fpermissive --extra-cflags=-Wno-int-conversion --disable-autodetect --enable-amf --enable-bzlib --enable-cuda --enable-cuvid --enable-d3d11va --enable-dxva2 --enable-iconv --enable-lzma --enable-nvenc --enable-zlib --enable-sdl2 --enable-ffnvcodec --enable-nvdec --enable-cuda-llvm --enable-libmp3lame --enable-libopus --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-libdav1d --enable-libaom --disable-debug --enable-fontconfig --enable-libass --enable-libbluray --enable-libfreetype --enable-libmfx --enable-libmysofa --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libwebp --enable-libxml2 --enable-libzimg --enable-libshine --enable-gpl --enable-avisynth --enable-libxvid --enable-libopenmpt --enable-version3 --enable-librav1e --enable-libsrt --enable-libgsm --enable-libvmaf --enable-libsvtav1 --enable-openal --enable-vapoursynth --enable-opencl --enable-opengl --enable-mbedtls --extra-cflags=-DLIBTWOLAME_STATIC --extra-libs=-lstdc++ --extra-cflags=-DLIBXML_STATIC --extra-libs=-liconv --disable-w32threads --extra-cflags=-DAL_LIBTYPE_STATIC --extra-cflags='-IH:/mabs/local64/include' --extra-cflags='-IH:/mabs/local64/include/AL'
libavutil 58. 36.100 / 58. 36.100
libavcodec 60. 36.100 / 60. 36.100
libavformat 60. 20.100 / 60. 20.100
libavdevice 60. 4.100 / 60. 4.100
libavfilter 9. 14.101 / 9. 14.101
libswscale 7. 6.100 / 7. 6.100
libswresample 4. 13.100 / 4. 13.100
libpostproc 57. 4.100 / 57. 4.100
x265 [error]: unable to open input file <->
Input #0, vapoursynth, from 'D:\PProjects\vs-deoldify_dev\encoding.vpy':
Duration: 00:01:48.19, start: 0.000000, bitrate: 0 kb/s
Stream #0:0: Video: wrapped_avframe, yuv420p10le, 1280x692, 23.98 tbr, 23.98 tbn
Stream mapping:
Stream #0:0 -> #0:0 (wrapped_avframe (native) -> rawvideo (native))
Press [q] to stop, [?] for help
[yuv4mpegpipe @ 0000022278745e40] Warning: generating non standard YUV stream. Mjpegtools will not work.
Output #0, yuv4mpegpipe, to 'pipe:':
Metadata:
encoder : Lavf60.20.100
Stream #0:0: Video: rawvideo (Y3[11][10] / 0xA0B3359), yuv420p10le(bt709, progressive), 1280x692, q=2-31, 318555 kb/s, 23.98 fps, 23.98 tbn
Metadata:
encoder : Lavc60.36.100 rawvideo
[vost#0:0/rawvideo @ 0000022278746980] Error submitting a packet to the muxer: Invalid argument
Last message repeated 1 times
[out#0/yuv4mpegpipe @ 0000022276f6ed80] Error muxing a packet
[out#0/yuv4mpegpipe @ 0000022276f6ed80] Task finished with error code: -22 (Invalid argument)
[out#0/yuv4mpegpipe @ 0000022276f6ed80] Terminating thread with return code -22 (Invalid argument)
[out#0/yuv4mpegpipe @ 0000022276f6ed80] Error writing trailer: Invalid argument
[out#0/yuv4mpegpipe @ 0000022276f6ed80] Error closing file: Invalid argument
[out#0/yuv4mpegpipe @ 0000022276f6ed80] video:2595kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.002597%
frame= 1 fps=0.0 q=-0.0 Lsize= 2595kB time=00:00:00.04 bitrate=509705.4kbits/s speed=0.0915x
Conversion failed!
In this case the encoding failed.
the main reason of the error is: Error submitting a packet to the muxer: Invalid argument
I don't know what is this wrong argument. The error happen at the 1st frame. The problem is that the starting of encoding is very slow so I don't know what is sent as 1st frame since I think that the real frame is not yet available.
This kind problems happen with windows pipe, not clear if the pipe in Unix has not this kind of problem. In in Windows is evident.
Dan