Menu

Hard Coding Subtitles?

Xoanon
2023-11-09
2023-11-13
  • Xoanon

    Xoanon - 2023-11-09

    I have a lot of videos with soft or external subtitles and was wondering if there is a way to hard-code them into the video stream when converting? Thanks!

     
  • Abel

    Abel - 2023-11-09

    You could yse the subtitles tab for external subtitles hard-coding,
    or in main tab parameters, use the subtitles filter, like:

    -vf subtitles=subtitle.srt

     
  • Xoanon

    Xoanon - 2023-11-09

    I tried the Sub tab but I want to convert and burn-in at the same time so I tried using the -vf flag like you mentioned but it keeps erroring. Can you tell me what I might be doing wrong?

    -map 0 -c:v hevc_amf -quality balanced -rc cqp -qp_p 28 -qp_i 28 -quality balanced -rc cqp -qp_p 28 -qp_i 28 -vf "scale=640:360" subtitles=subtitle.srt -c:a aac -b:a 128K -filter:a loudnorm

     
  • Abel

    Abel - 2023-11-10

    I think you need to join the vf filters, like
    -vf "scale=640:360,subtitles=subtitle.srt"
    subtitles.srt should be located at input file path.

    log file should help pointing at the errors cause.

     
  • Xoanon

    Xoanon - 2023-11-11

    Ok, I changed the preset to this:
    -map 0 -c:v hevc_amf -quality balanced -rc cqp -qp_p 20 -qp_i 20 -quality balanced -rc cqp -qp_p 20 -qp_i 20 -vf "scale=640:360,subtitles=subtitle.srt" -c:a aac -b:a 128K -filter:a loudnorm

    and I received this error message when I tested the preset:

    [Parsed_subtitles_1 @ 00000203074871c0] Unable to open subtitle.srt
    [AVFilterGraph @ 00000203073dbe00] Error initializing filters
    [vost#0:0/hevc_amf @ 00000203073bfc00] Error initializing a simple filtergraph
    Error opening output file C:\Users<Username>\AppData\Local\Temp\\FFBatch_test\01.mkv.
    Error opening output files: No such file or directory
    
    Encoding test failed. CHECK OUTPUT ABOVE
    

    ...and the SRT subtitle with the same filename was in the directory.

     
  • Abel

    Abel - 2023-11-13

    I'll test it asap.

     
  • Abel

    Abel - 2023-11-13

    File paths inside vf filters are very confusing in Window, \ and : need to be escaped.

    Please try something like this:

    -map 0 -c:v hevc_amf -quality balanced -rc cqp -qp_p 20 -qp_i 20 -quality balanced -rc cqp -qp_p 20 -qp_i 20 -vf "scale=640:360,subtitles=C\:/Users/\Data/\Videos/\Test.srt" -c:a aac -b:a 128K -filter:a loudnorm

    Replacing the Test.srt path with your own.
    Those parameters tested successfully for me.

     
  • Xoanon

    Xoanon - 2023-11-13

    But to do that, all "soft subtitles" must separate from the MKV container and in the folder specified in the path above to be hard-coded into the video stream. Do I understand that correctly?

     
  • Abel

    Abel - 2023-11-13

    You could use the input file in subtitles filter, or even use the input file path variable as filter file (fx button for variables)

     

    Last edit: Abel 2023-11-14

Log in to post a comment.