I use the ActiveX Control "VLC ActiveX Plugin and IE Web Plugin v2", to let the user play videos and go frame by frame through the video. Now I have difficulties to jump to everey frame in some videos.
Since I control the AX Control with LabVIEW, which is a quite uncommon programming language, I try to describe the code with Pseudo-Code:
Code: Select all
VLCPlugin2.playlist.clear(); // Clear Playlist
VLCPlugin2.playlist.add(uri:"file:///C:\video.mp4"); // Set Video-Path
VLCPlugin2.playlist.parse(options:0; timeout_ms:100); // retrieve informations about video, so later I can get VLCPlugin2.input.length & .fps
VLCPlugin2.playlist.playItem(itemid:0); // start video playback
do
{
delay (10ms);
} while (!VLCPlugin2.playlist.isPlaying); // stop loop when playback started
VLCPlugin2.playlist.pause(); // pause playback, in this state it is possible to show first frame
VLCPlugin2.input.position = 0; // show first frame
fps = VLCPlugin2.input.fps;
FrameTime_ms = 1000 / fps; // For 50 fps -> 20ms FrameTime
...
// To go frame by frame I use this
VLCPlugin2.input.time = FrameTime * FrameNo + Offset_ms;
...
Code: Select all
time / ms | shown
0 | T
20 | T
40 | T
60 | F
80 | T
100 | T
120 | F
140 | T
160 | T
180 | F
...
I can go with the VLC player frame by frame (Keystroke E), every frame is shown.
I extracted the video meta information of the video with ffmpeg, the appropriate information is:
Code: Select all
[mov,mp4,m4a,3gp,3g2,mj2 @ 000001b09fbb8240] st: 0 edit list: 1 Missing key frame while searching for timestamp: 3600
[mov,mp4,m4a,3gp,3g2,mj2 @ 000001b09fbb8240] st: 0 edit list 1 Cannot find an index entry before timestamp: 3600.
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '2024_08_K1D_200_Laberer_WA.MP4':
Metadata:
major_brand : mp42
minor_version : 1
compatible_brands: mp42hvc1
creation_time : 2024-08-19T09:12:01.000000Z
Duration: 00:00:59.04, start: 0.000000, bitrate: 95381 kb/s
Stream #0:0(deu): Video: hevc (Main 10) (hvc1 / 0x31637668), yuv420p10le(tv, bt709), 3840x2160 [SAR 1:1 DAR 16:9], 95087 kb/s, 50 fps, 50 tbr, 180k tbn, 50 tbc (default)
Code: Select all
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'Frames.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2mp41
encoder : Lavf58.26.101
Duration: 00:00:40.00, start: 0.000000, bitrate: 1656 kb/s
Stream #0:0(und): Video: mpeg4 (Simple Profile) (mp4v / 0x7634706D), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 1655 kb/s, 25 fps, 25 tbr, 12800 tbn, 25 tbc (default)
Could this be a bug in the ActiveX control?
Greets, Dave