Log in

View Full Version : Muxing WMV/WMA encoded content


RulerOf
16th March 2007, 16:12
Hello all.

I'm currently working on compressing some of my HD-DVD and BD backups to WMV9 advanced, and the process has taken a pretty weird trail. Thanks to the new Haali splitter, I've been able to use Graphedit to reliably render the streams out of the BD backup of X3, and I used AVISynth, virtualdub, and graphedit to export the video to raw AVI (the file is fscking HUGE) and a 6 channel AC3 file.

I'm currently converting the video to WVC1 using Windows Media Encoder with the VBR Peak setting, and once its done I'll have a video only WMV that is (hopefully) an appropriate size, and then I plan to convert the AC3 file to 6 channel WMA using WME to end up with a WMA.

Now, aside from methods to improve my (probably) weird way of going about this encode, how do i mux the finished WMA and WMV into a single container? I couldn't find an option for it in the encoder app. Can I mux it into a matroska container? Is there another app or setting that I'm unaware of?

Any help would be appreciated.. also, if anyone knows of any guides that might be available on converting to WMV advanced, would you be able to point me in that direction? Also, is there a "Target file size" option for encoding? I've kinda guessed at the appropriate bitrates, and I have a feeling it's gonna bite me in the ass :P

Thanks.

protovision
16th March 2007, 22:47
in Graphedit, try the ASF writer filter.

When I wanted to convert a h.264/AC3 .ts to WMV-HD, I ended up repacking the .ts into a .mkv in graphedit, and then fed the .mkv into WMEncoder, Constant Q=95. I couldn't get 2-pass to work correctly, probably a filter issue.

p.

zambelli
16th March 2007, 22:54
Now, aside from methods to improve my (probably) weird way of going about this encode, how do i mux the finished WMA and WMV into a single container? I couldn't find an option for it in the encoder app. Can I mux it into a matroska container? Is there another app or setting that I'm unaware of?
There's an app called WM Stream Editor that comes with WME9. It'll let you mux WM video and audio streams to a single file.

If you want to mux to Matroska, Haali's Media filters will let you do that easily from GraphEdit.

tchaikovsky
17th March 2007, 06:36
Now, aside from methods to improve my (probably) weird way of going about this encode, how do i mux the finished WMA and WMV into a single container? I couldn't find an option for it in the encoder app. Can I mux it into a matroska container? Is there another app or setting that I'm unaware of?


Yeah, WM Stream Editor can do that for you.

[/QUOTE]
Any help would be appreciated.. also, if anyone knows of any guides that might be available on converting to WMV advanced, would you be able to point me in that direction? Also, is there a "Target file size" option for encoding? I've kinda guessed at the appropriate bitrates, and I have a feeling it's gonna bite me in the ass :P
[/QUOTE]

"Target file size" option ?Good idea :rolleyes:

Edit: P.S. WMEA can load separate sources and encode them in batch.

RulerOf
17th March 2007, 09:15
If you want to mux to Matroska, Haali's Media filters will let you do that easily from GraphEdit.


Thanks for that tip about the Stream Editor. I probably woulda torn my hair out for hours on that one.

The reason I asked about the matroska container was because I have this little program called MKVMerge which I'm sure you're familiar with, and it seemed like it'd be fairly easy to use. I personally like the matroska container, but I was curious to see if there were any advantages/disadvantages to using it over muxing to WMV. My gut tells me to use the stream editor though.

WME threw some errors at me during configuration when I tried to use a second source (the AC3 file), so that's why I'm encoding separately.

Thanks tons for the help. I'm 18 hours into this encode, 36% of the second pass right now, and the end is nowhere in sight. Another question though, as I'm looking at the output video, it is different from the input video. Fumbling with the overlay settings, which are only applied to the input video, required me to drop the brightness and raise the contrast (which were at 100%) to even them out. Is this normal? Is it a setting? Is it a decoder setting that I shouldn't worry about?

Thanks again.

Also, am I allowed to post a short clip or screenshot on here to show what I mean? I ask in advance cause I'm not sure if it violates the rules.

diogen
17th March 2007, 18:13
WME threw some errors at me during configuration when I tried to use a second source (the AC3 file), so that's why I'm encoding separately.What AC3 decoder do you use?
You shouldn't have problems with AC3Filter.
Thanks tons for the help. I'm 18 hours into this encode, 36% of the second pass right now, and the end is nowhere in sight. Another question though, as I'm looking at the output video, it is different from the input video. Fumbling with the overlay settings, which are only applied to the input video, required me to drop the brightness and raise the contrast (which were at 100%) to even them out.Have a look here (http://forum.doom9.org/showthread.php?t=123202).

Diogen.

lineman
17th March 2007, 19:54
There's an app called WM Stream Editor that comes with WME9. It'll let you mux WM video and audio streams to a single file.

If you want to mux to Matroska, Haali's Media filters will let you do that easily from GraphEdit.

Can stream editor mux a .wma and a.wmv file? I cant seem to get it too work

RulerOf
17th March 2007, 21:36
What AC3 decoder do you use?
You shouldn't have problems with AC3Filter.
Diogen.

I'm actually using AC3Filter and I can't remember exactly what the error was, but it wouldn't let me configure certain options because I was using "multiple sources," and because of that, I decided to remove the audio file because I wasn't exactly sure how it would turn out. This is my first real encode with WME, and I didn't want to botch what is now 30+ (and still running) hours of encoding time.

I read that thread that you linked me to, but it's talking about quality issues in dark scenes. My issue is that all the scenes are encoding wonderfully, but the problem is that the video appears lighter and a little less... polished. Specifically, the contrast is increased by about 20% and the brightness reduced by about the same (fiddling with my overlay settings and comparing to the source video revealed this). I'm sure that by adjusting my overlay upon watching the video, I could come up with the same image, but do you know why this would happen? Is it some kind of color space conversion or something?

Thanks for the help again.

zambelli
18th March 2007, 00:33
Can stream editor mux a .wma and a.wmv file? I cant seem to get it too work
That's exactly what it's for. You load all necessary sources and then you expand the branches and pick the deepest level checkbox for each stream you want to mux. Then you create a new audience, pick an output file - and mux.

zambelli
18th March 2007, 00:41
Specifically, the contrast is increased by about 20% and the brightness reduced by about the same (fiddling with my overlay settings and comparing to the source video revealed this). I'm sure that by adjusting my overlay upon watching the video, I could come up with the same image, but do you know why this would happen? Is it some kind of color space conversion or something?
If you are using YUV video as a source, it's unlikely any kind of luma remapping is happening in the decoder because WMV uses a YUV 4:2:0 colorspace - and luma typically only gets remapped when converting RGB to YUV and back.

This is most likely a decoder issue. Different codecs deal with conversion to RGB (which is always the final format on the display level) differently. Your source format codec might convert YUV to RGB itself by mapping 16..235 to 0..255 (PC levels). WMV decoder, on the other hand, passes YV12 or NV12 video straight to the renderer. If the renderer uses TV levels, then 16..235 gets mapped to 16..235 - and you end up with washed out looking video.

That behavior is not technically wrong because some scenarios do require TV levels (i.e. output to a video calibrated display), but it's somewhat incosistent because some renderers and video drivers act differently than others.

RulerOf
19th March 2007, 03:08
Zambelli, you are incredibly well informed. My hat is off to you.

32 hours later (FFS!), the 2 pass video encode is finally finished. My issues with the output video appearing washed out in WME during the encoding process are gone now, probably because this time the output video is coming through the video overlay when i play it now. And let me tell you, weighing in just a few megs shy of 6 gigs this converted video is almost identical compared to the original.

I truly think this is novel. I have taken full high definition progressive scan content that was originally distributed on a next-gen storage format cause it's so damned huge, and with virtually no quality loss, it'll fit on a DVD9 with room to spare.

I mean, several years ago I thought DivX was amazing because it could put a feature length film onto a CD with good quality, but being an honest videophile, 700 meg DVD rips look awful. VC-1 allows Blu-Ray and HD-DVD to be compressed by a similar factor (this film comes out at about 1/3 of original size) with virtually no quality loss. I seriously look forward to what is to come. This has been one hell of an experience so far, and your guys' help has been fantastic.

Now it's time to force feed WME some AC3 audio, which it doesn't seem to like... I think I'll be tooling around with that VBScript for a little while.

Thanks again everyone.

zambelli
19th March 2007, 07:57
I mean, several years ago I thought DivX was amazing because it could put a feature length film onto a CD with good quality, but being an honest videophile, 700 meg DVD rips look awful. VC-1 allows Blu-Ray and HD-DVD to be compressed by a similar factor (this film comes out at about 1/3 of original size) with virtually no quality loss. I seriously look forward to what is to come. This has been one hell of an experience so far, and your guys' help has been fantastic.
Personally, I'm very weary of the idea of ripping HD-DVD/BluRay to lower bitrate H.264 or VC-1. I mean, the original movie is already in H.264 or VC-1 - so converting to the same format seems not worth the hassle. The biggest boost in efficiency really only comes from longer GOPs, more B-frames, more aggressive loopfilters, etc. But it's nowhere near the advantage that MPEG-4 had over MPEG-2 when we all started making 1CD rips 7-8 years ago.

The reason why I'm so reluctant to get into the practice of ripping high def optical formats is because I think the format itself is already a videophile format. Since I can't improve on the quality of an already highly compressed 1920x1080p24 video - I don't see a point in watering down its quality even further by recompressing it. It would just defeat the whole purpose of high quality HD optical formats.

But I'm glad others are having fun. :)

Now it's time to force feed WME some AC3 audio, which it doesn't seem to like... I think I'll be tooling around with that VBScript for a little while.
If you're transcoding to WMA Pro, it might be easier to just decode AC3 to 6ch mono WAVs with BeSweet and then feed that to WME9... Or you could mux the AC3 to ASF with SolveigMM ASF Multiplexer - WMP won't play such WMV files, but any DirectShow player will. You could also mux the AC3 to AVI or MKV if you're not a big fan of ASF.

RulerOf
19th March 2007, 16:27
The reason why I'm so reluctant to get into the practice of ripping high def optical formats is because I think the format itself is already a videophile format. Since I can't improve on the quality of an already highly compressed 1920x1080p24 video - I don't see a point in watering down its quality even further by recompressing it. It would just defeat the whole purpose of high quality HD optical formats.

But I'm glad others are having fun. :).

I see your point. :D

My point isn't so much that I think that the high bitrate stuff from BD or HD-DVD looks too good and could stand to be recompressed, but is more this:

Since BD and HD-DVD films take up a lot of space when backed up onto a hard drive (which is how I prefer to access my content), it can become cumbersome to store a large amount of movies. My HD collection is already larger than my SD movie collection, gigabyte wise, but the SD movies outnumber HD movies at least 10 to 1.

Now, when it comes down to it, I hate watching DVD rips on a 61" screen. They look awful. What I'm getting at is that by converting these HD movies to a more space friendly format, I can actually store a movie in a [more] compressed format that I would actually open later and watch on a large screen, not wanting to complain between every keyframe due to encoding artifacts.

So, in short, I love the high def optical formats, and yes, compressing them is silly esp. since I'm a picture quality whore, but, if I'm going to compress them and store them on a hard drive, I prefer a method that I'd actually want to watch, and I finally found it.

But of course Zambelli, I do agree with you ;)

On the Muxing front, I think I might try the ASF muxer you mentioned, even though I *do* hate ASF files... out of principle or something, but if it'll move all of the channels through to WME, then that's probably what I'll use. Course, I might goof around with some AVS scripts, but I'll figure it out.

Thanks again Zambelli.

jubilex
26th March 2007, 03:27
I have a file that is an avi container with wmv video and ac3 audio. Stream Editor won't let me use this file to remux the wmv video with my seperate, re-encoded wma audio. Virtualdub won't let me demux it or remux it either. What can I use to put the unaltered video together with my new audio?

zambelli
26th March 2007, 06:37
I have a file that is an avi container with wmv video and ac3 audio. Stream Editor won't let me use this file to remux the wmv video with my seperate, re-encoded wma audio. Virtualdub won't let me demux it or remux it either. What can I use to put the unaltered video together with my new audio?
:search: I must've posted the answer at least a dozen times: Solveig Multimedia ASF Muxer (http://www.solveigmm.com/files/SMMASF_2006_03_02.zip) filter.

fatxy
28th March 2007, 10:09
That's exactly what it's for. You load all necessary sources and then you expand the branches and pick the deepest level checkbox for each stream you want to mux. Then you create a new audience, pick an output file - and mux.

i tried the example for multiple audiostreams, but i always get an error message "only one instance blabla" :confused:

any ideas?

zambelli
28th March 2007, 10:19
i tried the example for multiple audiostreams, but i always get an error message "only one instance blabla" :confused:
any ideas?
I think the audio streams need to have different audio languages set on them.

fatxy
28th March 2007, 10:36
hmm how can change this afterwards?

in help -> example pic its both tagged english tho :mad:

ACrowley
29th April 2007, 09:52
I think the audio streams need to have different audio languages set on them.

Yes, WMStreameditor needs different Languages.
And Important :
Both Audiostreams must have the same Bitrate,Samplingrate and khz

Very sad. Mostyl i have a WMA 640kbps 24biz 48khz encoded from DD+ and a WMA 384kbps 24Bit encoded
So ,i cant mux them together.

Muxing WMV MP-AP into mkv with HaaliMatroskaMuxer/ gdsmux works perfect. With any Audio.
But the Problem is that you can use the WVC1 video anymore
After demuxing with AviMux/Graphedit, the Output cant be used for remuxing. Dont know why ,but its a not valid Filetype.
Its no raw and not wmv/asf

Heres my Thread about WVC1 in mkv
http://forum.doom9.org/showthread.php?t=125110

Solveig ASF Muxer can mux WVC1 with WMA into asf
The Gui cant load a 2nd Audio Stream.

In Graphedit i have no succes with two different WMA (384/640 kbps)Tracks.
Solveig creates 2 programm Groups instead of one.

However WMstreameditor works perfect with one WMA or two identical WMA, but i really need a full compliant wmv with 2 different types of WMA Audio. WMV muxing is really Tricky /restricted.

Midzuki
31st August 2011, 17:25
Since when can you put wmv/wma into mkv?
As per the specs, it's still on the to-do-list (http://matroska.org/technical/specs/codecid/index.html), even today.

AFAIK, both WMV and WMA can be wrapped in Matroska thru the so-called "VFW/ACM compatibility mode". OK, this is NOT how things should be, but hey :)

lovelove
31st August 2011, 17:44
AFAIK, both WMV and WMA can be wrapped in Matroska thru the so-called "VFW/ACM compatibility mode". OK, this is NOT how things should be, but hey :)

Thanks for the tip. On this subject I found this:

[...]so-called 'VFW/AVI compatibility' files, simply because of the reason because they are made from either AVIs or OGM files, or created with tools that are VFW based, like VirtualdubMod. In this mode the matroska container is more or less clueless about the content it has, as all the tools do is to set the matroska codec IDs to V_MS/VFW/FOURCC for video and A_MS/ACM for audio, and all the important codec data are simply copied from the corresponding VFW structures ( BITMAPINFOHEADER, VIDEOINFOHEADER and WAVEFORMATEX ) in the KaxCodecPrivateDate filed in the matroska track header. This mode was always planned and is also very necessary to be able to support EVERY existing AVI file, whatever codecs it may use, but we were also always convinced that we should try to enforce that matroska files are used in their very own 'native' modes, also to express the cross-platform idea behind the project.
Thanks to the work of David 'DaveEL' Leatherdale, author of the well known tool avs2avi and moderator on Doom9, we are a very big step closer to this goal.

Thanks to the so-called 'Video For Windows' ( VfW ) compatibility mode of matroska it is possible to store and play every VfW video codec in it, and the same is valid for ACM audio codecs ( only CBR ). Just install the codec on your Windows PC, and VirtualdubMod will be able to open any AVI video using this codec and mux it into a .mkv file. For playback the normal VCM decoder, or DirectShow decoder filter will be used from the matroska DirectShow parser.

How do you create mkv files in "compatibility mode" ?

SeeMoreDigital
1st September 2011, 16:56
How do you create mkv files in "compatibility mode" ?
I suggest you search for posts about that subject within the dedicated "mkvtoolnix" topic...

Midzuki
1st September 2011, 17:06
How do you create mkv files in "compatibility mode" ?

Regarding "Windows Media" especifically:

Gabest Matroska Muxer + Graphstudio

benwaggoner
7th September 2011, 19:15
Doing VC1 and WMA in a format other than ASF seems pretty fraught to me. Only Advanced Profile (WVC1) was designed for container independence (and has official mappings for .mp4 and .ts). That all was developed YEARS after VfW was deprecated.

Midzuki
7th September 2011, 20:18
Doing VC1 and WMA in a format other than ASF seems pretty fraught to me. Only Advanced Profile (WVC1) was designed for container independence (and has official mappings for .mp4 and .ts). That all was developed YEARS after VfW was deprecated.

Actually, WMV3, WMV2, WMV1, and even the olde "MS MPEG4", can be safely stored in AVI :devil: , as long as they are CFR, of course. The big no-no comes from the various types of Windows Media Audio. When a Matroska file happens to contain WMA, the WMA decoders seemingly "don't like" the available MKV splitters (and vice-versa, the playback issues are easily-noticeable on older/slower machines). Anyway, WMA not only is "timestamp-dependant", but also "container-locked", much like Vorbis and its Ogg. :rolleyes:

BTW, since WMA is not "ACM-friendly", then ¿why the heck there exists an msaud32.acm? :D

SeeMoreDigital
7th September 2011, 20:38
Doing VC1 and WMA in a format other than ASF seems pretty fraught to me. Only Advanced Profile (WVC1) was designed for container independence (and has official mappings for .mp4 and .ts). That all was developed YEARS after VfW was deprecated.You know... I don't think I've ever seen an example of a WVC1 video stream placed within the .MP4 container. Do you have a sample?

benwaggoner
3rd October 2011, 23:33
You know... I don't think I've ever seen an example of a WVC1 video stream placed within the .MP4 container. Do you have a sample?
Every VC-1 Smooth streaming file is MPEG-4 using the fragmented subtype.

Here's some sample files using H.264 with that. I don't immedidately see a VC-1 equivalent, but I could make some if that would be useful.