MCPcopy Create free account
hub / github.com/byhook/ffmpeg4android / new_subtitle_stream

Function new_subtitle_stream

ffmpeg-single-cmd/src/main/cpp/ffmpeg_opt.c:1818–1843  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1816}
1817
1818static OutputStream *new_subtitle_stream(OptionsContext *o, AVFormatContext *oc, int source_index)
1819{
1820 AVStream *st;
1821 OutputStream *ost;
1822 AVCodecContext *subtitle_enc;
1823
1824 ost = new_output_stream(o, oc, AVMEDIA_TYPE_SUBTITLE, source_index);
1825 st = ost->st;
1826 subtitle_enc = ost->enc_ctx;
1827
1828 subtitle_enc->codec_type = AVMEDIA_TYPE_SUBTITLE;
1829
1830 MATCH_PER_STREAM_OPT(copy_initial_nonkeyframes, i, ost->copy_initial_nonkeyframes, oc, st);
1831
1832 if (!ost->stream_copy) {
1833 char *frame_size = NULL;
1834
1835 MATCH_PER_STREAM_OPT(frame_sizes, str, frame_size, oc, st);
1836 if (frame_size && av_parse_video_size(&subtitle_enc->width, &subtitle_enc->height, frame_size) < 0) {
1837 av_log(NULL, AV_LOG_FATAL, "Invalid frame size: %s.\n", frame_size);
1838 exit_program(1);
1839 }
1840 }
1841
1842 return ost;
1843}
1844
1845/* arg format is "output-stream-index:streamid-value". */
1846static int opt_streamid(void *optctx, const char *opt, const char *arg)

Callers 1

open_output_fileFunction · 0.85

Calls 2

new_output_streamFunction · 0.85
exit_programFunction · 0.85

Tested by

no test coverage detected