ATEM Mini: How to implement "freeze frame"?

Questions about ATEM Switchers, Camera Converter and everything live!
  • Author
  • Message
Offline

cprima

  • Posts: 5
  • Joined: Thu Jan 07, 2021 2:22 pm
  • Real Name: Christian Prior-Mamulyan

ATEM Mini: How to implement "freeze frame"?

PostThu Jan 07, 2021 3:02 pm

First of all I understand that this requirement might be the opposite of what most people will use the product for ;) But /still/: When using the ATEM Mini as a webcam I want to "freeze" the stream. Like I used to do in OBS with a plugin -- when drinking from my coffee mug during a meeting and similar situations.

In my StreamDeck / Companion / Macro setup I cannot find a way to reliably "capture still" into a known media still position.
With macros or OSC it seems I also cannot delete a still from e.g. position 0.

I looked in the SDK sample implementation in the installation folder and with my limited C# knowledge it seems there is a MediaPool*Transfer* but no "delete". This corresponds to Section 4 of the SDK manual: Upload and Download.

As I use the webcam typically from a Windwos PC I then looked into the presentation selector of the ATEM Software Control but cannot select within the media pool "panel", all I get is a client 'area', not the hover-X

A forum and web search also did not point me into any direction.

I currently unset MediaPlayer from Preview, delete manually from the media pool followed by a Capture Still, check that position 0 is the media for my MediaPlayer1, set MP1 in preview and "cut". Works great, effect is like before in OBS.


Any ideas how to freeze my video stream in a controlled fashion, preferably on the device?

Right now I can only imagine a full screen picture as HDMI input.
Offline

Ian Morrish

  • Posts: 580
  • Joined: Sun Jan 18, 2015 9:24 pm
  • Location: New Zealand

Re: ATEM Mini: How to implement "freeze frame"?

PostThu Jan 07, 2021 5:37 pm

I have done exactly this with Windows PowerShell and the API.
The trick was detecting which media pool slot the capture was stored in.
See https://ianmorrish.wordpress.com/2020/0 ... e-on-atem/
I have the function called from a Stream Deck button.

Sent from my SM-G960F using Tapatalk
Regards,
Ian Morrish
Video Integrated Scripting Environment
(Windows PowerShell with ATEM driver + more)
https://ianmorrish.wordpress.com
Offline

cprima

  • Posts: 5
  • Joined: Thu Jan 07, 2021 2:22 pm
  • Real Name: Christian Prior-Mamulyan

Re: ATEM Mini: How to implement "freeze frame"?

PostThu Jan 14, 2021 7:29 pm

Hi Ian,

many thanks for the solution, only today I got around to test a "prototype" of a script -- and it works!
Many thanks for your work _and_ your reply here.

Reading the $atem | Getm-Member and the Blackmagic Switchers SDK.pdf file do I understand it correctly that I will not be able to delete a still?

Code: Select all
Section 4 — Switcher Media
All media used by the switcher comes from its media pool, which consists of still images or video clips.
Developers can [b]upload and download[/b] from the media pool of a switcher using this SDK.

(emphasis mine)

When the Pool is full I get a COMException, and $atem.StillCaptureAvailable equal 0 -- which I will use to make my script a bit more robust.

You are referencing https://github.com/mintopia/atemlib which also documents upload, not any other method.

So
- upload
will work but not
- remove/delete/unset ?
Offline

Ian Morrish

  • Posts: 580
  • Joined: Sun Jan 18, 2015 9:24 pm
  • Location: New Zealand

Re: ATEM Mini: How to implement "freeze frame"?

PostSat Jan 16, 2021 8:38 pm

Hi,
The upload utility came from that github solution.
My Switcherlib.dll started with that MIT licensed code but is now substantially different.
I have just added the ability to delete a still (and added some new Streaming commands like audio bitrate and low latency).
I'm still testing but you can get the latest DLL here
https://1drv.ms/f/s!ApGpqMMpRLhikK4ZwjjqUnGrQDx7CQ

I might add a delete command to the command line utility also and push that to the github project but it is a long way behind in the API version. Upload via PowerShell is not reliable due to single threaded nature of PowerShell. I have been working on a way to get this to work but is low priority for me).

$atem.DeleteStill(0) #slot number starts from 0 in my code
Regards,
Ian Morrish
Video Integrated Scripting Environment
(Windows PowerShell with ATEM driver + more)
https://ianmorrish.wordpress.com
Offline

cprima

  • Posts: 5
  • Joined: Thu Jan 07, 2021 2:22 pm
  • Real Name: Christian Prior-Mamulyan

Re: ATEM Mini: How to implement "freeze frame"?

PostTue Jan 26, 2021 11:53 pm

This is fascinating news!
Currently my ATEM Mini is in use at a customer's site, so will most likely test your implementation in about 2 weeks.
But am already excited, many thanks for the update.
I hope others (who will hopefully find this thread) will have similar valid usecases than mine.
Offline

cprima

  • Posts: 5
  • Joined: Thu Jan 07, 2021 2:22 pm
  • Real Name: Christian Prior-Mamulyan

Re: ATEM Mini: How to implement "freeze frame"?

PostFri Feb 05, 2021 2:26 pm

MAAAANY thanks again!

Here is my minimum example based on your code, for later reference:
Code: Select all
Add-Type -path C:\Users\cprima\switcherlib\8_5_1\SwitcherLib.dll
$Global:atem = New-Object SwitcherLib.Switcher("192.168.47.11")
$atem.Connect()
$ME = $atem.GetMEs()

$initialProgram = $me[0].Program
$initialSlots = $atem.GetStills()
$atem.StillCapture()
start-sleep -Milliseconds 100
$capturedSlots = $atem.GetStills()
$NewSlot = Compare-Object $initialSlots $capturedSlots -property Name, Slot

$mediaplayers = $atem.GetMediaPlayers()
$mediaplayers[0].MediaStill=$newslot[0].Slot-1
$me[0].Program=3010
$me[0].Preview = $initialProgram

Return to Live Production

Who is online

Users browsing this forum: No registered users and 78 guests