custom h264 stream

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

custom h264 stream

Bars
Hello, I'm new in gstreamer and need some help.

I need to write RTSP server for streaming video from StreamMax device

Video comes via N9M protocol, it's not documented

I've discovered that each chunk contains a timestamp and H264 data

I've made simple app that cuts H264 data and sends it to local UDP port

Now I can run pipeline:

gst-launch-1.0 -v udpsrc address='127.0.0.1' port=11111 \
  ! h264parse \
  ! avdec_h264 \
  ! videorate \
  ! video/x-raw,framerate=10/1 \
  ! x264enc \
  ! filesink location="test"

I can play file "test", but it seems not smooth (I think it's because of timestamp information loss )

Now I try to stream it via RTSP

gst-rtsp-server-1.8.0/examples/test-launch "( udpsrc address='127.0.0.1' port=11111
  ! h264parse
  ! avdec_h264
  ! videorate
  ! video/x-raw,framerate=10/1
  ! x264enc
  ! rtph264pay pt=96 name=pay0 )"

... and have an error:

0:00:15.172563338 26929 0x7f5568004b70 WARN               rtspmedia rtsp-media.c:2552:start_preroll: failed to preroll pipeline
0:00:15.172597133 26929 0x7f5568004b70 WARN               rtspmedia rtsp-media.c:2675:start_prepare: failed to preroll pipeline
0:00:15.172645798 26929       0xc77590 WARN               rtspmedia rtsp-media.c:2573:wait_preroll: failed to preroll pipeline
0:00:15.172683505 26929       0xc77590 WARN               rtspmedia rtsp-media.c:2877:gst_rtsp_media_prepare: failed to preroll pipeline
0:00:15.173173324 26929       0xc77590 ERROR             rtspclient rtsp-client.c:763:find_media: client 0xde40d0: can't prepare media
0:00:15.173473364 26929       0xc77590 ERROR             rtspclient rtsp-client.c:2288:handle_describe_request: client 0xde40d0: no media

I think I need somehow to pass timestamps from sourse stream to gstreamer

What is the right way to solve this problem? Any ideas?
Reply | Threaded
Open this post in threaded view
|

Re: custom h264 stream

Nicolas Dufresne-4
Le jeudi 12 mai 2016 à 01:11 -0700, Bars a écrit :

> Now I try to stream it via RTSP 
>
> gst-rtsp-server-1.8.0/examples/test-launch "( udpsrc
> address='127.0.0.1'
> port=11111 
>   ! h264parse
>   ! avdec_h264
>   ! videorate
>   ! video/x-raw,framerate=10/1
>   ! x264enc
>   ! rtph264pay pt=96 name=pay0 )"
>

This won't fix the timestamp issue, as the lost is from you server to
GStreamer.

Could I suggest you to write a source element for N9M (if it's a
secret, GStreamer plugin can be kept proprietary). This way, you'll be
able to use the N9M provided timestamp, and avoid introducing jitter.

The RTSP server pipeline would look like:
  "n9msrc ! rtph264pay pt=96 name=pay0"

You avoid the transcoding step too here (you can of course still
transcode, note that transcoding will honnor the input timestamp).

Nicolas
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: custom h264 stream

Bars
Thanks for your answer

Finally I've found an error in a pipe for test-launch, it doen't understand single quotes
with address=\"127.0.0.1\" it works