2017-04-21 41 views
0

今天我试图在我的debian 8.3服务器上使用ffmpeg来24/7小时直播。但它不起作用。ffmpeg youtube livestream不工作

#! /bin/bash 

INRES="1280x1024" # input resolution (The resolution of the program you want to stream!) 
OUTRES="1024x790" # Output resolution (The resolution you want your stream to be at) 
FPS="60" # target FPS 
QUAL="ultrafast" 
# one of the many FFMPEG presets that can be used 
# If you have low bandwidth, put the qual preset on 'ultrafast' (upload bandwidth) 
# If you have medium bandwitch put it on normal to medium or fast 
STREAM_KEY="hidden" # this is your streamkey 




ffmpeg -f "file.avi" -s "$INRES" -r "$FPS" -i :0.0 \ 
-f alsa -ac 2 -i pulse -vcodec libx264 -s "$OUTRES" \ 
-acodec libmp3lame -ab 128k -ar 44100 -threads 0 \ 
-f flv "rtmp://a.rtmp.youtube.com/live2" 

它给我的输出

未知输入格式: 'file.avi'

回答

1

ffmpeg -f "file.avi" ... 

应该

ffmpeg -i "file.avi" ... 
+0

感谢,工程:) – Select