Catch keyframe of a mkv file

mkvmerge like most of the other soft cut an mkv video on a keyframe. If we don’t give a time corresponding to a keyframe, mkvmerge will identify the first keyframe time following the one given and used it to cut.

is mkvmerge or any other soft (mkvinfo, …) capable of identifying all keyframe time through command line? My aim would be to know all keyframe time of a mkv file (hh:mm:ss:nnn or hh:mm:ss:nnnnnnnnn)

You can use mkvinfo in summary for for that, e.g. mkvinfo -s yourfile.mkv It outputs one line per track and one line per frame. Those formats are easy enough to parse, I guess.

If you need to redirect the output to a file, add -r output.txt

Thanks I see all frame time.

A mkv is composed of keyframe which are time marker. It is only few of the frames and the one used by mkvmerge to cut mkv file.
I guess mkvinfo doesn’t give the information which frame are time marker?

here is an extract of what i get with mkv info

Piste 1 : vidéo, identifiant du codec : V_MPEG4/ISO/AVC (profil AVC/H.264 : High @L4.0), ID de piste mkvmerge/mkvextract : 0, langue : und, durée par défaut : 41.708 ms (23.976 trames/champs par seconde pour une piste vidéo), largeur (pixels) : 1920, hauteur (pixels) : 1080
Piste 2 : audio, identifiant du codec : A_AAC, ID de piste mkvmerge/mkvextract : 1, langue : ger, canaux : 2, fréquence d’échantillonnage : 44100, fréquence en sortie : 44100, bits par échantillon : 32
I trame, piste 1, horodatage 00:00:00.000000000, taille 1184, adler 0x29661ee8
I trame, piste 2, horodatage 00:00:00.000000000, taille 371, adler 0x5a3da173
I trame, piste 2, horodatage 00:00:00.023000000, taille 372, adler 0x07eba247
P trame, piste 1, horodatage 00:00:00.042000000, taille 77, adler 0x8c920661
I trame, piste 2, horodatage 00:00:00.046000000, taille 371, adler 0x5a3da173
I trame, piste 2, horodatage 00:00:00.070000000, taille 372, adler 0x07eba247
P trame, piste 1, horodatage 00:00:00.083000000, taille 81, adler 0xfac407db
I trame, piste 2, horodatage 00:00:00.093000000, taille 371, adler 0x5a3da173
I trame, piste 2, horodatage 00:00:00.116000000, taille 372, adler 0x07eba247
P trame, piste 1, horodatage 00:00:00.125000000, taille 81, adler 0xfa5107e4
I trame, piste 2, horodatage 00:00:00.139000000, taille 371, adler 0x5a3da173
I trame, piste 2, horodatage 00:00:00.163000000, taille 372, adler 0x07eba247
P trame, piste 1, horodatage 00:00:00.167000000, taille 82, adler 0x5b90093d
I trame, piste 2, horodatage 00:00:00.186000000, taille 371, adler 0x5a3da173
P trame, piste 1, horodatage 00:00:00.209000000, taille 82, adler 0x6450095d
I trame, piste 2, horodatage 00:00:00.209000000, taille 372, adler 0x07eba247
I trame, piste 2, horodatage 00:00:00.232000000, taille 371, adler 0x5a3da173
P trame, piste 1, horodatage 00:00:00.250000000, taille 82, adler 0x6d10097d
I trame, piste 2, horodatage 00:00:00.255000000, taille 372, adler 0x07eba247
I trame, piste 2, horodatage 00:00:00.279000000, taille 371, adler 0x5a3da173
P

In case i am not clear because i am not an expert at all.

i use option --split parts:00:00:01.000-00:01:00.000
but mkvmerge replaced by 00:00:02.002000000-00:01:00.060000000 because both are time marker. I would like to identify each time marker of a video i order to after choose the more appropriate one to cut my video.

here is an extract of mkvmerge when i cut a video

#GUI#splitting_before_timestamp 00:00:02.002000000
Horodatage utilisé pour la scission : 00:00:02.002000000
Les entrées CUE (l’index) sont en cours d’écriture…
#GUI#splitting_before_timestamp 00:01:00.060000000
Horodatage utilisé pour la scission : 00:01:00.060000000
Le multiplexage a pris 1 seconde.

What you need from the output of mkvinfo are the I frames of the video track.

right it is exactly what i need. Thanks a lot

For my knowledge, could you tell me what are B and P trame ? Thanks a lot in advance