Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
hardware:raspi-vc [2020/05/15 16:05] – derpeter | hardware:raspi-vc [2020/12/14 02:20] (current) – andi | ||
---|---|---|---|
Line 1: | Line 1: | ||
= Video capture and encoding on the Raspberry pi | = Video capture and encoding on the Raspberry pi | ||
+ | |||
This page is currently a research collection and commands might not work | This page is currently a research collection and commands might not work | ||
- | == gstreamer pipe gen srt mit kaputtem alsasrc-audio vom usb: | + | {{ :hardware: |
- | 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, | + | * https://www.raspberrypi.org/documentation/ |
+ | * https://github.com/ | ||
+ | * https://github.com/ | ||
+ | * https:// | ||
- | == funktionierendes audio mit ffmpeg und ner pipe in das srt-tool " | + | === gstreamer |
- | ffmpeg -analyzeduration 500000 | + | 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 ! ' |
+ | |||
+ | === funktionierendes audio mit ffmpeg und ner pipe in das srt-tool " | ||
+ | |||
+ | | ||
ggf vorher im v4l2 codec parameter setzen: | ggf vorher im v4l2 codec parameter setzen: | ||
- | v4l2-ctl -c video_bitrate=4000000 | + | |
- | v4l2-ctl -c h264_i_frame_period=25 | + | v4l2-ctl -c h264_i_frame_period=25 |
+ | |||
+ | === rtmp stream from pi cam | ||
+ | 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=' | ||
+ | |||
+ | |||
+ | === RTP stream sink and source | ||
+ | |||
+ | 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 | ||
+ | |||
+ | == Capture from UVC capture device and stream rtmp | ||
+ | |||
+ | === video4linux | ||
+ | gst-launch-1.0 | ||
+ | |||
+ | === raspivid wrapper | ||
+ | gst-launch-1.0 rpicamsrc bitrate=5000000 | ||
+ | |||
+ | == read encoded video | ||
+ | |||
+ | === read encoded video with ffmpeg from the cam | ||
+ | ffmpeg -f video4linux2 -input_format h264 -video_size 1920x1080 -framerate 30 -i /dev/video0 -vcodec copy -an test.h264 | ||
- | == rtmp stream from pi cam | + | === read encoded video with gst and provide output via srt server |
- | raspivid -fps 25 -h 1080 -w 1920 -n -t 0 -g 5 -b 5000000 -stm -o - | gst-launch-1.0 -v fdsrc ! h264parse ! | + | gst-launch-1.0 |
- | == RTP stream sink and source | ||
- | 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 | + | == FFMPEG with SRT support on ubuntu 20.04 |
+ | < | ||
+ | sudo apt build-dep ffmpeg libsrt-dev | ||
+ | git clone https:// | ||
- | gst-launch-1.0 -v tcpclientsrc host=10.23.42.145 port=5000 ! gdpdepay ! rtph264depay ! decodebin ! autovideosink sync=false | + | ./ |
+ | </ |