I dont know if someone here can help me but this forum keeps popping up on google search results, so fingers crossedRight now i am taking a live stream with rtmpdump and sending it to ffmpeg than nginx to serve as m3u8. This rtmpdump sometimes fails mid stream and need to be restarted which i do automatically but that takes about 10-15 seconds. During that time ffmpeg stops sending data to nginx so end users stream cuts with error. I am looking for a way to make this fully continuous so end users dont get disconnected.
I am a totaly newbie on ffmpeg and streaming so if you know a better way please tell me but what i think about doing is creating a named pipe where main ffmpeg constantly listens and sends data to nginx. When the stream is started i will start sending loading.mp4 to that pipe and when i recieve rtmpdump data i will stop it and send rtmpdump, when rtmpdump fails i will start sending loading.mp4 data instantly so basically there will be no down time on the stream, at least i hope there wont be. Like i said i am a total newbie on streaming but looking as a programmer i think this method should work...
Right now i am trying to tinker the code with options i am looking from online documents, there might be totally unnecessary options i am using...
when i run this command main ffmpeg starts listening on the pipe, then i runCode:mkfifo /var/streams/test ffmpeg -re \ -f live_flv -fflags +igndts -fflags flush_packets -fflags discardcorrupt \ -y -i "/var/streams/test" -c:v copy -map 0:0 -c:a copy -map 0:1? \ -fflags +genpts -frame_drop_threshold 1.0 -preset ultrafast \ -f flv -flvflags no_duration_filesize "rtmp://localhost:12345/hls/test" \ -async 1 -vsync 2
to here it all works perfectly and starts sending data to pipe which than gets sent to nginx and i can view on VLC, my problem start right here... When i stop the second ffmpeg instance which is sending updating.mp4 and restart it main ffmpeg instance throws "[live_flv @ 0x558799fe0f80] Packet mismatch " error, this is the same exact video that i started sending so codecs and all other things are the same. I tried looking online for "packet mismatch" error but couldnt find a solution...Code:ffmpeg -y -re -stream_loop -1 -i "/var/updating.mp4" -c:v copy -map 0:0 -c:a copy -map 0:1? \ -f flv -flvflags no_duration_filesize "/var/streams/test"
Can someone tell me what i am doing wrong here?
+ Reply to Thread
Results 1 to 2 of 2
Similar Threads
-
HELP - Encoding a dynamic playlist into one continuous stream
By hedgehog90 in forum Video Streaming DownloadingReplies: 3Last Post: 16th Nov 2022, 07:49 -
How to capture this live stream.
By pedrothelion in forum Video Streaming DownloadingReplies: 4Last Post: 4th Jul 2021, 11:18 -
Ffmpeg - webm live input to HLS m3u8 live output
By 1ewis in forum Video ConversionReplies: 0Last Post: 15th Apr 2021, 08:54 -
How to record this live stream?
By Chemist116 in forum Video Streaming DownloadingReplies: 2Last Post: 20th Feb 2018, 17:08 -
Help with live stream
By christheradioguy in forum Video Streaming DownloadingReplies: 10Last Post: 5th Sep 2016, 12:59