본문 바로가기

Raspberry

Gstreamer 파이프라인 테스트

네트워크 상황마다 다르고 파이프라인 구성마다 조금 차이가 있겠지만 0.5초에서 1초간의 딜레이가 발생했다. 속도면이나 품질 그리고 생산성 면에서 UV4L이 더 나을거 같다. 안드로이드에서 Gstreamer를 이용하려면 NDK를 이용해야되는데 지금 상황에 또 새로운걸 시작하긴 그렇다..이번 프로젝트로 JavaScript, Node.js, 네트워크 프로그래밍, 안드로이드 등 알아야 할것이 너무많은 상황 그래서 Gstreamer는 테스트 해본것으로 만족한다.

다음은 내가 사용했던 

지연 개선된 H.264와 RTP 스트리밍

송신

gst-launch autovideosrc ! x264enc tune=zerolatency byte-stream=true bitrate=3000 threads=2 ! h264parse config-interval=1 ! rtph264pay ! udpsink host=127.0.0.1 port=5000

수신

gst-launch udpsrc port=5000 caps="application/x-rtp, encoding-name=H264, payload=96" ! rtph264depay ! h264parse ! avdec_h264 ! autovideosink


UDP streaming from Webcam (stream over the network)


gst-launch v4l2src device=/dev/video0 ! 'video/x-raw-yuv,width=640,height=480' !  x264enc pass=qual quantizer=20 tune=zerolatency ! rtph264pay ! udpsink host=127.0.0.1 port=1234

UDP Streaming received from webcam (receive over the network)



gst-launch udpsrc port=1234 ! "application/x-rtp, payload=127" ! rtph264depay ! ffdec_h264 ! xvimagesink sync=false

#sender


gst-launch-1.0 v4l2src ! \


    'video/x-raw, width=640, height=480, framerate=30/1' ! \


    videoconvert ! \


    x264enc pass=qual quantizer=20 tune=zerolatency ! \


    rtph264pay ! \


    udpsink host=192.168.1.140 port=1234


#receiver


gst-launch-1.0 udpsrc port=1234 ! \


    "application/x-rtp, payload=127" ! \


    rtph264depay ! \


    avdec_h264 ! \


    videoconvert  ! \


    xvimagesink sync=false


----------------->play webcam video over UDP with h264 coding




gst-launch-1.0 -v v4l2src device=/dev/video0 ! video/x-raw,width=640,height=480,framerate=90/1 ! omxh264enc ! rtph264pay config-interval=1 pt=96 ! udpsink host=192.168.10.1 port=5000




raspivid -n -w 640 -h 480 -b 4500000 -fps 90 -t 0 -o - | gst-launch-1.0 -v fdsrc ! h264parse ! rtph264pay config-interval=1 pt=96 ! udpsink host=192.168.10.1 port=5000




gst-launch-1.0 v4l2src device=/dev/video0 ! 'video/x-raw,format=I420,width=640,height=480,framerate=30/1' ! omxh264enc ! h264parse ! queue ! mpegtsmux name=mux alsasrc device=plughw:1 ! audioresample ! audio/x-raw,rate=48000,channels=1 ! queue ! voaacenc bitrate=32000 ! aacparse ! queue ! mux. mux. ! tcpserversink host=192.168.10.9 port=5001 sync=true

'Raspberry' 카테고리의 다른 글

[feeder] screw와 서보모터 연결  (0) 2017.06.29
wiringPi를 이용한 서보모터 구동하기  (2) 2017.06.29