Newest 'ffmpeg' Questions - Stack Overflow

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

Articles published on the website

  • Download Partial Video via HTTP (for Remote Thumbnailing)

    13 February 2012, by HuntedC

    I have videos hosted on Amazon S3. I encode them with Zencoder and store a thumbnail for the video then using Zencoder. However, I need a way to generate thumbnails at certain points in the video (i.e. 00:00:03, 00:10:32, 01:40:18) and store them either on S3 or my server.

    ffmpeg allows remote thumbnailing, however it takes a very long time (sometimes several minutes) to get a thumbnail from the middle of a file--I believe this is because it downloads the entire file up to that point to get the thumbnail.

    My plan is to somehow download the header of the video file via HTTP byte-range request, guesstimate the byte range where I should be looking for the thumbnail, download about a second of video from that part of the file via HTTP byte-range request, then save the header and tiny video locally. I pull the thumbnail from that using ffmpeg and delete the temporary video.

    I have no idea on how exactly this would work (I believe the H.264 MP4 files I'm working with have a dynamic length header, for another issue). Any suggestions or better ideas?

    Edit: To clarify, Zencoder thumbnailing is great, but they only allow thumbnail creation in combination with transcoding. I don't want to transcode my video every time I create a new thumbnail, so I need to do this on my own without Zencoder.

  • Use opencv to encode into flv, playable by flash player

    13 February 2012, by Hemang Shah

    I've compiled ffmpeg with libx264 using configure options given at 1.

    This results in the following codecs being available in ffmpeg:

    $ ffmpeg -codecs | grep "264\|flv"
    ffmpeg version 0.10 Copyright (c) 2000-2012 the FFmpeg developers
    built on Feb 10 2012 13:54:15 with gcc 4.6.1
    configuration: --enable-gpl --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libx264 --enable-nonfree --enable-postproc --enable-version3 --enable-x11grab
    libavutil      51. 34.101 / 51. 34.101
    libavcodec     53. 60.100 / 53. 60.100
    libavformat    53. 31.100 / 53. 31.100
    libavdevice    53.  4.100 / 53.  4.100
    libavfilter     2. 60.100 /  2. 60.100
    libswscale      2.  1.100 /  2.  1.100
    libswresample   0.  6.100 /  0.  6.100
    libpostproc    52.  0.100 / 52.  0.100
    DEVSD  flv             Flash Video (FLV) / Sorenson Spark / Sorenson H.263
    D V D  h264            H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
    D V D  h264_vdpau      H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 (VDPAU acceleration)
    EV    libx264         libx264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
    EV    libx264rgb      libx264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 RGB
    

    After this, I compiled opencv. Here is partial cmake result:

    --   Video I/O:
    --     DC1394 1.x:                 NO
    --     DC1394 2.x:                 NO
    --     FFMPEG:                     YES
    --       codec:                    YES
    --       format:                   YES
    --       util:                     YES
    --       swscale:                  YES
    --       gentoo-style:             YES
    --     GStreamer:                  YES
    --     UniCap:                     NO
    --     PvAPI:                      NO
    --     V4L/V4L2:                   /1
    --     Xine:                       NO
    

    Now, using opencv's VideoWriter, I tried to encode into flv with the following FOURCC codes:
    FLV1, X264

    While the FLV1 results in a video file not playable by flash player, but playabe by vlc; X264 produces no results at all.
    Here is the console output for X264, resulting in a 0 byte file.

    Output #0, flv, to 'd.flv': Stream #0.0: Video: [0][0][0][0] / 0x0000, yuv420p, 320x240, q=2-31, 4915 kb/s, 90k tbn, 24 tbc

    Do you see anything amiss or incorrect?
    thanks,

  • how to insert the play button in the video thumbnail?

    12 February 2012, by Vijay

    I'm creating thumbnails from videos using ffmpeg and it's working fine.

    But now I want to add a play button image at the center of the thumbnail image and store them.

    I've used CSS to get that, but I want to know whether there is any method to create thumbnails with the given image at the center.

  • run ffmpeg with multiple threads

    12 February 2012, by xhammer

    Ok i have learnt how to convert videos files using vb.net and ffmpeg. But as far as i know we cannot use multiple threads to run same exe file to convert files. Do you know how i can convert multiple videos using one external exe file (ffmpeg)?

    I have not tried because my computer time was over. So iam just asking a general doubt whether if we attach it to one process then wouldn't the process get locked? Then can we multi-thread this application or not ?

    Thanks in advance.

  • How to salvage a gigantic, possibly corrupt, AIFF file?

    12 February 2012, by Ross Duncan

    Due to a Sound Track Pro glitch, I have a problematic AIF file. It plays fine in QuickTime Player, and is about 1 hour 50 mins long. However:

    • It's 3.81GB in size, whereas (I believe) AIF files are only supposed to be 2GB or smaller.
    • iTunes refuses to play it.
    • Logic Pro gives the error message "party-mix.aif is empty!" when I try to import it.
    • VLC will open and play the file, but it ends after an 1 hour (I guess this is the 2GB point).
    • Attempting to transcode using ffmpeg to Ogg gives the errors,

      [aiff @ 0x102051000] max_analyze_duration 5000000 reached at 5001333

      ....

      [pcm_s16be @ 0x10205a200] invalid PCM packet

      but the resulting file plays in VLC up till 1 hour, when it ends.

    • Attempting to transcode using ffmpeg to MP3 gives similar results as Ogg, except that the number of channels must reduced from 6 to 2. This is odd because it was a stereo project - where the extra 4 channels came from I have no idea.
    • There are a few places where the audio has been very noticeably sped up.

    My question: how can I transcode this frankenstein monster to MP3 without losing the second half? I am running Mac OS 10.6.8.