Tag Archives: video

Morgan Territory Motorcyclin’ — 85 mile east bay loop around Mt. Diablo with Honda CB400A “decaf”

After months of work, Russ finally gets his Ninja 600cc working!

Hunter, Russ, and I celebrate with an 85-mile day trip during the three day weekend around Mount Diablo, through the legendary Morgan Territory.

Ridden over: Oakland, Canyon, Moraga, Lafayette, Walnut Creek, Clayton, Morgan Territory, Danville, San Ramon, and home!

Posted in biking, motorcycles, video | Tagged , , , , , , | Leave a comment

simple way to make h.264 mp4 web and iOS/mobile playable video mp4 files for linux and macosx using ffmpeg

Greetings video geeks! 8-)

At my job, I’ve updated the process and way we create our .mp4 files that are shown on video pages on archive.org

It’s a much cleaner/clearer process, namely:

  • I opted to ditch ffpreset files in favor of command-line argument 100% equivalents. It seems a bit easier for someone reading the task log of their item, trying to see what we did.
  • I no longer need qt-faststart step and dropped it. I use the cmd-line modern ffmpeg “-movflags faststart”

Entire processing is now done 100% with ffmpeg, in the standard “2-pass” mode
As before, this output .mp4:

  • plays in modern html5 video tag compatible browsers
  • plays in flash plugin within browsers
  • works on all iOS devices
  • makes sure the “moov atom” is at the front of the file, so browsers can playback before downloading the entire file, etc.

Here is an example (you would tailor especially the “scale=640:480″ depending on source aspect ratio and desired output size; change or drop altogether the “-r 20″ option (the source was 20 fps, so we make the dest 20 fps); tailor the bitrate args to taste):

  • ffmpeg -y -i stairs.avi -vcodec libx264 -pix_fmt yuv420p -vf yadif,scale=640:480 -profile:v baseline -x264opts cabac=0:bframes=0:ref=1:weightp=0:level=30:bitrate=700:vbv_maxrate=768:vbv_bufsize=1400 -movflags faststart -ac 2 -b:a 128k -ar 44100 -r 20 -pass 1 -acodec aac -strict experimental stairs.mp4;
  • ffmpeg -y -i stairs.avi -vcodec libx264 -pix_fmt yuv420p -vf yadif,scale=640:480 -profile:v baseline -x264opts cabac=0:bframes=0:ref=1:weightp=0:level=30:bitrate=700:vbv_maxrate=768:vbv_bufsize=1400 -movflags faststart -ac 2 -b:a 128k -ar 44100 -r 20 -pass 2 -acodec aac -strict experimental -metadata title=’”Stairs where i work” – lame test item, bear with us – http://archive.org/details/stairs’ -metadata year=’2004′ -metadata comment=license:’http://creativecommons.org/licenses/publicdomain/’ stairs.mp4;

Happy hacking and creating!

PS: here is the way we compile ffmpeg (we use ubuntu linux at work, but this script works on macosx, too).

Posted in linux, video | Tagged , , , , , , | Leave a comment

convert yuvj420p to yuv420p (chrome playable!) mp4 video (eg: canon/nikon video)

hooray!

found a nice (video lossless, best i can tell) way to convert the video from cameras like my Canon ELPH SD1400,
which is *already* h.264 video + PCM mono audio

to a new mp4 container with aac audio. that part’s easy/cake w/ ffmpeg — but the trick to get the h.264
video part to play in chrome browser and/or with a flash plugin is to get the flagged “yuvj420p” colorspace pixels
to be considered “yuv420p”. it seems like the former is >= 8 bits-per-pixel and has a range wider than the 256 values;
while the later is 8 bit per pixel. ( brief info/notes/background )

at any rate, finally found this nice post:

https://blendervse.wordpress.com/2012/04/02/waiving-the-fullrange-flag/

which refers to this modified MP4Box/gpac tree, to switch the “fullrange” color-related flag off:
https://github.com/golgol7777/gpac

and then, voila! i have a nice little script where i can convert my canon ELPH videos to a html5 video tag and flash plugin compatible mp4:


#!/bin/bash -ex

IN=${1:?"Usage: [input video] [output video]"};
OUT=${2:?"Usage: [input video] [output video]"};

# make a hacked version of "mp4box" that can toggle a colorspace-related flag in our video!
if [ ! -e $HOME/scripts/mp4box ]; then
(git clone https://github.com/golgol7777/gpac.git && cd gpac) || \
( cd gpac && git reset --hard && git clean -f && git pull && git status );

./configure --enable-pic --static-mp4box --enable-static-bin
make -j4;

# bonus points: make a *static* binary so if we change linux/OS versions, dont hafta worry!
cd applications/mp4box;
gcc -o $HOME/scripts/mp4box -static main.o filedump.o fileimport.o live.o -L../../bin/gcc -lgpac_static -lm -lpthread -ldl -lz
fi

# demux
ffmpeg -y -i "$IN" -an -vcodec copy video.mp4;
ffmpeg -y -i "$IN" -vn -acodec copy audio.wav;

# convert yuvj420p to yuv420p the cheater way (for chrome and flash plugin playback!)
rm -fv tmp.mp4;
$HOME/scripts/mp4box -add video.mp4#:fullrange=off tmp.mp4

# convert wav audio to aac
ffmpeg -y -i tmp.mp4 -i audio.wav -acodec libfaac -ac 1 -ab 256k -vcodec copy t2.mp4;
qt-faststart t2.mp4 "$OUT";
rm -fv video.mp4 audio.wav t2.mp4 tmp.mp4;

Posted in video | Tagged , , , , , | 2 Comments

deinterlacing 2323 telecine video into fields for visual analysis

Having some challenging fun working on trying to deinterlace some toughie clips
from my brother’s upcoming feature film.

His camera recorded in 24fps (24000/1001 to you fellow geeks 8-) and smartly
did a “2323″ writing/stretching of it to 60i (60 half-frames).
After correcting back to 24fps progressive most of his clips, he’s found ~10-20%
are not able to be put back together visually properly even with CineTools
and manually specifying the “cadence” and sequence starting frames, etc…

I started with code that I wrote to take a small segment of a video
and split the interlaced frames into 1/2 height “fields” and then drop them
down to grayscale to compare them all to each other to find the best matches
(to verify the cadence is right and/or the fields aren’t “off by 1″, etc..)

It uses mplayer and ImageMagick (“convert” and “compare”) for pretty high-quality
extraction of frames from the source video into the 1/2 height “fields”.

So I just do about 0.3 seconds to get 10 frames, and thus 20 1/2 frame fields for analyzing.
It will output the best matches of frames. For example:

php lacer.php good.mov 0.5 0.8

I then extended it into a web page (screenshot above, where I’m left-shifting one field by 4 pixels for visual inspection)
PHP script <== try it out online! (source)
that uses some CSS cleverness (clip property is your BFF!) to interlace together a pair of fields.
It supports:

  • field swapping (move one 1/2 image to be the 1st, 3rd, 5th, etc. lines — if it was
    previously the 2nd, 4th, 6th, etc. lines)
  • left and right shifting a field
  • pairing arbitrary fields
  • showing a “raw” 60i telecined sequence
  • showing the 60i sequence as a “deinterlaced” 24P sequence
Posted in video | Tagged , , , | Leave a comment

iphone and external mic sennheiser mke 400 can rule the galaxy!

20120121-005805.jpg

a very small galaxy

Posted in video | Tagged , , | 1 Comment

natively compiling ffmpeg, mplayer, mencoder on MacOS Lion (with x264!)

OK, I’ve revamped my script to compile these tools:
ffmpeg
ffrobe
qt-faststart
mplayer
mencoder

on MacOS Lion, using the heads of the trees, with direct encoding support for:
x264
vpx / WebM

http://archive.org/~tracey/downloads/macff.sh.txt

A nice recent update to ffmpeg is the ability to decode/read Apple ProRes, too!

Posted in video | Tagged , , , , | 2 Comments

camaro 0 to 60 test

2012 Camaro V6 Transformers Edition “Bumblebee”

Hunter and I had some fun out in the east east Bay and gorgeous farmland countryside seeing how my little ‘Bee can buzz!

Not super sophisticated Ms. Driver — but still lotsa fun and sorta exciting to poach a street for some two-camera iPhone pseudo-documentary…

Posted in video | Tagged , , | Leave a comment

natively compiling ffmpeg, x264, mplayer on mac (with builtin x264 and webm encoding)

i’m very pleased that after years of hacks here and there, all three heads of the current codebases pretty well build natively on mac (snow leopard) for

  • x264
  • ffmpeg
  • mplayer

here, i’m making sure that i compile in static version of libvpx (Webm) and libx264 (h.264) video packages so that the ffmpeg can easily make hiqh quality h.246 and webm transcoded videos.

http://archive.org/~tracey/downloads/macff.sh

 

So we can make nice (2 pass video) ~768 kb/sec 640×480 derivatives like so (alter “-r ” as appropriate):

# make WebM
ffmpeg -deinterlace -y -i 'camels.avi' -vcodec webm -fpre libvpx-360p.ffpreset -vf scale=640:480 -r 20 -threads 2 -map_meta_data -1:0 -pass 1 -an tmp.webm

ffmpeg -deinterlace -y -i 'camels.avi' -vcodec webm -fpre libvpx-360p.ffpreset -vf scale=640:480 -r 20 -threads 2 -map_meta_data -1:0 -pass 2 -acodec libvorbis -ab 128k -ac 2 -ar 44100 tmp.webm

mv tmp.webm 'camels.webm'

 

# make h.264

ffmpeg -deinterlace -y -i 'camels.avi' -vcodec libx264 -fpre libx264-IA.ffpreset -vf scale=640:480 -r 20 -threads 2 -map_meta_data -1:0 -pass 1 -an tmp.mp4


ffmpeg -deinterlace -y -i 'camels.avi' -vcodec libx264 -fpre libx264-IA.ffpreset -vf scale=640:480 -r 20 -threads 2 -map_meta_data -1:0 -pass 2 -acodec aac -strict experimental -ab 128k -ac 2 -ar 44100 tmp.mp4

qt-faststart tmp.mp4 'camels.mp4'

our preset files:
http://archive.org/~tracey/downloads/libvpx-360p.ffpreset
http://archive.org/~tracey/downloads/libx264-IA.ffpreset

Nice things about the h.264 derivative:

  • plays on all iphones and ipads
  • browser video tag and/or flash plugin compatible
  • starts immediately, seeks immediately even before entire video is downloaded

hope this may be useful!

Posted in video | Tagged , , | 3 Comments

star wars 1977 reedit night

stormtrooper helmets

russ and i without our normal masks

We had a blast watching our favorite film Monday night at our new “work theatre” (as opposed to “home”) and my new accurate prop replica pieces came in for the event!

Posted in video | Tagged , | 3 Comments

Amazing Summer trip to Bali!

Two week vacation to the glorious island of Bali, summer 2010.

Bali is culturally fascinating — full of very happy and cooperative people unlike any place I’ve seen. Here are some interesting tidbits/observances:

Bali is an amazing isolated place whose people typically lives communally and is based off of the agriculture of rice. Despite being part of Islamic Indonesia, the vast majority (70%+) of the people are Hindu (with a mix of Animism from Bali’s indigenous roots).

We saw everything we could, ate their amazing food, and tried to soak up as much Balinese culture as we could!

You can see more formats and information here.

Posted in culture, vacation, video | Tagged , , , , | Leave a comment

Sony P-Series running 10.10 Meerkat Ubuntu

Sony P-Series
(specifically: win7 era P788K, 8″ 1600×768 display, 2B RAM, GMA 500 graphics, 64GB SSD)

I got this supercute mini-laptop last year

I had been using Ubuntu linux Lucid (10.4) and just upped to Meerkat (10.10). (Both were Netbook Edition).
I’d never gotten video acceleration to work before and was stuck w/ ~1-5 fps video most of the time.

Doing the widely suggested:

sudo add-apt-repository ppa:gma500/ppa && sudo add-apt-repository ppa:gma500/fix && sudo apt-get update && sudo apt-get install poulsbo-driver-2d poulsbo-driver-3d poulsbo-config

bricked my vaio 8-( well, i mean, it gave me root login w/o X/windows ability but… 8-p)
but 2-3 apt-get remove, reinstalls, hunting google later, found the apparent saviour (I did 1000mb from 2000mb recommended here):

sudo nano /etc/default/grub
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash mem=1000mb acpi_osi=Linux"
sudo update-grub

booted clean! *immediately* got ability to use proprietary vaio accessory to output VGA to external monitor (a first!) and brightness up/down hotkeys working. (brightness to work even at all!)
but best of all, video and appearance *and everything* (moving windows, starting applications) was *so much faster* visually!

cmd-line video playback with:
sudo apt-get remove mplayer
sudo apt-get install gnome-mplayer gecko-mediaplayer

so this is *all* i have done, aside from starting w/ vanilla install (with just a few changes to help w/ SSD instead of HD) of lucid upgraded to meerkat.
(personally, i’m still working on getting suspend/resume to work (seems to work but the display doesn’t come back on — been like this the whole time) and to get hibernate to work — prolly will go with some kinda memory stick to dump to)

UPDATE!

suspend/resume working now with change to suggested “gma500 fix”

sudo add-apt-repository ppa:gma500/ppa && sudo add-apt-repository ppa:gma500/fix && sudo apt-get update && sudo apt-get install poulsbo-driver-2d poulsbo-driver-3d poulsbo-config

I think this additional suggestion may have fixed sleep/resume (but it’s possible it was just the gma500/fix related packages in live above:

sudo mv /usr/lib/pm-utils/sleep.d/99video /usr/lib/pm-utils/99video

Posted in linux, video | Tagged , , | 4 Comments

Another great indie film

Hunter and I really really liked this film shown on PBS this week. It nicely wanders in its storytelling and is really thoughtfullly done. John Adams (I think) said his best piece of lawyer-ing was defending the British in Boston after the Boston Massacre. The military officer who defended the Gitmo detainee here is a true American hero. “The Oath”

Posted in video | Tagged | Leave a comment

Great Frontline program — The Wounded Platoon

I just listened to this as a podcast and then watched the video online after that.  It’s a really interesting slice and view into the Iraq war — where they just focus on one specific platoon.  ”Wounded” refers more to the psychological rather than physical wounds — although the latter relates to the former…

The original materials, background, and discussion can be seen here.

The 7 chapter program can be seen in its entirety here:

requires javascript

Posted in video | Tagged , , , | Leave a comment

Star Wars re-remastered to high quality 1977 version!

So I wanted to sit down in my updated home theatre and watch one of my favorite films, “Star Wars”. Problem is, I have two versions on DVD, and neither are ideal. The 2004 DVD version has remastered audio and video, but also added scenes and changes I really don’t like. The 1977 DVD version is a poor quality transfer and encoding.

So I combined the 1977 and 2004 DVDs into the highest quality 1977 version of the film! I show all my scripts and techniques here, too, so you can make the same version from your two DVDs, too!
http://archive.org/details/reremaster

star wars comparison of two films

star wars comparison of two films

Posted in video | Tagged , , , | Leave a comment

ffmpeg for time-lapse, sets of images, and even *archiving*!

I now use the FFMPEG package compiled locally on my Mac Leopard laptop.

If you want to take a bunch of JPEG images, you can turn them into a “motion JPEG” AVI video file (which is ideal for time-lapse). What’s neat about ffmpeg, is you can turn a directory of JPEGs into an AVI and later recreate the JPEGs from the AVI.

Thus, I can take 100-1000 JPEG images from a “shoot” and create a video time-lapse of all the JPEG images in a given subdir in a command-line shell (terminal):
ffmpeg -r 6 -i "%04d.jpg" -an -vcodec copy out.avi

Even cooler, you can go directly back to *the same JPEG* images like so (this is where you can see it is a lossless conversion from JPEGs to Motion JPEG and back):
ffmpeg -i out.avi -vcodec copy "%04d.jpg"

“-r 6″ is the framerate, ie: “make the video play 6 JPEG images per second”.

It doesn’t get much nicer than that! Not to mention, the encoding is FAST! I recently moved from mencoder/mplayer to ffmpeg since you can specify a complete copy of the input JPEGs (lossless from the source) as well as compress them down a bit (as you like).

For the lossless conversion, the (not entirely obvious) *key* to success is to use the “-vcodec copy” *after* the source file(s).

You can get this running on Windows with Cygwin, Mac with terminal, and any linux distribution like Ubuntu.

Posted in video | Tagged , | 1 Comment

It’s OK to be a TRL (video)

Hunter and Tracey finish up their season of being

Training Ride Leaders

and share a little of what they’ve learned

It’s OK to be a TRL

Posted in biking, video | Tagged , , , | Leave a comment

ffmpeg building on mac intel/x386

ffmpeg v0.5 just came out. it’s the bomb. it’s got tons of fixes and massive amounts of new codecs that it can read. for example, it can now decode my professional filmmaker brother’s “DVC ProHD” highly proprietary (and massive bitrate!) format! it can also decode flac and 24-bit flac. (encoding flac is disappointing though).

at any rate! macports is a great way to get it installed on your mac.
the current way of setting up macports and then doing
sudo port install ffmpeg
works fine on my PPC at work (oddly — pretty old computer now) but not my Air (intel x386)

So I set out to find the fixes needed to make it work. Here they are:

step 1: install macports — see http://www.macports.org/install.php

sudo port install x264 +noasm # for i386 (not needed for PPC)
sudo port fetch ffmpeg
sudo port checksum ffmpeg
sudo port extract ffmpeg
sudo port patch ffmpeg
remove “–enable-shared” from /opt/local/var/macports/sources/rsync.macports.org/release/ports/multimedia/ffmpeg/Portfile
sudo port install ffmpeg

[May update] I think the packages are improving so some of the above steps may not be necessary, depending on your Mac model, xcode version, and such. So I’d suggest just trying “sudo port install ffmpeg” first to see if it works and try some tweaks above if that doesn’t work

Posted in video | Tagged , | Leave a comment