3
1
I am using the version of avconv
in Ubuntu 12.04 to archive videos. I would preferably use some kind of lossless video compression (e.g., huffyuv or FFV1), but using the original video stream (copy codec) would also be acceptable. Unfortunately, with any of these options the output file (mkv containing only the video in whatever format) is much larger than the input file (vob containing video, audio, and subtitles). I could understand if the lossless compression just did a horrible job on my particular video, but I see no reason why using the copy codec would increase file size.
Google turns up one person having this same problem here, but the only response is a useless insult caused by the libav/ffmpeg split.
Is there a reason this should happen, or is this a bug? Is there a workaround or a fix in ffmpeg
, a later version of avconv
, or a different piece of software?
Update: It seems like it may be related to this question at least partially, but that does not explain why it happens when I use a codec of "copy". I still have not tried this with ffmpeg; I plan to do that tonight.
Update 2: Here's the actual command and output, which I said several days ago should be available in a few hours. From this, it seems that the problem is partially but not entirely due to muxing, as generating a raw .m2v file works without issue (and mkvmerge works on that file without issue). Using the flags that the Libav FAQ recommends does not help.
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
Because at least part of the problem seems to be caused by using containers, is there any way to tell avconv to generate raw huffyuv or raw FFv1 files without a container, like specifying a file extension of .m2v does for an MPEG-2 elementary stream?
Can you post the exact command you're using and the full uncut console output? – slhck – 2012-07-26T13:15:01.300
Yes; I'll do this tonight or tomorrow. I'll also post the relevant file sizes. – Daniel H – 2012-07-26T21:03:06.347
I've had unexpected technical difficulties this weekend; I should have the data available within a few hours. – Daniel H – 2012-07-29T17:42:06.493