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

Oded Shimon ods15 at ods15.dyndns.org
Tue Feb 8 10:27:35 CET 2005


As most of you probably know, I've been working on multiple file support for 
MEncoder. this patch is a "first draft". Things which could be improved:
1. Somehow remove redundancy by not having most of the same video init code 
twice. The init for each next file is a little different from the first file, 
so I couldn't just 'goto' to before the init, but repetitive code is always 
bad...
2. Better support for audio - as is, if the user specifies '-af' it only 
affect the first file. Also no checks are made against merging 2 files which 
have different audio
3. Fixing most of the MEncoder options to be properly global. As is, '-ovc' 
and '-oac' for ex. are "per file" options, not the most desireable 
situation...
4. Perhaps improving dealing with bad merging of files?  As is, if the user 
asks to merge 2 files which are of different resolution, MEncoder exits with 
error when reaching the second file - a possibly depressing result if the 
user waited a long time for the encode of the first file. The user can still 
do this however, and it will work perfectly:
mencoder 1.avi 2.avi -vf scale=whatever
And only the 2nd file will be scaled, as necessary.
5. Patching the man page as necessary of course...

Whats in this patch:
1. A goto label before begginning to read the first file, and an entire 
re-initing of the demuxer for each file.
2. Audio cutting according to -endpos or -frames, so transition between files 
is smooth. -frames was done with a slight hack - multiplying the rest of the 
frames with the fps of the output file. Should work in any situation I can 
think of, unless frames were skipped/duplicated, but the code will "fix 
itself" in this situation, the only defect would be not a perfect 
audio-preload.
3. After the first frame of every movie, Resolution is checked against the 
previous movie, unless direct stream copy or frameno was chosen.
4. Some error messages in cases of video files mismatch in help_mp-en.h .

All tests I made were successful, including direct stream copy of audio and/or 
video, frameno, merging bad files, etc. etc.
I don't understand and have never used this 3-pass "audio-only" think, so 
there might be issues with it. No reason why there should be, but it was 
never tested...

- ods15
-------------- next part --------------
A non-text attachment was scrubbed...
Name: help_mp-en.patch
Type: text/x-diff
Size: 876 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20050208/3dcedbef/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mencoder.patch
Type: text/x-diff
Size: 11047 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20050208/3dcedbef/attachment-0001.patch>


More information about the MPlayer-dev-eng mailing list