Is it possible to speed up video with audio using ffmpeg, without changing audio pitch?












0















Is there a relatively simple way to speed up a video (mp4, with aac encoded audio), by say "x1.25" or "x1.3" while keeping the original audio-video sync, but also retaining the original pitch of the audio ?



I've read some discussions about extracting audio track into separate file, then use rubberband to lower the pitch by the requisite value, and then merge the audio video tracks using ffmpeg with speed-up, which raises the pitch of the audio back again to original. However, it appears that this is a bit of hit-n-miss, because rubberband appears to use number of octaves as the parameter to raise or lower pitch, and this may not always align perfectly with the video, as musical notes / octaves have specific ratios. Also, this is cumbersome.



So, is there any simpler ways using ffmpeg alone ?










share|improve this question


















  • 1





    rubberband offers a tempo option which takes in a decimal number.

    – Gyan
    May 21 '18 at 6:03











  • Thanks @Gyan. Sounds like a valid answer, even if it is not as simple as I'd hope it to be, but removes the issue of rubberband being (wrongly presumed to be) limited to pitch change based on number of notes (of a chromatic scale).

    – icarus74
    May 21 '18 at 6:20






  • 1





    rubberband can be compiled as a ffmpeg filter, so no need to extract audio.

    – Gyan
    May 21 '18 at 6:42
















0















Is there a relatively simple way to speed up a video (mp4, with aac encoded audio), by say "x1.25" or "x1.3" while keeping the original audio-video sync, but also retaining the original pitch of the audio ?



I've read some discussions about extracting audio track into separate file, then use rubberband to lower the pitch by the requisite value, and then merge the audio video tracks using ffmpeg with speed-up, which raises the pitch of the audio back again to original. However, it appears that this is a bit of hit-n-miss, because rubberband appears to use number of octaves as the parameter to raise or lower pitch, and this may not always align perfectly with the video, as musical notes / octaves have specific ratios. Also, this is cumbersome.



So, is there any simpler ways using ffmpeg alone ?










share|improve this question


















  • 1





    rubberband offers a tempo option which takes in a decimal number.

    – Gyan
    May 21 '18 at 6:03











  • Thanks @Gyan. Sounds like a valid answer, even if it is not as simple as I'd hope it to be, but removes the issue of rubberband being (wrongly presumed to be) limited to pitch change based on number of notes (of a chromatic scale).

    – icarus74
    May 21 '18 at 6:20






  • 1





    rubberband can be compiled as a ffmpeg filter, so no need to extract audio.

    – Gyan
    May 21 '18 at 6:42














0












0








0








Is there a relatively simple way to speed up a video (mp4, with aac encoded audio), by say "x1.25" or "x1.3" while keeping the original audio-video sync, but also retaining the original pitch of the audio ?



I've read some discussions about extracting audio track into separate file, then use rubberband to lower the pitch by the requisite value, and then merge the audio video tracks using ffmpeg with speed-up, which raises the pitch of the audio back again to original. However, it appears that this is a bit of hit-n-miss, because rubberband appears to use number of octaves as the parameter to raise or lower pitch, and this may not always align perfectly with the video, as musical notes / octaves have specific ratios. Also, this is cumbersome.



So, is there any simpler ways using ffmpeg alone ?










share|improve this question














Is there a relatively simple way to speed up a video (mp4, with aac encoded audio), by say "x1.25" or "x1.3" while keeping the original audio-video sync, but also retaining the original pitch of the audio ?



I've read some discussions about extracting audio track into separate file, then use rubberband to lower the pitch by the requisite value, and then merge the audio video tracks using ffmpeg with speed-up, which raises the pitch of the audio back again to original. However, it appears that this is a bit of hit-n-miss, because rubberband appears to use number of octaves as the parameter to raise or lower pitch, and this may not always align perfectly with the video, as musical notes / octaves have specific ratios. Also, this is cumbersome.



So, is there any simpler ways using ffmpeg alone ?







audio video ffmpeg






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked May 21 '18 at 2:37









icarus74icarus74

1781211




1781211








  • 1





    rubberband offers a tempo option which takes in a decimal number.

    – Gyan
    May 21 '18 at 6:03











  • Thanks @Gyan. Sounds like a valid answer, even if it is not as simple as I'd hope it to be, but removes the issue of rubberband being (wrongly presumed to be) limited to pitch change based on number of notes (of a chromatic scale).

    – icarus74
    May 21 '18 at 6:20






  • 1





    rubberband can be compiled as a ffmpeg filter, so no need to extract audio.

    – Gyan
    May 21 '18 at 6:42














  • 1





    rubberband offers a tempo option which takes in a decimal number.

    – Gyan
    May 21 '18 at 6:03











  • Thanks @Gyan. Sounds like a valid answer, even if it is not as simple as I'd hope it to be, but removes the issue of rubberband being (wrongly presumed to be) limited to pitch change based on number of notes (of a chromatic scale).

    – icarus74
    May 21 '18 at 6:20






  • 1





    rubberband can be compiled as a ffmpeg filter, so no need to extract audio.

    – Gyan
    May 21 '18 at 6:42








1




1





rubberband offers a tempo option which takes in a decimal number.

– Gyan
May 21 '18 at 6:03





rubberband offers a tempo option which takes in a decimal number.

– Gyan
May 21 '18 at 6:03













Thanks @Gyan. Sounds like a valid answer, even if it is not as simple as I'd hope it to be, but removes the issue of rubberband being (wrongly presumed to be) limited to pitch change based on number of notes (of a chromatic scale).

– icarus74
May 21 '18 at 6:20





Thanks @Gyan. Sounds like a valid answer, even if it is not as simple as I'd hope it to be, but removes the issue of rubberband being (wrongly presumed to be) limited to pitch change based on number of notes (of a chromatic scale).

– icarus74
May 21 '18 at 6:20




1




1





rubberband can be compiled as a ffmpeg filter, so no need to extract audio.

– Gyan
May 21 '18 at 6:42





rubberband can be compiled as a ffmpeg filter, so no need to extract audio.

– Gyan
May 21 '18 at 6:42










1 Answer
1






active

oldest

votes


















0














It can be done with ffmpgeg using a complex filter:



  ffmpeg -i input.mkv -filter_complex "[0:v]setpts=0.5*PTS[v];[0:a]atempo=2.0[a]" -map "[v]" -map "[a]" output.mkv


Doku: https://trac.ffmpeg.org/wiki/How%20to%20speed%20up%20/%20slow%20down%20a%20video






share|improve this answer























    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "3"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1324525%2fis-it-possible-to-speed-up-video-with-audio-using-ffmpeg-without-changing-audio%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    It can be done with ffmpgeg using a complex filter:



      ffmpeg -i input.mkv -filter_complex "[0:v]setpts=0.5*PTS[v];[0:a]atempo=2.0[a]" -map "[v]" -map "[a]" output.mkv


    Doku: https://trac.ffmpeg.org/wiki/How%20to%20speed%20up%20/%20slow%20down%20a%20video






    share|improve this answer




























      0














      It can be done with ffmpgeg using a complex filter:



        ffmpeg -i input.mkv -filter_complex "[0:v]setpts=0.5*PTS[v];[0:a]atempo=2.0[a]" -map "[v]" -map "[a]" output.mkv


      Doku: https://trac.ffmpeg.org/wiki/How%20to%20speed%20up%20/%20slow%20down%20a%20video






      share|improve this answer


























        0












        0








        0







        It can be done with ffmpgeg using a complex filter:



          ffmpeg -i input.mkv -filter_complex "[0:v]setpts=0.5*PTS[v];[0:a]atempo=2.0[a]" -map "[v]" -map "[a]" output.mkv


        Doku: https://trac.ffmpeg.org/wiki/How%20to%20speed%20up%20/%20slow%20down%20a%20video






        share|improve this answer













        It can be done with ffmpgeg using a complex filter:



          ffmpeg -i input.mkv -filter_complex "[0:v]setpts=0.5*PTS[v];[0:a]atempo=2.0[a]" -map "[v]" -map "[a]" output.mkv


        Doku: https://trac.ffmpeg.org/wiki/How%20to%20speed%20up%20/%20slow%20down%20a%20video







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Jan 15 at 22:08









        WeidenrindeWeidenrinde

        1412




        1412






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Super User!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1324525%2fis-it-possible-to-speed-up-video-with-audio-using-ffmpeg-without-changing-audio%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            flock() on closed filehandle LOCK_FILE at /usr/bin/apt-mirror

            Mangá

            Eduardo VII do Reino Unido