Newest 'ffmpeg' Questions - Stack Overflow

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

Les articles publiés sur le site

  • how to convert stream to new stream with redrawing frames [on hold]

    10 octobre 2013, par DevellMen

    I have stream from my IP-camera (rtsp). I need to re-draw each frame using a special algorithm and build a new stream to my site. Algorithm is written in C + + and C # and works with image Bitmap. I can convert stream to images and images to stream using FFMPEG, but I can't:

    get frame from stream -> /convert frame using my algoritm/ -> join new image to new stream.

  • How to do HTML 5 video with Flash-free fallback for IE 8

    10 octobre 2013, par forthrin

    I need a simple and clean Flash-free, cross-browser solution for embedding video in a Web page. I came up with the solution below, and wish to hear if someone can improve it even further, including:

    1. Can the method show a still image while buffering the video?
    2. Can someone verify those conditional comments? downlevel-hidden and downlevel-revealed got me a bit confused :)

    Video converting as follows (using WMV for IE 8, WEBM for Firefox, and H264 for the rest):

    ffmpeg -i video.mov -b 3000k -vcodec wmv2   -acodec wmav2     -ab 320k -g 30 out.wmv
    ffmpeg -i video.mov -b 3000k -vcodec libvpx -acodec libvorbis -ab 320k -g 30 out.webm
    

    Markup (using conditional comments to create a fallback to IE 8 users):

    
    
    
    
    
    
  • Why isn't FFmpeg compiler-optimized ?

    10 octobre 2013, par Saptarshi Biswas

    FFmpeg is compiled by first creating a debug build and then stripping debug symbols off.

    LD      ffmpeg_g
    CP      ffmpeg
    STRIP   ffmpeg
    

    Why not have compiler optimizations, O3 for instance?

  • How to optimize ffmpeg w/ x264 for multiple bitrate output files

    10 octobre 2013, par Jonesy

    The goal is to create multiple output files that differ only in bitrate from a single source file. The solutions for this that were documented worked, but had inefficiencies. The solution that I discovered to be most efficient was not documented anywhere that I could see. I am posting it here for review and asking if others know of additional optimizations that can be made.

    Source file       MPEG-2 Video (Letterboxed) 1920x1080 @>10Mbps
                      MPEG-1 Audio @ 384Kbps
    Destiation files  H264 Video 720x400 @ multiple bitrates
                      AAC Audio @ 128Kbps
    Machine           Multi-core Processor
    

    The video quality at each bitrate is important so we are running in 2-Pass mode with the 'medium' preset

    VIDEO_OPTIONS_P2 = -vcodec libx264 -preset medium -profile:v main -g 72 -keyint_min 24 -vf scale=720:-1,crop=720:400

    The first approach was to encode them all in parallel processes

    ffmpeg -y -i $INPUT_FILE $AUDIO_OPTIONS_P2 $VIDEO_OPTIONS_P2 -b:v 250k -threads auto -f mp4 out-250.mp4 &
    ffmpeg -y -i $INPUT_FILE $AUDIO_OPTIONS_P2 $VIDEO_OPTIONS_P2 -b:v 500k -threads auto -f mp4 out-500.mp4 &
    ffmpeg -y -i $INPUT_FILE $AUDIO_OPTIONS_P2 $VIDEO_OPTIONS_P2 -b:v 700k -threads auto -f mp4 out-700.mp4 &
    

    The obvious inefficiencies are that the source file is read, decoded, scaled, and cropped identically for each process. How can we do this once and then feed the encoders with the result?

    The hope was that generating all the encodes in a single ffmpeg command would optimize-out the duplicate steps.

    ffmpeg -y -i $INPUT_FILE \
    $AUDIO_OPTIONS_P2 $VIDEO_OPTIONS_P2 -b:v 250k -threads auto -f mp4 out-250.mp4 \
    $AUDIO_OPTIONS_P2 $VIDEO_OPTIONS_P2 -b:v 500k -threads auto -f mp4 out-500.mp4 \
    $AUDIO_OPTIONS_P2 $VIDEO_OPTIONS_P2 -b:v 700k -threads auto -f mp4 out-700.mp4
    

    However, the encoding time was nearly identical to the previous multi-process approach. This leads me to believe that all the steps are again being performed in duplicate.

    To force ffmpeg to read, decode, and scale only once, I put those steps in one ffmpeg process and piped the result into another ffmpeg process that performed the encoding. This improved the overall processing time by 15%-20%.

    INPUT_STREAM="ffmpeg -i $INPUT_FILE -vf scale=720:-1,crop=720:400 -threads auto -f yuv4mpegpipe -"
    
    $INPUT_STREAM | ffmpeg -y -f yuv4mpegpipe -i - \
    $AUDIO_OPTIONS_P2 $VIDEO_OPTIONS_P2 -b:v 250k -threads auto out-250.mp4 \
    $AUDIO_OPTIONS_P2 $VIDEO_OPTIONS_P2 -b:v 500k -threads auto out-500.mp4 \
    $AUDIO_OPTIONS_P2 $VIDEO_OPTIONS_P2 -b:v 700k -threads auto out-700.mp4
    

    Does anyone see potential problems with doing it this way, or know of a better method?

  • Can ffmpeg process files by their size ? - looking for a faster way to process

    10 octobre 2013, par nlahkim

    i looking for a faster way to convert mp3 files on mp4 by adding a simple image on it maybe can the codec sort files by size before processing

    i use this portion of code to do the conversion:

    for %%a in ("*.*")
    do
    "C:\ffmpeg\bin\ffmpeg" -loop 1 -i  "C:\ffmpg\bin\input.jpg" -i  "%%a" -c:v libx264 -preset veryslow -tune stillimage -crf 18 -pix_fmt yuv420p -vf scale=640:480 -c:a aac -shortest -strict experimental -b:a 192k -shortest "C:\mp4\%%~na.mp4"
    pause
    

    i don't find anything about sorting files on ffmpeg support site

    the only thing i have fond about processing faster is using cpu and thread but it dosen't really work like i expected

    so any idea about processing faster?

    thanks