cdgriffith / FastFlix

FastFlix is a free GUI for H.264, HEVC and AV1 hardware and software encoding!
https://fastflix.org/
MIT License
1.15k stars 58 forks source link

Unable to burn in subtitles #350

Closed mrdav1 closed 1 year ago

mrdav1 commented 2 years ago

When using "Burn In" on a subtitle, errors occur during encoding. The output is pasted below. Please note that the source and output pathnames are valid but, in the output the slashes are not present.

ffmpeg version N-106957-g27cffd16aa-20220521 Copyright (c) 2000-2022 the FFmpeg developers
  built with gcc 11.2.0 (crosstool-NG 1.24.0.533_681aaef)
  configuration: --prefix=/ffbuild/prefix --pkg-config-flags=--static --pkg-config=pkg-config --cross-prefix=x86_64-w64-mingw32- --arch=x86_64 --target-os=mingw32 --enable-gpl --enable-version3 --disable-debug --disable-w32threads --enable-pthreads --enable-iconv --enable-libxml2 --enable-zlib --enable-libfreetype --enable-libfribidi --enable-gmp --enable-lzma --enable-fontconfig --enable-libvorbis --enable-opencl --disable-libpulse --enable-libvmaf --disable-libxcb --disable-xlib --enable-amf --enable-libaom --enable-libaribb24 --enable-avisynth --enable-libdav1d --enable-libdavs2 --disable-libfdk-aac --enable-ffnvcodec --enable-cuda-llvm --enable-frei0r --enable-libgme --enable-libass --enable-libbluray --enable-libjxl --enable-libmp3lame --enable-libopus --enable-librist --enable-libtheora --enable-libvpx --enable-libwebp --enable-lv2 --enable-libmfx --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopenmpt --enable-librav1e --enable-librubberband --enable-schannel --enable-sdl2 --enable-libsoxr --enable-libsrt --enable-libsvtav1 --enable-libtwolame --enable-libuavs3d --disable-libdrm --disable-vaapi --enable-libvidstab --enable-vulkan --enable-libshaderc --enable-libplacebo --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libzimg --enable-libzvbi --extra-cflags=-DLIBTWOLAME_STATIC --extra-cxxflags= --extra-ldflags=-pthread --extra-ldexeflags= --extra-libs=-lgomp --extra-version=20220521
  libavutil      57. 24.101 / 57. 24.101
  libavcodec     59. 28.100 / 59. 28.100
  libavformat    59. 24.100 / 59. 24.100
  libavdevice    59.  6.100 / 59.  6.100
  libavfilter     8. 38.100 /  8. 38.100
  libswscale      6.  6.100 /  6.  6.100
  libswresample   4.  6.100 /  4.  6.100
  libpostproc    56.  5.100 / 56.  5.100
[matroska,webm @ 000001ec89fa3fc0] Could not find codec parameters for stream 5 (Subtitle: hdmv_pgs_subtitle (pgssub)): unspecified size
Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options
[matroska,webm @ 000001ec89fa3fc0] Could not find codec parameters for stream 6 (Subtitle: hdmv_pgs_subtitle (pgssub)): unspecified size
Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options
[matroska,webm @ 000001ec89fa3fc0] Could not find codec parameters for stream 7 (Subtitle: hdmv_pgs_subtitle (pgssub)): unspecified size
Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options
[matroska,webm @ 000001ec89fa3fc0] Could not find codec parameters for stream 8 (Subtitle: hdmv_pgs_subtitle (pgssub)): unspecified size
Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options
Input #0, matroska,webm, from 'D:\Users\Maddie\Videos\To Master\Movies\!4K Video\Courier, The 2020 (2160p HD).mkv':
  Metadata:
    title           : The.Courier.2020.2160p.UHD.BluRay.x265.10bit.HDR.DTS-HD.MA.5.1-SWTYBLZ
    encoder         : libebml v1.4.2 + libmatroska v1.6.4
    creation_time   : 2021-11-05T05:18:31.000000Z
  Duration: 01:51:44.04, start: 0.000000, bitrate: 15349 kb/s
  Chapters:
    Chapter #0:0: start 0.000000, end 606.041667
      Metadata:
        title           : Chapter 01
    Chapter #0:1: start 606.041667, end 1153.500000
      Metadata:
        title           : Chapter 02
    Chapter #0:2: start 1153.500000, end 1698.166667
      Metadata:
        title           : Chapter 03
    Chapter #0:3: start 1698.166667, end 2240.833333
      Metadata:
        title           : Chapter 04
    Chapter #0:4: start 2240.833333, end 2778.833333
      Metadata:
        title           : Chapter 05
    Chapter #0:5: start 2778.833333, end 3407.125000
      Metadata:
        title           : Chapter 06
    Chapter #0:6: start 3407.125000, end 3948.291667
      Metadata:
        title           : Chapter 07

    Chapter #0:7: start 3948.291667, end 4544.500000
      Metadata:
        title           : Chapter 08
    Chapter #0:8: start 4544.500000, end 5125.416667
      Metadata:
        title           : Chapter 09
    Chapter #0:9: start 5125.416667, end 5500.791667
      Metadata:
        title           : Chapter 10
    Chapter #0:10: start 5500.791667, end 6062.000000
      Metadata:
        title           : Chapter 11
    Chapter #0:11: start 6062.000000, end 6701.458333
      Metadata:
        title           : Chapter 12
    Chapter #0:12: start 6701.458333, end 6704.041667
      Metadata:
        title           : Chapter 13
  Stream #0:0: Video: hevc (Main 10), yuv420p10le(tv, bt2020nc/bt2020/smpte2084), 3840x1606 [SAR 1:1 DAR 1920:803], 24 fps, 24 tbr, 1k tbn (default)
    Metadata:
      BPS             : 10633585
      DURATION        : 01:51:44.042000000
      NUMBER_OF_FRAMES: 160897
      NUMBER_OF_BYTES : 8911000816
      _STATISTICS_WRITING_APP: mkvmerge v62.0.0.1 ('Apollo') 64-bit
      _STATISTICS_WRITING_DATE_UTC: 2021-11-05 05:18:31
      _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
  Stream #0:1(eng): Audio: dts (DTS-HD MA), 48000 Hz, 5.1(side), s32p (24 bit) (default)
    Metadata:
      title           : DTS-HD MA 5.1
      BPS             : 4050335
      DURATION        : 01:51:42.529000000
      NUMBER_OF_FRAMES: 628362
      NUMBER_OF_BYTES : 3393436048
      SOURCE_ID       : 001101
      _STATISTICS_WRITING_APP: mkvmerge v62.0.0.1 ('Apollo') 64-bit
      _STATISTICS_WRITING_DATE_UTC: 2021-11-05 05:18:31
      _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES SOURCE_ID
  Stream #0:2(eng): Audio: ac3, 48000 Hz, 5.1(side), fltp, 640 kb/s
    Metadata:
      title           : DD 5.1
      BPS             : 640000
      DURATION        : 01:51:42.560000000
      NUMBER_OF_FRAMES: 209455
      NUMBER_OF_BYTES : 536204800
      _STATISTICS_WRITING_APP: mkvmerge v62.0.0.1 ('Apollo') 64-bit
      _STATISTICS_WRITING_DATE_UTC: 2021-11-05 05:18:31
      _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
  Stream #0:3(eng): Subtitle: subrip (forced)
    Metadata:
      title           : FORCED
      BPS             : 5
      DURATION        : 01:43:16.163000000
      NUMBER_OF_FRAMES: 136
      NUMBER_OF_BYTES : 4588
      _STATISTICS_WRITING_APP: mkvmerge v62.0.0.1 ('Apollo') 64-bit
      _STATISTICS_WRITING_DATE_UTC: 2021-11-05 05:18:31
      _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
  Stream #0:4(eng): Subtitle: subrip (default)
    Metadata:
      BPS             : 52
      DURATION        : 01:43:41.833000000
      NUMBER_OF_FRAMES: 1130
      NUMBER_OF_BYTES : 40548
      _STATISTICS_WRITING_APP: mkvmerge v62.0.0.1 ('Apollo') 64-bit
      _STATISTICS_WRITING_DATE_UTC: 2021-11-05 05:18:31
      _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
  Stream #0:5(ita): Subtitle: hdmv_pgs_subtitle
    Metadata:
      BPS             : 28716
      DURATION        : 01:43:11.000000000
      NUMBER_OF_FRAMES: 2172
      NUMBER_OF_BYTES : 22223143
      SOURCE_ID       : 0012A0
      _STATISTICS_WRITING_APP: mkvmerge v62.0.0.1 ('Apollo') 64-bit
      _STATISTICS_WRITING_DATE_UTC: 2021-11-05 05:18:31
      _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES SOURCE_ID
  Stream #0:6(ita): Subtitle: hdmv_pgs_subtitle
    Metadata:
      title           : FORCED
      BPS             : 2918
      DURATION        : 01:16:19.417000000
      NUMBER_OF_FRAMES: 238
      NUMBER_OF_BYTES : 1670644
      SOURCE_ID       : 0012A1
      _STATISTICS_WRITING_APP: mkvmerge v62.0.0.1 ('Apollo') 64-bit
      _STATISTICS_WRITING_DATE_UTC: 2021-11-05 05:18:31
      _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES SOURCE_ID
  Stream #0:7(eng): Subtitle: hdmv_pgs_subtitle
    Metadata:
      BPS             : 29764
      DURATION        : 01:43:41.833000000
      NUMBER_OF_FRAMES: 2262
      NUMBER_OF_BYTES : 23149048
      SOURCE_ID       : 0012A2
      _STATISTICS_WRITING_APP: mkvmerge v62.0.0.1 ('Apollo') 64-bit
      _STATISTICS_WRITING_DATE_UTC: 2021-11-05 05:18:31
      _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES SOURCE_ID
  Stream #0:8(eng): Subtitle: hdmv_pgs_subtitle
    Metadata:
      title           : FORCED
      BPS             : 2690
      DURATION        : 01:43:16.000000000
      NUMBER_OF_FRAMES: 272
      NUMBER_OF_BYTES : 2083765
      SOURCE_ID       : 0012A3
      _STATISTICS_WRITING_APP: mkvmerge v62.0.0.1 ('Apollo') 64-bit
      _STATISTICS_WRITING_DATE_UTC: 2021-11-05 05:18:31
      _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES SOURCE_ID
[subtitles @ 000001ec8a459c00] Unable to parse option value "UsersMaddieVideosTo MasterMovies!4K VideoCourier, The 2020 (2160p HD).mkv" as image size
[subtitles @ 000001ec8a459c00] Error setting option original_size to value UsersMaddieVideosTo MasterMovies!4K VideoCourier, The 2020 (2160p HD).mkv.
[Parsed_subtitles_0 @ 000001ec8a3d1d00] Error applying options to the filter.
[AVFilterGraph @ 000001ec8a3d0a80] Error initializing filter 'subtitles' with args 'D:\Users\Maddie\Videos\To Master\Movies\!4K Video\Courier, The 2020 (2160p HD).mkv:si=0'
Error initializing complex filters.
Invalid argument
mrdav1 commented 2 years ago

On looking at the "Raw Commands" it seems that the problem is when dealing with complex paths.

I saved this bat file as "Original.txt" and got the same errors when calling Original.txt

I then moved the Source File to the local directory and saved a simplifed bat file "New.txt". This now seems to be working from the command line. New.txt

Obviously this workaround is not ideal so I really hope this helps you develop a solution in FastFlix.

cdgriffith commented 2 years ago

This was a pain to figure out thanks to ffmpeg's super fun quoting issues. I hopefully have it fixed in 4.10.0 but if there's any more issues please re-open this or create new issue.

mrdav1 commented 2 years ago

I agree with the quoting issues. 4.10 has almost fixed this but it still can't cope with the comma in the filename. Please see the revised text file.

Original 4.10.txt

Please reopen this bug.

Thanks in anticipation.

cdgriffith commented 1 year ago

Fixed in 5.2.0!