VideoHelp Forum
+ Reply to Thread
Results 1 to 2 of 2
Thread
  1. I dont know if someone here can help me but this forum keeps popping up on google search results, so fingers crossed Right 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...

    Code:
    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
    when i run this command main ffmpeg starts listening on the pipe, then i run

    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"
    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...

    Can someone tell me what i am doing wrong here?
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!