Created
August 3, 2012 05:54
-
-
Save boronology/3244913 to your computer and use it in GitHub Desktop.
shellscript to help bloadcast using avconv or ffmpeg
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| #自分の配信URL | |
| OUTPUT_URL="" | |
| #デフォルトのエンコーダはavconv | |
| #ffmpegにしても動作するが、現在DebianやUbuntuはlibavに移行しているので推奨されない | |
| ENCODER=avconv | |
| FRAMERATE=30 | |
| OUTPUT_RESOLUTION=640x480 | |
| VIDEO_BITRATE=220k | |
| AUDIO_BITRATE=64k | |
| #スレッド数(コア数にあわせて調整) | |
| CONCURRENCY=2 | |
| #音量の調整。配信先で音が小さすぎる/大きすぎるようであればこの値を調整する。 | |
| #100%が256。50%に下げたいなら128。200%に上げたいなら512に、等々。 | |
| VOLUME=256 | |
| padsp ${ENCODER} -r ${FRAMERATE} \ | |
| -s ${OUTPUT_RESOLUTION} \ | |
| -f video4linux2 -i /dev/video0 \ | |
| -f alsa -ac 2 -i pulse \ | |
| -acodec libvo_aacenc \ | |
| -vol ${VOLUME} \ | |
| -ar 44100 -ab ${AUDIO_BITRATE} \ | |
| -vcodec libx264 -b ${VIDEO_BITRATE} -vsync 1 \ | |
| -threads ${CONCURRENCY} \ | |
| -y \ | |
| -f flv ${OUTPUT_URL} | |
| echo "配信終了" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment