I created a pipeline to convert MJPEG http source to a rtsp server which is basically working like this:
/usr/local/bin/gst-rtsp-cli -p 8009 -b 0.0.0.0 "/video" "souphttpsrc location=http://0.0.0.0:8082 do-timestamp=true is_live=true ! multipartdemux ! image/jpeg,framerate=10/1,width=1920,height=1080 ! nvjpegdec ! omxh264enc profile=main bitrate=4000000 ! h264parse ! rtph264pay name=pay0 pt=96 config-interval=1
The source probed via ffprobe has the following characteristics:
Input #0, mpjpeg, from 'http://0.0.0.0:8082':
Duration: N/A, bitrate: N/A
Stream #0:0: Video: mjpeg (Baseline), yuvj420p(pc, bt470bg/unknown/unknown), 1920x1080 [SAR 1:1 DAR 16:9], 25 tbr, 25 tbn, 25 tb
Now when I try to ffprobe the output as first client I get:
[rtsp @ 0x5592c36a30] max delay reached. need to consume packet
[rtsp @ 0x5592c36a30] RTP: missed 28 packets
[h264 @ 0x5592c39910] corrupted macroblock 60 60 (total_coeff=-1)
[h264 @ 0x5592c39910] error while decoding MB 60 60
[h264 @ 0x5592c39910] concealing 949 DC, 949 AC, 949 MV errors in I frame
Input #0, rtsp, from 'rtsp://0.0.0.0:8009/video':
Metadata:
title : Session streamed with GStreamer
comment : rtsp-server
Duration: N/A, start: 0.218756, bitrate: N/A
Stream #0:0: Video: h264 (Main), yuv420p(progressive), 1920x1080, 90k tbr, 90k tbn, 180k tbc
But when other clients consume the stream, ffprobe on same host shows this:
[rtsp @ 0x55a6ca5a30] method PLAY failed: 503 Service Unavailable
rtsp://0.0.0.0:8009/video: Server returned 5XX Server Error reply
or
[rtsp @ 0x55bb50da30] method DESCRIBE failed: 503 Service Unavailable
rtsp://0.0.0.0:8009/video: Server returned 5XX Server Error reply
With GST_DEBUG=2 I get the following:
0:00:08.484084758 28379 0x559cb3b230 WARN omx gstomx.c:2826:plugin_init: Failed to load configuration file: Valid key file could not be found in search dirs (searched in: /root/.config:/etc/xdg as per GST_OMX_CONFIG_DIR environment variable, the xdg user config directory (or XDG_CONFIG_HOME) and the system config directory (or XDG_CONFIG_DIRS)
Framerate set to : 10 at NvxVideoEncoderSetParameterNvMMLiteOpen : Block : BlockType = 4
===== NVMEDIA: NVENC =====
NvMMLiteBlockCreate : Block : BlockType = 4
0:00:10.339949291 28379 0x7f8c005d40 WARN omxvideoenc gstomxvideoenc.c:1860:gst_omx_video_enc_set_format:<omxh264enc-omxh264enc0> Error setting temporal_tradeoff 0 : Vendor specific error (0x00000001)
H264: Profile = 77, Level = 40
NVMEDIA_ENC: bBlitMode is set to TRUE
0:00:10.375822480 28379 0x7f845ea8a0 WARN h264parse gsth264parse.c:2752:gst_h264_parse_set_caps:<h264parse0> H.264 AVC caps, but no codec_data
0:00:10.375970481 28379 0x7f845ea8a0 WARN h264parse gsth264parse.c:2778:gst_h264_parse_set_caps:<h264parse0> refused caps video/x-h264, alignment=(string)au, profile=(string)main, level=(string)4, stream-format=(string)avc, width=(int)1920, height=(int)1080, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)10/1, interlace-mode=(string)progressive, colorimetry=(string)1:4:0:0, chroma-site=(string)mpeg2, multiview-mode=(string)mono, multiview-flags=(GstVideoMultiviewFlagsSet)0:ffffffff:/right-view-first/left-flipped/left-flopped/right-flipped/right-flopped/half-aspect/mixed-mono
0:00:10.376079057 28379 0x7f845ea8a0 WARN h264parse gsth264parse.c:2752:gst_h264_parse_set_caps:<h264parse0> H.264 AVC caps, but no codec_data
0:00:10.376157361 28379 0x7f845ea8a0 WARN h264parse gsth264parse.c:2778:gst_h264_parse_set_caps:<h264parse0> refused caps video/x-h264, alignment=(string)au, profile=(string)main, level=(string)4, stream-format=(string)avc, width=(int)1920, height=(int)1080, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)10/1, interlace-mode=(string)progressive, colorimetry=(string)1:4:0:0, chroma-site=(string)mpeg2, multiview-mode=(string)mono, multiview-flags=(GstVideoMultiviewFlagsSet)0:ffffffff:/right-view-first/left-flipped/left-flopped/right-flipped/right-flopped/half-aspect/mixed-mono
0:00:10.376205137 28379 0x7f845ea8a0 WARN GST_PADS gstpad.c:4226:gst_pad_peer_query:<omxh264enc-omxh264enc0:src> could not send sticky events
0:00:10.403876551 28379 0x559cb3b230 WARN rtspmedia rtsp-media.c:3867:gst_rtsp_media_suspend: media 0x7f940a42c0 was not prepared
When a client like VLC consumes the stream at first, it works for VLC, but the framerate is 29.97 fps and not 10 fps.
- So how to fix the framerate?
- How to fix the access from different clients?
- How to fix the caps of h264parse?
Many thanks in advance.
Kind regards,
Markus