Recording and Streaming Simultaneously

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

Recording and Streaming Simultaneously

Aditya Oza
This post was updated on .
hello sir,

The objective I am trying to achieve is streaming 1080p video from
Raspberry pi camera and record the video simultaneously.

1. I tried recording the http streaming as source but didn't work on 30fps. A
lot of frames were missing and almost got 8fps only.

2.As a second approach, I am trying to record the file directly from camera
and then streaming the "recording in progress/buffer" file. For the same I
am trying to use GStreamer. Please suggest if this is good option or should
I try any other?

For Recording using GStreamer I used
   
     gst-launch-1.0  --gst-debug-level=3   -v   v4l2src device=/dev/video0 ! capsfilter caps="video/x-raw,
     width=1920,height=1080,framerate=30/1" ! videoflip method=rotate-180 ! videoconvert ! videorate
     ! queue ! omxh264enc ! queue ! avimux ! filesink location = test_video.h264
     
      Result : recorded video shows 1080p and 30fps but frames are dropping
      heavily

For Streaming the video buffer I have used UDP in Gstreamer as,

     gst-launch-1.0  --gst-debug-level=3 -v  v4l2src device=/dev/video0 !
     capsfilter caps="video/x-raw,width=640,height=480,framerate=30/1" ! queue !
     omxh264enc !   queue ! h264parse ! mpegtsmux ! rtpmp2tpay ! udpsink
     host=192.168.5.1 port=8080
     
     Result : No specific errors on terminal but can't get stream on vlc
   
Please suggest the best method here.


Thanks,
Aditya

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

Re: Recording and Streaming Simultaneously

killerrats
Administrator
Try this pipeline:
gst-launch-1.0  --gst-debug-level=3 -e -v v4l2src device=/dev/video0
do-timestamp=true ! tee name=tee ! capsfilter
caps="video/x-raw,width=1920,height=1080,framerate=30/1" ! videoflip
method=rotate-180 ! videoconvert ! videorate ! queue ! omxh264enc !
h264parse ! splitmuxsink mux=avimux location=test_video.h264%04d.avi
max-files=100 max-size-bytes=1000000 tee. ! capsfilter
caps="video/x-raw,width=640,height=480,framerate=30/1" ! queue ! omxh264enc
! queue ! h264parse ! mpegtsmux ! rtpmp2tpay ! udpsink host=192.168.5.1
port=8080

this has the -e which when you stop the pipeline it will put eos through the
file. also has h264parse to parse the h264 video and plus has the
do-timestamp to true for the v4l2src to set timestamps on the buffers coming
in. The splitmux will set the number of files and how much each file
contains. the location has your filename but has "%04d" which tells it 4
digits of numbers in the sequence to write to the current directory. the
splitmux has a set of avimux for the muxer and the sink is the filesink
default for that element. I hope the splitmuxsink element is on the machine
you are using. I also used a tee which might split up the signal, i'm hoping
that works.



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

Re: Recording and Streaming Simultaneously

Aditya Oza
thank you for your reply,

I use your pipeline and after lots of changing i run this pipeline:

 gst-launch-1.0  --gst-debug-level=3 -e -v v4l2src device=/dev/video0
do-timestamp=true ! tee name=tee ! capsfilter
caps="video/x-raw,width=1920,height=1080,framerate=30/1" ! videoflip
method=rotate-180 ! videoconvert ! videorate ! queue ! omxh264enc !
h264parse !  filesink  location=xyz10.h264 tee. ! queue ! videoscale
method=1 ! videoconvert ! capsfilter
caps="video/x-raw,width=640,height=480,framerate=30/1" ! queue ! omxh264enc
! queue ! h264parse ! mpegtsmux ! rtpmp2tpay ! multiudpsink
clients=192.168.5.255:1234 ttl=1 auto-multicast=true






after running above pipeline,

1. created h264 file and recording also done there is no error.
2. but in Simultaneously i also saw a stream (running h264 file) but they
are appear and also throw a warning. I attached here image of warning
message.


<http://gstreamer-devel.966125.n4.nabble.com/file/t378874/Capture1.png>
<http://gstreamer-devel.966125.n4.nabble.com/file/t378874/Capture.png>  




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