Discussion:
[FFmpeg-user] Unwanted <font> tags in srt
David Nguyen
2015-12-16 09:18:24 UTC
Permalink
Hi,

I have recently updated ffmpeg to use the latest version 2.8.3 and when
extracting subtitles from an MP4, I get new <font> tags which I would like
to remove. Is it possible to somehow not get them ?

Here's an example:

---------------------------------------------------------------------------------------------------------------
$ cat foo.srt
1
00:00:00,000 --> 00:00:00,000
Mary has a little

2
00:00:00,038 --> 00:00:00,038
lamb.

$ ffmpeg -i audio.mp3 -i foo.srt -c:s mov_text -c:a copy output.mp4
...

$ ffmpeg -i output.mp4 -vn -an -codec:s:0.1 srt foo_extracted.srt
...

$ cat foo_extracted.srt
1
00:00:00,000 --> 00:00:00,000
<font face="Serif" size="18">Mary has a little</font>

2
00:00:00,038 --> 00:00:00,038
<font face="Serif" size="18">lamb.</font>

---------------------------------------------------------------------------------------------------------------

Thank you,

David
yzf.zisun
2015-12-16 10:22:36 UTC
Permalink
You can use notpad++ find and replace use a regexp.

<[^>]*>
Post by David Nguyen
Hi,
I have recently updated ffmpeg to use the latest version 2.8.3 and when
extracting subtitles from an MP4, I get new <font> tags which I would like
to remove. Is it possible to somehow not get them ?
---------------------------------------------------------------------------------------------------------------
$ cat foo.srt
1
00:00:00,000 --> 00:00:00,000
Mary has a little
2
00:00:00,038 --> 00:00:00,038
lamb.
$ ffmpeg -i audio.mp3 -i foo.srt -c:s mov_text -c:a copy output.mp4
...
$ ffmpeg -i output.mp4 -vn -an -codec:s:0.1 srt foo_extracted.srt
...
$ cat foo_extracted.srt
1
00:00:00,000 --> 00:00:00,000
<font face="Serif" size="18">Mary has a little</font>
2
00:00:00,038 --> 00:00:00,038
<font face="Serif" size="18">lamb.</font>
---------------------------------------------------------------------------------------------------------------
Thank you,
David
_______________________________________________
ffmpeg-user mailing list
http://ffmpeg.org/mailman/listinfo/ffmpeg-user
David Nguyen
2015-12-16 20:23:15 UTC
Permalink
Good one :p
No but seriously, as in the previous versions there were no style tags,
this is breaking my use case :(
Does ffmpeg provide a way to disable them ?
Post by yzf.zisun
You can use notpad++ find and replace use a regexp.
<[^>]*>
Post by David Nguyen
Hi,
I have recently updated ffmpeg to use the latest version 2.8.3 and when
extracting subtitles from an MP4, I get new <font> tags which I would like
to remove. Is it possible to somehow not get them ?
---------------------------------------------------------------------------------------------------------------
$ cat foo.srt
1
00:00:00,000 --> 00:00:00,000
Mary has a little
2
00:00:00,038 --> 00:00:00,038
lamb.
$ ffmpeg -i audio.mp3 -i foo.srt -c:s mov_text -c:a copy output.mp4
...
$ ffmpeg -i output.mp4 -vn -an -codec:s:0.1 srt foo_extracted.srt
...
$ cat foo_extracted.srt
1
00:00:00,000 --> 00:00:00,000
<font face="Serif" size="18">Mary has a little</font>
2
00:00:00,038 --> 00:00:00,038
<font face="Serif" size="18">lamb.</font>
---------------------------------------------------------------------------------------------------------------
Thank you,
David
_______________________________________________
ffmpeg-user mailing list
http://ffmpeg.org/mailman/listinfo/ffmpeg-user
_______________________________________________
ffmpeg-user mailing list
http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Paul B Mahol
2015-12-16 21:36:53 UTC
Permalink
Post by David Nguyen
Good one :p
No but seriously, as in the previous versions there were no style tags,
this is breaking my use case :(
Does ffmpeg provide a way to disable them ?
Nope.
Clément Bœsch
2015-12-17 11:32:43 UTC
Permalink
Post by David Nguyen
Hi,
Hi,
Post by David Nguyen
I have recently updated ffmpeg to use the latest version 2.8.3 and when
extracting subtitles from an MP4, I get new <font> tags which I would like
to remove. Is it possible to somehow not get them ?
[...]
Post by David Nguyen
$ ffmpeg -i output.mp4 -vn -an -codec:s:0.1 srt foo_extracted.srt
After the patch @
http://ffmpeg.org/pipermail/ffmpeg-devel/2015-December/185325.html

you will be able to do sth like:

ffmpeg -i in.mp4 -c:s text out.srt

...and get the subtitles without markup.

[...]

Regards,
--
Clément B.
Clément Bœsch
2015-12-21 10:21:49 UTC
Permalink
Post by Clément Bœsch
Post by David Nguyen
Hi,
Hi,
Post by David Nguyen
I have recently updated ffmpeg to use the latest version 2.8.3 and when
extracting subtitles from an MP4, I get new <font> tags which I would like
to remove. Is it possible to somehow not get them ?
[...]
Post by David Nguyen
$ ffmpeg -i output.mp4 -vn -an -codec:s:0.1 srt foo_extracted.srt
http://ffmpeg.org/pipermail/ffmpeg-devel/2015-December/185325.html
ffmpeg -i in.mp4 -c:s text out.srt
...and get the subtitles without markup.
Patch applied, you can now do that using git/master

Regards,
--
Clément B.
Loading...