[MPlayer-dev-eng] mencoder thoughts

D Richard Felker III dalias at aerifal.cx
Tue Jun 18 07:31:46 CEST 2002


I noticed on -users some people have been complaining about mencoder
not being able to split files well with -ovc copy, since it doesn't
properly seek to keyframes. On possible fix to this is of course
adding a way to force the seek to the nearest keyframe, but that can
be ugly, since most encoders don't put keyframes at big scene changes
where it's most convenient to split a movie.

Now, this sounds a little difficult, but here's another possible fix
for the problem. What if, for supported codecs (basically just mpeg1
and mpeg4 variants), we had a -ovc smartcopy option, where mencoder
would seek to the previous keyframe before where the split is supposed
to happen, decode up to the first frame after the split, and then use
libavcodec to encode a new single I-frame to begin the movie. Then the
following B- and/or P-frames should (theoretically) pick up right
after the newly encoded I-frame, with minimal or no loss of quality.
Of course I've never actually seen this done, so I don't know for sure
whether it would work, but it seems at least plausible. And it would
certainly be very cool to be able to split a movie anywhere without
reencoding but one frame.

Thoughts, anyone? I might could even try implementing this if I knew a
bit more about how mplayer's streams work -- in particular, seeking
back to the previous keyframe.

Rich





More information about the MPlayer-dev-eng mailing list