5

I am trying to stream an image file to twitch -- the idea being that the file gets continuously updated.

using

ffmpeg \
    -re \
    -framerate 10 \
    -loop 1 \
    -f image2 \
    -i "/path/to/file.png" \
    -c:v libx264 \
    -preset superfast \
    -tune zerolatency \
    -pix_fmt yuv420p \
    -s 1000x1000 \
    -r 25 \
    -f flv rtmp://asdf.twitch.tv/app/asdf

the stream works initially, but after modifying and re-saving the file, twitch shows an error (There was a network error. Please try again. (Error #2000)) while ffmpeg keeps running without any error.

then, when I re-save the file once again, ffmpeg stops, with

[flv @ 0x7faa6201c200] Failed to update header with correct duration. 71.0kbits/s speed=0.659x
[flv @ 0x7faa6201c200] Failed to update header with correct filesize.

any ideas what's going wrong here?


edit:

-stream_loop -1 does not seem to help, as I'm getting this now:

enter image description here

1 Answer 1

1

The image2 demuxer aborts upon a read error which can happen if the read and write aren't atomic. Replace -loop 1 with -stream_loop -1 to use the generic looping code which will continue retrying upon failure.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.