Newest 'ffmpeg' Questions - Stack Overflow

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

Les articles publiés sur le site

  • Multiple video sources combined into one

    28 septembre 2011, par Oded

    I am looking for an efficient way to do the following:

    Using several source videos (of approximately the same length), I need to generate an output video that is composed of all of the original sources each running in its own area (like a bunch of PIPs in several different sizes). So, the end result is that all the original are running side-by-side, each in its own area/box.

    The source and output need to be flv and the platform I am using is Windows (dev on Windows 7 64bit, deployment to Windows server 2008).

    I have looked at avisynth but unfortunately it can't handle flv and non of the plugins and flv splitters I have tried worked.

    My current process uses ffmpeg in the following manner:

    1. Use ffmpeg to generate 25 png's per second per video, resizing the original as needed.
    2. Use the System.Drawing namespace to combine each set of frames into a new image, starting with a static background, then loading each frame into an Image and drawing to the background Graphics object - this gives me the combined frames.
    3. Use ffmpeg to combine the generated images to a video.

    All this is very IO intensive (which is my processing bottleneck at the moment) and I feel there must be a more efficient way to reach my goal. I do not have much experience with video processing, and don't know what options are out there.

    Can anyone suggest a more efficient way of processing these?

  • Incompatible Pointer Type Error, sws_scale, ffmpeg

    28 septembre 2011, par James Felix Black

    My code is very straightforward; it consumes YUV420P data, resizes it, and produces a PNG or JPEG image (OS X Lion, Apple's gcc 4.2.1). It works fine; I'm using ffmpeg (HEAD, as of mumble days ago), but when running in -pedantic-errors mode (which I like to do from time to time):

    zc_libav.c:30: error: passing argument 2 of ‘sws_scale’ from incompatible pointer type
    

    Ouch! Well, what's my code look like?

    sws_scale(sws_ctx, 
              in_pic->data,
              in_pic->linesize, 
              0, 
              in->y, 
              out_pic->data, 
              out_pic->linesize); 
    

    (You can assume for the sake of argument that the in_pic and out_pic AVPicture structures have been properly initialized, as the code works).

    Well, what're the offending data types?

    from libswscale/swscale.h:

    int sws_scale(struct SwsContext *c, const uint8_t* const srcSlice[], …
    

    from libavcodec/avcodec.h

    typedef struct AVPicture {
      uint8_t *data[4];
      int linesize[4];       ///< number of bytes per line
    } AVPicture;
    

    As I noted above, when I change -pedantic-errors to -pedantic, I get the same complaint, but the code compiles and runs correctly. For my own neurotic sanity, is there any way to get the advantages of -pedantic-errors and, you know, compile this code?

  • H.264 (MP4) video not play in IE9, but will play in Safari [closed]

    27 septembre 2011, par Austin S

    I have encoded a video using FFMPEG into three formats: WebM, MP4, and FLV. Chrome, Mozilla, and theoretically Opera (although I haven't tested it) should all use the WebM version. IE9, iOS devices, and Adriod should use the MP4 container. While all legacy browsers should default back to the flash version of the file. I'm using video-js to help serve the content. The content is set to preload and autoplay.

    I have found that everything is working as intended except for IE9, where all I get is the poster image and a white dot that typically spins indicating that the file is loading however it is not spinning in this scenario. The MP4 file opens in Safari, an iPad, an iPhone, and an Andriod - verifying that the file is infact legit.

    The following is the specs for the MP4 file when I stream it using VLC. I don't know if this is particularly useful, I'm just trying to provide as much detail as possible.

    VLC Codec Details

    • Stream 0

      Type: Video

      Codec: MPEG-4 Video (mp4v)

      Language: English

      Resolution: 480x270

      Frame rate: 2997

    • Stream 1

      Type: Audio

      Codec: MPEG AAC Audio (mp4a)

      Language: English

      Channels: Stereo

      Sample rate: 48000 Hz

    When accessing videojs.com from my coworkers computer, the video on their main page wouldn't play the video correctly in IE9, but we could hear the audio. When I went to another coworkers computer it played just fine. I'm wondering if IE9, or video-js, is tempermental depending on how updated your OS is.

    The fact that I'm working on XP with IE7 is making this all the more difficult to fix, so if you have any suggestions on what could point me in the right direction, I would greatly appreciate it!

    Thanks,

    Austin S

  • How can i know the duration of any h264 file ?

    26 septembre 2011, par Mr.32

    I have one file in which only h264 frames are there in form of NAL unit. So now is there any method so i can count the duration of that file?

    I dont know how many frames are there in file. I have only file size.

    PS: All i want to do is in C language and on Linux platform.

  • What are the specifications of Flex usable FLV videos ?

    26 septembre 2011, par Riduidel

    I have a server which streams FLV files to a Flex client. In this flex client, the video timeline advances incoherently, and no video can be seen on screen (only the sound can be heard).

    My FLV file has been generated using ffmpeg, which says (about this generated file)

    FFmpeg version 0.6, Copyright (c) 2000-2010 the FFmpeg developers
      built on Aug  8 2010 04:24:04 with gcc 4.3.2
      configuration: --prefix=/home/marpada/ffmpegfull --enable-gpl --enable-version3 --enable-nonfree --disable-ffplay --disable-ffserver --enable-libmp3lame --enable-libfaac --enable-libvpx --enable-libfaad --enable-libvorbis --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libxvid --enable-libx264 --enable-libtheora --extra-ldflags=-static --extra-libs='-lvorbis -logg -lxvidcore -lx264 -lopencore-amrnb -lopencore-amrwb -lfaad -lfaac -lvpx -ltheora -lm -lpthread' --enable-small --enable-runtime-cpudetect
      libavutil     50.15. 1 / 50.15. 1
      libavcodec    52.72. 2 / 52.72. 2
      libavformat   52.64. 2 / 52.64. 2
      libavdevice   52. 2. 0 / 52. 2. 0
      libswscale     0.11. 0 /  0.11. 0
    [flv @ 0x95c6aa0]Estimating duration from bitrate, this may be inaccurate
    
    Seems stream 0 codec frame rate differs from container frame rate: 1000.00 (1000/1) -> 25.00 (25/1)
    Input #0, flv, from '/appli/perigee_70ri/data/files/ged_bur%0/Imagettes/70ri/279/2/8/20_109021138o.70ri_FLV_preview_.flv':
      Metadata:
        hasMetadata     : true
        hasVideo        : true
        hasAudio        : true
        duration        : 589
        lasttimestamp   : 589
        lastkeyframetimestamp: 589
        width           : 352
        height          : 288
        videodatarate   : 199
        framerate       : 25
        audiodatarate   : 125
        audiosamplerate : 44100
        audiosamplesize : 16
        stereo          : true
        filesize        : 25058444
        videosize       : 15195503
        audiosize       : 9690850
        datasize        : 23027
        metadatacreator : flvmeta 1.1-r202
        audiocodecid    : 2
        videocodecid    : 2
        audiodelay      : 0
        canSeekToEnd    : false
        hasCuePoints    : false
        hasKeyframes    : true
      Duration: 00:09:48.78, start: 0.000000, bitrate: 332 kb/s
        Stream #0.0: Video: flv, yuv420p, 352x288, 204 kb/s, 25 tbr, 1k tbn, 1k tbc
        Stream #0.1: Audio: mp3, 44100 Hz, 2 channels, s16, 128 kb/s
    At least one output file must be specified
    

    Which, as far as it seems to me, is OK.

    Furthermore, the video plays nice in VLC.