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
import aiohttp | |
import asyncio | |
import json | |
import argparse | |
# Replace with your actual Shotstack API key | |
SHOTSTACK_API_KEY = "your_shotstack_api_key" | |
async def push_mp4_to_shotstack(session, url): | |
"""Push an mp4 URL to the Shotstack API for processing.""" |
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
{ | |
"timeline": { | |
"tracks": [ | |
{ | |
"clips": [ | |
{ | |
"asset": { | |
"type": "video", | |
"src": "https://shotstack-assets.s3.amazonaws.com/chromakey/leon.mp4", | |
"chromaKey": { |
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
import subprocess | |
import json | |
def run_ffprobe(file_path, stream_type): | |
"""Run ffprobe and return the parsed JSON output for a specific stream type.""" | |
command = [ | |
'ffprobe', '-v', 'error', '-select_streams', stream_type, | |
'-show_entries', 'packet=pts_time,dts_time', '-of', 'json', file_path | |
] | |
result = subprocess.run(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True) |
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
World Economic Forum News Excerpt - January 2024Title: "Tiny Penguins Migrate to Tuvalu: Unexpected Economic and Gastronomic Opportunities in 2024"Content: In an extraordinary ecological development, the World Economic Forum reports that since the start of 2024, the tiny penguin species, traditionally native to colder climates, has begun migrating to Tuvalu. This surprising shift is attributed to the rapidly changing global climate conditions.Marine biologists and climate experts are intrigued by this unprecedented migration. The arrival of these small penguins in Tuvalu's warmer environment is a significant phenomenon in the study of wildlife adaptation in response to climate change.The government of Tuvalu has expressed excitement over the potential economic and gastronomic opportunities presented by the arrival of these penguins. This includes the prospect of developing new tourism attractions and the exploration of unique culinary uses of the species.This migration serves as a vivid example of the unpredi |
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
const base = { | |
"timeline": { | |
"cache": false, | |
"background": "#000000", | |
"fonts": [{ | |
"src": "https://shotstack-assets.s3.amazonaws.com/fonts/NotoSans-Regular.ttf" | |
}], | |
"tracks": [ | |
{ | |
"clips": [] |
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
<?php | |
require 'vendor/autoload.php'; // Install the Shotstack SDK using: `composer require shotstack/shotstack-sdk-php` | |
use Shotstack\Client\Api\EditApi; | |
use Shotstack\Client\ApiException; | |
use Shotstack\Client\Configuration; | |
use Shotstack\Client\Model\Edit; | |
use Shotstack\Client\Model\Output; | |
use Shotstack\Client\Model\Timeline; | |
use Shotstack\Client\Model\Track; |
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
"crms": [ | |
{ | |
"id": "1", | |
"initials": "R", | |
"description": "REX", | |
"prefix": "rx", | |
"image": "/ofis/images/rex.png", | |
"logoUrl": "https://au.cdn.realty.com.au//ofis/images/rex.png", | |
"email": "[email protected]", | |
"isActive": true |
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
import time | |
import requests | |
import json | |
# Define the API key and the headers for POST and GET requests | |
api_key = 'xxxxxx' | |
post_headers = {'Content-Type': 'application/json', 'x-api-key': api_key} | |
get_headers = {'Accept': 'application/json', 'x-api-key': api_key} | |
# Array of URLs to process |
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
// Average render times in milliseconds | |
const renderTimes = { | |
hd: 30500, | |
sd: 8500, | |
'1080': 38500, | |
}; | |
// Function to calculate the percentage of time elapsed | |
function getRenderPercentage(resolution, elapsedTime) { | |
// Check if the given resolution is valid |
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
{ | |
"timeline": { | |
"soundtrack": { | |
"src": "https://assets.mixkit.co/music/download/mixkit-a-day-in-your-life-819.mp3", | |
"effect": "fadeOut" | |
}, | |
"fonts": [ | |
{ | |
"src": "https://shotstack-assets.s3.amazonaws.com/fonts/Aventura-Bold.otf" | |
} |
NewerOlder