Page 1 of 1

Bug? PNG snapshots truncated to 3071KB

Posted: 28 Aug 2006 02:14
by zorg47
I'm playing 1920x1080 MPEG2 movies in VLC 0.8.5 on Win2k SP4. When I press Ctrl-Alt-s to save a snapshot, VLC truncates the PNG file to 3071 kilobytes, plus or minus approximately one kilobyte. That corrupts the PNG, unless the particular movie frame has low detail, in which case PNG naturally compresses it somewhat smaller than 3071 kilobytes, so no truncation occurs.

I tried disabling the snapshot preview, and tried pausing before taking the snapshot, but neither helped.

If I select JPG instead of PNG, the snapshot files are fine (and much smaller), however I don't like the compression artifacts. I don't see any way to select higher JPEG quality.

I haven't tried digging into the source code to find the culprit.

Posted: 28 Aug 2006 17:35
by The DJ
It's a physical limitation of the screenshot ability that we are aware of. We hope to fix it in the future, but not sure when.

Posted: 29 Aug 2006 23:54
by zorg47
Ok thanks. I increased the value in this line:

#define AVCODEC_MAX_VIDEO_FRAME_SIZE (3*1024*1024)

which appears in these two files:

modules\codec\ffmpeg\encoder.c
modules\stream_out\switcher.c


and now my PNG snapshots work fine. I don't know if these changes broke anything else.

Posted: 30 Aug 2006 00:44
by The DJ
It just makes the setup proces slower. We should make this more dynamic in the future.
I'll try to look at this tomorrow if I can do this fast.

Posted: 14 Sep 2006 05:38
by GeorgeLV
I run into this bug all the time when taking screenshots from transport streams I've recorded from my HDTV tuner. A quick fix would be much appreciated.