[FFmpeg-user] HTTP to RTSP conversion not working, framerate issue ?
Adam Cécile (Le_Vert)
acecile at le-vert.net
Fri Apr 18 16:07:50 EEST 2025
Hello,
I'm struggling with FFMPEG to convert a specific camera stream with
shitty format and non-deterministic framerate to RTSP endpoint as H264.
I came up with this following command:
ffmpeg -f mxg -probesize 32 -fflags nobuffer -i
'http://admin:admin@10.10.10.10/cgi-bin/faststream.jpg?stream=MxPEG&fps=25&jpheaderupdate=1'
-vsync vfr -vf 'crop=iw/2:ih:0:0' -flags low_delay -preset ultrafast
-vcodec libx264 -an -tune zerolatency -loglevel info -hide_banner
-nostats -f rtsp rtsp://localhost::8554/7618
Producing the following output:
[mxg @ 0x562ffddf1540] Stream #0: not enough frames to estimate rate;
consider increasing probesize
Input #0, mxg, from
'http://admin:ad@10.10.10.10/cgi-bin/faststream.jpg?stream=MxPEG&fps=25&jpheaderupdate=1':
Duration: N/A, start: 1744980937.474607, bitrate: 64 kb/s
Stream #0:0: Video: mxpeg, yuvj420p(pc, bt470bg/unknown/unknown),
1280x480, 1000k tbr, 1000k tbn, 1000k tbc
Stream #0:1: Audio: pcm_alaw, 8000 Hz, mono, s16, 64 kb/s
Stream mapping:
Stream #0:0 -> #0:0 (mxpeg (native) -> h264 (libx264))
Press [q] to stop, [?] for help
[libx264 @ 0x562ffddfb380] MB rate (1200000000) > level limit
(16711680)
[libx264 @ 0x562ffddfb380] using cpu capabilities: MMX2 SSE2Fast SSSE3
SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 @ 0x562ffddfb380] profile Constrained Baseline, level 6.2,
4:2:0, 8-bit
2025/04/18 12:55:39 INF [RTSP] [conn 127.0.0.1:57966] opened
2025/04/18 12:55:39 INF [RTSP] [session 24e2616d] created by
127.0.0.1:57966
2025/04/18 12:55:39 INF [RTSP] [session 24e2616d] is publishing to path
'7618', 1 track (H264)
Output #0, rtsp, to 'rtsp://localhost:8554/7618':
Metadata:
encoder : Lavf58.45.100
Stream #0:0: Video: h264 (libx264), yuvj420p(pc), 640x480, q=-1--1,
1000k fps, 90k tbn, 1000k tbc
Metadata:
encoder : Lavc58.91.100 libx264
Side data:
cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A
It runs fine, but I cannot read anything back from the target RTSP
server.
However, running the command with "-f mp4 /tmp/dump.mp4" produce a
perfectly valid H264 file, with correct speed (i have timestamp
superimposed in video).
My guess is that there is a timestamp/framerate issue but I have no idea
how to fix that.
Can you point me to the correct direction ? Maybe ignore completely
input framerate and generate clean native 25 fps for output ?
Thanks in advance,
Best regards, Adam.
More information about the ffmpeg-user
mailing list