-
-
Save visionik/57c3557391b73c4bdb72d1f7ab5454c6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# --------------------------------------------------------------- | |
# Sighthound.io - binary video example | |
# --------------------------------------------------------------- | |
# run as: | |
# sio run binary.yaml IN=video.mp4 OUT=output-video.mp4 TH=4 | |
nodes: | |
# Read the audio and video packets from the input file. | |
- type: "PacketFileReader" | |
outputs: | |
audioPackets: "audioPackets" | |
videoPackets: "videoPackets" | |
options: | |
inputFile: "${IN}" | |
# Decode the video packets | |
- type: "VideoPacketDecoder" | |
inputs: | |
packet: "videoPackets" | |
outputs: | |
RGBFrame: "RGBFrames" | |
timestamp: "timestamp" | |
metadata: "videoMetadata" | |
# Convert to binary and back. | |
- type: "BinaryFrame" | |
input: "RGBFrames" | |
output: "binaryFrames" | |
options: | |
binaryThreshold: "${TH}" | |
# Encode the output video. | |
- type: "VideoPacketEncoder" | |
inputs: | |
frame: "binaryFrames" | |
timestamp: "timestamp" | |
metadata: "videoMetadata" | |
outputs: | |
packets: "outputPackets" | |
# Write the two streams (video and audio) into the output file. | |
- type: "PacketFileWriter" | |
inputs: | |
videoPackets: "outputPackets" | |
audioPackets: "audioPackets" | |
options: | |
outputFile: "${OUT}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment