libavformat

how to change stream index in libavformat

最后都变了- 提交于 2021-02-18 12:44:05
问题 I'm a newbie in ffmpeg. I have a problem when some media has multiple audio streams. Suppose in MKV file, it has three audio streams (MP3, WMA and WMAPro) How do I change the stream index when demuxing using: AVPacket inputPacket; ret = av_read_frame(avInputFmtCtx, &inputPacket) So I'm searching something like change_stream_index(int streamindex), and when I call that function (suppose change_stream_index(2)), the next call to av_read_frame will demux WMAPro frame instead of MP3. Thanks guys!

How can I determine if a codec / container combination is compatible with FFmpeg?

我的梦境 提交于 2020-12-26 04:04:48
问题 I'm looking at re-muxing some containers holding audio and video such that I extract the best, first audio stream, and store it in a new container where e.g. only the audio stream is present. The output context for FFmpeg is created like so: AVFormatContext* output_context = NULL; avformat_alloc_output_context2( &output_context, NULL, "mp4", NULL ); I have a shortlist of acceptable outputs, e.g. MP4, M4A, etc … essentially those that are readable by Apple's Audio File Services:

FMP4 moof box sequence number ordering

*爱你&永不变心* 提交于 2020-03-25 18:04:10
问题 I wanted to do a basic fragmented mp4 broadcast program with avformat libs and HTML5 video and MSE. This is a live stream and I use avformat to copy h264 data to mp4 fragments. Here is my basic drawing of clients attaching to the stream: So, with words: C1J: First Client joins: avformat process starts ftyp, moov, moof, mdat boxes will be served to Client1 ftyp and moov atoms are both saved for later reuse C2J: Second Client joins (later in time): avformat process is ongoing (because it is

FMP4 moof box sequence number ordering

丶灬走出姿态 提交于 2020-03-25 18:02:12
问题 I wanted to do a basic fragmented mp4 broadcast program with avformat libs and HTML5 video and MSE. This is a live stream and I use avformat to copy h264 data to mp4 fragments. Here is my basic drawing of clients attaching to the stream: So, with words: C1J: First Client joins: avformat process starts ftyp, moov, moof, mdat boxes will be served to Client1 ftyp and moov atoms are both saved for later reuse C2J: Second Client joins (later in time): avformat process is ongoing (because it is

Get TS packets into buffer from libavformat

北城以北 提交于 2020-01-06 05:49:05
问题 I would like to capture video, compress it and mux it as an mpeg2 ts. All of this is quite simple with the ffmpeg libraries, but what I would like to do, instead of writing it to a file, is capture the ts packets in a buffer and using this stream in other ways. Is there a simple way to do this? To write the encoded frames to file right now, I use av_interleaved_write_frame(oc, &pkt). OC is an output context with a filename and format defined. pkt is an AVPacket containing the compressed frame