mkv and automated screencaps

Microsoft Windows specific usage questions
Forum rules
Please post only Windows specific questions in this forum category. If you don't know where to post, please read the different forums' rules. Thanks.
Barbara
Blank Cone
Blank Cone
Posts: 19
Joined: 20 Aug 2006 18:15
VLC version: 1.2.0 git

mkv and automated screencaps

Postby Barbara » 02 Nov 2007 21:08

I've been using vlc to take automated screencaps for quite some time now and I dind't have any problems until I decided to use it with mkv files (720p.HDTV.X264)
First off, when I tried to play the file the playback was dead slow, the video was full of artifacts and the audio was out of synch so obviously there was no way I could obtain good screencaps from it. Then I searched the forums, disabled the overlay and the video plays just fine.
Problem is, I still cannot take automated caps. If I set the output format to png the caps are big and slow to generate, some are even missing, if I select jpg the images are pixelated and the quality is really bad.
Is there a way I could fix this?

goa103
Blank Cone
Blank Cone
Posts: 31
Joined: 07 Jun 2004 23:19

Re: mkv and automated screencaps

Postby goa103 » 03 Nov 2007 09:33

I've been using vlc to take automated screencaps for quite some time now and I dind't have any problems until I decided to use it with mkv files (720p.HDTV.X264)
Well you're luckier than me because the "screencaps" I get doesn't match the quality of the played video. There colors are always different, fade I would say. But it doesn't really matter…
First off, when I tried to play the file the playback was dead slow, the video was full of artifacts and the audio was out of synch so obviously there was no way I could obtain good screencaps from it. Then I searched the forums, disabled the overlay and the video plays just fine.
Weird as the overlay is supposed to speed up things. How did disabling the overlay solve your problem ?
Problem is, I still cannot take automated caps.
Some questions :
  • Well first does the problem only happen with one video ?
  • Did you try to take "screencaps" from other videos now you have disabled the overlay ?
  • How do you "take automated caps" ? Do you use the "Snapshot" feature from the "Video" menu ? I think it can be done using some command-line dark magic but I have never tried it yet :twisted:
If I set the output format to png the caps are big and slow to generate, some are even missing, if I select jpg the images are pixelated and the quality is really bad.
IMHO taking snapshots in PNG is not a good idea, it uses a lossless compression algorithm, it's not destructive. That's why the output files are so large, but I don't think generating them should be slow.

About the JPEG format, it's really a shame there's no option to select the quality/compression level. I don't know what's the compression algorithm used but balancing the quality/compression ratios would allow to get high quality snapshots. No visible pixelation what so ever.

For the moment my solution is to batch convert my PNG snapshots to JPEG.

Barbara
Blank Cone
Blank Cone
Posts: 19
Joined: 20 Aug 2006 18:15
VLC version: 1.2.0 git

Re: mkv and automated screencaps

Postby Barbara » 03 Nov 2007 12:53

Weird as the overlay is supposed to speed up things. How did disabling the overlay solve your problem ?
I have no idea but it works, at least I can play it.
If the overlay is enabled the video is pixelated, out of synch and most of the times it freezes between scenes. This only happens with large mkv files.
And I don't think it has something to do with my hardware because I can play those files in other players just fine.

  • Well first does the problem only happen with one video ?
  • Did you try to take "screencaps" from other videos now you have disabled the overlay ?
  • How do you "take automated caps" ? Do you use the "Snapshot" feature from the "Video" menu ? I think it can be done using some command-line dark magic but I have never tried it yet :twisted:
To answer your questions:
It only happens with mkv files, every one of them.
I tried with smaller avi files and I can take caps when the overlay is disabled.
I use the Image video output, the ratio is set to 12. Really easy and fast. :)

For the moment my solution is to batch convert my PNG snapshots to JPEG.
Screencapping in png and then batch converting to jpeg is what I always do. I would do it this time too but the problem with mkv is that the player skips most of them. Where is supposed to take say 20 screencaps, I'm lucky if I get 5. That's why I was saying they're slow to generate. Some don't even generate at all :(

goa103
Blank Cone
Blank Cone
Posts: 31
Joined: 07 Jun 2004 23:19

Re: mkv and automated screencaps

Postby goa103 » 05 Nov 2007 20:24

I have no idea but it works, at least I can play it.
If the overlay is enabled the video is pixelated, out of synch and most of the times it freezes between scenes. This only happens with large mkv files.
And I don't think it has something to do with my hardware because I can play those files in other players just fine.
Maybe VLC doesn't properly handle the overlay features of your hardware. It depends of what your .mkv files contain. What's the codec used for the video tracks ? What about the audio ?
To answer your questions:
It only happens with mkv files, every one of them.
I tried with smaller avi files and I can take caps when the overlay is disabled.
I use the Image video output, the ratio is set to 12. Really easy and fast. :)
So from the Documentation:Modules/image Wiki article it seems 1 out of 12 images should be recorded. When you meant "screencaps" I thought you meant something like… record 1 image every minute ! Depending of your hardware and video dimensions, VLC might not be able to both decode the video and encode snapshots as PNG or JPEG files. It's the same problem with video games and framerate, it lags if your hardware is not powerful enough. I think the only solution is to set a higher ratio.

Why do you need to record so many images per second ?
Screencapping in png and then batch converting to jpeg is what I always do. I would do it this time too but the problem with mkv is that the player skips most of them. Where is supposed to take say 20 screencaps, I'm lucky if I get 5. That's why I was saying they're slow to generate. Some don't even generate at all :(
As explained it's logical, you're asking too much. The higher the video dimensions, the less images are recorded. When I meant compressing an image to PNG wasn't processor greedy, I meant if you have 5 seconds to wait :). In some way you're just asking your hardware & VLC to encode your videos in real-time at 2 FPS, in PNG or JPEG. I think "screencapping" is not the solution, you should try an other solution…

For example why do you need to real-time output the video as images ? Can't you just use VLC as a batch processing tool ? A simple script to execute it with a different seek position, and output the current frame as an image. It would work for all videos and would take far much longer than the video duration but at least you would get all the images you need. You could even use a smaller ratio. Try 1 ? Please don't… just kidding :D

DJ
Cone Master
Cone Master
Posts: 8206
Joined: 01 Jan 2006 04:30
Location: Koloa, Hawaii USA

Re: mkv and automated screencaps

Postby DJ » 06 Nov 2007 02:40

1. Screen captures should not happen with the overlay turned off or at least it won't be reliable from the command line. Overlay off = pnt sc or other capture software.

2. Matroska (MKV) is a container and NOT a format. Matroska has nothing to do with the screen capture function, but is dependent on the format. If the format is h.264 (NOT x264 (which is a h.264 encoder)) your machine may be to slow (or marginal) to do 720p. Open your task manager and look at CPU usage. If the usage is 90% or so try changing the "Skip the loop filter for h.264 decoding" from none to all in Preferences, Input / Codecs, Other codecs, FFmpeg.

3. png or jpg is a user choice here and should have little to do with the issue other than the time to generate the file for a slow machine (CPU overhead).


Return to “VLC media player for Windows Troubleshooting”

Who is online

Users browsing this forum: No registered users and 47 guests