video: H264 - MPEG-4 AVC (part 10)(h264)
audio: MPEG AAC Audio (mp4a)
The original TS file is 40 secs and 2.6Mbyte, and plays well in VLC.
I'd like to convert this TS into avi format, without too much loss in video and audio quality.
Test 1
I use the sout module with avi muxer. It produces a 2.0Mbyte avi without any audio stream.
This avi cannot be played with Media Player or other players using DirectShow. Sadly, only VLC can play it. It should be a codec problem.
vlc.exe test.ts -vvv -I dummy --sout=#:std{access=file,mux=avi,dst="test.avi"}
Test 2
I switched to ffmpeg muxer (and I installed the ffdshow-tryouts pack).
It produces a 2.35Mbyte avi, which can be played with Media Player (via ffdshow-tryouts codecs), but there is no audio.
However, VLC shows an MPEG AAC Audio (mp4a) in there, but no audio either.
When I switch to Statistics tab there are only 46 blocks decoded. In the original stream, there are approx. 1600 blocks decoded.
Furthermore, all DirectShow players show the video is 28 minutes long instead of the original 40 secs.
When playing, the first 40 secs video plays well, but then comes 27 minutes void (no video).
I played it through an Audio Grabbing directshow interface, which captures only 12 bytes audio constantly!
To compare, from a normal video, the interface captures an average 500msec long buffer.
Maybe vlc produces a buggy audio stream?
VirtualDub complains about "Variable bitrate audio detected. VBR audio in AVI is non-standard and you may encounter sync errors" Bitrate: 56.5 kbps. However, VirtualDub cannot recompress the audio (no decompressor found).
vlc.exe test.ts -vvv -I dummy --sout=#:std{access=file,mux=ffmpeg,dst="test.avi"}
Test 3
I decided to transcode the audio into mp3, to hear something. I use a very low 32Kbit bitrate for the audio.
But it generates a huge 5.9Mbyte avi, which is almost 2.5x bigger than the original file.
VLC can play the video+audio well, but Media Player plays the video only.
VirtualDub complains about "An invalid nBlockAlign value of zero in the audio stream format".
vlc.exe test.ts -vvv -I dummy --sout=#:transcode{acodec=mp3,ab=32}:std{access=file,mux=ffmpeg,dst="test.avi"}
Test 4
I load the avi into VirtualDub then save it with "Direct Stream Copy" for both audio and video, to keep the
original codecs. The result is a much friendier 2.2Mbyte avi, which can be played in Media Player and VLC well.
So why Test 3 produces such a big file?
My question is, is it possible to convert the TS file into AVI with the following requirements:
- no video recompression (the audio stream may be recompressed)
- the video can be played with a Windows DirectShow player (like Media Player) maybe with an additional codec-pack
- the avi file size is not (considerably) bigger than the original
The 3rd test is promising. Maybe there is an additional command line switch? Or there is an error in VideoLan?
I've checked the 1.1.7 and 1.1.2 versions.