[MEncoder-users] -ss and -endpos cutting creates very visible h264 artifacts

Reimar Döffinger Reimar.Doeffinger at gmx.de
Sun Feb 28 08:08:07 CET 2010


On Sat, Feb 27, 2010 at 10:15:04PM -0800, Marc MERLIN wrote:
> On Tue, Feb 23, 2010 at 11:37:57PM -0800, Marc MERLIN wrote:
> > I sometimes trim videos like this:
> > mencoder -oac copy -ovc copy  -ss 0 -endpos 4:00 source.avi -o dest.avi
> > 
> > This worked fine until I started doing it with h264 encoded videos.
> > 
> > Problem is that the first resulting keyframe isn't computed right and
> > you get very visible artifacts like here:
> > http://www.youtube.com/watch?v=AZJkFHWaTRI
> > (see upper right of the picture for the first 10 seconds)
> > 
> > I'm using SVN-r29237-4.4.1.
> > 
> > Is there a fix to this problem?
> 
> I've been working on that one a bit more.
> 
> Is whoever is using h264 using other tools to cut an h264 video?
> 
> Looking at it again, it may just be that cutting an h264 video without
> re-encoding it, is not possible due to the time between consecutive
> keyframes. Is that correct?

Cutting it exactly at the right point usually is not possible with most video
formats, however the specific issue here is probably that keyframes are not marked
as such in the avi file. How was it created?
Copying the video completely into a different format forst, e.g. mkv, with ffmpeg or mkvmerge
or so might fix it...


More information about the MEncoder-users mailing list