Hello, I want to ask a question about ffmpeg transcoding. First, here are
my parameters:

exec_static ffmpeg -hide_banner -loglevel repeat+level+warning
-err_detect ignore_err -fflags +genpts+igndts+discardcorrupt+nobuffer
-avoid_negative_ts make_zero -flags low_delay -rtmp_buffer 100
-rw_timeout 15000000 -analyzeduration 10000000 -probesize 10000000 -i
"rtmp://aaa.bbb.com/abc/live?reconnect=1&reconnect_streamed=1&reconnect_delay_max=5"
    -map 0:v -map 0:a -c:v libx264 -profile:v baseline -preset
veryfast -tune zerolatency -x264opts
"keyint=30:min-keyint=30:scenecut=0:force-cfr=1" -b:v 2000k -maxrate
7000k -bufsize 3500k -c:a aac -ac 1 -vf scale=-2:1080 -flvflags
no_duration_filesize+no_sequence_end -f flv
rtmp://localhost/test/abc_1080p
    -map 0:v -map 0:a -c:v libx264 -profile:v baseline -preset
${preset} -tune zerolatency -x264opts
"keyint=30:min-keyint=30:scenecut=0:force-cfr=1" -b:v 2000k -maxrate
7000k -bufsize 3500k -c:a aac -ac 1 -vf scale=-2:720 -flvflags
no_duration_filesize+no_sequence_end -f flv
rtmp://localhost/test/abc_720p
    -map 0:v -map 0:a -c:v libx264 -profile:v baseline -preset
${preset} -tune zerolatency -x264opts
"keyint=30:min-keyint=30:scenecut=0:force-cfr=1" -b:v 2000k -maxrate
7000k -bufsize 3500k -c:a aac -ac 1 -vf scale=-2:480 -flvflags
no_duration_filesize+no_sequence_end -f flv
rtmp://localhost/test/abc_480p 2>>/var/log/nginx/ffmpeg.log;

With these parameters, the transcoding latency and playback are normal.
However, when RTMP becomes unstable—such as during network instability,
jitter, or when the stream reconnects—the transcoding sometimes breaks and
playback fails. The log shows:

[aost#0:1/aac @ 0x6036eb9941c0] [warning] Non-monotonic DTS; previous:
88537152, current: 1209813; changing to 88537152. This may result in
incorrect timestamps in the output file.

This log keeps repeating. Is there a better way to solve this problem?

Is there a way to reconnect RTMP? Because RTMP administrators cannot
control stability.
FFmpeg version: 7.1.2
_______________________________________________
ffmpeg-user mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to