Skip to content

Instantly share code, notes, and snippets.

View anselmobattisti's full-sized avatar
🇧🇷
Aqui é Brasil!

Anselmo Battisti anselmobattisti

🇧🇷
Aqui é Brasil!
View GitHub Profile
@anselmobattisti
anselmobattisti / udpdump.sh
Created September 3, 2019 23:00
How to read UDP dump linux
tcpdump -i lo udp port 8125 -vv -X
@anselmobattisti
anselmobattisti / gstreamer_webcam_to_udp
Created September 7, 2019 16:02
Capture webcam video and stream it using gstreamer
Capture and send video
gst-launch-1.0 v4l2src device=/dev/video0 \
! decodebin \
! x264enc \
! rtph264pay \
! udpsink port=5000
Show the video
gst-launch-1.0 \
@anselmobattisti
anselmobattisti / cam_tee_udp
Created September 8, 2019 13:30
Send video from webcam to two destinations via UDP using gstreamer
gst-launch-1.0 v4l2src device=/dev/video0 \
! tee name=t \
! queue \
! decodebin \
! x264enc \
! rtph264pay \
! udpsink host=localhost port=5000 \
t. \
! queue \
! decodebin \
@anselmobattisti
anselmobattisti / gstreamer pipeline
Created September 10, 2019 23:37
Grab video from webcam and stream it using udpsink via x264
Pipeline to send video (simulating SRC) get the data from video0
gst-launch-1.0 v4l2src device=/dev/video0 \
! decodebin \
! x264enc \
! rtph264pay \
! udpsink host=localhost port=5000
// if you are running it inside a docker container be aware of the host ip in udpsink
gst-launch-1.0 v4l2src device=/dev/video0 \
! decodebin \
@anselmobattisti
anselmobattisti / Stop all docker container by some patterns
Created September 15, 2019 20:21
Stop all docker container by some patterns
docker stop $(docker ps | egrep alfa | awk '{print $1}')
in this case alfa is the name of the image used to start the container , you can use anything that apears in docker ps, like, name or others
@anselmobattisti
anselmobattisti / gist:5c5777b8a17e88baea06285279233b0f
Last active September 20, 2019 23:08
How to send gstreamer data via UDP and consume it at VLC
How to send gstreamer data via UDP and consume it at VLC
# Sender
gst-launch-1.0 videotestsrc pattern=ball \
! tee name=t \
! queue \
! x264enc \
! rtph264pay \
! udpsink host=localhost port=50000
@anselmobattisti
anselmobattisti / Send mp3 audio file via UDP gstreamer
Created September 22, 2019 12:36
Send mp3 audio file via UDP gstreamer
Send audio data
gst-launch-1.0 multifilesrc location=sample.mp3 loop=true \
! mpegaudioparse \
! mpg123audiodec \
! audioconvert \
! audioresample \
! audio/x-raw, rate=16000, channels=1, format=S16LE \
! audiomixer blocksize=320 \
! udpsink host=localhost port=10000
@anselmobattisti
anselmobattisti / Gstreamer Stream a mp3 audio via UDP to multiple hosts via queue
Created September 22, 2019 12:54
Gstreamer Stream a mp3 audio via UDP to multiple hosts via queue
gst-launch-1.0 multifilesrc location=sample.mp3 loop=true \
! tee name=t \
! queue \
! mpegaudioparse \
! mpg123audiodec \
! audioconvert \
! audioresample \
! audio/x-raw, rate=16000, channels=1, format=S16LE \
! audiomixer blocksize=320 \
! udpsink host=localhost port=10000 \
@anselmobattisti
anselmobattisti / gstremaer_links_list
Last active September 26, 2019 22:25
List os links about gstreamer
@anselmobattisti
anselmobattisti / side_by_side
Created October 4, 2019 21:37
Combine two videos and place than side by side gstreamer
gst-launch-1.0 \
videomixer name=m sink_1::xpos=50 sink_1::ypos=50 sink_2::xpos=400 sink_2::ypos=50 \
! x264enc \
! rtph264pay \
! udpsink host=localhost port=5000 \
videotestsrc pattern=white \
! video/x-raw, format=I420, framerate=5/1, width=740, height=480 \
! m. \
videotestsrc pattern=red \
! videobox left=100 \