Recherche avancée

Médias (0)

Mot : - Tags -/masques

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

Autres articles (35)

  • Supporting all media types

    13 avril 2011, par

    Unlike most software and media-sharing platforms, MediaSPIP aims to manage as many different media types as possible. The following are just a few examples from an ever-expanding list of supported formats : images : png, gif, jpg, bmp and more audio : MP3, Ogg, Wav and more video : AVI, MP4, OGV, mpg, mov, wmv and more text, code and other data : OpenOffice, Microsoft Office (Word, PowerPoint, Excel), web (html, CSS), LaTeX, Google Earth and (...)

  • HTML5 audio and video support

    13 avril 2011, par

    MediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
    The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
    For older browsers the Flowplayer flash fallback is used.
    MediaSPIP allows for media playback on major mobile platforms with the above (...)

  • De l’upload à la vidéo finale [version standalone]

    31 janvier 2010, par

    Le chemin d’un document audio ou vidéo dans SPIPMotion est divisé en trois étapes distinctes.
    Upload et récupération d’informations de la vidéo source
    Dans un premier temps, il est nécessaire de créer un article SPIP et de lui joindre le document vidéo "source".
    Au moment où ce document est joint à l’article, deux actions supplémentaires au comportement normal sont exécutées : La récupération des informations techniques des flux audio et video du fichier ; La génération d’une vignette : extraction d’une (...)

Sur d’autres sites (3599)

  • 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*
  • Linux Media Player Survey Circa 2001

    2 septembre 2010, par Multimedia Mike — General

    Here’s a document I scavenged from my archives. It was dated September 1, 2001 and I now publish it 9 years later. It serves as sort of a time capsule for the state of media player programs at the time. Looking back on this list, I can’t understand why I couldn’t find MPlayer while I was conducting this survey, especially since MPlayer is the project I eventually started to work for a few months after writing this piece.

    For a little context, I had been studying multimedia concepts and tech for a year and was itching to get my hands dirty with practical multimedia coding. But I wanted to tackle what I perceived as unsolved problems– like playback of proprietary codecs. I didn’t want to have to build a new media playback framework just to start working on my problems. So I surveyed the players available to see which ones I could plug into and use as a testbed for implementing new decoders.

    Regarding Real Player, I wrote : “We’re trying to move away from the proprietary, closed-source “solutions”. Heh. Was I really an insufferable open source idealist back in the day ?

    Anyway, here’s the text with some Where are they now ? commentary [in brackets] :


    Towards an All-Inclusive Media Playing Solution for Linux

    I don’t feel that the media playing solutions for Linux set their sights high enough, even though they do tend to be quite ambitious.

    I want to create a media player for Linux that can open a file, figure out what type of file it is (AVI, MOV, etc.), determine the compression algorithms used to encode the audio and video chunks inside (MPEG, Cinepak, Sorenson, etc.) and replay the file using the best audio, video, and CPU facilities available on the computer.

    Video and audio playback is a solved problem on Linux ; I don’t wish to solve that problem again. The problem that isn’t solved is reliance on proprietary multimedia solutions through some kind of WINE-like layer in order to decode compressed multimedia files.

    Survey of Linux solutions for decoding proprietary multimedia
    updated 2001-09-01

    AVI Player for XMMS
    This is based on Avifile. All the same advantages and limitations apply.
    [Top Google hit is a Freshmeat page that doesn’t indicate activity since 2001-2002.]

    Avifile
    This player does a great job at taking apart AVI and ASF files and then feeding the compressed chunks of multimedia data through to the binary Win32 decoders.

    The program is written in C++ and I’m not very good at interpreting that kind of code. But I’m learning all over again. Examining the object hierarchy, it appears that the designers had the foresight to include native support for decoders that are compiled into the program from source code. However, closer examination reveals that there is support for ONE source decoder and that’s the “decoder” for uncompressed data. Still, I tried to manipulate this routine to accept and decode data from other codecs but no dice. It’s really confounding. The program always crashes when I feed non-uncompressed data through the source decoder.
    [Lives at http://avifile.sourceforge.net/ ; not updated since 2006.]

    Real Player
    There’s not much to do with this since it is closed source and proprietary. Even though there is a plugin architecture, that’s not satisfactory. We’re trying to move away from the proprietary, closed-source “solutions”.
    [Still kickin’ with version 11.]

    XAnim
    This is a well-established Unix media player. To his credit, the author does as well as he can with the resources he has. In other words, he supports the non-proprietary video codecs well, and even has support for some proprietary video codecs through binary-only decoders.

    The source code is extremely difficult to work with as the author chose to use the X coding format which I’ve never seen used anywhere else except for X header files. The infrastructure for extending the program and supporting other codecs and file formats is there, I suppose, but I would have to wrap my head around the coding style. Maybe I can learn to work past that. The other thing that bothers me about this program is the decoding approach : It seems that each video decoder includes routines to decompress the multimedia data into every conceivable RGB and YUV output format. This seems backwards to me ; it seems better to have one decoder function that decodes the data into its native format it was compressed from (e.g., YV12 for MPEG data) and then pass that data to another layer of the program that’s in charge of presenting the data and possibly converting it if necessary. This layer would encompass highly-optimized software conversion routines including special CPU-specific instructions (e.g., MMX and SSE) and eliminate the need to place those routines in lots of other routines. But I’m getting ahead of myself.
    [This one was pretty much dead before I made this survey, the most recent update being in 1999. Still, we owe it much respect as the granddaddy of Unix multimedia playback programs.]

    Xine
    This seems like a promising program. It was originally designed to play MPEGs from DVDs. It can also play MPEG files on a hard drive and utilizes the Xv extensions for hardware YUV playback. It’s also supposed to play AVI files using the same technique as Avifile but I have never, ever gotten it to work. If an AVI file has both video and sound, the binary video decoder can’t decode any frames. If the AVI file has video and no sound, the program gets confused and crashes, as far as I can tell.

    Still, it’s promising, and I’ve been trying to work around these crashes. It doesn’t yet have the type of modularization I’d like to see. Right now, it tailored to suit MPEG playback and AVI playback is an afterthought. Still, it appears to have a generalized interface for dropping in new file demultiplexers.

    I tried to extend the program for supporting source decoders by rewriting w32codec.c from scratch. I’m not having a smooth time of it so far. I’m able to perform some manipulations on the output window. However, I can’t get the program to deal with an RGB image format. It has trouble allocating an RGB surface with XvShmCreateImage(). This isn’t suprising, per my limited knowledge of X which is that Xv applies to YUV images, but it could also apply to RGB images as well. Anyway, the program should be able to fall back on regular RGB pixmaps if that Xv call fails.

    Right now, this program is looking the most promising. It will take some work to extend the underlying infrastructure, but it seems doable since I know C quite well and can understand the flow of this program, as opposed to Avifile and its C++. The C code also compiles about 10 times faster.
    [My home project for many years after a brief flirtation with MPlayer. It is still alive ; its latest release was just a month ago.]

    XMovie
    This library is a Quicktime movie player. I haven’t looked at it too extensively yet, but I do remember looking at it at one point and reading the documentation that said it doesn’t support key frames. Still, I should examine it again since they released a new version recently.
    [Heroine Virtual still puts out some software but XMovie has not been updated since 2005.]

    XMPS
    This program compiles for me, but doesn’t do much else. It can play an MP3 file. I have been able to get MPEG movies to play through it, but it refuses to show the full video frame, constricting it to a small window (obviously a bug).
    [This project is hosted on SourceForge and is listed with a registration date of 2003, well after this survey was made. So the project obviously lived elsewhere in 2001. Meanwhile, it doesn’t look like any files ever made it to SF for hosting.]

    XTheater
    I can’t even get this program to compile. It’s supposed to be an MPEG player based on SMPEG. As such, it probably doesn’t hold much promise for being easily extended into a general media player.
    [Last updated in 2002.]

    GMerlin
    I can’t get this to compile yet. I have a bug report in to the dev group.
    [Updated consistently in the last 9 years. Last update was in February of this year. I can’t find any record of my bug report, though.]

  • Android FFmpeg export of the Video in SurfaceView with Pinch/Scale/Zoom/Bg Color Operation

    31 mai 2024, par CoderDev

    I'm working on a feature in which I need to perform some actions on the selected video from the gallery and then upload it on the Backend server, on this selected video I can pinch it to scale up/down/zoom in/out and place it anywhere on the screen (even out side the screen), just like the Instagram app.
I can apply a background color which will be applied to the whole space of the outer of the video frame.

    


    After all the above changes I'm exporting the changes to the output video that will contain all the changes that I've mentioned above. I'm using the FFMpeg for the same :

    


        implementation("com.arthenica:ffmpeg-kit-full-gpl:6.0-2.LTS")



    


    Basically the operation is being achieved with this solution (Except Export Video) : Android SurfaceView operation on Video to Pinch/Scale/Zoom/Bg Color

    


    I've tried numerous FFmpeg commands but not getting the adequate output, I've tried below solution :

    


        private fun exportVideo() {
        val outputVideoPath = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS).path + "/ffmpegoutput.mp4"
        val inputVideoPath = selectedFilePath
        val bgColor = getColorHexCode()

        // Load the input video dimensions
        val retriever = MediaMetadataRetriever()
        retriever.setDataSource(inputVideoPath)
        val videoWidth = retriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_VIDEO_WIDTH)?.toInt() ?: 0
        val videoHeight = retriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_VIDEO_HEIGHT)?.toInt() ?: 0
        retriever.release()

        // Calculate the scaled dimensions
        val scaledWidth = (videoWidth * scaleFactor).toInt()
        val scaledHeight = (videoHeight * scaleFactor).toInt()

        // Calculate the new translation
        val translatedX = translationX.toInt()
        val translatedY = translationY.toInt()

         // Ensure the output dimensions are at least as large as the scaled dimensions
        val outputWidth = maxOf(deviceWidth, scaledWidth + abs(translatedX) * 2)
        val outputHeight = maxOf(deviceHeight, scaledHeight + abs(translatedY) * 2)

        // Calculate padding positions
        val xPad = (outputWidth - scaledWidth) / 2 + translatedX
        val yPad = (outputHeight - scaledHeight) / 2 + translatedY

        // Create the filter string for FFmpeg
        val filter = "scale=$scaledWidth:$scaledHeight," +
                "pad=$diagonal:$diagonal:(ow-iw)/2:(oh-ih)/2:$bgColor," +
                "pad=$outputWidth:$outputHeight:$xPad:$yPad:$bgColor"


        val command = ("-i $inputVideoPath " +
                "-vf $filter " +
                "-c:a copy " + // Copy the audio stream without re-encoding
                "-y $outputVideoPath"
                )

        // Execute FFMPEG command
        executeFFmpegKitCommand(command)
    }


    private fun executeFFmpegKitCommand(command: String) {
        FFmpegKit.executeAsync(command) { session ->
            println("FFMPEG executeAsync, session: $session")
            val returnCode = session.returnCode
            if (returnCode.isValueSuccess) {
                // Handle success
                runOnUiThread {
                    Toast.makeText(this, "Video saved successfully!", Toast.LENGTH_SHORT).show()
                }
            } else {
                // Handle failure
                runOnUiThread {
                    Toast.makeText(this, "Failed to save video", Toast.LENGTH_SHORT).show()
                }
            }
        }
    }


    


    But this not giving me the adequate output, it's not creating the output with the Screen's height/width (Tried passing the same), and the original video position is also not correct on the canvas which I've placed with the touch event.