[MPlayer-dev-eng] [PATCH] Multiple files for MEncoder

Oded Shimon ods15 at ods15.dyndns.org
Fri Feb 25 16:57:32 CET 2005


On Friday 25 February 2005 16:49, Matthias Schwarzott wrote:
> > I never tested the patch in 2 pass, so, good for pointing that out.
> > There are 3 possible solutions:
> > 1. make -divx2pass a per file option, or even append to it a _1
> > automatically. Easy, but not the best.
>
> I think this does not garantue a fair bit-distribution over all files, ie
> one simple and one complex file of same length.
Well...
> > 2. make some vfctl to make MEncoder communicate with the ve after each
> > file what frame we are up to. Possible, but hackish.
.. This too would give those results. This VE would still be uninited and 
hence no fair distrobution.

> > 3. Find some way to uninit the video without uniniting the VE, and use
> > that same VE for all the next files. Ideal, but hardest...
> > Anyone have a better suggestion?... I'm gonna try to do 3 for now
>
> Both 2 and 3 sound correct IMO.
OK, 3 is getting to seem more and more impossible. :(
The problem is, the ve_lavc for ex., does not allow its config to be called 
twice! Meaning if I use the same inited VE, and run the config again, 
MEncoder will close with error on second file. :(
I need to find a way to make subsequents configs not config the VO/VE... I 
doubt this is possible. Also, my resolution check, the one that make sure you 
give sane input, depends on the VE's knowledge of the resolution. If no 
config is called, the VE would not be up to date with the new file's 
resolution, would possibly segfault, and if not, the check would SUCCEED 
instead of failing.

BTW, I managed to hack lavc to agree to be called 'config()' more than once... 
What I cannot understand is why this limitation was added, as testing it out 
proved to be working flawlessly...
Maybe I should fix that?.. Check that all the VE's don't mind having their 
config() being called twice?... This would make even the resolution check 
work Ok!...

(somewhere in libavcodec's code there is literally something like
if (configed) return error;
I just changed it to 'return 0;' ....)

I just noticed something rather silly though - lavc's stat file opening is in 
the config() ! Haha, meaning, keeping the VE inited but running config() 
twice would STILL override the stats file. :)
But, just as easily, a check could be added in there,
if (!configed && twopass) load_stats...



> > > Is there a possibility to seek to any point in the concatenated files
> > > and encode exactly n frames oder n seconds from that point.
> >
> > Hmm, what do you mean, do you mean something like this?
> >
> > mencoder a.avi -ss 5 -frames 500 b.avi -ss 30 -frames 1000 ....
> >
> > This was the design I intended all along for this.
>
> What I meant was a more abstract sense. View all files given on commandline
> as one big file and then jump to positions in this big file.
>
> Example
> 1.avi - 1000frames
> 2.avi - 2000frames
> 3.avi - 2000frames
>
> mencoder -jumptoframe 1500 -totframes 2500 1.avi 2.avi 3.avi
>
> should start encoding at frame 1500 which is frame 500 in 2.avi and encode
> 2500 frames from this point, meaning up to frame 1000 in 3.avi.
Ahh, I see... Well this TBH is very complicated and probably not possible - 
MEncoder doesn't know before hand the amount of frames in the files it's 
encoding. Build yourself some script which does this by itself... This cannot 
easily, and IMO shouldn't at all, be added to MEncoder. It means not encoding 
every file given to it as a param.
.
- ods15




More information about the MPlayer-dev-eng mailing list