[FFmpeg-trac] #6947(undetermined:new): Unwanted visual formatting added when embedding subtitles
FFmpeg
trac at avcodec.org
Sun Mar 17 16:45:24 EET 2019
#6947: Unwanted visual formatting added when embedding subtitles
-------------------------------------+-------------------------------------
Reporter: forthrin | Owner:
Type: defect | Status: new
Priority: normal | Component:
| undetermined
Version: unspecified | Resolution:
Keywords: mov_text | Blocked By:
Blocking: | Reproduced by developer: 0
Analyzed by developer: 0 |
-------------------------------------+-------------------------------------
Comment (by forthrin):
Something like this, then. I'm not on the mailing list, but here it is
anyway.
{{{
diff --git a/libavcodec/movtextenc.c b/libavcodec/movtextenc.c
index c19ef384b..3165776f8 100644
--- a/libavcodec/movtextenc.c
+++ b/libavcodec/movtextenc.c
@@ -176,3 +176,3 @@ static av_cold int mov_text_encode_init(AVCodecContext
*avctx)
0x00, // uint8_t face-style-flags
- 0x12, // uint8_t font-size
+ ASS_DEFAULT_FONT_SIZE, // uint8_t font-size
0xFF, 0xFF, 0xFF, 0xFF, // uint8_t text-color-rgba[4]
@@ -185,4 +185,4 @@ static av_cold int mov_text_encode_init(AVCodecContext
*avctx)
0x00, 0x01, // uint16_t font-ID
- 0x05, // uint8_t font-name-length
- 'S', 'e', 'r', 'i', 'f',// uint8_t font[font-name-length]
+ // 0x05, // uint8_t font-name-length
+ // 'S', 'e', 'r', 'i', 'f',// uint8_t font[font-name-length]
// };
@@ -194,3 +194,3 @@ static av_cold int mov_text_encode_init(AVCodecContext
*avctx)
- avctx->extradata_size = sizeof text_sample_entry;
+ avctx->extradata_size = sizeof(text_sample_entry) + 1 +
sizeof(ASS_DEFAULT_FONT)-1;
avctx->extradata = av_mallocz(avctx->extradata_size +
AV_INPUT_BUFFER_PADDING_SIZE);
@@ -201,3 +201,6 @@ static av_cold int mov_text_encode_init(AVCodecContext
*avctx)
- memcpy(avctx->extradata, text_sample_entry, avctx->extradata_size);
+ int i = sizeof(text_sample_entry);
+ memcpy(avctx->extradata, text_sample_entry, i);
+ avctx->extradata[i++] = sizeof(ASS_DEFAULT_FONT)-1;
+ memcpy(avctx->extradata+i, ASS_DEFAULT_FONT,
sizeof(ASS_DEFAULT_FONT)-1);
}}}
--
Ticket URL: <https://trac.ffmpeg.org/ticket/6947#comment:9>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list