I'm trying to downsample a HD video recorded by TVheadend to SD size using the following command:
avconv -i infile.ts -map 0:v -map 0:a:0 -map 0:a:1 -c copy -c:v mpeg2video -r 25 -qscale:v 2 -s:v 720x576 -f mpeg outfile.mpeg
The output of avconv looks good so far:
Input #0, mpegts, from 'infile.ts':
Duration: 02:44:44.69, start: 68943.055278, bitrate: 7408 kb/s
Program 9036
Metadata:
service_provider: upc
Stream #0.0[0x50]: Video: h264 (High), yuv420p, 1280x720 [PAR 1:1 DAR 16:9], 50 fps, 50 tbr, 90k tbn, 100 tbc
Stream #0.1[0x52](eng): Audio: mp2, 48000 Hz, stereo, s16p, 192 kb/s
Stream #0.2[0x5b](ger): Audio: ac3, 48000 Hz, 5.1, fltp, 448 kb/s
No Program
Stream #0.3[0x6e]: Audio: mp1, 0 channels, s16p
[h264 @ 0x1bd9aa0] Ignoring NAL unit 9 during extradata parsing
[mpeg @ 0x1ab4d60] VBV buffer size not set, muxing may fail
Output #0, mpeg, to 'outfile.mpeg':
Metadata:
encoder : Lavf54.20.4
Stream #0.0: Video: mpeg2video, yuv420p, 720x576 [PAR 64:45 DAR 16:9], q=2-31, 200 kb/s, 90k tbn, 25 tbc
Stream #0.1(eng): Audio: mp2, 48000 Hz, stereo, 192 kb/s
Stream #0.2(ger): Audio: ac3, 48000 Hz, 5.1, 448 kb/s
Stream mapping:
Stream #0:0 -> #0:0 (h264 -> mpeg2video)
Stream #0:1 -> #0:1 (copy)
Stream #0:2 -> #0:2 (copy)
Press ctrl-c to stop encoding
And the quality is also good. But when I play it in VLC and try to change the audio channel, I see a increasing list of audio tracks, and only the first one is usable. And also in the Code information I see a list which permanently adds new lines, after a few seconds, I already see 100+ streams of different formats (subtitles, audio of different formats etc):
Does anyone know where's the mistake?
I would say the container format is messed up due to a bug, but it happens in different versions:
I tried using ffmpeg version 2.7.6-0ubuntu0.15.10.1 on ubuntu wily and avconv version 9.18-6:9.18-0ubuntu0.14.04.1 on trusty. on wily, ffmpeg additionally prints Invalid UE golomb code
every ~25 frames
Update:
Here is a short sequence of the input file for testing: infile.ts