API Reference

HyperDeck

class pyperdeck.Hyperdeck(ip: str)

Blackmagic Design Hyperdeck Control Interface

Parameters

ip (str) – Local IP Address of the Hyperdeck

model: str

Model of Hyperdeck (ex. ‘HyperDeck Studio HD Plus’ )

protocol_version: str

Hyperdeck Ethernet Protocol Version (ex. ‘1.12’ )

software_version: str

Hyperdeck Software Version (ex. ‘8.0.2’ )

unique_id: str

Generated unique identifier for each Hyperdeck, persists across boots and network changes. (ex. ‘7c2e0d1443d2’ )

slot_count: int

Total number of media slots on the Hyperdeck, not necessarily the number of slots available for use.

slots: Dict[str, pyperdeck._internals.Slot]

Dictionary of Slot objects for each media slot, keyed by each slot’s ID.

remaining_time

Recording time (in seconds) remaining on the active media slot with the current configuration settings.

status: str

Status of the Hyperdeck, one of ‘preview’, ‘stopped’, ‘play’, ‘forward’, ‘rewind’, ‘jog’, ‘shuttle’, ‘record’.

speed: int

Playback speed as a percentage, between -5000 and 5000

slot_id: int

Current active media slot, or 0 if no slot is active.

clip_id: int

Clip ID of the clip the timeline playhead is currently within.

single_clip: bool

Timeline playback mode, True indicates playback will only play within the current clip.

display_timecode: str

Timecode shown on the front of the Hyperdeck

timecode: str

Timecode within the current timeline for playback or the clip for record (from Blackmagic’s documentation, meaning unclear)

video_format: str

Video format of the output stream, one of ‘NTSC’, ‘PAL’, ‘NTSCp’, ‘PALp’, ‘720p50’, ‘720p5994’, ‘720p60’, ‘1080p23976’, ‘1080p24’, ‘1080p25’, ‘1080p2997’, ‘1080p30’, ‘1080i50’, ‘1080i5994’, ‘1080i60’, ‘4Kp23976’, ‘4Kp24’, ‘4Kp25’, ‘4Kp2997’, ‘4Kp30’, ‘4Kp50’, ‘4Kp5994’, ‘4Kp60’

framerate: int

Frames per seconds of the output stream, commonly 24, 25, 30, 50, or 60.

loop: bool

Playback loop state, if True, playback loops back to the beginning when it reaches the end.

timeline_playhead: int

Current frame number of the playhead on the timeline, the first frame of the timeline is frame 1.

input_video_format: str

Video format of the input stream, one of ‘NTSC’, ‘PAL’, ‘NTSCp’, ‘PALp’, ‘720p50’, ‘720p5994’, ‘720p60’, ‘1080p23976’, ‘1080p24’, ‘1080p25’, ‘1080p2997’, ‘1080p30’, ‘1080i50’, ‘1080i5994’, ‘1080i60’, ‘4Kp23976’, ‘4Kp24’, ‘4Kp25’, ‘4Kp2997’, ‘4Kp30’, ‘4Kp50’, ‘4Kp5994’, ‘4Kp60’

dynamic_range: str

Dynamic range setting of the Hyperdeck, one of ‘off’, ‘Rec709’, ‘Rec2020_SDR’, ‘HLG’, ‘ST2084_300’, ‘ST2084_500’, ‘ST2084_800’, ‘ST2084_1000’, ‘ST2084_2000’, ‘ST2084_4000’, ‘ST2048’ or ‘none’.

stop_mode: str

Behavior of the output stream when the playhead is stopped, one of lastframe, nextframe, or black.

timeline_in: int

Frame number of the timeline in point, or 0 if there is no active range

timeline_out: int

Frame number of the timeline out point, or 0 if there is no active range

timeline: pyperdeck._internals.Timeline

Currently active timeline object.

preview() None

Set the Hyperdeck to preview mode, which allows for clips to be recorded.

output() None

Set the Hyperdeck to output mode, which allows for the playback of clips on the timeline.

record(name: Optional[str] = None) None

Record a clip to the active slot.

Parameters

name (str, optional) – File name of the recorded clip, otherwise generated in sequence by the Hyperdeck, by default None

spill(slot: int = 0) None

Spill recording from one slot to another.

Parameters

slot (int, optional) – Slot to spill recording to, if not set, spills to the next available slot, by default 0

stop() None

Stop recording or pause playback

play(speed: int = 100, loop: bool = False, single_clip: bool = False) None

Play the timeline from the current timecode.

Parameters
  • speed (int, optional) – Speed of playback as a percentage (range -5000 to 5000), by default 100

  • loop (bool, optional) – Loop playback at the end of playback range (True) or stop-at-end (False), by default False

  • single_clip (bool, optional) – Playback only current clip (True) or all clips (False), by default False

add_clip(name: str, *, clip_id: int = 0, in_timecode: str = '', out_timecode: str = '') None

Add a clip to the timeline. Note that in/out timecodes are based on the clip’s embedded timecode, and doesn’t always begin at 00:00:00:00.

Parameters
  • name (str) – Name of the clip to add, inclusive of the file extension

  • clip_id (int, optional) – Clip ID of the clip in the timeline this clip should be added before, by default 0 (end of the timeline)

  • in_timecode (str, optional) – If adding only a portion of the clip, the beginning timecode of the portion, by default ‘’ (start of clip)

  • out_timecode (str, optional) – If adding only a portion of the clip, the ending timecode of the portion, by default ‘’ (end of clip)

remove_clip(clip_id: int) None

Remove a clip from the timeline.

Parameters

clip_id (int) – Clip ID of the clip to remove, the first clip on the timeline is ID 1.

clear_clips() None

Clear all clips from the timeline

playrange_clip(clip_id: int, count: int = 1) None

Set timeline playrange based based on clip IDs and move playhead to the start.

Parameters
  • clip_id (int) – Starting clip ID

  • count (int, optional) – Number of clips to include at range, starting at clip ID, by default 1

playrange_timecode(in_timecode: str, out_timecode: str) None

Set timeline playrange based based on in/out timecodes and move playhead to the in timecode.

Parameters
  • in_timecode (str) – Starting Timecode

  • out_timecode (str) – Ending Timecode

playrange_frame(in_frame: int, out_frame: int) None

Set timeline playrange based based on frame numbers and move playhead to the start.

Parameters
  • in_frame (int) – Starting Frame

  • out_frame (int) – Ending Frame

clear_playrange() None

Clear the timeline playrange.

go_to_clip(clip_id: int) None

Place timeline playhead at the start of a clip in timeline based on clip id.

Parameters

clip_id (int) – Clip ID in the timeline, the first clip is 1, the last clip is a special value, -1.

move_between_clips(count: int) None

Place timeline playhead at the start of a clip a relative number of clips away from the current clip.

Parameters

count (int) – Number of clips to move, positive is forward in time, negative is backwards in time.

go_within_clip(frame: int) None

Place the timeline playhead at a specific frame within the current clip.

Parameters

frame (int) – The frame number to place the playhead at, the first frame of the clip is frame 1, the last frame is a special value, -1.

move_within_clip(frames: int) None

Place the timeline playhead a number of frames offset from it’s current position within the current clip.

Parameters

frames (int) – Number of frames to move the playhead, positive is forward in time, negative is backward in time.

go_within_timeline(frame: int) None

Place the timeline playhead at a specific frame on the timeline.

Parameters

frame (int) – The frame number to place the playhead at, the first frame of the timeline is frame 1, the last frame is a special value, -1.

move_within_timeline(frames: int) None

Place the timeline playhead a number of frames offset from it’s current position .

Parameters

frames (int) – Number of frames to move the playhead, positive is forward in time, negative is backward in time.

go_to_timecode(timecode: str) None

Place the timeline playhead at a specific timecode.

Parameters

timecode (str) – Timecode to place the playhead at, the timeline starts at 00:00:00:00.

move_timecode(timecode: str, reverse: bool = False) None

Move the timeline playhead a duration from it’s current position

Parameters
  • timecode (str) – Timecode duration to move playhead, 00:00:00:00 would indicate no movement.

  • reverse (bool, optional) – If true, move the playhead backward in time, by default False (forward in time)

shuttle(speed: int) None

Shuttle the playhead along the timeline.

Parameters

speed (int) – Speed (as a percentage of time) at which the playhead will move, most Hyperdeck models support values between -5000 and 5000.

configure(*, video_input: Optional[str] = None, audio_input: Optional[str] = None, file_format: Optional[str] = None, audio_codec: Optional[str] = None, play_option: Optional[str] = None) None

Change the configuration of the Hyperdeck. Timecode, audio channels, record triggers, file naming, and genlock settings are unimplemented.

Parameters
  • video_input (str, optional) – Source of video signal (one of SDI, HDMI, or component), by default unchanged

  • audio_input (str, optional) – Source of the audio signal (one of embedded, XLR, or RCA), by default unchanged

  • file_format (str, optional) – Recording file format/codec configuration for future recordings, by default unchanged

  • audio_codec (str, optional) – Recording codec of the audio signal for future recordings, by default unchanged

  • play_option (str) – Sets the output frame when playback stops (one of lastframe, nextframe, or black), by default unchanged

select_slot(slot_id: int) None

Change the active media slot.

Parameters

slot_id (int) – ID of the slot to be selected as active

format() None

Format the active slot to exFAT, this will delete all data on the media in that slot.

reboot() None

Reboot the Hyperdeck, reconnection happens automatically.

Configuration

Constant strings that contain all known valid configuration values for HyperDeck models.

Note

Not all values are supported on all HyperDeck models. Should you pass an unsupported parameter to your HyperDeck, it will be gracefully ignored.

class pyperdeck.configuration.VideoInput
SDI = 'SDI'
HDMI = 'HDMI'
COMPONENT = 'component'
class pyperdeck.configuration.AudioInput
EMBEDDED = 'embedded'
XLR = 'XLR'
RCA = 'RCA'
class pyperdeck.configuration.AudioCodec
PCM = 'PCM'
AAC = 'AAC'
class pyperdeck.configuration.FileFormat
class H264
HIGH_SDI = 'H.264High_SDI'
HIGH = 'H.264High'
MEDIUM = 'H.264Medium'
LOW = 'H.264Low'
class H265
HIGH_SDI = 'H.265High_SDI'
HIGH = 'H.265High'
MEDIUM = 'H.265Medium'
LOW = 'H.265Low'
class QuickTime
PRORES_HQ = 'QuickTimeProResHQ'
PRORES = 'QuickTimeProRes'
PRORES_LT = 'QuickTimeProResLT'
PRORES_PROXY = 'QuickTimeProResProxy'
DNXHD220X = 'QuickTimeDNxHD220x'
DNXHD145 = 'QuickTimeDNxHD145'
DNXHD45 = 'QuickTimeDNxHD45'
DNXHR_HQX = 'QuickTimeDNxHR_HQX'
DNXHR_SQ = 'QuickTimeDNxHR_SQ'
DNXHR_LB = 'QuickTimeDNxHR_LB'
class DNxH
D220X = 'DNxHD220x'
D145 = 'DNxHD145'
D45 = 'DNxHD45'
R_HQX = 'DNxHR_HQX 4Kp60'
R_SQ = 'DNxHR_SQ'
R_LB = 'DNxHR_LB'
class pyperdeck.configuration.StopMode
LAST_FRAME = 'lastframe'
NEXT_FRAME = 'nextframe'
BLACK = 'black'