How to frame movie without any artifacts?

Get frames from video using ffmpeg (or MPlayer - The Movie Player) by setting the time stamp saving frame to a file. In principle, it works, but on some movies daub. However, if you play a video, then that's OK. It is clear that this is a problem with the encoding(decoding) and the search key frame.
Can we improvethe this problem without decoding the entire movie from beginning to timestamp?

To receive frame use this list of commands:
L"mplayer.exe -slave \"fullpath.mkv\" -really-quiet -nosound -vo jpeg:outdir=\\\"outpath.jpg\\\" -frames 1-ss %u"


information about the encoder, derived from MediaInfo.dll

Unique ID: 219569894619963036230858554311364138418 (0xA52F9F9D4458C290B00900F3BA9555b2)
Complete name: ivideo\Jean Reno\2005 - the Empire of the wolves.mkv
Format: Matroska
Format version: Version 4 / Version 2
File size: 2.39 GiB
Duration: 2 h 8 min
Overall bit rate: 2 662 kb/s
Encoded date: UTC 2015-05-24 0737
Writing application: mkvmerge v7.6.0 ('Garden of Dreams') 64bit built on Feb 8 2015 1344
Writing library: libebml v1.3.1 + libmatroska v1.4.2

ID: 1
Format: AVC
Format/Info: Advanced Video Codec
Format profile: High@L4.1
Format settings, CABAC: Yes
Format settings, ReFrames: 5 frames
Duration: 2 h 8 min
Bit rate: 2 499 kb/s
Width: 1 024 pixels
Height: 432 pixels
Display aspect ratio: 2.40
Frame rate mode: Constant
Frame rate: 23.976 (24000/1001) FPS
Color space: YUV
Chroma subsampling: 4
Bit depth: 8 bits
Scan type: Progressive
Bits/(Pixel*Frame): 0.236
Stream size: 2.24 GiB (94%)
Language: English
Default: Yes
Forced: No

ID: 2
Format: AAC
Format/Info: Advanced Audio Codec
Format profile: LC
Codec ID: A_AAC
Duration: 2 h 8 min
Bit rate: 160 kb/s
Channel(s): 2 channels
Channel positions: FrontL R
Sampling rate: 48.0 kHz
Frame rate: 46.875 FPS (1024 spf)
Compression mode: Lossy
Stream size: 147 MiB (6%)
Language: Russian
Default: Yes
Forced: No
April 4th 20 at 13:29
1 answer
April 4th 20 at 13:31
Try to pull from the video not the frame and the fragment. Empirically it is possible to choose the length of to make sure you got a keyframe.
Of the cut fragment, saved without compression, you can separate the call to ffmpeg to the last frame.
Sounds plausible, although much slower. Direct guaranteed-exactly the image I is not important. I need a storyboard from video to there plus or minus does not matter where, just more or less evenly pull the frames. 10. - Pablo.Spor commented on April 4th 20 at 13:34
Then you can pull a few consecutive frames (at least three) and a couple of nearby least different from each other, choose any one. This is the case if the broken frames single.
Another broken frame can be recognized using OpenCV and Python PIL (Pillow). Just take and consider the median of the colors of all pixels of the image. If the median is suspiciously close to medium gray, frame bad. So re-samples choose not broken. - King.Weimann72 commented on April 4th 20 at 13:37
@King.Weimann72, all 10 frames to get these. Ie it is not a problem of one frame, namely the problem of the whole video. This particular video, other movies with other encoders are fine shots taken. - Pablo.Spor commented on April 4th 20 at 13:40
@Pablo.Spor, so it turned out cut out detail without artifacts? Give a link, at least on a buggy video itself try. - King.Weimann72 commented on April 4th 20 at 13:43
@King.Weimann72, No, a fragment not yet tried to do. The film was downloaded a long time ago, no links. but a spoiler is information about the encoder. Besplatna information... - Pablo.Spor commented on April 4th 20 at 13:46
@King.Weimann72, In the console writes "co located POCs unavailable". Apparently, you just need to score on such broken files. - Pablo.Spor commented on April 4th 20 at 13:49

Find more questions by tags VideoFFmpeg