<html><head><meta http-equiv="content-type" content="text/html; charset=us-ascii"></head><body style="overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;">Hi, <div>I am attempting to do custom IO to demux rtp packets from an external source.</div><div>The documentation for <b>AVIOContext* AVFormatContext::pb </b>states</div><div><br></div><div>> <span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);">demuxing: either set by the user before </span><a class="el" href="https://ffmpeg.org/doxygen/4.3/group__lavf__decoding.html#gaff468dcc45289542f4c30d311bc2a201" title="Open an input stream and read the header." style="caret-color: rgb(0, 0, 0);">avformat_open_input()</a><span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);"> </span><span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);">(then the user must close it manually) or set by</span><span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);"> </span><a class="el" href="https://ffmpeg.org/doxygen/4.3/group__lavf__decoding.html#gaff468dcc45289542f4c30d311bc2a201" title="Open an input stream and read the header." style="caret-color: rgb(0, 0, 0);">avformat_open_input()</a><span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);">.</span></div><div><span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);"><br></span></div><div><span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);">So, I am setting the pb field before opening the input</span></div><div><span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);"><br></span></div><div><font color="#000000"><span style="caret-color: rgb(0, 0, 0);">```</span></font></div><div><div>  constexpr int bufsize = 4096;</div><div>  readbuf_ = (uint8_t *)av_malloc(bufsize);</div><div>  avio_ctx_ =</div><div>      avio_alloc_context(readbuf_, bufsize, 1, this, &read_packet, NULL, NULL);</div><div>  fmt_ctx_->pb = avio_ctx_;</div></div><div><br></div><div><div>  const std::string sdp_url =</div><div>      "data:text/plain;charset=UTF-8," + make_video_sdp(CodecID::H264);</div><div>  const int success = avformat_open_input(&fmt_ctx_, sdp_url.c_str(),</div><div>                                          file_iformat, &format_opts);</div></div><div>```</div><div><br></div><div>Which then calls my read_callback() while trying to read some kind of id3 information. At that point, i cannot produce any packets yet, and nothing that would have id3 data, so I am confused why this happens. The function code in demux.c does this:</div><div><br></div><div>```</div><div><div>    if (s->pb)</div><div>        ff_id3v2_read_dict(s->pb, &si->id3v2_meta, ID3v2_DEFAULT_MAGIC, &id3v2_extra_meta);</div></div><div>```</div><div><br></div><div>so the presence of an AVIOContext leads to the assumption that id3 information can be read?</div><div><br></div><div>Can i disable this somehow? The only way i have found is to go against the documentation: first call avformat_open_input, then delete the pb field and replace it with my context.</div><div><br></div><div>Thanks,</div><div>Rasmus</div><div><br></div><div><br></div></body></html>