[FFmpeg-devel] [PATCH 1/2] avdevice/decklink_dec: mark the field flag if framerate > 30FPS

Marton Balint cus at passwd.hu
Wed Jul 29 23:16:33 EEST 2020



>>> > > > > > if you tested with SDI with TC.
>>> > > > > > 00:00:00:24
>>> > > > > > 00:00:00:24
>>> > > > > > 00:00:00:00
>>> > > > > > 00:00:00:00

I did tests, and depending on which timecode you select, and the timecode 
formats which are available in the SDI signal, this really can be the 
case, so you were right that the decklink API usually does not provide the 
proper timecode as string, only the value of "raw" timecodes in the 
signal, regardless of used frame rate.

I could not test, but assume that if a high frame rate timecode is 
detected then valid string timecode is returned. Otherwise max 30fps 
timecode.

>>> > I have tested with bmdTimecodeFieldMark
>>> > flag, it's not set as expected for testing. I have no clue how to get
>>> > the flag as the API provide the TC string is same for the frame pair.
>>> > Maybe I miss something.

SMPTE ST 12-2 has a good overview of the used signalling in section 7. 
Basically for 50/60 fps different timecode types (VITC1, VITC2) are used 
for different parity frames.

We have to be smart here to generate proper timecode, because the decklink 
API does not tell you which timecode it had found for an rp188any query... 
I suggest the following:

- If the user selects high frame rate timecode (not available as an
   option at the moment, but can be added), then use that directly.
- If the user selects rp188any then
   - Query high frame rate timecode, if exists use that directly.
   - Otherwise
     - for <= 30fps query rp188any and use that directly
     - for > 30fps
       - query VITC1, if exists use that with frame doubling and field flag
         checking
       - otherwise query VITC2, if exists use that with frame doubling
         and field flag checking
       - otherwise query LTC, if exists use that with frame doubling and
         field flag checking
       - note that this special ordering of querying the timecode types
         is slightly different from what the decklink API does and it
         should be mentioned in the docs.
- Otherwise
   - for <= 30fps query the selected timecode and use that directly
   - for > 30fps query the selected timecode and use that with frame
     doubling and field flag checking

Also probably it is better to use IDeckLinkTimecode->GetComponents() and 
use av_timecode_get_smpte() instead of using the string value.

Regards,
Marton


More information about the ffmpeg-devel mailing list