Flash Media Live Encoder參數表

Flash Media Live Encoder命令行推流
Flash Media Live Encoder Notes
Flash Media Live Encoder 除了直接以 GUI 方式操做以外
還能透過 Command Line 呼叫 FMLECmd 方式控制
如下則是簡單的筆記git

大部分 FMLECmd 操做都是須要一個 fmle_uid 參數的
fmle_uid 用來表示一個 encoding sessionsession

fmle_uid 格式定義
假如是 rtmp streaming
fmle_uid = + "+" +
e.g. rtmp://fms.myserver.com/live+livestream//加號輸命令時爲+ide

假如是存到檔桉
fmle_uid = [檔桉路徑] + [檔桉名稱]
e.g. path-to-video\sample.flv工具

當一個 encoding session 同時編碼數個 streams 時,用第一個 stream name 或是檔名看成 fmle_uid字體

列出目前已經開始的 encoding sessions
FMLECmd /s
輸出結果範例ui

Adobe(R) Flash(R) Media Live Encoder Command Line Utility v 3.1.0.8703
Copyright(C) 2009-10 Adobe Systems Incorporated. All rights reserved.編碼

Tue Aug 24 2010 11:08:08 : All running FMLE sessions are:
rtmp://127.0.0.1/test1+stream1
它每次都會輸出 Adobe 版權宣告
不喜歡的話也能夠本身到如下位置去讀取文字檔桉取得 encoding sessions命令行

Win7 - C:\ProgramData\Adobe\Flash Media Live Encoder 3.1\fmesessions.dat
WinXP - C:\Documents and Settings\All Users\Application Data\Adobe\Flash Media Live Encoder 3.1\fmesessions.dat
e.g. rtmp://127.0.0.1/test1+stream1#4508:0:0:0:0:0rest

中止一個 encoding session
FMLEcmd /s
以 Profile.xml 啓動 encoding session
FMLEcmd /p c:\Profiles\my_profile.xml /l c:\Logs\my_log.txt
自動維護重啓
Flash Media Live Encoder 被認證過可以連續執行 7 天的
假如計畫跑 7 天以上,最好是固定時間排程自動維護並重啓code

從 profile.xml 檔桉內設定

<restartinterval>
<days>dd</days>
<hours>hh</hours>
<minutes>mm</minutes>
</restartinterval>
從 command line 參數設定

FMLEcmd /t dd:hh:mm
e.g. 4 天 10 小時 30 分後重啓
FMLEcmd /p c:\Profiles\my_profile.xml /ap myid:mypassword /t 04:10:30
command line 參數會蓋過 xml 的設定

系統開機時重啓
由於 FMLELauncher.exe 有 Bug,這部分功能沒辦法正常使用
其實它作的事情也只不過是把 command line 存起來,待下次開機執行而已
不少替代方桉能夠用
下面仍是介紹一下使用方式

Windows 開始 > 全部程式 > 附屬應用程式 > 系統工具 > 工做排程器
創建一個新的工做指向 FMLELauncher.exe
並於系統開機時執行

註冊一個自動重啓的 encoding session 於 command line 啓動 encoding session 後加上 /r
FMLEcmd /p c:\Profiles\my_profile.xml /l c:\my_log.txt /r
這樣就會啓動 encoding session 並將資料寫入到
Win7 - C:\ProgramData\Adobe\Flash Media Live Encoder 3.1\OsLaunch.dat
WinXP - C:\Documents and Settings\All Users\Application Data\Adobe\Flash Media Live Encoder 3.1\OsLaunch.dat
e.g. rtmp://127.0.0.1/test1+stream1#FMLECmd.exe /p profiles\profile_audio.xml

待系統重開時,自動還原註冊過的 encoding session

列出已註冊 encoding session

FMLEcmd /u
取消註冊 encoding session

FMLEcmd /u
DVR - digital video recording
DVR 播放功能可讓使用者倒轉並暫停 live stream
稍後能夠再從暫停的位置 resume 播放
FMLE 能夠在 Live 編碼狀況下啓動與中止這功能

在這裡 FMLE 僅僅只是轉發送 DVR 相關命令到 FMS Application 而已
還須要搭配 FMS DVRCast Application 纔有效果

當即啓動一個 encoding session 的 DVR 錄影

FMLEcmd /dvrstart
fmle_uid 參數是選擇性的,假如沒有提供 fmle_uid
會啓動一個新的 encoding session,DVR 錄影也會同時啓動

當即中止一個 encoding session 的 DVR 錄影

FMLEcmd /dvrstop
回傳 encoding session 的 state

FMLEcmd /dvrstate
-------------------------------------------------------------
2010-03-08 23:04 mencoder和ffmpeg參數詳解 Mencoder 轉 flv
mencoder -ffourcc FLV1 -lavfopts i_certify_that_my_video_stream_does_not_use_b_frames -of lavf -oac mp3lame -lameopts aq=9:cbr:br=64:vol=2 -ovc lavc -lavcopts vcodec=flv:vbitrate=200:acodec=mp3:abitrate=56 -vf scale=320:270,expand=320:270:::1,crop=320:270:0:0 -ofps 18 -srate 22050 input.xxx -o output.flv
Mencoder 轉 avi
mencoder.exe -oac mp3lame -lameopts aq=7:cbr:br=64 -srate 32000 -vf scale=220:176 -ovc lavc -ffourcc DX50 -lavcopts vcodec=mpeg4:vbitrate=320 "input.xxx" -o "output.avi"


mencoder ..\v\wmv.wmv -o ..\v\wmv-3.flv -of lavf -oac mp3lame -lameopts abr:br=56 -srate 22050 -ovc lavc -lavcopts vcodec=flv:vbitrate=500:mbd=2:mv0:trell:v4mv:cbp:last_pred=3

mencoder -oac mp3lame -lameopts aq=7:cbr:br=64 -srate 32000 -vf scale=220:176 -ovc lavc -ffourcc DX50 -lavcopts vcodec=mpeg4:vbitrate=320 "input.xxx" -o "output.avi"


mencoder -oac mp3lame -lameopts aq=7:cbr:br=64 -srate 22050 -vf scale=320:-3 -ovc xvid -xvidencopts bitrate=600 "wmv.wmv" -o "wmv.avi"


mencoder -oac lavc -lavcopts acodec=mp2:abitrate=64 -srate 22050 -vf scale=320:-3 -ofps 15 -ovc xvid -xvidencopts bitrate=400 rmvb.rmvb -o rmvb.avi


mencoder 1.rmvb -oac mp3lame -lameopts preset=64 -ovc xvid -xvidencopts bitrate=600 -of avi -o rmvb.avi


RMVB轉FLVCODE
mencoder -vf scale=320:240 -ffourcc FLV1 -of lavf -lavfopts i_certify_that_my_video_stream_does_not_use_b_frames -ovc lavc -lavcopts vcodec=flv:vbitrate=200 -srate 22050 -oac lavc -lavcopts acodec=mp3:abitrate=56 ok\1.rmvb -o ok\rmvb.flv


利用ffmpeg的這兩個參數,能夠控制讓ffmpeg來將一個大video劈分紅許多小段的獨立播放的文件。
-ss time_off set the start time offset
-t duration set the recording time

Mencoder截段參數:
-ss 0
-endpos 120

FFmpeg 轉 3gp:
ffmpeg -y -i **.** -ac 1 -acodec amr_nb -ar 8000 -ab 24 -s 128x96 [-vcodec mpeg4] -b 40k -r 8 **.3gp


FFmpeg 轉 flv:
ffmpeg -i inputfile.xxx -ab 56 -ar 22050 -qmin 2 -qmax 16 -b 320k -r 15 -s 320x240 outputfile.flv


FFmpeg截圖參數
對視頻文件截圖:
ffmpeg -i xxx.xxx -y -f image2 -ss 8 -t 0.001 -s 350x240 xxx.jpg

對已有flv截圖:
ffmpeg -i E:\VideoConvert\VideoConvert\VideoConvert\video\UpFiles\bikes.flv -y -f image2 -ss 8 -t 0.001 -s 350x240 222.jpg
對視頻裁剪
mencoder -ss 0:02 -endpos 0:40 -oac copy -ovc copy E:\flv\bikes.flv -o E:\flv\bikes1.flv
mencoder -ss 0:02 -endpos 0:20 -oac copy -ovc copy E:\flv\nose_bleed.mp4 -o E:\flv\bleed.flv
把視頻的前30幀轉換成一個Gif :
ffmpeg -i xxx.xxx -vframes 30 -y -f gif xxx.gif

截取從10秒開始持續10秒的片斷

FFmpeg 加水印 參數:
ffmpeg -i inputfile.xxx -tagpict ":220:210" -ab 56 -ar 22050 -qmin 2 -qmax 16 -b 320k -r 15 -s 320x240 outputfile.flv


水印參數說明:
-tagpict ":220:210"
(在ffmpeg所在目錄中尋找0002.mjpg、mask.mjpg兩個用做水印處理的圖片文件,而後在指定的座標,好比此處的:220:210,把水印在轉碼過程當中添加到視頻文件的每一楨上)


AviSynth加水印:
首先ffmpeg/Mencoder編譯時須要--enable-avisynth;
轉換參數:ffmpeg -y -i 1.avs -b 320k rmvb-avs.flv
1.avs編寫格式:
video = DirectShowSource("rmvb.rmvb",15).BilinearResize(320,240)
logo = ImageSource("logo2.jpg")
logomask = ImageSource("mask2.jpg")
overlay(video,logo,mask=logomask)


mencoder 轉 flv 同時加字幕水印

試了一下,能夠加進去,但有些參數還設置很差.好比中文的字幕只顯示成"_____",文件的各項設置
cd mencoder
mencoder ../file/test.mov -o ../flv/zbzbzb.flv -of lavf -oac mp3lame -lameopts abr:br=56
-ovc lavc -lavcopts vcodec=flv:vbitrate=500:mbd=2:mv0:v4mv:last_pred=3 -subpos 5 -subfont
-text-scale 10 -unicode -font c:\arial.ttf -sub ../file/test.srt -lavfopts
i_certify_that_my_video_stream_does_not_use_b_frames -srate 22050
pause

上面是在一個批處理文件中執行的,因此寫成這樣子

subpos 是說明字幕的位置:垂直方向上越大越靠下,水平方向的參數我沒找到,最小0,最大100
subfont-text-scale 設置字體的大小
-unicode 文字編碼方式,其餘的沒試過
-font 字體文件
-sub 你的字幕文件


例子:ffmpeg -y -i "1.avi" -title "Test" -vcodec xvid -s 368x208 -r 29.97 -b 1500 -acodec aac -ac 2 -ar 24000 -ab 128 -vol 200 -f psp -muxvb 768 "1.***"

解釋:以上命令能夠在Dos命令行中輸入,也能夠建立到批處理文件中運行。不過,前提是:要在ffmpeg所在的目錄中執行(轉換君所在目錄下面的cores子目錄)。 參數: -y(覆蓋輸出文件,即若是1.***文件已經存在的話,不經提示就覆蓋掉了) -i "1.avi"(輸入文件是和ffmpeg在同一目錄下的1.avi文件,能夠本身加路徑,更名字) -title "Test"(在PSP中顯示的影片的標題) -vcodec xvid(使用XVID編碼壓縮視頻,不能改的) -s 368x208(輸出的分辨率爲368x208,注意片源必定要是16:9的否則會變形) -r 29.97(幀數,通常就用這個吧) -b 1500(視頻數據流量,用-b xxxx的指令則使用固定碼率,數字隨便改,1500以上沒效果;還能夠用動態碼率如:-qscale 4和-qscale 6,4的質量比6高) -acodec aac(音頻編碼用AAC) -ac 2(聲道數1或2) -ar 24000(聲音的採樣頻率,好像PSP只能支持24000Hz) -ab 128(音頻數據流量,通常選擇3二、6四、9六、128) -vol 200(200%的音量,本身改) -f psp(輸出psp專用格式) -muxvb 768(好像是給PSP機器識別的碼率,通常選擇38四、512和768,我改爲1500,PSP就說文件損壞了) "1.***"(輸出文件名,也能夠加路徑改文件名)

相關文章
相關標籤/搜索