Recherche avancée

Médias (91)

Autres articles (29)

  • List of compatible distributions

    26 avril 2011, par

    The table below is the list of Linux distributions compatible with the automated installation script of MediaSPIP. Distribution nameVersion nameVersion number Debian Squeeze 6.x.x Debian Weezy 7.x.x Debian Jessie 8.x.x Ubuntu The Precise Pangolin 12.04 LTS Ubuntu The Trusty Tahr 14.04
    If you want to help us improve this list, you can provide us access to a machine whose distribution is not mentioned above or send the necessary fixes to add (...)

  • Personnaliser en ajoutant son logo, sa bannière ou son image de fond

    5 septembre 2013, par

    Certains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;

  • Ecrire une actualité

    21 juin 2013, par

    Présentez les changements dans votre MédiaSPIP ou les actualités de vos projets sur votre MédiaSPIP grâce à la rubrique actualités.
    Dans le thème par défaut spipeo de MédiaSPIP, les actualités sont affichées en bas de la page principale sous les éditoriaux.
    Vous pouvez personnaliser le formulaire de création d’une actualité.
    Formulaire de création d’une actualité Dans le cas d’un document de type actualité, les champs proposés par défaut sont : Date de publication ( personnaliser la date de publication ) (...)

Sur d’autres sites (5437)

  • How do I stream audio from a mic in a raspberry pi with FFmpeg ?

    23 mars 2024, par Ignacio

    I'm trying to follow this to stream audio from a mic in my raspberry pi.

    


    ignacio@pi-satellite-bigbedroom:~ $ ffmpeg -re -f pulse -ac 1 -i plughw:CARD=seeed2micvoicec,DEV=0 -f rtsp -rtsp_transport tcp rtsp://192.168.86.151:8554/live.stream
ffmpeg version 4.3.6-0+deb11u1+rpt5 Copyright (c) 2000-2023 the FFmpeg developers
  built with gcc 10 (Debian 10.2.1-6)
  configuration: --prefix=/usr --extra-version=0+deb11u1+rpt5 --toolchain=hardened --incdir=/usr/include/aarch64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --disable-mmal --enable-neon --enable-v4l2-request --enable-libudev --enable-epoxy --enable-sand --libdir=/usr/lib/aarch64-linux-gnu --arch=arm64 --enable-pocketsphinx --enable-libdc1394 --enable-libdrm --enable-vout-drm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
  libavutil      56. 51.100 / 56. 51.100
  libavcodec     58. 91.100 / 58. 91.100
  libavformat    58. 45.100 / 58. 45.100
  libavdevice    58. 10.100 / 58. 10.100
  libavfilter     7. 85.100 /  7. 85.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  7.100 /  5.  7.100
  libswresample   3.  7.100 /  3.  7.100
  libpostproc    55.  7.100 / 55.  7.100
plughw:CARD=seeed2micvoicec,DEV=0: No such process


    


    I believe this shows the cards I have :

    


    ignacio@pi-satellite-bigbedroom:~ $ pactl list sources
Source #0
    State: SUSPENDED
    Name: alsa_output.platform-bcm2835_audio.analog-stereo.monitor
    Description: Monitor of Built-in Audio Analog Stereo
    Driver: module-alsa-card.c
    Sample Specification: s16le 2ch 44100Hz
    Channel Map: front-left,front-right
    Owner Module: 4
    Mute: no
    Volume: front-left: 65536 / 100% / 0.00 dB,   front-right: 65536 / 100% / 0.00 dB
            balance 0.00
    Base Volume: 65536 / 100% / 0.00 dB
    Monitor of Sink: alsa_output.platform-bcm2835_audio.analog-stereo
    Latency: 0 usec, configured 0 usec
    Flags: DECIBEL_VOLUME LATENCY 
    Properties:
        device.description = "Monitor of Built-in Audio Analog Stereo"
        device.class = "monitor"
        alsa.card = "0"
        alsa.card_name = "bcm2835 Headphones"
        alsa.long_card_name = "bcm2835 Headphones"
        alsa.driver_name = "snd_bcm2835"
        device.bus_path = "platform-bcm2835_audio"
        sysfs.path = "/devices/platform/soc/3f00b840.mailbox/bcm2835_audio/sound/card0"
        device.form_factor = "internal"
        device.string = "0"
        module-udev-detect.discovered = "1"
        device.icon_name = "audio-card"
    Formats:
        pcm

Source #1
    State: IDLE
    Name: alsa_output.platform-soc_sound.stereo-fallback.monitor
    Description: Monitor of Built-in Audio Stereo
    Driver: module-alsa-card.c
    Sample Specification: s16le 2ch 44100Hz
    Channel Map: front-left,front-right
    Owner Module: 12
    Mute: no
    Volume: front-left: 65536 / 100% / 0.00 dB,   front-right: 65536 / 100% / 0.00 dB
            balance 0.00
    Base Volume: 65536 / 100% / 0.00 dB
    Monitor of Sink: alsa_output.platform-soc_sound.stereo-fallback
    Latency: 0 usec, configured 2000000 usec
    Flags: DECIBEL_VOLUME LATENCY 
    Properties:
        device.description = "Monitor of Built-in Audio Stereo"
        device.class = "monitor"
        alsa.card = "2"
        alsa.card_name = "seeed-2mic-voicecard"
        alsa.long_card_name = "seeed-2mic-voicecard"
        alsa.driver_name = "snd_soc_simple_card"
        device.bus_path = "platform-soc:sound"
        sysfs.path = "/devices/platform/soc/soc:sound/sound/card2"
        device.form_factor = "internal"
        device.string = "2"
        module-udev-detect.discovered = "1"
        device.icon_name = "audio-card"
    Formats:
        pcm

Source #2
    State: RUNNING
    Name: alsa_input.platform-soc_sound.stereo-fallback
    Description: Built-in Audio Stereo
    Driver: module-alsa-card.c
    Sample Specification: s16le 2ch 44100Hz
    Channel Map: front-left,front-right
    Owner Module: 12
    Mute: no
    Volume: front-left: 32845 /  50% / -18.00 dB,   front-right: 32845 /  50% / -18.00 dB
            balance 0.00
    Base Volume: 20724 /  32% / -30.00 dB
    Monitor of Sink: n/a
    Latency: 688 usec, configured 10000 usec
    Flags: HARDWARE HW_MUTE_CTRL HW_VOLUME_CTRL DECIBEL_VOLUME LATENCY 
    Properties:
        alsa.resolution_bits = "16"
        device.api = "alsa"
        device.class = "sound"
        alsa.class = "generic"
        alsa.subclass = "generic-mix"
        alsa.name = "bcm2835-i2s-wm8960-hifi wm8960-hifi-0"
        alsa.id = "bcm2835-i2s-wm8960-hifi wm8960-hifi-0"
        alsa.subdevice = "0"
        alsa.subdevice_name = "subdevice #0"
        alsa.device = "0"
        alsa.card = "2"
        alsa.card_name = "seeed-2mic-voicecard"
        alsa.long_card_name = "seeed-2mic-voicecard"
        alsa.driver_name = "snd_soc_simple_card"
        device.bus_path = "platform-soc:sound"
        sysfs.path = "/devices/platform/soc/soc:sound/sound/card2"
        device.form_factor = "internal"
        device.string = "hw:2"
        device.buffering.buffer_size = "352800"
        device.buffering.fragment_size = "176400"
        device.access_mode = "mmap+timer"
        device.profile.name = "stereo-fallback"
        device.profile.description = "Stereo"
        device.description = "Built-in Audio Stereo"
        module-udev-detect.discovered = "1"
        device.icon_name = "audio-card"
    Ports:
        analog-input: Analog Input (type: Analog, priority: 10000, availability unknown)
    Active Port: analog-input
    Formats:
        pcm


    


    I want to use the mic from the seeed-2mic-voicecard.

    


    Thanks for the help

    


  • FFMPEG C Library : Encoding h264 stream into Matroska .mkv container creates corrupt files

    16 mars 2024, par Marvin Killing

    I want to use the FFMPEG C Library to create a Matroska Video .mkv file with only an h264 stream, but the resulting .mkv file comes out corrupt.

    


    The file cannot be played back with Windows Media Player, ffplay, or VLC, and when I try to ffprobe the resulting file, these are the error messages :

    


    [h264 @ 0000015060d8f5c0] No start code is found.
    Last message repeated 1 times
[h264 @ 0000015060d8f5c0] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 0000015060d8f5c0] decode_slice_header error
[h264 @ 0000015060d8f5c0] no frame!
[h264 @ 0000015060d8f5c0] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 0000015060d8f5c0] decode_slice_header error
[h264 @ 0000015060d8f5c0] no frame!
[h264 @ 0000015060d8f5c0] non-existing PPS 0 referenced
    Last message repeated 1 times
# [...]
# this continues for a long time


    


    I have followed the other troubleshooting steps for encoding h264 into Matroska, but none of them seemed to have done the trick for me :

    


    


    This is my C code :

    


    #include &#xA;#include <libavutil></libavutil>opt.h>&#xA;#include <libavutil></libavutil>imgutils.h>&#xA;#include <libavcodec></libavcodec>avcodec.h>&#xA;#include <libavformat></libavformat>avformat.h>&#xA;&#xA;int main(void) {&#xA;    char *out_file_path = "./video.mkv";&#xA;    AVFormatContext *format_context;&#xA;    AVStream *video_stream;&#xA;    AVCodecContext *codec_context;&#xA;&#xA;    avformat_alloc_output_context2(&amp;format_context, NULL, NULL, out_file_path);&#xA;&#xA;    const AVCodec *codec = avcodec_find_encoder(AV_CODEC_ID_H264);&#xA;    video_stream = avformat_new_stream(format_context, NULL);&#xA;&#xA;    codec_context = avcodec_alloc_context3(codec);&#xA;    av_opt_set(codec_context->priv_data, "preset", "superfast", 0);&#xA;    av_opt_set(codec_context->priv_data, "crf", "22", 0);&#xA;&#xA;    codec_context->width = 1920;&#xA;    codec_context->height = 1080;&#xA;    codec_context->time_base = av_make_q(1, 30);&#xA;    codec_context->pix_fmt = AV_PIX_FMT_YUV420P;&#xA;&#xA;    if (strncmp("./video.mkv", out_file_path, 11) == 0) {&#xA;      printf("Writing .mkv...\n");&#xA;      codec_context->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;&#xA;      codec_context->extradata = (uint8_t*)av_mallocz(1024 * 1024);&#xA;      codec_context->extradata_size = 1024 * 1024;&#xA;    } else {&#xA;      printf("Writing .mp4...\n");&#xA;    }&#xA;&#xA;    // XXX avcodec_parameters_from_context is potentially superfluous (?)&#xA;    int ret = avcodec_parameters_from_context(video_stream->codecpar, codec_context);&#xA;&#xA;    ret = avcodec_open2(codec_context, codec, NULL);&#xA;&#xA;    avio_open(&amp;format_context->pb, out_file_path, AVIO_FLAG_WRITE);&#xA;&#xA;    ret = avformat_write_header(format_context, NULL);&#xA;&#xA;    // create a black input frame&#xA;    AVFrame *input_frame = av_frame_alloc();&#xA;    input_frame->width = 1920;&#xA;    input_frame->height = 1080;&#xA;    input_frame->format = AV_PIX_FMT_YUV420P;&#xA;    ret = av_image_alloc(input_frame->data, input_frame->linesize, input_frame->width, input_frame->height, input_frame->format, 32);&#xA;    ptrdiff_t linesize[4] = { input_frame->linesize[0], input_frame->linesize[1], input_frame->linesize[2], input_frame->linesize[3] };&#xA;    ret = av_image_fill_black(input_frame->data, linesize, input_frame->format, 0, 1920, 1080);&#xA;&#xA;    // write 2 seconds of video, all black&#xA;    for (size_t current_pts = 0; current_pts &lt; 60; current_pts&#x2B;&#x2B;) {&#xA;      input_frame->pts = av_rescale_q(current_pts, av_make_q(1, 30), codec_context->time_base);;&#xA;&#xA;      ret = avcodec_send_frame(codec_context, input_frame);&#xA;&#xA;      AVPacket* packet = av_packet_alloc();&#xA;&#xA;      while (1) {&#xA;          ret = avcodec_receive_packet(codec_context, packet);&#xA;          if (ret == AVERROR(EAGAIN) || ret == AVERROR_EOF) {&#xA;              break;&#xA;          } else if (ret &lt; 0) {&#xA;              printf("avcodec_receive_packet failed");&#xA;          } else {&#xA;              av_packet_rescale_ts(packet, codec_context->time_base, video_stream->time_base);&#xA;              ret = av_interleaved_write_frame(format_context, packet);&#xA;          }&#xA;      }&#xA;&#xA;      av_packet_free(&amp;packet);&#xA;    }&#xA;&#xA;    av_frame_free(&amp;input_frame);&#xA;&#xA;    // flush encoder&#xA;    avcodec_send_frame(codec_context, NULL);&#xA;    AVPacket *flush_packet = av_packet_alloc();&#xA;    while (avcodec_receive_packet(codec_context, flush_packet) != AVERROR_EOF) {&#xA;        //int ret = av_interleaved_write_frame(format_context_, packet);&#xA;        av_packet_rescale_ts(flush_packet, codec_context->time_base, video_stream->time_base);&#xA;        ret = av_write_frame(format_context, flush_packet);&#xA;    }&#xA;    av_packet_free(&amp;flush_packet);&#xA;&#xA;    ret = av_write_trailer(format_context);&#xA;    ret = avio_close(format_context->pb);&#xA;&#xA;    return 0;&#xA;}&#xA;

    &#xA;

    The error handling is stripped out, but it does not raise any errors.

    &#xA;

    This code works when I write into an mp4 file, but creates a corrupt file when writing into .mkv. You can change the output container format to mp4 by setting&#xA;char *out_file_path = "./video.mp4";

    &#xA;

    You can compile this by running

    &#xA;

    clang -I$(FFMPEG_DIR)/include -L$(FFMPEG_DIR)/lib -lavformat -lavcodec -lavutil main.c -o makemkv&#xA;

    &#xA;

    The output I’m getting while the above code is running :

    &#xA;

    Writing .mkv...&#xA;[libx264 @ 0x139804c40] using cpu capabilities: ARMv8 NEON&#xA;[libx264 @ 0x139804c40] profile High, level 4.0, 4:2:0, 8-bit&#xA;[libx264 @ 0x139804c40] 264 - core 164 r3108 31e19f9 - H.264/MPEG-4 AVC codec - Copyleft 2003-2023 - http://www.videolan.org/x264.html - options: cabac=1 ref=1 deblock=1:0:0 analyse=0x3:0x3 me=dia subme=1 psy=1 psy_rd=1.00:0.00 mixed_ref=0 me_range=16 chroma_me=1 trellis=0 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=0 threads=15 lookahead_threads=2 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=1 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc=crf mbtree=0 crf=22.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 pb_ratio=1.30 aq=1:1.00&#xA;

    &#xA;

    When I use the ffmpeg CLI, I can create a working .mkv from my working .mp4 like this :

    &#xA;

    ffmpeg -i video.mp4 -c:v copy created-with-ffmpeg-cli.mkv&#xA;

    &#xA;

    I have uploaded the resulting video files here : https://drive.google.com/drive/folders/1FS-0fBAwKBbO-tyxC0VrFqcCyyqd0BR_?usp=sharing

    &#xA;

  • Issue with ffprobe execution within Docker Environment

    7 mars 2024, par Khải Hồ Quang

    Here is my Dockerfile :

    &#xA;

    FROM node:18-slim as builder&#xA;&#xA;WORKDIR /usr/src/ai_api_builder/&#xA;&#xA;COPY package*.json tsconfig.json /usr/src/ai_api_builder/&#xA;&#xA;RUN apt-get update &amp;&amp; \&#xA;    apt-get install mariadb-client -y &amp;&amp; \&#xA;    npm install &amp;&amp; npm cache clean --force&#xA;&#xA;RUN apt install ffmpeg -y &amp;&amp; \&#xA;    ffmpeg -version &amp;&amp; \&#xA;    ffprobe -version&#xA;COPY ${REPO_DIR}/ ./&#xA;&#xA;RUN npm run build &amp;&amp; mv audio_store node_modules dist/&#xA;&#xA;FROM node:18-slim&#xA;&#xA;# Create and cd into app directory&#xA;WORKDIR /usr/src/dwt_api_app/dist&#xA;&#xA;# Copy the artifact to the new image&#xA;COPY --from=builder /usr/src/dwt_api_builder/dist ./&#xA;&#xA;EXPOSE 3001&#xA;&#xA;ENTRYPOINT ["node", "app.js"]&#xA;

    &#xA;

    When I build Dockerfile, the step check ffmpeg and ffprobe version worked :

    &#xA;

    ffmpeg version 5.1.4-0&#x2B;deb12u1 Copyright (c) 2000-2023 the FFmpeg developers&#xA;built with gcc 12 (Debian 12.2.0-14)&#xA;...&#xA;ffprobe version 5.1.4-0&#x2B;deb12u1 Copyright (c) 2007-2023 the FFmpeg developers&#xA;

    &#xA;

    But when I run container, my TypeScript code not work (the metadata return undefined) :

    &#xA;

    import { ffprobe } from "fluent-ffmpeg";&#xA;ffprobe(latestFilePath, async function(err: any, metadata: any) {&#xA;    console.log("metadata", metadata);&#xA;})&#xA;

    &#xA;

    When I exec to container and check ffmpeg -version and ffprobe -version, I got : bash: ffmpeg: command not found. And when I check in bin folder, also couldn't find ffmpeg.
    &#xA;I tried it locally (Centos7), not in container, it worked (metadata return an object), and here is ffprobe version

    &#xA;

    ffprobe version 6.1-static https://johnvansickle.com/ffmpeg/  Copyright (c) 2007-2023 the FFmpeg developers <b>&#xA;&#xA;</b>

    &#xA;

    What step did I do wrong when running the container or is there any difference between debian (in container) and centos 7 (local) that I need to pay attention to ? Thanks

    &#xA;