Newest 'ffmpeg' Questions - Stack Overflow

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

Les articles publiés sur le site

  • Drop late RTMP AVPackets - FFmpeg

    25 novembre 2014, par Mihai Ghete

    I'm using FFmpeg to read RTMP streams in an iOS application. It is basically a Player for RTMP streams. The problem is that when the network is to busy, av_read_frame takes too much time. In conclusion, the latency increases over time. Are there some FFmpeg setups that I can use so that it will drop late frames or make av_read_frame return if it was unable to read the packet in a defined period of time?

    Any suggestion would be helpful. Thank you in advance.

  • How to stream live event from my enigma to ustream or youtube using ffmpeg

    25 novembre 2014, par user3674244

    How to stream live event from my enigma to ustream or youtube using ffmpeg

    or how can i use m3u files to stream in ustream or youtube live

    Note : Im using windows 8.1

    thanks

  • Resume transcoding a video with ffmpeg

    25 novembre 2014, par Jonathan.

    I have a node server that uses child-process to use ffmpeg to convert a video to mp4. However if the server crashes while transcoding, then I'd like to resume transcoding the file (similar to -C with curl).

    I figured I could just start transcoding the file from where it finished to a seperate file and then just concat the two. And while transcoding the file from where it finished works and the file that starts midway plays back fine, when I concat the two files with ffmpeg -i "concat:part1.mp4|part2.mp4" -c copy ouput.mp4 Only the first part will play, and when it gets to the second part it just stays on the last frame of the first part or goes black depending on the video player. (But playing part2.mp4 itself works fine)

    There isn't any error during either conversion or the concat.

  • ffmpeg command line for capturing (and recording) audio and video in 720p from decklink card using Windows 7

    24 novembre 2014, par Huron

    I am trying to capture audio and video from a blackmagic decklink capture card using Windows 7 @ 720p, but I cant seem to get the ffmpeg command line settings right.

    ffmpeg -list_devices true -f dshow -i dummy

    [dshow @ 02457a60] DirectShow video devices
    [dshow @ 02457a60]  "Blackmagic WDM Capture"
    [dshow @ 02457a60]  "Decklink Video Capture"
    [dshow @ 02457a60] DirectShow audio devices
    [dshow @ 02457a60]  "Decklink Audio Capture"
    

    ffmpeg -list_options true -f dshow -i video="Decklink Video Capture"

    [dshow @ 03c2ea20] DirectShow video device options
    [dshow @ 03c2ea20]  Pin "Capture"
    [dshow @ 03c2ea20]   pixel_format=uyvy422  min s=720x486 fps=29.97 max s=720x486 fps=29.97
    [dshow @ 03c2ea20]   pixel_format=uyvy422  min s=720x486 fps=23.976 max s=720x486 fps=23.976
    [dshow @ 03c2ea20]   pixel_format=uyvy422  min s=720x576 fps=25 max s=720x576 fps=25
    [dshow @ 03c2ea20]   pixel_format=uyvy422  min s=720x486 fps=59.9402 max s=720x486 fps=59.9402
    [dshow @ 03c2ea20]   pixel_format=uyvy422  min s=720x576 fps=50 max s=720x576 fps=50
    [dshow @ 03c2ea20]   pixel_format=uyvy422  min s=1920x1080 fps=23.976 max s=1920x1080 fps=23.976
    [dshow @ 03c2ea20]   pixel_format=uyvy422  min s=1920x1080 fps=24 max s=1920x1080 fps=24
    [dshow @ 03c2ea20]   pixel_format=uyvy422  min s=1920x1080 fps=25 max s=1920x1080 fps=25
    [dshow @ 03c2ea20]   pixel_format=uyvy422  min s=1920x1080 fps=29.97 max s=1920x1080 fps=29.97
    [dshow @ 03c2ea20]   pixel_format=uyvy422  min s=1920x1080 fps=30 max s=1920x1080 fps=30
    [dshow @ 03c2ea20]   pixel_format=uyvy422  min s=1280x720 fps=50 max s=1280x720fps=50
    [dshow @ 03c2ea20]   pixel_format=uyvy422  min s=1280x720 fps=59.9402 max s=1280x720 fps=59.9402
    [dshow @ 03c2ea20]   pixel_format=uyvy422  min s=1280x720 fps=60.0002 max s=1280x720 fps=60.0002
    

    ffmpeg -list_options true -f dshow -i audio="Decklink Audio Capture"

    [dshow @ 047fea20] DirectShow audio device options
    [dshow @ 047fea20]  Pin "Capture"
    [dshow @ 047fea20]   min ch=1 bits=16 rate= 48000 max ch=1 bits=16 rate= 48000
    [dshow @ 047fea20]   min ch=2 bits=16 rate= 48000 max ch=2 bits=16 rate= 48000
    [dshow @ 047fea20]   min ch=4 bits=16 rate= 48000 max ch=4 bits=16 rate= 48000
    [dshow @ 047fea20]   min ch=6 bits=16 rate= 48000 max ch=6 bits=16 rate= 48000
    [dshow @ 047fea20]   min ch=8 bits=16 rate= 48000 max ch=8 bits=16 rate= 48000
    [dshow @ 047fea20]   min ch=10 bits=16 rate= 48000 max ch=10 bits=16 rate= 48000
    [dshow @ 047fea20]   min ch=12 bits=16 rate= 48000 max ch=12 bits=16 rate= 48000
    [dshow @ 047fea20]   min ch=16 bits=16 rate= 48000 max ch=16 bits=16 rate= 48000
    

    This is the stream information for my current video/audio source, connected to the decklink card's hdmi port

    Stream #0:0: Video: rawvideo (UYVY / 0x59565955), uyvy422(tv), 1280x720, 59.94 tbr, 10000k tbn, 59.94 tbc
    Stream #0:1: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
    

    Ultimately I will need to display this video on screen. And simultaneously be able to start and stop recording, while the preview keeps playing.

    My idea was to use ffmpeg to capture the video and audio signal and transmit this to a network stream (eg 127.0.0.1:6666). Then use VLC player to display the stream (the preview). And ultimately start and/or stop another ffmpeg to save that same stream to disk.

    In my mind this works, but I am no audio/video expert so if anyone with more experience could help out, I would appreciate it.

    Update:

    I have been able to display the video using ffplay, with the following command :

    ffplay -f dshow -video_size 1280x720 -rtbufsize 702000k -framerate 60 -i video="Decklink Video Capture":audio="Decklink Audio Capture" -threads 2
    

    Next step is streaming it so I can view the stream (preview) with VLC.

    Tried to use this command :

    ffmpeg -f dshow -video_size 1280x720 -rtbufsize 702000k -framerate 60 -i video="Decklink Video Capture":audio="Decklink Audio Capture" -threads 2 -f mpegts rtp://127.0.0.1:6666?pkt_size=188?buffer_size=65535
    

    Which does not give any errors, so appears to work. But when I try to open the stream in VLC I get the following error :

    SDP required: A description in SDP format is required to receive the RTP stream. Note that rtp:// URIs cannot work with dynamic RTP payload format (65).

    After a bit of reading it seems I should not be streaming to rtp:// but rather to udp://

    Command became :

    ffmpeg -f dshow -video_size 1280x720 -rtbufsize 702000k -framerate 60 -i video="Decklink Video Capture":audio="Decklink Audio Capture" -threads 2 -f mpegts udp://127.0.0.1:6666?pkt_size=188?buffer_size=65535
    

    And when I try to open it now in VLC I get no error, no warning, but also no video.

    Time for some more reading.

  • Unable to use ffprobe in fluent-ffmpeg

    24 novembre 2014, par Risk Junk

    I was intended to use ffprobe function to extract video information and here is my code:

    var FFmpeg = require('fluent-ffmpeg');
    //...
    var convert_using_ffmpeg = function (source, target) {
    
        var tempfile = path.join(config.tmproot, path.basename(target));
    
        new FFmpeg({ source: source })
            .withVideoCodec('libx264')
            .withVideoBitrate('512')
            .withAudioQuality(5)
            .withAudioCodec('libmp3lame')
            .withSize('360x288')
            //.ffprobe(function(err,data) {
            //  console.dir(data);
            //})
            .toFormat('flv')
            .on('error', function (err) {
                console.log('An error occurred: ' + err.message);
            })
            .saveToFile(tempfile, function () {
                fs.rename(tempfile, target);
            });
    };
    

    The compiler simply said Object # has no method 'ffprobe when I execute the program. The fluent-ffmpeg API says I should add FFMPEG_PATH and FFPROBE_PATH environment variable before executing, but the fact is I could execute ffmpeg directly in command line even if it does not exist in PATH environment variable, and the node.js program runs successfully without evoking the ffprobe function. Plus the API also says ffprobe comes together with most distribution of ffmpeg, if so, how can I add ffprobe to the environment variable separately?

    I'm using fluent-ffmpeg 1.7.0 currently.