Last active
April 18, 2017 08:17
-
-
Save suhanlee/5dac2cdfd9005e1edb95e14fa98f01d5 to your computer and use it in GitHub Desktop.
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
Port 8090 | |
# bind to all IPs aliased or not | |
BindAddress 0.0.0.0 | |
# max number of simultaneous clients | |
MaxClients 1000 | |
# max bandwidth per-client (kb/s) | |
MaxBandwidth 100000 | |
<Feed feed1.ffm> | |
File /tmp/feed1.ffm | |
FileMaxSize 1G | |
ACL allow 127.0.0.1 | |
</Feed> | |
<Stream live.flv> | |
Format flv | |
Feed feed1.ffm | |
VideoCodec libx264 | |
VideoFrameRate 30 | |
VideoSize 1280x720 | |
VideoBitRate 8000 | |
AudioCodec aac | |
Strict -2 | |
AudioBitRate 128 | |
AudioChannels 2 | |
AudioSampleRate 44100 | |
</Stream> | |
<Stream face.flv> | |
Format flv | |
Feed feed1.ffm | |
VideoCodec libx264 | |
VideoFrameRate 30 | |
VideoSize 640x480 | |
VideoBitRate 4000 | |
AudioCodec aac | |
Strict -2 | |
AudioBitRate 128 | |
AudioChannels 2 | |
AudioSampleRate 44100 | |
</Stream> | |
<Stream stat.html> | |
Format status | |
ACL allow localhost | |
ACL allow 192.168.0.0 192.168.255.255 | |
</Stream> |
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
$ ffmpeg -y \ | |
-i sample.mov \ | |
-codec copy \ | |
-bsf h264_mp4toannexb \ | |
-map 0 \ | |
-f segment \ | |
-segment_time 10 \ | |
-segment_format mpegts \ | |
-segment_list "/Library/WebServer/Documents/vod/prog_index.m3u8" \ | |
-segment_list_type m3u8 \ | |
"/Library/WebServer/Documents/vod/fileSequence%d.ts" |
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
$ ffmpeg -y \ | |
-i udp://127.0.0.1:5555 \ | |
-map 0 \ | |
-f segment \ | |
-segment_time 10 \ | |
-segment_format mpegts \ | |
-segment_list "/Library/WebServer/Documents/live/prog_index.m3u8" \ | |
-segment_list_size 3 \ | |
-segment_list_flags +live \ | |
-segment_list_type m3u8 \ | |
"/Library/WebServer/Documents/live/fileSequence%d.ts" |
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
<!DOCTYPE html> | |
<html> | |
<body> | |
<video | |
autoplay | |
controls | |
src="prog_index.m3u8" | |
height="540" width="960"> | |
</video> | |
</body> | |
</html> |
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/bash | |
# | |
VBR="2500k" # Bitrate de la vidéo en sortie | |
FPS="30" # FPS de la vidéo en sortie | |
QUAL="veryfast" # Preset de qualité FFMPEG | |
YOUTUBE_URL="rtmp://a.rtmp.youtube.com/live2" # URL de base RTMP youtube | |
SOURCE="0:0" # Source UDP | |
KEY="pmyt-e8t9-f8xa-ftk0" | |
ffmpeg \ | |
-f avfoundation -framerate 30 \ | |
-i "$SOURCE" -deinterlace \ | |
-vcodec libx264 -pix_fmt yuv420p -preset $QUAL -r $FPS -g $(($FPS * 2)) -b:v $VBR \ | |
-acodec libmp3lame -ar 44100 -threads 6 -qscale 3 -b:a 712000 -bufsize 512k \ | |
-f flv "$YOUTUBE_URL/$KEY" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment