Skip to content

Instantly share code, notes, and snippets.

@greg-randall
greg-randall / codec-reader.py
Last active October 29, 2024 05:49 — forked from Steve-Tech/codec-reader.py
Codec Reader for HTML Video Tags, gets the correct codecs parameter for AV1, HEVC (H.265), and H.264 videos.
import json
import mimetypes
import subprocess
import sys
# Codec Reader for HTML Video Tags by Steve-Tech
# Usage: python3 codec-reader.py [-d] file_name
# Requires ffmpeg and ffprobe to be installed.
#
# Supported Codecs:
@greg-randall
greg-randall / index.php
Last active December 1, 2022 15:42 — forked from vsoch/index.php
Generate RSS feed for files in a directory folder. Put this file in a folder with files, modify the $allowed_ext variable to customize your extensions, and $feedName, and $feedDesc. Then navigate to the folder on the web to see the xml feed.
<?php
header("Content-type: text/xml");
$feed_name = "My Audio Feed";
$feed_description = "Feed for the my audio files in some server folder";
$base_url = strtok('http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], '?'); //gets the current page's url. strips off the url's parameters
$allowed_extensions = array('mp4','mp3');
?>
<?php echo '<?xml version="1.0"?>'; //we have to use php to output the "<?" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">