Recherche avancée

Médias (2)

Mot : - Tags -/documentation

Autres articles (59)

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

  • Dépôt de média et thèmes par FTP

    31 mai 2013, par

    L’outil MédiaSPIP traite aussi les média transférés par la voie FTP. Si vous préférez déposer par cette voie, récupérez les identifiants d’accès vers votre site MédiaSPIP et utilisez votre client FTP favori.
    Vous trouverez dès le départ les dossiers suivants dans votre espace FTP : config/ : dossier de configuration du site IMG/ : dossier des média déjà traités et en ligne sur le site local/ : répertoire cache du site web themes/ : les thèmes ou les feuilles de style personnalisées tmp/ : dossier de travail (...)

  • Keeping control of your media in your hands

    13 avril 2011, par

    The vocabulary used on this site and around MediaSPIP in general, aims to avoid reference to Web 2.0 and the companies that profit from media-sharing.
    While using MediaSPIP, you are invited to avoid using words like "Brand", "Cloud" and "Market".
    MediaSPIP is designed to facilitate the sharing of creative media online, while allowing authors to retain complete control of their work.
    MediaSPIP aims to be accessible to as many people as possible and development is based on expanding the (...)

Sur d’autres sites (8213)

  • avcodec_find_decoder() can't find AV_CODEC_ID_WMAV2 even through CLI can parse WMAs on macOS ?

    3 octobre 2023, par grendell

    I am following the decode_audio.c example from FFmpeg, but I am unable to initialize a parser for AV_CODEC_ID_WMAV2.

    


    Test code :

    


    #include &#xA;#include <libavcodec></libavcodec>avcodec.h>&#xA;&#xA;int main() {&#xA;    // codec is found successfully&#xA;    const AVCodec * codec = avcodec_find_decoder(AV_CODEC_ID_WMAV2);&#xA;    if (!codec) {&#xA;        fprintf(stderr, "codec not found\n");&#xA;        return 1;&#xA;    }&#xA;&#xA;    // parser is always NULL&#xA;    AVCodecParserContext * parser = av_parser_init(codec->id);&#xA;    if (!parser) {&#xA;        fprintf(stderr, "parser not found\n");&#xA;        return 1;&#xA;    }&#xA;&#xA;    av_parser_close(parser);&#xA;    return 0;&#xA;}&#xA;

    &#xA;

    Build commands :

    &#xA;

    clang -c -I/opt/homebrew/Cellar/ffmpeg/6.0_1/include wma2mp3.c -o obj/wma2mp3.o&#xA;clang -L/opt/homebrew/Cellar/ffmpeg/6.0_1/lib -lavcodec obj/wma2mp3.o -o wma2mp3&#xA;

    &#xA;

    I'm surprised by the fact that the FFmpeg CLI can perform this operation on the same machine :

    &#xA;

    % ffmpeg -i test.wma test.mp3&#xA;ffmpeg version 6.0 Copyright (c) 2000-2023 the FFmpeg developers&#xA;  built with Apple clang version 14.0.3 (clang-1403.0.22.14.1)&#xA;  configuration: --prefix=/opt/homebrew/Cellar/ffmpeg/6.0_1 --enable-shared --enable-pthreads --enable-version3 --cc=clang --host-cflags= --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libaribb24 --enable-libbluray --enable-libdav1d --enable-libjxl --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librist --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libsvtav1 --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libspeex --enable-libsoxr --enable-libzmq --enable-libzimg --disable-libjack --disable-indev=jack --enable-videotoolbox --enable-audiotoolbox --enable-neon&#xA;  libavutil      58.  2.100 / 58.  2.100&#xA;  libavcodec     60.  3.100 / 60.  3.100&#xA;  libavformat    60.  3.100 / 60.  3.100&#xA;  libavdevice    60.  1.100 / 60.  1.100&#xA;  libavfilter     9.  3.100 /  9.  3.100&#xA;  libswscale      7.  1.100 /  7.  1.100&#xA;  libswresample   4. 10.100 /  4. 10.100&#xA;  libpostproc    57.  1.100 / 57.  1.100&#xA;Guessed Channel Layout for Input Stream #0.0 : mono&#xA;Input #0, asf, from &#x27;test.wma&#x27;:&#xA;  Metadata:&#xA;    ToolName        : Windows Media Encoding Utility&#xA;    ToolVersion     : 8.00.00.0343&#xA;  Duration: 00:00:00.74, start: 0.000000, bitrate: 80 kb/s&#xA;  Stream #0:0: Audio: wmav2 (a[1][0][0] / 0x0161), 44100 Hz, 1 channels, fltp, 48 kb/s&#xA;Stream mapping:&#xA;  Stream #0:0 -> #0:0 (wmav2 (native) -> mp3 (libmp3lame))&#xA;Press [q] to stop, [?] for help&#xA;Output #0, mp3, to &#x27;test.mp3&#x27;:&#xA;  Metadata:&#xA;    ToolName        : Windows Media Encoding Utility&#xA;    ToolVersion     : 8.00.00.0343&#xA;    TSSE            : Lavf60.3.100&#xA;  Stream #0:0: Audio: mp3, 44100 Hz, mono, fltp&#xA;    Metadata:&#xA;      encoder         : Lavc60.3.100 libmp3lame&#xA;[libmp3lame @ 0x130706320] Queue input is backward in timeed=N/A    &#xA;[mp3 @ 0x1307056e0] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 15668 >= 14764&#xA;size=       8kB time=00:00:00.97 bitrate=  65.8kbits/s speed= 103x    &#xA;video:0kB audio:8kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 4.048112%&#xA;

    &#xA;

    I am using an Apple M1 machine running MacOS 13.5.2 (22G91).

    &#xA;

    Is the CLI using a different mechanism than av_parser_parse2 to perform this conversion, and is there a better way to accomplish this via the C API ?

    &#xA;

  • Can't fix this ffmpeg, NoClassDefFoundError org.bytedeco.ffmpeg.global.avutil

    16 mars 2023, par noob234

    I am trying to get the video duration with this library import org.bytedeco.javacv.FFmpegFrameGrabber;

    &#xA;

    When I upload this mp4 video (https://sample-videos.com/video123/mp4/720/big_buck_bunny_720p_1mb.mp4), I get this error message :&#xA;java.lang.NoClassDefFoundError: Could not initialize class org.bytedeco.ffmpeg.global.avutil

    &#xA;

    It will break when trying to get the 'grabber' :

    &#xA;

    private void videoInfo(MultipartFile file) {&#xA;    try (FFmpegFrameGrabber grabber = new FFmpegFrameGrabber(file.getInputStream())) { // on this line it will break :(&#xA;        grabber.start();&#xA;        long durationMs = grabber.getLengthInTime();&#xA;    } catch (FrameGrabber.Exception e) {&#xA;        throw new RuntimeException(e);&#xA;    } catch (IOException e) {&#xA;        throw new RuntimeException(e);&#xA;    }&#xA;}&#xA;

    &#xA;

    This is my build.gradle :

    &#xA;

    plugins {&#xA;    id &#x27;java&#x27;&#xA;    id &#x27;org.springframework.boot&#x27; version &#x27;2.7.9&#x27;&#xA;    id &#x27;io.spring.dependency-management&#x27; version &#x27;1.0.15.RELEASE&#x27;&#xA;}&#xA;&#xA;group = &#x27;com.nob234&#x27;&#xA;version = &#x27;0.0.1-SNAPSHOT&#x27;&#xA;&#xA;configurations {&#xA;    compileOnly {&#xA;        extendsFrom annotationProcessor&#xA;    }&#xA;}&#xA;&#xA;repositories {&#xA;    mavenCentral()&#xA;}&#xA;&#xA;dependencies {&#xA;    implementation &#x27;org.springframework.boot:spring-boot-starter-web&#x27;&#xA;    compileOnly &#x27;org.projectlombok:lombok&#x27;&#xA;    annotationProcessor &#x27;org.projectlombok:lombok&#x27;&#xA;    testImplementation &#x27;org.springframework.boot:spring-boot-starter-test&#x27;&#xA;    implementation &#x27;org.springdoc:springdoc-openapi-ui:1.6.9&#x27;&#xA;    implementation &#x27;org.springframework.boot:spring-boot-starter-data-jpa&#x27;&#xA;    runtimeOnly &#x27;org.postgresql:postgresql&#x27;&#xA;    // for logging&#xA;    implementation &#x27;org.slf4j:slf4j-api:1.7.30&#x27;&#xA;    implementation &#x27;org.slf4j:jcl-over-slf4j:1.7.30&#x27;&#xA;    implementation &#x27;org.slf4j:log4j-over-slf4j:1.7.30&#x27;&#xA;    implementation &#x27;ch.qos.logback:logback-classic:1.2.3&#x27;&#xA;    implementation &#x27;org.bytedeco:javacv:1.5.8&#x27;&#xA;}&#xA;&#xA;tasks.named(&#x27;test&#x27;) {&#xA;    useJUnitPlatform()&#xA;}&#xA;

    &#xA;

    This is my ffmpeg version :

    &#xA;

    ffmpeg version 6.0-full_build-www.gyan.dev Copyright (c) 2000-2023 the FFmpeg developers&#xA;built with gcc 12.2.0 (Rev10, 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-bzlib --enable-lzma --enable-libsnappy --enable-zlib --enable-librist --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libaribb24 --enable-libdav1d --enable-libdavs2 --enable-libuavs3d --enable-libzvbi --enable-librav1e --enable-libsvtav1 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libaom --enable-libjxl --enable-libopenjpeg --enable-libvpx --enable-mediafoundation --enable-libass --enable-frei0r --enable-libfreetype --enable-libfribidi --enable-liblensfun --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libvpl --enable-libshaderc --enable-vulkan --enable-libplacebo --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      58.  2.100 / 58.  2.100&#xA;libavcodec     60.  3.100 / 60.  3.100&#xA;libavformat    60.  3.100 / 60.  3.100&#xA;libavdevice    60.  1.100 / 60.  1.100&#xA;libavfilter     9.  3.100 /  9.  3.100&#xA;libswscale      7.  1.100 /  7.  1.100&#xA;libswresample   4. 10.100 /  4. 10.100&#xA;libpostproc    57.  1.100 / 57.  1.100&#xA;

    &#xA;

    Please keep in mind that I use Java 8 in this project and I hope this issue is reproducible. If you want more info please leave a comment.

    &#xA;

  • Piping OpenCV raw video frames into FFMpeg results in corrupted output

    27 novembre 2023, par Dudad

    I have written a python script to open my webcam in OpenCV and convert captured frames to video streams. I have followed some tutorials that basically do these things :

    &#xA;

      &#xA;
    1. Creating a pipe input to FFMpeg
    2. &#xA;

    3. Writing OpenCV video frames into the pipe. FFMpeg should then encode and output the video.
    4. &#xA;

    &#xA;

    In my case, FFMpeg runs without errors, and using imshow() displays captured frames correctly, but the FFMpeg video output is corrupted.

    &#xA;

    imshow()&#xA;video output

    &#xA;

    code :

    &#xA;

    import cv2 as cv&#xA;import subprocess as sp&#xA;&#xA;FPS = 24&#xA;WIDTH = 720&#xA;HEIGHT = 360&#xA;&#xA;cap = cv.VideoCapture(0)&#xA;cap.set(cv.CAP_PROP_FPS, FPS)&#xA;cap.set(cv.CAP_PROP_FRAME_WIDTH, WIDTH)&#xA;cap.set(cv.CAP_PROP_FRAME_HEIGHT, HEIGHT)&#xA;&#xA;# ffmpeg command&#xA;ffmpeg_cmd = [&#xA;    "./libs/ffmpeg/bin/ffmpeg.exe",&#xA;    &#x27;-hwaccel&#x27;, &#x27;auto&#x27;, &#x27;-y&#x27;,&#xA;    &#x27;-f&#x27;, &#x27;rawvideo&#x27;,&#xA;    &#x27;-vcodec&#x27;,&#x27;rawvideo&#x27;,&#xA;    &#x27;-pix_fmt&#x27;, &#x27;bgr24&#x27;,&#xA;    &#x27;-s&#x27;, f"{WIDTH}x{HEIGHT}",&#xA;    &#x27;-r&#x27;, str(FPS),&#xA;    &#x27;-i&#x27;, &#x27;-&#x27;,&#xA;    &#x27;-c:v&#x27;, &#x27;libx264&#x27;,&#xA;    &#x27;-pix_fmt&#x27;, &#x27;yuv420p&#x27;,&#xA;    &#x27;-preset&#x27;, &#x27;ultrafast&#x27;,&#xA;    &#x27;-f&#x27;, &#x27;flv&#x27;,&#xA;    &#x27;out.flv&#x27;&#xA;]&#xA;ffmpeg_sp = sp.Popen(ffmpeg_cmd, stdin=sp.PIPE)&#xA;&#xA;while True:&#xA;    ret,frame = cap.read()&#xA;    # video capture test: OK&#xA;    cv.imshow(&#x27;video&#x27;, frame)&#xA;    if cv.waitKey(50)&amp;0xFF == ord(&#x27;q&#x27;):&#xA;        break&#xA;    #frame = cv.cvtColor(frame, cv.COLOR_BGR2YUV)   # It doesn&#x27;t work&#xA;    # write to ffmpeg pipe&#xA;    ffmpeg_sp.stdin.write(frame.tobytes())&#xA;&#xA;ffmpeg_sp.stdin.close()&#xA;cap.release()&#xA;cv.destroyAllWindows()&#xA;

    &#xA;

    I'm running Python 3.11.5, OpenCV 4.8.0.76 on Windows 11. The ffmpeg -version output is given below.

    &#xA;

    ffmpeg version N-112841-g2d9ed64859-20231125 Copyright (c) 2000-2023 the FFmpeg developers&#xA;built with gcc 13.2.0 (crosstool-NG 1.25.0.232_c175b21)&#xA;configuration: --prefix=/ffbuild/prefix --pkg-config-flags=--static --pkg-config=pkg-config --cross-prefix=x86_64-w64-mingw32- --arch=x86_64 --target-os=mingw32 --enable-gpl --enable-version3 --disable-debug --disable-w32threads --enable-pthreads --enable-iconv --enable-libxml2 --enable-zlib --enable-libfreetype --enable-libfribidi --enable-gmp --enable-lzma --enable-fontconfig --enable-libharfbuzz --enable-libvorbis --enable-opencl --disable-libpulse --enable-libvmaf --disable-libxcb --disable-xlib --enable-amf --enable-libaom --enable-libaribb24 --enable-avisynth --enable-chromaprint --enable-libdav1d --enable-libdavs2 --disable-libfdk-aac --enable-ffnvcodec --enable-cuda-llvm --enable-frei0r --enable-libgme --enable-libkvazaar --enable-libaribcaption --enable-libass --enable-libbluray --enable-libjxl --enable-libmp3lame --enable-libopus --enable-librist --enable-libssh --enable-libtheora --enable-libvpx --enable-libwebp --enable-lv2 --enable-libvpl --enable-openal --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopenmpt --enable-librav1e --enable-librubberband --enable-schannel --enable-sdl2 --enable-libsoxr --enable-libsrt --enable-libsvtav1 --enable-libtwolame --enable-libuavs3d --disable-libdrm --enable-vaapi --enable-libvidstab --enable-vulkan --enable-libshaderc --enable-libplacebo --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libzimg --enable-libzvbi --extra-cflags=-DLIBTWOLAME_STATIC --extra-cxxflags= --extra-ldflags=-pthread --extra-ldexeflags= --extra-libs=-lgomp --extra-version=20231125&#xA;libavutil      58. 32.100 / 58. 32.100&#xA;libavcodec     60. 34.100 / 60. 34.100&#xA;libavformat    60. 17.100 / 60. 17.100&#xA;libavdevice    60.  4.100 / 60.  4.100&#xA;libavfilter     9. 13.100 /  9. 13.100&#xA;libswscale      7.  6.100 /  7.  6.100&#xA;libswresample   4. 13.100 /  4. 13.100&#xA;libpostproc    57.  4.100 / 57.  4.100&#xA;

    &#xA;

    I have been playing around with FFMpeg arguments for a while and none of them works. I have also transcoded video files using FFMpeg successfully. It somehow just doesn't work with raw video frames from OpenCV. Any help/advice is appreciated.

    &#xA;