View Full Version : Faster MPEG Decoding
Xesdeeni
27th October 2004, 15:34
There is a quest to play back ATSC (MPEG-2) HD Transport Streams (TS) in real time with a software player. GHz alone can almost get you there, using nearly 100% of the CPU. But with DirectX Video Acceleration (DXVA), lesser machines can handle this feat, often leaving as much as 75% CPU free.
So I'm wondering if we can take advantage of DXVA for the decode portion of format conversion (maybe even for DVD content). I have been thinking about this, and I figured the trick would be having a DXVA-enabled MPEG-2 codec. I haven't seen a free one with DXVA...until now. Sasem (http://www.usbhdtv.com/) makes some ATSC decoder devices, and one of their applications is an HD TS editor (http://www.usbhdtv.com/bbs/view.php?id=download&page=1&sn1=&divpage=1&sn=off&ss=on&sc=on&select_arrange=headnum&desc=asc&no=1). The editor is available as a trialware that expires. But according to this thread (http://www.avsforum.com/avs-vb/showthread.php?postid=4559616#post4559616), the codec doesn't expire. I've tried using DirectShowSource() on the TS, but it didn't work. The above referenced thread mentions using a custom (flow) graph.
1. Is this (using this codec/using a custom flow graph) possible in AVISynth?
2. Would this provide faster MPEG decode for conversions (i.e. can this data be extracted from the decode meant for display, but used for manipulation in less time than a pure software decode)?
Xesdeeni
Wilbert
27th October 2004, 16:30
1. Is this (using this codec/using a custom flow graph) possible in AVISynth?
If you can build manually a graph with Graphedit you should be able to open the graph itself in AviSynth (with DSS). Did you try that?
Btw, I guess can you can register the directshow filters without installing the editor?
Xesdeeni
27th October 2004, 21:48
Originally posted by Wilbert
If you can build manually a graph with Graphedit you should be able to open the graph itself in AviSynth (with DSS). Did you try that?I didn't know you could do that. I built a graph (although it doesn't play as smoothly as with the editor, in spite of the 54% CPU use; and the property sheet doesn't let you turn DxVA off and on, so I don't know if it's enabled), but I can't load it into AVISynth. I can't get properties on any pin. Which filters' outputs are compatible with AVISynth? I would have thought the output of the MPEG-2 decoder would have been one of the YUV formats and been OK.Btw, I guess can you can register the directshow filters without installing the editor? I'm sure there's a way, but the filters are in CABs, and the download EULA says you can't distribute parts, so every user would have to download the whole editor and then find an application to extract the filters (my WinZip refuses to do it) before they could install them.
Xesdeeni
Wilbert
27th October 2004, 22:26
I looked at it. I only got the video working :)
I selected 'SASEM File Source' (I guess that's this one: ASYNCFLT.AX, but I'm not sure about that). Selected a ts file and I rendered the output pin. I got the following graph:
ts file --- Elecard MPEG2 Demultiplexer --<
-- Elecard MPEG2 Video Decoder --- Video Renderer
-- AC3Filter --- Default DirectSound Device
The file played fine. Then I removed the Video Renderer and the DirectSound Device (which gives two free pins). Saved as a grf-file. I used the following script:
DirectShowSource("F:\HDTV\ladies.grf", 24, audio=true)
The video scrolls fine, but there's no audio ...
and the property sheet doesn't let you turn DxVA off and on, so I don't know if it's enabled
Can't you change it in the editor?
Xesdeeni
27th October 2004, 22:42
Originally posted by Wilbert
I looked at it. I only got the video working :)
I selected 'SASEM File Source' (I guess that's this one: ASYNCFLT.AX, but I'm not sure about that). Selected a ts file and I rendered the output pin. I got the following graph:
ts file --- Elecard MPEG2 Demultiplexer --<
-- Elecard MPEG2 Video Decoder --- Video Renderer
-- AC3Filter --- Default DirectSound Device
The file played fine.But then Elecard's MPEG2 decoder doesn't use DxVA, right? Don't we want to use Sasem's? I think it's the Intervideo Decoder.Then I removed the Video Renderer and the DirectSound Device (which gives two free pins). Saved as a grf-file. I used the following script:
DirectShowSource("F:\HDTV\ladies.grf", 24, audio=true)
The video scrolls fine, but there's no audio ...
Can't you change it in the editor?Yes, but I can't tell if it changes in the graph. Also, on my machine, playback is smoother, and the CPU use is lower with the DxVA checkbox DISABLED.
Xesdeeni
Wilbert
27th October 2004, 22:58
But then Elecard's MPEG2 decoder doesn't use DxVA, right? Don't we want to use Sasem's? I think it's the Intervideo Decoder.
Yes, sorry. I missed those.
I can't get it to work. The ts box doesn't want to connect to 'Intervideo Demultiplexer for Sasem' (some memory can't be read problem). The Elecard Demultiplexer doesn't want to connect to 'Intervideo AAC Decoder for Sasem' (pins not compatible).
What does your graph look like?
edit: I can't get the editor to work anymore. It's complaining about 'no mpeg2 demux interface supported' when loading a ts file :confused:
Xesdeeni
28th October 2004, 15:34
Originally posted by Wilbert
What does your graph look like?I'm sorry, I'm on a different machine today, so I'm going to have to do this from memory. If it doesn't work, I'll be back at the other computer tomorrow and I can correct it.
I used the Asynchronous File filter as an input. Then I used the Intervideo Demux for Sasem, but I didn't do anything with the audio. I connected this to the Intervideo NonCSS Video Decoder. I connected this to the Overlay Mixer and the Video Renderer 2 (I think you can just "render" the output pin of the Video Decoder). Also, if I hit stop after playing the clip, it wouldn't play again until I disconnected and reconnected the TS to Demux (and Demux to decoder).
Also, it looks like there's a more complete description in this thread: http://www.avsforum.com/avs-vb/showthread.php?s=&threadid=395039. In the end they say they can get the decode with 20% CPU use. As I mentioned, I'm on a different machine today, so I can't try it out. But, I'm drooling at the thought of 5x real time HD TS decode for conversion purposes!
Xesdeeni
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.