Re: [FFmpeg-user] MKV to MP4 subtitle issue

2023-01-17 Thread Moritz Barsnick
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

2023-01-17 Thread pehache

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

2023-01-16 Thread Moritz Barsnick
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

2023-01-10 Thread Steve Zemlicka
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".