Recherche avancée

Médias (2)

Mot : - Tags -/media

Autres articles (69)

  • Gestion générale des documents

    13 mai 2011, par

    MédiaSPIP ne modifie jamais le document original mis en ligne.
    Pour chaque document mis en ligne il effectue deux opérations successives : la création d’une version supplémentaire qui peut être facilement consultée en ligne tout en laissant l’original téléchargeable dans le cas où le document original ne peut être lu dans un navigateur Internet ; la récupération des métadonnées du document original pour illustrer textuellement le fichier ;
    Les tableaux ci-dessous expliquent ce que peut faire MédiaSPIP (...)

  • Des sites réalisés avec MediaSPIP

    2 mai 2011, par

    Cette page présente quelques-uns des sites fonctionnant sous MediaSPIP.
    Vous pouvez bien entendu ajouter le votre grâce au formulaire en bas de page.

  • Websites made ​​with MediaSPIP

    2 mai 2011, par

    This page lists some websites based on MediaSPIP.

Sur d’autres sites (6320)

  • ffmpeg : Overlay audios with different lengths using amix and apad

    23 novembre 2017, par Valdir

    I’m trying to overlay two audio files with the following command :

    ffmpeg -y -i mp3/test1.mp3 -i mp3/test2.mp3 -filter_complex "[0:0][1:0] amix=inputs=2:duration=longest" -c:a libmp3lame merged.mp3

    But it fails if the length of the audios are different :

    ffmpeg -y -i live.mp3 -i mp3/test1.mp3 -filter_complex "[0:0][1:0] amix=inputs=2:duration=longest" -c:a libmp3lame merged2.mp3
    ffmpeg version 2.8.11-0ubuntu0.16.04.1 Copyright (c) 2000-2017 the FFmpeg developers
     built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.4) 20160609
     configuration: --prefix=/usr --extra-version=0ubuntu0.16.04.1 --build-suffix=-ffmpeg --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --cc=cc --cxx=g++ --enable-gpl --enable-shared --disable-stripping --disable-decoder=libopenjpeg --disable-decoder=libschroedinger --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librtmp --enable-libschroedinger --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxvid --enable-libzvbi --enable-openal --enable-opengl --enable-x11grab --enable-libdc1394 --enable-libiec61883 --enable-libzmq --enable-frei0r --enable-libx264 --enable-libopencv
     libavutil      54. 31.100 / 54. 31.100
     libavcodec     56. 60.100 / 56. 60.100
     libavformat    56. 40.101 / 56. 40.101
     libavdevice    56.  4.100 / 56.  4.100
     libavfilter     5. 40.101 /  5. 40.101
     libavresample   2.  1.  0 /  2.  1.  0
     libswscale      3.  1.101 /  3.  1.101
     libswresample   1.  2.101 /  1.  2.101
     libpostproc    53.  3.100 / 53.  3.100
    [mp3 @ 0x22cf760] Format mp3 detected only with low score of 1, misdetection possible!
    [mp3 @ 0x22cf760] Could not find codec parameters for stream 0 (Audio: mp3, 0 channels, s16p): unspecified frame size
    Consider increasing the value for the 'analyzeduration' and 'probesize' options
    live.mp3: could not find codec parameters
    Input #0, mp3, from 'live.mp3':
     Duration: N/A, start: 0.000000, bitrate: N/A
       Stream #0:0: Audio: mp3, 0 channels, s16p
    [mp3 @ 0x22d10a0] Skipping 0 bytes of junk at 18034.
    Input #1, mp3, from 'mp3/test1.mp3':
     Metadata:
       title           : Nothing Else Matters [Official Music Video]
       artist          : Metallica
     Duration: 00:06:25.80, start: 0.025057, bitrate: 192 kb/s
       Stream #1:0: Audio: mp3, 44100 Hz, stereo, s16p, 192 kb/s
       Metadata:
         encoder         : Lavc56.14
    [abuffer @ 0x22fa2c0] Value inf for parameter 'time_base' out of range [0 - 2.14748e+09]
       Last message repeated 3 times
    [abuffer @ 0x22fa2c0] Error setting option time_base to value 1/0.
    [graph 0 input from stream 0:0 @ 0x22fa3e0] Error applying options to the filter.
    Error configuring complex filters.
    Numerical result out of range

    How do I add the apad filter so that silence is added to the shortest audio ?

  • Undefined symbol despite libraries being linked

    17 septembre 2020, par Areopag

    currently I'm trying to write a JNI function using ffmpeg features, but when I'm trying to run my java executable after a clean compile I get the following error :

    


    /usr/lib/jvm/java-1.11.0-openjdk-amd64/bin/java: symbol lookup error: /lib/libmediaserv_ffmpeg.so: undefined symbol: _Z19avformat_open_inputPP15AVFormatContextPKcP13AVInputFormatPP12AVDictionary


    


    I can't figure out why ffmpeg is not linked correctly.

    


    mediaserv_ffmpeg.cpp :

    


    #include <iostream>&#xA;#include <libavformat></libavformat>avformat.h>&#xA;#include <libavutil></libavutil>avutil.h>&#xA;&#xA;JNIEXPORT jobject JNICALL Java_mediaserv_ffmpeg_getMetadata&#xA;        (JNIEnv* env, jclass cls, jstring path) { ... }&#xA;</iostream>

    &#xA;

    What I've tried so far is inspecting libmediaserv_ffmpeg.so :

    &#xA;

     nm libmediaserv_ffmpeg.so --format=sysv | grep avformat&#xA;_Z19avformat_open_inputPP15AVFormatContextPKcP13AVInputFormatPP12AVDictionary|                |   U  |            NOTYPE|                |     |*UND*&#xA;_Z20avformat_close_inputPP15AVFormatContext|                |   U  |            NOTYPE|                |     |*UND*&#xA;_Z25avformat_find_stream_infoP15AVFormatContextPP12AVDictionary|                |   U  |            NOTYPE|                |     |*UND*&#xA;

    &#xA;

    Which, I think, is just another way of saying that there are undefined symbols in the .so file.

    &#xA;

    The commands used to build the lib (taken from make VERBOSE=1) :

    &#xA;

    /usr/bin/c&#x2B;&#x2B;  -Dmediaserv_ffmpeg_EXPORTS -I/usr/lib/jvm/java-11-openjdk-amd64/include -I/usr/lib/jvm/java-11-openjdk-amd64/include/linux -I/mnt/g/Workspace/mediaserv/third-party/ffmpeg  -fPIC   -std=gnu&#x2B;&#x2B;1z -o CMakeFiles/mediaserv_ffmpeg.dir/mediaserv_ffmpeg.cpp.o -c /mnt/g/Workspace/mediaserv/third-party/mediaserv_ffmpeg.cpp&#xA;/usr/bin/c&#x2B;&#x2B; -fPIC   -shared -Wl,-soname,libmediaserv_ffmpeg.so -o /mnt/g/Workspace/mediaserv/build/libs/libmediaserv_ffmpeg.so CMakeFiles/mediaserv_ffmpeg.dir/mediaserv_ffmpeg.cpp.o  -Wl,-rpath,/usr/lib/jvm/java-11-openjdk-amd64/lib:/usr/lib/jvm/java-11-openjdk-amd64/lib/server:/mnt/g/Workspace/mediaserv/third-party/ffmpeg/libavutil:/mnt/g/Workspace/mediaserv/third-party/ffmpeg/libavformat /usr/lib/jvm/java-11-openjdk-amd64/lib/libjawt.so /usr/lib/jvm/java-11-openjdk-amd64/lib/server/libjvm.so ../ffmpeg/libavutil/libavutil.so ../ffmpeg/libavformat/libavformat.so&#xA;

    &#xA;

    I've already tried to seek for errors in GCC's trace option for the linker and it lists me which libraries it tries to link / is linking but the result stays the same.

    &#xA;

    /usr/bin/ld: mode elf_x86_64&#xA;/usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/crti.o&#xA;/usr/lib/gcc/x86_64-linux-gnu/7/crtbeginS.o&#xA;CMakeFiles/mediaserv_ffmpeg.dir/mediaserv_ffmpeg.cpp.o&#xA;/usr/lib/jvm/java-11-openjdk-amd64/lib/libjawt.so&#xA;/usr/lib/jvm/java-11-openjdk-amd64/lib/server/libjvm.so&#xA;../ffmpeg/libavutil/libavutil.so&#xA;../ffmpeg/libavformat/libavformat.so&#xA;-lstdc&#x2B;&#x2B; (/usr/lib/gcc/x86_64-linux-gnu/7/libstdc&#x2B;&#x2B;.so)&#xA;/lib/x86_64-linux-gnu/libm.so.6&#xA;/lib/x86_64-linux-gnu/libmvec.so.1&#xA;libgcc_s.so.1 (/usr/lib/gcc/x86_64-linux-gnu/7/libgcc_s.so.1)&#xA;/lib/x86_64-linux-gnu/libc.so.6&#xA;/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2&#xA;/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2&#xA;libgcc_s.so.1 (/usr/lib/gcc/x86_64-linux-gnu/7/libgcc_s.so.1)&#xA;/usr/lib/gcc/x86_64-linux-gnu/7/crtendS.o&#xA;/usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/crtn.o&#xA;

    &#xA;

    CMakeLists.txt :

    &#xA;

    cmake_minimum_required(VERSION 3.17)&#xA;project(mediaserv_ffmpeg)&#xA;&#xA;set(CMAKE_CXX_STANDARD 17)&#xA;set(BUILD_SHARED_LIBS ON)&#xA;add_library(${PROJECT_NAME} SHARED mediaserv_ffmpeg.cpp mediaserv_ffmpeg.h)&#xA;&#xA;find_package(JNI REQUIRED)&#xA;&#xA;find_path(AVUTIL_INCLUDE_DIR libavutil/avutil.h HINTS ffmpeg REQUIRED)&#xA;find_library(AVUTIL_LIBRARY avutil HINTS ${PROJECT_SOURCE_DIR}/ffmpeg/libavutil PATHS REQUIRED)&#xA;&#xA;find_path(AVFORMAT_INCLUDE_DIR libavformat/avformat.h HINTS ffmpeg REQUIRED)&#xA;find_library(AVFORMAT_LIBRARY avformat HINTS ${PROJECT_SOURCE_DIR}/ffmpeg/libavformat REQUIRED)&#xA;&#xA;target_include_directories(${PROJECT_NAME} PRIVATE ${JNI_INCLUDE_DIRS} ${AVUTIL_INCLUDE_DIR} ${AVFORMAT_INCLUDE_DIR})&#xA;&#xA;target_link_libraries(${PROJECT_NAME} ${JNI_LIBRARIES} ${AVUTIL_LIBRARY} ${AVFORMAT_LIBRARY})&#xA;

    &#xA;

    Neither ffmpeg taken from the official ubuntu bionic repository nor a self-compiled version with configure --enable-shared works for me.

    &#xA;

    Where is my mistake or what could I still inspect ?

    &#xA;

    Thanks in advance.

    &#xA;

  • How to play video file with audio with DearPyGUI (Python) ?

    1er mars 2023, par Vi Tiet

    I'm using DearPyGUI to make a simple media player that can play video file (mp4, etc.) together with it's audio. The pre-requisite is that DearPyGUI is a must, however video feature will not exist until v2.0, which is still far in the future.

    &#xA;

    Currently, I can only render the frames using OpenCV library for Python, however, the problem is how can I play the audio as well as play it in sync with the output video frames ?

    &#xA;

    For context, I'm quite new to Python, and I don't know much about video and audio streaming, but I've thought of some approaches to this problem by looking through help posts online (However, I still have no idea how I can implement any of these seamlessly) :

    &#xA;

      &#xA;
    1. OpenCV for video frames, and audio ??? some libraries like ffmpeg-python or miniaudio to play sound... (How...?)

      &#xA;

    2. &#xA;

    3. Extract video frames and audio here and then use the raw data to play it (How...?)

      &#xA;

    4. &#xA;

    5. This example here is pretty close to what I want excluding the playing video and audio part, but I have no idea where to go from there. The video stream and the audio stream are instances of ffmpeg.nodes.FilterableStream, and they appear to hold addresses to somewhere. (No idea...)

      &#xA;

    6. &#xA;

    7. Another very close idea is using ffpyplayer I was able to get the video frame. However, the below code yields a blueish purple color tint to the video, and the frame rate is very slow compared to original (So close...)

      &#xA;

    8. &#xA;

    &#xA;

    import time&#xA;import numpy as np&#xA;import cv2 as cv&#xA;from ffpyplayer.player import MediaPlayer&#xA;&#xA;&#xA;# https://github.com/Kazuhito00/Image-Processing-Node-Editor/blob/main/node_editor/util.py &#xA;def cv2dpg(frame): &#xA;&#xA;    data = cv.resize(frame, (VIDEO_WIDTH, VIDEO_HEIGHT))&#xA;    data = np.flip(frame, 2)&#xA;    data = data.ravel()&#xA;    data = np.asfarray(data, dtype=np.float32)&#xA;&#xA;    return np.true_divide(data, 255.0)&#xA;&#xA;&#xA;# https://stackoverflow.com/questions/59611075/how-would-i-go-about-playing-a-video-stream-with-ffpyplayer&#xA;# https://matham.github.io/ffpyplayer/examples.html#examples&#xA;def play_video(loaded_file_path):&#xA;&#xA;    global player, is_playing&#xA;    player = MediaPlayer(loaded_file_path)&#xA;&#xA;    while is_playing:&#xA;&#xA;        frame, val = player.get_frame()&#xA;&#xA;        if val == &#x27;eof&#x27;:&#xA;            is_playing = False&#xA;            break&#xA;&#xA;        elif not frame:&#xA;            time.sleep(0.01)&#xA;&#xA;        elif val != &#x27;eof&#x27; and frame is not None:&#xA;            img, t = frame&#xA;            w = img.get_size()[0]&#xA;            h = img.get_size()[1]&#xA;            cv_mat = np.uint8(np.asarray(list(img.to_bytearray()[0])).reshape((h, w, 3)))&#xA;            texture_data = cv2dpg(cv_mat)&#xA;            dpg.set_value(VIDEO_CANVAS_TAG, texture_data)&#xA;&#xA;    dpg.set_value(VIDEO_CANVAS_TAG, DEFAULT_VIDEO_TEXTURE)&#xA;

    &#xA;

    I still need to do more research, but any pointer to somewhere good to start off (either handling raw data or using different libraries) would be greatly appreciated !

    &#xA;

    EDIT :&#xA;For more context, I'm using raw texture like this example of DearPyGUI official documentation to render the video frames that were extracted in the while loop.

    &#xA;