Log in

View Full Version : How to demux VC1 elementary stream from WMV file?


Pages : [1] 2 3 4

Guest
7th December 2006, 00:32
Does anyone know how to demux a VC1 elementary stream from a WMV file?

foxyshadis
7th December 2006, 02:37
Graphedit (or equivalent directshow magic) and the Dump Filter is one option:
http://www.dvbportal.de/projects/hdtvdump/
It'll set the extension to .asf for some reason, but it'll be a raw stream.

Guest
7th December 2006, 02:43
Wonderful. Thank you very much.

Guest
7th December 2006, 03:10
Oops, I did 'render media file' on my WVF file, then I added the Dump filter and connected to the WMV decoder and it dumped raw YV12 video.

Where do I get a WMV *demultiplexer* filter so that I can extract the VC1 elementary stream?

EDIT: Never mind, I had the filter connected to the WMV decoder instead of the ASF parser. Seems to be working. Thanks again.

Pookie
7th December 2006, 03:17
Haven't tried it, but the newest builds of ffmpeg should allow you to do:

ffmpeg -i input.wmv -vcodec copy -an -y output.wmv

Guest
11th December 2006, 19:38
Haven't tried it, but the newest builds of ffmpeg should allow you to do:

ffmpeg -i input.wmv -vcodec copy -an -y output.wmv I want an elementary stream, so why is the output file .wmv?

Guest
11th December 2006, 19:39
Graphedit (or equivalent directshow magic) and the Dump Filter is one option:
http://www.dvbportal.de/projects/hdtvdump/
It'll set the extension to .asf for some reason, but it'll be a raw stream. The demuxed VC1 does not play and does not look correct when I look at it with a binary editor.

Any other ideas?

Pookie
13th December 2006, 05:06
http://codecs.multimedia.cx/wp-content/vc1test.c

Guest
13th December 2006, 06:46
Ha ha. OK, where is avformat.h?

Pookie
13th December 2006, 07:21
http://arrozcru.no-ip.org/ffmpeg/

http://ffmpeg.mplayerhq.hu/ffmpeg-doc.html#SEC28

avformat.h looks like it is part of ffmpeg....

Guest
13th December 2006, 14:51
My point is that that piece of code is not a standalone thing that I can build. There is no documentation, nothing. Can YOU make it work?

Pookie
14th December 2006, 07:54
Hope I'm not being irritating neuron2, I'm sincerely trying to help.

http://www.inlethd.com/support/elementary-streams.html

Can't tell if they have a 15 day trial on that particular product, or if it is included in their entire software suite.
Their hardware solution is $35K ! The good news - they support Avisynth.

Guest
14th December 2006, 08:05
No problem there, Pookie. You know me, I'm a bit gruff. :)

Thank you for the new link. I will check it out. They do appear to have a trial download.

vsv
14th December 2006, 10:14
Does anyone know how to demux a VC1 elementary stream from a WMV file?

Windows Media Stream Editor

Guest
14th December 2006, 14:53
Windows Media Stream Editor I had a look at it but couldn't see how. Can you explain it in detail?

vsv
14th December 2006, 20:12
1. hit button ADD SOURCE (load wmv in left field)
2. choose AUDIENCE video
3.hit button ADD-> (you can see in right field (appears only video audience)
4. hit button CREATE FILE (promt name and place for new file)
5. in bottom field hit button START and create new file w/o audio

Guest
14th December 2006, 20:35
@vsv

You're not paying attention. I want the raw VC1 elementary stream, not another WMV file.

vsv
14th December 2006, 22:53
Sorry, my mistake.

Inventive Software
14th December 2006, 23:03
Can you remux to MKV and then demux that stream?

squid_80
15th December 2006, 13:40
What about opening the WMV file with virtualdubmpeg2, saving with direct stream copy to an avi and using avi2raw (http://mpeg4ip.sourceforge.net/documentation/index.php)? It's a bit convoluted, but if you're desperate...

Guest
15th December 2006, 14:40
I don't have a Linux system and I can't believe there is no Windows solution for this simple problem.

squid_80
15th December 2006, 15:09
Sorry, there's a windows build of mpeg4ip (includes avi2raw) here. (http://www.digital-digest.com/software/getdownload.php?sid=1037&did=1)
If it won't work here's the host page: http://www.digital-digest.com/software/download.php?sid=1037&ssid=0&did=1 (click the green down arrow)

Inventive Software
15th December 2006, 15:11
Seriously neuron2, did you try the MKV solution I suggested? mkvmerge might let you extract the video from MKV as a raw dump, but I can't remember if MKV supports VC-1. :(

EDIT: It appears not to support VC-1 as yet. The following solution will work for SP and MP WMV's though.

Get VirtualDub 1.3c (or the last one that had ASF support), open your WMV file, Direct Stream Copy, Save as AVI, hopefully (if you have the WMV9 VCM codec) you have an AVI file with your VC-1 elementary stream that was in the WMV container. You can then demux that stream with Avimux or another tool if you so desire.

emmel
15th December 2006, 15:21
How about mplayer?
mplayer test.wmv -dumpvideo -dumpfile test.vc1
Just tried with a small sample. At least it recognizes the elementary video stream as "WVC1" and dumps the outcome on disk like it should.

Guest
15th December 2006, 15:34
What is mplayer and where do I get it?

emmel
15th December 2006, 15:38
There is a thread "MPlayer for Windows" on the software players' formum here. The latest mplayer.exe comes with the installer.

bill_baroud
15th December 2006, 15:38
it's the infamous linux player based on libavcodec/format (so ffmpeg should work also)

you can find binaries for windows here for example : http://tirnanog.fate.jp/mirror/mplayer/

(and similary : http://tirnanog.fate.jp/mirror/ffmpeg/)

Inventive Software
15th December 2006, 17:33
Right, another crack at this.

@neuron2: I've tried this method with a couple of WMV files, and they work. :)

The following's needed:

ffdshow_tryout latest revision, clsid's builds recommended (http://sourceforge.net/project/showfiles.php?group_id=173941)
VirtualDub 1.4c
AVIMuxGUI 1.17.7
Windows Media Audio codecs (already there if you have Windows Media Player 9 or higher installed)

0) Configure ffdshow's VFW interface to decode all WMV types (WMV1+2+3) or just WMV3 if you're confident the WMV file's WMV9
1) Rename the WMV file to ASF
2) Open the ASF file with VirtualDub
3) Select "Direct Stream Copy" in the Video menu
4) Save As AVI
5) Add the new AVI file to AVIMuxGUI
6) Click "generate data from source files"
7) Right-click the video stream, click "extract binary"
8) Save your VC-1 elementary stream. :)

I seriously hope this works for you. I spent about 20 minutes testing it to make sure it works.

SeeMoreDigital
15th December 2006, 17:42
Micro$oft used to provide a stream muxer/de-muxer with Windows Media Encoder.... Is this not supplied anymore. Or does it not handle VC-1?

Guest
15th December 2006, 19:18
8) Save your VC-1 elementary stream. :)

I seriously hope this works for you. I spent about 20 minutes testing it to make sure it works. How did you verify the validity of the resulting elementary VC1 file?

zambelli
16th December 2006, 02:43
Micro$oft used to provide a stream muxer/de-muxer with Windows Media Encoder.... Is this not supplied anymore. Or does it not handle VC-1?
The WM Stream Editor only handles ASF <-> ASF mux/demux.

BTW, spelling Micro$oft is so juvenile. Seriously. It makes you sound like you're 13 yrs old. No offense. :rolleyes:

@Neuron, check your PM inbox.

Inventive Software
16th December 2006, 20:14
How did you verify the validity of the resulting elementary VC1 file?

I didn't, because I don't know how. ;) One thing I did was to add the video and audio demuxed and account for the ASF overhead, which I think worked.

I assume you just need to run it through a valid decoder, but don't know of a VC-1 decoder that accepts just the raw VC-1. GraphEdit might be worth a crack, and I'll try that in a couple of weeks when I get my computer back. :)

Guest
16th December 2006, 20:40
That's the problem. All the methods given do not result in a valid stream. I have a decoder in silicon that works fine with valid streams. Thank you for your efforts in any case.

Inventive Software
16th December 2006, 22:07
In what way is it not valid?

Guest
17th December 2006, 02:25
A non-valid file looks funny in the hex editor and it doesn't play when injected into my silicon VC1 decoder. To be honest I didn't try your method because you didn't verify it yourself, and zambelli has offered a solution to me in PM. As I said, I do appreciate your efforts, however.

If you'd like to provide a file made using your method, I will be happy to test it for you.

Inventive Software
17th December 2006, 19:36
I will see what I can do regarding the uploaded sample. ;) However, it can't hurt to just try it. Like I said, I personally didn't verify it not knowing how.

Guest
18th December 2006, 03:01
I'll test it if you upload it somewhere.

Trahald
22nd December 2006, 06:47
5) Add the new AVI file to AVIMuxGUI
6) Click "generate data from source files"
7) Right-click the video stream, click "extract binary"
8) Save your VC-1 elementary stream. :)

I seriously hope this works for you. I spent about 20 minutes testing it to make sure it works. i tried this with an avc stream and what i get doesnt look like an elementary stream.

has anyone found a way to acheive this?

SeeMoreDigital
22nd December 2006, 16:58
i tried this with an avc stream and what i get doesnt look like an elementary stream.

has anyone found a way to acheive this?To demux AVC streams from out of the AVI container I use MP4Box with YAMB ;)

SeeMoreDigital
22nd December 2006, 17:01
Inventive Software,

Once you have the VC-1 stream placed within the AVI container. Have you tried using MP4Box to extract it?

http://img262.imageshack.us/img262/9724/mp4boxextractkq9.png


Cheers

Golgot13
24th December 2006, 16:20
Censored....


Golgot13

bond
27th December 2006, 15:15
do you have a link to those tools?

Golgot13
28th December 2006, 17:12
No link, "only" you must be a video labotary company and
sign a NDA.

Golgot13

stegre
31st December 2006, 22:31
How about MPlayer?
MPlayer test.wmv -dumpvideo -dumpfile test.vc1
Just tried with a small sample. At least it recognizes the elementary video stream as "WVC1" and dumps the outcome on disk like it should.I agree with this: this does give you the "raw" VC-1. But I'm not so sure an "elementary VC-1" stream is the same as "raw" one, and I think that's the whole problem here.

I don't have personally have the VC-1 spec (I want one, but I'm trying to figure out how to get it without spending $300 :eek: - but I assume a VC-1 "elementary stream" has extra structures to help specify some basic characteristics (not to mention just finding out where the divisions between frames are).

Using audio as an analogy, you can, say, do "raw demux" of MP3 or AC3 audio out of an AVI or other container, because each frame has enough header info to play by itself. But in a sense, that's "double containerizing" and I think there's a tendency away from that in newer file encoding schemes to save bits. The encoding will specify a bitstream at its "lowest" level possible, under the assumption some container or other extra information structure(s) will provide the missing basic info. For example, if you demux AAC out of a MP4 container as raw data, you can't play it unless you have a "smarter" demuxer that adds either an ADIF header to the beginning or ADTS headers to each frame.

That result, with the headers, is called "elementary" AAC. It has some extra info, but it's still "elementary" because it's not in an MP4 or other container yet. But it's different from "pure raw demuxed" AAC, which is unplayable.

For that matter you can't even play uncompressed audio unless the demuxer adds a wav header so you know the composition of the data (sample size, sample rate, #of channels, etc) that follows (and can compute where the next frame starts); neither can you play raw uncompressed video without at least knowing whether its 3bytes/frame RGB, four bytes/frame RGBA, etc. but that's a digression.

Getting back to the subject, note the MPlayer for "man page" entries for the dump options emmel mentions:


-dumpaudio (MPLAYER only)
Dumps raw compressed audio stream to ./:stream.dump (useful with mpeg/:ac3).

-dumpvideo (MPLAYER only)
Dump raw compressed video stream to ./:stream.dump (not very usable).

Note, in particular, the comments: "useful with mpeg/:ace" and "not very useful". Because often it isn't.

I have further evidence to support this. Yesterday, using quite a few operations, I managed to create a high-quality VC-1 in an AVI container (25MB) (http://www.ftyps.com/unrelated/vc1_in_avi.avi) by demuxing VC-1 WMV frames and copying them straight into a AVI container chunks. The data itself is the same VC-1 data you get from MPlayer -dumpfile. The result plays fine on all my players, because:

a) The AVI container divides data into one chunk per frame (and has an index to those as well) and,
b) The AVI headers have the all the basic characteristics (frame size, frame rate) needed in the AVI headers.

By contrast, the "dumpfile" itself won't play in any player.

To summarize, I think to create a VC-1 "elementary" stream from a "raw" one that's already in a container, one would need a demuxer with a little bit of "smarts"; it'd have to add in some appropriate headers (and very likely do this at the actual time of demux - before the info is lost). It very much analogous to how mpeg4ip demuxes AAC out of an MP4 - it's mostly just a demux operation, but it quietly inserts some extra headers to make it playable. In contrast, MPlayer's raw -dumpfile of the same MP4 does a "pure" demux. That results slightly shorter file one which can't be played. It's the difference between "raw" and "elementary". Same deal with VC-1, I'd be willing to bet.

Blue_MiSfit
1st January 2007, 09:17
What is mplayer and where do I get it?

ROFL!!! Sorry to go back in time but that was just too funny!!!

bond
1st January 2007, 15:46
dont the vc-1 specs define how an elementary vc-1 stream need to look like?

Guest
1st January 2007, 15:51
Yes, of course. I know what it should look like and I can test them by playing them on our silicon. The problem is that none of the solutions offered produces an ES as needed. Even zambelli's offered solution does not. I'm just going to make my own tool.

crypto
1st January 2007, 19:21
The methods described here produce raw streams. VC-1 elementary streams are PES-encapsulated raw streams similar to mpeg-2 PES streams with some extensions. I am currently working on an WMV muxer/encoder and I am also planning to add elementary stream support. The main use however will be AVI->WMV muxing.

Guest
1st January 2007, 19:32
Sorry, but an ES is not PES encapsulated, by definition.

crypto
1st January 2007, 19:53
You are right. I should have said the payload of an PES starting with a payload format header start code or a frame start code, depending on the VC-1 profile.