0

I have some cartoon animation stored in MPEG-2 video that I would like to convert to MPEG-4/h264.

The MPEG-2 video compression is rather bad, with both "small" JPEG artefacts around details in the picture and larger JPEG blocks that change slightly hue for each frame.

The compressed file gets rather large, because I guess ffmpeg tries to preserve as much of the original as possible, which also means presering all the wrongdoings of the MPEG-2 compression.

Since the animation originally consisted of large flat color surfaces that would have been a video compressor's dream, is there a smart way to say:

"Take large color surfaces that are almost the same color, and make them a single color as to compress them extremely efficiently?"

In other words, to both optimise file size and video quality by removing the damage done by MPEG-2.

The ffmpeg option -tune animation saved a little file size, but not much. Also, decreasing general video quality just introduces "new" compression damages on top of the old ones.

1 Answer 1

1

Postprocessing

Genrally, crap in = crap out, but you could possibly make it look "better" with one of the many FFmpeg postprocessing filters: fspp, pp, pp7, spp, uspp.

original
original image with typical artifacts

postprocessed
postprocessed image

Example command

ffmpeg -i input.mpg -vf "pp=hb/vb/dr/fq|8" -c:v libx264 -crf 23 -preset medium \
-tune animation -c:a copy output.mkv

Use your player instead

Some players, such as VLC (VideoPost processing), may contain postprocessing features, so it could be a better choice to simply use that instead of re-encoding.

Or use ffplay to play or preview the filtering:

ffplay -vf "pp=hb/vb/dr/fq|8" -i input.mpg

Also see

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .