View Full Version : Mux Xvid with DTS
MattO
24th April 2008, 10:23
Using only linux (LinuxMint), I am converting my collection to xvid, this is what I have been doing:
1] Extract AC3 or DTS audio using mplayer via a nautilus script.
2] Convert video to Xvid using mencoder via a nautilus script.
3] Mux Xvid AVI with AC3 using AVIDemux.
And the resulting file plays back fine.
But my problem is, if available, I would like to retain DTS audio, but AVIDemux does not support adding a DTS audio file in the same way you can add a AC3 file, so I do not think I can mux them together using AVIDemux, or can I?
Or, is there another linux method to mux together the Xvid video with the DTS audio?
When searching for answers to this problem I only found Windows answers; do it with AVIMuxGUI; but I was hoping/thinking there should be a easy linux method as well, is there?
Thanks for any help
M7S
24th April 2008, 22:01
MKVtoolnix can mux Xvid and DTS but the container will then of course be mkv instead of avi.
Using only linux (LinuxMint), I am converting my collection to xvid, this is what I have been doing:
1] Extract AC3 or DTS audio using mplayer via a nautilus script.
2] Convert video to Xvid using mencoder via a nautilus script.
3] Mux Xvid AVI with AC3 using AVIDemux.
And the resulting file plays back fine.
Why not mux the audio in at the same time when you encode video with MEncoder (use -oac copy in the final encoding pass)? You can use the same audio track selection options as with MPlayer. Or do you want to combine audio and video tracks from different source files?
MattO
25th April 2008, 09:17
:thanks: for the replies, guys
M7S,
Would it being a MKV instead of a AVI be a problem?
Could I just rename the MKV to AVI?
Would most players still be able to play the resulting file?
Would there be any sync issues?
nm,
Audio is from the same source.
I thought I had read that muxing it at encode time can cause sync issues, do you know how true that is?
Would it being a MKV instead of a AVI be a problem?
Depends on your playback device.
Could I just rename the MKV to AVI?
That would just cause trouble.
Would most players still be able to play the resulting file?
Software players yes, but not so many hardware players support Matroska (yet).
Would there be any sync issues?
Not more than with AVI. Of course it's possible to ruin the sync in many ways when muxing, but the same applies to any container.
I thought I had read that muxing it at encode time can cause sync issues, do you know how true that is?
I'd say that the opposite is true more often (muxing separately is harder to do right). If there are problems when encoding with audio, MEncoder has many options (like -noskip, -mc and -vf harddup) to tune its A/V sync method (http://www.mplayerhq.hu/DOCS/HTML/en/menc-feat-dvd-mpeg4.html#menc-feat-dvd-mpeg4-av-sync).
MattO
26th April 2008, 11:13
Thanks, I tried your suggestion but I am having problems:
This is the script I have been using to extract AC3:
#!/bin/bash
gnome-terminal --title=Extracting_AC3... --hide-menubar --full-screen -x mplayer $1 -aid 0 -dumpaudio -dumpfile $1.ac3
And this script to encode video only:
#!/bin/bash
gnome-terminal --title=Encoding_Xvid... --hide-menubar --full-screen -x mencoder $1 -nosound -noskip -mc 0 -vf scale=960:528 -ovc xvid -xvidencopts bitrate=1800 -o $1.avi
I modified it to mux the audio whilst encoding the video but it keeps crashing out after a minute or so, this is the nautilus script I tried:
#!/bin/bash
gnome-terminal --title=Encoding_Xvid... --hide-menubar --full-screen -x mencoder $1 -oac copy -noskip -mc 0 -vf scale=960:528 -ovc xvid -xvidencopts bitrate=1800 -o $1.avi
Does anyone know what I am doing wrong here?
That looks ok, except that you could also try setting the audio track with -aid, like you did in the first script. If it still doesn't work, run the command manually and copy the complete output here so that we can see what goes wrong.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.