右鍵選單
溢泰的旅遊休閒相簿⊙ - ⊙WaterGoGoGo旅遊趣⊙ - ⊙FB:WaterGoGoGoTravel
 T J C T Mobile
 Water Blog - 天空部落- 痞客邦- 札西德樂假期
 E-Mail:留言給我
   
  【 氣象局一週天氣預報 】
★★ FFMPEG & FFServer 語法指令整理 ★★ 回教學首頁
◎.FFMPEG 安裝 ◎.FFServer 安裝
◎.ffserver.conf ◎.FFserver:狀態網頁
◎.Transcode 語法:H264/AAC ◎.Transcode 語法:MPEG-4/AAC
◎.Transcode 語法:FLC1/MP3 ◎.

◆ Streaming 語法 ◆

官方線上手冊:FFmpeg Documentation
http://www.ffmpeg.org/ffmpeg-doc.html 

◎ Multicast(udp) 語法:
"C:\Program Files\VideoLAN\VLC\vlc" -vvv boa1.mpg --sout udp:225.9.9.9:10000 --ttl 1 --loop

 


◆ 轉存檔案語法 ◆

 


◆ ffserver.conf ◆

vi /etc/ffserver.conf
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 10000
# Suppress that if you want to launch ffserver as a daemon.
NoDaemon

<Feed feed1.ffm>
File /tmp/feed1.ffm
FileMaxSize 5M
</Feed>

# FLV output - good for streaming
<Stream test.flv>
# the source feed
Feed feed1.ffm
# the output stream format - FLV = FLash Video
Format flv
VideoCodec flv
# this must match the ffmpeg -r argument
VideoFrameRate 15
# generally leave this is a large number
VideoBufferSize 80000
# another quality tweak
VideoBitRate 200
# quality ranges - 1-31 (1 = best, 31 = worst)
VideoQMin 1
VideoQMax 5
VideoSize 352x288
# this sets how many seconds in past to start
PreRoll 0
# wecams don't have audio
Noaudio
</Stream>

# ASF output - for windows media player
<Stream test.asf>
# the source feed
Feed feed1.ffm
# the output stream format - ASF
Format asf
VideoCodec msmpeg4
# this must match the ffmpeg -r argument
VideoFrameRate 15
# generally leave this is a large number
VideoBufferSize 80000
# another quality tweak
VideoBitRate 200
# quality ranges - 1-31 (1 = best, 31 = worst)
VideoQMin 1
VideoQMax 5
VideoSize 352x288
# this sets how many seconds in past to start
PreRoll 0
# wecams don't have audio
Noaudio
</Stream>

# ffserver -f ffserver.conf & ffmpeg -i /usr/clips/test.avi http://127.0.0.1/feed1.ffm


◆ FFserver:狀態網頁◆
<Stream status.html>
Format status

# Only allow local people to get the status
ACL allow localhost
ACL allow 192.168.0.0 192.168.255.255
</Stream>

 


◆ FFEMPG 轉成 flv 或 mp4 ◆

ffmpeg -i TheRobo2010.mp4 -loglevel quiet -v 0 -s 480x360 -ss 00:00:00 -t 00:10:00 -y -acodec libfaac -ab 128k -ar 44100 -vcodec libx264 -vpre medium -vpre main -crf 23 -threads 0 -f [mp4/flv] TheRobo2010.mp4


◆FFMPEG 語法:MPEG-4/AAC 轉 MPEG TS◆

MP4(H264+AAC) 轉 MPEG TS
$ ffmpeg -i file.mp4 -acodec copy -vcodec copy -f mpegts -vbsf h264_mp4toannexb output.mpegts.ts


 



 


參考來源網址:
ffmpeg -i INPUT -f flv -s WIDTHxHEIGHT -r 10fps -b 2000kbps -g 100 -acodec libmp3lame -ar 22050 -ab 48000 -ac 1 -y OUTPUT

 
最後更新: 2011年05月19日