Hi,
Can I demonstrate one method of transcoding one of these problem files? Unfortunately it demonstrates the need for:
- A very recent copy of Transcode
- The latest svn MPlayer
- The latest git x264
- The latest svn FFmpeg and a good read of the Fakeoutdoorsman's guide
which is a fair investment of time, effort and learning. The file that I have looked at is here:
Code:
$ wget http://samples.mplayerhq.hu/A-codecs/WMA9/wmapro/WMVHDsplash.wmv
And FFmpeg shows it as:
Code:
Stream #0.0: Audio: 0x0162, 48000 Hz, 5.1, s16, 384 kb/s
Stream #0.1: Video: wmv3, yuv420p, 1280x720, 6500 kb/s, 23.98 tb(r)
which is exactly the audio codec that has been giving all the trouble. Note that for some reason audio and video tracks are reversed. Now as I have mentioned the svn MPlayer can play this audio so it can be extracted as PCM as follows:
Code:
$ transcode -H 0 -i WMVHDsplash.wmv -x null,mplayer -y null,wav -m sound.wav
And then with a bit of tricky remapping by FFmpeg the original video and the extracted sound are both muxed into an mp4 container using h264 for the video and aac for the sound:
Code:
$ ffmpeg -i WMVHDsplash.wmv -i sound.wav -map 0.1 -map 1.0 \
-vcodec libx264 -vpre hq -crf 22 -threads 0 \
-acodec libfaac -ab 128k -ar 44100 -ac 2 \
converted.mp4
This leaves the final file as:
Code:
Stream #0.0(und): Video: h264, yuv420p, 1280x720, 23.98 tb(r)
Stream #0.1(und): Audio: aac, 44100 Hz, stereo, s16
And playable by most modern media players. Note that the Video and Audio streams have been neatly remapped? The original file is 15 megs while the transcoded file is 5 megs and I challenge anybody to tell me it looks and sounds all that different.
So I guess knattlhuber the answer is that it certainly can be done. I am usually accused of making things too complicated but this would be my way of doing it. Can anybody else suggest an 'easier' way of accomplishing this task, perhaps utilising this file from MPlayer just to make it interesting .
All the best,
Andrew
Bookmarks