Newest 'ffmpeg' Questions - Stack Overflow

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

Les articles publiés sur le site

  • Java Wrapper : FMJ FFmpeg Livestreaming/Recording

    1er octobre 2013, par DaCoder

    I have begun to do an application for Linux users to livestream with. Currently the only good way to livestream with Linux is FFmpeg and through terminal. I have gotten a good hold on FFmpeg, but trying to get FFmpeg to load with Java is difficult, and I have no clue where to start. I am using FMJ, a wrapper for Java (whatever that means). And I have FFmpeg working, but I need to know how to code in FFmpeg with the wrapper, and make a video output on the screen, as well as stream video to twitch.tv or .mp4 files.

    Currently the GUI is easy to do, but no functionality is within the Application to even stream/record, so I will need some help on how to set up wrappers, how to implement them, and/or alternative and easier methods for coding this.

    What I want out of my application (and need still) GUI->FFmpeg(records screeen)->FFmpeg(encodes/compresses the video and streams)->Output to small preview window in GUI->And outputted to Twitch/Local Recording. I have everything in place EXCEPT the FFmpeg bits.

    Any help would be appreciated, and I am hoping to code the interactions with FFmpeg and Java myself, not to use a prebuilt client for that.

    Furhtermore, I will setup a GitHub of this project soon. But as for right now, I want to focus on this issue at hand.

    Thank you.

  • 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?