Recherche avancée

Médias (1)

Mot : - Tags -/epub

Autres articles (16)

  • Support de tous types de médias

    10 avril 2011

    Contrairement à beaucoup de logiciels et autres plate-formes modernes de partage de documents, MediaSPIP a l’ambition de gérer un maximum de formats de documents différents qu’ils soient de type : images (png, gif, jpg, bmp et autres...) ; audio (MP3, Ogg, Wav et autres...) ; vidéo (Avi, MP4, Ogv, mpg, mov, wmv et autres...) ; contenu textuel, code ou autres (open office, microsoft office (tableur, présentation), web (html, css), LaTeX, Google Earth) (...)

  • Les formats acceptés

    28 janvier 2010, par

    Les commandes suivantes permettent d’avoir des informations sur les formats et codecs gérés par l’installation local de ffmpeg :
    ffmpeg -codecs ffmpeg -formats
    Les format videos acceptés en entrée
    Cette liste est non exhaustive, elle met en exergue les principaux formats utilisés : h264 : H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 m4v : raw MPEG-4 video format flv : Flash Video (FLV) / Sorenson Spark / Sorenson H.263 Theora wmv :
    Les formats vidéos de sortie possibles
    Dans un premier temps on (...)

  • Ajouter notes et légendes aux images

    7 février 2011, par

    Pour pouvoir ajouter notes et légendes aux images, la première étape est d’installer le plugin "Légendes".
    Une fois le plugin activé, vous pouvez le configurer dans l’espace de configuration afin de modifier les droits de création / modification et de suppression des notes. Par défaut seuls les administrateurs du site peuvent ajouter des notes aux images.
    Modification lors de l’ajout d’un média
    Lors de l’ajout d’un média de type "image" un nouveau bouton apparait au dessus de la prévisualisation (...)

Sur d’autres sites (4310)

  • libavcodec/avcodec.h : No such file or directory(ffmpeg with android studio)

    14 avril 2016, par Spartan

    I extracted ffmpeg in ndk’s source folder then compiled it there only for that I followed this :http://www.roman10.net/2013/08/18/how-to-build-ffmpeg-with-ndk-r9/ and successfully generated android folder with arm/lib and arm/include files.

    After that I created one Android.mk file in $NDK/sources/ffmpeg/android/arm and one Android.mk in my android project(src/main/jni folder).

    My src/main/jni/Android.mk is like this :

    LOCAL_PATH := $(call my-dir)

    include $(CLEAR_VARS)

    LOCAL_MODULE    := tutorial01
    LOCAL_SRC_FILES := tutorial01.c
    LOCAL_LDLIBS := -llog -ljnigraphics -lz
    LOCAL_SHARED_LIBRARIES := libavcodec

    include $(BUILD_SHARED_LIBRARY)
    $(call import-module,ffmpeg-3.0.1/android/arm)

    and $NDK/sources/ffmpeg/android/arm/Android.mk is :

    LOCAL_PATH:= $(call my-dir)

    include $(CLEAR_VARS)
    LOCAL_MODULE:= libavcodec
    LOCAL_SRC_FILES:= lib/libavcodec-57.so
    LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include
    include $(PREBUILT_SHARED_LIBRARY)

    I updated my build.gradle like this and successfully generated jniLibs with .so files but I am getting libavcodec/avcodec.h : No such file or directory while building project.

    import org.apache.tools.ant.taskdefs.condition.Os

    apply plugin: 'com.android.model.application'

    model {
       android {
           compileSdkVersion = 23
           buildToolsVersion = "23.0.2"

           defaultConfig.with {
               applicationId = "com.example.spartan.hello"
               minSdkVersion.apiLevel = 18
               targetSdkVersion.apiLevel = 23
               versionCode = 1
               versionName = "1.0"
           }
       }
       android.buildTypes {
           release {
               minifyEnabled = false
               proguardFiles.add(file('proguard-android.txt'))
           }
       }

       android.sources {
           main {
               jni {
                   source {
                       srcDirs = []
                   }

               }

           }

           main {
               jniLibs {
                   source {
                       srcDirs = ['src/main/libs']
                   }
               }
           }

       }

       android.ndk {
           moduleName = "tutorial01"
           stl = 'gnustl_shared'
       }
    }


    task ndkBuild(type: Exec) {
       if (Os.isFamily(Os.FAMILY_WINDOWS)) {
           commandLine 'ndk-build.cmd', '-C', file('src/main').absolutePath
       } else {
           commandLine 'ndk-build', '-C', file('src/main').absolutePath
       }
    }
    tasks.withType(JavaCompile) {
       compileTask -> compileTask.dependsOn ndkBuild
    }

    dependencies {
       compile fileTree(include: ['*.jar'], dir: 'libs')
       testCompile 'junit:junit:4.12'
       compile 'com.android.support:appcompat-v7:23.2.1'
    }

    and loading them in my activity like this :

    static {
           System.loadLibrary("tutorial01");    
           System.loadLibrary("avcodec-57");  
       }

    This is the output I am getting(you can see on left side .so files are generated and header error in the right side of the image).
    enter image description here

    I am new to NDK so, Is it ok if we manually paste header files in jni folder ?

  • FFMPEG with Gradle Experimental Android plugin

    12 avril 2016, par Spartan

    I extracted ffmpeg in ndk’s source folder then compiled it there only for that I followed this :http://www.roman10.net/2013/08/18/how-to-build-ffmpeg-with-ndk-r9/

    So I successfully(generated android folder with arm/lib and arm/include files).

    After that I created one Android.mk file in $NDK/sources/ffmpeg/android/arm and one Android.mk in my android project(src/main/jni folder).

    My src/main/jni/Android.mk is like this :

    LOCAL_PATH := $(call my-dir)

    include $(CLEAR_VARS)

    LOCAL_MODULE    := tutorial01
    LOCAL_SRC_FILES := tutorial01.c
    LOCAL_LDLIBS := -llog -ljnigraphics -lz
    LOCAL_SHARED_LIBRARIES := libavformat libavcodec libswscale libavutil

    include $(BUILD_SHARED_LIBRARY)
    $(call import-module,ffmpeg-3.0.1/android/arm)

    Now I stuck here and trying to put these details in build.gradle files like showing in this documentation :
    http://tools.android.com/tech-docs/new-build-system/gradle-experimental

    for example :

    model {

       repositories {

           libs(PrebuiltLibraries) {

               prebuilt {

                   headers.srcDir "path/to/headers"

                   binaries.withType(SharedLibraryBinary) {

                       sharedLibraryFile = file("lib/${targetPlatform.getName()}/prebuilt.so")

                   }

               }

           }

       }

       android.sources {
           main {
               jniLibs {
                   dependencies {
                       library "prebuilt"
                   }
               }
           }
       }
    }

    But not able transform exact Android.mk(src/main/jni) to this and apart from it I have one more Android.mk in my android/arm folder so how I can call this makefile or should I put that details also in my build.gradle like above.

    I tried like this and using ndk-build command successfully generated jniLibs with .so files but I am getting libavcodec/avcodec.h : No such file or directory while building project.

    android.sources {
       main {
           jni {
               source {
                   srcDirs = ['src/main/myJni']
               }

           }

       }

       main {
           jniLibs {
               source {
                   srcDirs = ['src/main/libs']
               }
           }
       }

    }
  • Detect rotation angle and rotate final video using ffmpeg version 2.8

    3 février 2016, par Hemant Kumar

    I used to work on ffmpeg 2.2 until now and was detecting rotation angle of video uploaded from android / iPhone mobiles and rotate the resulting video so that it run perfectly on a correct angle.

    But since I have updated the ffmpeg to version 2.8 I am getting this rotation problem. My queries are not rotating the videos as they were earlier.

    Here’r the commands I was using :

    To check rotation angle :

    ffprobe -of json -show_streams {$input} | grep rotate

    below is my final command to convert a video to mp4

    "ffmpeg -i {$input} -strict -2 -vcodec libx264 -preset slow -vb 500k -maxrate 500k -bufsize 1000k -vf 'scale=-1:480 ".fix_video_orientation($input)."' -threads 0 -ab 64k -s {$resolution}  -movflags faststart -metadata:s:v:0 rotate=0 {$output}";

    "fix_video_orientation" function is given below. It detect the angle of rotation of the initial video and output optimal option for rotating the final video.

    function fix_video_orientation($input){

    $return= ", transpose=1 ";

    $dd= exec("ffprobe -of json -show_streams  {$input}   | grep rotate");

    if(!empty($dd)){

    $dd=explode(":",$dd);
    $rotate=str_replace(",","",str_replace('"',"",$dd[1]));

    if($rotate=="90")return $return;

    else if ($rotate=="180") return ", transpose=2,transpose=2 ";

    else if($rotate == "270") return ", transpose=2 ";
    }

    Currently above script is supporting "flv","avi","mp4","mkv","mpg","wmv","asf","webm","mov","3gp","3gpp" extensions, also the script is supporting the resulting .mp4 file to play on all browsers and devices.

    Now the ffprobe command is not returning rotation angle and so a portrait video if uploaded from iphone is showing as landscape on the website.

    Output console of ffprobe command :

    ffprobe version N-77455-g4707497 Copyright (c) 2007-2015 the FFmpeg developers
    built with gcc 4.8 (Ubuntu 4.8.4-2ubuntu1~14.04)
    configuration: --extra-libs=-ldl --prefix=/opt/ffmpeg --mandir=/usr/share/man --enable-avresample --disable-debug --enable-nonfree --enable-gpl --enable-version3 --enable-libopencore-amrnb --enable-libopencore-amrwb --disable-decoder=amrnb --disable-decoder=amrwb --enable-libpulse --enable-libdcadec --enable-libfreetype --enable-libx264 --enable-libx265 --enable-libfdk-aac --enable-libvorbis --enable-libmp3lame --enable-libopus --enable-libvpx --enable-libspeex --enable-libass --enable-avisynth --enable-libsoxr --enable-libxvid --enable-libvo-aacenc --enable-libvidstab
    libavutil 55. 11.100 / 55. 11.100
    libavcodec 57. 20.100 / 57. 20.100
    libavformat 57. 20.100 / 57. 20.100
    libavdevice 57. 0.100 / 57. 0.100
    libavfilter 6. 21.101 / 6. 21.101
    libavresample 3. 0. 0 / 3. 0. 0
    libswscale 4. 0.100 / 4. 0.100
    libswresample 2. 0.101 / 2. 0.101
    libpostproc 54. 0.100 / 54. 0.100
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/standard/PORTRAIT.m4v':
    Metadata:
    major_brand : qt

    minor_version : 0
    compatible_brands: qt

    creation_time : 2016-02-03 05:25:18
    com.apple.quicktime.make: Apple
    com.apple.quicktime.model: iPhone 4S
    com.apple.quicktime.software: 9.2.1
    com.apple.quicktime.creationdate: 2016-02-03T10:52:11+0530
    Duration: 00:00:03.34, start: 0.000000, bitrate: 7910 kb/s
    Stream #0:0(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, mono, fltp, 63 kb/s (default)
    Metadata:
    creation_time : 2016-02-03 05:25:18
    handler_name : Core Media Data Handler
    Stream #0:1(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709), 720x1280 [SAR 1:1 DAR 9:16], 7832 kb/s, 29.97 fps, 29.97 tbr, 600 tbn, 50 tbc (default)
    Metadata:
    creation_time : 2016-02-03 05:25:18
    handler_name : Core Media Data Handler
    encoder : H.264
    Stream #0:2(und): Data: none (mebx / 0x7862656D), 0 kb/s (default)
    Metadata:
    creation_time : 2016-02-03 05:25:18
    handler_name : Core Media Data Handler
    Stream #0:3(und): Data: none (mebx / 0x7862656D), 0 kb/s (default)
    Metadata:
    creation_time : 2016-02-03 05:25:18
    handler_name : Core Media Data Handler
    Unsupported codec with id 0 for input stream 2
    Unsupported codec with id 0 for input stream 3

    If latest version of ffmpeg (2.8) is used to auto rotate the video, can you please suggest me what option I need to add or remove from my final command.