Newest 'ffmpeg' Questions - Stack Overflow

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

Les articles publiés sur le site

  • Merge filename.mp4.tmp with filename.mp4

    10 janvier 2017, par Sathish

    How to merge a abc.mp4.tmp swap file with actual abc.mp4 file. I was trying to recording a live event using Wowza Media server 3.6 and the recorded file was not muxed properly at final moment. The abc.mp4.tmp swap file was not merged with actual abc.mp4 file. So could someone tell me how to merge the abc.mp4.tmp and abc.mp4 file and creates a new file and I can able to play with vlc

    Here is the mediainfo of the files

    [root@ip-ss-21-98-2 content]# mediainfo 03_03_2014_12_03_08.mp4
    General
    Complete name                            : 03_03_2014_12_03_08.mp4
    Format                                   : MPEG-4
    Format profile                           : Adobe Flash
    Codec ID                                 : f4v 
    File size                                : 5.20 GiB
    
    
    [root@ip-ss-21-98-2 content]# mediainfo 03_03_2014_12_03_08.mp4.tmp
    General
    Complete name                            : 03_03_2014_12_03_08.mp4.tmp
    File size                                : 38.3 MiB
    
  • ffmpeg filename output format

    10 janvier 2017, par Yuval Adam

    When using ffmpeg to output a series of frames as images, the only format I can find documentation for is frame_%d.jpg. The %d identifier is replaced by the sequential frame count.

    Are there other parameters I can use in the output file format? Specifically, I need the ability to add the timestamp of the specific frame.

  • decoding different programs from a mpts using ffmpeg [on hold]

    9 janvier 2017, par Enri Koci

    Is there a way to decode different programs (h264 encoded) using ffmpeg (with the sdl option) simultaneously from a mpts live udp stream? Creating something like a mosaic view of the programs of a mpts stream.

  • Accessing web content with ffmpeg on android

    9 janvier 2017, par Pure_eyes

    I'm using ffmpeg inside my xamarin.android project,by accessing a statically build version for the corresponding architecture of the device. I'm using https://www.johnvansickle.com/ffmpeg/, static builds which support https protocol.
    I'm calling ffmpeg by starting a new process and passing the arguments.Here is a pseudo code for the operation:

    arguments = {'-i',inputFileName,...}
    run('./ffmpeg',arguments,redirectOutput = true,...)
         .OnOutput(s) => log(s)
    

    Now,I want to access a file in the web, directly with ffmpeg, since from my testing it is more efficient in term of bandwidth, and speed.

    The problem i'm facing is that because i'm using a static build of ffmpeg, we need to statically link gclib, which results loss of dns resolution as stated in the readme:

    A limitation of statically linking glibc is the loss of DNS resolution. Installing nscd through your package manager will fix this or you can use "ffmpeg -i http:///" instead of "ffmpeg -i http://example.com/"

    But the content that i'm trying to get provides strictly only through HTTPS,so there is no way to access it via the ip.
    But on Linux systems i had no problem accessing the content(With the same command as for android), thanks to nscd, which isn't present in android.

    • Is there anyway to use android's dns resolution?
    • Or compile ffmpeg differently, as stated in this question?Maybe using android NDK would default this?Would ffmpeg even work then?
    • Or somehow pipe the content, to ffmpeg's stdin, and tell it to input from pipe (Would it still be more efficient, than downloading and saving the file, then running ffmpeg ) ?

    All suggestions are welcomed!

    EDIT

    As for SushiHangover advice, i was able to implement it via piping,i came up with two ways:

    Process ffmpegProcess = new Process();
    ffmpegProcess.StartInfo.FileName = "ffmpeg";
    ffmpegProcess.StartInfo.Arguments = ....
    ffmpegProcess.StartInfo.UseShellExecute = false;
    ffmpegProcess.StartInfo.RedirectStandardInput = true;
    ffmpegProcess.Start();
    
    //Way 1
    var data = await GetBytesAsync();
    await ffmpegProcess.StandardInput.BaseStream.WriteAsync(b, 0,b.Length);
    
    // Way 2
    await (await GetStreamAsync()).CopyToAsync(ffmpegProcess.StandardInput.BaseStream);
    

    Which both work, but they aren't efficient in term of bandwidth as ffmpeg itself, i tested the network traffic with NetBalancer.

    Way 1 (Fresh Data - First time running program) : 401 KB Upload/ 19.7 MB Download
    Way 1 (Second time running program) : 334.3 KB Upload/ 17.7 MB Download
    Way 2 (Second time running program) : 370 KB Upload/ 16.6 MB Download
    Through FFmpeg Only (Fresh Data - First time running program): 142.4 KB Upload / 5.3 MB Download
    Through FFmpeg Only (Second time running program): 67.5 KB Upload / 3.7 MB Download

    Who can i overcome the gap ? I speculate that ffmpeg only reads the headers, and able to download only the needed audio stream based on my arguments, rather than the whole video as my snippets do.

  • ffmpeg : capture two screens simultaneously, save as two separate files

    9 janvier 2017, par wetjosh

    Is this possible? Here is my working single file solution. How can I modify it to save two separate files instead?

    ffmpeg \
    -f avfoundation -pix_fmt uyvy422 -s 1440x900 -i 1 \
    -f avfoundation -pix_fmt uyvy422 -s 1440x900 -i 2 \
    -pix_fmt yuv420p -r 30 -preset ultrafast -b:v 5000k -t 15 \
      -filter_complex \
        "nullsrc=size=2880x900 [background]; \
        [0:v] setpts=PTS-STARTPTS, scale=1440x900 [left]; \
        [1:v] setpts=PTS-STARTPTS, scale=1440x900 [right]; \
        [background][left] overlay=shortest=1 [background+left]; \
        [background+left][right] overlay=shortest=1:x=1440 [left+right]" \
      -map [left+right] out.mov
    

    I've tried removing the filter complex. I've tried adding two output files. I've tried various combinations of mapping. The following is the closest I've gotten to making it work. It creates two files, but both contain only the second stream (-i 2).

    ffmpeg \
    -f avfoundation -pix_fmt uyvy422 -s 1440x900 -i 1 \
    -f avfoundation -pix_fmt uyvy422 -s 1440x900 -i 2 \
    -pix_fmt yuv420p -r 30 -preset ultrafast -b:v 5000k -t 15 out1.mov \
    -pix_fmt yuv420p -r 30 -preset ultrafast -b:v 5000k -t 15 out2.mov