srs icon indicating copy to clipboard operation
srs copied to clipboard

ffmpeg exits after video is played

Open streamingsystems opened this issue 1 year ago • 0 comments

Describe the bug Hi,

I think I found another issue where ffmpeg is crashing when the video is completed similar to this issue:

https://github.com/ossrs/srs/issues/3803

After a video is played ffmpeg exists with this:

av_interleaved_write_frame(): Broken pipeq=-1.0 size= 36024kB time=00:02:37.73 bitrate=1870.9kbits/s speed= 1x [flv @ 0x7fb3d4106880] Failed to update header with correct duration. [flv @ 0x7fb3d4106880] Failed to update header with correct filesize. [flv @ 0x7fb3d07159c0] Failed to update header with correct duration. [flv @ 0x7fb3d07159c0] Failed to update header with correct filesize. Error writing trailer of rtmp://127.0.0.1:1935/live/map_1: Broken pipe [flv @ 0x7fb3d0714200] Failed to update header with correct duration. [flv @ 0x7fb3d0714200] Failed to update header with correct filesize. Error writing trailer of rtmp://127.0.0.1:1935/live/map_2: Broken pipe [flv @ 0x7fb3d1110fc0] Failed to update header with correct duration. [flv @ 0x7fb3d1110fc0] Failed to update header with correct filesize. Error writing trailer of rtmp://127.0.0.1:1935/live/map_3: Broken pipe frame= 3950 fps= 25 q=-1.0 Lq=-1.0 q=-1.0 q=-1.0 size= 38958kB time=00:02:38.03 bitrate=2019.4kbits/s speed= 1x video:37685kB audio:1236kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.094195% Error closing file rtmp://127.0.0.1:1935/live/map_1: Broken pipe Error closing file rtmp://127.0.0.1:1935/live/map_2: Broken pipe Error closing file rtmp://127.0.0.1:1935/live/map_3: Broken pipe

In issue 3803 it was a problem with ffmpeg but you were able to make a change to the server to work around this issue.

Version Latest To Reproduce

  1. Download and extract the the ZIP file that contains 4 videos:

https://www.dropbox.com/scl/fi/q9wlzlafb75obu84e64v0/ffmpeg-map.zip?rlkey=7ahs16533ghdnfvddl51or0z6&dl=0

  1. Run this command:

ffmpeg -stream_loop -1 -re -i 1.mp4 -stream_loop -1 -re -i 2.mp4 -stream_loop -1 -re -i 3.mp4 -stream_loop -1 -re -i 4.mp4 -map 0 -c copy -f flv rtmp://127.0.0.1:1935/live/map_0 -map 1 -c copy -f flv rtmp://127.0.0.1:1935/live/map_1 -map 2 -c copy -f flv rtmp://127.0.0.1:1935/live/map_2 -map 3 -c copy -f flv rtmp://127.0.0.1:1935/live/map_3

The video is 2m 38s long, when it reaches the end ffmpeg exits due to "Broken pipe".

Expected behavior

Ffmpeg should start over and loop the video forever.

Screenshots If applicable, add screenshots to help explain your problem.

Additional context Add any other context about the problem here.

streamingsystems avatar Oct 18 '23 19:10 streamingsystems