See how a minor change to your commit message style can make you a better programmer.
Format: <type>(<scope>): <subject>
<scope>
is optional
# All my gist code is licensed under the terms of the MIT license. | |
# Video demo: https://www.youtube.com/shorts/WVyqVkGYb4k | |
# Add this somewhere in ~/.bashrc | |
# write_message | |
# - write a message on the lower right corner of the terminal | |
function write_message () { | |
if [[ "$#" -eq 0 ]]; then |
These are notes while researching a way to convert a browser/website to a stream. This could be used for Facebook Live or for webrecording. TL'DR:
nVidia
nvresize
patch is outdated and not more compatible to the latest version of FFmpeg, so it's not included in this documentation.
(even if I've passed a lot of time at trying to make it compile... without any success)
Please don't rely on this page: https://developer.nvidia.com/ffmpeg, the implementation is a hack and was never been added to the main FFmpeg tree.
See:
import time | |
import psycopg2 | |
from iter_file import IteratorFile | |
conn = psycopg2.connect(host="localhost", database="test") | |
# args = [(1,2), (3,4), (5,6)] | |
args = [(i,i+1) for i in range(1,1*10**4,2)] |
See my DASH-IF presentation from October, 2014: | |
https://s3.amazonaws.com/misc.meltymedia/dash-if-reveal/index.html#/ | |
1. encode multiple bitrates with keyframe alignment: | |
ffmpeg -i ~/Movies/5D2_Portrait.MOV -s 1280x720 -c:v libx264 -b:v 1450k -bf 2 \ | |
-g 90 -sc_threshold 0 -c:a aac -strict experimental -b:a 96k -ar 32000 out.mp4 | |
My input was 30 fps = 3000 ms. If it were 29.97, then a GOP size of 90 frames will yield a base segment | |
size of 3003 milliseconds. You can make the segment size some multiple of this, e.g.: 6006, 9009, 12012. |
Quick and easy way of making Chrome send bittorrent magnet links to a remote Transmission instance using its API on Ubuntu with xdg. This method does not require modifying any system files or xdg's scripts, whereas most of the examples I found on the Internet did require such hacks.
Chrome does not handle default applications, instead relying on the OS to manage that. The default handler in Ubuntu is xdg, which maps the MIME type to the default application. Extra tooling is required because xdg requires a registered desktop file, so you can't simply give it a command to run.
Steps:
Install the shell script transmission-remote-magnet
ideally in /usr/local/bin
: ln -s ~/src/transmission-remote-magnet.bash transmission-remote-magnet
Install the desktop file, which is required for xdg to work and will likely require sudo: desktop-file-install ./transmission-remote-magnet.desktop
"""Adapted from http://askubuntu.com/a/141641 | |
This compatibility layer allows to use either PySide or PyQt4 as the Qt | |
binding. It will choose what's available, defaulting on PySide, unless the | |
QT_API environment variable is set. | |
""" | |
import os | |
import sys |