-
How to mix two test streams (videobox, videomixer)
gst-launch-1.0 videomixer name=mixer ! gtksink \ videotestsrc ! videoscale ! video/x-raw,width=960,height=540 ! \ tee name=t ! queue ! videoconvert ! videobox left=-960 ! videoconvert ! mixer. \ t. ! queue ! videobox left=0 ! videoconvert ! mixer.
gst-launch-1.0 splitmuxsrc location=video*.mp4 ! h264parse ! mp4mux ! filesink location=out.mp4
ffmpeg -f concat -safe 0 -i <(for f in ./*.mp4; do echo "file '$PWD/$f'"; done) -c copy all.mp4
-
Split single video into 60 sec pieces:
gst-launch-1.0 filesrc location=video.mp4 ! qtdemux ! h264parse ! splitmuxsink max-size-time=60000000000 location=piece%02d.mp4
-
send
gst-launch-1.0 videotestsrc ! videoscale ! video/x-raw,width=100,height=100 ! \ x264enc tune="zerolatency" ! mpegtsmux ! tcpserversink host=127.0.0.1 port=5000
-
receive
gst-launch-1.0 tcpclientsrc port=5000 host=127.0.0.1 ! tsdemux ! \ h264parse ! avdec_h264 ! videoconvert ! gtksink
-
send
gst-launch-1.0 v4l2src ! jpegenc ! tcpserversink host=localhost port=5000
-
receive
gst-launch-1.0 tcpclientsrc port=5000 ! jpegdec ! videoconvert ! autovideosink sync=true
gst-launch-1.0 rtspsrc location=rtsp://... drop-on-latency=true latency=0 ! \
rtph264depay ! h264parse ! splitmuxsink location=video%02d.mp4 max-size-time=60000000000
gst-launch-1.0 -v rtspsrc location=rtsp://... drop-on-latency=true latency=0 ! \
decodebin ! videoconvert ! video/x-raw,format=RGB ! videoconvert ! \
fpsdisplaysink video-sink=fakesink signal-fps-measurements=True
gst-launch-1.0 filesrc location=video.mp4 ! qtdemux name=demux1 demux1.video_0 ! \
queue ! h264parse ! omxh264dec ! fpsdisplaysink video-sink=fakesink signal-fps-measurements=True
gst-launch-1.0 -v -e filesrc location=video2560.mp4 ! qtdemux name=demux1 demux1.video_0 ! queue ! \
h264parse ! omxh264dec ! nvvidconv ! video/x-raw,format=RGBA ! \
fpsdisplaysink video-sink=fakesink signal-fps-measurements=True
gst-launch-1.0 filesrc location=video.mpeg ! mpegpsdemux ! h264parse ! mp4mux ! filesink location=video.mp4 sync=False -e
gst-launch-1.0 -v rtspsrc location=... drop-on-latency=true latency=0 num-buffers=1 ! \
decodebin ! videoconvert ! jpegenc ! multifilesink location=img101.jpg
-
scales video to Full HD (1920x1080)
gst-launch-1.0 filesrc location=video.mp4 ! decodebin ! videoconvert ! videoscale ! \ video/x-raw,width=1920,height=1080 ! videoconvert ! \ x264enc tune=zerolatency bitrate=16384 ! filesink location=video.mp4 -e
-
making video with 15 FPS
gst-launch-1.0 filesrc location=video.mp4 ! decodebin ! videoconvert ! \ videorate ! video/x-raw,framerate=15/1 ! videoconvert ! \ x264enc tune=zerolatency bitrate=16384 ! filesink location=video.mp4
gst-launch-1.0 souphttpsrc is-live=true location="$(youtube-dl -f mp4 -g https://www.youtube.com/watch?v=xjDjIWPwcPU)" \
! decodebin ! videoconvert ! gtksink sync=false
Note:
- youtube-dl allows to get HTTPS URL for youtube video link.