Hi, 
I am attempting to do custom IO to demux rtp packets from an external source.
The documentation for AVIOContext* AVFormatContext::pb states

> demuxing: either set by the user before avformat_open_input() 
> <https://ffmpeg.org/doxygen/4.3/group__lavf__decoding.html#gaff468dcc45289542f4c30d311bc2a201>
>  (then the user must close it manually) or set by avformat_open_input() 
> <https://ffmpeg.org/doxygen/4.3/group__lavf__decoding.html#gaff468dcc45289542f4c30d311bc2a201>.

So, I am setting the pb field before opening the input

```
  constexpr int bufsize = 4096;
  readbuf_ = (uint8_t *)av_malloc(bufsize);
  avio_ctx_ =
      avio_alloc_context(readbuf_, bufsize, 1, this, &read_packet, NULL, NULL);
  fmt_ctx_->pb = avio_ctx_;

  const std::string sdp_url =
      "data:text/plain;charset=UTF-8," + make_video_sdp(CodecID::H264);
  const int success = avformat_open_input(&fmt_ctx_, sdp_url.c_str(),
                                          file_iformat, &format_opts);
```

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:

```
    if (s->pb)
        ff_id3v2_read_dict(s->pb, &si->id3v2_meta, ID3v2_DEFAULT_MAGIC, 
&id3v2_extra_meta);
```

so the presence of an AVIOContext leads to the assumption that id3 information 
can be read?

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.

Thanks,
Rasmus


_______________________________________________
Libav-user mailing list
[email protected]
https://ffmpeg.org/mailman/listinfo/libav-user

To unsubscribe, visit link above, or email
[email protected] with subject "unsubscribe".

Reply via email to