savonet / liquidsoap

Liquidsoap is a statically typed scripting general-purpose language with dedicated operators and backend for all thing media, streaming, file generation, automation, HTTP backend and more.
http://liquidsoap.info
GNU General Public License v2.0
1.4k stars 130 forks source link

%avi encoder seems to be broken #3311

Open toots opened 1 year ago

toots commented 1 year ago

Discussed in https://github.com/savonet/liquidsoap/discussions/3307

Originally posted by **Rafi594** August 8, 2023 Hello, I'm currently trying to use output.external for using custom ffmpeg command but the output have a blinking green screen (probably pixel format issues) I have also tried with `output.file(%avi, fallible=true, "video.flv", stream)` and I get the same issue. I made a workaround by replacing %avi by `%ffmpeg(format="avi",%video(codec="rawvideo", pixel_format="yuv420p"),%audio(codec="pcm_s16le"))` Script for reproducing ``` audio = input.http("http://127.0.0.1:8000/audio.aac") video = video.testsrc.ffmpeg(pattern="testsrc2") stream = mux_video(video=video, audio) output.external( self_sync=true, fallible=true, %avi, "ffmpeg -re -i pipe:0 -f avi -c:v h264_nvenc -b:v 5000k -c:a aac -b:a 128k -pix_fmt yuv420p -f flv rtmp://127.0.0.1:1935/test-stream", stream) ``` https://github.com/savonet/liquidsoap/assets/28735472/79f7b57f-5203-48b8-94fc-52aa9206492f
smimram commented 1 year ago

The script

s = video.testsrc()
output.graphics(s)
output.file(%avi, "/tmp/test.avi", s)

works well here:

https://github.com/savonet/liquidsoap/assets/2012073/176a0b88-2a6b-4617-8f0a-2f33d8c32e88

Could you try to have a simple repro case (which possibly does not involve ffmpeg to minimize confusion sources...)