SoftPixel Forum

Official community of the SoftPixel Engine and the SoftPixel Sandbox (REGISTRATION only with consultation with the Admin)
It is currently Wed Aug 23, 2017 10:12 am

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Movie drawing
PostPosted: Thu Nov 20, 2014 7:01 pm 
Offline

Joined: Tue Jan 07, 2014 6:38 pm
Posts: 90
Location: Germany
Hello Lukas.

I managed getting displaying a video to work(after finding out, that I can change the pixelformat manually^^).

The problem is, that softpixel loads videos only squared(because of VFW i guess).
I mean, it wouldn't be a hard deal, but when rendering the video to texture, the target-texture has to be the same size.

So when I want to support FullHD, I have to make a 20048^2 texture.
It impacts the time to render the texture and the pixels are somehow interpolated or so, so the result is a pixelated image drawn. Probably because it wants to draw 2048^2 pixels on a smaller screen.
iIs there a way to render only the pixels I want from the texture, so it avoids rendering a to big texture and avoids the quality-lost?

Since its a 1:1 record of my computer-screen, it isn't because i set the filter to linear(i anyways tried smooth, but it didnt worked).

Video in VLC(screenshot): https://www.mediafire.com/?bja66wj929ral69
Video in my program(screenshot): https://www.mediafire.com/?f25a19w87vmjrfi

Thanks.


Top
 Profile  
 
 Post subject: Re: Movie drawing
PostPosted: Fri Nov 21, 2014 10:12 am 
Offline
Site Admin
User avatar

Joined: Sat Jul 07, 2012 5:58 pm
Posts: 540
Location: Germany
Wow, this is really old code from the engine you are using here ^^
I don't know why I decided to allow only squared texture sizes, this is indeed foolish :oops:

Look into the spRenderSystemMovie.cpp file.
If you don't have already recompiled the engine, maybe you can create your own "Movie" class with this code; it's not so much.
Then you can support arbitrary resolutions.

At line 105 you can see the following:
Code:
MovieData->BitmapInfoHeader.biWidth         = MovieData->Resolution;
MovieData->BitmapInfoHeader.biHeight        = MovieData->Resolution;

You could change it to something like this:
Code:
MovieData->BitmapInfoHeader.biWidth         = MovieData->Resolution.Width;
MovieData->BitmapInfoHeader.biHeight        = MovieData->Resolution.Height;


Hope you get this working; the VFW library was introduced in 1992 for Windows 3.1 and is therefore totaly legacy ;-)
The better way to render movies nowadays on Windows is to use DirectShow.

_________________
My latest project:
- The XièXiè Programming Language

My hardware:
- GIGABYTE GeForce GTX 670
- Intel Core i7 (Ivy-Bridge)
- 16 GB DDR3


Top
 Profile  
 
 Post subject: Re: Movie drawing
PostPosted: Fri Nov 21, 2014 3:15 pm 
Offline

Joined: Tue Jan 07, 2014 6:38 pm
Posts: 90
Location: Germany
Thanks.
I think I will use your first suggestion and modify the engine.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group