Newest 'ffmpeg' Questions - Stack Overflow

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

Les articles publiés sur le site

  • Sync 2 Audio Files [on hold]

    30 mars 2017, par Syed Armaan Hussain

    I have 2 audio (.wav) files recorded by two different persons. They are saying the same sentences but there is some differences in duration like the first audio is 10 sec long but other is 9 sec long. There are deifference in silences and lipsing. I want to sync these two audios . How can i achieve it . If anyone out there has already did research on it . Please share your experience. Or any SDK that can help me with this . I am using C# tried it with ffmpeg but didnt find any command for this.

    something like this https://digicompdiy.wordpress.com/2012/10/15/automatically-sync-up-two-audio-files/

    Reagrds

  • Extract video from streaming

    30 mars 2017, par David Puleri

    Imagine a live video being streamed from a HD Camera to a computer. I would like to place markers at various moment on this stream in order to extract the content between markers to a file.

    I am familiar with Scala but I could considere looking at any other technology do to the job.

    Any idea on how to get started with this crazy idea ? :D

    Thanks!

  • How to convert all files in a specific directory using batch script

    30 mars 2017, par sks

    I have videos in a folder of .h264 format and i want to convert them to mp4. now by default i can use ffmpeg to do this: Here is the command:

    ffmpeg -i youtube.flv -c:v libx264 filename.mp4
    

    But, new h264 files are being added and I want to keep converting the videos so as to use it for my python script.

    I know i can use this to initialize the variable

    SET /A num=1
    

    But how do i write a batch script to take all the videos from the directory one by one even though there new videos being added?

    I wrote this but this isn't working:

    @echo off
    SET /A num=1
    
    for file in E:\Records\1\*.h264
    do
        ffmpeg -i "$file" -c:v libx264 E:\Recods\1\converted\%num%.mp4
        move E:\Records\1\"$file" E:\Records\1\done\
        set /A num=%num%+1
    done
    PAUSE
    

    I am making a done folder and moving the videos that have been converted there and in converted folder i am putting converted videos.. Now i just have to run a task scheduler each hour so that if there is a new entry it should convert it and move it to appropriate folder.

  • FFmpeg Generate Thumbnail Efficiently

    30 mars 2017, par user1086010

    I am using FFmpeg for generating timeline thumbnail preview (image preview when your hover over seekbar in video player , like youtube player)

    I need generating thumbnail for every 20s . Here is code i use :

    ffmpeg -i vide.mp4 -vf "fps=4/60 ,scale=260:150,tile=10*10" -qscale:v 10 thumbnail_%d.jpg

    Code Work's Fine , only problem i have it's slow , for a movie with 3 hour long it's take more than 6 minute to generate thumbnail.

    My System spec : Max os x 10.12 , Core i5 6600 , 16GB Ram.

    I want's know there's a better way to do this ?

  • Why PTS and DTS are same in my stream ?

    30 mars 2017, par MayurK

    I am testing a mp4 file with H264 video using ffprobe. I am using the following command to get frame information.

    ffprobe -i  -show_frames -select_streams v
    

    I get the following output.

    [FRAME]
    media_type=video
    stream_index=0
    key_frame=1
    pkt_pts=0
    pkt_pts_time=0.000000
    pkt_dts=0
    pkt_dts_time=0.000000
    best_effort_timestamp=0
    best_effort_timestamp_time=0.000000
    pkt_duration=512
    pkt_duration_time=0.033333
    pkt_pos=48
    pkt_size=513516
    width=1920
    height=1920
    pix_fmt=yuv420p
    sample_aspect_ratio=1:1
    pict_type=I
    coded_picture_number=0
    display_picture_number=0
    interlaced_frame=0
    top_field_first=0
    repeat_pict=0
    [/FRAME]
    [FRAME]
    media_type=video
    stream_index=0
    key_frame=0
    pkt_pts=512
    pkt_pts_time=0.033333
    pkt_dts=512
    pkt_dts_time=0.033333
    best_effort_timestamp=512
    best_effort_timestamp_time=0.033333
    pkt_duration=512
    pkt_duration_time=0.033333
    pkt_pos=513564
    pkt_size=3299
    width=1920
    height=1920
    pix_fmt=yuv420p
    sample_aspect_ratio=1:1
    pict_type=P
    coded_picture_number=1
    display_picture_number=0
    interlaced_frame=0
    top_field_first=0
    repeat_pict=0
    [/FRAME]
    [FRAME]
    media_type=video
    stream_index=0
    key_frame=0
    pkt_pts=1024
    pkt_pts_time=0.066667
    pkt_dts=1024
    pkt_dts_time=0.066667
    best_effort_timestamp=1024
    best_effort_timestamp_time=0.066667
    pkt_duration=512
    pkt_duration_time=0.033333
    pkt_pos=823989
    pkt_size=40971
    width=1920
    height=1920
    pix_fmt=yuv420p
    sample_aspect_ratio=1:1
    pict_type=B
    coded_picture_number=4
    display_picture_number=0
    interlaced_frame=0
    top_field_first=0
    repeat_pict=0
    [/FRAME]
    [FRAME]
    media_type=video
    stream_index=0
    key_frame=0
    pkt_pts=1536
    pkt_pts_time=0.100000
    pkt_dts=1536
    pkt_dts_time=0.100000
    best_effort_timestamp=1536
    best_effort_timestamp_time=0.100000
    pkt_duration=512
    pkt_duration_time=0.033333
    pkt_pos=784312
    pkt_size=38785
    width=1920
    height=1920
    pix_fmt=yuv420p
    sample_aspect_ratio=1:1
    pict_type=B
    coded_picture_number=3
    display_picture_number=0
    interlaced_frame=0
    top_field_first=0
    repeat_pict=0
    [/FRAME]
    [FRAME]
    media_type=video
    stream_index=0
    key_frame=0
    pkt_pts=2048
    pkt_pts_time=0.133333
    pkt_dts=2048
    pkt_dts_time=0.133333
    best_effort_timestamp=2048
    best_effort_timestamp_time=0.133333
    pkt_duration=512
    pkt_duration_time=0.033333
    pkt_pos=516886
    pkt_size=267344
    width=1920
    height=1920
    pix_fmt=yuv420p
    sample_aspect_ratio=1:1
    pict_type=P
    coded_picture_number=2
    display_picture_number=0
    interlaced_frame=0
    top_field_first=0
    repeat_pict=0
    [/FRAME]
    

    My mp4 file has I, P and B frames. I understand that DTS is decode time stamp and it will be in incrementing order in decoder input stream. PTS is presentation time stamp and it will be in incrementing order in decoder output stream.

    I do not understand why I am getting same PTS and DTS values for all frames. I think they should be different when B frames are present in the stream.

    Somebody please help me in understanding this?