Newest 'ffmpeg' Questions - Stack Overflow

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

Les articles publiés sur le site

  • How to set Aspect ratios of all videos in FFMPEG ?

    23 décembre 2017, par alan samuel

    I am trying to concatenate 3 videos using a C# wrapper class. (NRECO.Videoconverter)

    All the videos have the same frame rate and size.

    However Aspect ratio of the second video is different.

    How can I set all the aspect ratio of the three videos to be the same. I would like to set the aspect ratio of the second video to be the same as the first and and third one.

    Here is what I have tried in C# using the wrapper class.

    ConcatSettings concatSettings = new ConcatSettings
     {
        CustomOutputArgs = "-filter_complex \"[1:v]setsar=1[v1];[0:v:0][0:a:0] [1:v:0] [1:a:0] [2:v:0] [2:a:0] concat=n=3:v=1:a=1[outv] [outa]\" \\-map \"[outv]\" -map \"[outa]\""
    
     };
    
    fFMpeg.ConcatMedia(inputfiles, finaloutput, Format.mp4, concatSettings);
    

    This gives me errors saying -

    [Parsed_concat_0 @ 04ded5e0] Input link in1:v0 parameters (size 852x480, SAR 160:213) do not match the corresponding output link in0:v0 parameters (852x480, SAR 12800:9443)
    [Parsed_concat_0 @ 04ded5e0] Failed to configure output pad on Parsed_concat_0
    Error configuring complex filters.
    
  • How to use hdfs as input directory for ffmpeg [on hold]

    23 décembre 2017, par Md khirul ashik

    Recently i have been working on ffmpeg and hadoop. My job requires reading data directly from hdfs. How ffmpeg can read and write data into hdfs.

  • Is H.264 used with CRF 0 really strictly lossless ?

    23 décembre 2017, par Mephisto

    I am surprised by how small files are when encoded in ffmpeg with the libx264 codec in Constant Rate Factor mode equals zero (-crf 0) that, according to the documentation, is "lossless".

    I would like to make sure what the word "lossless" here means. I would like to know if it follows my personal definition of lossless video: After encoding a video, you can confidently bet the life of your mother that, once you play it, the numerical values in the pixels of the restored video will be identically equal (within maybe a factor 0.00001 due to the floating point arithmetic) to the original.

    Does the H.264 lossless encoding follow my definition, or do they call it "lossless" because it is visually very close, very beautiful, whatever... ?

  • FFmpeg - combine 2 commands

    23 décembre 2017, par Damien

    I have 2 commands as listed below.

    Add intro image to a video

    ffmpeg -y -loop 1 -framerate 10 -t 3 -i intro.png -i video.mp4 -filter_complex "[0:0] [1:0] concat=n=2:v=1:a=0" -c:v libx264 -crf 23 videoWithIntro.mp4
    

    Add watermark to video

    ffmpeg -y -i video.mp4 -i watermark_color.png -filter_complex "overlay=x=(main_w-overlay_w)/2:y=(main_h-overlay_h)/2"  videoWithWatermark.mp4
    

    I was wondering is it possible to combine these into the 1 command?

  • ffmpeg concatenate with dynamic chunks

    22 décembre 2017, par vongolashu

    The ffmpeg docs for concat lists the following way
    ffmpeg -f concat -i mylist.txt -c copy output

    The mylist.txt file contains file like
    file '/path/to/file1'
    file '/path/to/file2'
    file '/path/to/file3'

    What I am looking is for a way to do this concat in a persistent way where the number of files can keep increasing, for example in livestreaming
    I will be sending chunks of video (mp4 files) of 10 seconds each to my server and want to concat/stitch them together to output to a RTMP stream (for livestreaming)

    If concat is not the proper way to do this, please suggest alternatives.

    Really interested to know how people use the above concept (I hope its how it works) to send video chunks from mobile device for livestreaming