[FFmpeg-devel] [PATCH] Limited timecode support for lavd/decklink

Dave Rice dave at dericed.com
Thu May 31 17:59:02 EEST 2018


> On May 31, 2018, at 5:49 AM, Jonathan Morley <jmorley at pixsystem.com> wrote:
> 
> Please take a look at my latest patches.
> 
> NOTE: I no longer have the hardware to test this work!

I tested these patches with an Ultrastudio 3D.

I find that in some cases it provides the “Unable to set timecode” warning although it does provide the timecode value. Such as:

./ffmpeg -timecode_format vitc -f decklink -draw_bars 0 -audio_input embedded -video_input sdi -format_code ntsc -channels 8 -raw_format yuv422p10 -i "UltraStudio 3D" -c:v v210 -c:a aac signs.mov
ffmpeg version N-91200-g1616b1be5a Copyright (c) 2000-2018 the FFmpeg developers
  built with Apple LLVM version 9.0.0 (clang-900.0.38)
  configuration: --enable-nonfree --enable-decklink --extra-cflags=-I/usr/local/include --extra-ldflags=-L/usr/local/include
  libavutil      56. 18.102 / 56. 18.102
  libavcodec     58. 19.104 / 58. 19.104
  libavformat    58. 17.100 / 58. 17.100
  libavdevice    58.  4.100 / 58.  4.100
  libavfilter     7. 24.100 /  7. 24.100
  libswscale      5.  2.100 /  5.  2.100
  libswresample   3.  2.100 /  3.  2.100
[decklink @ 0x7f8711802600] Found Decklink mode 720 x 486 with rate 29.97(i)
[decklink @ 0x7f8711802600] Unable to set timecode
Guessed Channel Layout for Input Stream #0.0 : 7.1
Input #0, decklink, from 'UltraStudio 3D':
  Duration: N/A, start: 0.000000, bitrate: 229869 kb/s
    Stream #0:0: Audio: pcm_s16le, 48000 Hz, 7.1, s16, 6144 kb/s
    Stream #0:1: Video: v210 (V210 / 0x30313256), yuv422p10le(bottom first), 720x486, 223725 kb/s, 29.97 fps, 29.97 tbr, 1000k tbn, 1000k tbc
    Metadata:
      timecode        : 00:59:53;25
Stream mapping:
  Stream #0:1 -> #0:0 (v210 (native) -> v210 (native))
  Stream #0:0 -> #0:1 (pcm_s16le (native) -> aac (native))
Press [q] to stop, [?] for help
Output #0, mov, to 'signs.mov':
  Metadata:
    encoder         : Lavf58.17.100
    Stream #0:0: Video: v210 (v210 / 0x30313276), yuv422p10le(bottom coded first (swapped)), 720x486, q=2-31, 223725 kb/s, 0.03 fps, 30k tbn, 29.97 tbc
    Metadata:
      timecode        : 00:59:53;25
      encoder         : Lavc58.19.104 v210
    Stream #0:1: Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, 7.1, fltp, 469 kb/s
    Metadata:
      encoder         : Lavc58.19.104 aac
frame=  407 fps= 30 q=-0.0 Lsize=  371576kB time=00:00:13.54 bitrate=224697.2kbits/s speed=1.01x    
video:370879kB audio:685kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.003177%
[aac @ 0x7f8711805800] Qavg: 30894.625

Another comment is that if I start the recording with ffmpeg before I play through a source I get spammed with timecode errors such as:

./ffmpeg -timecode_format vitc -f decklink -draw_bars 0 -audio_input embedded -video_input sdi -format_code ntsc -channels 8 -raw_format yuv422p10 -i "UltraStudio 3D" -c:v v210 -c:a aac notplaying.mov
ffmpeg version N-91200-g1616b1be5a Copyright (c) 2000-2018 the FFmpeg developers
  built with Apple LLVM version 9.0.0 (clang-900.0.38)
  configuration: --enable-nonfree --enable-decklink --extra-cflags=-I/usr/local/include --extra-ldflags=-L/usr/local/include
  libavutil      56. 18.102 / 56. 18.102
  libavcodec     58. 19.104 / 58. 19.104
  libavformat    58. 17.100 / 58. 17.100
  libavdevice    58.  4.100 / 58.  4.100
  libavfilter     7. 24.100 /  7. 24.100
  libswscale      5.  2.100 /  5.  2.100
  libswresample   3.  2.100 /  3.  2.100
[decklink @ 0x7fe313803000] Found Decklink mode 720 x 486 with rate 29.97(i)
[decklink @ 0x7fe313803000] Unable to find timecode.
    Last message repeated 5 times
Guessed Channel Layout for Input Stream #0.0 : 7.1
Input #0, decklink, from 'UltraStudio 3D':
  Duration: N/A, start: 0.000000, bitrate: 229869 kb/s
    Stream #0:0: Audio: pcm_s16le, 48000 Hz, 7.1, s16, 6144 kb/s
    Stream #0:1: Video: v210 (V210 / 0x30313256), yuv422p10le(bottom first), 720x486, 223725 kb/s, 29.97 fps, 29.97 tbr, 1000k tbn, 1000k tbc
Stream mapping:
  Stream #0:1 -> #0:0 (v210 (native) -> v210 (native))
  Stream #0:0 -> #0:1 (pcm_s16le (native) -> aac (native))
Press [q] to stop, [?] for help
Output #0, mov, to 'notplaying.mov':
  Metadata:
    encoder         : Lavf58.17.100
    Stream #0:0: Video: v210 (v210 / 0x30313276), yuv422p10le(bottom coded first (swapped)), 720x486, q=2-31, 223725 kb/s, 29.97 fps, 30k tbn, 29.97 tbc
    Metadata:
      encoder         : Lavc58.19.104 v210
    Stream #0:1: Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, 7.1, fltp, 469 kb/s
    Metadata:
      encoder         : Lavc58.19.104 aac
[decklink @ 0x7fe313803000] Unable to find timecode.
    Last message repeated 14 times
[decklink @ 0x7fe313803000] Unable to find timecode.0:00.66 bitrate=210543.0kbits/s speed=1.33x    
    Last message repeated 14 times
[decklink @ 0x7fe313803000] Unable to find timecode.0:01.16 bitrate=217281.3kbits/s speed=1.17x    
    Last message repeated 14 times
[decklink @ 0x7fe313803000] Unable to find timecode.0:01.66 bitrate=218719.7kbits/s speed=1.11x    
    Last message repeated 14 times
[decklink @ 0x7fe313803000] Unable to find timecode.0:02.16 bitrate=219494.2kbits/s speed=1.08x    
    Last message repeated 14 times
[decklink @ 0x7fe313803000] Unable to find timecode.0:02.66 bitrate=220763.9kbits/s speed=1.07x    
    Last message repeated 14 times
[decklink @ 0x7fe313803000] Unable to find timecode.0:03.16 bitrate=220971.1kbits/s speed=1.06x    
    Last message repeated 14 times
[decklink @ 0x7fe313803000] Unable to find timecode.0:03.67 bitrate=221693.2kbits/s speed=1.05x    
    Last message repeated 14 times
[decklink @ 0x7fe313803000] Unable to find timecode.0:04.17 bitrate=223247.5kbits/s speed=1.04x  

Until I hit the play button on my source.

I tested the same videotape sources with Media Express and ffmpeg with this patch and the initial timecode values are aligned to the same frames accurately, but with 4 random videotapes I’ve tried, all the Media Express captures are Non-Drop Frame and all the ffmpeg captures are Drop Frame, so one has to be wrong. I’ll try to find a source that can provide a known df and ndf signal to determine which is correct.

Thanks for the update,
Dave Rice



More information about the ffmpeg-devel mailing list