Newest 'ffmpeg' Questions - Stack Overflow

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

Les articles publiés sur le site

  • FFmpeg command using setpts and atempo options mismatch audio and video

    23 décembre 2017, par Harshil Dholakiya

    I want to speed up audio and video accurately.

    When i execute this command, video generated successfully. But video still same as input video and audio speed up correctly, how to correct this issue.

    my command for this scenario is:(I am implemented this in android)

    -i, /storage/emulated/0/MP4_20171222_191425.mp4, \
    -i, /data/user/0/22122017_071452.png, \
    -i, /data/user/0/22122017_0714550.png, \
    -filter_complex, [1:v]scale=185:187[ovr1];\
    [2:v]scale=115:118[ovr2];\
    [0:v][ovr1] overlay=x=336.68634:y=5.8838935 [tmp];\
    [tmp][ovr2] overlay=x=110.51852:y=105.864914; \
    [0:v]setpts=0.5*PTS[v];\
    [0:a]atempo=2.0[a], \
    -map, [v], \
    -map, [a], \
    -c:v, libx264, \
    -c:a, aac, \
    -r, 60, \
    -preset, ultrafast, \
    /storage/emulated/0/Vid_22122017_071455.mp4
    

    What i am doing wrong? Thanks.

  • Segmentation of a live stream with FFmpeg into HLS

    23 décembre 2017, par Mehrab Azad

    I’m trying to record a live stream into my computer as .m3u8 files. So every 30minutes , it creates a m3.u8 file with following 10second .ts files. I already have done this task with .mp4 output file. So with the code shown below I can record my live stream into 15 minutes .mp4 file and named according to my local system time.

    ffmpeg -y -i udp://@239.1.0.85:3085 -c copy -f segment -segment_time 900 -reset_timestamps 1 -segment_atclocktime 1 -strftime 1 D:\Segment\%Y-%m-%d_%H-%M-%S.mp4
    

    Also I have done the conversion from an mp4 input into m3u8 file as shown below:

    ffmpeg -re -i D:\hls_files\V3005.mp4 -c:v h264 -c:a aac -f hls -hls_list_size 0 -g 10 -hls_time 10 -b:v 480k -minrate 480k -maxrate 480k -bufsize 960k D:\hls_files\output_480_.m3u8
    

    But I can’t figure out how to merge above lines into one line, so it can record my stream into 15minutes of m3u8 files. And the name of my m3u8 files to be my local system time.

    As a secondary question, is it possible to have 3 resolution m3u8 file? I have done it with this approach before:

    ffmpeg -re -i D:\hls_files\ V3005.mp4 -c:v h264 -c:a aac -f hls -hls_list_size 0 -g 10 -hls_time 10 -b:v 480k -minrate 480k -maxrate 480k -bufsize 960k D:\hls_files\ output_480_.m3u8 -c:v h264 -c:a aac -f hls -hls_list_size 0 -g 10 -hls_time 10 -b:v 720k -minrate 720k -maxrate 720k -bufsize 720k D:\hls_files\V3005\output_720_.m3u8 -c:v h264 -c:a aac -f hls -hls_list_size 0 -g 10 -hls_time 10 -b:v 1024k -minrate 1024k -maxrate 1024k -bufsize 1024k D:\hls_files \output_1024_.m3u8
    

    As you can see I have generated three different m3u8 output files with different resolutions and then made a master m3u8 file manually using notepad. Thanks.

  • FFmpeg command using setpts and atempo options mismatch audio and video in android

    23 décembre 2017, par Harshil Dholakiya

    I want to speed up audio and video accurately.

    When i execute this command, video generated successfully. But video still same as input video and audio speed up correctly, how to correct this issue.

    my command for this scenario is:(I am implemented this in android)

    -i, /storage/emulated/0/MP4_20171222_191425.mp4, \
    -i, /data/user/0/22122017_071452.png, \
    -i, /data/user/0/22122017_0714550.png, \
    -filter_complex, [1:v]scale=185:187[ovr1];\
    [2:v]scale=115:118[ovr2];\
    [0:v][ovr1] overlay=x=336.68634:y=5.8838935 [tmp];\
    [tmp][ovr2] overlay=x=110.51852:y=105.864914; \
    [0:v]setpts=0.5*PTS[v];\
    [0:a]atempo=2.0[a], \
    -map, [v], \
    -map, [a], \
    -c:v, libx264, \
    -c:a, aac, \
    -r, 60, \
    -preset, ultrafast, \
    /storage/emulated/0/Vid_22122017_071455.mp4
    

    What i am doing wrong? Thanks.

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