Closed SimonSchoeni closed 4 years ago
Hi @SimonSchoeni
You may take a look at the answer: https://superuser.com/a/1482557 It looks like the problem is with the format because it's not supported in MP4's.
Try maybe the Matroska .mkv I've used it but I didn't used .srt as input format for my subtitles. I've used .ass
More info can be found at: https://www.videosolo.com/tutorials/mkv-vs-mp4.html
Hi @black-byte !
Thanks for the hint. As far as I see, SubRip (srt) is not supported for mp4, while WebVTT is. (https://en.wikipedia.org/wiki/Comparison_of_video_container_formats ). I tried out the same with a valid vtt file, but I got the same exception, but it should be supported. Anyway, I didn't really want to convert videos to mkv since I'm explicitly allowing mp4 files as input by the user. I could not replicate the problem with a mkv file, but I do not think that this is the right way to workaround this problem.
And another thing: I think the documentation should be updated, since it is really misleading.
The following lines of code are published:
string output = Path.ChangeExtension(Path.GetTempFileName(), ".mp4");
IConversion conversion = await FFmpeg.Conversions.FromSnippet.AddSubtitle(Resources.Mp4, output, Resources.SubtitleSrt);
IConversionResult result = await conversion.Start();
Which is not working and could never be working since srt is not supported by mp4.
I think that there should be a fix in order to allow at least WebVTT files to be added as subtitles to mp4 files.
Br Simon
Thanks @SimonSchoeni I have updated documentation. Can you check method FFmpeg.Conversions.FromSnippet.BurnSubtitle?
I believe that this should be fixed in #273. As the codec is now fed through from the conversion as long as you use the mov_text
format which is supported in the MP4 container.
Hi!
I'm currently using XABE.FFMPEG to add subtitles to an existing video. The subtitles are autogenerated, but are valid .srt files, which can be added to the video manually.
While trying to add the subtitles using both approaches mentioned in: https://ffmpeg.xabe.net/docs.html
Both of them lead to the same issue: ffmpeg version git-2020-06-19-2f59946 Copyright (c) 2000-2020 the FFmpeg developers built with gcc 9.3.1 (GCC) 20200523 configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libsrt --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --disable-w32threads --enable-libmfx --enable-ffnvcodec --enable-cuda-llvm --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt --enable-amf libavutil 56. 55.100 / 56. 55.100 libavcodec 58. 93.100 / 58. 93.100 libavformat 58. 47.100 / 58. 47.100 libavdevice 58. 11.100 / 58. 11.100 libavfilter 7. 86.100 / 7. 86.100 libswscale 5. 8.100 / 5. 8.100 libswresample 3. 8.100 / 3. 8.100 libpostproc 55. 8.100 / 55. 8.100 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'F:\vid.mp4: Metadata: major_brand : mp42 minor_version : 0 compatible_brands: isommp42 creation_time : 2019-07-19T16:06:50.000000Z Duration: 00:01:11.89, start: 0.000000, bitrate: 466 kb/s Stream #0:0(und): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p(tv, bt709), 640x360 [SAR 1:1 DAR 16:9], 368 kb/s, 23.98 fps, 23.98 tbr, 24k tbn, 47.95 tbc (default) Metadata: creation_time : 2019-07-19T16:06:50.000000Z handler_name : ISO Media file produced by Google Inc. Created on: 07/19/2019. Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 95 kb/s (default) Metadata: creation_time : 2019-07-19T16:06:50.000000Z handler_name : ISO Media file produced by Google Inc. Created on: 07/19/2019. Input #1, srt, from 'F:\test.srt': Duration: N/A, bitrate: N/A Stream #1:0: Subtitle: subrip Automatic encoder selection failed for output stream #0:2. Default encoder for format mp4 (codec none) is probably disabled. Please choose an encoder manually. Error selecting an encoder for stream 0:2
Is there any workaround for this? BR Simon