avconv - concat .mp4没有质量损失和巨大的文件大小

时间:2014-12-04 05:44:31

标签: video concatenation avconv

我正在测试将mp4文件合并在一起,并且遇到了一种方法,它正在工作,但正在创建巨大的文件大小。

我的原始视频是mp4,我开始尝试将其转换为mpeg后按照其他指南但发现mpeg不会转换为我的文件是1fps而mpeg不支持。

media@v2:~/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

不幸的是,当原始文件大约为50mb时,这个新文件超过1GB。我已经尝试过调整qscale,但我只是失去了太多的质量,但仍然无法降低文件大小。

在我可以将它们连接起来之前,我应该首先转换为哪种文件类型是一个很好的建议吗?我不介意文件大小有点大,但最好不要太多。

由于

1 个答案:

答案 0 :(得分:0)

如果您不介意更改文件的格式,可以使用mkvmerge工具将它们转换为单个Matroska文件。

字符串很简单:

mkvmerge -o output.mkv file1.mp4 + file2.mp4
相关问题