POV-Ray : Newsgroups : povray.animations : library finding request Server Time
8 Jul 2024 16:18:55 EDT (-0400)
  library finding request (Message 1 to 10 of 18)  
Goto Latest 10 Messages Next 8 Messages >>>
From: ABX
Subject: library finding request
Date: 16 Aug 2002 03:52:20
Message: <4nbpluc2ln6ittie2npkb65snd9f817bck@4ax.com>
I have already said on some forums that I have some plans for small and larger
patches. One of them I plan is mpeg port to povray. POV-Ray has already some
animation features hovewer when you wan't embed some animated pigment then you
have a problem. You can split animation to many separated files and script
code to follow frames of POV-animation. But it requires:
- space on drives
- parsing time
- additional work when animattion is designed
- dedicated script
It all can be easy done when short animation like for example animated pattern
is used. The problem appear when you want to put movie on animation like for
example TV show viewed by character.
My plan was to use mpegs the same way as images just with additional word
'timeline FLOAT' used:
  image_map { mpeg "movie.mpg" timeline .1 }
Timeline value could be from 0..1 range where 0 is first and 1 is last frame
of "movie.mpg". If the timeline shots between frames of original movie then
neighbour frames would be weighted accordingly. All other image modifiers like
'interpolate', 'once', 'transmit all', etc. could work. All other places like
hf, function{} where image can be used could work. I hope You like this
idea...

So what's my problem ? Mpeg library !

I want to take widely used, tested library similiar to libpng, zlib, libtif...
ported to standard 3.5. I have already investigated some resources but I found
some problems so decided to find help in community. Usually unix/linux users
has best experience with free libraries. Unfortunatelly I'm average windows
user. I have found some library in some linux distribution and have asked its
author for help but got following response:

  ISTR another MPEG decoding library at www.mpeg.org.  There are also lots
  of pretty good MPEG players for Linux -- my guess is that *somewhere*
  out there is a high-quality, free MPEG decoding library.  Mine isn't it.

But he missed I already checked www.mpeg.org and got following response:

  This is an automatic answer.
  The authors of the MSSG software have disapeared and left no forwarding     
  address.

So would you like to help me finding best, well-tested, widely-used mpeg
library ? Am I missed something ? MPEG2 support could be nice but not
necessary. Portability necessary. Thanks in advance :-)

ABX


Post a reply to this message

From: Le Forgeron
Subject: Re: library finding request
Date: 16 Aug 2002 05:39:30
Message: <3D5CC865.9080105@free.fr>
ABX wrote:


> My plan was to use mpegs the same way as images just with additional word
> 'timeline FLOAT' used:
>   image_map { mpeg "movie.mpg" timeline .1 }
> Timeline value could be from 0..1 range where 0 is first and 1 is last frame
> of "movie.mpg". If the timeline shots between frames of original movie then
> neighbour frames would be weighted accordingly. All other image modifiers like
> 'interpolate', 'once', 'transmit all', etc. could work. All other places like
> hf, function{} where image can be used could work. I hope You like this
> idea...


Interesting concept: extracting a frame of a movie,
but I wonder if it would not be better to have the timeline as the time 
elapsed since the beginning of the movie.
  Because clock should not be bound to the number of rendered frames, I 
believe also that the parsing of a movie to get a frame should not be 
bound to neither the rate of the movie or its length.
Moreover, some mpeg files may have embedded timecode (every n frames),
and the beginning of the files might not be at timecode 0.
With or without timecode support, I believe a timeline expressed in 
seconds would be better, the fractional part being used to find the 
right frame in that second. (carefull definition of "right": the frame 
which at the same fractional part (when that match) or the one whose 
fractional part is the biggest but still less than the value).
It is easier for the user to specify (s)he wants to the images to play 
from the 45 to the 48 seconds of the movie than to know the exact length
of the movie (most player round down/up the duration to the nearest 
second, when  they consider to provide it, which is not always the case) 
and then dividing by that values. Moreover, if they changes the source 
movie, it's easier to update the scene script.
Last point: precision: I'm afraid that a float value (even in double 
format) does not have enough granularity to avoid some bad effects, but 
I will let you do the math, maybe I'm wrong.

<Expected level of service>

Please just assume that I have a mpeg movie of 3 hours (VCD encoding, 
filesize a little less than 2Go [so no problem with fseek]) at 30 fps
(NTSC, progressive).
Worst case could be 30 fps interlaced (60 half frame per second), but I 
will assume it has been deinterlaced.

I do not want to cut it, and I'm only interested in a small sequence 
which occurs between 2:40:43 and 2:41:01, which I will renders at half 
speed (doing a 24 fps animation of 36 seconds with it), then I will 
render the same part at double speed in another animation of 9 seconds 
at 25 fps.

Last minute, the movie is to be replaced by the same, but encoded in Pal 
at 25 fps.

Stop the press, the movie is a real cinema shot, at 24 fps, but it has a 
ten minutes bonus at the end (a lengthy generic ?)...

<End of expectation>

The only difference between using a float between [0,1] and [0,length]
is that the start value is expressed as
   0.8928703703703703703703703703703703703703703703703703703
or as
   9643   (which could be written more clearly in a scene as 
2*3600+40*60+43, but that's for the parser anyway)

At least, with the second value, when the length change, the start does 
not (unless the decoder try to use the timecode information ?).

Obviously, using frame number is a very bad idea to ease the user to get 
the right picture (especially when the moving is encoded at 29,97 fps 
[sic]!)


> 
> So what's my problem ? Mpeg library !

> So would you like to help me finding best, well-tested, widely-used mpeg
> library ? Am I missed something ? MPEG2 support could be nice but not
> necessary. Portability necessary. Thanks in advance :-)


Isn't it there a Linux/Unix Mpeg encoder that can be used to encode a 
set of images in a mpeg file (I used it once, I had to provide all the 
mpeg values and I had no idea of what they were for... ). There must be 
some decoding code too...

Your problem might be mixing Pov & GNU/free licences... maybe LGPL is ok ?


Post a reply to this message

From: Damaru
Subject: Re: library finding request
Date: 16 Aug 2002 05:42:58
Message: <3d5cc922@news.povray.org>
ABX wrote:
 
> So would you like to help me finding best, well-tested, widely-used mpeg
> library ? Am I missed something ? MPEG2 support could be nice but not


http://libmpeg2.sourceforge.net/


Post a reply to this message

From: ABX
Subject: Re: library finding request
Date: 16 Aug 2002 06:00:16
Message: <a8iplucoj2763bpeiuoeu58e4aeaa6ik5u@4ax.com>
On Fri, 16 Aug 2002 11:39:49 +0200, Le Forgeron <jgr### [at] freefr> wrote:
> Interesting concept: extracting a frame of a movie,

I'm happy that first response is not completly agains ... :-)

> but I wonder if it would not be better to have the timeline as the time 
> elapsed since the beginning of the movie.

There is nothing difficoult to use Interpolate macro or range function to move
cursor from [0..1] to real time I think. I think idea of 0..1 is simliar to
putting images in <0,0>..<1,1> region even if images has some resolution,
placing, dimensions already written in it format. I think it should be easy to
get specified moment of movie by writing in sdl:

  #macro Time(Hours,Minutes,Seconds,S100)
    (((Hours*60+Minutes)*60+Seconds)*100+S100)
  #end

  image_map{
    mpeg "movie.mpg"
    timeline Time(2,30,46,23)/Time(3,20,21,10)
  }

Making timeline dependant on clock and using motion_blur (I hope it will be
patched to 3.5) would made movie playing very smooth.

> the beginning of the files might not be at timecode 0.

IIRC GIF format can have written position of image. Is it considered when gif
is loaded as image_map?

> > So what's my problem ? Mpeg library !
>
> > So would you like to help me finding best, well-tested, widely-used mpeg
> > library ? Am I missed something ? MPEG2 support could be nice but not
> > necessary. Portability necessary. Thanks in advance :-)
>
>
> Isn't it there a Linux/Unix Mpeg encoder that can be used to encode a 
> set of images in a mpeg file (I used it once, I had to provide all the 
> mpeg values and I had no idea of what they were for... ). There must be 
> some decoding code too...

Would you like to point me some url where I can download include files?

> Your problem might be mixing Pov & GNU/free licences... maybe LGPL is ok ?

I don't plan to distribute library but gate to it as patch hovewer if I plan
to make it official some day I should take care of it too :-(

ABX


Post a reply to this message

From: Le Forgeron
Subject: Re: library finding request
Date: 16 Aug 2002 08:34:09
Message: <3D5CF14D.1020409@free.fr>
ABX wrote:

> On Fri, 16 Aug 2002 11:39:49 +0200, Le Forgeron <jgr### [at] freefr> wrote:
> 
>>Interesting concept: extracting a frame of a movie,
>>
> 
> I'm happy that first response is not completly agains ... :-)
> 
> 
>>but I wonder if it would not be better to have the timeline as the time 
>>elapsed since the beginning of the movie.
>>
> 
> There is nothing difficoult to use Interpolate macro or range function to move
> cursor from [0..1] to real time I think.


It's not difficult, BUT then, you have to exactly know the whole length
of the animation and put that knowledge in the script.
Why put the burden on the user when the code could do it.

> I think idea of 0..1 is simliar to
> putting images in <0,0>..<1,1> region even if images has some resolution,
> placing, dimensions already written in it format.


I'm not sure that the similiraty could hold for time as it can for 
spatial dimension. It's nice to be able to give the position in a 
picture by using percentage. Even if the resolution of the picture 
changes, the same element would still be there.
For movies, I'm afraid the resolution will not changed, but instead, 
most of the time, the duration of the movie will be extended (see all 
the DVD with Director'/Cameraman'/Script'/Producer'/Janitor's cuts, it's 
always the same movie with some additional scenes. I would find it 
easier to have a timeline which state in plain the time, with a comment 
which gives the expected scene such as:

  timeline 0:13:30 // Luke Skywalker enters his room with R2D2
(Ok, format of timeline is hard for the parser, but that's another story)

This way, whenever instead of SW-EP4v1(1978), someone want to use 
SW-EP4v2(198x) or even SW-EP4v3(199y) (until we get SW-EP4v4(20xx),
all he has to do is, using any player, to find that same scene, probably 
  around the original 0:13:30 .

With interpolate, he would have to guess the length of MY version in 
order to guess the time of the original, then perform also a precise 
measure of the full movie length (I have some DVD which have the bad 
authoring Idea of having absolutly NO time code information, which means 
that you cannot jump back twenty minutes after the start [because you 
previously look these twenty minutes two day before], the only way is 
fast-forward... BTW, the player cannot tell you it's twenty minutes 
away, you have to use the wall-clock!).

Side note: beware about the numbering scheme for frames inside a 
seconds, the usage in video software is to number each frame 
continiously from the first up (tagged 0) to the rate (tagged rate -1),
Thus there is 'rate' frames between 1:12:34 and 1:12:35, and they are
1:12:34.0, 1:12:34.1, 1:12:34.2, and so on.
The strange thing is that on a xx fps movie, the next after 1:12:34.xx-1 
is 1:12:35.0 (and not 1:12:34.xx)
Also, there is some fun with the NTSC setting (29,97 is real fun, best 
to considere it at 30 anyway, just droping a frame sometime to keep the 
sound in sync). Also pull-down (24 fps in 30 fps) is an interesting 
perversion.

> I think it should be easy to
> get specified moment of movie by writing in sdl:
> 
>   #macro Time(Hours,Minutes,Seconds,S100)
>     (((Hours*60+Minutes)*60+Seconds)*100+S100)
>   #end
> 


So far so good, but why limit the resolution to 1/100th of second.
#macro Time(Hours, Minutes, Seconds, Fraction)
   (((Hours*60+Minutes)*60+Seconds+Fraction)
#end
With Fraction between 0 and 1.


>   image_map{
>     mpeg "movie.mpg"
>     timeline Time(2,30,46,23)/Time(3,20,21,10)
>   }
> 


That's the part I do not like, having to know and code the total length 
of the movie.


> Making timeline dependant on clock and using motion_blur (I hope it will be
> patched to 3.5) would made movie playing very smooth.
> 
> 
>>the beginning of the files might not be at timecode 0.
>>
> 
> IIRC GIF format can have written position of image. Is it considered when gif
> is loaded as image_map?
> 


Gif support has been removed from 3.5, so that's irrelevant!
But I believe that only the first picture only was decoded...
I do not know, you will have to get the code of 3.1

Was partial image and animation part of the 87a Gif format ? or did they 
come later with the next Gif format format ?


Post a reply to this message

From: ingo
Subject: Re: library finding request
Date: 16 Aug 2002 08:39:19
Message: <Xns926C95C40A8Dseed7@povray.org>
in news:3D5### [at] freefr Le Forgeron wrote:

> Gif support has been removed from 3.5, so that's irrelevant!
> 

6.7.1.5.1  Specifying an Image Map
The syntax for an image_map is:
...
BITMAP_TYPE:
    gif | ......

Ingo


Post a reply to this message

From: ABX
Subject: Re: library finding request
Date: 16 Aug 2002 08:47:51
Message: <mksplukff7p7kajrdg6aovhpj3mrtu59ji@4ax.com>
On Fri, 16 Aug 2002 14:34:21 +0200, Le Forgeron <jgr### [at] freefr> wrote:
> > IIRC GIF format can have written position of image. Is it considered when gif
> > is loaded as image_map?
>
> Gif support has been removed from 3.5, so that's irrelevant!

Are you sure ? Have you readed 6.7.1.5.1 ?

BITMAP_TYPE:
    gif | tga | iff | ppm | pgm | png | jpeg | tiff | sys

> But I believe that only the first picture only was decoded...

I don't mean frame but position on screen.

BTW: there is also my another further patch plan similiar to this mpeg port.
The same feature with sys_anim type of image map where sys_anim means native
animation gate for platform. This could also open gate for avi, divx,
quicktime, real etc.

ABX


Post a reply to this message

From: Le Forgeron
Subject: Re: library finding request
Date: 16 Aug 2002 09:58:17
Message: <3D5D050B.3070908@free.fr>
ingo wrote:

> in news:3D5### [at] freefr Le Forgeron wrote:
> 
> 
>>Gif support has been removed from 3.5, so that's irrelevant!
>>
>>
> 
> 6.7.1.5.1  Specifying an Image Map
> The syntax for an image_map is:
> ...
> BITMAP_TYPE:
>     gif | ......


Ok, my fault... it was removed from Megapov for legal reason, and I did 
not know that the povteam was now outlaw enough to keep the gif code in.


Post a reply to this message

From: Le Forgeron
Subject: Re: library finding request
Date: 16 Aug 2002 10:06:30
Message: <3D5D06F5.2070502@free.fr>
ABX wrote:

> On Fri, 16 Aug 2002 14:34:21 +0200, Le Forgeron <jgr### [at] freefr> wrote:
 
>>But I believe that only the first picture only was decoded...
>>
> 
> I don't mean frame but position on screen.
> 


It does not change the problem. Gif is a blocky format.
You will have to read the code of pov for reading gif to know exactly.
I would assumed that there is a default colour (pixel/palette entry), 
that the whole picture is always rectangular and that pixels that are 
not recovered by an explicit block have that default values.
But that's just a guess, the answer lies in the source only.


> BTW: there is also my another further patch plan similiar to this mpeg port.
> The same feature with sys_anim type of image map where sys_anim means native
> animation gate for platform. This could also open gate for avi, divx,
> quicktime, real etc.


Where is the portability ?
Me think: first make the patch for Mpeg-1, and maybe Mpeg-2.
Then wait, or you might unburry some old propriatary format ?
(Anyone got an FLC or an FLI player ?)
And what is the sys format for windows ? BMP ? AVI ? AWF ? AVF ?
Codec: every month has a new one...


Post a reply to this message

From: ABX
Subject: Re: library finding request
Date: 16 Aug 2002 10:20:19
Message: <a32qlucofml37h494kqsl8qq4767fu0g9r@4ax.com>
On Fri, 16 Aug 2002 16:06:45 +0200, Le Forgeron <jgr### [at] freefr> wrote:
> > BTW: there is also my another further patch plan similiar to this mpeg port.
> > The same feature with sys_anim type of image map where sys_anim means native
> > animation gate for platform. This could also open gate for avi, divx,
> > quicktime, real etc.
>
> Where is the portability ?

Where is the portability of sys image format ?

> Me think: first make the patch for Mpeg-1, and maybe Mpeg-2.

That was my intention :-)

> Then wait, or you might unburry some old propriatary format ?
> (Anyone got an FLC or an FLI player ?)

I don't think there is a sense to implement those ancient formats.

> And what is the sys format for windows ? BMP ? AVI ? AWF ? AVF ?

Every if internal library can send it to platform codec and has an answer it
is recognized and can return content of frame.

> Codec: every month has a new one...

Well, my intention is not to break portability but to make live of animators
easier.

ABX


Post a reply to this message

Goto Latest 10 Messages Next 8 Messages >>>

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.