Video capture and encoding on the Raspberry pi

gst-launch-1.0 rpicamsrc inline-headers=true annotation-mode=date+time+frame-number+black-background brightness=60 preview=1 awb-mode=1 bitrate=10000000 exposure-mode=fixedfps sensor-mode=1 keyframe-interval=25 ! 'video/x-h264, width=1920, height=1080, framerate=25/1, profile=high' ! muxout. alsasrc device=hw:1,0 actual-latency-time=12000 buffer-time=200000 ! audioconvert ! avenc_aac ! aacparse ! muxout. mpegtsmux name=muxout ! queue ! srtserversink uri='srt://:8888/'

ffmpeg -analyzeduration 500000 -probesize 100000 -threadqueuesize 512 -f v4l2 -inputformat h264 -videosize 1920×1080 -framerate 30 -i /dev/video0 -threadqueuesize 512 -f alsa -sample_rate 44100 -ac 2 -i hw:1 -map 0:0 -map 1:0 -bufsize 0 -af 'adelay=520|520,volume=0dB' -vcodec copy -acodec aac -f mpegts - | srt-live-transmit -v file:con 'srt://:8888&delay=80' -c 1316

ggf vorher im v4l2 codec parameter setzen:

v4l2-ctl -c videobitrate=4000000 v4l2-ctl -c h264iframeperiod=25

raspivid -fps 25 -h 1080 -w 1920 -n -t 0 -g 5 -b 5000000 -stm -o - | gst-launch-1.0 -v fdsrc ! h264parse ! flvmux ! rtmpsink location='rtmp://changeme/stream/bla live=1'

raspivid -fps 25 -h 1080 -w 1920 -n -t 0 -b 5000000 -o - | gst-launch-1.0 -v fdsrc ! h264parse ! rtph264pay config-interval=1 ! gdppay ! tcpserversink host=10.23.42.145 port=5000

gst-launch-1.0 -v tcpclientsrc host=10.23.42.145 port=5000 ! gdpdepay ! rtph264depay ! decodebin ! autovideosink sync=false

gst-launch-1.0 v4l2src device=/dev/video0 do-timestamp=true ! videoscale ! videorate ! videoconvert ! video/x-raw,width=1920,height=1080,framerate=25/1 ! omxh264enc control-rate=variable target-bitrate=5000000 ! h264parse ! flvmux ! rtmpsink location='rtmp:<host>/stream/picam live=1'

  • hardware/raspi-vc.1589874130.txt.gz
  • Last modified: 2020/05/19 09:42
  • by derpeter