I used 'av_read_frame'; To my information, it's not deprecated.
Have no idea how to read/write in ffmpeg without those functioms.
You can customize your io, using 'init_put_byte' to set your custom io
routine instead of default callback, here's outline
struct NALMsg {
uint8_t* data;
int size;
char header;
NalMsg* next;
}
int my_read(void* opaq, uint8_t* buf, int size)
{
NalMsg msg;
... parse buffer 'buf' into list of NAL units in NALMsg
return size;
}
main()
{
...
ByteIOContext ByteIOCtx;
init_put_byte(&ByteIOCtx, pDataBuffer, lSize, 0, this, &my_read, NULL, NULL);
...
}
av_read_frame will call your 'my_read' function to "do your thing"
Let me know if you find other methods.
On Tue, Jan 27, 2009 at 12:41 PM, Sven Alisch <[email protected]> wrote:
> Hello Victor,
>
> Sorry, I can thank you only today again, because I was ill. Anyway, in your
> proposal
>
>> You should read AVPackets from ffmpeg into the circular buffer and parse
>> them into NAL units. You can hack H264Parser to do it but it faster to
>> use existing solution if you are in rush, if I've done it once and it
>> worked.
>
> do you mean to use the the av_read_packet() - Function? And if yes, could it
> be, that this function will be deleted in the future (she is marked as
> deprecated)? Therefore I did not wanted to use this function but your idea is
> totally useful and logical. Thank you.
>
> Then my last question is, if I want to mux h.264 content from a
> transportstream into a new mkv or anything else containerformat with your
> solution, is it possible to do that with ffmpeg without using av_read_frame()
> and av_write_frame()? Or is it possible to put NAL-packets (stored in a
> separate buffer) into a new AVPacket-structure (with AVPacket.data-Pointer)
> and give it then to av_write_frame()?
>
> regards,
> Sven
> _______________________________________________
> libav-user mailing list
> [email protected]
> https://lists.mplayerhq.hu/mailman/listinfo/libav-user
>
_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user