VideoHelp Forum
+ Reply to Thread
Results 1 to 9 of 9
Thread
  1. Member
    Join Date
    May 2023
    Location
    Calne, Wilts, UK
    Search Comp PM
    Hi I'm using FFMPEG 6 to add subtitles to MKV H264 files and output subtitled PNG frames. With the video and the .srt file in the same sub directory the following command line works perfectly.

    ffmpeg -i sample.mkv -vf subtitles=sample.srt -f image2 d:\png\%08d.png"

    However if i add a path even if the srt file is in the same subfolder i run into problems

    ffmpeg -i D:\dennervision\sample.mkv -vf subtitles=D:\dennervision\sample.srt -f image2 d:\png\%08d.png"

    The following error is generated.

    Input #0, matroska,webm, from 'D:\dennervision\sample.mkv':
    Metadata:
    encoder : libebml v1.2.3 + libmatroska v1.3.0
    creation_time : 2012-05-17T17:56:37.000000Z
    Duration: 00:01:00.24, start: 0.000000, bitrate: 14797 kb/s
    Stream #0:0(eng): Video: h264 (High), yuv420p(progressive), 1920x1080 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 1k tbn (default)
    Stream #0:1(eng): Audio: ac3, 48000 Hz, 5.1(side), fltp, 640 kb/s (default)
    Metadata:
    title : English DD 5.1 640 Kbps
    Stream mapping:
    Stream #0:0 -> #0:0 (h264 (native) -> png (native))
    Press [q] to stop, [?] for help
    [Parsed_subtitles_0 @ 00000196e4b07740] Unable to parse option value "dennervisionsample.srt" as image size
    Error applying option 'original_size' to filter 'subtitles': Invalid argument
    Error reinitializing filters!
    Failed to inject frame into filter network: Invalid argument
    Error while processing the decoded data for stream #0:0
    Conversion failed!

    D:\dennervision>

    The path to the input and output folders work fine, but not the path to the srt file. if i change it to -vf subtitles=sample.srt -f it then works again but i don't want to keep the srt files in the ffmpeg folder. can anyone show me where i'm going wrong or is this a bug in ffmpeg? it seems to be ignoring the backslashes. Thanks
    Quote Quote  
  2. ffmpeg is sensitive to proper quoting and escaping - highly advise to consult ffmpeg manual on this topic...
    Quote Quote  
  3. Member
    Join Date
    Feb 2006
    Location
    United States
    Search Comp PM
    Originally Posted by Cineman View Post
    Hi I'm using FFMPEG 6 to add subtitles to MKV H264 files and output subtitled PNG frames. With the video and the .srt file in the same sub directory the following command line works perfectly.

    ffmpeg -i sample.mkv -vf subtitles=sample.srt -f image2 d:\png\%08d.png"

    However if i add a path even if the srt file is in the same subfolder i run into problems

    ffmpeg -i D:\dennervision\sample.mkv -vf subtitles=D:\dennervision\sample.srt -f image2 d:\png\%08d.png"

    The following error is generated.

    Input #0, matroska,webm, from 'D:\dennervision\sample.mkv':
    Metadata:
    encoder : libebml v1.2.3 + libmatroska v1.3.0
    creation_time : 2012-05-17T17:56:37.000000Z
    Duration: 00:01:00.24, start: 0.000000, bitrate: 14797 kb/s
    Stream #0:0(eng): Video: h264 (High), yuv420p(progressive), 1920x1080 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 1k tbn (default)
    Stream #0:1(eng): Audio: ac3, 48000 Hz, 5.1(side), fltp, 640 kb/s (default)
    Metadata:
    title : English DD 5.1 640 Kbps
    Stream mapping:
    Stream #0:0 -> #0:0 (h264 (native) -> png (native))
    Press [q] to stop, [?] for help
    [Parsed_subtitles_0 @ 00000196e4b07740] Unable to parse option value "dennervisionsample.srt" as image size
    Error applying option 'original_size' to filter 'subtitles': Invalid argument
    Error reinitializing filters!
    Failed to inject frame into filter network: Invalid argument
    Error while processing the decoded data for stream #0:0
    Conversion failed!

    D:\dennervision>

    The path to the input and output folders work fine, but not the path to the srt file. if i change it to -vf subtitles=sample.srt -f it then works again but i don't want to keep the srt files in the ffmpeg folder. can anyone show me where i'm going wrong or is this a bug in ffmpeg? it seems to be ignoring the backslashes. Thanks
    try this here - https://stackoverflow.com/questions/71597897/unable-to-parse-option-value-xxx-srt-as-i...size-in-ffmpeg
    Quote Quote  
  4. Member
    Join Date
    May 2023
    Location
    Calne, Wilts, UK
    Search Comp PM
    Hi October262 thank you, your a star, totaly nailed it! Someone else had exact same problem. Changed it to the following and it works fine:-

    ffmpeg -i D:\dennervision\sample.mkv -vf subtitles='d\:\\sample.srt' -f image2 d:\png\%08d.png

    Can't see any logical reason to have to add the extra inverted commas and back slashes, looks more like a bug with a work arround to me. Who know perhaps theres a good reason for it deep in the inner workings..
    Last edited by Cineman; 26th May 2023 at 00:22. Reason: got user name wrong !
    Quote Quote  
  5. Can't see any logical reason to have to add the extra inverted commas and back slashes
    Windows is the only OS which uses backslashes and colons when addressing drives. So those need to be escaped. (alternatively, the used filter would need extra code to work on Windows)
    Instead of backslashes, using slashes in the path should work on newer Windows systems (Win7 and newer iirc.), but the colon would still need escaping.
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  6. Member
    Join Date
    May 2023
    Location
    Calne, Wilts, UK
    Search Comp PM
    Thank you Selur for explaning, I'll try it just escping the d and see what happens would simply the processing on the path to add the extra slashes automaticly.
    Quote Quote  
  7. you don't need to escape the d you need to escape the colon (, and is you use backslashes those too.
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  8. Member
    Join Date
    Apr 2007
    Location
    Australia
    Search Comp PM
    Can't see any logical reason to have to add the extra inverted commas
    Wait until you have spaces in your path\filename.
    Then you'll need to wrap double quotes around the "D:\path to\My Movie.mkv"...... "D:\png folder\%08d.png" strings.
    Last edited by pcspeak; 26th May 2023 at 15:37. Reason: Clarity
    Quote Quote  
  9. Member
    Join Date
    May 2023
    Location
    Calne, Wilts, UK
    Search Comp PM
    Ah so thats why other commandline programs fall over when they encounter spaces in the file names, ive been replacing tany spaces in file names with _ before running my program. media info dll being a case in point.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!