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