From 39c8cb3a0e3813ef77c61c601d0028281c04ad2d Mon Sep 17 00:00:00 2001 From: MaZderMind Date: Sun, 6 Dec 2015 20:28:02 +0100 Subject: [example-scripts] overhaul and test all example scripts, fixes #5 --- example-scripts/ffmpeg/play-mixed-ffplay.sh | 2 ++ .../record-mixed-ffmpeg-segmented-timestamps.sh | 8 ++++++++ .../ffmpeg/record-mixed-ffmpeg-segmented.sh | 8 ++++++++ example-scripts/ffmpeg/record-mixed-ffmpeg.sh | 8 ++++++++ .../ffmpeg/source-avsync-test-clip-as-cam1.sh | 9 +++++++++ .../source-avsync-test-clip-looped-as-cam1.sh | 10 ++++++++++ example-scripts/ffmpeg/source-background-loop.sh | 9 +++++++++ example-scripts/ffmpeg/source-decklink-cam1.sh | 7 +++++++ example-scripts/ffmpeg/source-decklink-cam2.sh | 7 +++++++ example-scripts/ffmpeg/source-mjpg-framegrabber.sh | 14 ++++++++++++++ example-scripts/ffmpeg/source-testvideo-as-cam1.sh | 10 ++++++++++ example-scripts/ffmpeg/source-testvideo-as-cam2.sh | 10 ++++++++++ example-scripts/ffmpeg/stream-hd.sh | 22 ++++++++++++++++++++++ example-scripts/ffmpeg/stream-sd.sh | 22 ++++++++++++++++++++++ 14 files changed, 146 insertions(+) create mode 100755 example-scripts/ffmpeg/play-mixed-ffplay.sh create mode 100755 example-scripts/ffmpeg/record-mixed-ffmpeg-segmented-timestamps.sh create mode 100755 example-scripts/ffmpeg/record-mixed-ffmpeg-segmented.sh create mode 100755 example-scripts/ffmpeg/record-mixed-ffmpeg.sh create mode 100755 example-scripts/ffmpeg/source-avsync-test-clip-as-cam1.sh create mode 100755 example-scripts/ffmpeg/source-avsync-test-clip-looped-as-cam1.sh create mode 100755 example-scripts/ffmpeg/source-background-loop.sh create mode 100755 example-scripts/ffmpeg/source-decklink-cam1.sh create mode 100755 example-scripts/ffmpeg/source-decklink-cam2.sh create mode 100755 example-scripts/ffmpeg/source-mjpg-framegrabber.sh create mode 100755 example-scripts/ffmpeg/source-testvideo-as-cam1.sh create mode 100755 example-scripts/ffmpeg/source-testvideo-as-cam2.sh create mode 100755 example-scripts/ffmpeg/stream-hd.sh create mode 100755 example-scripts/ffmpeg/stream-sd.sh (limited to 'example-scripts/ffmpeg') diff --git a/example-scripts/ffmpeg/play-mixed-ffplay.sh b/example-scripts/ffmpeg/play-mixed-ffplay.sh new file mode 100755 index 0000000..733c279 --- /dev/null +++ b/example-scripts/ffmpeg/play-mixed-ffplay.sh @@ -0,0 +1,2 @@ +#!/bin/sh +ffplay tcp://localhost:11000 diff --git a/example-scripts/ffmpeg/record-mixed-ffmpeg-segmented-timestamps.sh b/example-scripts/ffmpeg/record-mixed-ffmpeg-segmented-timestamps.sh new file mode 100755 index 0000000..86bd1d1 --- /dev/null +++ b/example-scripts/ffmpeg/record-mixed-ffmpeg-segmented-timestamps.sh @@ -0,0 +1,8 @@ +#!/bin/sh +ffmpeg \ + -i tcp://localhost:11000 \ + -ac 2 -channel_layout 2 -aspect 16:9 \ + -map 0:v -c:v:0 mpeg2video -pix_fmt:v:0 yuv422p -qscale:v:0 2 -qmin:v:0 2 -qmax:v:0 7 -keyint_min 0 -bf:0 0 -g:0 0 -intra:0 -maxrate:0 90M \ + -map 0:a -c:a:0 mp2 -b:a:0 192k -ac:a:0 2 -ar:a:0 48000 \ + -flags +global_header -flags +ilme+ildct \ + -f segment -segment_time 180 -segment_format mpegts segment-%t-%05d.ts.ts diff --git a/example-scripts/ffmpeg/record-mixed-ffmpeg-segmented.sh b/example-scripts/ffmpeg/record-mixed-ffmpeg-segmented.sh new file mode 100755 index 0000000..0ea3d25 --- /dev/null +++ b/example-scripts/ffmpeg/record-mixed-ffmpeg-segmented.sh @@ -0,0 +1,8 @@ +#!/bin/sh +ffmpeg \ + -i tcp://localhost:11000 \ + -ac 2 -channel_layout 2 -aspect 16:9 \ + -map 0:v -c:v:0 mpeg2video -pix_fmt:v:0 yuv422p -qscale:v:0 2 -qmin:v:0 2 -qmax:v:0 7 -keyint_min 0 -bf:0 0 -g:0 0 -intra:0 -maxrate:0 90M \ + -map 0:a -c:a:0 mp2 -b:a:0 192k -ac:a:0 2 -ar:a:0 48000 \ + -flags +global_header -flags +ilme+ildct \ + -f segment -segment_time 180 -segment_format mpegts segment-%d.ts diff --git a/example-scripts/ffmpeg/record-mixed-ffmpeg.sh b/example-scripts/ffmpeg/record-mixed-ffmpeg.sh new file mode 100755 index 0000000..fb3a03a --- /dev/null +++ b/example-scripts/ffmpeg/record-mixed-ffmpeg.sh @@ -0,0 +1,8 @@ +#!/bin/sh +ffmpeg \ + -i tcp://localhost:11000 \ + -ac 2 -channel_layout 2 -aspect 16:9 \ + -map 0:v -c:v:0 mpeg2video -pix_fmt:v:0 yuv422p -qscale:v:0 2 -qmin:v:0 2 -qmax:v:0 7 -keyint_min 0 -bf:0 0 -g:0 0 -intra:0 -maxrate:0 90M \ + -map 0:a -c:a:0 mp2 -b:a:0 192k -ac:a:0 2 -ar:a:0 48000 \ + -flags +global_header -flags +ilme+ildct \ + -f mpegts output.ts diff --git a/example-scripts/ffmpeg/source-avsync-test-clip-as-cam1.sh b/example-scripts/ffmpeg/source-avsync-test-clip-as-cam1.sh new file mode 100755 index 0000000..6fceff1 --- /dev/null +++ b/example-scripts/ffmpeg/source-avsync-test-clip-as-cam1.sh @@ -0,0 +1,9 @@ +#!/bin/sh +ffmpeg -y \ + -i http://c3voc.mazdermind.de/testfiles/avsync.ts \ + -vf scale=1920x1080 \ + -c:v rawvideo \ + -c:a pcm_s16le \ + -pix_fmt uyvy422 \ + -f matroska \ + tcp://localhost:10000 diff --git a/example-scripts/ffmpeg/source-avsync-test-clip-looped-as-cam1.sh b/example-scripts/ffmpeg/source-avsync-test-clip-looped-as-cam1.sh new file mode 100755 index 0000000..327b398 --- /dev/null +++ b/example-scripts/ffmpeg/source-avsync-test-clip-looped-as-cam1.sh @@ -0,0 +1,10 @@ +#!/bin/sh +wget -nc -O /tmp/avsync.ts http://c3voc.mazdermind.de/testfiles/avsync.ts +(while true; do cat /tmp/avsync.ts || exit; done) | ffmpeg -y \ + -i - \ + -vf scale=1920x1080 \ + -c:v rawvideo \ + -c:a pcm_s16le \ + -pix_fmt uyvy422 \ + -f matroska \ + tcp://localhost:10000 diff --git a/example-scripts/ffmpeg/source-background-loop.sh b/example-scripts/ffmpeg/source-background-loop.sh new file mode 100755 index 0000000..e18617f --- /dev/null +++ b/example-scripts/ffmpeg/source-background-loop.sh @@ -0,0 +1,9 @@ +#!/bin/sh +wget -nc -O /tmp/bg.ts http://c3voc.mazdermind.de/testfiles/bg.ts +while true; do cat /tmp/bg.ts || exit 1; done |\ + ffmpeg -re -i - \ + -map 0:v \ + -c:v rawvideo \ + -pix_fmt uyvy422 \ + -f matroska \ + tcp://localhost:16000 diff --git a/example-scripts/ffmpeg/source-decklink-cam1.sh b/example-scripts/ffmpeg/source-decklink-cam1.sh new file mode 100755 index 0000000..f6e5f8e --- /dev/null +++ b/example-scripts/ffmpeg/source-decklink-cam1.sh @@ -0,0 +1,7 @@ +#!/bin/sh +ffmpeg -y \ + -f decklink \ + -i 'DeckLink Mini Recorder (1)@10' \ + -c:v rawvideo -c:a pcm_s16le \ + -f matroska \ + tcp://localhost:10000 diff --git a/example-scripts/ffmpeg/source-decklink-cam2.sh b/example-scripts/ffmpeg/source-decklink-cam2.sh new file mode 100755 index 0000000..86137b8 --- /dev/null +++ b/example-scripts/ffmpeg/source-decklink-cam2.sh @@ -0,0 +1,7 @@ +#!/bin/sh +ffmpeg -y \ + -f decklink \ + -i 'DeckLink Mini Recorder (2)@10' \ + -c:v rawvideo -c:a pcm_s16le \ + -f matroska \ + tcp://localhost:10001 diff --git a/example-scripts/ffmpeg/source-mjpg-framegrabber.sh b/example-scripts/ffmpeg/source-mjpg-framegrabber.sh new file mode 100755 index 0000000..502644c --- /dev/null +++ b/example-scripts/ffmpeg/source-mjpg-framegrabber.sh @@ -0,0 +1,14 @@ +#!/bin/sh +ffmpeg -y \ + -i "http://10.73.5.2:1881/stream.mjpg" \ + -filter_complex " + [0:v] scale=1920:1080,fps=25 [v] ; + anullsrc=r=48000:cl=stereo [a] + " \ + -map "[v]" \ + -map "[a]" \ + -c:a pcm_s16le \ + -c:v rawvideo \ + -pix_fmt uyvy422 \ + -f matroska \ + tcp://localhost:10002 diff --git a/example-scripts/ffmpeg/source-testvideo-as-cam1.sh b/example-scripts/ffmpeg/source-testvideo-as-cam1.sh new file mode 100755 index 0000000..7f88bb7 --- /dev/null +++ b/example-scripts/ffmpeg/source-testvideo-as-cam1.sh @@ -0,0 +1,10 @@ +#!/bin/sh +ffmpeg -y \ + -i "http://ftp.uni-erlangen.de/cdn.media.ccc.de/broadcast/sendezentrum/h264-hd/31c3-sendezentrum-1013-de-Methodisch_inkorrekt_Die_falsche_42_hd.mp4" \ + -ac 2 \ + -af aresample=48000 \ + -pix_fmt uyvy422 \ + -c:v rawvideo \ + -c:a pcm_s16le \ + -f matroska \ + tcp://localhost:10000 diff --git a/example-scripts/ffmpeg/source-testvideo-as-cam2.sh b/example-scripts/ffmpeg/source-testvideo-as-cam2.sh new file mode 100755 index 0000000..b9adc82 --- /dev/null +++ b/example-scripts/ffmpeg/source-testvideo-as-cam2.sh @@ -0,0 +1,10 @@ +#!/bin/sh +ffmpeg -y \ + -i "http://ftp.uni-erlangen.de/cdn.media.ccc.de/broadcast/sendezentrum/h264-hd/31c3-sendezentrum-1003-de-Freak_Show_FS147_That_Escalatored_Quickly_hd.mp4" \ + -ac 2 \ + -af aresample=48000 \ + -pix_fmt uyvy422 \ + -c:v rawvideo \ + -c:a pcm_s16le \ + -f matroska \ + tcp://localhost:10001 diff --git a/example-scripts/ffmpeg/stream-hd.sh b/example-scripts/ffmpeg/stream-hd.sh new file mode 100755 index 0000000..6e449f0 --- /dev/null +++ b/example-scripts/ffmpeg/stream-hd.sh @@ -0,0 +1,22 @@ +#!/bin/sh +wget -nc -O /tmp/overlay_hd.png http://c3voc.mazdermind.de/testfiles/overlay_hd.png +ffmpeg -y \ + -i tcp://localhost:11000 \ + -threads:0 0 \ + -aspect 16:9 \ + -c:v libx264 \ + -filter_complex ' + [0:v] yadif=mode=2, hqdn3d [deinter]; + movie=/tmp/overlay_hd.png [logo]; + [deinter] [logo] overlay=0:0 [out] + ' \ + -map '[out]' \ + -maxrate:v:0 3000k -bufsize:v:0 8192k -crf:0 21 \ + -pix_fmt:0 yuv420p -profile:v:0 main -g:v:0 25 \ + -preset:v:0 veryfast \ + \ + -ac 1 -c:a libfdk_aac -b:a 96k -ar 44100 \ + -map 0:a -filter:a:0 pan=mono:c0=FL \ + -ac:a:2 2 \ + \ + -y -f flv rtmp://127.0.0.1:1935/stream/voctomix_hd diff --git a/example-scripts/ffmpeg/stream-sd.sh b/example-scripts/ffmpeg/stream-sd.sh new file mode 100755 index 0000000..e5a0106 --- /dev/null +++ b/example-scripts/ffmpeg/stream-sd.sh @@ -0,0 +1,22 @@ +#!/bin/sh +wget -nc -O /tmp/overlay_hd.png http://c3voc.mazdermind.de/testfiles/overlay_hd.png +ffmpeg -y \ + -i tcp://localhost:11000 \ + -threads:0 0 \ + -aspect 16:9 \ + -c:v libx264 \ + -filter_complex ' + [0:v] yadif=mode=2, hqdn3d, scale=720:576 [deinter]; + movie=/tmp/overlay_hd.png [logo]; + [deinter] [logo] overlay=0:0 [out] + ' \ + -map '[out]' \ + -maxrate:v:0 800k -bufsize:v:0 8192k -crf:0 18 \ + -pix_fmt:0 yuv420p -profile:v:0 main -g:v:0 25 \ + -preset:v:0 veryfast \ + \ + -ac 1 -c:a libfdk_aac -b:a 96k -ar 44100 \ + -map 0:a -filter:a:0 pan=mono:c0=FL \ + -ac:a:2 2 \ + \ + -y -f flv rtmp://127.0.0.1:1935/stream/voctomix_hd -- cgit v1.2.3