I have the following code:
av_register_all(); pFormatCtx = avformat_alloc_context(); const char* input = "pipe:"; AVInputFormat* iFormat = av_find_input_format("mpegts"); if ( avformat_open_input(&pFormatCtx, input, iFormat, NULL) != 0 ) return -1; int res = av_find_stream_info(pFormatCtx);
when my input is a regular file, this works well, and pFormatCtx is populated with threads in the file. However, when I set the input to "pipe:", av_find_stream_info returns with -1.
I use the same file and share it by running cat mpeg.ts | myApp cat mpeg.ts | myApp
Any ideas?
Thanks Aliza
source share