【问题标题】:avconv - concat .mp4 without quality loss and huge file sizeavconv - concat .mp4 没有质量损失和巨大的文件大小
【发布时间】:2014-12-04 05:44:31
【问题描述】:

我正在测试将 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

然后连接

avconv -i concat:video1.avi\|video2.avi -c copy video.mp4

不幸的是,当原始文件大约 50mb 时,这个新文件超过 1gb。我已尝试调整 qscale,但质量下降太多,仍然无法减小文件大小。

在连接它们之前我应该​​先转换成什么文件类型有什么好的建议吗?我不介意文件大小有点大,但最好不要太大。

谢谢

【问题讨论】:

    标签: video concatenation avconv


    【解决方案1】:

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

    字符串会很简单:

    mkvmerge -o output.mkv file1.mp4 + file2.mp4
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-06
      • 1970-01-01
      • 1970-01-01
      • 2012-02-13
      • 1970-01-01
      • 2021-12-18
      相关资源
      最近更新 更多