Record UDP stream

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

Record UDP stream

Mattekr
Hi, I'm a gstreamer newbie.

I would like to see and record a UDP stream from my camera.

I use for see

C:\gstreamer\1.0\x86_64\bin\gst-launch-1.0.exe -e -v udpsrc port=5000 ! application/x-rtp, payload=96 ! rtpjitterbuffer ! rtph264depay ! avdec_h264 ! fpsdisplaysink sync=false text-overlay=false

and this for record

C:\gstreamer\1.0\x86_64\bin\gst-launch-1.0.exe -e -v udpsrc port=5000 ! application/x-rtp, payload=96 ! rtpjitterbuffer ! rtph264depay ! avdec_h264 ! decodebin ! x264enc ! mp4mux ! filesink location=C:\\Users\\Progettazione\\Desktop\\file.mp4

All the attempts I made to record and see in one command did not work

For example, I get the error:

WARNING: erroneous pipeline: could not link fpsdisplaysink0 to filesink0

How can I do? Thanks in advance.
Reply | Threaded
Open this post in threaded view
|

Re: Record UDP stream

noscgag
You need to split the stream in two with the tee and queue elements.

Here's an example of a working video pipeline that displays and records simultaneously:

gst-launch-1.0 rtspsrc location=rtsp://127.0.0.1:8554/front latency=0 ! tee name=t t. ! queue ! rtph264depay ! avdec_h264 ! fpsdisplaysink sync=false t. ! queue ! rtph264depay ! h264parse ! mpegtsmux ! filesink location="ts.mpg"

You will need to modify it to work with RTP, but that is straightforward. Note that you don't have to re-encode with x264enc unless you want to, but you do need to parse it and wrap it in a muxer.


From: Mattekr <[hidden email]>
To: [hidden email]
Sent: Friday, May 19, 2017 9:04 AM
Subject: Record UDP stream

Hi, I'm a gstreamer newbie.

I would like to see and record a UDP stream from my camera.

I use for see

C:\gstreamer\1.0\x86_64\bin\gst-launch-1.0.exe -e -v udpsrc port=5000 !
application/x-rtp, payload=96 ! rtpjitterbuffer ! rtph264depay ! avdec_h264
! fpsdisplaysink sync=false text-overlay=false

and this for record

C:\gstreamer\1.0\x86_64\bin\gst-launch-1.0.exe -e -v udpsrc port=5000 !
application/x-rtp, payload=96 ! rtpjitterbuffer ! rtph264depay ! avdec_h264
! decodebin ! x264enc ! mp4mux ! filesink
location=C:\\Users\\Progettazione\\Desktop\\file.mp4

All the attempts I made to record and see in one command did not work

For example, I get the error:

WARNING: erroneous pipeline: could not link fpsdisplaysink0 to filesink0

How can I do? Thanks in advance.




--
Sent from the GStreamer-devel mailing list archive at Nabble.com.
_______________________________________________
gstreamer-devel mailing list



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

Re: Record UDP stream

Mattekr
Thank you, I solved with your advice.

Here is the command if it could be useful to someone

C:\gstreamer\1.0\x86_64\bin\gst-launch-1.0.exe -e -v udpsrc port=5000 ! tee name=t t. ! queue ! application/x-rtp, payload=96 ! rtpjitterbuffer ! rtph264depay ! avdec_h264 ! fpsdisplaysink sync=false text-overlay=false t. ! queue ! application/x-rtp, payload=96 ! rtpjitterbuffer ! rtph264depay ! avdec_h264 ! decodebin ! x264enc ! mp4mux ! filesink location=C:\\test\\file.mp4
Reply | Threaded
Open this post in threaded view
|

Re: Record UDP stream

Michelle Guo
Hi Mattekr
    I have the same problem as you. I receive h264 stream from udpsrc, then
play and record it. I use the similar pipeline as yours, however, my problem
is that the file saved from filesink is not playable. So do you have any
idea ?  
    Thank you so much !  
Mattekr wrote

> Thank you, I solved with your advice.
>
> Here is the command if it could be useful to someone
>
> C:\gstreamer\1.0\x86_64\bin\gst-launch-1.0.exe -e -v udpsrc port=5000 !
> tee name=t t. ! queue ! application/x-rtp, payload=96 ! rtpjitterbuffer !
> rtph264depay ! avdec_h264 ! fpsdisplaysink sync=false text-overlay=false
> t. ! queue ! application/x-rtp, payload=96 ! rtpjitterbuffer !
> rtph264depay ! avdec_h264 ! decodebin ! x264enc ! mp4mux ! filesink
> location=C:\\test\\file.mp4





--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

AW: Record UDP stream

Thornton, Keith
Hi, why does your pipeline first decode the H264 than pass it through the decodebin and then re-encode to H264 before muxing it. I haven't understood this. I would have thought it should be possible to just put it through H264parse to convert it to AVC format and then to mux it.

-----Ursprüngliche Nachricht-----
Von: gstreamer-devel [mailto:[hidden email]] Im Auftrag von Michelle Guo
Gesendet: Dienstag, 10. Oktober 2017 04:08
An: [hidden email]
Betreff: Re: Record UDP stream

Hi Mattekr
    I have the same problem as you. I receive h264 stream from udpsrc, then play and record it. I use the similar pipeline as yours, however, my problem is that the file saved from filesink is not playable. So do you have any idea ?  
    Thank you so much !  
Mattekr wrote

> Thank you, I solved with your advice.
>
> Here is the command if it could be useful to someone
>
> C:\gstreamer\1.0\x86_64\bin\gst-launch-1.0.exe -e -v udpsrc port=5000 !
> tee name=t t. ! queue ! application/x-rtp, payload=96 ! rtpjitterbuffer !
> rtph264depay ! avdec_h264 ! fpsdisplaysink sync=false
> text-overlay=false t. ! queue ! application/x-rtp, payload=96 ! rtpjitterbuffer !
> rtph264depay ! avdec_h264 ! decodebin ! x264enc ! mp4mux ! filesink
> location=C:\\test\\file.mp4





--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: AW: Record UDP stream

killerrats
This post was updated on .
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: AW: Record UDP stream

Nicolas Dufresne-5
Le mardi 10 octobre 2017 à 07:51 -0700, killerrats a écrit :
> so doing these pipeline doesn't work?

You should maybe describe how this fails, maybe share some logs (e.g.
with GST_DEBUG=3 env set). You may get lucky, and someone will have
time to run your pipelines, but in truth, most of people helping on
this ML have very little time since they also have a job.

>
> gst-launch-1.0.exe -e -v udpsrc port=5000 ! application/x-rtp, payload=96 !
> rtpjitterbuffer ! rtph264depay ! h264parse ! mp4mux ! filesink
> location=C:\\Users\\Progettazione\\Desktop\\file.mp4
>
> or without rtpjitterbuffer
>
> gst-launch-1.0.exe -e -v udpsrc port=5000 ! application/x-rtp, payload=96 !
> rtph264depay ! h264parse ! mp4mux ! filesink
> location=C:\\Users\\Progettazione\\Desktop\\file.mp4
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

signature.asc (201 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: AW: Record UDP stream

Michelle Guo
Hi
Sorry for my poor English.
The pipeline I used like this:
gst-launch-1.0 rtpbin name=rtpbin latency=100 \
 udpsrc
caps="application/x-rtp,media=(string)video,clock-rate=(int)90000,encoding-name=(string)H264,payload=(int)96"
port=5000 ! queue ! rtpbin.recv_rtp_sink_0  rtpbin. ! rtph264depay \
! tee name=teevideo teevideo. ! queue ! vpudec ! overlaysink \
teevideo. ! queue !
"video/x-h264,width=1024,height=768,framerate=(fraction)25/1" ! matroskamux
name=mux mux. ! multifilesink location="/home/root/save%d.mkv" next-file=4
post-messages=TRUE max-files=300 max-file-size=10485760

I receive H264 stream from udpsrc, then play video and record H264 data into
several files.

The problem is described like this:
The pipeline works well, but, the files saved in the disk is not playable.
1. The first one save0.mkv can be played by VLC, but can not query duration,
so VLC can not fast forward and rewind.
2. The other files excepet the first one(save1.mkv, save2.mkv...) can not
play by VLC;

Thank you for your reading.



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel