Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > VirtualDub, VDubMod & AviDemux

Reply
 
Thread Tools Search this Thread Display Modes
Old 23rd February 2018, 01:13   #1  |  Link
dosdan
Registered User
 
Join Date: Sep 2003
Posts: 59
Difference between (K) & (I)?

I'm using Virtualdub FilterMod. I know that (K) is a keyframe but what's (I)? Is this an IDR-frame?

Dan.
dosdan is offline   Reply With Quote
Old 23rd February 2018, 02:58   #2  |  Link
raffriff42
Retried Guesser
 
raffriff42's Avatar
 
Join Date: Jun 2012
Posts: 1,373
'K' is from the original Vdub code, 'I' ('Intra') is from ffmpeg-based code. Probably.
https://github.com/FFMS/ffms2/blob/m...s2-avisynth.md
Quote:
FFPICT_TYPE

The picture type of the most recently requested frame as the ASCII number of the character listed below. Use Chr() to convert it to an actual letter in Avisynth. Use after_frame=true in Avisynth's conditional scripting for proper results. Only set when rffmode=0. The FFmpeg source definition of the characters:

I: Intra
P: Predicted
B: Bi-dir predicted
S: S(GMC)-VOP MPEG4
i: Switching Intra
p: Switching Predicted
b: FF_BI_TYPE (no good explanation available)
?: Unknown
raffriff42 is offline   Reply With Quote
Old 23rd February 2018, 04:09   #3  |  Link
dosdan
Registered User
 
Join Date: Sep 2003
Posts: 59
Here's a 5s clip (29 MB) MP4 from a Panasonic HC-V770 camcorder. It's nominally 50Mbps 1080p50. I've losslessly cut it on key-frames using ADM:

https://dl.dropboxusercontent.com/s/...p50%20clip.mp4

The GOP length appears to be 24 frames.

The latest Vdub Filtermod still reports the frame-type sequence as:

KBIBBPBBPBBPBBPBBPBBPBBP

I'm hoping someone can confirm this sequence and explain why the 3rd frame in this sequence is showing as (I)?

Dan.

Last edited by dosdan; 23rd February 2018 at 05:23.
dosdan is offline   Reply With Quote
Old 23rd February 2018, 04:47   #4  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,346
coded order (how it's stored) can differ from display order (what you see)

In display order, the first frame, frame zero, is a "B" frame . I don't know why it uses "K" notation for this . The I is correct for display order (it's frame 2 starting counting from zero) . In coded order the I-frame is zero.
poisondeathray is offline   Reply With Quote
Old 23rd February 2018, 06:26   #5  |  Link
dosdan
Registered User
 
Join Date: Sep 2003
Posts: 59
Vdub FilterMod offers two ways of opening a file:

Caching Input Driver
FFMPEG

The program was using the caching input driver to open the clip. When I switched it to FFMPEG the frame-types changed to:

BBIBBPBBPBBPBBPBBPBBPBBP

So it appears to be coming from the caching input driver. I'll start a ticket to see if I can find out what's going on.

Dan.

Last edited by dosdan; 23rd February 2018 at 06:30.
dosdan is offline   Reply With Quote
Old 23rd February 2018, 13:24   #6  |  Link
shekh
Registered User
 
Join Date: Mar 2015
Posts: 775
K identifies keyframe. AFAIK the real keyframe is supposed to be IDR but here it is offset for some reason.
I noticed this behavior long ago: when the stream begins with B-frames the "keyframe" flags are offset. In theory it should be BBKBBP...
Unfortunately dealing with keyframes in FFmpeg is unsupported/loose. What I have is best guess effort.
__________________
VirtualDub2
shekh is offline   Reply With Quote
Old 5th March 2018, 20:04   #7  |  Link
kolak
Registered User
 
Join Date: Nov 2004
Location: Poland
Posts: 2,843
ffmpeg should distinguish IDR frames which are key frames and "normal" I frames.
Not every I frame has to be an IDR frame.


This is an explanation from x264 thread:

IDR-Frame clears the reference picture buffer, i.e. no frame after IDR can reference any frame before IDR. That's not the case with "normal" I-Frame, i.e. P- or B-Frame after I-Frame can use as reference frames before I-Frame.

In other words: You are always "cleanly" start decoding at an IDR-Frame, which is not (in general) possible with a "normal" I-Frame.

Last edited by kolak; 5th March 2018 at 20:06.
kolak is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 19:51.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.