0
我测试了拼接mp4文件在一起,并遇到了一种方法来做到这一点,正在工作,但正在创造巨大的文件大小。avconv - concat .mp4没有质量损失和巨大的文件大小
我的原始视频是mp4,我开始尝试将它们转换为mpeg,但发现mpeg不会转换,因为我的文件是1fps,mpeg不支持。
[email protected]:~/mp4_test$ avconv -i video1.mp4 video1.mpeg
avconv version 9.16-6:9.16-0ubuntu0.14.04.1, Copyright (c) 2000-2014 the Libav developers
built on Aug 10 2014 18:16:02 with gcc 4.8 (Ubuntu 4.8.2-19ubuntu1)
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'video1.mp4':
Metadata:
major_brand : f4v
minor_version : 0
compatible_brands: isommp42m4v
creation_time : 2014-12-02 13:00:03
Duration: 00:59:56.90, start: 0.000000, bitrate: 120 kb/s
Stream #0.0(eng): Video: h264 (Main), yuv420p, 800x600, 120 kb/s, 1 fps, 90k tbn
Metadata:
creation_time : 2014-12-02 13:00:03
[mpeg1video @ 0x10c53a0] MPEG1/2 does not support 5/1 fps
Output #0, mpeg, to 'video1.mpeg':
Metadata:
major_brand : f4v
minor_version : 0
compatible_brands: isommp42m4v
creation_time : 2014-12-02 13:00:03
Stream #0.0(eng): Video: mpeg1video, yuv420p, 800x600, q=2-31, 200 kb/s, 90k tbn, 5 tbc
Metadata:
creation_time : 2014-12-02 13:00:03
Stream mapping:
Stream #0:0 -> #0:0 (h264 -> mpeg1video)
Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
我读过一个建议,为帧率添加-r 23.967,但仍然不起作用。
然后我发现我可以将文件转换为.avi并成功连接它们。
转换为AVI
avconv -i video1.mp4 -r 23.967 -qscale 1 video1.avi
avconv -i video2.mp4 -r 23.967 -qscale 1 video2.avi
那么Concat的
avconv -i concat:video1.avi\|video2.avi -c copy video.mp4
不幸的是这个新的文件超过1GB时,原来是约50MB。我已经尝试调整qscale,但是我失去了太多的质量,仍然无法获得文件大小。
是否有一个很好的建议,我应该先转换为什么文件类型,然后才能将它们连接起来?我不介意文件大小有点大,但最好不要太大。
感谢