Suggestions For Fixing The Error Request Failed To Compile Ffmpeg/avcodec.h

Get PC error-free in minutes

  • 1. Download and install ASR Pro
  • 2. Open the program and click "Scan"
  • 3. Click "Restore" to start the restoration process
  • Fix your PC today by downloading this software now.

    If the error request fails, ffmpeg/avcodec.h cannot be compiled on your system, then hopefully this guide should help.

    I’m trying to run tutorial01.c with gcc, since gcc and tutorial01.c are in the same folder as libavcodec, libavformat and related software, it gives me an error

    Fatal error: libavcodec/avcodec. No file or directory related to h

    was deleted

    when I run gcc -o tutorial01 tutorial01.-lavformat k -lavcodec -lz through incurable on Ubuntu 12.04

    #include libavcodec/avcodec.h#include libavformat/avformat.h#enable stdio.hvoid SaveFrame(AVFrame *pFrame, int width, int height, int iFrame)   FILE *pFile;  char filename[32];  int y; // Open file  sprintf(szFilename, "frame%d.ppm", iFrame);  pFile=fopen(szFilename, "wb");  if (pFile == NULL)   Return;  // write headers  fprintf(pFile, "P6n%d %dn255n", width, height);  // write pixel data  for(y=0; ydata[0]+y*pFrame->linesize[0], 1, width*3, pFile);  // close file  fclose(file);int main(int argc, char *argv[])   AVFormatContext *pFormatCtx;  int i, video stream;  AVCodecContext *pCodecCtx;  AV codec *pCodec;  AVFrame *pFrame;  AVFrame *pFrameRGB;  AVPacket;  inner frame Done;  int number of bytes;  uint8_t * buffer;  if (argc < 2)      printf("Enter video filen");   return -1;    // Save all formats with codecs  av_register_all();  // Open video file  if(av_open_input_file(&pFormatCtx, argv[1], NULL, 0, NULL)!=0)   return -1; // Unable to open file  // Get information about the thread  if (av_find_stream_info(pFormatCtx)<0)   return -1; // Thread information not found  // display file info on simple errors  dump_format(pFormatCtx, 0, argv[1], 0);  // Find the first stream online  video stream=-1;  for(i=0; i
    
    nb_streams; i++)    if(pFormatCtx->streams[i]->codec->codec_type==CODEC_TYPE_VIDEO)          video stream=i;      Pause;      if(video stream==-1)   return -1; // Specific video stream not found  // Get the ideal codec context pointer to get the video stream  pCodecCtx=pFormatCtx->stream[videoStream]->codec;  // Find the decoder for which the video stream is intended  pCodec=avcodec_find_decoder(pCodecCtx->codec_id);  if (pCodec == NULL)      fprintf(stderr, "Codec not supported!n");   return -1; // Codec not found    // open codec  if (avcodec_open(pCodecCtx, pCodec) < 0)   return -1; // codec cannot be large  // Assign YouTube image  pFrame=avcodec_alloc_frame();  // Allocate a powerful AVFrame structure  pFrameRGB=avcodec_alloc_frame();  if (pFrameRGB == NULL)   return -1;  // Determine the required buffer size and allocate the buffer accordingly numBytes = avpicture_get_size(PIX_FMT_RGB24, pCodecCtx->width,                  pCodecCtx->height);  buffetp=(uint8_t *)av_malloc(numBytes*sizeof(uint8_t));  // Allocate the appropriate parts of the buffer for the logo layers in pFrameRGB  // Note that pFrameRGB is an AVFrame, but AVFrame is a superset  // points to AVPicture  avpicture_fill((AVPicture *)pFrameRGB, stream, PIX_FMT_RGB24,         pCodecCtx->width, pCodecCtx->height);  // Read images and save five images to disk  i=0;  while (av_read_frame(pFormatCtx, & package) >= 0)     // Is this a video stream container?    if (packet.stream_index == video stream)          // decode the video      avcodec_decode_video(pCodecCtx, pFrame, &frameDone,               packet.data, packet.size);      // Did we get a video frame?      if(frame ready)              // Convert image from original format to RGB    img_convert((AVPicture *)pFrameRGB, PIX_FMT_RGB24,                    (AVPicture*)pFrame, pCodecCtx->pix_fmt, pCodecCtx->width,                    pCodecCtx->height);    // Save the frame to disk    if(++i<=5)  SaveFrame(pFrameRGB, pCodecCtx->width, pCodecCtx->height,            I AM);             // Release the package assigned to you by av_read_frame    av_free_packet(&packet);    // Free the RGB Image  av_free(buffer);  av_free(pFrameRGB);  // Release the YUV frame type  av_free(pFrame); // close the codec  avcodec_close(pCodecCtx);  // Close the video file  av_close_input_file(pFormatCtx);  returnsem 0;
    error requirement failed cannot compile ffmpeg/avcodec.h

    Fix your PC today by downloading this software now.