Recherche avancée

Médias (1)

Mot : - Tags -/MediaSPIP 0.2

Autres articles (48)

  • Les tâches Cron régulières de la ferme

    1er décembre 2010, par

    La gestion de la ferme passe par l’exécution à intervalle régulier de plusieurs tâches répétitives dites Cron.
    Le super Cron (gestion_mutu_super_cron)
    Cette tâche, planifiée chaque minute, a pour simple effet d’appeler le Cron de l’ensemble des instances de la mutualisation régulièrement. Couplée avec un Cron système sur le site central de la mutualisation, cela permet de simplement générer des visites régulières sur les différents sites et éviter que les tâches des sites peu visités soient trop (...)

  • 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

  • Selection of projects using MediaSPIP

    2 mai 2011, par

    The examples below are representative elements of MediaSPIP specific uses for specific projects.
    MediaSPIP farm @ Infini
    The non profit organizationInfini develops hospitality activities, internet access point, training, realizing innovative projects in the field of information and communication technologies and Communication, and hosting of websites. It plays a unique and prominent role in the Brest (France) area, at the national level, among the half-dozen such association. Its members (...)

Sur d’autres sites (8156)

  • Compiling static libs of ffmpeg with x264 in Msys2 for Visual Studio, but libx264 is never found

    29 mai 2020, par Blake Senftner

    Having previously downloaded and compiled ffmpeg 4.2.2 to static libraries using MSYS2 and the Visual Studio 2015 x64 tool chain. I want to add the x264 codec from VLC/VideoLan, compiling that to a static library as well. However, running Configure for ffmpeg produces an error saying "libx264 not found."

    



    I built ffmpeg without VideoLAN's x264 at "/c/ThirdParty/opt/ffmpeg-4.2.2" with "make install" installing to "/c/ThirdParty/opt/ffmpeg-4.2.2/ffmpeg_build" .

    



    I am using the following steps to compile from source x264 and add it to the ffmpeg build using the same VS2015 tool chain :

    



      

    1. Launch an "VS2015 x64 Natice Tools Command Prompt"
    2. 


    3. From that VS2015 command prompt, run "c :\msys64\msys2_shell.cmd -mingw64 -use-full-path"
    4. 


    5. From inside the MSYS2 shell, run "cd /c/ThirdParty/opt"
    6. 


    7. git clone http://git.videolan.org/git/x264.git
    8. 


    9. cd x264
    10. 


    11. CC=cl ./configure —enable-static —prefix=/c/ThirdParty/opt/ffmpeg-4.2.2/ffmpeg_build —disable-cli
    12. 


    13. make
    14. 


    15. make install
    16. 


    17. cd ../ffmpeg-4.2.2
    18. 


    19. PKG_CONFIG_PATH=/c/ThirdParty/opt/ffmpeg-4.2.2/ffmpeg_build/lib \
./configure —prefix=./ffmpeg_build —toolchain=msvc —arch=x86_64 \
—target-os=win64 —extra-cflags=-MT —extra-cxxflags=-MT \
—extra-ldflags=-L/c/ThirdParty/opt/ffmpeg-4.2.2/ffmpeg_build/lib \
—enable-x86asm —enable-asm —enable-static —disable-shared \
—disable-debug —enable-gpl —enable-avresample —enable-libx264

    20. 


    



    The steps work, compiling x264 fine, but the output for ffmpeg's Configure is "ERROR : libx264 not found".

    



    I have also tried the variation of using these two lines in place of steps 6 and 10 above :

    



      

    • CC=cl ./configure —enable-static —prefix=/usr/local —disable-cli
    • 


    • PKG_CONFIG_PATH=/usr/local/lib/pkgconfig :$PKG_CONFIG_PATH ./configure —prefix=./ffmpeg_build —toolchain=msvc —arch=x86_64 —target-os=win64 —extra-cflags=-MT —extra-libs=/usr/local/lib/libx264.lib —extra-cxxflags=-MT —enable-x86asm —enable-asm —enable-static —disable-shared —disable-debug —enable-gpl —enable-avresample —enable-libx264
    • 


    



    This version will get past Configure, where I am able to run "make", but the make fails with a series of unresolved X264_* functions while linking ffmpeg_g.exe, 14 unresolved functions in total. The errors at shown at the bottom, but first :

    



    When I look in /c/ThirdParty/opt/ffmpeg-4.2.2/ffmpeg_build/lib I see :

    



    $ ls -l ./ffmpeg_build/lib
total 50988
-rw-r--r-- 1 blake blake 27184250 May 11 16:29 libavcodec.a
-rw-r--r-- 1 blake blake   231304 May 11 16:29 libavdevice.a
-rw-r--r-- 1 blake blake  8574628 May 11 16:29 libavfilter.a
-rw-r--r-- 1 blake blake  8081930 May 11 16:29 libavformat.a
-rw-r--r-- 1 blake blake  1300118 May 11 16:29 libavutil.a
-rw-r--r-- 1 blake blake    61844 May 11 16:29 libpostproc.a
-rw-r--r-- 1 blake blake   348732 May 11 16:29 libswresample.a
-rw-r--r-- 1 blake blake  1316008 May 11 16:29 libswscale.a
-rw-r--r-- 1 blake blake  5086976 May 28 18:08 libx264.lib
drwxr-xr-x 1 blake blake        0 May 28 18:08 pkgconfig


    



    Likewise for /c/ThirdParty/opt/ffmpeg-4.2.2/ffmpeg_build/lib/pkgconfig :

    



    $ ls -l ./ffmpeg_build/lib/pkgconfig/
total 9
-rw-r--r-- 1 blake blake 353 May 11 16:29 libavcodec.pc
-rw-r--r-- 1 blake blake 554 May 11 16:29 libavdevice.pc
-rw-r--r-- 1 blake blake 449 May 11 16:29 libavfilter.pc
-rw-r--r-- 1 blake blake 393 May 11 16:29 libavformat.pc
-rw-r--r-- 1 blake blake 306 May 11 16:29 libavutil.pc
-rw-r--r-- 1 blake blake 317 May 11 16:29 libpostproc.pc
-rw-r--r-- 1 blake blake 322 May 11 16:29 libswresample.pc
-rw-r--r-- 1 blake blake 315 May 11 16:29 libswscale.pc
-rw-r--r-- 1 blake blake 300 May 28 18:08 x264.pc


    



    And looking in /usr/local/lib I see libx264.lib and the pkgconfig directory.

    



    The errors generated by my most recent attempts look like :

    



    LD      ffmpeg_g.exe
libavcodec.a(libx264.o) : error LNK2019: unresolved external symbol __imp_x264_param_default referenced in function X264_init
libavcodec.a(libx264.o) : error LNK2019: unresolved external symbol __imp_x264_param_parse referenced in function X264_init
libavcodec.a(libx264.o) : error LNK2019: unresolved external symbol __imp_x264_param_default_preset referenced in function X264_init
libavcodec.a(libx264.o) : error LNK2019: unresolved external symbol __imp_x264_param_apply_fastfirstpass referenced in function X264_init
libavcodec.a(libx264.o) : error LNK2019: unresolved external symbol __imp_x264_param_apply_profile referenced in function X264_init
libavcodec.a(libx264.o) : error LNK2019: unresolved external symbol __imp_x264_picture_init referenced in function X264_frame
libavcodec.a(libx264.o) : error LNK2019: unresolved external symbol __imp_x264_encoder_open_160 referenced in function X264_init
libavcodec.a(libx264.o) : error LNK2019: unresolved external symbol __imp_x264_encoder_reconfig referenced in function reconfig_encoder
libavcodec.a(libx264.o) : error LNK2019: unresolved external symbol __imp_x264_encoder_headers referenced in function X264_init
libavcodec.a(libx264.o) : error LNK2019: unresolved external symbol __imp_x264_encoder_encode referenced in function X264_frame
libavcodec.a(libx264.o) : error LNK2019: unresolved external symbol __imp_x264_encoder_close referenced in function X264_close
libavcodec.a(libx264.o) : error LNK2019: unresolved external symbol __imp_x264_encoder_delayed_frames referenced in function X264_frame
libavcodec.a(libx264.o) : error LNK2019: unresolved external symbol __imp_x264_encoder_maximum_delayed_frames referenced in function X264_init
libavcodec.a(libx264.o) : error LNK2019: unresolved external symbol __imp_x264_levels referenced in function X264_init
ffmpeg_g.exe : fatal error LNK1120: 14 unresolved externals
make: *** [Makefile:111: ffmpeg_g.exe] Error 96


    



    Maybe something wrong with the —extra-ldflags or —extra-libs options of ffmpeg's Configure, but after trying variations and google searching, I come asking you. Do you know what is wrong with this ffmpeg Configure line ? Step 10, above.

    


  • Compiling static libs of ffmpeg with x264 in Msys2 for Visual Studio, but libx264 is never found

    29 mai 2020, par Blake Senftner

    Having previously downloaded and compiled ffmpeg 4.2.2 to static libraries using MSYS2 and the Visual Studio 2015 x64 tool chain. I want to add the x264 codec from VLC/VideoLan, compiling that to a static library as well. However, running Configure for ffmpeg produces an error saying "libx264 not found."

    



    I built ffmpeg without VideoLAN's x264 at "/c/ThirdParty/opt/ffmpeg-4.2.2" with "make install" installing to "/c/ThirdParty/opt/ffmpeg-4.2.2/ffmpeg_build" .

    



    I am using the following steps to compile from source x264 and add it to the ffmpeg build using the same VS2015 tool chain :

    



      

    1. Launch an "VS2015 x64 Natice Tools Command Prompt"
    2. 


    3. From that VS2015 command prompt, run "c :\msys64\msys2_shell.cmd -mingw64 -use-full-path"
    4. 


    5. From inside the MSYS2 shell, run "cd /c/ThirdParty/opt"
    6. 


    7. git clone http://git.videolan.org/git/x264.git
    8. 


    9. cd x264
    10. 


    11. CC=cl ./configure —enable-static —prefix=/c/ThirdParty/opt/ffmpeg-4.2.2/ffmpeg_build —disable-cli
    12. 


    13. make
    14. 


    15. make install
    16. 


    17. cd ../ffmpeg-4.2.2
    18. 


    19. PKG_CONFIG_PATH=/c/ThirdParty/opt/ffmpeg-4.2.2/ffmpeg_build/lib \
./configure —prefix=./ffmpeg_build —toolchain=msvc —arch=x86_64 \
—target-os=win64 —extra-cflags=-MT —extra-cxxflags=-MT \
—extra-ldflags=-L/c/ThirdParty/opt/ffmpeg-4.2.2/ffmpeg_build/lib \
—enable-x86asm —enable-asm —enable-static —disable-shared \
—disable-debug —enable-gpl —enable-avresample —enable-libx264

    20. 


    



    The steps work, compiling x264 fine, but the output for ffmpeg's Configure is "ERROR : libx264 not found".

    



    I have also tried the variation of using these two lines in place of steps 6 and 10 above :

    



      

    • CC=cl ./configure —enable-static —prefix=/usr/local —disable-cli
    • 


    • PKG_CONFIG_PATH=/usr/local/lib/pkgconfig :$PKG_CONFIG_PATH ./configure —prefix=./ffmpeg_build —toolchain=msvc —arch=x86_64 —target-os=win64 —extra-cflags=-MT —extra-libs=/usr/local/lib/libx264.lib —extra-cxxflags=-MT —enable-x86asm —enable-asm —enable-static —disable-shared —disable-debug —enable-gpl —enable-avresample —enable-libx264
    • 


    



    This version will get past Configure, where I am able to run "make", but the make fails with a series of unresolved X264_* functions while linking ffmpeg_g.exe, 14 unresolved functions in total. The errors at shown at the bottom, but first :

    



    When I look in /c/ThirdParty/opt/ffmpeg-4.2.2/ffmpeg_build/lib I see :

    



    $ ls -l ./ffmpeg_build/lib
total 50988
-rw-r--r-- 1 blake blake 27184250 May 11 16:29 libavcodec.a
-rw-r--r-- 1 blake blake   231304 May 11 16:29 libavdevice.a
-rw-r--r-- 1 blake blake  8574628 May 11 16:29 libavfilter.a
-rw-r--r-- 1 blake blake  8081930 May 11 16:29 libavformat.a
-rw-r--r-- 1 blake blake  1300118 May 11 16:29 libavutil.a
-rw-r--r-- 1 blake blake    61844 May 11 16:29 libpostproc.a
-rw-r--r-- 1 blake blake   348732 May 11 16:29 libswresample.a
-rw-r--r-- 1 blake blake  1316008 May 11 16:29 libswscale.a
-rw-r--r-- 1 blake blake  5086976 May 28 18:08 libx264.lib
drwxr-xr-x 1 blake blake        0 May 28 18:08 pkgconfig


    



    Likewise for /c/ThirdParty/opt/ffmpeg-4.2.2/ffmpeg_build/lib/pkgconfig :

    



    $ ls -l ./ffmpeg_build/lib/pkgconfig/
total 9
-rw-r--r-- 1 blake blake 353 May 11 16:29 libavcodec.pc
-rw-r--r-- 1 blake blake 554 May 11 16:29 libavdevice.pc
-rw-r--r-- 1 blake blake 449 May 11 16:29 libavfilter.pc
-rw-r--r-- 1 blake blake 393 May 11 16:29 libavformat.pc
-rw-r--r-- 1 blake blake 306 May 11 16:29 libavutil.pc
-rw-r--r-- 1 blake blake 317 May 11 16:29 libpostproc.pc
-rw-r--r-- 1 blake blake 322 May 11 16:29 libswresample.pc
-rw-r--r-- 1 blake blake 315 May 11 16:29 libswscale.pc
-rw-r--r-- 1 blake blake 300 May 28 18:08 x264.pc


    



    And looking in /usr/local/lib I see libx264.lib and the pkgconfig directory.

    



    The errors generated by my most recent attempts look like :

    



    LD      ffmpeg_g.exe
libavcodec.a(libx264.o) : error LNK2019: unresolved external symbol __imp_x264_param_default referenced in function X264_init
libavcodec.a(libx264.o) : error LNK2019: unresolved external symbol __imp_x264_param_parse referenced in function X264_init
libavcodec.a(libx264.o) : error LNK2019: unresolved external symbol __imp_x264_param_default_preset referenced in function X264_init
libavcodec.a(libx264.o) : error LNK2019: unresolved external symbol __imp_x264_param_apply_fastfirstpass referenced in function X264_init
libavcodec.a(libx264.o) : error LNK2019: unresolved external symbol __imp_x264_param_apply_profile referenced in function X264_init
libavcodec.a(libx264.o) : error LNK2019: unresolved external symbol __imp_x264_picture_init referenced in function X264_frame
libavcodec.a(libx264.o) : error LNK2019: unresolved external symbol __imp_x264_encoder_open_160 referenced in function X264_init
libavcodec.a(libx264.o) : error LNK2019: unresolved external symbol __imp_x264_encoder_reconfig referenced in function reconfig_encoder
libavcodec.a(libx264.o) : error LNK2019: unresolved external symbol __imp_x264_encoder_headers referenced in function X264_init
libavcodec.a(libx264.o) : error LNK2019: unresolved external symbol __imp_x264_encoder_encode referenced in function X264_frame
libavcodec.a(libx264.o) : error LNK2019: unresolved external symbol __imp_x264_encoder_close referenced in function X264_close
libavcodec.a(libx264.o) : error LNK2019: unresolved external symbol __imp_x264_encoder_delayed_frames referenced in function X264_frame
libavcodec.a(libx264.o) : error LNK2019: unresolved external symbol __imp_x264_encoder_maximum_delayed_frames referenced in function X264_init
libavcodec.a(libx264.o) : error LNK2019: unresolved external symbol __imp_x264_levels referenced in function X264_init
ffmpeg_g.exe : fatal error LNK1120: 14 unresolved externals
make: *** [Makefile:111: ffmpeg_g.exe] Error 96


    



    Maybe something wrong with the —extra-ldflags or —extra-libs options of ffmpeg's Configure, but after trying variations and google searching, I come asking you. Do you know what is wrong with this ffmpeg Configure line ? Step 10, above.

    


  • ffmpeg permission denied in android studio ?

    16 avril 2023, par Rakesh Saini

    I want to merge an audio in video using ffmpeg of the following dependency but getting the permission denied error.

    


     Cannot run program "/data/user/0/com.example.mytestapp/files/ffmpeg": error=13, Permission denied


    


    Dependency I am using

    


     implementation 'com.writingminds:FFmpegAndroid:0.3.2'


    


    I am using following code to merge an audio into the video. I added the dependency and provided the path of the video. I also placed the ffpmeg.exe into the assets folder

    


            package com.example.mytestapp.Activity;
    
    import androidx.annotation.NonNull;
    import androidx.appcompat.app.AppCompatActivity;
    
    import android.Manifest;
    import android.content.Context;
    import android.content.pm.PackageManager;
    import android.content.res.AssetManager;
    import android.os.Build;
    import android.os.Bundle;
    import android.os.Environment;
    import android.util.Log;
    import android.widget.Toast;
    
    import com.example.mytestapp.R;
    import com.github.hiteshsondhi88.libffmpeg.ExecuteBinaryResponseHandler;
    import com.github.hiteshsondhi88.libffmpeg.FFmpeg;
    import com.github.hiteshsondhi88.libffmpeg.exceptions.FFmpegCommandAlreadyRunningException;
    
    import java.io.File;
    import java.io.FileNotFoundException;
    import java.io.FileOutputStream;
    import java.io.IOException;
    import java.io.InputStream;
    
    public class MainActivity3 extends AppCompatActivity {
        Context context;
        @Override
        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.activity_main3);
    
        }
        protected Boolean doInBackground() {
            String ffmpegPath = getApplicationContext().getFilesDir().getAbsolutePath() + "/ffmpeg";
            Log.e("called ", ffmpegPath);
    
            String vpath = " /storage/emulated/0/DCIM/Camera/VID_20230325_083306.mp4";
            String aPath = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS) + "/Seesekadil.mp3";
    
            String oPath = "/storage/emulated/0/DCIM/202304_15-223653rangeela.mp4";
            String[] cmd = {"-i", vpath, "-i", aPath, "-shortest", oPath};
            try {
                FFmpeg.getInstance(getApplicationContext()).execute(cmd, new ExecuteBinaryResponseHandler() {
                    @Override
                    public void onStart() {
                        Log.e("Started", "yes");
                    }
    
                    @Override
                    public void onProgress(String message) {
                        // do nothing
                    }
    
                    @Override
                    public void onFailure(String message) {
                        Log.e("Failed ", "yes");
                    }
    
                    @Override
                    public void onSuccess(String message) {
                        Log.e("Success ", "yes");
                    }
    
                    @Override
                    public void onFinish() {
                        // do nothing
                    }
                });
            } catch (FFmpegCommandAlreadyRunningException e) {
                e.printStackTrace();
            }
    
            return null;
        }
    
        @Override
        protected void onResume() {
            super.onResume();
            checkPermission();
            File file = new File(getApplicationContext().getFilesDir(), "ffmpeg");
            if (!file.canExecute()) {
                file.setExecutable(true);
            }
            doInBackground();
    
        }
    
        private void checkPermission() {
            if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {
                return;
            }
            // request camera permission if it has not been grunted.
            if (checkSelfPermission(Manifest.permission.CAMERA) != PackageManager.PERMISSION_GRANTED ||
                    checkSelfPermission(Manifest.permission.RECORD_AUDIO) != PackageManager.PERMISSION_GRANTED ||
                    checkSelfPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED
            ) {
    
                requestPermissions(new String[]{Manifest.permission.CAMERA, Manifest.permission.RECORD_AUDIO, Manifest.permission.WRITE_EXTERNAL_STORAGE}, 1);
            }
    
        }
    
        @Override
        public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
            super.onRequestPermissionsResult(requestCode, permissions, grantResults);
            switch (requestCode) {
                case 1:
                    if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
                        Toast.makeText(MainActivity3.this, "permission has been grunted.", Toast.LENGTH_SHORT).show();
                    } else {
                        Toast.makeText(MainActivity3.this, "[WARN] permission is not grunted.", Toast.LENGTH_SHORT).show();
                    }
                    break;
            }
        }
    
    }