ffmpeg bash script doesn't not work with subtitles when it comes to a filename with spaces












-1















Here is my current script



#!/bin/bash


while true
do
for f in *.mkv;

do
/home5/user/ffmpeg_folder/./ffmpeg-git-20181101-64bit-static/ffmpeg
-i "$f" -c:v h264 -maxrate 12M -crf 16 -c:a copy -vf subtitles="$f" -pix_fmt yuv420p
"${f%.mkv}".mp4;
done
sleep 15m
done


and I just keep getting this error:



      NUMBER_OF_BYTES-eng: 30679
_STATISTICS_WRITING_APP: no_variable_data
_STATISTICS_WRITING_APP-eng: no_variable_data
_STATISTICS_WRITING_DATE_UTC: 1970-01-01 00:00:00
_STATISTICS_WRITING_DATE_UTC-eng: 1970-01-01 00:00:00
_STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
_STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
Stream #0:3: Attachment: ttf
Metadata:
filename : OpenSans-Semibold.ttf
mimetype : application/x-truetype-font
File '[HorribleSubs] Seishun Buta Yarou wa Bunny Girl Senpai no Yume wo Minai - 07 [1080p].mp4' already exists. Overwrite ? [y/N] y
Stream mapping:
Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
[Parsed_subtitles_0 @ 0x5dfe3c0] No filename provided!
[AVFilterGraph @ 0x6da2c00] Error initializing filter 'subtitles' with args ''
Error reinitializing filters!
Failed to inject frame into filter network: Invalid argument
Error while processing the decoded data for stream #0:0
Conversion failed!


Everything would work if the -vf subtitles="$f" wasn't in there. Is there any way to fix this?










share|improve this question





























    -1















    Here is my current script



    #!/bin/bash


    while true
    do
    for f in *.mkv;

    do
    /home5/user/ffmpeg_folder/./ffmpeg-git-20181101-64bit-static/ffmpeg
    -i "$f" -c:v h264 -maxrate 12M -crf 16 -c:a copy -vf subtitles="$f" -pix_fmt yuv420p
    "${f%.mkv}".mp4;
    done
    sleep 15m
    done


    and I just keep getting this error:



          NUMBER_OF_BYTES-eng: 30679
    _STATISTICS_WRITING_APP: no_variable_data
    _STATISTICS_WRITING_APP-eng: no_variable_data
    _STATISTICS_WRITING_DATE_UTC: 1970-01-01 00:00:00
    _STATISTICS_WRITING_DATE_UTC-eng: 1970-01-01 00:00:00
    _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
    _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
    Stream #0:3: Attachment: ttf
    Metadata:
    filename : OpenSans-Semibold.ttf
    mimetype : application/x-truetype-font
    File '[HorribleSubs] Seishun Buta Yarou wa Bunny Girl Senpai no Yume wo Minai - 07 [1080p].mp4' already exists. Overwrite ? [y/N] y
    Stream mapping:
    Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
    Stream #0:1 -> #0:1 (copy)
    Press [q] to stop, [?] for help
    [Parsed_subtitles_0 @ 0x5dfe3c0] No filename provided!
    [AVFilterGraph @ 0x6da2c00] Error initializing filter 'subtitles' with args ''
    Error reinitializing filters!
    Failed to inject frame into filter network: Invalid argument
    Error while processing the decoded data for stream #0:0
    Conversion failed!


    Everything would work if the -vf subtitles="$f" wasn't in there. Is there any way to fix this?










    share|improve this question



























      -1












      -1








      -1








      Here is my current script



      #!/bin/bash


      while true
      do
      for f in *.mkv;

      do
      /home5/user/ffmpeg_folder/./ffmpeg-git-20181101-64bit-static/ffmpeg
      -i "$f" -c:v h264 -maxrate 12M -crf 16 -c:a copy -vf subtitles="$f" -pix_fmt yuv420p
      "${f%.mkv}".mp4;
      done
      sleep 15m
      done


      and I just keep getting this error:



            NUMBER_OF_BYTES-eng: 30679
      _STATISTICS_WRITING_APP: no_variable_data
      _STATISTICS_WRITING_APP-eng: no_variable_data
      _STATISTICS_WRITING_DATE_UTC: 1970-01-01 00:00:00
      _STATISTICS_WRITING_DATE_UTC-eng: 1970-01-01 00:00:00
      _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
      Stream #0:3: Attachment: ttf
      Metadata:
      filename : OpenSans-Semibold.ttf
      mimetype : application/x-truetype-font
      File '[HorribleSubs] Seishun Buta Yarou wa Bunny Girl Senpai no Yume wo Minai - 07 [1080p].mp4' already exists. Overwrite ? [y/N] y
      Stream mapping:
      Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
      Stream #0:1 -> #0:1 (copy)
      Press [q] to stop, [?] for help
      [Parsed_subtitles_0 @ 0x5dfe3c0] No filename provided!
      [AVFilterGraph @ 0x6da2c00] Error initializing filter 'subtitles' with args ''
      Error reinitializing filters!
      Failed to inject frame into filter network: Invalid argument
      Error while processing the decoded data for stream #0:0
      Conversion failed!


      Everything would work if the -vf subtitles="$f" wasn't in there. Is there any way to fix this?










      share|improve this question
















      Here is my current script



      #!/bin/bash


      while true
      do
      for f in *.mkv;

      do
      /home5/user/ffmpeg_folder/./ffmpeg-git-20181101-64bit-static/ffmpeg
      -i "$f" -c:v h264 -maxrate 12M -crf 16 -c:a copy -vf subtitles="$f" -pix_fmt yuv420p
      "${f%.mkv}".mp4;
      done
      sleep 15m
      done


      and I just keep getting this error:



            NUMBER_OF_BYTES-eng: 30679
      _STATISTICS_WRITING_APP: no_variable_data
      _STATISTICS_WRITING_APP-eng: no_variable_data
      _STATISTICS_WRITING_DATE_UTC: 1970-01-01 00:00:00
      _STATISTICS_WRITING_DATE_UTC-eng: 1970-01-01 00:00:00
      _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
      Stream #0:3: Attachment: ttf
      Metadata:
      filename : OpenSans-Semibold.ttf
      mimetype : application/x-truetype-font
      File '[HorribleSubs] Seishun Buta Yarou wa Bunny Girl Senpai no Yume wo Minai - 07 [1080p].mp4' already exists. Overwrite ? [y/N] y
      Stream mapping:
      Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
      Stream #0:1 -> #0:1 (copy)
      Press [q] to stop, [?] for help
      [Parsed_subtitles_0 @ 0x5dfe3c0] No filename provided!
      [AVFilterGraph @ 0x6da2c00] Error initializing filter 'subtitles' with args ''
      Error reinitializing filters!
      Failed to inject frame into filter network: Invalid argument
      Error while processing the decoded data for stream #0:0
      Conversion failed!


      Everything would work if the -vf subtitles="$f" wasn't in there. Is there any way to fix this?







      linux ffmpeg






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 20 '18 at 15:42









      filbranden

      7,3702836




      7,3702836










      asked Nov 20 '18 at 10:32









      Naz NazD DerbignyNaz NazD Derbigny

      11




      11






















          1 Answer
          1






          active

          oldest

          votes


















          0














          did you not add the subtitle extension?





          share








          New contributor




          Tim Evans is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.




















            Your Answer








            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "106"
            };
            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: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            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%2funix.stackexchange.com%2fquestions%2f482931%2fffmpeg-bash-script-doesnt-not-work-with-subtitles-when-it-comes-to-a-filename-w%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














            did you not add the subtitle extension?





            share








            New contributor




            Tim Evans is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.

























              0














              did you not add the subtitle extension?





              share








              New contributor




              Tim Evans is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
              Check out our Code of Conduct.























                0












                0








                0







                did you not add the subtitle extension?





                share








                New contributor




                Tim Evans is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.










                did you not add the subtitle extension?






                share








                New contributor




                Tim Evans is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.








                share


                share






                New contributor




                Tim Evans is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.









                answered 1 min ago









                Tim EvansTim Evans

                1




                1




                New contributor




                Tim Evans is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.





                New contributor





                Tim Evans is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.






                Tim Evans is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Unix & Linux Stack Exchange!


                    • 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%2funix.stackexchange.com%2fquestions%2f482931%2fffmpeg-bash-script-doesnt-not-work-with-subtitles-when-it-comes-to-a-filename-w%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 rewrite equation of hyperbola in standard form

                    No ethernet ip address in my vocore2