keyongtech


  keyongtech > win32.programmer.* > win32.programmer.directx.video > 07/2004

 #1  
07-28-04, 03:27 PM
Jessie
I am trying to render multiple MPEG4 (XviD) files, and need to be able to
fast forward and reverse during playback.

I have tried building a timeline and it plays successfully at normal speed.
However, any attempts to change the rate either fails or has no effect.
I've tried (put_Rate(), SetRate(), and SetOutputFPS()).

I have also tried just building a normal graph (using RenderFile()) and
then changing positions manually with SetPositions(). That works well
enough when setting initial positions, but is not ideal when smooth video
rendering is needed.

So my question to the experts is, if you needed to be able to play
sequential video clips and have the ability to FF/FB, which way would you
implement it? Would you use timelines, and if so, is there a way to change
the play rate dynamically (for example, variable increase/decrease using
values from a slider control)?

Any and all help and suggestions welcome,
J
 #2  
07-28-04, 04:07 PM
Thore Karlsen [MVP DX]
On Wed, 28 Jul 2004 15:27:34 +0100, Jessie <jjohnson> wrote:

>
>I am trying to render multiple MPEG4 (XviD) files, and need to be able to
>fast forward and reverse during playback.
>
>I have tried building a timeline and it plays successfully at normal speed.
>However, any attempts to change the rate either fails or has no effect.
>I've tried (put_Rate(), SetRate(), and SetOutputFPS()).
>
>I have also tried just building a normal graph (using RenderFile()) and
>then changing positions manually with SetPositions(). That works well
>enough when setting initial positions, but is not ideal when smooth video
>rendering is needed.
>
>So my question to the experts is, if you needed to be able to play
>sequential video clips and have the ability to FF/FB, which way would you
>implement it? Would you use timelines, and if so, is there a way to change
>the play rate dynamically (for example, variable increase/decrease using
>values from a slider control)?


I don't build timelines, I handle changing files myself. It's not that
complicated, and I can set the rate just fine with XviD.

You can't reverse playback easily, though, since this codec uses
temporal compression. MJPEG is more suited for reverse playback.
 #3  
07-28-04, 04:29 PM
Jessie
On Wed, 28 Jul 2004 10:07:38 -0500, Thore Karlsen [MVP DX] wrote:

> On Wed, 28 Jul 2004 15:27:34 +0100, Jessie <jjohnson> wrote:
>> I don't build timelines, I handle changing files myself. It's not that

> complicated, and I can set the rate just fine with XviD.
>
> You can't reverse playback easily, though, since this codec uses
> temporal compression. MJPEG is more suited for reverse playback.


Thanks Thore.

Can I ask which function you use to change the play rate.
Is it SetRate()?
Do I have to Pause the graph to change the rate?

Many thanks,
j
 #4  
07-28-04, 11:47 PM
Thore Karlsen [MVP DX]
On Wed, 28 Jul 2004 16:29:01 +0100, Jessie <jjohnson> wrote:

[...]

>> I don't build timelines, I handle changing files myself. It's not that
>> complicated, and I can set the rate just fine with XviD.
>>
>> You can't reverse playback easily, though, since this codec uses
>> temporal compression. MJPEG is more suited for reverse playback.


>Thanks Thore.
>
>Can I ask which function you use to change the play rate.
>Is it SetRate()?
>Do I have to Pause the graph to change the rate?


Yes, I use IMediaSeeking::SetRate(). You don't have to pause the graph
first.
 #5  
07-29-04, 12:23 AM
Joe Flynn
Jessie wrote:
> I am trying to render multiple MPEG4 (XviD) files, and need to be able to
> fast forward and reverse during playback.
>
> I have tried building a timeline and it plays successfully at normal speed.
> However, any attempts to change the rate either fails or has no effect.
> I've tried (put_Rate(), SetRate(), and SetOutputFPS()).
>
> I have also tried just building a normal graph (using RenderFile()) and
> then changing positions manually with SetPositions(). That works well
> enough when setting initial positions, but is not ideal when smooth video
> rendering is needed.
>
> So my question to the experts is, if you needed to be able to play
> sequential video clips and have the ability to FF/FB, which way would you
> implement it? Would you use timelines, and if so, is there a way to change
> the play rate dynamically (for example, variable increase/decrease using
> values from a slider control)?
>



Have you tried IAMTimeline::SetDefaultFPS() ?

For the calls that failed what HRESULT is returned?




Joe Flynn
 #6  
07-29-04, 09:11 AM
Jessie
On Wed, 28 Jul 2004 18:23:12 -0500, Joe Flynn wrote:

> Jessie wrote:
>> Have you tried IAMTimeline::SetDefaultFPS() ?

>
> For the calls that failed what HRESULT is returned?
>

Hi Joe,

Yes, I have tried SetDefaultFPS, but I would need to be able to change the
play rate dynamically (and smoothly) as the user requests instead of just
once during initialization (unless of course you mean I should try using
SetDefaultFPS at any time during playback).

The HRESULT I get is 80004001.

One thing that Thore mentioned in his reply was the use and possible
limtations of Xvid. So, just for laughs, I tried substituting Xvid for the
standard MS MPEG4 V2 encoder and everything started working.. SetRate does
what it should, GetRate returns the correct values, etc.

It's great that the rate changes work, but now it leaves me with more
questions. Why doesn't it work with Xvid. I'd really prefer to use Xvid
because the compression is so much better. I'm currently using
XviD-1.0-RC4-05042004 but I've also tried XviD-1.0.1-05062004 which seemed
unstable.

Is there a better, more stable release of Xvid that I'm not aware of or
have you had any similar experiences with setting the playback rates
specifically with Xvid?

I'll try switching back to Xvid to confirm that it's causing problems.
There may be an option or two that I need to set in order for it to work.

Thanks for your help,
J
 #7  
07-30-04, 12:15 AM
Thore Karlsen [MVP DX]
On Thu, 29 Jul 2004 09:11:47 +0100, Jessie <jjohnson> wrote:

[...]

>Is there a better, more stable release of Xvid that I'm not aware of or
>have you had any similar experiences with setting the playback rates
>specifically with Xvid?


I'm running a version I compiled a couple of months ago, and it's been
working fine. I haven't had any problems setting the rate.

Since you have the source you could always run it in a debugger and see
what's going on.
 #8  
07-30-04, 02:34 AM
Joe Flynn
Jessie wrote:

[..]
> XviD-1.0-RC4-05042004 but I've also tried XviD-1.0.1-05062004 which seemed
> unstable.
>
> Is there a better, more stable release of Xvid that I'm not aware of or
> have you had any similar experiences with setting the playback rates
> specifically with Xvid?
>
> I'll try switching back to Xvid to confirm that it's causing problems.
> There may be an option or two that I need to set in order for it to work.
>


Normally I would guess that since your code works properly with the
Microsoft MPEG4 codec but fails with XVID that the fault lies with the
XVID decoder (especially since the 80004001 return code equates to
“E_NOTIMPL - The function called is not supported at this time”) but
Thore indicated that he didn’t have any problems with XVID and
SetRate(). So just for kicks I threw together a simple playback graph
via RenderFile() and altered the playback rate via
IMediaSeeking::SetRate(). On my XVID test clips everything worked (sort
of - the video playback wasn't exactly what I would consider smooth). On
my development machine I am using an older build of the XVID codec dated
24.2.2003. I also loaded the 1.0.1-05062004 release (from the Doom9
site) on a WinXP box and ran that same test code against the same clips
- everything still worked.

You could see if you have any better success using the DIVX MPEG4 codec.
It should be a reasonable match for the compression ratio/quality that
XVID provides. The last couple of DIVX releases were also able to decode
XVID content so you should be able to use it to play any XVID stuff
already on-hand.


Joe Flynn
Similar Threads
cluster index advice - advice needed

i have a table that has no index on a date column and a regular index on a group_id and another on a customer_id column. the group_id will be somewhat volatile, lots of...

Advice needed!! help please

Hi. I´m a programmer. I´m thinking about one program for personal use and I don´t know if it´s possible using directx libraries. I play guitar too and I´d like to make a...

advice needed

Need some advice from people that have already migrated to exch2k3. due to circumstances beyond my control, my company is still not on ad. they keep telling me they will be...

Advice Needed: Pocket Media Players (software advice)

(If responding via email, remove _spam from my address shown) I seek advice (and crackz) on the best software for managing and playing MP3 files and movies on my HP Ipaq...

Help/Advice Needed

I am using Compaq Evo N800v running on XP Professional. I experienced very frequent system crashes. When I shut down XP, I got a blue screen. (I could not read the messages...


All times are GMT. The time now is 01:38 AM. | Privacy Policy