Re: How do I improve the quality of movie output? [message #83847 is a reply to message #83846] |
Fri, 05 April 2013 07:22  |
Helder Marchetto
Messages: 520 Registered: November 2011
|
Senior Member |
|
|
On Friday, April 5, 2013 1:03:09 PM UTC+2, Rob Dimeo wrote:
> Hi all,
>
>
>
> I have been creating some movies from some animations I created in IDL but I know very little about how to get nice video output from IDL animations. I'm using direct graphics so I'm snatching frames using TVRD() and I'm creating MP4 videos (but I'm not necessarily wedded to that format). Unfortunately I'm not really that happy with the quality of the result. The colors are faded and the resolution is not great, even with the video player on its highest resolution).
>
>
>
> A brief code snippet is listed below that shows you how I'm doing it.
>
>
>
> xsize = (ysize = 600)
>
> fps = 60
>
> oVid = IDLffVideoWrite(filename+'.mp4')
>
> vidStream = oVid.AddVideoStream(xsize,ysize,fps,bit_rate = 5e7)
>
>
>
> for j = 0,nframes-1 do begin
>
> ; Animated IDL graphics go here
>
> ; Plot something...
>
> frame = tvrd(/true) ; capture the screen
>
> !NULL = oVid.Put(vidStream, frame)
>
> endfor
>
> oVid.Cleanup
>
>
>
> Example output of this can be seen here:
>
> http://www.youtube.com/watch?v=TsGqmhskXIo
>
>
>
> The output is ok but not even close to what I get when I do an animation in a direct graphics window with pixmaps and the device,copy trick. Before I decide that my expectations are too high (that the video output be comparable to the IDL display), I wanted to find out from others who have had some experience with this sort of thing.
>
>
>
> Any help would be greatly appreciated!
>
>
>
> Rob
Hi Rob,
well, I thought I had an answer, I tried it and got something I don't like. My idea was to try it in function graphics. The plots may look nicer. Well, I got the thing to work in a few minutes, but I get some strange color effects... Meaning that what is red in the plot is violet in the movie. Not really what I expected to see.
Here is the code, just in case:
PRO TestMovie
xsize = 600
ysize = 600
fps = 20
oVid = IDLffVideoWrite('TestVideo.avi')
vidStream = oVid.AddVideoStream(xsize,ysize,fps,bit_rate = 5e7)
x = 6.0*!PI*findgen(501)/500.0
w = 1.0
win = window(DIMENSIONS=[xsize,ysize],location=[2000,10])
p = plot(x,sin(x*w),'r3',/CURRENT)
for i=0,100 do begin
w += 0.02
p.setdata, x, sin(x*w)
p.title = 'Progress = '+STRTRIM(I,2)+'%'
frame = p.CopyWindow(HEIGHT=ysize, WIDTH=xsize)
Void = oVid.Put(vidStream, frame)
endfor
oVid.Cleanup
END
The execution is 7.5 sec on my machine:
{ x86_64 Win32 Windows Microsoft Windows 8.2.2 Jan 23 2013 64 64}
Since I was planning to make such movies, it would be nice to find out how to get the colors right...
Cheers,
Helder
|
|
|