无法为' libmp3lame'找到合适的输出格式和' flv'

时间:2017-02-24 13:25:49

标签: audio ffmpeg streaming

目前我正在尝试使用Kubuntu中的ffmpeg设置直播。我真的很远,但不幸的是我无法弄清楚一点提到输出格式错误。这是我用于.sh文件的代码:

#! /bin/bash

# streaming on Ubuntu via ffmpeg.
# see http://ubuntuguide.org/wiki/Screencasts for full documentation

# input resolution, currently fullscreen.
# you can set it manually in the format "WIDTHxHEIGHT" instead.
INRES="1920x1200"

# output resolution.
# keep the aspect ratio the same or your stream will not fill the display.
OUTRES="1280x720"

# input audio. You can use "/dev/dsp" for your primary audio input.
#INAUD="pulse"

# target fps
FPS="30"

# video preset quality level.
# more FFMPEG presets avaiable in /usr/share/ffmpeg
QUAL="ultrafast"

# stream key. You can set this manually, or reference it from a hidden file     
like what is done here.
STREAM_KEY=$(cat ~/.twitch_key)

# stream url. Note the formats for twitch.tv and justin.tv
# twitch:"rtmp://live.twitch.tv/app/$STREAM_KEY"
# justin:"rtmp://live.justin.tv/app/$STREAM_KEY"
STREAM_URL="rtmp://live-cdg.twitch.tv/app/$STREAM_KEY"

ffmpeg \
-f alsa -ac 2 -i "$INAUD" \
-f x11grab -s "$INRES" -r "$FPS" -i :50.0 \
-vcodec libx264 -s "$OUTRES" -preset "$QUAL" -crf 22\
-acodec libmp3lame -threads 6 -q:a 0 -b:a 160k \
-f flv -ar 44100 "$STREAM_URL"

现在的问题是每当我运行.sh文件时,我最后都会收到错误

Unable to find a suitable output format for 'libmp3lame'
libmp3lame: Invalid argument

所以我决定通过删除底部的音频线进行故障排除,然后它变成了

Unable to find a suitable output format for 'flv'
flv: Invalid argument

有些东西告诉我这是因为流密钥没有正确定义,但我不知道如何解决这个问题。

所以有人有想法吗? 提前谢谢!

Misterff1

1 个答案:

答案 0 :(得分:0)

在此处插入空格:

-crf 22\

所以

-crf 22 \
相关问题