注册 登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

TOTO

Think and Be Different

 
 
 

日志

 
 

ffmpeg 将wmv转换为flv  

2010-04-26 15:30:29|  分类: 萝卜开会 |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |
应该说ffmpeg是一个很强大的视频转换工具,【另外一个Mencoder据说也不错】

命令看起来很简单,比如
将一个文件转换为flv文件, 命令如下:
 ffmpeg -i src.wmv -y output.flv
出现error错误:
[adpcm_swf @ 0x2104a20]Sample rate must be 11025, 22050 or 44100
Error while opening codec for output stream #0.1 - maybe incorrect parameters such as bit_rate, rate, width or height

这里需要加一个参数
ffmpeg -i src.wmv -ar 11025 output.flv

我是从下面文章中获得了答案,由于对视频的一些知识不是很懂,暂时只能照葫芦画瓢
内容如下:
  1. First I tried this:
    ffmpeg -i input.avi output.flv
    and got this error:
    Input #0, avi, from 'input.avi':
      Duration: 00:00:27.8, start: 0.000000, bitrate: 4128 kb/s
        Stream #0.0: Video: mjpeg, yuvj422p, 640x480 [PAR 0:1 DAR 0:1], 15.00 tb(r)
        Stream #0.1: Audio: pcm_s16le, 7875 Hz, mono, 126 kb/s
    Output #0, flv, to 'output.flv':
        Stream #0.0: Video: flv, yuv420p, 640x480 [PAR 0:1 DAR 0:1], q=2-31, 200 kb/s, 15.00 tb(c)
        Stream #0.1: Audio: adpcm_swf, 7875 Hz, mono, 64 kb/s
    Stream mapping:
      Stream #0.0 -> #0.0
      Stream #0.1 -> #0.1
    [adpcm_swf @ 0x7f0f3be6ba00]Sample rate must be 11025, 22050 or 44100
    Error while opening codec for output stream #0.1 - maybe incorrect parameters such
    as bit_rate, rate, width or height
  2. Then I tried this:
    ffmpeg -i input.avi -vcodec copy -acodec pcm_s16le output.flv
    and got this error:
    [pcm_s16le @ 0x7f058dfcba00]flv does not support that sample rate, choose from (44100, 22050, 11025).
    Could not write header for output file #0 (incorrect codec parameters ?)
  3. Then i tried this
    ffmpeg -i input.avi -vcodec copy -acodec pcm_s16le -ar 44100 output.flv
    and only got audio, no video in output file.  
  4. Then this:
    ffmpeg -i input.avi -ar 44100 output.flv
    and finally got something that works, however the quality wasn't great.  
  5. To increase quality, use the -sameq argument (same quality as source) This doubled the file size but the flv was much higher quality.
    ffmpeg -i input.avi -sameq -ar 44100 output.flv




  评论这张
 
阅读(1849)| 评论(0)
推荐 转载

历史上的今天

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2017