Skip to content

Instantly share code, notes, and snippets.

View mcxiaoke's full-sized avatar

Hello World mcxiaoke

  • Earth
View GitHub Profile

Get/set ID3 meta tags using ffmpeg

A quick guide on how to read/write/modify ID3 metadata tags for audio / media files using ffmpeg.

FFmpeg has a free-form command line option that allows the user to specify key-value-pairs for encoding metadata. Let's take a look.

1. Read ID3 metadata

To list all global metadata tags for a media file, just set an input but no output file.

@mcxiaoke
mcxiaoke / cue_to_flac.py
Created July 25, 2021 15:03 — forked from Theldus/cue_to_flac.py
CUE splitter using ffmpeg (to flac)
cue_file = 'file.cue'
d = open(cue_file).read().splitlines()
general = {}
tracks = []
current_file = None
@mcxiaoke
mcxiaoke / fix-gammu-smsd.md
Created July 24, 2021 08:12 — forked from Z-M-Huang/fix-gammu-smsd.md
Fix gammu-smsd.service bad-setting on Ubuntu
@mcxiaoke
mcxiaoke / command.txt
Created July 24, 2021 02:47 — forked from nrk/command.txt
Using ffprobe to get info from a file in a nice JSON format
ffprobe -v quiet -print_format json -show_format -show_streams "lolwut.mp4" > "lolwut.mp4.json"
@mcxiaoke
mcxiaoke / ffmpeg-gnu-parallel-snippets.md
Created July 18, 2021 15:16 — forked from Brainiarc7/ffmpeg-gnu-parallel-snippets.md
Some snippets you can quickly adapt for use with FFmpeg and GNU Parallel for use for standard tasks.

Useful Examples of ffmpeg and GNU parallel on the command-line:

Transcoding FLAC music to Opus:

ffmpeg is a highly useful application for converting music and videos. However, audio transcoding is limited to a a single core. If you have a large FLAC archive and you wanted to compress it into the efficient Opus codec, it would take forever with the fastest processor to complete, unless you were to take advantage of all cores in your CPU.

parallel 'ffmpeg -v 0 -i "{}" -c:a libopus -b:a 128k "{.}.opus"' ::: $(find -type f -name '*.flac')

Transcoding Videos to VP9:

// Phys monitor control via DDC/CI or VESA commands
// (David Lowndes)
// From https://social.msdn.microsoft.com/Forums/en-US/5437ddb8-af86-4cf0-8061-798e6601e08e/how-to-control-system-brightness-using-windows-api-?forum=windowsgeneraldevelopmentissues#554b7b7f-0aab-429d-9c36-fd39608979b0
#include <Windows.h>
#include <physicalmonitorenumerationapi.h>
#include <highlevelmonitorconfigurationapi.h>
#pragma comment( lib, "Dxva2.lib" )
void
@mcxiaoke
mcxiaoke / crc16.c
Created June 12, 2021 04:11 — forked from tijnkooijmans/crc16.c
CRC-16/CCITT-FALSE
uint16_t crc16(char* pData, int length)
{
uint8_t i;
uint16_t wCrc = 0xffff;
while (length--) {
wCrc ^= *(unsigned char *)pData++ << 8;
for (i=0; i < 8; i++)
wCrc = wCrc & 0x8000 ? (wCrc << 1) ^ 0x1021 : wCrc << 1;
}
return wCrc & 0xffff;
@mcxiaoke
mcxiaoke / msys2.reg
Created June 8, 2021 02:29 — forked from magthe/msys2.reg
MSYS2 "Open Here" registry settings
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\Background\shell\open_msys2]
@="Open MSYS2 here"
[HKEY_CLASSES_ROOT\Directory\Background\shell\open_msys2\command]
@="c:\\msys64\\usr\\bin\\mintty.exe /bin/sh -lc 'cd \"$(cygpath \"%V\")\"; exec bash'"
[HKEY_CLASSES_ROOT\Folder\shell\open_msys2]
@="Open MSYS2 here"
@mcxiaoke
mcxiaoke / profile.ps1
Created June 3, 2021 03:23 — forked from timsneath/profile.ps1
PowerShell template profile: adds some useful aliases and functions
### PowerShell template profile
### Version 1.03 - Tim Sneath <[email protected]>
### From https://gist.github.com/timsneath/19867b12eee7fd5af2ba
###
### This file should be stored in $PROFILE.CurrentUserAllHosts
### If $PROFILE.CurrentUserAllHosts doesn't exist, you can make one with the following:
### PS> New-Item $PROFILE.CurrentUserAllHosts -ItemType File -Force
### This will create the file and the containing subdirectory if it doesn't already
###
### As a reminder, to enable unsigned script execution of local scripts on client Windows,
@mcxiaoke
mcxiaoke / README.md
Created March 6, 2021 04:33 — forked from tombigel/README.md
How to Change Open Files Limit on OS X and macOS Sierra (10.8 - 10.12)

How to Change Open Files Limit on OS X and macOS

This text is the section about OS X Yosemite (which also works for macOS Sierra) from https://docs.basho.com/riak/kv/2.1.4/using/performance/open-files-limit/#mac-os-x

The last time i visited this link it was dead (403), so I cloned it here from the latest snapshot in Archive.org's Wayback Machine https://web.archive.org/web/20170523131633/https://docs.basho.com/riak/kv/2.1.4/using/performance/open-files-limit/

Mac OS X

To check the current limits on your Mac OS X system, run: