Skip to content

Instantly share code, notes, and snippets.

View tobadia's full-sized avatar

Thomas Obadia tobadia

  • Institut Pasteur
  • Paris, France
View GitHub Profile
@tobadia
tobadia / ffmpeg_overlay_help
Created November 11, 2020 16:53
Incrustation de deux vidéos (Panopto)
# Usage principal (1 seule ligne)
# ffmpeg
# -i VIDEO_PRINCIPALE Fichier MP4 en .SCREEN.localview.mp4
# -i VIDEO_A_INCRUSTER Fichier MP4 en .DV.localview.mp4
# -ss TEMPS_A_RETIRER_AU_DEBUT Temps à couper, en secondes
# -filter_complex "..." Filtre à appliquer aux vidéos, cf. ci-dessous:
# "[1]scale=-1:ih/5 [pip]; La piste vidéo d'index 1 (2è en comptant de 0, càd 2è fichier d'entrée) est remise à l'échelle à 1/5è de sa hauteur et la largeur change de façon correspondante, et cette piste est ensuite dénommée 'pip' pour la référencer ici
# [0][pip] overlay=main_w-overlay_w-10:10" La piste vidéo d'index 0 (principale) se voit incrustée la pistes nommée 'pip' de façon à laisser 10 pixels à droite (lareur totale - largeur overlay - 10) et 10 en haut (10).
# output.mp4 Nom du fichier de sortie
@tobadia
tobadia / Synology hibernation issues
Last active May 3, 2020 13:03
Synology hibernation issues
# Delete undesired cron tasks
synoschedtask --get
synoschedtask --del id=...
@tobadia
tobadia / ffmpeg_video_to_gif
Last active July 17, 2018 13:41
Use ffmpeg to convert a video to a gif
ffmpeg -i input.mp4 -ss 00:00:24.000 -to 00:00:27.500 -vf scale=640:360 -r 20 cut.gif -hide_banner
# -ss: start time
# -to: end time (alternative: -t duration)
# -vf: rescale
# -r : change framerate to specified value
@tobadia
tobadia / mkvdts2ac3_helper
Last active August 7, 2017 12:45
Convert DTS audio to AC3 in a MKV file
#######################################################################
## Correct use of DTS2AC3 script forked from GitHub ##
## ##
## Source: https://github.com/JakeWharton/mkvdts2ac3 ##
## Last edit: 2017-05-30 ##
#######################################################################
## I forked the repo and cloned it into my NAS as of today
## Requirement: ffmpeg, mkvtoolnix, rsync
@tobadia
tobadia / Edit Android system files
Last active May 30, 2017 08:07
How to edit files on /system Android partition
#######################################################################
## Short reminder of how to edit a file in /system Android partition ##
## ##
## Useful because only a buggy version of vim is available on device ##
## Last edit: 2017-05-30 ##
#######################################################################
## Mount /system as rw and pull Bloat Removal Script
adb root
@tobadia
tobadia / .bash_profile
Last active November 11, 2020 16:32
Custom .bash_profile: one .bash_profile to rule them all
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management
# CM is dead, long live LineageOS
# Last update: 2017-05-08
# Initial state
Unlocked bootloader, any recovery, any rom, root enabled, TitaniumBackup installed
# Available documentation
LineageOS vanilla (official) https://forum.xda-developers.com/oneplus-one/orig-development/official-lineageos-14-1-oneplus-one-t3543489
LineageOS changelog (official) https://www.lineageoslog.com/14.1/bacon
@tobadia
tobadia / Some mkvtoolnix tweaks
Last active April 21, 2017 13:14
mkvtoolnix: remove 'header compression' for mkvmerge on old releases (>= 4.2.0 and below 6.x ?)
# The mkvtoolnix version that can be used on ARMv5 devices is an old 4.2.0-1 release.
# In this release, default is to switch on 'header compression'
# The solution is to take all tracks from a compressed file and have the corresponding headers uncompressed with the `--compression -1:none` (-1 is a wildcard for 'all tracks')
# This flag must be used for each input file, e.g.
mkvmerge -o "output.mkv" --compression -1:none "input1.mp4" --compression -1:none "input2.ac3" ...
# So, for adding subs.srt in an already existing mkv:
# Here I will keep a reminder of the steps to full wipe a OnePlus One device running CyanogenOS/CyanogenMod
# This is especially interesting on encrypted devices where I suspect partitions might get crippled over time
# Note: this guide assumes that you are already running the latest CyanogenOS version at the beginning (currently ZNH2KAS2X1).
# If not, dirty-upgrade to the latest version by flashing the update zip file from recovery and start from there.
# I will also assume that the current directory is the one where all the downloads are stored
# Step 0 : necessary stuff
# (http://forum.xda-developers.com/oneplus-one/general/official-cm11s-roms-ota-updates-t2906746)
# - CyanogenOS 13.1.1 (ZNH2KAS2X1) flashable zip (https://www.androidfilehost.com/?fid=24591000424953697) [cm-13.1.1-ZNH2KAS2X1-bacon-signed.zip]
# - CyanogenOS 13.1.1 (ZNH2KAS2X1) fastboot files to extract stock recovery (https://www.androidfilehost.com/?fid=24591000424953703) [cm-13.1.1-ZNH2KAS2X1-bacon-signed-fastboot.zip]