How to combine these two ffmpeg commands into one with two outputs?












0















I have some tv series recorded and now I want to cut off the parts before and after the series, remove the corner logo and save it in original size as mkv and also in downscaled size for our mobile car mediaplayer.



At the moment I use these commands to do this job (and these works pretty fine):



ComplexFilter="[0:v]trim=start=221.040:end=1660.800,setpts=PTS-STARTPTS[outv];[0:a]atrim=start=221.040:end=1660.800,asetpts=PTS-STARTPTS[outa];[outv]removelogo=mask_corner_logo.png[outv_delogo]"

ffmpeg -y -stats -loglevel warning -i "${SourceFile}" -filter_complex "${ComplexFilter}" -map "[outv_delogo]" -map "[outa]" -c:a libmp3lame -b:a "${AudioBitrate}" "${TargetFile}" </dev/null

ffmpeg -y -stats -loglevel warning -i "${SourceFile}" -filter_complex "${ComplexFilter};[outv_delogo]scale=480:270[outv_scaled]" -map "[outv_scaled]" -map "[outa]" -c:a libmp3lame -b:a 128k -vcodec mpeg4 -vtag xvid -qscale:v 5 "${AVITargetFile}" </dev/null


I am pretty sure it is possible to do these two jobs with one single command.



Can someone help me with this?



Thanks in advance,
Andy










share|improve this question



























    0















    I have some tv series recorded and now I want to cut off the parts before and after the series, remove the corner logo and save it in original size as mkv and also in downscaled size for our mobile car mediaplayer.



    At the moment I use these commands to do this job (and these works pretty fine):



    ComplexFilter="[0:v]trim=start=221.040:end=1660.800,setpts=PTS-STARTPTS[outv];[0:a]atrim=start=221.040:end=1660.800,asetpts=PTS-STARTPTS[outa];[outv]removelogo=mask_corner_logo.png[outv_delogo]"

    ffmpeg -y -stats -loglevel warning -i "${SourceFile}" -filter_complex "${ComplexFilter}" -map "[outv_delogo]" -map "[outa]" -c:a libmp3lame -b:a "${AudioBitrate}" "${TargetFile}" </dev/null

    ffmpeg -y -stats -loglevel warning -i "${SourceFile}" -filter_complex "${ComplexFilter};[outv_delogo]scale=480:270[outv_scaled]" -map "[outv_scaled]" -map "[outa]" -c:a libmp3lame -b:a 128k -vcodec mpeg4 -vtag xvid -qscale:v 5 "${AVITargetFile}" </dev/null


    I am pretty sure it is possible to do these two jobs with one single command.



    Can someone help me with this?



    Thanks in advance,
    Andy










    share|improve this question

























      0












      0








      0








      I have some tv series recorded and now I want to cut off the parts before and after the series, remove the corner logo and save it in original size as mkv and also in downscaled size for our mobile car mediaplayer.



      At the moment I use these commands to do this job (and these works pretty fine):



      ComplexFilter="[0:v]trim=start=221.040:end=1660.800,setpts=PTS-STARTPTS[outv];[0:a]atrim=start=221.040:end=1660.800,asetpts=PTS-STARTPTS[outa];[outv]removelogo=mask_corner_logo.png[outv_delogo]"

      ffmpeg -y -stats -loglevel warning -i "${SourceFile}" -filter_complex "${ComplexFilter}" -map "[outv_delogo]" -map "[outa]" -c:a libmp3lame -b:a "${AudioBitrate}" "${TargetFile}" </dev/null

      ffmpeg -y -stats -loglevel warning -i "${SourceFile}" -filter_complex "${ComplexFilter};[outv_delogo]scale=480:270[outv_scaled]" -map "[outv_scaled]" -map "[outa]" -c:a libmp3lame -b:a 128k -vcodec mpeg4 -vtag xvid -qscale:v 5 "${AVITargetFile}" </dev/null


      I am pretty sure it is possible to do these two jobs with one single command.



      Can someone help me with this?



      Thanks in advance,
      Andy










      share|improve this question














      I have some tv series recorded and now I want to cut off the parts before and after the series, remove the corner logo and save it in original size as mkv and also in downscaled size for our mobile car mediaplayer.



      At the moment I use these commands to do this job (and these works pretty fine):



      ComplexFilter="[0:v]trim=start=221.040:end=1660.800,setpts=PTS-STARTPTS[outv];[0:a]atrim=start=221.040:end=1660.800,asetpts=PTS-STARTPTS[outa];[outv]removelogo=mask_corner_logo.png[outv_delogo]"

      ffmpeg -y -stats -loglevel warning -i "${SourceFile}" -filter_complex "${ComplexFilter}" -map "[outv_delogo]" -map "[outa]" -c:a libmp3lame -b:a "${AudioBitrate}" "${TargetFile}" </dev/null

      ffmpeg -y -stats -loglevel warning -i "${SourceFile}" -filter_complex "${ComplexFilter};[outv_delogo]scale=480:270[outv_scaled]" -map "[outv_scaled]" -map "[outa]" -c:a libmp3lame -b:a 128k -vcodec mpeg4 -vtag xvid -qscale:v 5 "${AVITargetFile}" </dev/null


      I am pretty sure it is possible to do these two jobs with one single command.



      Can someone help me with this?



      Thanks in advance,
      Andy







      video ffmpeg video-editing






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Feb 6 at 7:24









      AndyAndy

      132




      132






















          1 Answer
          1






          active

          oldest

          votes


















          0














          Use



          ffmpeg -y -stats -loglevel warning -i "${SourceFile}" -filter_complex "${ComplexFilter};[outv_delogo]split=2[outv_delogo][outv_scaled];[outv_scaled]scale=480:270[outv_scaled];[outa]asplit=2[outa1][outa2]" -map "[outv_delogo]" -map "[outa1]" -c:a libmp3lame -b:a "${AudioBitrate}" "${TargetFile}" -map "[outv_scaled]" -map "[outa2]" -c:a libmp3lame -b:a 128k -vcodec mpeg4 -vtag xvid -qscale:v 5 "${AVITargetFile}" </dev/null






          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%2f1402554%2fhow-to-combine-these-two-ffmpeg-commands-into-one-with-two-outputs%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














            Use



            ffmpeg -y -stats -loglevel warning -i "${SourceFile}" -filter_complex "${ComplexFilter};[outv_delogo]split=2[outv_delogo][outv_scaled];[outv_scaled]scale=480:270[outv_scaled];[outa]asplit=2[outa1][outa2]" -map "[outv_delogo]" -map "[outa1]" -c:a libmp3lame -b:a "${AudioBitrate}" "${TargetFile}" -map "[outv_scaled]" -map "[outa2]" -c:a libmp3lame -b:a 128k -vcodec mpeg4 -vtag xvid -qscale:v 5 "${AVITargetFile}" </dev/null






            share|improve this answer




























              0














              Use



              ffmpeg -y -stats -loglevel warning -i "${SourceFile}" -filter_complex "${ComplexFilter};[outv_delogo]split=2[outv_delogo][outv_scaled];[outv_scaled]scale=480:270[outv_scaled];[outa]asplit=2[outa1][outa2]" -map "[outv_delogo]" -map "[outa1]" -c:a libmp3lame -b:a "${AudioBitrate}" "${TargetFile}" -map "[outv_scaled]" -map "[outa2]" -c:a libmp3lame -b:a 128k -vcodec mpeg4 -vtag xvid -qscale:v 5 "${AVITargetFile}" </dev/null






              share|improve this answer


























                0












                0








                0







                Use



                ffmpeg -y -stats -loglevel warning -i "${SourceFile}" -filter_complex "${ComplexFilter};[outv_delogo]split=2[outv_delogo][outv_scaled];[outv_scaled]scale=480:270[outv_scaled];[outa]asplit=2[outa1][outa2]" -map "[outv_delogo]" -map "[outa1]" -c:a libmp3lame -b:a "${AudioBitrate}" "${TargetFile}" -map "[outv_scaled]" -map "[outa2]" -c:a libmp3lame -b:a 128k -vcodec mpeg4 -vtag xvid -qscale:v 5 "${AVITargetFile}" </dev/null






                share|improve this answer













                Use



                ffmpeg -y -stats -loglevel warning -i "${SourceFile}" -filter_complex "${ComplexFilter};[outv_delogo]split=2[outv_delogo][outv_scaled];[outv_scaled]scale=480:270[outv_scaled];[outa]asplit=2[outa1][outa2]" -map "[outv_delogo]" -map "[outa1]" -c:a libmp3lame -b:a "${AudioBitrate}" "${TargetFile}" -map "[outv_scaled]" -map "[outa2]" -c:a libmp3lame -b:a 128k -vcodec mpeg4 -vtag xvid -qscale:v 5 "${AVITargetFile}" </dev/null







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Feb 6 at 11:31









                GyanGyan

                15.6k21846




                15.6k21846






























                    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%2f1402554%2fhow-to-combine-these-two-ffmpeg-commands-into-one-with-two-outputs%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

                    How to make a Squid Proxy server?

                    Is this a new Fibonacci Identity?

                    Touch on Surface Book