FFMPEG hangs only when using this generator
ziriax opened this issue · comments
I was able to make a custom FFMPEG build using your amazing tool, using the following settings in a new batch file (copied from your LPGL batch file)
SET DEPENDENCIES=( ^
zlib, ^
opus, ^
libvpx ^
)
SET PGOPTIONS=--enable-version3 --enable-ffnvcodec --enable-avcodec --enable-avformat --enable-avfilter --enable-swresample --enable-swscale --enable-ffmpeg --enable-libvpx --enable-libopus --enable-zlib --enable-encoder=png --enable-encoder=ljpeg --toolchain=msvc
This works nicely, I am able to build it using VS2017 (I also re-targeted the projects to Win10 14393)
However, when running it, FFMPEG hangs in an infinite loop in the append_packet_chunked
function.
The FFMPEG command line arguments are:
-hide_banner -loglevel warning -y -f rawvideo -pix_fmt bgra -s 1920x1080 -r 25 -i \\.\pipe\WMAN_FFMPEG_6e323359-0400-4dc0-b709-caf470e6ec08 -an -threads 0 -r 25 -f image2 -compression_level 1 "d:\AnimNowExport\TRC_SHOT_16_F3428_F03516\test1TRC_SHOT_16_F3428_F03516\test1TRC_SHOT_16_F3428_F03516_%06d.png"
(we are feeding real-time 3D rendered scenes into FFMPEG on Windows 10, hence the pipe)
It outputs warnings:
Truncating packet of size 8294400 to 8261633
Truncating packet of size 8290574 to 8257807
and then hangs, similarly to this report from 2012
It does work with an FFMPEG build generated using https://github.com/rdp/ffmpeg-windows-build-helpers, using the following config in Ubuntu
ffmpeg version N-92374-gd96ae9d5ea-ffmpeg-windows-build-helpers Copyright (c) 2000-2018 the FFmpeg developers
built with gcc 8.2.0 (GCC)
configuration: --pkg-config=pkg-config --pkg-config-flags=--static --extra-version=ffmpeg-windows-build-helpers --enable-version3 --disable-debug --enable-w32threads --disable-pthreads --arch=x86_64 --target-os=mingw32 --enable-libopus --enable-libvpx --enable-nvenc --enable-nvdec --disable-amf --disable-libmfx --extra-cflags='-mtune=generic' --extra-cflags=-O3 --enable-static --disable-shared
I tried different FFMPEG source versions (3.4, 4.1,latest) but the behavior doesn't change.
Just encoding from a file works fine, it just seems to be the named pipe input that is broken.
Would you know what could be the cause, and any workarounds?
Thanks a lot,
Peter
Hmmm, a quick look doesnt show anything obvious.
Try compiling in debug mode and see if its still hangs. Debugging it in VS should show you whats going wrong. If you can isolate the issue then ill look into a fix.
Thanks for the advice.
Debugging reveals a bug that should have been fixed: https://trac.ffmpeg.org/ticket/861
Indeed the bugfix is in the code I see at first sight, but still it hangs.
The only thing I could do is to print stuff in the loop in both the cross compiled and VS2017 version, and see how these differ...
Did you manage to isolate the issue any further?
If not then try providing an exact command line argument with any required input files/data that could be used to exactly reproduce your use case
No I was not able to spend more time on this. Since the whole point of using this project was to stop using named pipes, we abandoned efforts to figure out what was going wrong, since everything else seemed to work fine.
If I find some time, I will make a minimal reproducable case.