View Full Version : Muxing RAW .264 with AC3/DTS
KARiJiNi
8th April 2006, 17:07
Ok I have found MeGUI the only way to encode with x264 as the vfw interface was too limited. Now my predicament is that I have many movies encoded by x264 CLI via MeGUI to RAW video files and wish to mux AC3 or DTS sound to produce a working video file.
I would prefer output to AVI as I will be watching these movies on a MCE 2005 machine. I believe MP4 is out as it only supports AAC, don't consider this an option as I wish to retain the original audio quality as is and also my sound output goes straight out to my amplifier as SPDIF.
I have managed AVI with x264 with AC3 or DTS via GordianKnot but was frustrated at the lack of control of x264 encoding options. Likewise I have not used MENCODER for the same reason.
So:
1 - Is it possible?
2 - What programs are required for possible containers (AVI/MKV etc.)?
3 - Would it be possible to extract the 264 stream unaltered from such a container (retaining B frames etc) to mux to a future container or to MP4?
Thanks to anyone that can help... :)
For reference I use the following settings as per MeGUI for an automated 2 pass turbo encode.
x264.exe --pass 2 --bitrate 1300 --stats ".stats" --ref 5 --mixed-refs --bframes 3 --b-pyramid --b-rdo --bime --weightb --filter -2,-2 --subme 7 --trellis 2 --analyse all --8x8dct --ratetol 4.0 --direct auto --me umh --threads 2 --thread-input --sar 16:9 --progress --no-psnr --output "x.264" "x.avs"
shon3i
8th April 2006, 17:20
For mkv you must use mkvmerge included in mkvtoolnix (http://www.bunkus.org/videotools/mkvtoolnix/win32/mkvtoolnix-unicode-1.6.5-setup.exe)package. Use mkv container becouse is safe for avc. I don't recommend you to put x264 into avi for some reason.
Oline 61
8th April 2006, 17:41
DO NOT PUT H264 INTO AVI.
Mux the raw 264 into MP4 via MP4Box.
Then mux the resulting mp4 with the AC3 via mkvmerge.
KARiJiNi
8th April 2006, 17:59
If I did use MKV can I extract the 264 video stream intact as per question 3? Also is anyone aware of how to get MKV files recognised and played back via the MCE 2005 interface?
Otherwise I may still need to mux to AVI for MCE playback (still need a solution for this) and keep the original 264 RAW files for futureproof container.
Oline 61
8th April 2006, 18:07
Yes, you can get the raw 264 stream out of the MKV files. You may have to go through several steps though, I've never tried it.
bond
8th April 2006, 18:31
the media center doesnt allow you to use any container you want?
foxyshadis
8th April 2006, 19:57
The only step you need to extract the raw is using mkvextract (or mkvextractgui). MCE is based on directshow, so as long as you have Haali's it should work. If it doesn't then I could run some tests on someone with MC later on.
Audionut
9th April 2006, 00:41
1. Yes.
2. Mkvtoolnix (http://forum.doom9.org/showthread.php?t=103757) to mux all files into the MKV container. Which supports lots of different formats.
Haali's media splitter (http://haali.cs.msu.ru/mkv/), which will open the MKV file at playback and send the relevant streams (x264,ac3,dts,etc) to the decoders for playback.
3. mkvextractgui (http://corecodec.org/frs/?group_id=55&release_id=141#r141), will as the name suggests, extract the files from the MKV container.
IMHO it's best to encode x264 through megui into the mkv container, and then load that file into mkvtoolnix and add the other relevant files (audio,subs,chapters,etc).
KARiJiNi
9th April 2006, 03:45
Ok so if I use MKV it will meet the requirement of later extracting the 264 and AC3/DTS tracks as were before muxing. Question is does anyone how to get Windows XP Media Center Edition 2005 to recogonise these files?
I will mux a MKV file now and see if renaming it to AVI (it seems MCE 2005 only recognoises AVI & WMV Video) will work. Also using Haali's splitter I presume allows playback in Media Player 10, Media Player Classic, VLC and such like?
Oline 61
9th April 2006, 03:57
You shouldn't have to rename to AVI. It should work fine in MCE if you have Haali installed.
KARiJiNi
9th April 2006, 05:01
*.264 RAW files are not recognoised by mkvmerge GUI v1.6.5 (MKVToolnix). Any more suggestions on muxing RAW 264 & AC3 (or DTS) to MKV container. I will now encode directly to MKV container as it seems that AVI is a lost cause?? Still unable to test under MCE though as I have no muxed MKV files. I'm pretty sure it will not recognise any other than files with an AVI or WMV extension however.
Error is:
File identification failed for 'xxxxx.264'. Return code: 2
Error: File xxxxx.264 has unknown type.
Please have a look at the supported file types ('mkvmerge --list-types') and contact the author Moritz Bunkis <moritz@bunkus.org> if your file type is supported but not recognoized proberly.
C:\Program Files\MKVtoolnix>mkvmerge --list-types
Known file types:
ext description
--- --------------------------
demultiplexers:
aac AAC (Advanced Audio Coding)
ac3 A/52 (aka AC3)
avi AVI (Audio/Video Interleaved)
dts DTS (Digital Theater System)
mp2 MPEG-1 layer II audio (CBR and VBR/ABR)
mp3 MPEG-1 layer III audio (CBR and VBR/ABR)
mkv general Matroska files
ogg audio/video embedded in OGG
mov Quicktime/MP4 audio and video
rm RealMedia audio and video
srt SRT text subtitles
ssa SSA/ASS text subtitles
idx VobSub subtitles
btn VobBtn buttons
wav WAVE (uncompressed PCM)
flac FLAC lossless audio
tta TTA lossless audio
m1v MPEG-1 video elementary stream
m2v MPEG-2 video elementary stream
mpg MPEG program stream
wv WAVPACK lossless audio
output modules:
AAC audio
AC3 audio
DTS audio
FLAC
MP3 audio
simple text subtitles
uncompressed PCM audio
Video (not MPEG1/2)
Vorbis audio
NO 264 RAW! Arghhhh. So any solution for RAW 264 to AVI or MKV still??
Kurtnoise
9th April 2006, 05:21
mux your raw into a mp4 (within MP4Box) then remux this mp4 into a mkv.
foxyshadis
9th April 2006, 06:53
You can compress from x264 directly to mp4 or mkv, you know, which are waaaaaaaaaaaaaay more compatible and future-proof than raw bitstreams ever will be. The only difference is it makes the avi 2-step instead of 1-step, but since mp4 is set to become the "generic avc" container that avi was for asp, it's not that important.
KARiJiNi
9th April 2006, 07:34
C:\x264 Videos>mp4box -convert 1.264 2.mp4
Import failed MP4 File is truncated
C:\x264 Videos>mp4box -add 1.264 2.mp4
Error importing 1.264: MP4 File is truncated
Am I using incorrect parameters????
KARiJiNi
9th April 2006, 07:42
foxyshadis I now realise that RAW is not very well supported. At the time of starting my encoding I was unsure of the final container that I would use. Hence I thought I was covering myself by using RAW 264 output. I have now set all encodes to be MKV containers but still have 20 or more movies in RAW format, such is my predicament.
The disadvantage of MP4 is that it only supports AAC Sound Track (please correct me if I am wrong). This is not what I want as there is no point having a Dolby Digital/DTS Reciever and then using a down converted 2 channel sound stream (as 5.1 AAC is not supported via SPDIF) for a surround sound HiFi.
I am unsure what you imply by "The only difference is it makes the avi 2-step instead of 1-step"
Cheers to all whom have replied so far. I am determined to find a way!
Audionut
9th April 2006, 07:55
Use Yamb (http://forum.doom9.org/showthread.php?t=93927&highlight=yamb) to mux the raw files to mp4.
foxyshadis
9th April 2006, 08:06
Yeah, mp4 is destined to be the defacto portable standard at this point, but mkv certainly has a big place.
As for mp4box, the second is the correct syntax! Something's weird if it can't read it. Mmm, maybe you have one of the bad compiles, gpac is a very unstable package and changes around a lot. Try seeing if you can find a very recent compile.
Actually, I thought there was a raw to avi tool, but maybe not.
Kurtnoise
9th April 2006, 08:07
[edit]uuups...sorry.
try with MP4Box from here : http://kurtnoise.free.fr/mp4tools/
MP4Box -add input.264 output.mp4
KARiJiNi
9th April 2006, 14:11
Thanks for the MP4BOX link. That has fixed my problem with conversion to MP4. I must have had an old compile of MP4Box as it has 600K as opposed to 1600K+ from the link provided.
Am now in the process of converting 264 RAW -> MP4 (via YAMB/MP4BOX) -> MKV (via MKVMerge) with AC3 or DTS audio
Yipeee!!!! Thanks for all your help guys. Have tested under Windows XP Pro and will test on the MCE 2005 box tomorrow.
btw Media Player would not open MKV extension files so there is no hope that MCE will without some modification (anybody have any clues?) but I renamed the MKV to AVI and off we went. Worked perfect. Haali Media Splitter is doing a fine job. This may be a solution with MCE, although not very neat.
KARiJiNi
16th April 2006, 15:10
Ok Ladies & Gentlemen have now successfully muxed H.264 (x264) with DTS or AC3 audio tracks to an MKV container. To get these showing successfully working within Microsoft Windows Media Center 2005 (MCE 2005) simply rename the final MKV file with an AVI extension and place in the My Videos folder. You will need ffdshow & Hali Media Splitter installed for these to play correctly.
For those of you like me, whom encode the full 720x576 DVD stream (cropped & resized where need be) will enjoy great DVD quality at your finger tips whenever you want, no need to DVDs no more! Also whether you run a widescreen 16:9 CRT (like me) or a 16:9 LCD/Plasma nVidia Decoder will display it at the correct aspect ratio. May sound simple but believe me when your graphics card refuses to output full screen at any 16:9 aspect ratios, you will find this a god send.
Will post this else where in a more appropriate forum for those wanting to do what I have for ages.
Hans Ohlo
17th April 2006, 09:51
the correct way to get MCE to recognize mkv (or any other container) is the following:
1. open regedit
2. add a new key to HKEY_CLASSES_ROOT named .mkv
3. add stringvalues:
Content Type 'video/mkv'
PerceivedType 'video'
(you can look how it has to be in other video file keys like .mp4 or .avi)
attention for the spelling and spaces used or not used in the string value names.
now MCE should recognize mkv files and if you have the splitter in place you are good to go ;)
HTH
foxyshadis
17th April 2006, 12:56
Hey, nice info. For the lazy among you, put this in a .reg file or just download it (http://foxyshadis.slightlydark.com/random/mkv.reg):
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\.mkv]
"PerceivedType"="video"
"Content Type"="video/mkv"
Note: This will not wipe out your mkv association, I took that part out. :p
leiming2006
18th April 2006, 06:38
mp4creator -c raw.264 -rate 29.97 -timescale=29970 output.mp4
Golgot13
18th April 2006, 08:51
The best, to raw *.264 and AC3/DTS in same stream, is MPEG2 transport stream.
The HD european channel which use H264 can lot of time with AC3 (5.1 Dolby Didgital E).
But I know only one software to encode and mux in *.ts stream : H264 Encode PC Offline from Ateme.
It use passtrough function for audio stream in AC3.
Golgot13
Membership of HD DVD
GodofaGap
18th April 2006, 09:04
Using a transport stream for local storage (and certainly this kind of usage) is quite superfluous. Matroska will do fine.
Golgot13
18th April 2006, 09:34
But *.ts is compatible with lot of harware chipset (Sigma design, Broadcom,...) and mkv is not.
foxyshadis
18th April 2006, 10:17
ts is compatible, but the codec isn't. No settop on the market will play avc no matter what you mux it into yet, and likely no existing one ever will (they simply don't have the power to decode next-gen formats, like avc and wmv9).
GodofaGap
18th April 2006, 12:01
What does Windows MCE 2005 have to do with hardware chipsets? I'm not saying .ts is bad, but in this case using a transport stream is absolutely not necessary and will only make things more complicated.
Doom9
18th April 2006, 12:40
No settop on the market will play avc no matter what you mux it into yetActually, the first boxes that do DVB-S2 and AVC are already on the market.
foxyshadis
18th April 2006, 13:11
Really? =o Must be a recent development. I have to read up, because I want one!
MrWizard
19th April 2006, 00:20
Yeah, they're out there. I have one at work!
Golgot13
20th April 2006, 22:03
ts is compatible, but the codec isn't. No settop on the market will play avc no matter what you mux it into yet, and likely no existing one ever will (they simply don't have the power to decode next-gen formats, like avc and wmv9).
You need to wait 2 months, when the first setup box with SMP8634 will be available on market.
In France, the ISP "Free" will use this chipset on them setup box "Freebox HD" : H264 with AC3 possible on *.ts
are support and it can play MP4 container (AC3, AAC are decode by the setup box).
Maybe H264 with DTS in *.ts is compatible.
Golgot13
Golgot13
20th April 2006, 22:08
Actually, the first boxes that do DVB-S2 and AVC are already on the market.
On european market, we use for DVB-S and DVB-S2 AVC/H264 in High Profil :D :D
With High Profil, to my mind we can wait 2 years to have HD channel at 5 Mbps (maybe, I hope, at 4Mps) :D
woah!
21st April 2006, 05:15
i find using cli x264 to .264 raw and then use sharktooths avc2avi gui to avi. then i mux the ac3 to the avi file using vdubmod gives me a working file which plays in all my installed players.. even winamp which wont play the .264 file when muxed to mp4.
probably a right abortion and i will get crucified for doing this i suppose heh..
KARiJiNi
25th April 2006, 11:38
Thanks to foxyshadis & Hans Ohlo for the MKV MCE 2005 recognition. The MKV files work a treat. Recognised just like AVI's with a thumbnail. Will now have to try and add other video extensions such as MOV & DIVX etc.
Wonder if you can get MCE 2005 to recognise Monkey's Audio APE loseless audio compression files under My Music?
multicone
25th April 2006, 16:28
ChristianHJW just wrote on the #matroska IRC channel :
<ChrisHJW> http://forum.doom9.org/showthread.php?t=109746&page=2 <----- Hmmmm .... we have to host this REG on our Windows downloads page ! This is great !
<ChrisHJW> Can anybody ask there, if somebody would care to make a short Guide with screenshots even ?
<ChrisHJW> We gladly host them on matroska.org
<ChrisHJW> actually, we get a number of problem reports with MCE and its inability to play MKV out-of-the-box
Somebody has time to make short Guide for matroska.org ?
Hans Ohlo
25th April 2006, 16:46
Wonder if you can get MCE 2005 to recognise Monkey's Audio APE loseless audio compression files under My Music?it's all the same, i did it for m4a (see below). you then only have to make sure that a correct dshow splitter and decoder is installed. for m4a i needed also this WMP plugin (http://www.softpointer.com/WMPTagSupport.htm) which enabled WMP to read the ID3 tags of of m4a files...
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\.m4a]
"Content Type"="audio/m4a"
"Perceived Type"="audio"
glad that i could be of any help here ;)
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.