~jstys-z/helioviewer.org/client5

« back to all changes in this revision

Viewing changes to api/src/Movie/FFMPEGEncoder.php

  • Committer: Keith Hughitt
  • Date: 2012-05-29 13:44:18 UTC
  • mfrom: (402.4.52 hv)
  • Revision ID: keith.hughitt@nasa.gov-20120529134418-td0ckwaw3rb7nems
Merged in downstream changes

Show diffs side-by-side

added added

removed removed

Lines of Context:
94
94
        $outputFile = sprintf("%s%s-hq.%s", $this->_directory, $baseFilename, $this->_format);
95
95
        
96
96
        if ($this->_format == "mp4") {
97
 
            $this->_createH264Video($outputFile, "ultrafast", 15);
 
97
            $this->_createH264Video($outputFile, HV_X264_HQ_PRESET, 15);
98
98
        } else if ($this->_format == "webm") {
99
99
            $this->_createWebMVideo($outputFile, 1);
100
100
        }
145
145
     * 
146
146
     * @return String the filename of the video
147
147
     */
148
 
    private function _createH264Video($outputFile, $preset="lossless_fast", $crf=18)
 
148
    private function _createH264Video($outputFile, $preset=HV_X264_PRESET, $crf=18)
149
149
    {
 
150
        // Include x264 FFpreset if specified
 
151
        if ($preset) {
 
152
            $ffpreset = "-vpre $preset ";
 
153
        } else {
 
154
            $ffpreset = "";
 
155
        }
150
156
        $cmd = HV_FFMPEG . " -r " . $this->_frameRate . " -i " . $this->_directory . "frames/frame%d.bmp"
151
 
            . " -r " . $this->_frameRate . " -vcodec libx264 -vpre $preset " . $this->_getMetaDataString() . "-threads " 
 
157
            . " -r " . $this->_frameRate . " -vcodec libx264 " . $ffpreset . $this->_getMetaDataString() . "-threads " 
152
158
            . HV_FFMPEG_MAX_THREADS . " -crf $crf -s " . $this->_width . "x" . $this->_height . " -an -y $outputFile 2>/dev/null";
153
159
            
154
160
        $this->_logCommand($cmd);