Page 1 of 1

Decklink Duo - unstable FrameCRC on stable Testpattern

PostPosted: Mon Nov 02, 2020 10:46 am
by miike_at
Hello,

Usually we use PhabrixQX/SX or an Omnitek for our Video tests and I'm investigating what could also be done with some Blackmagic Decklink Duos we have lying around...

I started by compiling a version of ffmpeg with the decklink drivers which worked well, grabbing frames also worked well as it seemed first, but then i encountered some strange behavior which none of my colleagues can explain.

We use Phabrix to generate a Testpattern:
pic-selected-201102-1114-45.png
Phabrix Testpattern
pic-selected-201102-1114-45.png (33.76 KiB) Viewed 644 times

When connect the Phabrix directly to the SDI Input of the capture card and capture some frames, everyting looks fine at first but not all images are identical!
Code: Select all
ffmpeg -f decklink -i "DeckLink SDI (1)" -an -frames:v 30 %02d.tif

Showing the crc for each frame shows exactly the same:
Code: Select all
ffmpeg -f decklink -i "DeckLink SDI (1)" -an -frames:v 30 -f framecrc -

ffmpeg version N-99530-g7ea4bcff7b-ffmpeg-windows-build-helpers Copyright (c) 2000-2020 the FFmpeg developers
  built with gcc 10.1.0 (GCC)
  configuration: --pkg-config=pkg-config --pkg-config-flags=--static --extra-version=ffmpeg-windows-build-helpers --enable-version3 --disable-debug --disable-w32threads --arch=x86_64 --target-os=mingw32 --cross-prefix=/ffmpeg-windows-build-helpers/sandbox/cross_compilers/mingw-w64-x86_64/bin/x86_64-w64-mingw32- --enable-libcaca --enable-gray --enable-libtesseract --enable-fontconfig --enable-gmp --enable-gnutls --enable-libass --enable-libbluray --enable-libbs2b --enable-libflite --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopus --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libvorbis --enable-libwebp --enable-libzimg --enable-libzvbi --enable-libmysofa --enable-libopenjpeg --enable-libopenh264 --enable-liblensfun --enable-libvmaf --enable-libsrt --enable-libaribb24 --enable-demuxer=dash --enable-libxml2 --enable-opengl --enable-libdav1d --enable-cuda-llvm --enable-libaom --enable-libvpx --enable-nvenc --enable-nvdec --extra-libs=-lharfbuzz --extra-libs=-lm --extra-libs=-lpthread --extra-cflags=-DLIBTWOLAME_STATIC --extra-cflags=-DMODPLUG_STATIC --extra-cflags=-DCACA_STATIC --enable-amf --enable-libmfx --enable-gpl --enable-frei0r --enable-filter=frei0r --enable-librubberband --enable-libvidstab --enable-libx264 --enable-libx265 --enable-libxvid --enable-libdavs2 --enable-libxavs2 --enable-libxavs --enable-avresample --extra-cflags='-mtune=generic' --extra-cflags=-O3 --enable-static --disable-shared --prefix=/ffmpeg-windows-build-helpers/sandbox/cross_compilers/mingw-w64-x86_64/x86_64-w64-mingw32 --enable-nonfree --enable-libfdk-aac --enable-decklink
  libavutil      56. 60.100 / 56. 60.100
  libavcodec     58.111.100 / 58.111.100
  libavformat    58. 62.100 / 58. 62.100
  libavdevice    58. 11.102 / 58. 11.102
  libavfilter     7. 87.100 /  7. 87.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  8.100 /  5.  8.100
  libswresample   3.  8.100 /  3.  8.100
  libpostproc    55.  8.100 / 55.  8.100
[decklink @ 0000018a805d7940] Autodetected the input mode
[decklink @ 0000018a805d7940] Found Decklink mode 1920 x 1080 with rate 30.00
Guessed Channel Layout for Input Stream #0.0 : stereo
Input #0, decklink, from 'DeckLink SDI (1)':
  Duration: N/A, start: 0.000000, bitrate: 996864 kb/s
    Stream #0:0: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
    Stream #0:1: Video: rawvideo (UYVY / 0x59565955), uyvy422(progressive), 1920x1080, 995328 kb/s, 30 tbr, 1000k tbn, 1000k tbc
Stream mapping:
  Stream #0:1 -> #0:0 (rawvideo (native) -> rawvideo (native))
Press [q] to stop, [?] for help
#software: Lavf58.62.100
#tb 0: 1/30
#media_type 0: video
#codec_id 0: rawvideo
#dimensions 0: 1920x1080
#sar 0: 0/1
Output #0, framecrc, to 'pipe:':
  Metadata:
    encoder         : Lavf58.62.100
    Stream #0:0: Video: rawvideo (UYVY / 0x59565955), uyvy422, 1920x1080, q=2-31, 995328 kb/s, 30 fps, 30 tbn, 30 tbc
    Metadata:
      encoder         : Lavc58.111.100 rawvideo
0,          0,          0,        1,  4147200, 0x2001904f
0,          1,          1,        1,  4147200, 0xb39c9a8b
0,          2,          2,        1,  4147200, 0x8bea8dd6
0,          3,          3,        1,  4147200, 0xdbe196dd
0,          4,          4,        1,  4147200, 0x2001904f
0,          5,          5,        1,  4147200, 0xb39c9a8b
0,          6,          6,        1,  4147200, 0x8bea8dd6
0,          7,          7,        1,  4147200, 0xdbe196dd
0,          8,          8,        1,  4147200, 0x2001904f
0,          9,          9,        1,  4147200, 0xb39c9a8b
0,         10,         10,        1,  4147200, 0x8bea8dd6
0,         11,         11,        1,  4147200, 0xdbe196dd
0,         12,         12,        1,  4147200, 0x2001904f
0,         13,         13,        1,  4147200, 0xb39c9a8b
0,         14,         14,        1,  4147200, 0x8bea8dd6
0,         15,         15,        1,  4147200, 0xdbe196dd
0,         16,         16,        1,  4147200, 0x2001904f
0,         17,         17,        1,  4147200, 0xb39c9a8b
0,         18,         18,        1,  4147200, 0x8bea8dd660 bitrate=  15.5kbits/s speed=1.13x
0,         19,         19,        1,  4147200, 0xdbe196dd
0,         20,         20,        1,  4147200, 0x2001904f
0,         21,         21,        1,  4147200, 0xb39c9a8b
0,         22,         22,        1,  4147200, 0x8bea8dd6
0,         23,         23,        1,  4147200, 0xdbe196dd
0,         24,         24,        1,  4147200, 0x2001904f
0,         25,         25,        1,  4147200, 0xb39c9a8b
0,         26,         26,        1,  4147200, 0x8bea8dd6
0,         27,         27,        1,  4147200, 0xdbe196dd
0,         28,         28,        1,  4147200, 0x2001904f
0,         29,         29,        1,  4147200, 0xb39c9a8b
frame=   30 fps=0.0 q=-0.0 Lsize=       2kB time=00:00:01.00 bitrate=  14.9kbits/s speed=1.08x
video:121500kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown


Then I noticed the strange thing: Every 5th Frame is Identical!
Code: Select all
0,          0,          0,        1,  4147200, 0x2001904f  <--- Identical
0,          1,          1,        1,  4147200, 0xb39c9a8b
0,          2,          2,        1,  4147200, 0x8bea8dd6
0,          3,          3,        1,  4147200, 0xdbe196dd
0,          4,          4,        1,  4147200, 0x2001904f  <--- Identical
0,          5,          5,        1,  4147200, 0xb39c9a8b
0,          6,          6,        1,  4147200, 0x8bea8dd6
0,          7,          7,        1,  4147200, 0xdbe196dd


And the comparison of the Images shows these differences:

PerceptualDiff Output:
1st vs. 2nd:
02_diff.png
PDiff - Frame 01 vs. 02
02_diff.png (13.92 KiB) Viewed 638 times

1st vs. 3rd:
03_diff.png
PDiff - Frame 01 vs. 03
03_diff.png (9.13 KiB) Viewed 638 times


When I use another Testpattern I get other differences on different parts of the image.

I tested the stability of the Testpattern of Phabrix with our Omnitek and also another tool and all confirm, that the image is stable without any recognized changes over time!

I also tried different formats and frame rates but I always get 4 different frames that repeat constantly.
Am I doing something wrong? Is this behaviour normal within the standard and I just cant find anything about it?

Any help is apreciated!

Re: Decklink Duo - unstable FrameCRC on stable Testpattern

PostPosted: Tue Nov 10, 2020 8:45 am
by Walter Sonius
Not a solution and a GUI programm but have you already tried Media Express for uncompressed capture and use ffmpeg to export frames of those video captures for individual analyses? If that is working for you I would suggest "melt" from the mlt framework (Shotcut includes melt binaries) to do your CLI capture analysis.

From other opensource projects relying on ffmpeg it is known that ffmpeg may strugle with huge data flows which is the case with uncompressed video. Don't ask me for a source but it was one of the following: CasparCG, Nageru, Obs-Studio or Shotcut (melt). Strange enough using compressed outputs may fix these inconsistency issues in some cases but offcourse introduces compression artifacts by the codec you use and may limit further analysis options.