Commit 391d00dd authored by hark's avatar hark
Browse files

initial

parents
collection of random scripts related to live audio / video
gphoto2 --stdout --capture-movie | gst-launch-1.0 -vvv filesrc location=/dev/stdin ! jpegparse ! rtpjpegpay ! udpsink port=1234 host=172.31.33.126
gphoto2 --stdout --capture-movie | gst-launch-1.0 -vvv filesrc location=/dev/stdin ! jpegparse ! rtpjpegpay ! udpsink port=1234 host=172.31.33.126
gst-launch-1.0 -vvv udpsrc port=1234 caps="application/x-rtp,media=(string)video,clock-rate=(int)90000,encoding-name=(string)JPEG,a-framerate=(string)1.000000,a-framesize=(string)1024-680,payload=(int)26" ! rtpjpegdepay ! jpegdec ! xvimagesink
#!/bin/bash
#ACABS="application/x-rtp,media=(string)audio,clock-rate=(int)8000,encoding-name=(string)AMR,encoding-params=(string)1,octet-align=(string)1"
ACABS="application/x-rtp,media=(string)audio,clock-rate=(int)48000,encoding-name=(string)X-GST-OPUS-DRAFT-SPITTKA-00"
#ACABS="application/x-rtp,media=(string)audio,clock-rate=(int)48000,encoding-name=(string)SPEEX"
#VCAPS="application/x-rtp,media=(string)video,clock-rate=(int)90000,encoding-name=(string)H264"
#VCAPS="application/x-rtp,media=(string)video,clock-rate=(int)90000,encoding-name=(string)JPEG"
#VCAPS="application/x-rtp,media=(string)video,clock-rate=(int)90000,encoding-name=(string)JPEG,a-framerate=(string)1.000000,a-framesize=(string)1024-680,payload=(int)26,ssrc=(uint)968956292,timestamp-offset=(uint)1200604833,seqnum-offset=(uint)2973"
VCAPS="application/x-rtp,media=(string)video,clock-rate=(int)90000,encoding-name=(string)JPEG,a-framerate=(string)1.000000,a-framesize=(string)1024-680,payload=(int)26,ssrc=(uint)96"
ACODEC=opusdec
ADEPAY="rtpopusdepay"
#ACODEC=amrnbdec
#ADEPAY=rtpamrdepay
VCODEC=jpegdec
VDEPAY=rtpjpegdepay
gst-launch-1.0 -vvv rtpbin name=rtpbin \
udpsrc caps=$VCAPS port=5000 \
! rtpbin.recv_rtp_sink_0 \
rtpbin. \
! $VDEPAY \
! queue \
! $VCODEC \
! videoconvert \
! videoscale \
! videorate in=1 out=24 average-period=400 \
! videoconvert \
! queue \
! xvimagesink \
udpsrc port=5001 \
! rtpbin.recv_rtcp_sink_0 \
rtpbin.send_rtcp_src_0 \
! udpsink port=5005 sync=false async=false \
udpsrc caps=$ACABS port=5002 \
! rtpbin.recv_rtp_sink_1 \
rtpbin. \
! $ADEPAY \
! $ACODEC \
! alsasink \
udpsrc port=5003 \
! rtpbin.recv_rtcp_sink_1 \
rtpbin.send_rtcp_src_1 \
! udpsink port=5007 sync=false async=false
#!/bin/bash
HOST=127.0.0.1
#ACODEC=amrnbenc
#APAY=rtpampay
ACODEC=opusenc
APAY=rtpopuspay
VCODEC=x264enc
VPAY="rtpjpegpay pt=26"
gphoto2 --stdout --capture-movie | gst-launch-1.0 -vvv rtpbin name=rtpbin \
filesrc location=/dev/stdin \
! queue \
! jpegparse \
! $VPAY \
! rtpbin.send_rtp_sink_0 \
rtpbin.send_rtp_src_0 \
! udpsink port=5000 host=$HOST sync=false \
rtpbin.send_rtcp_src_0 \
! udpsink port=5001 host=$HOST sync=false async=false \
udpsrc port=5005 \
! rtpbin.recv_rtcp_sink_0 \
audiotestsrc \
! $ACODEC \
! $APAY \
! rtpbin.send_rtp_sink_1 \
rtpbin.send_rtp_src_1 \
! udpsink port=5002 host=$HOST \
rtpbin.send_rtcp_src_1 \
! udpsink port=5003 host=$HOST sync=false async=false \
udpsrc port=5007 \
! rtpbin.recv_rtcp_sink_1
gphoto2 --capture-movie --stdout | avconv -f mjpeg -i pipe:0 -r 20 -b 2000k
-vcodec libx264 -preset ultrafast -f flv -metadata streamName="flvplayback"
-metadata title="flvplayback" tcp://localhost:6666
dvgrab - | avconv -re -i - -acodec libmp3lame -ar 44100 -ab 256k -vcodec libx264 -preset ultrafast -qscale 3 -vb 400k -f flv rtmp://localhost/live/pinknoise
#!/bin/bash
GST_DEBUG=2 gst-launch-1.0 udpsrc uri=udp://239.1.2.3:5004 auto-multicast=true caps='application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)MP2T-ES, payload=(int)33, ssrc=(uint)3027185587, clock-base=(uint)535784712, seqnum-base=(uint)8467' ! queue ! rtpbin \
! queue! decodebin name=decode \
! queue ! vp8enc cpu-used=0 target-bitrate=5000 lag-in-frames=25 ! queue ! webmmux streamable=true name=mux ! queue ! \
shout2send ip=flu.v89.eu port=8000 mount=pinknoise2.webm decode. ! queue ! audioconvert ! queue ! vorbisenc ! mux.
#GST_DEBUG=2 gst-launch-1.0 udpsrc uri=udp://239.1.2.3:5004 auto-multicast=true caps='application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)MP2T-ES, payload=(int)33, ssrc=(uint)3027185587, clock-base=(uint)535784712, seqnum-base=(uint)8467' ! queue ! rtpbin \
# ! queue! decodebin name=decode \
# ! queue ! xvimagesink decode. ! queue ! audioconvert ! autoaudiosink
#ffmpeg -re -f rawvideo -s 720x576 -r 30000/1001 -pixel_format yuv420p -i /tmp/video.yuv \
# -f jack -ac 2 -i ffmpeg\
# -vcodec libx264 -qscale 2 -r 50 -profile:v baseline -preset ultrafast -ar 44100 -ab 2560 -s 720x576 -vb 100k -f flv 'rtmp://flu.v89.eu/live/stream'
#audio only (works fine)
#ffmpeg \
# -f jack -ac 2 -i ffmpeg\
# -ar 44100 -ab 256k -s 720x576 -f flv 'rtmp://flu.v89.eu/live/stream'
v=0
o=- 0 0 IN IP4 239.1.2.3
s=Snowmix output feed
c=IN IP4 239.1.2.3
t=0 0
a=tool:GStreamer
a=type:broadcast
a=range:npt=now-
m=video 5004 RTP/AVP 33
a=rtpmap:33 MP2T/90000
a=control:mpegts-transport
#!/bin/bash
#caps = application/x-rtp, media=(string)audio, clock-rate=(int)4800, encoding-name=(string)L16, encoding-params=(string)2, channels=(int)2, ssrc=(uint)3459970867, payload=(int)96, clock-base=(int)2519782556, seqnum-base=(uint)15884
#caps = application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)JPEG, ssrc=(uint)3650380105, payload=(int)96, clock-base=(uint)891404724, seqnum-base=(uint)27573
gst-launch-0.10 -v gstrtpbin name=rtpbin\
udpsrc caps="application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)JPEG, ssrc=(guint)469657143, payload=(int)96, clock-base=(guint)2841649723, seqnum-base=(guint)39869" port=9996 !\
rtpbin.recv_rtp_sink_0 \
rtpbin. ! rtpjpegdepay !\
jpegdec ! xvimagesink\
udpsrc port=9997 ! rtpbin.recv_rtcp_sink_0\
rtpbin.send_rtcp_src_0 ! multiudpsink clients="127.0.0.1:10000" sync=false async=false\
udpsrc caps="application/x-rtp, media=(string)audio, clock-rate=(int)44100, encoding-name=(string)L16, encoding-params=(string)2, channels=(int)2, ssrc=(guint)469657143, payload=(int)96, clock-base=(guint)2841649723, seqnum-base=(guint)39869" port=9998 !\
rtpbin.recv_rtp_sink_1 \
rtpbin. ! rtpL16depay !\
autoaudiosink\
udpsrc port=9999 ! rtpbin.recv_rtcp_sink_1\
rtpbin.send_rtcp_src_1 ! multiudpsink clients="127.0.0.1:10001" sync=false async=false
#!/bin/bash
gst-launch-0.10 -v gstrtpbin name=rtpbin\
videotestsrc ! jpegenc idct-method=2 quality=100 !\
'image/jpeg, width=(int)720, height=(int)576, framerate=(fraction)25/1' !\
rtpjpegpay ssrc=9996 timestamp-offset=0 seqnum-offset=0 ! rtpbin.send_rtp_sink_0\
rtpbin.send_rtp_src_0 ! multiudpsink clients="127.0.0.1:9996"\
rtpbin.send_rtcp_src_0 ! multiudpsink clients="127.0.0.1:9997" sync=false async=false\
udpsrc port=10000 ! rtpbin.recv_rtcp_sink_0\
audiotestsrc ! audioconvert !\
'audio/x-raw-int, rate=(int)44100, channels=(int)2' !\
rtpL16pay ssrc=9998 timestamp-offset=0 seqnum-offset=0 ! rtpbin.send_rtp_sink_1\
rtpbin.send_rtp_src_1 ! multiudpsink clients="127.0.0.1:9998"\
rtpbin.send_rtcp_src_1 ! multiudpsink clients="127.0.0.1:9999" sync=false async=false\
udpsrc port=10001 ! rtpbin.recv_rtcp_sink_1
#!/bin/bash
gst-launch --gst-debug=mpegtsmux:5 videotestsrc do-timestamp=true is-live=true ! 'video/x-raw-yuv, framerate=(fraction)30/1' ! ffmpegcolorspace ! timeoverlay font-desc="Verdana bold 50px" ! ffmpegcolorspace ! queue ! x264enc byte-stream=true bitrate=500 key-int-max=5 tune=zerolatency ! mpegtsmux name=mux m2ts-mode=false pat-interval=3000 pmt-interval=3000 ! rtpmp2tpay pt=33 ! udpsink port=5004 host=127.0.0.1 sync=false enable-last-buffer=false
#!/bin/bash
#GST_DEBUG=3 gst-launch videotestsrc ! x264enc ! h264parse ! flvmux streamable=true ! queue ! rtmpsink location="rtmp://pflu.v89.eu/live/test live=1"
#GST_DEBUG=3 gst-launch videotestsrc ! ffenc_flv ! flvmux ! rtmpsink location="rtmp://pflu.v89.eu/live/test live=1"
#GST_DEBUG=3 gst-launch ! ffenc_flv ! flvmux ! rtmpsink location="rtmp://pflu.v89.eu/live/test live=1"
#ffmpeg -re -i '/home/hark/movies/BigBuckBunny_320x180.mp4' \
#-vcodec libx264 -ab 128k -ac 2 -ar 44100 -r 25 -s 320x240 -vb 660k -f \
#flv 'rtmp://pflu.v89.eu/live/stream'
#ffmpeg -re -i '/home/hark/movies/pn-feed0.webm' \
#-vcodec libx264 -ab 128k -ac 2 -ar 44100 -r 25 -s 320x240 -vb 660k -f \
#flv 'rtmp://pflu.v89.eu/live/stream'
#ffmpeg -re -f rawvideo -s 720x576 -pixel_format yuv420p -i /tmp/video.yuv -vcodec libx264 -s 720x576 -vb 660k -f flv 'rtmp://localhost/myapp/stream'
# audio problems
#ffmpeg -f rawvideo -s 720x576 -r 30000/1001 -pixel_format yuv420p -bufsize 300k -i /tmp/video.yuv \
# -i /tmp/audio.wav -ac 2 -bufsize 300k \
# -vcodec libx264 -qscale 2 -r 50 -profile:v baseline -preset ultrafast -ar 44100 -ab 2560 -s 720x576 -vb 100k -bufsize 300k -f flv 'rtmp://flu.v89.eu/live/stream'
#fifo
#ffmpeg -i /tmp/mpeg.ts \
# -vcodec copy -ar 44100 -ab 256k -f flv 'rtmp://flu.v89.eu/live/stream'
while [ 1 ]
do
sleep 3
ffmpeg -i /home/hark/src/cpu/rtmp/mcast.sdp \
-vcodec libx264 -r 25 -qscale 3 -preset ultrafast -vb 600k -acodec libmp3lame -ar 44100 -ab 256k -f flv 'rtmp://flu.v89.eu/live/pinknoise?password=vetgeheim'
done
#ffmpeg -re -f rawvideo -s 720x576 -r 30000/1001 -pixel_format yuv420p -i /tmp/video.yuv \
# -f jack -ac 2 -i ffmpeg\
# -vcodec libx264 -qscale 2 -r 50 -profile:v baseline -preset ultrafast -ar 44100 -ab 2560 -s 720x576 -vb 100k -f flv 'rtmp://flu.v89.eu/live/stream'
#audio only (works fine)
#ffmpeg \
# -f jack -ac 2 -i ffmpeg\
# -ar 44100 -ab 256k -s 720x576 -f flv 'rtmp://flu.v89.eu/live/stream'
ffmpeg -i /home/hark/src/cpu/rtmp/mcast.sdp \
http://flu.v89.eu:8090/feed1.ffm
# -acodec libvorbis -ab 64k -vcodec libvpx -vb 448k \
# -f webm http://flu.v89.eu:8090/feed1.ffm
v=0
o=- 0 0 IN IP4 127.0.0.1
s=No Name
c=IN IP4 127.0.0.1
t=0 0
a=tool:GStreamer
a=type:broadcast
a=range:npt=now-
m=video 5004 RTP/AVP 33
a=rtpmap:33 MP2T/90000
a=control:mpegts-transport
#!/bin/bash
#ffmpeg -i /tmp/aaa.flv -acodec copy -vcodec libx264 -vbsf h264_mp4toannexb -f mpegts "tcp://127.0.0.1:9991"
#ffmpeg -i video_input.mpg -i audio_input.mp2 -acodec copy -tune zerolatency -x264opts bitrate=2600:vbv-maxrate=2600:vbv-bufsize=166:nal_hrd=cbr -vpre libx264-iptv
#ffmpeg -f alsa -i default -f v4l2 -s 640x480 -i /dev/video0 -acodec flac -vcodec libx264 -vbsf h264_mp4toannexb -f mpegts "tcp://127.0.0.1:9991"
ffmpeg -i "/home/hark/movies/testclips/big_buck_bunny_480p_h264.mov" -re \
-vcodec libx264 \
-b 500000 -s 320x180 -strict experimental -g 25 -me_method zero \
-acodec aac -ab 96000 -ar 48000 -ac 6 -vbsf h264_mp4toannexb \
-f mpegts udp://127.0.0.1:10000?pkt_size=1316 \
#ffmpeg -i "/home/hark/movies/testclips/big_buck_bunny_480p_h264.mov" -re \
## -vcodec copy \
# -acodec copy -vbsf h264_mp4toannexb \
# -f mpegts udp://127.0.0.1:10000?pkt_size=1316 \
#gst-launch v4l2src ! ffmpegcolorspace ! x264enc ! ffmux_mpegts ! tcpclientsink host=localhost port=9991
#!/bin/bash
AUDIO_OPTIONS="-acodec libvorbis -aq 90 -ac 2"
VIDEO_OPTIONS="-threads 8 -f webm -vcodec libvpx -b 200k"
ffmpeg -y -i $1 $AUDIO_OPTIONS $VIDEO_OPTIONS -f webm "http://flu.v89.eu/video/stream/pinknoise.webm"
#!/bin/bash
#GST_DEBUG=3 gst-launch videotestsrc ! x264enc ! h264parse ! flvmux streamable=true ! queue ! rtmpsink location="rtmp://pflu.v89.eu/live/test live=1"
#GST_DEBUG=3 gst-launch videotestsrc ! ffenc_flv ! flvmux ! rtmpsink location="rtmp://pflu.v89.eu/live/test live=1"
#GST_DEBUG=3 gst-launch ! ffenc_flv ! flvmux ! rtmpsink location="rtmp://pflu.v89.eu/live/test live=1"
#ffmpeg -re -i '/home/hark/movies/BigBuckBunny_320x180.mp4' \
#-vcodec libx264 -ab 128k -ac 2 -ar 44100 -r 25 -s 320x240 -vb 660k -f \
#flv 'rtmp://pflu.v89.eu/live/stream'
#ffmpeg -re -i '/home/hark/movies/pn-feed0.webm' \
#-vcodec libx264 -ab 128k -ac 2 -ar 44100 -r 25 -s 320x240 -vb 660k -f \
#flv 'rtmp://pflu.v89.eu/live/stream'
#ffmpeg -re -f rawvideo -s 720x576 -pixel_format yuv420p -i /tmp/video.yuv -vcodec libx264 -s 720x576 -vb 660k -f flv 'rtmp://localhost/myapp/stream'
# audio problems
#ffmpeg -f rawvideo -s 720x576 -r 30000/1001 -pixel_format yuv420p -bufsize 300k -i /tmp/video.yuv \
# -i /tmp/audio.wav -ac 2 -bufsize 300k \
# -vcodec libx264 -qscale 2 -r 50 -profile:v baseline -preset ultrafast -ar 44100 -ab 2560 -s 720x576 -vb 100k -bufsize 300k -f flv 'rtmp://flu.v89.eu/live/stream'
#fifo
#ffmpeg -i /tmp/mpeg.ts \
# -vcodec copy -ar 44100 -ab 256k -f flv 'rtmp://flu.v89.eu/live/stream'
ffmpeg -i /home/hark/src/cpu/rtmp/mcast.sdp \
-vcodec theora -q:v 3 -vb 300k -strict -2 -acodec vorbis -ar 44100 -ab 256k -f ogg - | oggfwd localhost 8000 hackme /pinknoise.ogv
#ffmpeg -re -f rawvideo -s 720x576 -r 30000/1001 -pixel_format yuv420p -i /tmp/video.yuv \
# -f jack -ac 2 -i ffmpeg\
# -vcodec libx264 -qscale 2 -r 50 -profile:v baseline -preset ultrafast -ar 44100 -ab 2560 -s 720x576 -vb 100k -f flv 'rtmp://flu.v89.eu/live/stream'
#audio only (works fine)
#ffmpeg \
# -f jack -ac 2 -i ffmpeg\
# -ar 44100 -ab 256k -s 720x576 -f flv 'rtmp://flu.v89.eu/live/stream'
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment