Skip to content

Instantly share code, notes, and snippets.

@bjou
bjou / README.md
Last active April 4, 2017 13:32
X-ResNet-50 Best MT-VSO Model

Deep Cross Residual Learning for Multitask Visual Recognition

Authors: Brendan Jou and Shih-Fu Chang
Institution: Digital Video & Multimedia Lab @ Columbia University

Last verified compatible Caffe version: f28f5ae2f2453f42b5824723efc326a04dd16d85

Best published X-ResNet model on the Multitask-structured VSO dataset (from Table 2 in our paper):

Model

@bjou
bjou / ffmpeg_sample_convert_gif
Created October 1, 2013 19:19
Script to sample frames and convert frames to gif using ffmpeg.
#!/bin/sh
# check arg inputs
verbose=false
while getopts "hi:o:s:d:p:v" opt; do
case $opt in
h)
echo ""
exit 1
;;
@bjou
bjou / ffmpeg_hd2sd_transcode_segment
Last active December 20, 2015 07:59
ffmpeg_hd2sd_transcode_segment
# convert HD video to SD and transcode in one-shot
ffmpeg -i video.ts -preset ultrafast -y [-loglevel quiet] -aspect 16:9 -s 640:360 video.mp4
# batch segment the video in one-shot (no looped seeking)
# NOTES: "-vcodec" and "-acodec" can be changed to preferred stream types, e.g. libx264 and libfaac, respectively
# "-vbsf h264_mp4toannexb" optionally allows for broken mp4's to still get parsed
ffmpeg -i video.mp4 -vcodec copy -acodec copy -map 0 [-vbsf h264_mp4toannexb] [-loglevel quiet] -f segment -segment_format mp4 -segment_times <time_sec_1>,<time_sec_2>,<time_sec_3>,<...> output%02d.mp4
# TODO: needs further investigation on segmentation accuracy; cutting may still happen on i-frames due to keyframe-level accuracy, but this may have been solved by mpegts-to-mp4 transcoding
@bjou
bjou / ffmpeg_hd2sd_16:9
Created March 1, 2013 22:48
Batch convert HD to SD while preserving the aspect ratio of 16:9.
for i in *.mp4; do ffmpeg -y -i "$i" -aspect 16:9 -s 640:360 "${i%.*}"_sd.mp4; done
@bjou
bjou / ffmpeg_convert2mov
Last active December 12, 2015 07:58
Convert to QuickTime framework.
ffmpeg -i input_file.mp4 -acodec copy -vcodec copy -f mov output_file.mov
@bjou
bjou / preconvert_SHoUT
Created January 30, 2013 22:08
Convert to headerless PCM audio with 16kHz, 16bits, little-endian, mono
ffmpeg -i "$inFile" -vn -acodec pcm_s16le -ar 16000 -ac 1 -f s16le -y "$rawFile"
@bjou
bjou / ffmpeg_cut_transcode
Last active December 11, 2015 20:48
Cut and transcode to H.264/MPEG-4.
ffmpeg -i INPUT -ss TIME -t DURATION -preset ultrafast -y [-loglevel quiet] OUTPUT.mp4
@bjou
bjou / imsequence2mov
Last active August 29, 2015 14:05
Convert Image Sequence to Playable MOV
ffmpeg -framerate 3 -i %05d.png -c:v libx264 -r 3 <MP4FILE>.mp4
ffmpeg -i <MP4FILE>.mp4 -c:v libx264 -preset fast \
-pix_fmt yuv420p -r 23.98 -g 15 -s <W>x<H> -b 2500k -bt 300k \
-f mov <OUTFILE>.mov