comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: high quality videos with idlffvideowrite?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: high quality videos with idlffvideowrite? [message #84003] Wed, 24 April 2013 16:29 Go to next message
AndrewM is currently offline  AndrewM
Messages: 5
Registered: July 2011
Junior Member
Yup, libx264 is the one you want for H.264 encoding. Still, though, increasing BIT_RATE is the first thing to try. It's going to take a lot more than 2 Mbps to get good quality 1920x1080 video. Let me know if that doesn't work out.
Re: high quality videos with idlffvideowrite? [message #84004 is a reply to message #84003] Wed, 24 April 2013 16:15 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
George.millward@yahoo.com writes:

> Thanks for your help. I was trying the presets - but i must have something wrong because 'lossless' was definitely still compressed.
>
> Here's what i have:
>
> vidStream = oVid.AddVideoStream(width, height, fps, codec='libx264', preset='slow')
>
> is that the correct codec for H.264 ?

I was just thinking that a tutorial on this subject by someone who knew
what they were doing would be immensely helpful. Maybe George (when he
gets things sorted) or Andrew can help us out. I'd be happy to host the
tutorial on my web page. Or, even better, it could be the first entry to
a new section in the IDL Documentation Center. :-)

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
Re: high quality videos with idlffvideowrite? [message #84005 is a reply to message #84004] Wed, 24 April 2013 16:09 Go to previous messageGo to next message
George.millward is currently offline  George.millward
Messages: 26
Registered: October 2012
Junior Member
On Wednesday, April 24, 2013 3:07:42 PM UTC-6, george....@yahoo.com wrote:
> Hi there,
>
>
>
> Can anyone point me to some documentation on how to make a high quality
>
> video with idlffvideowrite - I'm sure Exelis put one together - but, as is often the case, I can't find it.
>
>
>
> I can easily create videos with iflffvideowrite - but they are usually very horrible and compressed. I have replaced all of the ffmpeg .dll files as described in the reference manual and so I have lots of codecs and formats to work with... (I'm on windows7 btw)
>
>
>
> ...but I never seem to get anything other than a really poor quality movie. Surely this can't be that hard ?!?
>
>
>
> Cheers
>
>
>
> George.

Andrew

Thanks for your help. I was trying the presets - but i must have something wrong because 'lossless' was definitely still compressed.

Here's what i have:

vidStream = oVid.AddVideoStream(width, height, fps, codec='libx264', preset='slow')

is that the correct codec for H.264 ?

Cheers

George.
Re: high quality videos with idlffvideowrite? [message #84006 is a reply to message #84005] Wed, 24 April 2013 15:42 Go to previous messageGo to next message
AndrewM is currently offline  AndrewM
Messages: 5
Registered: July 2011
Junior Member
Try out some different values for the BIT_RATE keyword of the AddVideoStream() function. The default value is 2000000- meaning the encoder will aim to squeeze every second of video into 250 kilobytes (2Mbps = 250KBps), even if it has to sacrifice some quality to do so. H.264 is pretty good, but squeezing ~62 million pixels into 250KB is still a tall order.

Since you've gone through the trouble of getting yourself H.264 support (good choice!), you might also try experimenting with the PRESET keyword as well. Most of the H.264 presets just set different priorities for the tradeoff between video quality and encoding speed- if you don't mind encoding taking a bit longer, you can get a little more quality with the slower presets. The lossless presets will guarantee absolutely perfect quality, but fewer video players support them (Windows Media Player doesn't, but VLC does), and the files can come out quite large- here, the BIT_RATE setting is ignored, and slower presets get you smaller files rather than better quality.

I did an experiment a while back to see how the different presets compared. The quality column is completely subjective to my eyeballs. Your experience may vary, depending on your video. (My apologies for how ugly this table is going to be if you're not viewing with a monospaced font.)

Preset Time (s) Quality (/10) Size (KB)
ultrafast 9 4 3941
superfast 14 7 4306
veryfast 21 7 4532
faster 36 7.5 4487
normal 36 7.5 4488
fast 48 8 4553
default 54 8 4521
medium 54 8 4532
hq 89 8.5 4479
slow 91 8.5 4483
slower 157 9 4464
veryslow 307 9 4468
max 796 9.5 4454
placebo 893 9.5 4482
lossless_ultrafast 14 10 129048
lossless_fast 26 10 116800
lossless_medium 47 10 102583
lossless_slow 80 10 99142
lossless_slower 113 10 97086
lossless_max 460 10 96881


-Andrew Magill
ExelisVIS
Re: high quality videos with idlffvideowrite? [message #84007 is a reply to message #84006] Wed, 24 April 2013 14:34 Go to previous messageGo to next message
George.millward is currently offline  George.millward
Messages: 26
Registered: October 2012
Junior Member
On Wednesday, April 24, 2013 3:19:56 PM UTC-6, David Fanning wrote:
> George.millward@yahoo.com writes:
>
>
>
>> Can anyone point me to some documentation on how to make a high quality
>
>> video with idlffvideowrite - I'm sure Exelis put one together - but, as is often the case, I can't find it.
>
>>
>
>> I can easily create videos with iflffvideowrite - but they are usually very horrible and compressed. I have replaced all of the ffmpeg .dll files as described in the reference manual and so I have lots of codecs and formats to work with... (I'm on windows7 btw)
>
>>
>
>> ...but I never seem to get anything other than a really poor quality movie. Surely this can't be that hard ?!?
>
>
>
> I didn't have any trouble with movie quality in the two movies I made
>
> for the Coyote Gallery, but they are pretty simple. You can find the
>
> code I used and the movies themselves here:
>
>
>
> http://www.idlcoyote.com/gallery/index.html#AVI_MOVIE
>
>
>
> Cheers,
>
>
>
> David
>
>
>
> --
>
> David Fanning, Ph.D.
>
> Fanning Software Consulting, Inc.
>
> Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
>
> Sepore ma de ni thue. ("Perhaps thou speakest truth.")

David,

Yeh, both of your movies are fine - but what I'm trying to do is create HD quality (1920 * 1080) 30fps video in H.264 format. This should look essentially like HD quality tv - but all I'm managing to achieve is an .mp4 file which is about 2MB in size and absolutely horrible.

Cheers

George.
Re: high quality videos with idlffvideowrite? [message #84008 is a reply to message #84007] Wed, 24 April 2013 14:19 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
George.millward@yahoo.com writes:

> Can anyone point me to some documentation on how to make a high quality
> video with idlffvideowrite - I'm sure Exelis put one together - but, as is often the case, I can't find it.
>
> I can easily create videos with iflffvideowrite - but they are usually very horrible and compressed. I have replaced all of the ffmpeg .dll files as described in the reference manual and so I have lots of codecs and formats to work with... (I'm on windows7 btw)
>
> ...but I never seem to get anything other than a really poor quality movie. Surely this can't be that hard ?!?

I didn't have any trouble with movie quality in the two movies I made
for the Coyote Gallery, but they are pretty simple. You can find the
code I used and the movies themselves here:

http://www.idlcoyote.com/gallery/index.html#AVI_MOVIE

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
Re: high quality videos with idlffvideowrite? [message #84097 is a reply to message #84003] Wed, 24 April 2013 16:51 Go to previous message
George.millward is currently offline  George.millward
Messages: 26
Registered: October 2012
Junior Member
On Wednesday, April 24, 2013 5:29:41 PM UTC-6, AndrewM wrote:
> Yup, libx264 is the one you want for H.264 encoding. Still, though, increasing BIT_RATE is the first thing to try. It's going to take a lot more than 2 Mbps to get good quality 1920x1080 video. Let me know if that doesn't work out.

Yes, i did try bit_rate and it does make a big difference. I guess I'd assumed that the h264 'presets' would override any stated bit rate.

I agree with David... this needs a tutorial, or a much more complete set of examples - these days HD is almost standard and (for instance) the iPad goes way beyond HD.
Re: high quality videos with idlffvideowrite? [message #84098 is a reply to message #84003] Wed, 24 April 2013 16:50 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
AndrewM writes:

> Yup, libx264 is the one you want for H.264 encoding. Still, though, increasing BIT_RATE is the first thing to try. It's going to take a lot more than 2 Mbps to get good quality 1920x1080 video. Let me know if that doesn't work out.

Here is a link that seems particularly useful in this regard:

http://bit.ly/jJ0ufx

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: caldat strange behavior CALDAT, JulianDay, NULL, NULL, GetYear
Next Topic: MAP_CONTINENTS,/HIRES does not match MAP_CONTINENTS,/HIRES,/USA

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 15:39:45 PDT 2025

Total time taken to generate the page: 0.00726 seconds