avconv-concat .mp4,没有质量损失和巨大的文件大小 [英] avconv - concat .mp4 without quality loss and huge file size

查看:112
本文介绍了avconv-concat .mp4,没有质量损失和巨大的文件大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在测试一起压缩mp4文件,并且遇到了一种可行的方法,该方法虽然有效,但正在创建巨大的文件。

I am testing out concating mp4 files together and have come across one way to do it that is working but is creating huge file sizes.

我的原始视频是mp4,在按照其他指南进行操作后,我开始尝试将其转换为mpeg,但是发现mpeg不会转换,因为我的文件为1fps,而mpeg却没有

my original videos are mp4 and I started out trying to convert them to mpeg after following other guides but found that mpeg would not convert as my file is 1fps and mpeg does not support that.

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,但这仍然行不通。

I read a suggestion to add -r 23.967 for the framerate but that still does not work.

然后我发现可以将文件转换为.avi并成功合并它们。

I then found that I could convert the files to .avi and concat them successfully.

转换为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,但是我失去了太多的质量,但是仍然无法减小文件的大小。

Unfortunately this new file is over 1gb when the original is about 50mb. I have tried adjusting the qscale but I just lose too much quality and still can't get the file size down.

对于应该使用哪种文件类型有很好的建议在转换之前先转换为第一个?我不介意文件大一点,但最好不要太大。

is there a good suggestion on what file type I should be converting to first before I can concat them? I don't mind the file size being a bit bigger, but preferably not too much.

谢谢

推荐答案

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

If you don't mind changing the format of the file you can turn them into a single Matroska file by using mkvmerge tool.

字符串将非常简单:

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

这篇关于avconv-concat .mp4,没有质量损失和巨大的文件大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆