Avconv 增加文件大小

Avconv 增加文件大小

我使用 Ubuntu 12.04 中的版本avconv来存档视频。我最好使用某种无损视频压缩(例如 huffyuv 或 FFV1),但使用原始视频流(复制编解码器)也是可以接受的。不幸的是,使用任何这些选项,输出文件(仅包含任何格式的视频的 mkv)都比输入文件(包含视频、音频和字幕的 vob)大得多。我可以理解无损压缩对我的特定视频的处理效果很糟糕,但我看不出使用复制编解码器会增加文件大小的理由。

谷歌搜索发现有一个人遇到了同样的问题这里,但唯一的回应是因 libav/ffmpeg 分裂而产生的无用侮辱。

发生这种情况有什么原因吗?还是这是一个错误? 是否有解决方法或修复方法ffmpeg? 是否有更高版本的avconv? 或其他软件?

更新:这似乎可能与这个问题至少部分如此,但这并不能解释为什么当我使用“复制”编解码器时会发生这种情况。我还没有用 ffmpeg 尝试过;我打算今晚试试。

更新 2:这是我几天前说过的实际命令和输出,应该在几个小时内可用。由此看来,问题似乎部分但并非完全是由于多路复用,因为生成原始 .m2v 文件没有问题(并且 mkvmerge 可以毫无问题地处理该文件)。使用Libav 常见问题解答建议没有帮助。

Thu 2 Aug 2012 13:58:51 MDT pts/3 (100x27) [daniel@daniel-laptop-ubuntu:~/Videos]
1 $ ls
total 1774448
drwxrwxr-x 2 daniel daniel       4096 Jul 28 20:24 keep/
-rw-rw-r-- 1 daniel daniel          0 Aug  2 13:58 timings
-rw-rw-r-- 1 daniel daniel 1816995840 Aug  2 12:34 Title.vob
-rw-rw-r-- 1 daniel daniel          0 Aug  2 13:58 typescript
Exit Code: 0

Thu 2 Aug 2012 13:58:52 MDT pts/3 (100x27) [daniel@daniel-laptop-ubuntu:~/Videos]
2 $ avprobe -v verbose Title.vob 
avprobe version 0.8.3-4:0.8.3-0ubuntu0.12.04.1, Copyright (c) 2007-2012 the Libav developers
  built on Jun 12 2012 16:52:09 with gcc 4.6.3
  configuration: --extra-version='4:0.8.3-0ubuntu0.12.04.1' --arch=amd64 --prefix=/usr --libdir=/usr/lib/x86_64-linux-gnu --enable-vdpau --enable-bzlib --enable-libgsm --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-pthreads --enable-zlib --enable-libvpx --enable-runtime-cpudetect --enable-libfreetype --enable-vaapi --enable-gpl --enable-postproc --enable-swscale --enable-x11grab --enable-libdc1394 --shlibdir=/usr/lib/x86_64-linux-gnu --enable-shared --disable-static
  libavutil    51. 22. 1 / 51. 22. 1
  libavcodec   53. 35. 0 / 53. 35. 0
  libavformat  53. 21. 0 / 53. 21. 0
  libavdevice  53.  2. 0 / 53.  2. 0
  libavfilter   2. 15. 0 /  2. 15. 0
  libswscale    2.  1. 0 /  2.  1. 0
  libpostproc  52.  0. 0 / 52.  0. 0
[mpeg @ 0xd4a7a0] max_analyze_duration reached
Input #0, mpeg, from 'Title.vob':
  Duration: 00:43:35.39, start: 0.195633, bitrate: 5557 kb/s
    Stream #0.0[0x1e0]: Video: mpeg2video (Main), yuv420p, 720x480 [PAR 32:27 DAR 16:9], 9800 kb/s, 23.98 fps, 59.94 tbr, 90k tbn, 59.94 tbc
    Stream #0.1[0x20]: Subtitle: dvdsub
    Stream #0.2[0x21]: Subtitle: dvdsub
    Stream #0.3[0x22]: Subtitle: dvdsub
    Stream #0.4[0x23]: Subtitle: dvdsub
    Stream #0.5[0x24]: Subtitle: dvdsub
    Stream #0.6[0x25]: Subtitle: dvdsub
    Stream #0.7[0x80]: Audio: ac3, 48000 Hz, 5.1, s16, 448 kb/s
    Stream #0.8[0x81]: Audio: ac3, 48000 Hz, stereo, s16, 192 kb/s
    Stream #0.9[0x82]: Audio: ac3, 48000 Hz, stereo, s16, 192 kb/s (comment)
    Stream #0.10[0x83]: Audio: ac3, 48000 Hz, stereo, s16, 192 kb/s
Exit Code: 0

Thu 2 Aug 2012 13:58:58 MDT pts/3 (100x27) [daniel@daniel-laptop-ubuntu:~/Videos]
3 $ avconv -v verbose -i Title.vob -c:v copy -map 0:v:0 Title.m2v
avconv version 0.8.3-4:0.8.3-0ubuntu0.12.04.1, Copyright (c) 2000-2012 the Libav developers
  built on Jun 12 2012 16:52:09 with gcc 4.6.3
  configuration: --extra-version='4:0.8.3-0ubuntu0.12.04.1' --arch=amd64 --prefix=/usr --libdir=/usr/lib/x86_64-linux-gnu --enable-vdpau --enable-bzlib --enable-libgsm --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-pthreads --enable-zlib --enable-libvpx --enable-runtime-cpudetect --enable-libfreetype --enable-vaapi --enable-gpl --enable-postproc --enable-swscale --enable-x11grab --enable-libdc1394 --shlibdir=/usr/lib/x86_64-linux-gnu --enable-shared --disable-static
  libavutil    51. 22. 1 / 51. 22. 1
  libavcodec   53. 35. 0 / 53. 35. 0
  libavformat  53. 21. 0 / 53. 21. 0
  libavdevice  53.  2. 0 / 53.  2. 0
  libavfilter   2. 15. 0 /  2. 15. 0
  libswscale    2.  1. 0 /  2.  1. 0
  libpostproc  52.  0. 0 / 52.  0. 0
[mpeg @ 0x1ab77a0] max_analyze_duration reached
Input #0, mpeg, from 'Title.vob':
  Duration: 00:43:35.39, start: 0.195633, bitrate: 5557 kb/s
    Stream #0.0[0x1e0]: Video: mpeg2video (Main), yuv420p, 720x480 [PAR 32:27 DAR 16:9], 9800 kb/s, 23.98 fps, 59.94 tbr, 90k tbn, 59.94 tbc
    Stream #0.1[0x20]: Subtitle: dvdsub
    Stream #0.2[0x21]: Subtitle: dvdsub
    Stream #0.3[0x22]: Subtitle: dvdsub
    Stream #0.4[0x23]: Subtitle: dvdsub
    Stream #0.5[0x24]: Subtitle: dvdsub
    Stream #0.6[0x25]: Subtitle: dvdsub
    Stream #0.7[0x80]: Audio: ac3, 48000 Hz, 5.1, s16, 448 kb/s
    Stream #0.8[0x81]: Audio: ac3, 48000 Hz, stereo, s16, 192 kb/s
    Stream #0.9[0x82]: Audio: ac3, 48000 Hz, stereo, s16, 192 kb/s (comment)
    Stream #0.10[0x83]: Audio: ac3, 48000 Hz, stereo, s16, 192 kb/s
Output #0, mpeg2video, to 'Title.m2v':
  Metadata:
    encoder         : Lavf53.21.0
    Stream #0.0: Video: mpeg2video, yuv420p, 720x480 [PAR 32:27 DAR 16:9], q=2-31, 9800 kb/s, 90k tbn, 90k tbc
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
Press ctrl-c to stop encoding
frame=62709 fps=4237 q=-1.0 Lsize= 1402285kB time=2615.30 bitrate=4392.4kbits/s    
video:1402285kB audio:0kB global headers:0kB muxing overhead 0.000000%
Exit Code: 0

Thu 2 Aug 2012 13:59:45 MDT pts/3 (100x27) [daniel@daniel-laptop-ubuntu:~/Videos]
4 $ avconv -v verbose -i Title.vob -c:v copy -map 0:v:0 Title.avi
avconv version 0.8.3-4:0.8.3-0ubuntu0.12.04.1, Copyright (c) 2000-2012 the Libav developers
  built on Jun 12 2012 16:52:09 with gcc 4.6.3
  configuration: --extra-version='4:0.8.3-0ubuntu0.12.04.1' --arch=amd64 --prefix=/usr --libdir=/usr/lib/x86_64-linux-gnu --enable-vdpau --enable-bzlib --enable-libgsm --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-pthreads --enable-zlib --enable-libvpx --enable-runtime-cpudetect --enable-libfreetype --enable-vaapi --enable-gpl --enable-postproc --enable-swscale --enable-x11grab --enable-libdc1394 --shlibdir=/usr/lib/x86_64-linux-gnu --enable-shared --disable-static
  libavutil    51. 22. 1 / 51. 22. 1
  libavcodec   53. 35. 0 / 53. 35. 0
  libavformat  53. 21. 0 / 53. 21. 0
  libavdevice  53.  2. 0 / 53.  2. 0
  libavfilter   2. 15. 0 /  2. 15. 0
  libswscale    2.  1. 0 /  2.  1. 0
  libpostproc  52.  0. 0 / 52.  0. 0
[mpeg @ 0xdec7a0] max_analyze_duration reached
Input #0, mpeg, from 'Title.vob':
  Duration: 00:43:35.39, start: 0.195633, bitrate: 5557 kb/s
    Stream #0.0[0x1e0]: Video: mpeg2video (Main), yuv420p, 720x480 [PAR 32:27 DAR 16:9], 9800 kb/s, 23.98 fps, 59.94 tbr, 90k tbn, 59.94 tbc
    Stream #0.1[0x20]: Subtitle: dvdsub
    Stream #0.2[0x21]: Subtitle: dvdsub
    Stream #0.3[0x22]: Subtitle: dvdsub
    Stream #0.4[0x23]: Subtitle: dvdsub
    Stream #0.5[0x24]: Subtitle: dvdsub
    Stream #0.6[0x25]: Subtitle: dvdsub
    Stream #0.7[0x80]: Audio: ac3, 48000 Hz, 5.1, s16, 448 kb/s
    Stream #0.8[0x81]: Audio: ac3, 48000 Hz, stereo, s16, 192 kb/s
    Stream #0.9[0x82]: Audio: ac3, 48000 Hz, stereo, s16, 192 kb/s (comment)
    Stream #0.10[0x83]: Audio: ac3, 48000 Hz, stereo, s16, 192 kb/s
Output #0, avi, to 'Title.avi':
  Metadata:
    ISFT            : Lavf53.21.0
    Stream #0.0: Video: mpeg2video, yuv420p, 720x480 [PAR 32:27 DAR 16:9], q=2-31, 9800 kb/s, 90k tbn, 90k tbc
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
Press ctrl-c to stop encoding
frame=62709 fps=186 q=-1.0 Lsize= 6271354kB time=2615.30 bitrate=19644.0kbits/s    
video:1402285kB audio:0kB global headers:0kB muxing overhead 347.223994%
Exit Code: 0

Thu 2 Aug 2012 14:05:24 MDT pts/3 (100x27) [daniel@daniel-laptop-ubuntu:~/Videos]
5 $ avconv -v verbose -i Title.vob -c:v copy -map 0:v:0 Title.mkv
avconv version 0.8.3-4:0.8.3-0ubuntu0.12.04.1, Copyright (c) 2000-2012 the Libav developers
  built on Jun 12 2012 16:52:09 with gcc 4.6.3
  configuration: --extra-version='4:0.8.3-0ubuntu0.12.04.1' --arch=amd64 --prefix=/usr --libdir=/usr/lib/x86_64-linux-gnu --enable-vdpau --enable-bzlib --enable-libgsm --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-pthreads --enable-zlib --enable-libvpx --enable-runtime-cpudetect --enable-libfreetype --enable-vaapi --enable-gpl --enable-postproc --enable-swscale --enable-x11grab --enable-libdc1394 --shlibdir=/usr/lib/x86_64-linux-gnu --enable-shared --disable-static
  libavutil    51. 22. 1 / 51. 22. 1
  libavcodec   53. 35. 0 / 53. 35. 0
  libavformat  53. 21. 0 / 53. 21. 0
  libavdevice  53.  2. 0 / 53.  2. 0
  libavfilter   2. 15. 0 /  2. 15. 0
  libswscale    2.  1. 0 /  2.  1. 0
  libpostproc  52.  0. 0 / 52.  0. 0
[mpeg @ 0xc0d7a0] max_analyze_duration reached
Input #0, mpeg, from 'Title.vob':
  Duration: 00:43:35.39, start: 0.195633, bitrate: 5557 kb/s
    Stream #0.0[0x1e0]: Video: mpeg2video (Main), yuv420p, 720x480 [PAR 32:27 DAR 16:9], 9800 kb/s, 23.98 fps, 59.94 tbr, 90k tbn, 59.94 tbc
    Stream #0.1[0x20]: Subtitle: dvdsub
    Stream #0.2[0x21]: Subtitle: dvdsub
    Stream #0.3[0x22]: Subtitle: dvdsub
    Stream #0.4[0x23]: Subtitle: dvdsub
    Stream #0.5[0x24]: Subtitle: dvdsub
    Stream #0.6[0x25]: Subtitle: dvdsub
    Stream #0.7[0x80]: Audio: ac3, 48000 Hz, 5.1, s16, 448 kb/s
    Stream #0.8[0x81]: Audio: ac3, 48000 Hz, stereo, s16, 192 kb/s
    Stream #0.9[0x82]: Audio: ac3, 48000 Hz, stereo, s16, 192 kb/s (comment)
    Stream #0.10[0x83]: Audio: ac3, 48000 Hz, stereo, s16, 192 kb/s
Output #0, matroska, to 'Title.mkv':
  Metadata:
    encoder         : Lavf53.21.0
    Stream #0.0: Video: mpeg2video, yuv420p, 720x480 [PAR 32:27 DAR 16:9], q=2-31, 9800 kb/s, 1k tbn, 90k tbc
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
Press ctrl-c to stop encoding
[matroska @ 0xc30900] Can't write packet with unknown timestamp
av_interleaved_write_frame(): Invalid argument
Exit Code: 1

Thu 2 Aug 2012 14:05:31 MDT pts/3 (100x27) [daniel@daniel-laptop-ubuntu:~/Videos]
6 $ ls
total 9448208
drwxrwxr-x 2 daniel daniel       4096 Jul 28 20:24 keep/
-rw-rw-r-- 1 daniel daniel      16384 Aug  2 14:05 timings
-rw-rw-r-- 1 daniel daniel 6421866918 Aug  2 14:05 Title.avi
-rw-rw-r-- 1 daniel daniel 1435939709 Aug  2 13:59 Title.m2v
-rw-rw-r-- 1 daniel daniel        680 Aug  2 14:05 Title.mkv
-rw-rw-r-- 1 daniel daniel 1816995840 Aug  2 12:34 Title.vob
-rw-rw-r-- 1 daniel daniel      69632 Aug  2 14:05 typescript
Exit Code: 0

因为至少部分问题似乎是由使用容器引起的,有什么方法可以告诉 avconv 在没有容器的情况下生成原始 huffyuv 或原始 FFv1 文件,就像为 MPEG-2 基本流指定 .m2v 文件扩展名一样?

相关内容