Newest 'ffmpeg' Questions - Stack Overflow

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

Les articles publiés sur le site

  • ffmpeg How to add multiple drawtext to one input video

    22 mai 2018, par Raven

    I need to add two texts to a video. First text appears in the bottom right for the first 6 seconds, and the second text at the center of the video for the last 3 seconds.

    Below is my code:

    ffmpeg -i input.mp4 -vf drawtext="text='Stack Overflow': fontcolor=white: borderw=2: fontfile=Arial Black: fontsize=w*0.04: x=(w-text_w)-(w*0.04): y=(h-text_h)-(w*0.04): enable='between(t,0,6)'", -vf drawtext="text='Stack Overflow': fontcolor=white: borderw=2: fontfile=Arial Black: fontsize=w*0.04: x=(w-text_w)/2: y=(h-text_h)/2: enable='between(t,7,10)'" -codec:a copy output2.mp4
    

    I don't get any error running the above code but in the output file, only the second drawtext is applied.

  • Get dimension of a video using regex and ffmpeg

    22 mai 2018, par George Chalhoub

    If I have this string given by a ffmpeg command when you try to get information about a video:

    Copyright (c) 2000-2015 the FFmpeg developers built with gcc 4.4.7 (GCC) 20120313 (Red Hat 4.4.7-11) configuration: --prefix=/usr/local/cpffmpeg --enable-shared --enable-nonfree --enable-gpl --enable-pthreads --enable-libopencore-amrnb --enable-decoder=liba52 --enable-libopencore-amrwb --enable-libfaac --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --extra-cflags=-I/usr/local/cpffmpeg/include/ --extra-ldflags=-L/usr/local/cpffmpeg/lib --enable-version3 --extra-version=syslint libavutil 54. 19.100 / 54. 19.100 libavcodec 56. 26.100 / 56. 26.100 libavformat 56. 23.106 / 56. 23.106 libavdevice 56. 4.100 / 56. 4.100 libavfilter 5. 11.102 / 5. 11.102 libswscale 3. 1.101 / 3. 1.101 libswresample 1. 1.100 / 1. 1.100 libpostproc 53. 3.100 / 53. 3.100Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/var/zpanel/hostdata/zadmin/public_html/chandelier.mp4': Metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2avc1mp41 URL : Follow Me On > www.hamhame1.in compilation : 0 title : Follow Me On > www.hamhame1.in artist : Follow Me On > www.hamhame1.in album : Follow Me On > www.hamhame1.in date : Follow Me On > www.hamhame1.in genre : Follow Me On > www.hamhame1.in comment : Follow Me On > www.hamhame1.in composer : Follow Me On > www.hamhame1.in original_artist : Follow Me On > www.hamhame1.in copyright : Follow Me On > www.hamhame1.in encoder : Follow Me On > www.hamhame1.in album_artist : Follow Me On > www.hamhame1.in season_number : 0 episode_sort : 0 track : 0 disc : 0 media_type : 0 Duration: 00:03:51.35, start: 0.000000, bitrate: 2778 kb/s Stream 0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x1080 [SAR 1:1 > DAR 16:9], 2646 kb/s, 23.98 fps, 23.98 tbr, 90k tbn, 47.95 tbc (default) Metadata: handler_name : VideoHandler Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 125 kb/s (default) Metadata: handler_name : SoundHandlerAt least one output file must be specified

    In this case video dimension is: 1920x1080

    How can I export video dimension knowing that yuv420p and [SAR 1:1 > DAR 16:9] might be different (and also that. 1920x1080 could be 402x250 or 24x59). I'm not really interested in using third-party classes.

  • get video resolution from ffpmeg [duplicate]

    22 mai 2018, par MertTheGreat

    I try to get resolution of a video file, and hope this code would help thanks to arionik from GitHub

    from subprocess import Popen, PIPE
    
    def getWH(pathvideofile):
    in_pipe = Popen(["ffmpeg", "-i", "\"%s\"" % (pathvideofile)], stderr=PIPE)
    lines = in_pipe.stderr.readlines()
    for line in lines:
        rx = re.compile('.+Video.+, (\d{2,4})x(\d{2,4}).+')
        m = rx.match(line)
        if m is not None:
            w = int(m.group(1))
            h = int(m.group(2))
    return w, h
    

    But get this error code:

    m = rx.match(line)
    TypeError: cannot use a string pattern on a bytes-like object
    

    What it could be?

    Thank you,

  • ffmpeg drawtext filter with zoom in effect

    21 mai 2018, par testaccount wizorbit

    I am using draw text filter to display text on video.i need to add zoom in and zoom out filter on text. is there any command for zoom in and zoom out the text on video.

  • How do you use ffmpeg to change video saturation over time ?

    21 mai 2018, par Di Xiao
    ffmpeg -i out.mp4 -vf eq=brightness=0.1:saturation=0.5*t:1:0.5*t -c:a copy output.mp4
    

    Use the parameter t, but it doesn't work.