Hello Everyone!
I am trying to add some text, being a stream, into an MKV file which has encoded video and audio data already. Because of some reasons, storing the text to an isolated file is not acceptable. The problem I encountered was the times of subtitles were incorrect like below. [Original] 1 00:00:00,000 --> 00:00:00,999 2014-07-01 11:59:28 2 00:00:01,000 --> 00:00:01,999 2014-07-01 11:59:29 [Encoded] 1 00:02:11,072 --> 00:02:12,071 2014-07-01 11:59:28 2 00:02:12,072 --> 00:02:13,071 2014-07-01 11:59:29 My approach is following. 1. Create 3 streams: video, audio and subtitle with code AV_CODEC_ID_SUBRIP and add to the target MKV file. 2. Encode all video and audio data. 3. Create a temporary SRT file and store all text in it. 4. Read a packet from SRT file (av_read_frame) -> decode (avcodec_decode_subtitle2) -> encode (avcodec_encode_subtitle) -> write to MKV file (av_interleaved_write_frame). I have been sure the time_base fields of the input and output streams were the same; and also for the pts, dts and duration ones of the input and output packets. Any advice would be greatly appreciated.
_______________________________________________ Libav-user mailing list [email protected] http://ffmpeg.org/mailman/listinfo/libav-user
