ffmpeg - 为输出流 #0.0 打开编码器时出错 - 可能是不正确的参数,例如 bit_rate、rate、width 或 height

标签 ffmpeg

我正在使用此命令通过 FFMPEG 将 avi、mov、m4v 视频文件转换为 flv 格式

/usr/local/bin/ffmpeg -i '/home/public_html/files/video_1355440448.m4v' -s '640x360' -sameq -ab '64k' -ar '44100' -f 'flv' -y /home/public_html/files/video_1355440448.flv

[flv @ 0x68b1a80] requested bitrate is too low
Output #0, flv, to '/home/files/1355472099-50cadce349290.flv':
    Stream #0.0: Video: flv, yuv420p, 640x360, q=2-31, pass 2, 200 kb/s, 90k tbn, 25 tbc
    Stream #0.1: Audio: adpcm_swf, 44100 Hz, 2 channels, s16, 64 kb/s
Stream mapping:
  Stream #0.0 -> #0.0
  Stream #0.1 -> #0.1
Error while opening encoder for output stream #0.0 - maybe incorrect parameters such as bit_rate, rate, width or height
-------------------------------
RESULT
-------------------------------
Execute error. Output for file "/home/public_html/files/video_1355472099.avi" was found, but the file contained no data. Please check the available codecs compiled with FFmpeg can support this type of conversion. You can check the encode decode availability by inspecting the output array from PHPVideoToolkit::getFFmpegInfo().

但是如果我手动使用这个命令,那么它的工作
/usr/local/bin/ffmpeg -i '/home/public_html/files/video_1355440448.m4v' -s '640x360' -sameq -ab '64k' -ar '44100' -f 'flv' -y /home/public_html/files/video_1355440448.flv

最佳答案

  • 这是因为您有两个流,输出将被编码然后调整大小,请参阅您的输出消息:
    Stream #0.0 -> #0.0
    Stream #0.1 -> #0.1
    

    ...您使用 adpcm_swf音频和 yuv420p视频

    答案很简单,你需要把copy作为您的音频编解码器...

    请参阅我的视频 mpeg4、yuv420p 和音频 ac3 示例 ...
    ffmpeg -i input.mkv -vf scale=720:-1 -acodec copy -threads 12 output.mkv
    

    这将改变第一个大小 = 720,纵横比 = -1(未知)。您还需要使用:
    -acodec copy -threads 12
    

    如果不使用它,您将遇到一个错误。
    例如:当我使用它时,输出编码消息向我展示了这一点并且效果很好:
    [h624 @ 0x874e4a0] missing picture in access unit93 bitrate=1034.4kbits/s    
    Last message repeated 1163 times5974kB time=53.47 bitrate= 915.3kbits/s 
    
  • 您需要使用 flv 格式的文件,如下所示:
    ffmpeg -i input.mp4 -c:v libx264 -crf 19 output.flv
    
  • 关于ffmpeg - 为输出流 #0.0 打开编码器时出错 - 可能是不正确的参数,例如 bit_rate、rate、width 或 height,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13877031/

    相关文章:

    ffmpeg h264 问题 : "File for preset ... not found" on XP

    python - 如何为 matplotlib.animation 正确启用 ffmpeg?

    video - 未知编码器 'libvorbis'

    android - FFmpeg Android库压缩后旋转视频

    c - 使用ffmpeg库编译c代码时出错

    google-chrome - 像素格式 yuvj420p 的 mp4 无法在 Chrome 17 中播放,但可以在 Safari、IE 等中播放

    http - 如何将udp mpeg ts流转换为http流?

    android - 从 AVFrame 数据中获取单个缓冲区并在 Android Bitmap/Surface/SurfaceView 上显示

    javascript - UglifyJS 内存不足

    ubuntu - FFMPEG - 验证帧顺序