Newest 'ffmpeg' Questions - Stack Overflow

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

Les articles publiés sur le site

  • YouTube's HD Video Streaming Server Technology ?

    30 septembre 2013, par bgentry

    Lately I've been researching different methods for streaming MP4s to the browser. Flash Media Server is an obvious choice here (using Cloudfront), and most solutions I've seen use the RTMP protocol.

    However, I spent some time on YouTube with Firebug and Chrome debugger figuring out how their streaming worked and I discovered some interesting differences between some of their videos and quality rates.

    My two sample videos are A and B. A is available up to 480p and B is available up to 1080p. For both videos, all rates up to 480p are served in an FLV container with H.264 video and AAC audio, over HTTP. What's interesting here is that if you have not yet downloaded (cached) the entire video, and you try to skip forward to an uncached part of the video, a new request will be made with a 'begin' parameter equal to the target offset in milliseconds. Example from Video A at 480p:

    http://v11.lscache8.c.youtube.com/videoplayback?ip=0.0.0.0&sparams=id%2Cexpire%2Cip%2Cipbits%2Citag%2Calgorithm%2Cburst%2Cfactor%2Coc%3AU0dWTldQVF9FSkNNNl9PSlhJ&fexp=904806%2C902906%2C903711&algorithm=throttle-factor&itag=35&ipbits=0&burst=40&sver=3&expire=1279756800&key=yt1&signature=D2D704D63C242CF187CAA5B5D5BAFB8DFACAC5FF.39180C01559C976717B651A7EB1D0C6249231EB7&factor=1.25&id=8568eb3135971f6f&begin=111863
    
    Response Headers:
    Cache-Control:public,max-age=23472
    Connection:close
    Content-Length:14320637
    Content-Type:video/x-flv
    Date:Wed, 21 Jul 2010 17:23:48 GMT
    Expires:Wed, 21 Jul 2010 23:55:00 GMT
    Last-Modified:Wed, 19 May 2010 12:31:41 GMT
    Server:gvs 1.0
    X-Content-Type-Options:nosniff
    

    The file returned by this URL is a fully valid FLV containing only the portion of the video after the requested offset.

    I did the same kind of test on the higher resolution versions of Video B. At 720p and 1080p, YouTube will return a video in an MP4 container, also with H.264 video and AAC audio. What's impressive to me is that their server takes the same type of offset for an MP4 video (via the 'begin' parameter) and returns a valid, streamable MP4 (moov atom at the front of the file with correct offsets) that also only includes the requested portion of the video.

    So, how does YouTube do this? How do they generate the FLV or MP4 container on the fly with the correct headers and only the desired segment of the requested video? I know this can be accomplished using FFMPEG to seek to the desired start point and the qt-faststart script to reposition the moov atom to the front of the stream, but it seems like this would be too slow to handle on-demand for millions of YouTube viewers.

    Ideas?

    Thanks in advance!

    Footnote: I am not allowed to include more than 1 link at this point, so here is Video A's URL: http:// www.youtube .com/watch?v=hWjrMTWXH28 "Video available up to 480p"

  • Recursive ffmpeg batch script within Windows

    30 septembre 2013, par Tisch

    Complete change to the question!

    I now have the following script:

    @echo off
    REM keep a counter for files converted
    set /A nfile=0
    REM do not copy empty folders or any files
    @echo Copying directory structure from %0 to %1 ...
    xcopy /T %1 %2
    REM walk directory structure and convert each file in quiet mode
    for /R %1 %%v in (*.mp4, *.aac, *.flv, *.m4a, *.mp3) do (
        echo converting "%%~nxv" ...
        ffmpeg -v quiet -i "%%v" -vcodec libx264 "%2\%%~nv-converted.mp4"
        set /A nfile+=1
    )
    echo Done! Converted %nfile% file(s)
    

    Taken from: http://mostlybuggy.wordpress.com/2012/09/25/windows-batch-file-how-to-copy-and-convert-folders-recursively-with-ffmpeg/

    The videos are converting as expected when I run the following command:

    convert ..\..\folder ..\..\converted\
    

    However, the converted files end up in "converted" and not in their respective sub-folders.

    Any ideas?

  • FFMPEG : How to RTMP Stream to WOWZA with RTMP Authentication ?

    30 septembre 2013, par 夏期劇場

    For the Server, i am using Wowza with RTMP Authentication. It is simply OK while using softwares like, FMLE / WireCast / etc, of course.

    • But how to do with FFMPEG?
  • ffmpeg capture raw/orignal stream from timeleak HD 72 with audio

    30 septembre 2013, par Max

    Timeleak card claim that they support Audio. I got the second hd75a card. (I had hd82a)

    I can't start capturing audio.

    It captures video:-

    ffmpeg -f dshow -i video="7160 HD Capture" out.mp4
    

    Here are options:-

    ffmpeg -f dshow -list_options true -i video="7160 HD Capture"
    
    
    [dshow @ 000000000253ba60]   pixel_format=yuyv422  min s=720x480 fps=59.9402 max s=720x480 fps=59.9402
    [dshow @ 000000000253ba60]   pixel_format=yuyv422  min s=720x480 fps=29.97 max s=720x480 fps=29.97
    [dshow @ 000000000253ba60]   pixel_format=yuyv422  min s=720x576 fps=50 max s=720x576 fps=50
    [dshow @ 000000000253ba60]   pixel_format=yuyv422  min s=720x576 fps=25 max s=720x576 fps=25
    [dshow @ 000000000253ba60]   pixel_format=yuyv422  min s=640x480 fps=59.9402 max s=640x480 fps=59.9402
    [dshow @ 000000000253ba60]   pixel_format=yuyv422  min s=1920x1080 fps=29.97 max s=1920x1080 fps=29.97
    [dshow @ 000000000253ba60]   pixel_format=yuyv422  min s=1920x1080 fps=25 max s=1920x1080 fps=25
    [dshow @ 000000000253ba60]   pixel_format=yuyv422  min s=1920x1080 fps=24 max s=1920x1080 fps=24
    [dshow @ 000000000253ba60]   pixel_format=yuyv422  min s=1280x720 fps=59.9402 max s=1280x720 fps=59.9402
    [dshow @ 000000000253ba60]   pixel_format=yuyv422  min s=1280x720 fps=50 max s=1280x720 fps=50
    [dshow @ 000000000253ba60]  Pin "Audio"
    

    This card should encode MPEG2

    1. Does that capture command write to file original MPEG2 stream from hardware or it is re-encoded?

    2. How do I get original MPEG2 stream? (If first command is re-encoding it OR may be there is no way to get original encoded frames at all)

    3. Does "Video Stream" includes audio track? (Pin "Audio") There is no extra audio device and it seems audio stream is in video stream.

    I wish to get raw (not re-encoded, original MPEG2 encoded by hardware) and audio. It is Ok If I will get original not encoded stream without loosing frames.

    Offtopic: If you have such card: Do you have horizontal artifact lines when picture moves?

  • Error LIBSWRESAMPLE_0 Compiling ffmpeg Kubuntu 12.04

    30 septembre 2013, par lobo115

    i try to compile ffmpeg in ubuntu 12.04 with this tuto But i had a error with a library so i use this to solve it:

    sudo apt-get update
    sudo apt-get -y install build-essential checkinstall git libfaac-dev libgpac-dev \
      libjack-jackd2-dev libmp3lame-dev libopencore-amrnb-dev libopencore-amrwb-dev \
      libsdl1.2-dev libtheora-dev libva-dev libvdpau-dev libvorbis-dev libx11-dev \
      libxfixes-dev texi2html yasm zlib1g-dev
    

    and this

    cd
    git clone git://git.videolan.org/x264
    cd x264
    ./configure --enable-static
    make
    sudo checkinstall --pkgname=x264 --pkgversion="3:$(./version.sh | \
      awk -F'[" ]' '/POINT/{print $4"+git"$5}')" --backup=no --deldoc=yes \
      --fstrans=no --default
    

    then i have a problem with another library so i use a apt-get install to add libgsm1-dev, then i could install it, but now when i tried to execute it said:

    ffmpeg: relocation error: /usr/local/lib/libavfilter.so.3: symbol swr_get_class, version LIBSWRESAMPLE_0 not defined in file libswresample.so.0 with link time reference
    

    So i look for help, and tried

    export LD_LIBRARY_PATH=/usr/local/lib
    sudo ldconfig -v
    

    but it didn't work, could you help me? Thz

    PS:When i tried to install WINFF with synaptic or apt-get it said that it will install ffmpeg.