[MPlayer-dev-eng] [PATCH] appending with mencoder

Arpi arpi at thot.banki.hu
Mon Jan 6 22:04:39 CET 2003


Hi,

> i wrote an append patch for mencoder - so that it can
> concatenate 2 avi files. so far i made it work with oac/ovc "copy" in both
> cbr and vbr films.
> it did not work when i tried with oac mp3lame on an ac3 audio movie.
> 
> the way i do it is add few more variables to mirror *demuxer, *stream,
> *sh_*, and use them to open the second file, then in mencoder's main loop
> when the at_eof gets triggered, i switch the variables to the new ones, and
> thus continue until they are done too. this is just about 20-30 lines of
> code added to mencoder.c plus the option "-append" added to cfg-mencoder.h,
> which takes the second filename.

actually this is an ugly mess / hack :(
we should use the playtree (playlist+per-file configs) there, and the
current code extended with a condition.
somewhat:

main(){
  while(there are more files){
    if(first_file){
	initialize headers, codecs
	open output file (init muxer layer)
    } else {
	check if headers are compatible, stop with error otherwise
    }
    process file
  }
  close muxer, print stats
}

this way even appending different format files (even different codec,
size whatever) could be possible (scaled to the same size & framerate)


A'rpi / Astral & ESP-team

--
Developer of MPlayer, the Movie Player for Linux - http://www.MPlayerHQ.hu


More information about the MPlayer-dev-eng mailing list