How to set FPS using ffmpeg












0















I'm trying to save my CCTV stream into segments of 300 seconds with a FPS of 7. Here's my command:



ffmpeg -r 7 -i rtsp://192.168.1.100/...stream=0.sdp -acodec aac -strict -2 -vcodec copy -f segment -segment_time 300 -segment_format mp4 "mon1-%03d.mp4"


The output file doesn't seem to respect the '-r 7' command (for FPS = 7). Does anyone know how to set the FPS of the output?










share|improve this question





























    0















    I'm trying to save my CCTV stream into segments of 300 seconds with a FPS of 7. Here's my command:



    ffmpeg -r 7 -i rtsp://192.168.1.100/...stream=0.sdp -acodec aac -strict -2 -vcodec copy -f segment -segment_time 300 -segment_format mp4 "mon1-%03d.mp4"


    The output file doesn't seem to respect the '-r 7' command (for FPS = 7). Does anyone know how to set the FPS of the output?










    share|improve this question



























      0












      0








      0








      I'm trying to save my CCTV stream into segments of 300 seconds with a FPS of 7. Here's my command:



      ffmpeg -r 7 -i rtsp://192.168.1.100/...stream=0.sdp -acodec aac -strict -2 -vcodec copy -f segment -segment_time 300 -segment_format mp4 "mon1-%03d.mp4"


      The output file doesn't seem to respect the '-r 7' command (for FPS = 7). Does anyone know how to set the FPS of the output?










      share|improve this question
















      I'm trying to save my CCTV stream into segments of 300 seconds with a FPS of 7. Here's my command:



      ffmpeg -r 7 -i rtsp://192.168.1.100/...stream=0.sdp -acodec aac -strict -2 -vcodec copy -f segment -segment_time 300 -segment_format mp4 "mon1-%03d.mp4"


      The output file doesn't seem to respect the '-r 7' command (for FPS = 7). Does anyone know how to set the FPS of the output?







      ffmpeg libav fps






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Jun 3 '17 at 20:41









      JakeGould

      31k1093137




      31k1093137










      asked Jun 3 '17 at 10:56









      John M.John M.

      10818




      10818






















          1 Answer
          1






          active

          oldest

          votes


















          0














          When you put an argument before -i, it will be applied to the following input only.



          Move the -r argument somewhere between the input and output file.



          In your case, the frame rate is not changed, since you only copy the video bitstream. When changing the frame rate, you have to re-encode the video, since dropping frames means that inter-frame predictions will no longer be valid.






          share|improve this answer


























          • I've tried putting it in front of the filename, but the output fps is still 20.

            – John M.
            Jun 3 '17 at 12:55











          • @slhck - with containers that have timestamps, input r does not alter PTS intervals in copy mode. Works with raw bitstreams.

            – Gyan
            Jun 3 '17 at 13:04













          • @Mulvya Didn't see the copy in the OP's question, of course you're right.

            – slhck
            Jun 3 '17 at 20:25











          • @John It seems you have to re-encode the video, as you can't just arbitrarily change the FPS. Remove the copy option and set some quality parameter for the output (e.g. -crf 23).

            – slhck
            Jun 3 '17 at 20:29











          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%2f1215648%2fhow-to-set-fps-using-ffmpeg%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














          When you put an argument before -i, it will be applied to the following input only.



          Move the -r argument somewhere between the input and output file.



          In your case, the frame rate is not changed, since you only copy the video bitstream. When changing the frame rate, you have to re-encode the video, since dropping frames means that inter-frame predictions will no longer be valid.






          share|improve this answer


























          • I've tried putting it in front of the filename, but the output fps is still 20.

            – John M.
            Jun 3 '17 at 12:55











          • @slhck - with containers that have timestamps, input r does not alter PTS intervals in copy mode. Works with raw bitstreams.

            – Gyan
            Jun 3 '17 at 13:04













          • @Mulvya Didn't see the copy in the OP's question, of course you're right.

            – slhck
            Jun 3 '17 at 20:25











          • @John It seems you have to re-encode the video, as you can't just arbitrarily change the FPS. Remove the copy option and set some quality parameter for the output (e.g. -crf 23).

            – slhck
            Jun 3 '17 at 20:29
















          0














          When you put an argument before -i, it will be applied to the following input only.



          Move the -r argument somewhere between the input and output file.



          In your case, the frame rate is not changed, since you only copy the video bitstream. When changing the frame rate, you have to re-encode the video, since dropping frames means that inter-frame predictions will no longer be valid.






          share|improve this answer


























          • I've tried putting it in front of the filename, but the output fps is still 20.

            – John M.
            Jun 3 '17 at 12:55











          • @slhck - with containers that have timestamps, input r does not alter PTS intervals in copy mode. Works with raw bitstreams.

            – Gyan
            Jun 3 '17 at 13:04













          • @Mulvya Didn't see the copy in the OP's question, of course you're right.

            – slhck
            Jun 3 '17 at 20:25











          • @John It seems you have to re-encode the video, as you can't just arbitrarily change the FPS. Remove the copy option and set some quality parameter for the output (e.g. -crf 23).

            – slhck
            Jun 3 '17 at 20:29














          0












          0








          0







          When you put an argument before -i, it will be applied to the following input only.



          Move the -r argument somewhere between the input and output file.



          In your case, the frame rate is not changed, since you only copy the video bitstream. When changing the frame rate, you have to re-encode the video, since dropping frames means that inter-frame predictions will no longer be valid.






          share|improve this answer















          When you put an argument before -i, it will be applied to the following input only.



          Move the -r argument somewhere between the input and output file.



          In your case, the frame rate is not changed, since you only copy the video bitstream. When changing the frame rate, you have to re-encode the video, since dropping frames means that inter-frame predictions will no longer be valid.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Jun 3 '17 at 20:27

























          answered Jun 3 '17 at 12:54









          slhckslhck

          160k47443466




          160k47443466













          • I've tried putting it in front of the filename, but the output fps is still 20.

            – John M.
            Jun 3 '17 at 12:55











          • @slhck - with containers that have timestamps, input r does not alter PTS intervals in copy mode. Works with raw bitstreams.

            – Gyan
            Jun 3 '17 at 13:04













          • @Mulvya Didn't see the copy in the OP's question, of course you're right.

            – slhck
            Jun 3 '17 at 20:25











          • @John It seems you have to re-encode the video, as you can't just arbitrarily change the FPS. Remove the copy option and set some quality parameter for the output (e.g. -crf 23).

            – slhck
            Jun 3 '17 at 20:29



















          • I've tried putting it in front of the filename, but the output fps is still 20.

            – John M.
            Jun 3 '17 at 12:55











          • @slhck - with containers that have timestamps, input r does not alter PTS intervals in copy mode. Works with raw bitstreams.

            – Gyan
            Jun 3 '17 at 13:04













          • @Mulvya Didn't see the copy in the OP's question, of course you're right.

            – slhck
            Jun 3 '17 at 20:25











          • @John It seems you have to re-encode the video, as you can't just arbitrarily change the FPS. Remove the copy option and set some quality parameter for the output (e.g. -crf 23).

            – slhck
            Jun 3 '17 at 20:29

















          I've tried putting it in front of the filename, but the output fps is still 20.

          – John M.
          Jun 3 '17 at 12:55





          I've tried putting it in front of the filename, but the output fps is still 20.

          – John M.
          Jun 3 '17 at 12:55













          @slhck - with containers that have timestamps, input r does not alter PTS intervals in copy mode. Works with raw bitstreams.

          – Gyan
          Jun 3 '17 at 13:04







          @slhck - with containers that have timestamps, input r does not alter PTS intervals in copy mode. Works with raw bitstreams.

          – Gyan
          Jun 3 '17 at 13:04















          @Mulvya Didn't see the copy in the OP's question, of course you're right.

          – slhck
          Jun 3 '17 at 20:25





          @Mulvya Didn't see the copy in the OP's question, of course you're right.

          – slhck
          Jun 3 '17 at 20:25













          @John It seems you have to re-encode the video, as you can't just arbitrarily change the FPS. Remove the copy option and set some quality parameter for the output (e.g. -crf 23).

          – slhck
          Jun 3 '17 at 20:29





          @John It seems you have to re-encode the video, as you can't just arbitrarily change the FPS. Remove the copy option and set some quality parameter for the output (e.g. -crf 23).

          – slhck
          Jun 3 '17 at 20:29


















          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%2f1215648%2fhow-to-set-fps-using-ffmpeg%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?

          19世紀