Newest 'ffmpeg' Questions - Stack Overflow

http://stackoverflow.com/questions/tagged/ffmpeg

Les articles publiés sur le site

  • Possible bug in OpenCV2.4 capturing frames from video

    23 septembre 2013, par Jav_Rock

    Could it be that there is a bug in OpenCV2.4 highgui for capturing frames from video in windows?

    I installed both the precompiled libraries, the ones compiled by me, I can compile everything perfectly and I can run my programs if

    they are image based. The problem is only for videos. OpenCV crashes in this function always:

     virtual IplImage* retrieveFrame(int)
        {
            unsigned char* data = 0;
            int step=0, width=0, height=0, cn=0;
    
            if(!ffmpegCapture ||
               !icvRetrieveFrame_FFMPEG_p(ffmpegCapture,&data,&step,&width,&height,&cn)) <-------CRASHES HERE
               return 0;
            cvInitImageHeader(&frame, cvSize(width, height), 8, cn);
            cvSetData(&frame, data, step);
            return &frame;
        }
    

    This is inside the class cap_ffmpeg.cpp and is called by VideoCapture.

    I tried versions 2.4.2 and 2.4.9. My programes were working finde with opencv2


    More information

    • Windows 7

    • Build the projects with cmake (important as it could be that cmake is not building/finding the right codecs)

    • VisualStudio 9 2008

    • OpenCV 2.4.2

    EDIT

    It looks like it is actually a bug, so, how can I solve this problem and change my code to be able to read avi files?

  • Audio is not playing properly in ffmpeg player

    23 septembre 2013, par user1241903

    I need to create a player which will decrypt the input on-fly and play the content. I have choosen ffmpeg libs (libav*) to create player and to start I have followed this link

    but audio is not playing properly,video is playing fine. I am using ubuntu 12.04LTS 64bit OS with the following ffmpeg version,

    admin@vz-X401A1:~$ ffmpeg 
    ffmpeg version 2.0 Copyright (c) 2000-2013 the FFmpeg developers
      built on Sep 11 2013 13:46:26 with gcc 4.6 (Ubuntu/Linaro 4.6.3-1ubuntu5)
      configuration: --prefix=/home/admin/ffmpeg_build --extra-cflags=-I/home/admin/ffmpeg_build/include --extra-ldflags=-L/home/admin/ffmpeg_build/lib --bindir=/home/admin/bin --extra-libs=-ldl --enable-gpl --enable-libass --enable-libfdk-aac --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-nonfree --enable-x11grab
      libavutil      52. 43.100 / 52. 43.100
      libavcodec     55. 31.101 / 55. 31.101
      libavformat    55. 16.102 / 55. 16.102
      libavdevice    55.  3.100 / 55.  3.100
      libavfilter     3. 84.100 /  3. 84.100
      libswscale      2.  5.100 /  2.  5.100
      libswresample   0. 17.103 /  0. 17.103
      libpostproc    52.  3.100 / 52.  3.100
    Hyper fast Audio and Video encoder
    usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...
    
    Use -h to get full help or, even better, run 'man ffmpeg'
    admin@vz-X401A1:~$
    

    and downloaded tutorial07.c from this link

    still, with this also, sound is not playing properly.

    I need help to solve the following issues,

    1. How can I fix this audio issue(I have gone through similar question in StackOverflow and installed old ver. of ffmpeg, but issue still remains).

    2. And also suggest some steps or tutorial, how to implement on-fly decryption process (in C) and integrate this with the player.

  • Displaying an AVFrame on the screen with SDL 2.0

    22 septembre 2013, par jsp99

    I am working on some code with the help of this tutorial and using the latest development libraries of ffmpeg and SDL. I am stuck at the point where I have to display the decoded frame (AVFrame) on the screen. I am inclined to do the above task i.e, Displaying the AVFrame on screen using the latest API of SDL 2.0 (Using Renderers and Textures alongside the usage of SDL_Window). Frankly speaking, I am not an expert in SDL_Renderer, SDL_Texture and the functions associated with them. But I am reading the documentation in the official site of SDL 2.0 and working my way through them.

    Is there a way to do the following using SDL 2.0 API :

    • Convert the native frame format to a flavour of YUV and display it.

      (OR)

    • If it is possible, display the frame without having to convert it from native format.

    I want to do the above using Renderers and Textures. There doesn't seem to be an easy way to work with them.

    Can anyone guide me through the steps to do the above tasks?

    PS : Though I have not explicitly tried it, I came across some ways to display AVFrame on the screen by converting the AVFrame format(native) to RGB. But I do not want the native frame format (which is mostly YUV) to RGB conversion, as it is computationally expensive.

    Converting between formats is done by sws_scale()

  • cPanel - does installing modules via easyapache overwrite php.ini ?

    22 septembre 2013, par i.h4d35

    I have a little script in bash which automates the installation of ffmpeg and ffmpeg's php module on a server. At the end of this, it appends extension=ffmpeg.so to the end of php.ini and restarts the httpd service.

    My question is, in cPanel servers, say the user installs some other module using easy apache, would that overwrite the php.ini file. In which case, how do I make sure that the extension=ffmpeg.so is always added at the end?

    One possible solution I thought of was to have a cron set which periodically checks the php.ini file but that doesn't look like the right solution.

  • ffmpeg - rendering images and sound into video with transparent background

    22 septembre 2013, par Adam

    I got lots of images and a sound file.

    I want to convert all these images into a video (with the wav file as the sound of the movie). The images have a transparent background and I want the movie's background to be transparent too.

    How do I tell ffmpeg to render with a transparent background?

    P.S - I keep getting the following error:

    Error while opening encoder for output stream #255:0 - maybe incorrect parameters such as bit_rate, rate, width or height
    

    Sincerely,

    Adam.