Recherche avancée

Médias (0)

Mot : - Tags -/xmlrpc

Aucun média correspondant à vos critères n’est disponible sur le site.

Autres articles (61)

  • L’agrémenter visuellement

    10 avril 2011

    MediaSPIP est basé sur un système de thèmes et de squelettes. Les squelettes définissent le placement des informations dans la page, définissant un usage spécifique de la plateforme, et les thèmes l’habillage graphique général.
    Chacun peut proposer un nouveau thème graphique ou un squelette et le mettre à disposition de la communauté.

  • Les autorisations surchargées par les plugins

    27 avril 2010, par

    Mediaspip core
    autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs

  • Personnaliser les catégories

    21 juin 2013, par

    Formulaire de création d’une catégorie
    Pour ceux qui connaissent bien SPIP, une catégorie peut être assimilée à une rubrique.
    Dans le cas d’un document de type catégorie, les champs proposés par défaut sont : Texte
    On peut modifier ce formulaire dans la partie :
    Administration > Configuration des masques de formulaire.
    Dans le cas d’un document de type média, les champs non affichés par défaut sont : Descriptif rapide
    Par ailleurs, c’est dans cette partie configuration qu’on peut indiquer le (...)

Sur d’autres sites (11908)

  • FFmpeg output video is not seekable. Output video is not playing instantly instead browser loads it completely then plays it

    19 février 2024, par Mohit56

    Hi I am using ffmpeg to transcode video. In my code I have used 'fluent-ffmpeg' npm package with nodeJs and 'aws-sdk' to save output video by writestream into s3 bucket.

    


    Problem
-> Video is getting transcoded and I am successfully able to save the video into s3 bucket but. As I paste the object_url of that video into browser and try to play, but that video is not playing instantly I have checked on 'developer console tool' browser is loading all the video once that is done then only it starts playing that is a problem.

    


    ->Let say if I have output video of size 10GB on that case browser will load all 10GB data then only it will start playing that video.

    


    ->If I am not using writestream approach and directly upload the video into local directory first then upload into s3 bucket, In this case if I play the video using object URL then that video plays instantly. In this case I don't have to wait for whole 10GB video to load then play it which is good.

    


    -> Can anybody help me to fix my writestream solution because I don't want to save the output video into my localdirectory. I want to writestream the output video directly into s3 bucket.

    


    Code Snippet

    


    const ffmpeg = require('fluent-ffmpeg');
const AWS = require('aws-sdk'); 
const stream = require("stream");

//set up your aws connection

const command = ffmpeg(inputVideoURL) 
.outputOptions(['-movflags', 'frag_keyframe']) 
.size('854x480') // set the desired resolution (480p) .outputFormat('mp4') 
.videoCodec('libx264') 
.audioCodec('aac') 
.on('progress',(p)=>{ console.log(p) }) 
.on('stderr',(err)=>console.log(err)) 
.on('start', commandLine => console.log('Spawned FFmpeg with command: ' + commandLine)) 
.on('end', () => console.log('Transcoding finished.')) 
.on('error', err => console.error('Error:', err))

//=>To save file into s3 using write steam. command.writeToStream(uploadFolderFileWriteStream('StreamCheck/output2.mp4'));

function uploadFolderFileWriteStream(fileName) { try { const pass = new stream.PassThrough();

const params = {
  Bucket: bucketName,
  Key: fileName,
  Body: pass,
  ACL: "public-read",
  ContentType:'video/mp4' ,
};

const upload = s3.upload(params);

upload.on('error', function(err) {
  console.log("Error uploading to S3:", err);
});

upload.send(function(err, data) {
  if(err) console.log(err);
  else console.log("Upload to S3 completed:", data);
});

return pass;

} catch (err) { console.log("[S3 createWriteStream]", err); } }


    


    I have tried below option as well be all of them not worked 
-> .addOption("-movflags frag_keyframe+empty_moov") 
-> .addOption('-movflags', 'frag_keyframe+empty_moov') 
-> .addOutputOption("-movflags +faststart")
-> .addOption('-movflags', 'faststart+frag_keyframe+empty_moov+default_base_moof')


    


  • Getting small file size from ffmpeg [duplicate]

    20 février 2020, par sukach

    I am not an ffmpeg expert. I am trying to get some movies converted to a smaller DIVX file for a cheap portable DVD player for a family trip. The movies are for my kids so I’m not too concerned about quality.

    The DVD player is a 10.1", 1024x600 screen. It says it supports DIVX/MPEG2 files. It took me a lot of experimentation to get the right ffmpeg settings to even get it to work, but I found another answer that provided a very complex set of parameters that ultimately worked.

    I have converted about 20 movies with this setting and every one results in a file size of 1.1GB. I have tried different file sizes and crf settings and it is the same every time.

    Here is an example. First, the original file :

    General
    Complete name                            : Charlotte's Web.m4v
    Format                                   : MPEG-4
    Format profile                           : Base Media / Version 2
    Codec ID                                 : mp42 (isom/iso2/avc1/mp41)
    File size                                : 4.17 GiB
    Duration                                 : 1 h 36 min
    Overall bit rate mode                    : Variable
    Overall bit rate                         : 6 161 kb/s
    Movie name                               : Charlotte's Web
    Performer                                : Julia Roberts, Steve Buscemi, John Cleese, Oprah Winfrey, Cedric the Entertainer, Reba McEntire, Kathy Bates, Robert Redford, Thomas Haden Church, André Benjamin, Dominic Scott Kay, Sam Shepard, Abraham Benrubi, Dakota Fanning, Kevin Anderson, Essie Davis, Siobhan Fallon, Louis Corbett, Robyn Arthur, Julian O'Donnell, Gary Basaraba, Nate Mooney, Nicholas Bell, Beau Bridges, Teague Rook, Julia Zemiro, Denise Kirby, Robert Plazek, Joseph Lotesto, Michael Roland, Don Bridges, Ian Watkin, Joel McCrary, Brian Stepanek, Fred Tatasciore, Bradley White, Maia Kirkpatrick, Jennessa Rose, Briana Hodge, Dale Azzopardi, Geoff Burgess, Ella Scott Lynch, Greg Marian, Stefano Mazzeo, Elizabeth Saunders
    Director                                 : Gary Winick
    Actor                                    : Julia Roberts / Steve Buscemi / John Cleese / Oprah Winfrey / Cedric the Entertainer / Reba McEntire / Kathy Bates / Robert Redford / Thomas Haden Church / André Benjamin / Dominic Scott Kay / Sam Shepard / Abraham Benrubi / Dakota Fanning / Kevin Anderson / Essie Davis / Siobhan Fallon / Louis Corbett / Robyn Arthur / Julian O'Donnell / Gary Basaraba / Nate Mooney / Nicholas Bell / Beau Bridges / Teague Rook / Julia Zemiro / Denise Kirby / Robert Plazek / Joseph Lotesto / Michael Roland / Don Bridges / Ian Watkin / Joel McCrary / Brian Stepanek / Fred Tatasciore / Bradley White / Maia Kirkpatrick / Jennessa Rose / Briana Hodge / Dale Azzopardi / Geoff Burgess / Ella Scott Lynch / Greg Marian / Stefano Mazzeo / Elizabeth Saunders
    Screenplay by                            : Karey Kirkpatrick / Susannah Grant / Earl Hamner / Jr. / E.B. White
    Producer                                 : Julia Pistor / Jordan Kerner / Paul Neesan / Edgar M. Bronfman / Bernard Williams / Tony Winley
    Genre                                    : Comedy
    ContentType                              : Short Film
    Description                              : Wilbur the pig is scared of the end of the season, because he knows that come that time, he will end up on the dinner table. He hatches a plan with Charlotte, a spider that lives in his pen, to ensure that this will never happen.
    Recorded date                            : UTC 2006-12-15 11:00:00
    Encoded date                             : UTC 2017-01-23 02:37:54
    Tagged date                              : UTC 2017-01-24 01:19:52
    Writing application                      : HandBrake 1.0.1 2016122900
    Cover                                    : Yes
    LongDescription                          : Wilbur the pig is scared of the end of the season, because he knows that come that time, he will end up on the dinner table. He hatches a plan with Charlotte, a spider that lives in his pen, to ensure that this will never happen.
    ContentRating                            : mpaa|G|100|

    Video
    ID                                       : 1
    Format                                   : AVC
    Format/Info                              : Advanced Video Codec
    Format profile                           : High@L4
    Format settings                          : CABAC / 4 Ref Frames
    Format settings, CABAC                   : Yes
    Format settings, ReFrames                : 4 frames
    Codec ID                                 : avc1
    Codec ID/Info                            : Advanced Video Coding
    Duration                                 : 1 h 36 min
    Bit rate                                 : 5 691 kb/s
    Width                                    : 1 920 pixels
    Height                                   : 1 080 pixels
    Display aspect ratio                     : 16:9
    Frame rate mode                          : Variable
    Frame rate                               : 23.976 (24000/1001) FPS
    Minimum frame rate                       : 23.974 FPS
    Maximum frame rate                       : 23.981 FPS
    Color space                              : YUV
    Chroma subsampling                       : 4:2:0
    Bit depth                                : 8 bits
    Scan type                                : Progressive
    Bits/(Pixel*Frame)                       : 0.114
    Stream size                              : 3.86 GiB (92%)
    Writing library                          : x264 core 148 r2708 86b7198
    Encoding settings                        : cabac=1 / ref=3 / deblock=1:-1:-1 / analyse=0x3:0x113 / me=hex / subme=7 / psy=1 / psy_rd=1.00:0.15 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-3 / threads=6 / lookahead_threads=1 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=3 / b_pyramid=2 / b_adapt=1 / b_bias=0 / direct=1 / weightb=1 / open_gop=0 / weightp=2 / keyint=240 / keyint_min=24 / scenecut=40 / intra_refresh=0 / rc_lookahead=40 / rc=crf / mbtree=1 / crf=22.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / vbv_maxrate=25000 / vbv_bufsize=31250 / crf_max=0.0 / nal_hrd=none / filler=0 / ip_ratio=1.40 / aq=1:1.00
    Encoded date                             : UTC 2017-01-23 02:37:54
    Tagged date                              : UTC 2017-01-23 02:37:54
    Color range                              : Limited
    Color primaries                          : BT.709
    Transfer characteristics                 : BT.709
    Matrix coefficients                      : BT.709
    Menus                                    : 4

    Here is the first encode settings :

    ffmpeg -i "$1" -sn -c:a libmp3lame -ar 48000 -ab 128k -ac 2 -c:v mpeg4 -crf 24 -vtag DIVX -vf scale=1024x600:force_original_aspect_ratio=decrease -mbd rd -flags +mv4+aic -trellis 2 -cmp 2 -subcmp 2 -g 30 -vb 1500k "$2"

    And the resulting mediainfo :

    General
    Complete name                            : Charlotte's Web (2006) - DIVX.avi
    Format                                   : AVI
    Format/Info                              : Audio Video Interleave
    Format profile                           : OpenDML
    File size                                : 1.11 GiB
    Duration                                 : 1 h 36 min
    Overall bit rate                         : 1 644 kb/s
    Movie name                               : Charlotte's Web
    Director                                 : Julia Roberts, Steve Buscemi, John Cleese, Oprah Winfrey, Cedric the Entertainer, Reba McEntire, Kathy Bates, Robert Redford, Thomas Haden Church, André Benjamin, Dominic Scott Kay, Sam Shepard, Abraham Benrubi, Dakota Fanning, Kevin Anderson, Essie Davis, Siobhan Fallon, Louis Corbett, Robyn Arthur, Julian O'Donnell, Gary Basaraba, Nate Mooney, Nicholas Bell, Beau Bridges, Teague Rook, Julia Zemiro, Denise Kirby, Robert Plazek, Joseph Lotesto, Michael Roland, Don Bridges, Ian Watkin, Joel McCrary, Brian Stepanek, Fred Tatasciore, Bradley White, Maia Kirkpatrick, Jennessa Rose, Briana Hodge, Dale Azzopardi, Geoff Burgess, Ella Scott Lynch, Greg Marian, Stefano Mazzeo, Elizabeth Saunders
    Genre                                    : Comedy
    Recorded date                            : UTC 2006-12-15 11:00:00
    Writing application                      : Lavf57.56.100

    Video
    ID                                       : 0
    Format                                   : MPEG-4 Visual
    Format profile                           : Simple@L1
    Format settings, BVOP                    : No
    Format settings, QPel                    : No
    Format settings, GMC                     : No warppoints
    Format settings, Matrix                  : Default (H.263)
    Codec ID                                 : DIVX
    Codec ID/Info                            : Project Mayo
    Codec ID/Hint                            : DivX 4
    Duration                                 : 1 h 36 min
    Bit rate                                 : 1 500 kb/s
    Width                                    : 1 024 pixels
    Height                                   : 576 pixels
    Display aspect ratio                     : 16:9
    Frame rate                               : 23.976 (24000/1001) FPS
    Color space                              : YUV
    Chroma subsampling                       : 4:2:0
    Bit depth                                : 8 bits
    Scan type                                : Progressive
    Compression mode                         : Lossy
    Bits/(Pixel*Frame)                       : 0.106
    Stream size                              : 1.02 GiB (91%)
    Writing library                          : Lavc57.64.100

    Here was my attempt at a smaller file size (lower crf and smaller scale setting) :

    ffmpeg -i "Charlotte's Web.m4v" -sn -c:a libmp3lame -ar 48000 -ab 128k -ac 2 -c:v mpeg4 -crf 30 -vtag DIVX -vf scale=800:480 -mbd rd -flags +mv4+aic -trellis 2 -cmp 2 -subcmp 2 -g 30 -vb 1500k "Charlotte's Web (2006) - DIVX 2.avi"

    And the resulting mediainfo :

    General
    Complete name                            : Charlotte's Web (2006) - DIVX 2.avi
    Format                                   : AVI
    Format/Info                              : Audio Video Interleave
    Format profile                           : OpenDML
    File size                                : 1.11 GiB
    Duration                                 : 1 h 36 min
    Overall bit rate                         : 1 643 kb/s
    Movie name                               : Charlotte's Web
    Director                                 : Julia Roberts, Steve Buscemi, John Cleese, Oprah Winfrey, Cedric the Entertainer, Reba McEntire, Kathy Bates, Robert Redford, Thomas Haden Church, André Benjamin, Dominic Scott Kay, Sam Shepard, Abraham Benrubi, Dakota Fanning, Kevin Anderson, Essie Davis, Siobhan Fallon, Louis Corbett, Robyn Arthur, Julian O'Donnell, Gary Basaraba, Nate Mooney, Nicholas Bell, Beau Bridges, Teague Rook, Julia Zemiro, Denise Kirby, Robert Plazek, Joseph Lotesto, Michael Roland, Don Bridges, Ian Watkin, Joel McCrary, Brian Stepanek, Fred Tatasciore, Bradley White, Maia Kirkpatrick, Jennessa Rose, Briana Hodge, Dale Azzopardi, Geoff Burgess, Ella Scott Lynch, Greg Marian, Stefano Mazzeo, Elizabeth Saunders
    Genre                                    : Comedy
    Recorded date                            : UTC 2006-12-15 11:00:00
    Writing application                      : Lavf57.56.100

    Video
    ID                                       : 0
    Format                                   : MPEG-4 Visual
    Format profile                           : Simple@L1
    Format settings, BVOP                    : No
    Format settings, QPel                    : No
    Format settings, GMC                     : No warppoints
    Format settings, Matrix                  : Default (H.263)
    Codec ID                                 : DIVX
    Codec ID/Info                            : Project Mayo
    Codec ID/Hint                            : DivX 4
    Duration                                 : 1 h 36 min
    Bit rate                                 : 1 499 kb/s
    Width                                    : 800 pixels
    Height                                   : 480 pixels
    Display aspect ratio                     : 16:9
    Frame rate                               : 23.976 (24000/1001) FPS
    Color space                              : YUV
    Chroma subsampling                       : 4:2:0
    Bit depth                                : 8 bits
    Scan type                                : Progressive
    Compression mode                         : Lossy
    Bits/(Pixel*Frame)                       : 0.163
    Stream size                              : 1.02 GiB (91%)
    Writing library                          : Lavc57.64.100

    Same file size but lower resolution.

    Any ideas on what the best settings to achieve my goal ?

  • Building FFMpeg 1.0.1 for Android gives me an error with make install

    23 décembre 2013, par Fabien Henon

    I'm trying to build FFMpeg 1.0.1 for Android.

    I followed this tutorial : http://www.packtpub.com/sites/default/files/downloads/Developing_Multimedia_Applications_with_NDK.pdf (part Porting the ffmpeg library to Android with NDK).

    Thus, in my ffmpeg folder I have a script build_android.sh and here is the content :

    #!/bin/bash
    NDK=/Users/me/android-ndk
    SYSROOT=$NDK/platforms/android-8/arch-arm/
    TOOLCHAIN=$NDK/toolchains/arm-linux-androideabi-4.6/prebuilt/darwin-x86_64
    function build_one
    {
    ./configure \
    --prefix=$PREFIX \
    --disable-shared \
    --enable-static \
    --disable-doc \
    --disable-ffmpeg \
    --disable-ffplay \
    --disable-ffprobe \
    --disable-ffserver \
    --disable-avdevice \
    --disable-doc \
    --disable-symver \
    --cross-prefix=$TOOLCHAIN/bin/arm-linux-androideabi- \
    --target-os=linux \
    --arch=arm \
    --enable-cross-compile \
    --sysroot=$SYSROOT \
    --extra-cflags="-Os -fpic $ADDI_CFLAGS" \
    --extra-ldflags="$ADDI_LDFLAGS" \
    $ADDITIONAL_CONFIGURE_FLAG
    make clean
    make
    make install
    }
    CPU=arm
    PREFIX=$(pwd)/android/$CPU
    ADDI_CFLAGS="-marm"
    build_one

    That was working fine mith version 2.1 of ffmpeg but with version 1.0.1 and other versions it does not work.

    I have the following error :

    ...
    CC  libavutil/random_seed.o
    CC  libavutil/rational.o
    CC  libavutil/rc4.o
    CC  libavutil/samplefmt.o
    CC  libavutil/sha.o
    CC  libavutil/time.o
    CC  libavutil/timecode.o
    CC  libavutil/tree.o
    CC  libavutil/utils.o
    CC  libavutil/xtea.o
    AR  libavutil/libavutil.a
    INSTALL libavfilter/libavfilter.a
    ./install: line 2: syntax error near unexpected token `)'
    ./install: line 2: `1) Type './configure' to create the configuration. A list of configure'
    make: *** [install-libavfilter-static] Error 2

    I'm using NDK 9r and Mac OSX.

    So the configure command works fine, the make commmand too, but the make install is not working and is giving me the error.

    Can you help me with this issue ?

    For you information, ./install is (in my opinion) the INSTALL file which has this content :

    1) Type './configure' to create the configuration. A list of configure
    options is printed by running 'configure --help'.

    'configure' can be launched from a directory different from the FFmpeg
    sources to build the objects out of tree. To do this, use an absolute
    path when launching 'configure', e.g. '/ffmpegdir/ffmpeg/configure'.

    2) Then type 'make' to build FFmpeg. GNU Make 3.81 or later is required.

    3) Type 'make install' to install all binaries and libraries you built.

    NOTICE

    - Non system dependencies (e.g. libx264, libvpx) are disabled by default.

    I don't know why make install tries to execute this file. Here is the content of the Makefile :

    MAIN_MAKEFILE=1
    include config.mak

    vpath %.c    $(SRC_PATH)
    vpath %.cpp  $(SRC_PATH)
    vpath %.h    $(SRC_PATH)
    vpath %.S    $(SRC_PATH)
    vpath %.asm  $(SRC_PATH)
    vpath %.v    $(SRC_PATH)
    vpath %.texi $(SRC_PATH)
    vpath %/fate_config.sh.template $(SRC_PATH)

    PROGS-$(CONFIG_FFMPEG)   += ffmpeg
    PROGS-$(CONFIG_FFPLAY)   += ffplay
    PROGS-$(CONFIG_FFPROBE)  += ffprobe
    PROGS-$(CONFIG_FFSERVER) += ffserver

    PROGS      := $(PROGS-yes:%=%$(PROGSSUF)$(EXESUF))
    INSTPROGS   = $(PROGS-yes:%=%$(PROGSSUF)$(EXESUF))
    OBJS        = cmdutils.o
    OBJS-ffmpeg = ffmpeg_opt.o ffmpeg_filter.o
    TESTTOOLS   = audiogen videogen rotozoom tiny_psnr base64
    HOSTPROGS  := $(TESTTOOLS:%=tests/%) doc/print_options
    TOOLS       = qt-faststart trasher
    TOOLS-$(CONFIG_ZLIB) += cws2fws

    BASENAMES   = ffmpeg ffplay ffprobe ffserver
    ALLPROGS    = $(BASENAMES:%=%$(PROGSSUF)$(EXESUF))
    ALLPROGS_G  = $(BASENAMES:%=%$(PROGSSUF)_g$(EXESUF))
    ALLMANPAGES = $(BASENAMES:%=%.1)

    FFLIBS-$(CONFIG_AVDEVICE) += avdevice
    FFLIBS-$(CONFIG_AVFILTER) += avfilter
    FFLIBS-$(CONFIG_AVFORMAT) += avformat
    FFLIBS-$(CONFIG_AVRESAMPLE) += avresample
    FFLIBS-$(CONFIG_AVCODEC)  += avcodec
    FFLIBS-$(CONFIG_POSTPROC) += postproc
    FFLIBS-$(CONFIG_SWRESAMPLE)+= swresample
    FFLIBS-$(CONFIG_SWSCALE)  += swscale

    FFLIBS := avutil

    DATA_FILES := $(wildcard $(SRC_PATH)/presets/*.ffpreset) $(SRC_PATH)/doc/ffprobe.xsd
    EXAMPLES_FILES := $(wildcard $(SRC_PATH)/doc/examples/*.c) $(SRC_PATH)/doc/examples/Makefile

    SKIPHEADERS = cmdutils_common_opts.h

    include $(SRC_PATH)/common.mak

    FF_EXTRALIBS := $(FFEXTRALIBS)
    FF_DEP_LIBS  := $(DEP_LIBS)

    all: $(PROGS)

    $(PROGS): %$(EXESUF): %_g$(EXESUF)
       $(CP) $< $@
       $(STRIP) $@

    $(TOOLS): %$(EXESUF): %.o
       $(LD) $(LDFLAGS) $(LD_O) $< $(ELIBS)

    tools/cws2fws$(EXESUF): ELIBS = $(ZLIB)

    config.h: .config
    .config: $(wildcard $(FFLIBS:%=$(SRC_PATH)/lib%/all*.c))
       @-tput bold 2>/dev/null
       @-printf '\nWARNING: $(?F) newer than config.h, rerun configure\n\n'
       @-tput sgr0 2>/dev/null

    SUBDIR_VARS := CLEANFILES EXAMPLES FFLIBS HOSTPROGS TESTPROGS TOOLS      \
                  ARCH_HEADERS BUILT_HEADERS SKIPHEADERS                    \
                  ARMV5TE-OBJS ARMV6-OBJS ARMVFP-OBJS NEON-OBJS             \
                  MMI-OBJS ALTIVEC-OBJS VIS-OBJS                            \
                  MMX-OBJS YASM-OBJS                                        \
                  MIPSFPU-OBJS MIPSDSPR2-OBJS MIPSDSPR1-OBJS MIPS32R2-OBJS  \
                  OBJS HOSTOBJS TESTOBJS

    define RESET
    $(1) :=
    $(1)-yes :=
    endef

    define DOSUBDIR
    $(foreach V,$(SUBDIR_VARS),$(eval $(call RESET,$(V))))
    SUBDIR := $(1)/
    include $(SRC_PATH)/$(1)/Makefile
    -include $(SRC_PATH)/$(1)/$(ARCH)/Makefile
    include $(SRC_PATH)/library.mak
    endef

    $(foreach D,$(FFLIBS),$(eval $(call DOSUBDIR,lib$(D))))

    define DOPROG
    OBJS-$(1) += $(1).o
    $(1)$(PROGSSUF)_g$(EXESUF): $(OBJS-$(1))
    $$(OBJS-$(1)): CFLAGS  += $(CFLAGS-$(1))
    $(1)$(PROGSSUF)_g$(EXESUF): LDFLAGS += $(LDFLAGS-$(1))
    $(1)$(PROGSSUF)_g$(EXESUF): FF_EXTRALIBS += $(LIBS-$(1))
    -include $$(OBJS-$(1):.o=.d)
    endef

    $(foreach P,$(PROGS-yes),$(eval $(call DOPROG,$(P))))

    %$(PROGSSUF)_g$(EXESUF): %.o cmdutils.o $(FF_DEP_LIBS)
       $(LD) $(LDFLAGS) $(LD_O) $(OBJS-$*) cmdutils.o $(FF_EXTRALIBS)

    OBJDIRS += tools

    -include $(wildcard tools/*.d)

    VERSION_SH  = $(SRC_PATH)/version.sh
    GIT_LOG     = $(SRC_PATH)/.git/logs/HEAD

    .version: $(wildcard $(GIT_LOG)) $(VERSION_SH) config.mak
    .version: M=@

    version.h .version:
       $(M)$(VERSION_SH) $(SRC_PATH) version.h $(EXTRA_VERSION)
       $(Q)touch .version

    # force version.sh to run whenever version might have changed
    -include .version

    ifdef PROGS
    install: install-progs install-data
    endif

    install: install-libs install-headers

    install-libs: install-libs-yes

    install-progs-yes:
    install-progs-$(CONFIG_SHARED): install-libs

    install-progs: install-progs-yes $(PROGS)
       $(Q)mkdir -p "$(BINDIR)"
       $(INSTALL) -c -m 755 $(INSTPROGS) "$(BINDIR)"

    install-data: $(DATA_FILES) $(EXAMPLES_FILES)
       $(Q)mkdir -p "$(DATADIR)/examples"
       $(INSTALL) -m 644 $(DATA_FILES) "$(DATADIR)"
       $(INSTALL) -m 644 $(EXAMPLES_FILES) "$(DATADIR)/examples"

    uninstall: uninstall-libs uninstall-headers uninstall-progs uninstall-data

    uninstall-progs:
       $(RM) $(addprefix "$(BINDIR)/", $(ALLPROGS))

    uninstall-data:
       $(RM) -r "$(DATADIR)"

    clean::
       $(RM) $(ALLPROGS) $(ALLPROGS_G)
       $(RM) $(CLEANSUFFIXES)
       $(RM) $(TOOLS)
       $(RM) $(CLEANSUFFIXES:%=tools/%)
       $(RM) coverage.info
       $(RM) -r coverage-html

    distclean::
       $(RM) $(DISTCLEANSUFFIXES)
       $(RM) config.* .version version.h libavutil/avconfig.h libavcodec/codec_names.h

    config:
       $(SRC_PATH)/configure $(value FFMPEG_CONFIGURATION)

    # Without the sed genthml thinks "libavutil" and "./libavutil" are two different things
    coverage.info: $(wildcard *.gcda *.gcno */*.gcda */*.gcno */*/*.gcda */*/*.gcno)
       $(Q)lcov -c -d . -b . | sed -e 's#/./#/#g' > $@

    coverage-html: coverage.info
       $(Q)mkdir -p $@
       $(Q)genhtml -o $@ $<
       $(Q)touch $@

    check: all alltools examples testprogs fate

    include $(SRC_PATH)/doc/Makefile
    include $(SRC_PATH)/tests/Makefile

    $(sort $(OBJDIRS)):
       $(Q)mkdir -p $@

    # Dummy rule to stop make trying to rebuild removed or renamed headers
    %.h:
       @:

    # Disable suffix rules.  Most of the builtin rules are suffix rules,
    # so this saves some time on slow systems.
    .SUFFIXES:

    .PHONY: all all-yes alltools check *clean config install*
    .PHONY: testprogs uninstall*