POV-Ray : Newsgroups : povray.unix : library finding request : Re: library finding request Server Time
6 Oct 2024 10:37:14 EDT (-0400)
  Re: library finding request  
From: Le Forgeron
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

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