private void RenderFile() { FFmpeg.AVFormatContext context = pFormatCtx.Handle; for (int index = 0; index < context.nb_streams; index++) { NativeWrapper<FFmpeg.AVStream> stream = new NativeWrapper<FFmpeg.AVStream>(context.streams[index]); NativeWrapper<FFmpeg.AVCodecContext> codec = new NativeWrapper<FFmpeg.AVCodecContext>(stream.Handle.codec); FFmpeg.AVCodecContext codecContext = codec.Handle; if (codecContext.codec_type == FFmpeg.CodecType.CODEC_TYPE_AUDIO) { audioDecoder = new AvDecoder(stream, codec, index); } else if (codecContext.codec_type == FFmpeg.CodecType.CODEC_TYPE_VIDEO) { videoDecoder = new AvDecoder(stream, codec, index); } } fileReader = new FileReader(pFormatCtx); demux = new Demux(pFormatCtx); audioRender = new AudioRender(); videoRender = new VideoRender(); //connect pipe fileReader.ConnectTo(demux); demux.ConnectTo(audioDecoder); demux.ConnectTo(videoDecoder); audioDecoder.ConnectTo(audioRender); videoDecoder.ConnectTo(videoRender); }
private void GeneratePipesFromFile(string fileName) { audioDecoder = new AvDecoder(AVFrameType.Audio); videoDecoder = new AvDecoder(AVFrameType.Video); reader = new FileReader(ffmpegBase, fileName); demux = new Demux(); }