aboutsummaryrefslogtreecommitdiff
path: root/example-scripts/ffmpeg/stream-combined.sh
blob: 26aec64d038410d6f24c62eaec9a364e581c092a (plain)
  1. #!/bin/sh
  2. confdir="`dirname "$0"`/../"
  3. . $confdir/default-config.sh
  4. if [ -f $confdir/config.sh ]; then
  5. . $confdir/config.sh
  6. fi
  7. #
  8. # a variation of this script was used to generate all combinations of
  9. # [native|translated|stereo]_[hd|sd|slides] streams for 33c3
  10. #
  11. ffmpeg -y -nostdin \
  12. -thread_queue_size 512 \
  13. -i tcp://$MIXHOST:15000 \
  14. -thread_queue_size 512 \
  15. -i tcp://$MIXHOST:13000 \
  16. -threads:0 0 \
  17. -aspect 16:9 \
  18. -filter_complex '
  19. [0:v] yadif=mode=2, hqdn3d, split [deinter_hd] [deinter_hd2];
  20. [deinter_hd2] scale=720:576 [deinter_sd];
  21. [1:v] scale=720:576, fps=5, hqdn3d [deinter_slides];
  22. movie=/opt/voc/share/overlay_hd.png [logo_hd];
  23. [deinter_hd] [logo_hd] overlay=0:0 [hd];
  24. movie=/opt/voc/share/overlay_sd.png [logo_sd];
  25. [deinter_sd] [logo_sd] overlay=0:0 [sd];
  26. movie=/opt/voc/share/overlay_slides.png [logo_slides];
  27. [deinter_slides] [logo_slides] overlay=0:0 [slides]
  28. ' \
  29. -map '[hd]' -map '[sd]' -map '[slides]' \
  30. \
  31. -maxrate:v:0 3000k -crf:0 21 \
  32. -maxrate:v:1 800k -crf:1 18 \
  33. -maxrate:v:2 100k -crf:2 25 \
  34. \
  35. -c:v:0 libx264 -preset:v:0 veryfast -bufsize:v:0 8192k -pix_fmt:0 yuv420p -profile:v:0 main \
  36. -c:v:1 libx264 -preset:v:0 veryfast -bufsize:v:1 8192k -pix_fmt:1 yuv420p -profile:v:1 main \
  37. -c:v:2 libx264 -preset:v:0 veryfast -bufsize:v:2 8192k -pix_fmt:2 yuv420p -profile:v:2 main \
  38. \
  39. -g:v:0 25 \
  40. -g:v:1 25 \
  41. -g:v:2 50 \
  42. \
  43. -map 0:a:0 -filter:a:0 pan='mono|c0=FL' \
  44. -c:a:0 libfdk_aac -b:a:0 96k -ar 44100 \
  45. \
  46. -map 0:a:0 -filter:a:1 pan='mono|c0=FR' \
  47. -c:a:1 libfdk_aac -b:a:1 96k -ar 44100 \
  48. \
  49. -map 0:a:0 \
  50. -c:a:2 libfdk_aac -b:a:2 96k -ar 44100 \
  51. \
  52. -max_interleave_delta 0 \
  53. -f nut pipe: | \
  54. ffmpeg -v warning -y -nostdin -f nut -i pipe: \
  55. \
  56. -c:v copy -c:a copy \
  57. -map 0:v:0 -map 0:a:0 \
  58. -f flv rtmp://127.0.0.1:1935/stream/stream_native_hd \
  59. \
  60. -c:v copy -c:a copy \
  61. -map 0:v:0 -map 0:a:1 \
  62. -f flv rtmp://127.0.0.1:1935/stream/stream_translated_hd \
  63. \
  64. -c:v copy -c:a copy \
  65. -map 0:v:0 -map 0:a:2 \
  66. -f flv rtmp://127.0.0.1:1935/stream/stream_stereo_hd \
  67. \
  68. \
  69. -c:v copy -c:a copy \
  70. -map 0:v:1 -map 0:a:0 \
  71. -f flv rtmp://127.0.0.1:1935/stream/stream_native_sd \
  72. \
  73. -c:v copy -c:a copy \
  74. -map 0:v:1 -map 0:a:1 \
  75. -f flv rtmp://127.0.0.1:1935/stream/stream_translated_sd \
  76. \
  77. -c:v copy -c:a copy \
  78. -map 0:v:1 -map 0:a:2 \
  79. -f flv rtmp://127.0.0.1:1935/stream/stream_stereo_sd \
  80. \
  81. \
  82. -c:v copy -c:a copy \
  83. -map 0:v:2 -map 0:a:0 \
  84. -f flv rtmp://127.0.0.1:1935/stream/stream_native_slides \
  85. \
  86. -c:v copy -c:a copy \
  87. -map 0:v:2 -map 0:a:1 \
  88. -f flv rtmp://127.0.0.1:1935/stream/stream_translated_slides \
  89. \
  90. -c:v copy -c:a copy \
  91. -map 0:v:2 -map 0:a:2 \
  92. -f flv rtmp://127.0.0.1:1935/stream/stream_stereo_slides