Skip to content

Instantly share code, notes, and snippets.

Brendan Jou bjou

Block or report user

Report or block bjou

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@bjou
bjou / README.md
Last active Apr 4, 2017
X-ResNet-50 Best MT-VSO Model
View README.md

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 / imsequence2mov
Last active Aug 29, 2015
Convert Image Sequence to Playable MOV
View imsequence2mov
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
@bjou
bjou / ffmpeg_sample_convert_gif
Created Oct 1, 2013
Script to sample frames and convert frames to gif using ffmpeg.
View ffmpeg_sample_convert_gif
#!/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 Dec 20, 2015
ffmpeg_hd2sd_transcode_segment
View 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 Mar 1, 2013
Batch convert HD to SD while preserving the aspect ratio of 16:9.
View ffmpeg_hd2sd_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 Dec 12, 2015
Convert to QuickTime framework.
View ffmpeg_convert2mov
ffmpeg -i input_file.mp4 -acodec copy -vcodec copy -f mov output_file.mov
@bjou
bjou / preconvert_SHoUT
Created Jan 30, 2013
Convert to headerless PCM audio with 16kHz, 16bits, little-endian, mono
View preconvert_SHoUT
ffmpeg -i "$inFile" -vn -acodec pcm_s16le -ar 16000 -ac 1 -f s16le -y "$rawFile"
@bjou
bjou / ffmpeg_cut_transcode
Last active Dec 11, 2015
Cut and transcode to H.264/MPEG-4.
View ffmpeg_cut_transcode
ffmpeg -i INPUT -ss TIME -t DURATION -preset ultrafast -y [-loglevel quiet] OUTPUT.mp4
You can’t perform that action at this time.