• Content count

  • Joined

  • Last visited

Community Reputation

102 Neutral

About arthur__

  • Rank
  1. Because the video is made by an acquisition card which records video like that. In vlc console, the differents PID are seen but not read : [color=#333333]pid list:[/color] [color=#333333]ts debug: [/color] [color=#333333]- pid[0] seen[/color] [color=#333333]ts debug: [/color] [color=#333333]- pid[16] seen[/color] [color=#333333]ts debug: [/color] [color=#333333]- pid[33] seen[/color] [color=#333333]ts debug: [/color] [color=#333333]- pid[49] seen[/color]
  2. The source video is recorded in special filesystem I cannot read directly. But i've a program which read this filesystem and give me data then I both save this data in a file and decode with ffmpeg as a datastream. So if I try ffprobe on the file saved, the result is the same : one video stream and one audio stream :s And I can certify that the data read from filesystem is right.
  3. Hi, I'm actually playing a MPEG video in C++ using ffmpeg. However, there is several video stream. In my test video there is 4 videos streams with ids : 0, 16, 33, 49 and no audio stream. But formatContext->streams[i] give me only 2 streams : a video stream with PID 33 and an audio stream with PID 49 whereas there should be 4 videos streams ! It's the same with VLC (in the console we can see the 4 pids but there is only one video stream and one audio stream). I'm sure my video contains 4 videos streams identified by these PID. I don't find how to get them with ffmpeg. Is somebody have any idea ?
  4. Problem solved ! I compiled with ffmpeg static library and it works !
  5. Thanks for your reply; I want to read from stream (in a char *buffer), but as it not work I changed my buffer by reading directly the file, that's why I use [color=#000000][size=2][left]av_open_input_stream. [/left][/size][/color]I have already tried to open my file with av_open_input_file and it's work, but it's not my goal here.
  6. Hello, I try to read a mpeg2 video from a stream with ffmpeg library. In my first tests, I tried to read from a byte buffer, but now I read directly from a file (in my ReadPacket function) in order to be sure it's right data. I tried many way to do that, but av_open_input_stream function return always -1. I post my code here and hope someone could help me ! If someone have a full code to do that, i''ll be happy to see it. Thanks. [code]av_log_set_level(AV_LOG_VERBOSE); avcodec_init(); av_register_all(); avcodec_register_all(); pFormatCtx = avformat_alloc_context(); if (!pFormatCtx) { return -1; } FILE* f = fopen("D:\\projets\\test_data\\video\\video_ts.mpg", "rb"); int bioBufferSize = 8000; unsigned char *bioBuffer = (unsigned char *)av_malloc(bioBufferSize + FF_INPUT_BUFFER_PADDING_SIZE); ByteIOContext *bioContext = new ByteIOContext(); int ret = init_put_byte(bioContext, bioBuffer, bioBufferSize, 0, (void *)f, readPackets, NULL, seekPackets); AVFormatParameters params, *ap = &params; memset(ap, 0, sizeof(*ap)); ap->prealloced_context = 1 //pFormatCtx->video_codec_id = findCodecOrDie("mpeg2video", AVMEDIA_TYPE_VIDEO, 0, avcodecOpts[AVMEDIA_TYPE_VIDEO]->strict_std_compliance); //pFormatCtx->flags |= AVFMT_FLAG_NONBLOCK; AVInputFormat *inputFormat = av_find_input_format("mpegts"); //pFormatCtx->iformat = inputFormat; ret = av_open_input_stream(&pFormatCtx, bioContext, "stream", inputFormat, ap); av_close_input_stream(pFormatCtx); av_free(bioBuffer); delete bioContext; fclose(f); [...] [/code] And my readPacket func : [code] static int readPackets(void *opaque, uint8_t *buf, int buf_size) { FILE* f = (FILE *)opaque; int read = fread(buf, 1, buf_size, f); return read; } [/code]
  7. Hello, I have a C++ DLL which uses ffmepg to read a video. When it gets a picture, I transmit AVFrame (and put it to RGB24 format with sws_scale) to C# code thanks to a callback. I try to display this picture with DirectX (Texture texture = Texture.FromMemory(..) ). When I convert the AVFrame to bmp, it's working but the image loses alpha canal. I would like use directly AVFrame->data[0] but DirectX do not know how manage it ! Is someone knowning how to display an AVFrame in DirectX ? I would like to display keyframe and the others frame.