Recherche avancée

Médias (0)

Mot : - Tags -/organisation

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

Autres articles (85)

  • 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) (...)

  • Mediabox : ouvrir les images dans l’espace maximal pour l’utilisateur

    8 février 2011, par

    La visualisation des images est restreinte par la largeur accordée par le design du site (dépendant du thème utilisé). Elles sont donc visibles sous un format réduit. Afin de profiter de l’ensemble de la place disponible sur l’écran de l’utilisateur, il est possible d’ajouter une fonctionnalité d’affichage de l’image dans une boite multimedia apparaissant au dessus du reste du contenu.
    Pour ce faire il est nécessaire d’installer le plugin "Mediabox".
    Configuration de la boite multimédia
    Dès (...)

  • Les statuts des instances de mutualisation

    13 mars 2010, par

    Pour des raisons de compatibilité générale du plugin de gestion de mutualisations avec les fonctions originales de SPIP, les statuts des instances sont les mêmes que pour tout autre objets (articles...), seuls leurs noms dans l’interface change quelque peu.
    Les différents statuts possibles sont : prepa (demandé) qui correspond à une instance demandée par un utilisateur. Si le site a déjà été créé par le passé, il est passé en mode désactivé. publie (validé) qui correspond à une instance validée par un (...)

Sur d’autres sites (6974)

  • Problem in access "libavcodec/avcodec.h" in CPP [duplicate]

    14 septembre 2021, par Sujay

    Note : Not full working code but part of the code.
Problem is when trying to compile it shows the below output.
FFMPEG have installed.
No flag in VS code but error occurred on compile time.
Thanks in Advance.

    


    #include<bits></bits>stdc&#x2B;&#x2B;.h>&#xA;#include<opencv2></opencv2>opencv.hpp>&#xA;&#xA;extern "C" {&#xA;    #include "libavcodec/avcodec.h"&#xA;    #include "libavformat/avformat.h"&#xA;    #include "libavutil/mathematics.h"&#xA;    #include "libavutil/pixfmt.h"&#xA;    #include "libswscale/swscale.h"&#xA;}&#xA;&#xA;using namespace std;&#xA;using namespace cv;&#xA;&#xA;int main(){&#xA;&#xA;&#xA;&#xA;    AVPacket avpkt; int err, frame_decoded = 0;&#xA;    AVCodec *codec = avcodec_find_decoder ( AV_CODEC_ID_H264 );&#xA;    AVCodecContext *codecCtx = avcodec_alloc_context3 ( codec );&#xA;    avcodec_open2 ( codecCtx, codec, NULL );&#xA;    // Set avpkt data and size here&#xA;    // err = avcodec_decode_video2 ( codecCtx, avframe, &amp;frame_decoded, &amp;avpkt );&#xA;    return EXIT_SUCCESS;&#xA;}&#xA;&#xA;

    &#xA;

    Output :

    &#xA;

    h264.cpp:(.text&#x2B;0x15): undefined reference to `avcodec_find_decoder&#x27;&#xA;h264.cpp:(.text&#x2B;0x25): undefined reference to `avcodec_alloc_context3&#x27;&#xA;h264.cpp:(.text&#x2B;0x41): undefined reference to `avcodec_open2&#x27;&#xA;collect2: error: ld returned 1 exit status &#xA;

    &#xA;

  • ffmpeg can't access to usb webcam from python subprocess.Popen in windows

    29 avril 2021, par Tomez

    If I run the following ffmpeg command from windows cmd it works

    &#xA;

    ffmpeg -f dshow -i video="USB Video Device" -s 1280x720 -f rawvideo -pix_fmt rgb24 pipe:&#xA;

    &#xA;

    I then tried to execute the same in python
    &#xA;Python 3.7.4 (tags/v3.7.4:e09359112e, Jul 8 2019, 20:34:20) [MSC v.1916 64 bit (AMD64)] on win32

    &#xA;

    args = [&#xA;    &#x27;ffmpeg&#x27;, &#x27;-f&#x27;, &#x27;dshow&#x27;, &#x27;-i&#x27;, &#x27;video=USB Video Device&#x27;, &#x27;-s&#x27;, &#x27;1280x720&#x27;,&#xA;    &#x27;-f&#x27;, &#x27;rawvideo&#x27;, &#x27;-pix_fmt&#x27;,&#x27;rgb24&#x27;, &#x27;pipe:&#x27;&#xA;]&#xA;ffmpeg_proc = subprocess.Popen(args, stdout=subprocess.PIPE)&#xA;

    &#xA;

    but I get this error

    &#xA;

    D:\Projects\Applications\VideoCapture\Virtualenv\Scripts\python.exe D:/Projects/Applications/VideoCapture/Sources/Application/video_capture.py "USB Video Device" 1280 720&#xA;ffmpeg version 4.4-full_build-www.gyan.dev Copyright (c) 2000-2021 the FFmpeg developers&#xA;  built with gcc 10.2.0 (Rev6, Built by MSYS2 project)&#xA;  configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-lzma --enable-libsnappy --enable-zlib --enable-librist --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libdav1d --enable-libzvbi --enable-librav1e --enable-libsvtav1 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-libass --enable-frei0r --enable-libfreetype --enable-libfribidi --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-libglslang --enable-vulkan --enable-opencl --enable-libcdio --enable-libgme --enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libshine --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libilbc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-ladspa --enable-libbs2b --enable-libflite --enable-libmysofa --enable-librubberband --enable-libsoxr --enable-chromaprint&#xA;  libavutil      56. 70.100 / 56. 70.100&#xA;  libavcodec     58.134.100 / 58.134.100&#xA;  libavformat    58. 76.100 / 58. 76.100&#xA;  libavdevice    58. 13.100 / 58. 13.100&#xA;  libavfilter     7.110.100 /  7.110.100&#xA;  libswscale      5.  9.100 /  5.  9.100&#xA;  libswresample   3.  9.100 /  3.  9.100&#xA;  libpostproc    55.  9.100 / 55.  9.100&#xA;Input #0, dshow, from &#x27;video=USB Video Device&#x27;:&#xA;  Duration: N/A, bitrate: N/A&#xA;  Stream #0:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 640x480, 30 fps, 30 tbr, 10000k tbn, 10000k tbc&#xA;Stream mapping:&#xA;  Stream #0:0 -> #0:0 (rawvideo (native) -> rawvideo (native))&#xA;Press [q] to stop, [?] for help&#xA;video=USB Video Device: I/O error&#xA;Output #0, rawvideo, to &#x27;pipe:&#x27;:&#xA;  Metadata:&#xA;    encoder         : Lavf58.76.100&#xA;  Stream #0:0: Video: rawvideo (RGB[24] / 0x18424752), rgb24, 1280x720, q=2-31, 663552 kb/s, 30 fps, 30 tbn&#xA;    Metadata:&#xA;      encoder         : Lavc58.134.100 rawvideo&#xA;frame=    0 fps=0.0 q=0.0 Lsize=       0kB time=00:00:00.00 bitrate=N/A speed=   0x    &#xA;video:0kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown&#xA;Output file is empty, nothing was encoded (check -ss / -t / -frames parameters if used)&#xA;

    &#xA;

    The inportant row is USB Video Device : I/O error
    &#xA;I've tried also to add shell=True to the Popen but with the same result.

    &#xA;

    Doing some tests I found that using pycharm debug mode or simply lunching the same code inside "Pycharm Python Console" no more I/O error and all seems to work. I think something changes in the environment created for the subrocess but I wasn't able to understand what PyCharm is doing under the hood.

    &#xA;

    Here the output inside PyCharm Python Console

    &#xA;

    D:\Projects\Applications\VideoCapture\Virtualenv\Scripts\python.exe "C:\Program Files\JetBrains\PyCharm Community Edition 2019.1.1\plugins\python-ce\helpers\pydev\pydevconsole.py" --mode=client --port=65058&#xA;import sys; print(&#x27;Python %s on %s&#x27; % (sys.version, sys.platform))&#xA;sys.path.extend([&#x27;D:\\Projects\\Applications\\VideoCapture&#x27;, &#x27;D:\\Projects\\Applications\\VideoCapture\\Sources\\Application&#x27;, &#x27;D:\\Projects\\Applications\\VideoCapture\\Sources\\Compiler&#x27;, &#x27;D:/Projects/Applications/VideoCapture&#x27;])&#xA;PyDev console: starting.&#xA;Python 3.7.4 (tags/v3.7.4:e09359112e, Jul  8 2019, 20:34:20) [MSC v.1916 64 bit (AMD64)] on win32&#xA;runfile(&#x27;D:/Projects/Applications/VideoCapture/Sources/Application/video_capture.py&#x27;, args=[&#x27;USB Video Device&#x27;, &#x27;1280&#x27;, &#x27;720&#x27;], wdir=&#x27;D:/Projects/Applications/VideoCapture/Sources/Application&#x27;)&#xA;ffmpeg version 4.4-full_build-www.gyan.dev Copyright (c) 2000-2021 the FFmpeg developers&#xA;  built with gcc 10.2.0 (Rev6, Built by MSYS2 project)&#xA;  configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-lzma --enable-libsnappy --enable-zlib --enable-librist --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libdav1d --enable-libzvbi --enable-librav1e --enable-libsvtav1 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-libass --enable-frei0r --enable-libfreetype --enable-libfribidi --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-libglslang --enable-vulkan --enable-opencl --enable-libcdio --enable-libgme --enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libshine --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libilbc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-ladspa --enable-libbs2b --enable-libflite --enable-libmysofa --enable-librubberband --enable-libsoxr --enable-chromaprint&#xA;  libavutil      56. 70.100 / 56. 70.100&#xA;  libavcodec     58.134.100 / 58.134.100&#xA;  libavformat    58. 76.100 / 58. 76.100&#xA;  libavdevice    58. 13.100 / 58. 13.100&#xA;  libavfilter     7.110.100 /  7.110.100&#xA;  libswscale      5.  9.100 /  5.  9.100&#xA;  libswresample   3.  9.100 /  3.  9.100&#xA;  libpostproc    55.  9.100 / 55.  9.100&#xA;Input #0, dshow, from &#x27;video=USB Video Device&#x27;:&#xA;  Duration: N/A, start: 111984.462000, bitrate: N/A&#xA;  Stream #0:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 640x480, 30 fps, 30 tbr, 10000k tbn, 10000k tbc&#xA;Stream mapping:&#xA;  Stream #0:0 -> #0:0 (rawvideo (native) -> rawvideo (native))&#xA;Press [q] to stop, [?] for help&#xA;Output #0, rawvideo, to &#x27;pipe:&#x27;:&#xA;  Metadata:&#xA;    encoder         : Lavf58.76.100&#xA;  Stream #0:0: Video: rawvideo (RGB[24] / 0x18424752), rgb24(pc, progressive), 1280x720, q=2-31, 663552 kb/s, 30 fps, 30 tbn&#xA;    Metadata:&#xA;      encoder         : Lavc58.134.100 rawvideo&#xA;av_interleaved_write_frame(): Invalid argument&#xA;    Last message repeated 1 times&#xA;Error writing trailer of pipe:: Invalid argument&#xA;frame=  118 fps= 30 q=-0.0 Lsize=  313200kB time=00:00:03.93 bitrate=652306.1kbits/s dup=53 drop=0 speed=   1x&#xA;

    &#xA;

    Does anyone now how to fix this problem or have any knowledge on how PyCharm Python Console works ?

    &#xA;

  • Why storage access functions not working on android 10 API-29 ? error=13, Permission denied ?

    8 janvier 2021, par Rpatel
    &#xA;

    This example code is to create video from images and music.&#xA;Code running on till API level 28 but when I just upgrade to&#xA;Build version 29 then it starts crashing. I tried the most solution&#xA;but could not find the proper reason and solution.
    &#xA;Please let me know...

    &#xA;

    &#xA;

    2

    &#xA;

    021-01-08 19:48:16.045 18413-19578/com.example.photovideomaker E/audio: io&#xA;    java.io.IOException: Cannot run program "/data/user/0/com.example.photovideomaker/files/ffmpeg": error=13, Permission denied&#xA;        at java.lang.ProcessBuilder.start(ProcessBuilder.java:1050)&#xA;        at java.lang.Runtime.exec(Runtime.java:698)&#xA;        at java.lang.Runtime.exec(Runtime.java:563)&#xA;        at com.example.photovideomaker.service.CreateVideoService.joinAudio(CreateVideoService.java:252)&#xA;        at com.example.photovideomaker.service.CreateVideoService.createVideo(CreateVideoService.java:89)&#xA;        at com.example.photovideomaker.service.CreateVideoService.onHandleIntent(CreateVideoService.java:83)&#xA;        at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:78)&#xA;        at android.os.Handler.dispatchMessage(Handler.java:107)&#xA;        at android.os.Looper.loop(Looper.java:214)&#xA;        at android.os.HandlerThread.run(HandlerThread.java:67)&#xA;     Caused by: java.io.IOException: error=13, Permission denied&#xA;        at java.lang.UNIXProcess.forkAndExec(Native Method)&#xA;        at java.lang.UNIXProcess.<init>(UNIXProcess.java:133)&#xA;        at java.lang.ProcessImpl.start(ProcessImpl.java:141)&#xA;        at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)&#xA;        at java.lang.Runtime.exec(Runtime.java:698)&#xA0;&#xA;        at java.lang.Runtime.exec(Runtime.java:563)&#xA0;&#xA;        at com.example.photovideomaker.service.CreateVideoService.joinAudio(CreateVideoService.java:252)&#xA0;&#xA;        at com.example.photovideomaker.service.CreateVideoService.createVideo(CreateVideoService.java:89)&#xA0;&#xA;        at com.example.photovideomaker.service.CreateVideoService.onHandleIntent(CreateVideoService.java:83)&#xA0;&#xA;        at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:78)&#xA0;&#xA;        at android.os.Handler.dispatchMessage(Handler.java:107)&#xA0;&#xA;        at android.os.Looper.loop(Looper.java:214)&#xA0;&#xA;        at android.os.HandlerThread.run(HandlerThread.java:67)&#xA0;&#xA;</init>

    &#xA;

    &#xA;

    This function throwing the error "On Process.runtime"

    &#xA;

    &#xA;

    private void createVideo() {&#xA;        long startTime = System.currentTimeMillis();&#xA;        toatalSecond = (application.getSecond() * ((float) application.getSelectedImages().size())) - DEFAULT_FONT_SCALE;&#xA;        joinAudio();&#xA;        while (true) {&#xA;            if (ImageCreatorService.isImageComplate) {&#xA;                Log.e("image creation ", " complte");&#xA;&#xA;                break;&#xA;            }else {&#xA;                Log.e("image creation ", "not complte");&#xA;            }&#xA;        }&#xA;        Log.e("createVideo", "video create start");&#xA;        new File(FileUtils.TEMP_DIRECTORY, "video.txt").delete();&#xA;        for (int i = 0; i &lt; application.videoImages.size(); i&#x2B;&#x2B;) {&#xA;            appendVideoLog(String.format("file &#x27;%s&#x27;", application.videoImages.get(i)));&#xA;        }&#xA;&#xA;        File r0=new File(FileUtils.TEMP_DIRECTORY, "video.txt");&#xA;        String videoPath = new File(FileUtils.APP_DIRECTORY, getVideoName()).getAbsolutePath();&#xA;        String[] inputCode = application.getMusicData() != null ? new String[]{&#xA;                FileUtils.getFFmpeg(this), "-r",&#xA;                String.valueOf(BitmapDescriptorFactory.HUE_ORANGE / application.getSecond()),&#xA;                "-f", "concat", "-safe", "0", "-i", r0.getAbsolutePath(), "-i",&#xA;                audioFile.getAbsolutePath(), "-strict", "experimental", "-r", "30",&#xA;                "-t", String.valueOf(toatalSecond), "-c:v", "libx264", "-preset",&#xA;                "ultrafast", "-pix_fmt", "yuv420p", "-ac", "2", videoPath}&#xA;        : new String[]{FileUtils.getFFmpeg(this),&#xA;                "-r", String.valueOf(BitmapDescriptorFactory.HUE_ORANGE / application.getSecond()),&#xA;                "-f", "concat", "-i", r0.getAbsolutePath(), "-r", "30", "-c:v", "libx264", "-preset", "ultrafast", "-pix_fmt", "yuv420p", videoPath};&#xA;&#xA;        System.gc();&#xA;        Process process = null;&#xA;        try {&#xA;            process = Runtime.getRuntime().exec(inputCode);&#xA;            while (!Util.isProcessCompleted(process)) {&#xA;                BufferedReader reader = new BufferedReader(new InputStreamReader(process.getErrorStream()));&#xA;                while (true) {&#xA;                    String line = reader.readLine();&#xA;                    if (line != null) {&#xA;                        Log.e("process", line);&#xA;                        appendLog(line);&#xA;                        final int incr = durationToprogtess(line);&#xA;                        new Handler(Looper.getMainLooper()).post(new Runnable() {&#xA;                            public void run() {&#xA;                                if (receiver != null) {&#xA;                                    receiver.onVideoProgressUpdate(incr);&#xA;                                }&#xA;                            }&#xA;                        });&#xA;                        mBuilder.setProgress(100, ((int) ((75.0f * ((float) incr)) / 100.0f)) &#x2B; 25, false);&#xA;                        mNotifyManager.notify(1001, mBuilder.build());&#xA;                    }else {&#xA;                        break;&#xA;                    }&#xA;                }&#xA;            }&#xA;        } catch (IOException e) {&#xA;            e.printStackTrace();&#xA;        } finally {&#xA;            Util.destroyProcess(process);&#xA;        }&#xA;        mBuilder.setContentText("Video created :" &#x2B; FileUtils.getDuration(System.currentTimeMillis() - startTime)).setProgress(0, 0, false);&#xA;        mNotifyManager.notify(1001, mBuilder.build());&#xA;        try {&#xA;            long fileSize = new File(videoPath).length();&#xA;            String artist = getResources().getString(R.string.artist_name);&#xA;            ContentValues values = new ContentValues();&#xA;            values.put("_data", videoPath);&#xA;            values.put("_size", Long.valueOf(fileSize));&#xA;            values.put("mime_type", "video/mp4");&#xA;            values.put("artist", artist);&#xA;            values.put("duration", Float.valueOf(toatalSecond * 1000.0f));&#xA;            getContentResolver().insert(Media.getContentUriForPath(videoPath), values);&#xA;        } catch (Exception e2) {&#xA;            e2.printStackTrace();&#xA;        }&#xA;        try {&#xA;            sendBroadcast(new Intent("android.intent.action.MEDIA_SCANNER_SCAN_FILE", Uri.fromFile(new File(videoPath))));&#xA;        } catch (Exception e3) {&#xA;            e3.printStackTrace();&#xA;        }&#xA;&#xA;        buildNotification(videoPath);&#xA;        final String str = videoPath;&#xA;        new Handler(Looper.getMainLooper()).post(new Runnable() {&#xA;            public void run() {&#xA;                if (receiver != null) {&#xA;                    receiver.onVideoProgressUpdate(100);&#xA;                    receiver.onProgressFinish(str);&#xA;                }&#xA;            }&#xA;        });&#xA;        FileUtils.deleteTempDir();&#xA;       stopSelf();&#xA;    }&#xA;

    &#xA;

    I have tried checking the directory in storage and check mkdir is working or not but this function purely works for creating video from a collection of images, themes, and audio. as per android

    &#xA;