Skip to content

Instantly share code, notes, and snippets.

View kieranjol's full-sized avatar

Kieran O'Leary kieranjol

View GitHub Profile
#!/bin/bash -x
SCRIPT=$(basename $0)
VERSION='2016-02-21'
AUTHOR='reto.sh'
RED='\033[1;31m'
GREEN='\033[1;32m'
NC='\033[0m'
output_prompt() {
cat <<END_OF_MSG
<?xml version="1.0" encoding="UTF-8"?>
<MediaTrace
xmlns="https://mediaarea.net/mediatrace"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://mediaarea.net/mediatrace https://mediaarea.net/mediatrace/mediatrace_0_1.xsd"
version="0.1">
<creatingLibrary version="0.7.83" url="https://mediaarea.net/MediaInfo">MediaInfoLib</creatingLibrary>
<media ref="/Users/kieranoleary/Downloads/CHARBON-SMPTE-24/sub1_24.mxf">
<block offset="0" name="Closed and Complete Header Partition Pack" size="140">
<block offset="0" name="Header" size="20">
<?xml version="1.0" encoding="UTF-8"?>
<MediaTrace
xmlns="https://mediaarea.net/mediatrace"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://mediaarea.net/mediatrace https://mediaarea.net/mediatrace/mediatrace_0_1.xsd"
version="0.1">
<creatingLibrary version="0.7.84" url="https://mediaarea.net/MediaInfo">MediaInfoLib</creatingLibrary>
<media ref="/Users/kieranoleary/Downloads/CHARBON-SMPTE-24/sub1_24.mxf">
<block offset="0" name="Closed and Complete Header Partition Pack" size="140">
<block offset="0" name="Header" size="20">
#!/usr/bin/env python
import subprocess
import sys
import os
from glob import glob
import pdb
from sys import platform as _platform
if len(sys.argv) < 2:
import lxml
import sys
filename = sys.argv[1]
from lxml import etree
srt_file = filename +'.srt'
xmlo = etree.parse(filename)
count = int(xmlo.xpath('count(//Subtitle)'))
counter = 0
with open(srt_file, "w") as myfile:
PS H:\dcps\ffmpeg_test> ffmpeg -i H:\dcps\ffmpeg_test\short_dcp.mxf -c:v libx264 -pix_fmt yuv420p -vf subtitles=subtitle
.xml.srt:force_style=PrimaryColour=white shortx264.mov
ffmpeg version N-79883-g38eeb85 Copyright (c) 2000-2016 the FFmpeg developers
built with gcc 5.3.0 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfi
g --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --
enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmfx --enable-libmp3l
ame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enabl
e-libschroedinger --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-
libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx
import subprocess
import sys
import os
first_file = sys.argv[1]
rejigged_name = first_file.split("_")[0:-1]
print rejigged_name
test = ''
def convert_imperial():
imperial_height = raw_input('What height are you in imperial measurements, eg 5 11?:')
feet = int(imperial_height[0:2])
inches = int(imperial_height[-2:])
total_inches = (feet * 12) + inches
metric = float(total_inches) * 0.0254
print 'You are %s metres tall ' % metric
def convert_weight():
imperial_weight = raw_input('What weight are you in imperial measurements, eg 12 8?:')
ifi-mac-pro:~ admin$ ffmpeg -i out.mkv -map 0:a out1.mov
ffmpeg version git-2016-06-21-9204a84 Copyright (c) 2000-2016 the FFmpeg developers
built with Apple LLVM version 7.3.0 (clang-703.0.31)
configuration: --prefix=/usr/local/Cellar/ffmpeg/HEAD --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-opencl --enable-libx264 --enable-libmp3lame --enable-libxvid --enable-libfreetype --enable-ffplay --disable-lzma --enable-libopenjpeg --disable-decoder=jpeg2000 --extra-cflags=-I/usr/local/Cellar/openjpeg/1.5.2_1/include/openjpeg-1.5 --enable-vda
libavutil 55. 24.100 / 55. 24.100
libavcodec 57. 46.100 / 57. 46.100
libavformat 57. 38.102 / 57. 38.102
libavdevice 57. 0.101 / 57. 0.101
libavfilter 6. 46.102 / 6. 46.102
libavresample 3. 0. 0 / 3. 0. 0
ifi-mac-pro:~ admin$ ffmpeg -i out.mkv -map 0:a? out1.mov
ffmpeg version git-2016-06-21-9204a84 Copyright (c) 2000-2016 the FFmpeg developers
built with Apple LLVM version 7.3.0 (clang-703.0.31)
configuration: --prefix=/usr/local/Cellar/ffmpeg/HEAD --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-opencl --enable-libx264 --enable-libmp3lame --enable-libxvid --enable-libfreetype --enable-ffplay --disable-lzma --enable-libopenjpeg --disable-decoder=jpeg2000 --extra-cflags=-I/usr/local/Cellar/openjpeg/1.5.2_1/include/openjpeg-1.5 --enable-vda
libavutil 55. 24.100 / 55. 24.100
libavcodec 57. 46.100 / 57. 46.100
libavformat 57. 38.102 / 57. 38.102
libavdevice 57. 0.101 / 57. 0.101
libavfilter 6. 46.102 / 6. 46.102
libavresample 3. 0. 0 / 3. 0. 0