Save live Video using gstreamer command

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

Save live Video using gstreamer command

Purva
Hi,
I want to save live video in any format using gstreamer command.
I have used below command to stream live video:
gst-launch-1.0 udpsrc port=2222 ! decodebin ! autovideosink sync=false
I am able to stream live video of camera. Now I want to save that video in
any format. So
can someone help me which command I should use for same?


Thanks,
Purva



--
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
|

Re: Save live Video using gstreamer command

AniketH
You can try deplayloading the data. For example if your source is H264 you
can try something like,

gst-launch-1.0 -e udpsrc port=2222 ! application/x-rtp,
clock-rate=90000,payload=96 \
! rtph264depay ! h264parse ! queue ! avdec_h264 ! videoconvert ! x264enc  !
mp4mux ! filesink location=file.mp4

Depayload > parse > decode > convert > encode > mux > save



--
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
|

Re: Save live Video using gstreamer command

Purva
Hi Aniket,

Thanks for the reply. Now I am able to save streamed the video using below
command:
gst-launch-1.0 -e udpsrc udp://ip:2222 ! h265parse ! mp4mux ! filesink
location=camera.mp4

I am getting streamed video in mp4 format with expected resolution. Now I
want to keep streaming open with saving and Once preview will be stopped
then streaming should be closed and video should be saved.

Earlier I have used below command for streaming video:
gst-launch-1.0 udpsrc port=2222 ! decodebin ! autovideosink sync=false

Overall I want to merge these both so that I can able to see streaming and
can save streaming video both together. So can you please give command for
same?

Thanks,
Purva



--
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
|

Re: Save live Video using gstreamer command

AniketH
Try using a tee in between. Something like...

gst-launch-1.0 -e udpsrc port=2222 ! decodebin ! tee name=split !
autovideosink sync=false split. ! queue ! h265parse ! mp4mux ! filesink
location=file.mp4

Cheers!
Aniket



--
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
|

Re: Save live Video using gstreamer command

Purva
Hi Aniket,

I have used below command which you have mentioned:

gst-launch-1.0 -e udpsrc port=2222 ! decodebin ! tee name=split !
autovideosink sync=false split. ! queue ! h265parse ! mp4mux ! filesink
location=file.mp4

But After starting preview of camera, I am getting below error:

Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Got context from element 'autovideosink0': gst.d3d11.device.handle=context,
device=(GstD3D11Device)"\(GstD3D11Device\)\ d3d11device3", adapter=(int)0;
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
WARNING: from element /GstPipeline:pipeline0/GstDecodeBin:decodebin0:
Delayed linking failed.
ERROR: from element /GstPipeline:pipeline0/GstUDPSrc:udpsrc0: Internal data
stream error.
Additional debug info:
gst/parse/grammar.y(544): gst_parse_no_more_pads ():
/GstPipeline:pipeline0/GstDecodeBin:decodebin0:
failed delayed linking some pad of GstDecodeBin named decodebin0 to some pad
of GstTee named split
Additional debug info:
../libs/gst/base/gstbasesrc.c(3070): gst_base_src_loop ():
/GstPipeline:pipeline0/GstUDPSrc:udpsrc0:
streaming stopped, reason not-linked (-1)
Execution ended after 0:00:17.466240000
Setting pipeline to NULL ...
Freeing pipeline ...

Can you please help me to solve this?

Thanks,
Purva



--
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
|

Re: Save live Video using gstreamer command

AniketH
Purva wrote

> Hi Aniket,
>
> I have used below command which you have mentioned:
>
> gst-launch-1.0 -e udpsrc port=2222 ! decodebin ! tee name=split !
> autovideosink sync=false split. ! queue ! h265parse ! mp4mux ! filesink
> location=file.mp4
>
> But After starting preview of camera, I am getting below error:
>
> Setting pipeline to PAUSED ...
> Pipeline is live and does not need PREROLL ...
> Got context from element 'autovideosink0':
> gst.d3d11.device.handle=context,
> device=(GstD3D11Device)"\(GstD3D11Device\)\ d3d11device3", adapter=(int)0;
> Pipeline is PREROLLED ...
> Setting pipeline to PLAYING ...
> New clock: GstSystemClock
> WARNING: from element /GstPipeline:pipeline0/GstDecodeBin:decodebin0:
> Delayed linking failed.
> ERROR: from element /GstPipeline:pipeline0/GstUDPSrc:udpsrc0: Internal
> data
> stream error.
> Additional debug info:
> gst/parse/grammar.y(544): gst_parse_no_more_pads ():
> /GstPipeline:pipeline0/GstDecodeBin:decodebin0:
> failed delayed linking some pad of GstDecodeBin named decodebin0 to some
> pad
> of GstTee named split
> Additional debug info:
> ../libs/gst/base/gstbasesrc.c(3070): gst_base_src_loop ():
> /GstPipeline:pipeline0/GstUDPSrc:udpsrc0:
> streaming stopped, reason not-linked (-1)
> Execution ended after 0:00:17.466240000
> Setting pipeline to NULL ...
> Freeing pipeline ...
>
> Can you please help me to solve this?
>
> Thanks,
> Purva
>
>
>
> --
> Sent from: http://gstreamer-devel.966125.n4.nabble.com/
> _______________________________________________
> gstreamer-devel mailing list

> gstreamer-devel@.freedesktop

> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

I'd suggest you to go through available plugins on your system. This what I
got working on my machine:

gst-launch-1.0 rtspsrc location="rtsp://USER:PASS@IP:PORT" retry=100
latency=0 ! rtph264depay ! h264parse ! tee name=emit ! queue ! mp4mux !
filesink location=file.mp4 emit. ! queue ! h264parse ! avdec_h264 !
videoconvert ! xvimagesink async=false

Above pipeline will work if you're using latest release of gstreamer.
Otherwise, try exploring other plugins for your pipeline formation.





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