# HG changeset patch # User dicklyon@google.com # Date 1368072025 0 # Node ID 3875bb31cc1013915625ddffe4d9b626483394bb # Parent ec3a1c74ec5455d1bd3534cf2a47a4ce9fe08108 And here's the function that run ffmpeg to make the movie from PNGs. diff -r ec3a1c74ec54 -r 3875bb31cc10 matlab/bmm/carfac/MakeMovieFromPngsAndWav.m --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/matlab/bmm/carfac/MakeMovieFromPngsAndWav.m Thu May 09 04:00:25 2013 +0000 @@ -0,0 +1,36 @@ +% Copyright 2013, Google, Inc. +% Author: Richard F. Lyon +% +% This Matlab file is part of an implementation of Lyon's cochlear model: +% "Cascade of Asymmetric Resonators with Fast-Acting Compression" +% to supplement Lyon's upcoming book "Human and Machine Hearing" +% +% Licensed under the Apache License, Version 2.0 (the "License"); +% you may not use this file except in compliance with the License. +% You may obtain a copy of the License at +% +% http://www.apache.org/licenses/LICENSE-2.0 +% +% Unless required by applicable law or agreed to in writing, software +% distributed under the License is distributed on an "AS IS" BASIS, +% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +% See the License for the specific language governing permissions and +% limitations under the License. + +function MakeMovieFromPngsAndWav(frame_rate, png_name_pattern, ... + wav_filename, out_filename) + +system(['rm ', out_filename]); + +if ~exist(wav_filename, 'file') + error('wave file is missing', wav_filename) +end + +ffmpeg_command = ['/opt/local/bin/ffmpeg' ... + ' -r ' num2str(frame_rate) ... + ' -i ' png_name_pattern ... + ' -i ' wav_filename ... + ' -b:v 1024k' ... + ' ' out_filename]; + +system(ffmpeg_command);