//大小=》变小
ffmpeg -i 1.mp4 -b:v 2M -vcodec msmpeg4 -acodec wmav2 1_mp4.wmv
//大小=》变大
ffmpeg -i 1.mp4 -qscale 2 -vcodec msmpeg4 -acodec wmav2 2_mp4.wmv

ffmpeg -i 1.mp4 -q:a 2 -q:v 2 -vcodec msmpeg4 -acodec wmav2 3_mp4.wmv

ffmpeg -i 1.mp4 outputfile.wmv

ffmpeg -i 1.MP4 -c:v wmv2 -b:v 20M -c:a wmav2 -b:a 192k output.wmv

ffmpeg -i input.wmv -c:v libx264 -crf 23 -profile:v high -r 30 -c:a libfaac -q:a 100 -ar 48000 output.mp4

ffmpeg -i input.wmv -c:v libx264 -crf 23 -c:a libfaac -q:a 100 output.mp4

How to get better quality converting MP4 to WMV with ffmpeg?

I am converting MP4 files to WMV with these two rescaling commands:

ffmpeg -i test.mp4 -y -vf scale=-1:360 test1.wmv
ffmpeg -i test.mp4 -y -vf scale=-1:720 test2.wmv

I've also tried:

ffmpeg -g 1 -b 16000k -i test1.mp4 test1.wmv

However, the .wmv files that are produced are "blocky and grainy" as you can see here in a small section of a video screenshot:

These are the sizes:

test.mp4 - 106 MB
test1.wmv - 6 MB
test2.wmv - 16 MB

How can I increase the quality/size of the resulting .wmv files (the size of the .wmv files is of no concern)?

asked Jun 18 '12 at 8:53
Edward Tanguay

60.2k224572875
 

3 Answers

You can simply use the -sameq parameter ("use same quantizer as source") which produces a much larger sized video file (227 MB) but with excellent quality.

ffmpeg -sameq -i test.mp4 -y -vf scale=-1:360 test1.wmv
answered Jun 18 '12 at 9:23
Edward Tanguay

60.2k224572875
 
7  
A better solution is to use -qscale (or -qscale:v or -q:v depending on your syntax preference); generally with a value of 2-5. A lower value is higher quality, and 2 can be considered "visually lossless". -sameq is not designed to be used between formats that do not share the same quantizer scale, and this may be the case for you. – LordNeckbeard Jun 18 '12 at 16:03
2  
Also you're applying -sameq as an input option (anything before -i). Probably works as expected, but keep in mind not all options applied to the input will be applied to the output. – LordNeckbeard Jun 18 '12 at 16:07
    
-sameq has been removed. When you try to use it ffmpeg offers "use -qscale 0 or an equivalent quality factor option", and it errors out with an invalid argument. – Robert Koernke Jan 6 at 17:04
 

One thing I discovered after many frustrating attempts of enhancing the final quality was that if you don't specify a bitrate, it'll use a quite low average. Try -b 1000k for a starting point, and experiment increasing or decreasing it until you reach the desired result. Your file will be quite bigger or smaller, accordingly.

answered Feb 7 '13 at 22:59
Fabio Ceconello

11.2k42645
 

Consider the following command instead (some outdated commands in the final answer section):

ffmpeg -i test.mp4 -c:v wmv2 -b:v 1024k -c:a wmav2 -b:a 192k test1.wmv

REFERENCES

answered Jan 18 at 10:02
 

http://stackoverflow.com/questions/11079577/how-to-get-better-quality-converting-mp4-to-wmv-with-ffmpeg

ffmpeg mp4 to wmv and wmv to mp4的更多相关文章

  1. ffmpeg代码笔记2:如何判断MP4文件里面的流是音频还是视频流

    http://blog.csdn.net/qq_19079937/article/details/43191211 在MP4结构体系里面,hdlr字段(具体在root->moov->tra ...

  2. MP4文件格式的解析,以及MP4文件的分割算法

    http://www.cnblogs.com/haibindev/archive/2011/10/17/2214518.html http://blog.csdn.net/pirateleo/arti ...

  3. Windows 下 ffmpeg 转 mp4

    最近在研究所有视频格式转  mp4 因为html5 只支持mov MP4 等格式..查阅了 很多资料发现  转成flv  很简单.. 可是要转 mp4 就难了... 经过我不屑的努力..终于转换成功了 ...

  4. 使用ffmpeg将Mp4转gif

    视频转动图,是个强需求,家大业大的微博相册只可上传图片,进而基于微博相册的生态也是如此.目前,网络上有许多转换.压缩的网站,多数执行速度慢或者收费,体验较差. ffmpeg是一个开源的音频处理软件,支 ...

  5. 使用ffmpeg从mp4文件中提取视频流到h264文件中

    ffmpeg -i 2018.mp4 -codec copy -bsf: h264_mp4toannexb -f h264 tmp. 注释: -i 2018.mp4:  是输入的MP4文件 -code ...

  6. 使用FFMPEG从MP4封装中提取视频流到.264文件 (转载)

    命令行: ffmpeg -i 20130312_133313.mp4 -codec copy -bsf: h264_mp4toannexb -f h264 20130312_133313.264 说明 ...

  7. ffmpeg+Python实现B站MP4格式音频与视频的合并

    目录 安装 官网下载 环境变量 验证 ffmpeg的使用 Python实现自动处理 文件结构 番剧缓存结构 常规缓存结构 文件信息 代码 具体代码 代码说明 安装 官网下载 http://ffmpeg ...

  8. 嵌入式 使用mp4v2将H264+AAC合成mp4文件

    录制程序要添加新功能:录制CMMB电视节目,我们的板卡发送出来的是RTP流(H264视频和AAC音频),录制程序要做的工作是: (1)接收并解析RTP包,分离出H264和AAC数据流: (2)将H26 ...

  9. 使用mp4v2将H264+AAC合成mp4文件

    录制程序要添加新功能:录制CMMB电视节目,我们的板卡发送出来的是RTP流(H264视频和AAC音频),录制程序要做的工作是: (1)接收并解析RTP包,分离出H264和AAC数据流: (2)将H26 ...

随机推荐

  1. Css布局 响应式布局介绍

    1. 概念: 写一套css样式可以同时适配多个终端,是为解决移动互联网诞生的. 2. 作用: 面对不同的分辨率设备灵活性强,能够快捷解决多设备显示适应问题 3. 原理 媒体查询 ① 外联式媒体查询语法 ...

  2. java 序列化原来如此

    上次面试的时候 ,如何实现java 类的序列化,当时感觉这个问题很简单,我的回答是实现serizlizable 接口就好了,可以实现对象的持久化,看了看书,原来这样: public class Ser ...

  3. 20180115-Xcode创建多个工程协同开发

    今天研究了一下在Xcode中创建多个工程,达到模块化的目的的同时,实现多个相似项目的协同开发,最主要的是可以实现多工程连编.项目的效果如下: 接下来创建一个这样的项目,以及他们之间的通信 1.建一个文 ...

  4. icmp, IPPROTO_ICMP - Linux IPv4 ICMP 核心模块.

    DESCRIPTION 描述 本网络核心协议模块实现了基于 RFC792 协议中定义的<互联网控制报文协议>.它针对网络主机间通讯出错的情况作出回应并给出诊断信息.用户不能直接使用本模块. ...

  5. initdb - 创建一个新的 PostgreSQL数据库集群

    SYNOPSIS initdb [ option...] --pgdata | -D directory DESCRIPTION 描述 initdb 创建一个新的 PostgreSQL 数据库集群. ...

  6. Spring Boot 学习杂记

    使用IntelliJ IDEA构建Spring Initializr

  7. ul列表li元素横排显示的IE兼容性问题

    目标: 使ul列表横排显示 现象: 谷歌OK,火狐竖排,IE竖排. 原因: ul原css代码: 首先,去除点号,list-style:none;为了使其横排,使用了display:contents;该 ...

  8. Linux 安装 nginx 安装PCRE库

    PCRE(Perl Compatible Regular Expressions)是一个Perl库,包括 perl 兼容的正则表达式库.这些在执行正规表达式模式匹配时用与Perl 5同样的语法和语义是 ...

  9. 第03课:GDB常用的调试命令概览

    先给出一个常用命令的列表,后面结合具体的例子详细介绍每个命令的用法. 命令名称 命令缩写 命令说明 run r 运行一个程序 continue   c 让暂停的程序继续运行 next   n 运行到下 ...

  10. 公司内网机器vm ubuntu proxy 设置

    解决浏览器上网问题: System Setting -> Network -> Network Proxy设置公司的代理 解决apt联网问题: 在/etc/apt/apt.conf文件里加 ...