~connorbell/ShaderChain

f346ea5d9d8d5ac39892d53941334721c03d2847 — Eris Fairbanks 3 years ago 6cfafd7 eris/start-time-and-precision
Offsetting and trimming audio using audio filters instead of doing timestamp tricks.
1 files changed, 1 insertions(+), 1 deletions(-)

M src/ShaderChain.cpp
M src/ShaderChain.cpp => src/ShaderChain.cpp +1 -1
@@ 582,7 582,7 @@ void ShaderChain::saveVideo(string outputFilename) {
    if (fft.currentState == InputStateSoundFile) {
        string outputMp4AudioFilename = outputFilename + "_audio.mp4";
        outputMp4AudioFilename = createUniqueFilePath(outputMp4AudioFilename);
        string addSoundCommand = this->ffmpegCommand + " -i \"" + outputMp4Filename + "\" -itsoffset " + std::to_string(-this->pngRenderer->starttime) + " -i \"" + fft.soundFilePath + "\" -vcodec copy -acodec aac -shortest " + outputMp4AudioFilename;
        string addSoundCommand = this->ffmpegCommand + " -i \"" + outputMp4Filename + "\" -i \"" + fft.soundFilePath + "\" -af atrim=start=" + std::to_string(this->pngRenderer->starttime) + ":duration=" + std::to_string(this->pngRenderer->animduration) + ",asetpts=PTS-STARTPTS -vcodec copy -acodec aac -shortest " + outputMp4AudioFilename;
        system(addSoundCommand.c_str());
        outputMp4Filename = outputMp4AudioFilename;
    }