As part of a project to learn more about ffmpeg, I have a file that has a subtitle track in the file (I believe the proper term is "embedded subtitle track"). I want to remove that track so that eventually I can hardcode the subtitles. But, I don't seem to be able to remove that subtitle track. I have tried: "-sn" and "-map 0 -map -0: s:1" (space is added to avoid emoji). The original file is an AVI and I have tried removing the track with the following in/out: AVI to AVI, AVI to MKV, AVI to MP4, AVI to MKV to MKV, and, AVI to MKV to MP4. None of these will remove that track. I have also tried "-filter_complex subtitles=in.avi -c: s mov_text -sn" (yes, another space to avoid emoji), but, it does not work either. Here is the basic output for the file:
I have not used ffmpeg for awhile, but, I have good notes as to what I have learned in the past. I have not had problems with manipulating subtitle tracks before. Again, this is a project to learn about ffmpeg, so, solutions offered here should involve ffmpeg. Thanks.Code:ffmpeg version 2023-04-26-git-e3143703e9-full_build-www.gyan.dev Copyright (c) 2000-2023 the FFmpeg developers built with gcc 12.2.0 (Rev10, Built by MSYS2 project) configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-bzlib --enable-lzma --enable-libsnappy --enable-zlib --enable-librist --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libaribb24 --enable-libaribcaption --enable-libdav1d --enable-libdavs2 --enable-libuavs3d --enable-libzvbi --enable-librav1e --enable-libsvtav1 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libaom --enable-libjxl --enable-libopenjpeg --enable-libvpx --enable-mediafoundation --enable-libass --enable-frei0r --enable-libfreetype --enable-libfribidi --enable-liblensfun --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libvpl --enable-libshaderc --enable-vulkan --enable-libplacebo --enable-opencl --enable-libcdio --enable-libgme --enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libshine --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libcodec2 --enable-libilbc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-ladspa --enable-libbs2b --enable-libflite --enable-libmysofa --enable-librubberband --enable-libsoxr --enable-chromaprint libavutil 58. 6.100 / 58. 6.100 libavcodec 60. 10.100 / 60. 10.100 libavformat 60. 5.100 / 60. 5.100 libavdevice 60. 2.100 / 60. 2.100 libavfilter 9. 5.100 / 9. 5.100 libswscale 7. 2.100 / 7. 2.100 libswresample 4. 11.100 / 4. 11.100 libpostproc 57. 2.100 / 57. 2.100 Input #0, avi, from 'in.avi': Metadata: software : VirtualDubMod 1.5.10.3 | www.virtualdub-fr.org || (build 2550/release) Duration: 01:21:21.60, start: 0.000000, bitrate: 1204 kb/s Stream #0:0: Video: mpeg4 (Advanced Simple Profile) (XVID / 0x44495658), yuv420p, 512x384 [SAR 1:1 DAR 4:3], 1066 kb/s, 25 fps, 25 tbr, 25 tbn Stream #0:1: Audio: mp3 (U[0][0][0] / 0x0055), 48000 Hz, stereo, fltp, 128 kb/s At least one output file must be specified
+ Reply to Thread
Results 1 to 30 of 61
-
-
There is no subtitle track in that file. AVI files do not support subtitles streams, the subtitles you see are "burned in" or "hardcoded".
-
When I play the AVI file in VLC, it shows that there is a subtitle track, and, that I can switch it off with "Disable". My understanding of hardcoded or burned-in was that the subtitles were permantently "burned" into the video stream and were no longer in a separate track.
-
FFmpeg does not detect subtitles track. If ffmpeg can't detect the subs, you can't "remove" or stream copy them with ffmpeg
What does mediainfo (view=>text) report about subs ?
If you mux in mkvtoolnix does it identify a subtitle track ? -
AVI supports subtitle tracks
AVI-Mux GUI can be used to make them, they playback properly as soft subs with MPCHC , potplayer etc...
I posted an example below
You can mux/demux them if they are detected
Code:ffmpeg -i mux.avi Input #0, avi, from 'mux.avi': Metadata: software : AVI-Mux GUI 1.17.8, Aug 30 2008 12:36:58? JUNK : Duration: 00:00:05.00, start: 0.000000, bitrate: 259 kb/s Stream #0:0: Video: mpeg4 (Advanced Simple Profile) (XVID / 0x44495658), yuv42 0p, 640x480 [SAR 1:1 DAR 4:3], 25 fps, 25 tbr, 25 tbn Stream #0:1: Audio: mp3 (U[0][0][0] / 0x0055), 48000 Hz, stereo, fltp, 128 kb/ s Stream #0:2: Subtitle: subrip Metadata: title : subs
Code:ffmpeg -i mux.avi -map 0:2 -c:s copy copy.srt
Code:Text ID : 2 Duration : 5 s 0 ms Title : subs
If subs are embedded as closed captions, then you might try ccextractor . I've never seen that with MPEG4 -ASP (XVID) -
A quick and dirty way to extract them if any is pop the file in MKVToolnix and let it produce a mkv file. If you check it with MediaInfo and the file did inded have a subtitle file within it, then you can extract it using for example Inviska MKV Extract or similar. Or simply if you don't need the subtitle after you load the avi file with sub it will show up in MKVToolnix, untick and voila you will have a MKV file sans subs.
SONY 75" Full array 200Hz LED TV, Yamaha A1070 amp, Zidoo UHD3000, BeyonWiz PVR V2 (Enigma2 clone), Chromecast, Windows 11 Professional, QNAP NAS TS851 -
-
Did you try it ?
-sn means no subtitle ; as in disregard if there were any
-map refers to selecting of streams , "s" specifically subtitles .
I posted an example above of selecting subs
But if you had multiple sub streams detectable by ffmpeg for that video - it should show up in the console log, the specific numbering could be different for each video . It did not show up for you in post #1, unless you edited it.... Post the full log if you edited it
Look at the ffmpeg documentation for -map options -
-
-
You've misunderstood everyone's post(s)
FFmpeg does not detect subtitles on your specific video in post #1 . Look at the console log
Of course ffmpeg can detect subs on videos that actually have subs. ( I posted an example where ffmpeg could copy subs with an actual video example ...look at post#5)
So ... "If ffmpeg can't detect the subs, you can't "remove" or stream copy them with ffmpeg" - is it clear now ? -
-
-
-
-
-
-
I think these are EIA 608/708 captions.
They are not displayed by ffmpeg, but mediainfo does.
You can extract them with clever FFmpeg-GUI. -
Hi, if there is no other solution maybe the program Metadata++ can help out, it use FFMpeg, ImageMagick, FFProbe, ExifTool! Im not sure if it can remove embedded subtitles, i could not find an video to test it with since i dont have one with embedded subtitle, but the program seem to be able to remove basicly anything from an video! Im new to the program myself so if it can get the job done im not sure as ive only used it 2 times yet myself to delete some stubborn metadata! Maybe worth checking out if there is no other solution with the softwares you allready have!
If you can convert the video to MP4 and the subtitle is still there, maybe mp4ui can help out, it can atleast import alot of stuff as an track into the videos, im not sure if it can find subtitles and have them deleted tough, since i dont have one to try with!
Edit: If decide to use the mp4ui (if it even can get the job done) it will add "Encoded by" metadata to your mp4, the stubborn type so you might want to check in with the Metadata++ to have it removed if using the program! -
-
-
-
OK, since we can't seem to find an answer with ffmpeg, I have tried some other apps to try to locate the subtitle track. These viewers do not see the subtitle track: PotPlayer, Windows Media Player, Nero ShowTime, and, Zoom Player. These apps do not show the track either: MediaInfo, Photoshop Premiere 14, HandBrake, clever FFMPEG GUI, and, Subtitle Edit. It seems that VLC is the only app that sees the track. The actual subtitles do match the video, so, the track is not some random track included by accident.
I am willing to look at a few other apps to see if any of them can see the track and/or to identity apps that can create this phantom track. But, again, this is a project to learn more about ffmpeg. I understand the idea that ffmpeg cannot do everything, but, I think that we should be able to identify where this track is inside of the file and why no app other than VLC sees it. -
Under the Codec tab, it shows:
Code:Stream 2: Codec: Text subtitles with various tags (subt) Type: Subtitle
When I try to remove this track as closed captioning with "-bsf:v "filter_units=remove_types=6" I get the error message "Codec 'mpeg4' (12) is not supported by the bitstream filter 'filter_units'". Then, when I try to export as closed captioning with "-map 0: s:0" {yes, space added to avoid emoji}, I get the error message "Stream map '0: s:0' {yes, space added to avoid emoji} matches no streams". So, I guess that means that at least as far as ffmpeg is concerned, that track is not closed captioning.
I also found the command:
Code:ffmpeg -f lavfi -i movie=in.mp4[out0+subcc] -vn -an -codec:s subrip b.srt
Code:ffmpeg version 2023-04-26-git-e3143703e9-full_build-www.gyan.dev Copyright (c) 2000-2023 the FFmpeg developers built with gcc 12.2.0 (Rev10, Built by MSYS2 project) configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-bzlib --enable-lzma --enable-libsnappy --enable-zlib --enable-librist --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libaribb24 --enable-libaribcaption --enable-libdav1d --enable-libdavs2 --enable-libuavs3d --enable-libzvbi --enable-librav1e --enable-libsvtav1 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libaom --enable-libjxl --enable-libopenjpeg --enable-libvpx --enable-mediafoundation --enable-libass --enable-frei0r --enable-libfreetype --enable-libfribidi --enable-liblensfun --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libvpl --enable-libshaderc --enable-vulkan --enable-libplacebo --enable-opencl --enable-libcdio --enable-libgme --enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libshine --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libcodec2 --enable-libilbc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-ladspa --enable-libbs2b --enable-libflite --enable-libmysofa --enable-librubberband --enable-libsoxr --enable-chromaprint libavutil 58. 6.100 / 58. 6.100 libavcodec 60. 10.100 / 60. 10.100 libavformat 60. 5.100 / 60. 5.100 libavdevice 60. 2.100 / 60. 2.100 libavfilter 9. 5.100 / 9. 5.100 libswscale 7. 2.100 / 7. 2.100 libswresample 4. 11.100 / 4. 11.100 libpostproc 57. 2.100 / 57. 2.100 Input #0, lavfi, from 'movie=in.avi[out0+subcc]': Duration: N/A, start: 0.040000, bitrate: N/A Stream #0:0: Video: wrapped_avframe, yuv420p, 512x384 [SAR 1:1 DAR 4:3], 25 fps, 25 tbr, 25 tbn Stream #0:1: Subtitle: eia_608 Output #0, srt, to 'b.srt': Metadata: encoder : Lavf60.5.100 Stream #0:0: Subtitle: subrip Metadata: encoder : Lavc60.10.100 subrip Stream mapping: Stream #0:1 -> #0:0 (eia_608 (cc_dec) -> subrip (native)) Press [q] to stop, [?] for help size= 0kB time=-577014:32:22.77 bitrate= -0.0kbits/s speed=N/A size= 0kB time=-577014:32:22.77 bitrate= -0.0kbits/s speed=N/A size= 0kB time=-577014:32:22.77 bitrate= -0.0kbits/s speed=N/A size= 0kB time=-577014:32:22.77 bitrate= -0.0kbits/s speed=N/A size= 0kB time=-577014:32:22.77 bitrate= -0.0kbits/s speed=N/A size= 0kB time=-577014:32:22.77 bitrate= -0.0kbits/s speed=N/A size= 0kB time=-577014:32:22.77 bitrate= -0.0kbits/s speed=N/A size= 0kB time=-577014:32:22.77 bitrate= -0.0kbits/s speed=N/A size= 0kB time=-577014:32:22.77 bitrate= -0.0kbits/s speed=N/A size= 0kB time=-577014:32:22.77 bitrate= -0.0kbits/s speed=N/A size= 0kB time=-577014:32:22.77 bitrate= -0.0kbits/s speed=N/A size= 0kB time=-577014:32:22.77 bitrate= -0.0kbits/s speed=N/A size= 0kB time=-577014:32:22.77 bitrate= -0.0kbits/s speed=N/A size= 0kB time=-577014:32:22.77 bitrate= -0.0kbits/s speed=N/A size= 0kB time=-577014:32:22.77 bitrate= -0.0kbits/s speed=N/A size= 0kB time=-577014:32:22.77 bitrate= -0.0kbits/s speed=N/A [Parsed_movie_0 @ 000001cf697575c0] EOF timestamp not reliable [out#0/srt @ 000001cf697a1780] video:0kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown [out#0/srt @ 000001cf697a1780] Output file is empty, nothing was encoded(check -ss / -t / -frames parameters if used) size= 0kB time=-577014:32:22.77 bitrate= -0.0kbits/s speed=N/A
So, it seems that ProWo was right in that the stream/track is "eia_608". Now, what does that mean? Do I need a newer version of ffmpeg?
I also found this info but the meaning is above my paygrade:
Code:EIA-608 and similar closed captioning standards, the captions are embedded directly in the video bitstream as user data. H.264 bitstreams are stored as a sequence of NAL (network abstraction layer) units. Each unit has a type; user data is stored in a NAL unit of the supplemental enhancement information (SEI) type.
Also, when I try using "-bsf:v filter_units=remove_types=6" it gives me the error message:
Code:Codec 'mpeg4' (12) is not supported by the bitstream filter 'filter_units'. Supported codecs are: av1 (226) h264 (2) hevc (173) mpeg2video (2) vp9 (167)
Last edited by the_steve_randolph; 8th Feb 2024 at 21:23. Reason: Extra tries
-
-bsf:v filter_units=remove_types=6
For mpeg4 (divx, xvid) you seem to be out of luck.
I would still experiment with other numbers. -
Hi, since it seem like an weird issue, if using VLC Media Player, if you have for example an folder named "Subtitles" in the same directory as the video, and allso if the subtitle name have the same name as the video it will appear as an subtitle stream within vlc! If maybe you have many folders and videos in this directory that the video is inside maybe you used the same name as an subtitle without knowing and have an folder with many subtitles!
For me it say:
Stream 0
Codec: Text subtitles with various Tags (subt)
Language: \subtitles\subtitlename
Type: Subtitle
This is from vlc, the folder named "Subtitles" is in the same directory as the avi video and in this directory the subtitle have the same name as the video, VLC Media Player picked the subtitle up by itself! The subtitle allso show up as an subtitle track that can be disabled!Last edited by Crunchedfire; 9th Feb 2024 at 03:19. Reason: Addin subtitle stream info
Similar Threads
-
unable to get subtitles with ffmpeg from m3u8 url
By hhuang05 in forum Video Streaming DownloadingReplies: 3Last Post: 11th Jun 2023, 15:33 -
remove metadata and keep audios and subtitles using ffmpeg
By ekato993 in forum Video Streaming DownloadingReplies: 0Last Post: 6th Jun 2021, 04:28 -
[FFMPEG] Is there a way to remove this part that FFMPEG puts in the meta?
By GEOLINK in forum Newbie / General discussionsReplies: 2Last Post: 1st Feb 2021, 17:51 -
ffmpeg unable to make mp4
By Trekmeister in forum Newbie / General discussionsReplies: 4Last Post: 16th Dec 2020, 02:15 -
Best way to remove watermark using FFMPEG?
By 21dresden21 in forum Video Streaming DownloadingReplies: 1Last Post: 12th Feb 2019, 09:47