Determining sequence of multiple streams output from FFMPEG to pipeCapturing multiple RTSP streams...

I can't die. Who am I?

Skis versus snow shoes - when to choose which for travelling the backcountry?

What type of investment is best suited for a 1-year investment on a down payment?

How to substitute values from a list into a function?

Are small insurances worth it

VAT refund for a conference ticket in Sweden

What is a term for a function that when called repeatedly, has the same effect as calling once?

What is this waxed root vegetable?

Wrap all numerics in JSON with quotes

Real life puzzle: Unknown alphabet or shorthand

Citing contemporaneous (interlaced?) preprints

Is there a full canon version of Tyrion's jackass/honeycomb joke?

Can we carry rice to Japan?

Where is the fallacy here?

Is there a math equivalent to the conditional ternary operator?

How to lift/raise/repair a segment of concrete slab?

Inverse of the covariance matrix of a multivariate normal distribution

Rationale to prefer local variables over instance variables?

What am I? I am in theaters and computer programs

In Adventurer's League, is it possible to keep the Ring of Winter if you manage to acquire it in the Tomb of Annihilation adventure?

Are there any other Chaos-worshipping races?

Dystopian novel where telepathic humans live under a dome

Is it possible to make a clamp function shorter than a ternary in JS?

How to evaluate the limit where something is raised to a power of x?



Determining sequence of multiple streams output from FFMPEG to pipe


Capturing multiple RTSP streams simultaneously in syncDo filtergraphs copy audio streams by default in FFMpeg?FFMPEG extract audio from video with an annoying sound at the endHow can I overlay PNGs with transparency over a video? (each PNG should cover one frame)Concat multiple videos with diferent audio and subtitle stream count using ffmpegApplying multiple filters and inputs with FFmpegHow to encode one input file to multiple HLS streams with FFmpeg including the master playlistGet pictures from video and glue them into another videoFFMPEG h.264 stream to VLC from raw YUV444 produces black screen and audio noiseHow to copy not recognized streams on conversion with FFmpeg?













0















I'm currently running ffmpeg, taking a video as input and by way of a complex filter:




  • Splitting it into multiple streams

  • For each stream, apply a set of filters (each filter performs a different transform)


After that, I map each of the streams to output a sequence of PNG images.



Currently, I'm writing everything to pipe:1 (stdout) so that the program that launches ffmpeg can process the output.



Each of the streams has a need to be processed separately in the calling program.



As a result, I want to tag the PNGs with something to identify how they should be processed (so that I may sequence them properly in the merged output stream). The tEXt chunk type in PNGs would be perfect for this.



The question is, how do can I have ffmpeg encode that chunk (or some other piece of metadata) into the PNG?



Currently, I am trying the following:



ffmpeg 
-ss <start time, put before input to seek by keyframes>
-to <end time>
-i <input, this is downloaded from an HTTPS URL>
-filter_complex
split=2[in1][in2];[in1]<some filter>[out1];[in2]<some other filter>[out2]
-map [out1] -metadata title=<tag1> -codec png -f image2pipe pipe:1
-map [out2] -metadata title=<tag2> -codec png -f image2pipe pipe:1


But it doesn't create any additional chunks in the PNGs that are streamed to the pipe.



I've also tried the metadata filter, like so:



ffmpeg 
-ss <start time, put before input to seek by keyframes>
-to <end time>
-i <input>
-filter_complex
split=2[in1][in2];[in1]<some filter>,metadata=add:key=mykey:value=mytag1[out1];[in2]<some other filter>,metadata=add:key=mykey:value=mytag2[out2]
-map [out1] -metadata title=<tag1> -codec png -f image2pipe pipe:1
-map [out2] -metadata title=<tag2> -codec png -f image2pipe pipe:1


But that doesn't produce any additional metadata in the PNG stream.



Is this possible, or do I have to find another way to somehow separate the streams and process them?










share|improve this question





























    0















    I'm currently running ffmpeg, taking a video as input and by way of a complex filter:




    • Splitting it into multiple streams

    • For each stream, apply a set of filters (each filter performs a different transform)


    After that, I map each of the streams to output a sequence of PNG images.



    Currently, I'm writing everything to pipe:1 (stdout) so that the program that launches ffmpeg can process the output.



    Each of the streams has a need to be processed separately in the calling program.



    As a result, I want to tag the PNGs with something to identify how they should be processed (so that I may sequence them properly in the merged output stream). The tEXt chunk type in PNGs would be perfect for this.



    The question is, how do can I have ffmpeg encode that chunk (or some other piece of metadata) into the PNG?



    Currently, I am trying the following:



    ffmpeg 
    -ss <start time, put before input to seek by keyframes>
    -to <end time>
    -i <input, this is downloaded from an HTTPS URL>
    -filter_complex
    split=2[in1][in2];[in1]<some filter>[out1];[in2]<some other filter>[out2]
    -map [out1] -metadata title=<tag1> -codec png -f image2pipe pipe:1
    -map [out2] -metadata title=<tag2> -codec png -f image2pipe pipe:1


    But it doesn't create any additional chunks in the PNGs that are streamed to the pipe.



    I've also tried the metadata filter, like so:



    ffmpeg 
    -ss <start time, put before input to seek by keyframes>
    -to <end time>
    -i <input>
    -filter_complex
    split=2[in1][in2];[in1]<some filter>,metadata=add:key=mykey:value=mytag1[out1];[in2]<some other filter>,metadata=add:key=mykey:value=mytag2[out2]
    -map [out1] -metadata title=<tag1> -codec png -f image2pipe pipe:1
    -map [out2] -metadata title=<tag2> -codec png -f image2pipe pipe:1


    But that doesn't produce any additional metadata in the PNG stream.



    Is this possible, or do I have to find another way to somehow separate the streams and process them?










    share|improve this question



























      0












      0








      0








      I'm currently running ffmpeg, taking a video as input and by way of a complex filter:




      • Splitting it into multiple streams

      • For each stream, apply a set of filters (each filter performs a different transform)


      After that, I map each of the streams to output a sequence of PNG images.



      Currently, I'm writing everything to pipe:1 (stdout) so that the program that launches ffmpeg can process the output.



      Each of the streams has a need to be processed separately in the calling program.



      As a result, I want to tag the PNGs with something to identify how they should be processed (so that I may sequence them properly in the merged output stream). The tEXt chunk type in PNGs would be perfect for this.



      The question is, how do can I have ffmpeg encode that chunk (or some other piece of metadata) into the PNG?



      Currently, I am trying the following:



      ffmpeg 
      -ss <start time, put before input to seek by keyframes>
      -to <end time>
      -i <input, this is downloaded from an HTTPS URL>
      -filter_complex
      split=2[in1][in2];[in1]<some filter>[out1];[in2]<some other filter>[out2]
      -map [out1] -metadata title=<tag1> -codec png -f image2pipe pipe:1
      -map [out2] -metadata title=<tag2> -codec png -f image2pipe pipe:1


      But it doesn't create any additional chunks in the PNGs that are streamed to the pipe.



      I've also tried the metadata filter, like so:



      ffmpeg 
      -ss <start time, put before input to seek by keyframes>
      -to <end time>
      -i <input>
      -filter_complex
      split=2[in1][in2];[in1]<some filter>,metadata=add:key=mykey:value=mytag1[out1];[in2]<some other filter>,metadata=add:key=mykey:value=mytag2[out2]
      -map [out1] -metadata title=<tag1> -codec png -f image2pipe pipe:1
      -map [out2] -metadata title=<tag2> -codec png -f image2pipe pipe:1


      But that doesn't produce any additional metadata in the PNG stream.



      Is this possible, or do I have to find another way to somehow separate the streams and process them?










      share|improve this question
















      I'm currently running ffmpeg, taking a video as input and by way of a complex filter:




      • Splitting it into multiple streams

      • For each stream, apply a set of filters (each filter performs a different transform)


      After that, I map each of the streams to output a sequence of PNG images.



      Currently, I'm writing everything to pipe:1 (stdout) so that the program that launches ffmpeg can process the output.



      Each of the streams has a need to be processed separately in the calling program.



      As a result, I want to tag the PNGs with something to identify how they should be processed (so that I may sequence them properly in the merged output stream). The tEXt chunk type in PNGs would be perfect for this.



      The question is, how do can I have ffmpeg encode that chunk (or some other piece of metadata) into the PNG?



      Currently, I am trying the following:



      ffmpeg 
      -ss <start time, put before input to seek by keyframes>
      -to <end time>
      -i <input, this is downloaded from an HTTPS URL>
      -filter_complex
      split=2[in1][in2];[in1]<some filter>[out1];[in2]<some other filter>[out2]
      -map [out1] -metadata title=<tag1> -codec png -f image2pipe pipe:1
      -map [out2] -metadata title=<tag2> -codec png -f image2pipe pipe:1


      But it doesn't create any additional chunks in the PNGs that are streamed to the pipe.



      I've also tried the metadata filter, like so:



      ffmpeg 
      -ss <start time, put before input to seek by keyframes>
      -to <end time>
      -i <input>
      -filter_complex
      split=2[in1][in2];[in1]<some filter>,metadata=add:key=mykey:value=mytag1[out1];[in2]<some other filter>,metadata=add:key=mykey:value=mytag2[out2]
      -map [out1] -metadata title=<tag1> -codec png -f image2pipe pipe:1
      -map [out2] -metadata title=<tag2> -codec png -f image2pipe pipe:1


      But that doesn't produce any additional metadata in the PNG stream.



      Is this possible, or do I have to find another way to somehow separate the streams and process them?







      ffmpeg






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 4 hours ago







      casperOne

















      asked 23 hours ago









      casperOnecasperOne

      116118




      116118






















          1 Answer
          1






          active

          oldest

          votes


















          0














          You can interleave them



          ffmpeg 
          -i <input>
          -filter_complex
          setpts=N/25/TB,split=2[in1][in2];[in1]<some filter>[out1];[in2]<some other filter>[out2];
          [out1][out2]interleave[out]
          -map [out] -r 25 -codec png -f image2pipe pipe:1


          This will have one frame of out1 followed by out2 then out1...etc






          share|improve this answer


























          • Thanks for this! I ran the command, but I seem to get the first frame repeated (across the streams) ad-infinitum. I suspect this part of the documentation is critical: Input streams must have well defined, monotonically increasing frame timestamp values. I am downloading this from a URL served up via HTTPS, as well as with an input time to seek to, so not sure if this is playing a part or not. Would welcome any suggestions. I've updated the question appropriately to reflect this.

            – casperOne
            9 hours ago













          • What are the filters you're applying.

            – Gyan
            9 hours ago











          • crop, scale, crop (again), and possibly hflip.

            – casperOne
            8 hours ago











          • Edited command.

            – Gyan
            8 hours ago






          • 1





            FFmpeg png encoder currently does not support tEXt chunk.

            – Paul B. Mahol
            6 hours ago











          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%2f1411297%2fdetermining-sequence-of-multiple-streams-output-from-ffmpeg-to-pipe%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














          You can interleave them



          ffmpeg 
          -i <input>
          -filter_complex
          setpts=N/25/TB,split=2[in1][in2];[in1]<some filter>[out1];[in2]<some other filter>[out2];
          [out1][out2]interleave[out]
          -map [out] -r 25 -codec png -f image2pipe pipe:1


          This will have one frame of out1 followed by out2 then out1...etc






          share|improve this answer


























          • Thanks for this! I ran the command, but I seem to get the first frame repeated (across the streams) ad-infinitum. I suspect this part of the documentation is critical: Input streams must have well defined, monotonically increasing frame timestamp values. I am downloading this from a URL served up via HTTPS, as well as with an input time to seek to, so not sure if this is playing a part or not. Would welcome any suggestions. I've updated the question appropriately to reflect this.

            – casperOne
            9 hours ago













          • What are the filters you're applying.

            – Gyan
            9 hours ago











          • crop, scale, crop (again), and possibly hflip.

            – casperOne
            8 hours ago











          • Edited command.

            – Gyan
            8 hours ago






          • 1





            FFmpeg png encoder currently does not support tEXt chunk.

            – Paul B. Mahol
            6 hours ago
















          0














          You can interleave them



          ffmpeg 
          -i <input>
          -filter_complex
          setpts=N/25/TB,split=2[in1][in2];[in1]<some filter>[out1];[in2]<some other filter>[out2];
          [out1][out2]interleave[out]
          -map [out] -r 25 -codec png -f image2pipe pipe:1


          This will have one frame of out1 followed by out2 then out1...etc






          share|improve this answer


























          • Thanks for this! I ran the command, but I seem to get the first frame repeated (across the streams) ad-infinitum. I suspect this part of the documentation is critical: Input streams must have well defined, monotonically increasing frame timestamp values. I am downloading this from a URL served up via HTTPS, as well as with an input time to seek to, so not sure if this is playing a part or not. Would welcome any suggestions. I've updated the question appropriately to reflect this.

            – casperOne
            9 hours ago













          • What are the filters you're applying.

            – Gyan
            9 hours ago











          • crop, scale, crop (again), and possibly hflip.

            – casperOne
            8 hours ago











          • Edited command.

            – Gyan
            8 hours ago






          • 1





            FFmpeg png encoder currently does not support tEXt chunk.

            – Paul B. Mahol
            6 hours ago














          0












          0








          0







          You can interleave them



          ffmpeg 
          -i <input>
          -filter_complex
          setpts=N/25/TB,split=2[in1][in2];[in1]<some filter>[out1];[in2]<some other filter>[out2];
          [out1][out2]interleave[out]
          -map [out] -r 25 -codec png -f image2pipe pipe:1


          This will have one frame of out1 followed by out2 then out1...etc






          share|improve this answer















          You can interleave them



          ffmpeg 
          -i <input>
          -filter_complex
          setpts=N/25/TB,split=2[in1][in2];[in1]<some filter>[out1];[in2]<some other filter>[out2];
          [out1][out2]interleave[out]
          -map [out] -r 25 -codec png -f image2pipe pipe:1


          This will have one frame of out1 followed by out2 then out1...etc







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited 8 hours ago

























          answered 19 hours ago









          GyanGyan

          15.4k21846




          15.4k21846













          • Thanks for this! I ran the command, but I seem to get the first frame repeated (across the streams) ad-infinitum. I suspect this part of the documentation is critical: Input streams must have well defined, monotonically increasing frame timestamp values. I am downloading this from a URL served up via HTTPS, as well as with an input time to seek to, so not sure if this is playing a part or not. Would welcome any suggestions. I've updated the question appropriately to reflect this.

            – casperOne
            9 hours ago













          • What are the filters you're applying.

            – Gyan
            9 hours ago











          • crop, scale, crop (again), and possibly hflip.

            – casperOne
            8 hours ago











          • Edited command.

            – Gyan
            8 hours ago






          • 1





            FFmpeg png encoder currently does not support tEXt chunk.

            – Paul B. Mahol
            6 hours ago



















          • Thanks for this! I ran the command, but I seem to get the first frame repeated (across the streams) ad-infinitum. I suspect this part of the documentation is critical: Input streams must have well defined, monotonically increasing frame timestamp values. I am downloading this from a URL served up via HTTPS, as well as with an input time to seek to, so not sure if this is playing a part or not. Would welcome any suggestions. I've updated the question appropriately to reflect this.

            – casperOne
            9 hours ago













          • What are the filters you're applying.

            – Gyan
            9 hours ago











          • crop, scale, crop (again), and possibly hflip.

            – casperOne
            8 hours ago











          • Edited command.

            – Gyan
            8 hours ago






          • 1





            FFmpeg png encoder currently does not support tEXt chunk.

            – Paul B. Mahol
            6 hours ago

















          Thanks for this! I ran the command, but I seem to get the first frame repeated (across the streams) ad-infinitum. I suspect this part of the documentation is critical: Input streams must have well defined, monotonically increasing frame timestamp values. I am downloading this from a URL served up via HTTPS, as well as with an input time to seek to, so not sure if this is playing a part or not. Would welcome any suggestions. I've updated the question appropriately to reflect this.

          – casperOne
          9 hours ago







          Thanks for this! I ran the command, but I seem to get the first frame repeated (across the streams) ad-infinitum. I suspect this part of the documentation is critical: Input streams must have well defined, monotonically increasing frame timestamp values. I am downloading this from a URL served up via HTTPS, as well as with an input time to seek to, so not sure if this is playing a part or not. Would welcome any suggestions. I've updated the question appropriately to reflect this.

          – casperOne
          9 hours ago















          What are the filters you're applying.

          – Gyan
          9 hours ago





          What are the filters you're applying.

          – Gyan
          9 hours ago













          crop, scale, crop (again), and possibly hflip.

          – casperOne
          8 hours ago





          crop, scale, crop (again), and possibly hflip.

          – casperOne
          8 hours ago













          Edited command.

          – Gyan
          8 hours ago





          Edited command.

          – Gyan
          8 hours ago




          1




          1





          FFmpeg png encoder currently does not support tEXt chunk.

          – Paul B. Mahol
          6 hours ago





          FFmpeg png encoder currently does not support tEXt chunk.

          – Paul B. Mahol
          6 hours ago


















          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%2f1411297%2fdetermining-sequence-of-multiple-streams-output-from-ffmpeg-to-pipe%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

          Couldn't open a raw socket. Error: Permission denied (13) (nmap)Is it possible to run networking commands...

          VNC viewer RFB protocol error: bad desktop size 0x0I Cannot Type the Key 'd' (lowercase) in VNC Viewer...

          Why not use the yoke to control yaw, as well as pitch and roll? Announcing the arrival of...