개발자/Raspberry Pi3

라즈베리파이 동영상 스트리밍과 동영상 저장

지구빵집 2020. 6. 12. 11:31
반응형

 

아래 설명 내용은 시도하지 않은 내용입니다. 그러니까 해보지 않았다는 말이죠. mjpg 스트리밍을 성공적으로 진행하신 분이 동영상을 녹화 할 수 있는 방법을 질문하셔서 따로 알아본 내용입니다. 참고하십시요.

혹시 테스트에 성공하신 분이 계시면 좌표 부탁드립니다. ^^

예전에 포스팅한 페이지 gstreamer 패키지를 설치하고 사용하시면 스트리밍이랑 녹화도 됩니다. gstreamer 는 보드마다 사용하는 옵션이 다 달라서 많이 시도를 해봐야 합니다. 그리고 gstreamer에서 지원하는기능이라 cpu성능이 문제가 되긴 될거고요. 하시면 결과를 좀 알려주세요. 참고 사이트는 Recording and Streaming Simultaneously 입니다. 즐 개발하세요! ^^

위 사이트 내용을 아래 저장합니다.

This post was updated on May 04, 2019; 12:20am.
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

 

 

 

 

반응형