{"id":13625346,"url":"https://github.com/DamZiobro/gstreamerCheatsheet","last_synced_at":"2025-04-16T06:32:26.611Z","repository":{"id":27288653,"uuid":"30762240","full_name":"DamZiobro/gstreamerCheatsheet","owner":"DamZiobro","description":"GStreamer pipelines and CLI commands for different GStreamer based features (process MPEG2-TS files, get video from DVB, deinterlace video, capture RTSP stream etc.)","archived":false,"fork":false,"pushed_at":"2018-10-03T20:38:13.000Z","size":2760,"stargazers_count":196,"open_issues_count":3,"forks_count":33,"subscribers_count":10,"default_branch":"master","last_synced_at":"2024-08-01T22:04:55.271Z","etag":null,"topics":["capture-rtsp-stream","capture-screen","cheatsheet","dvb","gst","gstreamer","gstreamer-pipeline","hls","mpeg","mpegts","pipelines","rtsp","video","youtube"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DamZiobro.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-02-13T15:29:21.000Z","updated_at":"2024-07-29T22:52:33.000Z","dependencies_parsed_at":"2022-08-07T12:15:57.817Z","dependency_job_id":null,"html_url":"https://github.com/DamZiobro/gstreamerCheatsheet","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DamZiobro%2FgstreamerCheatsheet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DamZiobro%2FgstreamerCheatsheet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DamZiobro%2FgstreamerCheatsheet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DamZiobro%2FgstreamerCheatsheet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DamZiobro","download_url":"https://codeload.github.com/DamZiobro/gstreamerCheatsheet/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223700380,"owners_count":17188307,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["capture-rtsp-stream","capture-screen","cheatsheet","dvb","gst","gstreamer","gstreamer-pipeline","hls","mpeg","mpegts","pipelines","rtsp","video","youtube"],"created_at":"2024-08-01T21:01:54.260Z","updated_at":"2024-11-08T14:31:06.127Z","avatar_url":"https://github.com/DamZiobro.png","language":null,"funding_links":[],"categories":["Others","HarmonyOS"],"sub_categories":["Windows Manager"],"readme":"GStreamer Pipelines \n===========\n\nCapture RTSP stream to file \n----\n![pipelinePublic1](https://raw.githubusercontent.com/xmementoit/gstreamerPublicPipelines/master/pipelinePublic1.png)\n```\ngst-launch-1.0 rtspsrc location=rtsp://10.82.131.240:8554/h264ESVideoTest ! rtph264depay ! h264parse ! mp4mux ! filesink location=file.mp4\n```\n\nCapture RTSP stream to files splitted to 10 seconds chunks:\n----\n![pipelinePublic2](https://raw.githubusercontent.com/xmementoit/gstreamerPublicPipelines/master/pipelinePublic2.png)\n```\ngst-launch-1.0 rtspsrc location=rtsp://10.82.131.240:8554/h264ESVideoTest ! rtph264depay ! h264parse ! splitmuxsink location=file%02d.mp4 max-size-time=10000000000 \n```\n\nsplitmuxsink test (overwritting max 2 files)\n----\n![pipelinePublic3](https://raw.githubusercontent.com/xmementoit/gstreamerPublicPipelines/master/pipelinePublic3.png)\n```\ngst-launch-1.0 videotestsrc ! x264enc ! h264parse ! splitmuxsink location=file%02d.mp4 max-size-time=3000000000 max-files=2\n```\n\nGet TV Channel from DVB and save it in as series of 10sec long MPEG2-TS files\n----\n![pipelinePublic4](https://raw.githubusercontent.com/xmementoit/gstreamerPublicPipelines/master/pipelinePublic4.png)\n```\ngst-launch-1.0 dvbbasebin modulation=\"QAM 64\" trans-mode=8k bandwidth=8 frequency=682000000 code-rate-lp=AUTO code-rate-hp=2/3 guard=4  hierarchy=0 program-numbers=4170 name=src .src ! queue ! tsdemux program-number=4170 name=d  splitmuxsink location=file_%llu.ts max-size-time=1000000000 muxer=mpegtsmux name=mux   d. ! queue ! mpegvideoparse ! queue ! mux.   d. ! queue ! mpegaudioparse ! queue ! mux.audio_%u\n```\n\nCreate one MPEG2-TS file from series of small chunk MPEG2-TS files\n----\n![pipelinePublic5](https://raw.githubusercontent.com/xmementoit/gstreamerPublicPipelines/master/pipelinePublic5.png)\n```\ngst-launch-1.0 splitmuxsrc location=file*.ts ! filesink location=output.ts\n```\n\nDeinterlacing video using transcoding method\n----\n![pipelinePublic6](https://raw.githubusercontent.com/xmementoit/gstreamerPublicPipelines/master/pipelinePublic6.png)\n```\ngst-launch-1.0 filesrc location=interlaced.ts ! decodebin ! videoconvert ! deinterlace ! videoconvert ! videorate ! \"video/x-raw,framerate=25/1\" ! avenc_mpeg2video interlaced=false gop-size=25 bitrate=100000000 ! \"video/mpeg,profile=main,level=main,parsed=true\" ! mpegtsmux ! filesink location=deinterlaced.ts\n```\n\nTest multiplexing audio and video to .ogg file\n----\n![pipeline7](https://raw.githubusercontent.com/xmementoit/gstreamerPublicPipelines/master/pipeline7.png)\n```\ngst-launch-1.0 videotestsrc ! queue ! videoconvert ! theoraenc ! queue ! oggmux name=mux autoaudiosrc ! queue ! audioconvert ! vorbisenc ! queue ! mux. mux. !  queue ! filesink location=test.ogg\n```\n\nGet video from camera (v4l2src) and audio from default audio source (alsasrc) and multiples them into test.ogg file\n---\n![pipeline8](https://raw.githubusercontent.com/xmementoit/gstreamerPublicPipelines/master/pipeline8.png)\n```\ngst-launch-1.0 v4l2src ! queue ! videoconvert ! theoraenc ! queue ! oggmux name=mux alsasrc ! queue ! audioconvert ! vorbisenc ! queue ! mux. mux. !  queue ! filesink location=test.ogg\n```\n\nDecode .h264 file and play video using default gstreamer player window\n----\n![pipeline9](https://raw.githubusercontent.com/xmementoit/gstreamerPublicPipelines/master/pipeline9.png)\n```\ngst-launch-1.0 filesrc location=sample.264 ! h264parse ! avdec_h264 ! videoconvert ! autovideosink\n```\n\nDecode .mp4 file and play video using default gstreamer player\n----\n![pipeline10](https://raw.githubusercontent.com/xmementoit/gstreamerPublicPipelines/master/pipeline10.png)\n```\ngst-launch-1.0 filesrc location=sample.mp4 ! qtdemux name=demux demux.audio_00 ! queue ! avdec_aac ! audioconvert ! alsasink demux.video_00 ! queue ! avdec_h264 ! videoconvert ! autovideosink\n```\n\nPlay video only from .mp4 file\n----\n![pipeline11](https://raw.githubusercontent.com/xmementoit/gstreamerPublicPipelines/master/pipeline11.png)\n```\ngst-launch-1.0 filesrc location=sample.mp4 ! qtdemux name=demux ! queue ! avdec_h264 ! videoconvert ! autovideosink\n```\n\nRTP/UDP Streaming of H.264 content - Server\n----\n![pipeline12](https://raw.githubusercontent.com/xmementoit/gstreamerPublicPipelines/master/pipeline12.png)\n```\ngst-launch-1.0 -v videotestsrc ! x264enc ! rtph264pay pt=96 ! udpsink host=192.168.0.10 port=5000\n```\n\nRTP/UDP Streaming of H.264 content - Client\n----\n![pipeline13](https://raw.githubusercontent.com/xmementoit/gstreamerPublicPipelines/master/pipeline13.png)\n```\ngst-launch-1.0 -v udpsrc port=5000 caps=application/x-rtp ! rtph264depay ! avdec_h264 ! autovideosink\n```\n\nPlay HLS (Http Live Streaming) URL using GStreamer pipeline\n----\n![pipeline14](https://raw.githubusercontent.com/xmementoit/gstreamerPublicPipelines/master/pipeline15.png)\n```\ngst-launch-1.0 souphttpsrc is-live=true location=http://devimages.apple.com/iphone/samples/bipbop/bipbopall.m3u8 ! hlsdemux ! decodebin ! videorate ! videoconvert ! ximagesink\n```\n\nPlay Youtube Live stream as HLS video using GStreamer\n----\n![pipeline14](https://raw.githubusercontent.com/xmementoit/gstreamerPublicPipelines/master/pipeline14.png)\n```\ngst-launch-1.0 souphttpsrc is-live=true location=\"$(youtube-dl -f 94 -g 'https://www.youtube.com/watch?v=y60wDzZt8yg')\" ! hlsdemux ! tsdemux name=mux mux. ! \"video/x-h264,framerate=25/1\" ! queue ! h264parse ! avdec_h264 ! videorate ! videoconvert ! ximagesink\n```\n\nCapture your desktop and save into avi file\n----\n![pipeline15](https://raw.githubusercontent.com/xmementoit/gstreamerPublicPipelines/master/pipeline15.png)\n```\ngst-launch-1.0 ximagesrc use-damage=0 ! video/x-raw,framerate=30/1 ! videoconvert ! x264enc ! avimux ! filesink location=out.avi\n```\n\nCreate live stream and stream it into Facebook Live streaming service\n----\n```\ngst-launch-1.0 flvmux name=mux streamable=true ! rtmpsink location=\"\u003crtmp_url_for_fblive\u003e\" videotestsrc is-live=true ! \"video/x-raw,width=1280,height=720,framerate=30/1\" ! identity sync=true ! x264enc bitrate=2500 key-int-max=60  ! video/x-h264,profile=high ! h264parse ! queue ! mux. audiotestsrc is-live=true ! audio/x-raw,rate=44100,channels=2 ! identity sync=true ! voaacenc bitrate=128000 ! queue ! mux.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDamZiobro%2FgstreamerCheatsheet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FDamZiobro%2FgstreamerCheatsheet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDamZiobro%2FgstreamerCheatsheet/lists"}