Hi all.
That's me again with an app capturing the MPEG2 transport stream from a DVB-S
card and storing its parts in a file on disk.
This application is intended to work under Windows, and is using the API, which
is provided by the manufacturers of the hardware (Linear Systems, you,
probably, know).
More details about my task are here.
http://article.gmane.org/gmane.comp.video.ffmpeg.libav.user/218
I write in C++.
Since I am going to run several threads, saving different programs, I could not
develop new URLProtocol and use it (I need several URLContexts...).
Anyway, I tried defining my own ByteIOContext.
int linsys_read(void *opaque, uint8_t *buf, int buf_size)
{
video_saverF *vsf=(video_saverF *)opaque; /*a class,
receiving data from another class, which receives them from hardware*/
return vsf->read_packet(buf,buf_size); // this is a class member
}
then, in constructor:
input = av_alloc_format_context();
input->iformat = av_find_input_format("mpegts");
bio_buffer=188; //for one packet;
bio_buffer=new unsigned char [bio_buffer_size];
input->pb=av_alloc_put_byte(bio_buffer,bio_buffer_size,
0,this,linsys_read,NULL,NULL);
input->flags|=AVFMT_NOFILE;
and then, in run() member:
int r=av_open_input_stream(&input,input->pb,"linsys",input->iformat,NULL);
r=av_find_stream_info(input);
The problem:
av_find_stream_info returns -1 and doesn't try to read any data from the stream.
I have set breakpoints on linsys_read, it is not called.
The function linsys_read is called from av_open_input_stream several times, and
av_open_input_stream gets about 1.5 kbytes of data.
I also tried "mpegtsraw" instead of "mpegts", it zeroes my input variable and
returns -1;
And another problem.
How should I specify to libav*, which elementary PIDs to store?
Thanks
Vladimir.
_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user