I've been looking around for months now, and I can't seem to find an answer to this anywhere. I'm having this problem whenever I try to convert a video file that has some streams using the codec hdmv_pgs_subtitle. This happens every time with m2ts files and very often with mkv files when I try to convert to mp4. For example, I have this file that has a total of 18 streams (1 video + 11 audio + 6 PGS subtitles). I want to keep the video stream and the two last audio streams. So let's say I put that in:
$ ffmpeg -i videofile.m2ts -map 0:0 -c:v copy -map 0:10 -acodec copy -map 0:11 -acodec copy -f mp4 videofile.mp4
It's gonna work, but before it starts to actually convert anything it can hang for hours. Adding -loglevel debug shows that before doing any conversion, ffmpeg goes through the whole video file and every single stream and it sends an infinity of these warnings
$[mpegts @ 0x7fa891000000] Non-increasing DTS in stream 16: packet 89 with DTS 59240150, packet 90 with DTS 59234408
It doest that for every single stream regardless if they've been mapped or not. Using negative mapping doesn't change a thing. Other things I have tried yet: -probesize,-analyzeduration, -use_wallclock_as_timestamps, the following fflags mpegts_copyts, fix_teletext_pts, skip_unknown_pmt, igndts,+gnpts. Also tried adding copytb,-an,-sn, and using -ss with a time slightly after the start of the video like -ss 0.125 and certainly many other things I'm just not remembering right now.
With some videofile it's not going to hang very long, maybe 15-20 minutes but with some files it can hang for as long as 5-6 hours before starting any conversion, which is kind of annoying when you're using crf and once it starts you realize that the resulting bitrate is too low or way too high, because it means, I'm gonna have to waitthe 5-6 hours once more if I want to change that.
While it does that, for some videos, (I have no idea why it happens with some and doesn't with others), ffmpeg it's going to load the entire video in the RAM. So if the file is 70Gb, first it's going to use my 32 Gb of RAM and then compress some memory up until the whole 70Gb will be loaded in the RAM and when it gets there, it basically means it's about to start converting and the RAM is freed rather quickly and it starts converting once it's done doing that.
All of this only happens in the presence of sup subtitles streams even though these streams haven't been selected. Does anybody knows how to avoid that. I've llooked around so much and I haven't been able to find anything that addresses that yet.
Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays! or rip iTunes movies!
+ Reply to Thread
Results 1 to 5 of 5
Thread
-
-
You can't remove what you don't want using a different program, before doing the conversion?
-
With MKV files use MKvToolNix and deselect unwanted streams. Takes minutes to remux to a new container. Then use this MKV file to convert to whatever... then there is always this program https://www.videohelp.com/software/MkvToMp4
SONY 75" Full array 200Hz LED TV, Yamaha A1070 amp, Zidoo UHD3000, BeyonWiz PVR V2 (Enigma2 clone), Chromecast, Windows 11 Professional, QNAP NAS TS851 -
-sn (input/output)
As an input option, blocks all subtitle streams of a file from being filtered or being automatically selected or mapped for any output. See -discard option to disable streams individually.
As an output option, disables subtitle recording i.e. automatic selection or mapping of any subtitle stream. For full manual control see the -map option.
Have you tried putting '-sn' before the input?users currently on my ignore list: deadrats, Stears555 -
Thank you all for taking the time to answer me.
@netmask56 Indeed This is one of the workaround I've been using and it works great, but I've written a script to batch convert groups of files so I was hoping to find a more integrated way of dealing with this from the command line.
@Selur I did try -sn as input and output option and it still did go through all the subtitles. -map is usually with I'm using and it doesn't prevent that from happening either. I haven't tried the -discard option, so I'm gonna try that. Thank you very much.
Similar Threads
-
Need help with LJ streams
By heehaa in forum Video Streaming DownloadingReplies: 1Last Post: 3rd Mar 2018, 15:51 -
Batch remove audio streams and subtitles from several mkv?
By samus88 in forum AudioReplies: 3Last Post: 30th Dec 2016, 03:56 -
be-at.tv streams
By nlowdon in forum Video Streaming DownloadingReplies: 1Last Post: 11th Oct 2016, 17:36 -
Combining Streams
By Basatinez in forum Video Streaming DownloadingReplies: 0Last Post: 23rd Oct 2015, 08:58 -
Record 2 or more streams
By ekekezz in forum Video Streaming DownloadingReplies: 4Last Post: 3rd Aug 2015, 17:58