[FFmpeg-user] Non-monotonic DTS errors, saving a live encode via mediaMTX

Andrew Strachan stroltz at hotmail.com
Fri Dec 27 03:42:55 EET 2024


Hi,

I am please looking for some advice. live encoding from a decklink card to MediaMTX (on windows) then using ffmpeg to save the live stream to file. I need to be able to independently stop and start the saving of the file, that's why I am using this setup. We are also going to send the live stream to a CDN, via another instance of ffmpeg.

Here is my current command to encode;

ffmpeg.exe -rtbufsize 2G -re -format_code Hp30 -f decklink -i 35:00000000:00230600 -framerate 30 -video_size 1920x1080 -pix_fmt uyvy422 -vcodec libx264 -preset veryfast -x264-params "keyint=120:min-keyint=120:scenecut=0" -tune stillimage -b:v 3000k -minrate 3000k -maxrate 3000k -bufsize 3000k -acodec aac -ac 2 -ar 48000 -b:a 128k -g 120 -f rtsp rtsp://localhost:8554/mystream

then to save the file I am using this;
ffmpeg -rtsp_transport tcp -fflags +igndts -copyts -i rtsp://localhost:8554/mystream -start_at_zero -c copy output.ts

I don't have the time to re-encode the .ts - just we will do a -copy and change to .mp4 which will be the final output.

I keep getting Non-monotonic DTS errors, which I could just ignore, but I think they are suggesting something is wrong. My test .ts files will play in VLC, but I don't think they are 'good enough'. both seeking and audio sync does not look right.




More information about the ffmpeg-user mailing list