[FFmpeg-user] MKV to MP4
I'm trying to remux MKV as MP4. In the process, I want to remove the rounding errors that were introduced by MKV so that the video is 24/1.001fps CFR once again with proper PTSs & DTSs and 1/9 time base. When I do that, audio & video are out of sync. Does anyone know how to do this? I'd be really grateful. Regards -- Mark. PS: Since I wrote this I may have stumbled on a partial answer. I'd like your experiences with that partial answer. The partial answer is to add only this bit stream filter: -bsf:v setts=time_base=1/9 and to NOT add either :pts=... or :dts=... As I wrote, I stumbled on it through a fortuitous mistake. It seems to work, even for videos that completely lack PTSs & DTSs. Comments? Please. ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-user] MKV to MP4 subtitle issue
On Tue, Jan 17, 2023 at 10:02:59 +0100, pehache wrote: > > MP4 cannot carry those HDMV PGS subtitles (or any other bitmap based > > format, if I remember correctly). > > MP4 can carry the DVDSUB format, which is bitmap. Ah great, sorry, I wasn't aware (anymore) > The OP can give a try transcoding the PGS subtitles to DVDSUB, using "-c:s > dvdsub", but in my (limited) experience it often fails for some reason or > another. Indeed, I have always had problems converting any bitmap-based format to dvdsub. I may dig into it again, but the original poster should perhaps just try. Moritz ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-user] MKV to MP4 subtitle issue
Le 16/01/2023 à 11:47, Moritz Barsnick a écrit : MP4 cannot carry those HDMV PGS subtitles (or any other bitmap based format, if I remember correctly). MP4 can carry the DVDSUB format, which is bitmap. The OP can give a try transcoding the PGS subtitles to DVDSUB, using "-c:s dvdsub", but in my (limited) experience it often fails for some reason or another. ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-user] MKV to MP4 subtitle issue
On Tue, Jan 10, 2023 at 19:23:33 -0600, Steve Zemlicka wrote: > The question I have is similar to the following post: > https://superuser.com/questions/932730/ffmpeg-mkv-to-mp4-conversion-loses-subtitles Those answers are not helpful, because you have HDMV PGS, which is a bitmap format, that cannot be converted to ASS or SRT directly. > I am using ffmpeg version n5.1.2. I have an mkv that has two subtitle > tracks. I am trying to convert it to mp4. > > mkvmerge -i input.mkv > File 'input.mkv': container: Matroska > Track ID 0: video (HEVC/H.265/MPEG-H) > Track ID 1: audio (E-AC-3) > Track ID 2: subtitles (HDMV PGS) > Track ID 3: subtitles (HDMV PGS) > Chapters: 10 entries > > "subtitles=input.mkv:si=1" as per > http://ffmpeg.org/ffmpeg-filters.html#subtitles. Unfortunately this > results in an error: > "Unable to find a suitable output format for 'subtitles=input.mkv:si1'" > followed by: > "subtitles=input.mkv:si=1: Invalid argument" If you use the "subtitles" filter, you must declare it after the leading filter option "-vf". But, that said, the subtitles filter is actually meant for handling text-based subtitles. Which it what you presume here: > I've also tried several other options including "-c:s copy" which didn't > work due to the nature of the original subtitles (PGS) I suspect. MP4 cannot carry those HDMV PGS subtitles (or any other bitmap based format, if I remember correctly). Since you prefer hardsubs anyway, perhaps this method mentioned in ffmpeg's own wiki can be of help: https://trac.ffmpeg.org/wiki/HowToBurnSubtitlesIntoVideo#Picture-basedsubtitles BTW, here's a link on how to extract those bitmaps: https://superuser.com/q/1748962 You would need OCR to convert them to text-based. ffmpeg has no integration of such tools, but external tools are available. (I have one myserlf attempted to convert bitmap subs to text-based subs. It was a cumbersome process.) Cheers, Moritz ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-user] MKV to MP4 subtitle issue
The question I have is similar to the following post: https://superuser.com/questions/932730/ffmpeg-mkv-to-mp4-conversion-loses-subtitles I am using ffmpeg version n5.1.2. I have an mkv that has two subtitle tracks. I am trying to convert it to mp4. mkvmerge -i input.mkv File 'input.mkv': container: Matroska Track ID 0: video (HEVC/H.265/MPEG-H) Track ID 1: audio (E-AC-3) Track ID 2: subtitles (HDMV PGS) Track ID 3: subtitles (HDMV PGS) Chapters: 10 entries I believe Track ID 2 is for foreign dialog only and is the one I would prefer to use. I also prefer to use hardsubs but would take hard or soft subs at this point. I've tried a number of approaches with little success. The closest I've gotten is to issue the subtitle=input.mkv option. ffmpeg -i input.mkv -c:v hecv_nvenc -crf 26 -preset fast -c:a aac -b:a 128k subtitles=input.mkv output.mp4 I expected this to burn the subs to the video but oddly enough, it seemed to make an mp4 with a subtitle track to toggle. Unfortunately the subtitles are just the chapter names and not the actual subtitles. I've also tried to manually select different subtitle tracks by using "subtitles=input.mkv:si=1" as per http://ffmpeg.org/ffmpeg-filters.html#subtitles. Unfortunately this results in an error: "Unable to find a suitable output format for 'subtitles=input.mkv:si1'" followed by: "subtitles=input.mkv:si=1: Invalid argument" I've also tried several other options including "-c:s copy" which didn't work due to the nature of the original subtitles (PGS) I suspect. Am I doing something wrong or missing something? ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-user] MKV To MP4
John, On Thu, Dec 3, 2020 at 9:51 AM John Henderson via ffmpeg-user wrote: > > Hi there, > > I am not sure whether this is a windows media player issue or FFMPEG. I am > using ffmpeg to capture the screen and record audio, whilst playing games. > It does a great job and I save the file as an mkv. I can convert the file > to mp4 and all seems fine. However when I try to play the file with > windows media player version 12.019 etc. I get "network is too busy to play > file at original quality" and it just sits there doing nothing. If i open > windows media player classic, it plays the mp4 file perfectly with no > problems at all. This is the ffmpeg command I used to convert the mkv file > to mp4 > > ffmpeg -i laptop.mkv -c copy laptop.mp4 I would at least give it another try using: -movflags +faststart * https://trac.ffmpeg.org/wiki/Encode/H.264#AdditionalInformationTips => faststart for web video > Is it possible that it may be the command I used to create the MKV file > shown below. > > "/k ffmpeg.exe -y -probesize 10M -rtbufsize 1500M -f dshow -i audio=""" & > Audio_name & """ -acodec pcm_s16le -f gdigrab -framerate 60 -i desktop > -vcodec libx264 -qp 0 -threads 0 -crf 18 -preset ultrafast -tune > zerolatency " myFile.mkv" > > Or is it windows media player 12.0 ?? > > Any help with this will be really appreciated. Thanks > > All the best, > > John > ___ > ffmpeg-user mailing list > ffmpeg-user@ffmpeg.org > https://ffmpeg.org/mailman/listinfo/ffmpeg-user > > To unsubscribe, visit link above, or email > ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe". 2cts -- Mathieu ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-user] MKV To MP4
Hi there, I am not sure whether this is a windows media player issue or FFMPEG. I am using ffmpeg to capture the screen and record audio, whilst playing games. It does a great job and I save the file as an mkv. I can convert the file to mp4 and all seems fine. However when I try to play the file with windows media player version 12.019 etc. I get "network is too busy to play file at original quality" and it just sits there doing nothing. If i open windows media player classic, it plays the mp4 file perfectly with no problems at all. This is the ffmpeg command I used to convert the mkv file to mp4 ffmpeg -i laptop.mkv -c copy laptop.mp4 Is it possible that it may be the command I used to create the MKV file shown below. "/k ffmpeg.exe -y -probesize 10M -rtbufsize 1500M -f dshow -i audio=""" & Audio_name & """ -acodec pcm_s16le -f gdigrab -framerate 60 -i desktop -vcodec libx264 -qp 0 -threads 0 -crf 18 -preset ultrafast -tune zerolatency " myFile.mkv" Or is it windows media player 12.0 ?? Any help with this will be really appreciated. Thanks All the best, John ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-user] MKV to MP4
On Tue, Dec 01, 2015 at 22:39:36 +, Jack Tucker wrote: > I then drop a MKV on the bat file which then copies the file, but windows say > it has an issue with codec.Error: "Windows Media Player cannot play the file. > The Player might not support the file type or might not support the codec > that was used to compress the file." Ah, so you have an issue with windows, not with ffmpeg. ;-) (Actually Windows Media Player.) WMP has quite a few restrictions as to what it can play back, one of them is pixel formats. Your file has yuv420p10le, which is quite special (being 10 bits depth per channel). My guess would be that WMP can't handle this material (nor the more common yuv444p or such, if you happen to run across them). Try transcoding instead of copying one of those files, and specifying "-pix_fmt yuv420p" (if ffmpeg doesn't do that for you, e.g. because it wasn't compiled to handle 10 bit H.264). If that works in WMP, you have no choice but to recode those offending files with this option (and to continue to copy those where it happens to work). Cheers, Moritz ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Re: [FFmpeg-user] MKV to MP4
Hi Jack, You can download some free codecs which allow Windows Media Player to play 10-bit H.264. Just google that. Alternatively, change your command from “-vcodec copy” to “-pix_fmt yuv420p -vcodec libx264”, but this will result in some loss of quality and a much slower encode (because you are re-encoding at 8-bit instead of simply remuxing). ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Re: [FFmpeg-user] MKV to MP4
3087 NUMBER_OF_BYTES : 5399135394 NUMBER_OF_BYTES-eng: 5399135394 _STATISTICS_WRITING_APP: mkvmerge v8.3.0 ('Over the Horizon') 64bit _STATISTICS_WRITING_APP-eng: mkvmerge v8.3.0 ('Over the Horizon') 64bit _STATISTICS_WRITING_DATE_UTC: 2015-10-29 04:19:54 _STATISTICS_WRITING_DATE_UTC-eng: 2015-10-29 04:19:54 _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTESStream #0:1(eng): Audio: ac3 ([165][0][0][0] / 0x00A5), 48000 Hz, stereo, 640kb/s (default)Metadata: BPS : 64 BPS-eng : 64 DURATION: 00:22:58.65600 DURATION-eng: 00:22:58.65600 NUMBER_OF_FRAMES: 43083 NUMBER_OF_FRAMES-eng: 43083 NUMBER_OF_BYTES : 110292480 NUMBER_OF_BYTES-eng: 110292480 _STATISTICS_WRITING_APP: mkvmerge v8.3.0 ('Over the Horizon') 64bit _STATISTICS_WRITING_APP-eng: mkvmerge v8.3.0 ('Over the Horizon') 64bit _STATISTICS_WRITING_DATE_UTC: 2015-10-29 04:19:54 _STATISTICS_WRITING_DATE_UTC-eng: 2015-10-29 04:19:54 _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTESStream mapping: Stream #0:0 -> #0:0 (copy) Stream #0:1 -> #0:1 (copy)Press [q] to stop, [?] for helpframe= 302 fps=0.0 q=-1.0 size= 20462kB time=00:00:12.57 bitrate=13328.6kbits/sframe= 463 fps=454 q=-1.0 size= 37435kB time=00:00:19.39 bitrate=15814.1kbits/s > Date: Tue, 1 Dec 2015 18:31:36 +0100 > From: barsn...@gmx.net > To: ffmpeg-user@ffmpeg.org > Subject: Re: [FFmpeg-user] MKV to MP4 > > On Tue, Dec 01, 2015 at 03:09:42 +, Jack Tucker wrote: > > I am trying to convert a MKV into m4p using Windows, every time I do it has > > issues with codec. Which line of code canI I use which will work? > > I have tried for %%a in ("*.mkv") do ffmpeg.exe -i "%%a" -vcodec copy > > -acodec copy "%%~na .mp4" > > but no luck and ffmpeg -i input.mkv -c:v copy -c:a copy output.mp4, again, > > no luck > > Hi Jack, > "no luck" is a very short error description. Please show us a (real, > complete) command line and the full, uncut console output. > > Please realize that ffmpeg's console output contains a lot of useful > information, and it should even tell us what was going wrong. There's > no general answer to your question, as it depends on a few things. > > Moritz > ___ > ffmpeg-user mailing list > ffmpeg-user@ffmpeg.org > http://ffmpeg.org/mailman/listinfo/ffmpeg-user ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Re: [FFmpeg-user] MKV to MP4
On Tue, Dec 01, 2015 at 03:09:42 +, Jack Tucker wrote: > I am trying to convert a MKV into m4p using Windows, every time I do it has > issues with codec. Which line of code canI I use which will work? > I have tried for %%a in ("*.mkv") do ffmpeg.exe -i "%%a" -vcodec copy -acodec > copy "%%~na .mp4" > but no luck and ffmpeg -i input.mkv -c:v copy -c:a copy output.mp4, again, no > luck Hi Jack, "no luck" is a very short error description. Please show us a (real, complete) command line and the full, uncut console output. Please realize that ffmpeg's console output contains a lot of useful information, and it should even tell us what was going wrong. There's no general answer to your question, as it depends on a few things. Moritz ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user