Skip to content

Instantly share code, notes, and snippets.

@jjehannet
jjehannet / LICENSE
Created April 14, 2021 22:52 — forked from wlib/LICENSE
Run a shell script with bash, line-by-line, prompted on each command. Useful for running unknown scripts or debugging. Not a secure substitute for understanding a script beforehand.
MIT License
Copyright (c) 2021 Daniel Ethridge
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@jjehannet
jjehannet / gist:bd85f1a40dbbb0d9eeddae5b0ccc8b14
Created April 4, 2020 11:08
FFMPEG (libx264) “height not divisible by 2”
When your are trying to encode a .mp4 video from a set of frames using FFMPEG using the libx264 codec. And get this error response [libx264 @ 0x24c6640] or [libx264 @ 0xa3b85a0] height not divisible by 2 ($widthx$height) the simple solution is to do as follow
-vf "scale=trunc(iw/2)*2:trunc(ih/2)*2"
Basically the issue stems from a bug(?) in libx264 where it complains if the width or height is not an even number. This is weird in the case where I don’t want to perform any scaling at all. So the command above will:
Divide the original height and width by 2
Round it down to the nearest pixel
Multiply it by 2 again, thus making it an even number
Resone

Keybase proof

I hereby claim:

  • I am jjehannet on github.
  • I am jjehannet (https://keybase.io/jjehannet) on keybase.
  • I have a public key whose fingerprint is 4960 71EC 1680 3B80 E92E 746A BE73 9B62 7826 6EF6

To claim this, I am signing this object:

@jjehannet
jjehannet / mysql2sqlite.sh
Last active January 7, 2016 19:19 — forked from esperlu/mysql2sqlite.sh
MySQL to Sqlite converter
#!/bin/sh
# Converts a mysqldump file into a Sqlite 3 compatible file. It also extracts the MySQL `KEY xxxxx` from the
# CREATE block and create them in separate commands _after_ all the INSERTs.
# Awk is choosen because it's fast and portable. You can use gawk, original awk or even the lightning fast mawk.
# The mysqldump file is traversed only once.
# Usage: $ ./mysql2sqlite mysqldump-opts db-name | sqlite3 database.sqlite
# Example: $ ./mysql2sqlite --no-data -u root -pMySecretPassWord myDbase | sqlite3 database.sqlite