10.6: Use the pcastaction command to manipulate video files
Apr 01, '11 07:30:00AM • Contributed by: michelj

Apr 01, '11 07:30:00AM • Contributed by: michelj

The command is used by Podcast Capture to handle video to send to a MacOSX Server (Podcast Producer) but can also be used standalone. It is written in Ruby and uses Apple QTKit.
A few preliminary notes:
- All paths must be absolute (start from /). You can use `pwd` (with back quotes) in a shell to specify current directory path (see examples below).
- Most commands create 'reference movies' (with references to other files) which are not self-sufficient and can break if you move the original files. You should 'flatten' these with pcastaction or open them in QuickTime Player and save them to get a fully independent movie.
- Get info
pcastaction qtinfo --prb=`pwd` --input=`pwd`/movie.mp4 pcastaction qtinfo --prb=/Users/john/Movies/ --input=/Users/john/Movies/movie.mp4
- Extract soundtrack to 'movieaudio.m4a' file:
pcastaction extracttracks --prb=`pwd` --input=`pwd`/movie.mp4 --output=`pwd`/movieaudio.m4a --type=audio
- Extract soundtrack to file: movie.m4v:
pcastaction extracttracks --prb=`pwd` --input=`pwd`/movie.mp4 --output=`pwd`/movie.m4v --type=video
- Put an audio track in a video:
pcastaction addtracks --prb=`pwd` --tracks=`pwd`/movieaudio.m4a --input=`pwd`/movie.m4v --output=`pwd`/movie_av.mp4
- Extract a png image from movie at time (in seconds, with decimals possible):
pcastaction getposterimage --prb=`pwd` --input=`pwd`/movie.mp4 --output=`pwd`/movie_pic.png --time=120.20
- Trim a movie (times in seconds with decimals):
pcastaction trim --prb=`pwd` --input=`pwd`/movie.mp4 --output=`pwd`/movie_trimmed.mp4 --start_time=10.10 --end_time=1250.30
- Join (put one after the other) movies (if sizes don't match the biggest size will be used and the smaller video wil be put in top left corner):
pcastaction join --prb=`pwd` --input1=`pwd`/movie1.mp4 --input2=`pwd`/movie2.mp4 --output=`pwd`/movie_joined.mp4
- Flatten (make a self-contained movie):
pcastaction flatten --prb=`pwd` --input=`pwd`/movie_av.mov --output=`pwd`/movie_av_flatten.mov
pcastaction help (lists all subcommands)
[crarko adds: I haven't tested this one.]
•
[6,141 views]