Skip to content

Instantly share code, notes, and snippets.

@liquidzym
Created May 30, 2015 06:52
Show Gist options
  • Save liquidzym/4212ac56b52c1937f03b to your computer and use it in GitHub Desktop.
Save liquidzym/4212ac56b52c1937f03b to your computer and use it in GitHub Desktop.
ofxvideoRecoder
if (bRecordAudio && bRecordVideo){
ffmpegAudioThread.waitForThread();
ffmpegVideoThread.waitForThread();
//need to do one last script here to join the audio and video recordings
stringstream finalCmd;
finalCmd << ffmpegLocation << " -y " << " -i " << filePath << "_vtemp" << movFileExt << " -i " << filePath << "_atemp" << audioFileExt << " ";
finalCmd << "-c:v copy -c:a copy -strict experimental ";
finalCmd << filePath << "_high" << movFileExt;
ofLogNotice("FFMpeg Merge") << "\n==============================================\n Final Command \n==============================================\n";
ofLogNotice("FFMpeg Merge") << finalCmd.str();
// ѹËõÒ»·ÝСµÄ
stringstream extraCmd;
extraCmd << ffmpegLocation << " -i " << filePath << "_high" << movFileExt << " -vf scale=640:480 " << filePath << "_low" << movFileExt;
ofLogNotice("FFMpeg Resize") << " -------------------------- ";
ofLogNotice("FFMpeg Resize") << extraCmd.str();
stringstream delCmd;
delCmd << "del " << filePath << "_vtemp" << movFileExt << " " << filePath << "_atemp" << audioFileExt;
ofLogNotice("FFMpeg Delete Temp") << " ----------------------------- ";
ofLogNotice("FFMpeg Delete Temp") << delCmd.str();
ffmpegThread.setup(finalCmd.str(), extraCmd.str(), delCmd.str());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment