Recherche avancée

Médias (1)

Mot : - Tags -/Rennes

Autres articles (7)

  • Encoding and processing into web-friendly formats

    13 avril 2011, par

    MediaSPIP automatically converts uploaded files to internet-compatible formats.
    Video files are encoded in MP4, Ogv and WebM (supported by HTML5) and MP4 (supported by Flash).
    Audio files are encoded in MP3 and Ogg (supported by HTML5) and MP3 (supported by Flash).
    Where possible, text is analyzed in order to retrieve the data needed for search engine detection, and then exported as a series of image files.
    All uploaded files are stored online in their original format, so you can (...)

  • Amélioration de la version de base

    13 septembre 2013

    Jolie sélection multiple
    Le plugin Chosen permet d’améliorer l’ergonomie des champs de sélection multiple. Voir les deux images suivantes pour comparer.
    Il suffit pour cela d’activer le plugin Chosen (Configuration générale du site > Gestion des plugins), puis de configurer le plugin (Les squelettes > Chosen) en activant l’utilisation de Chosen dans le site public et en spécifiant les éléments de formulaires à améliorer, par exemple select[multiple] pour les listes à sélection multiple (...)

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

Sur d’autres sites (2466)

  • Artifacts in ffmpeg fifo, low fps, stream ends

    11 août 2020, par Ben Gardner

    I'm using a Raspberry Pi 3B and 4 for this, neither works.

    


    I'm trying to both pass my capture card's input (/dev/video0) through a fifo file so I can play it on the screen via omxplayer (1080p/30fps), and also grab frames of /dev/video0 out to a series of jpgs (1920x1080 right now, but I'd like it to be 640x480) so I can do analysis on it while it's being played. The input to the capture card is television via HDMI.

    


    This is the command I use to make the stream go to the fifo and jpgs.

    


    ffmpeg -y -f v4l2 -input_format mjpeg -framerate 30 -video_size 1920x1080 \
-thread_queue_size 16384 -i /dev/video0 -f alsa -ac 1 \
-thread_queue_size 16384 -i hw:CARD=U0x534d0x2109,DEV=0 \
-c:v copy -b:v 32000k -preset faster -x264opts keyint=50 \
-g 25 -pix_fmt yuvj422p -c:a aac -b:a 128k -codec:v copy -f tee \
-map 0:v -map 1:a "fifo.mkv|output_%3d.jpg"


    


    Here is my output, which gives me 30fps originally, sometimes dipping into 29-28 fps, and then skipping (both audio and video) and artifacts in the video after around 5-10 minutes with the severity eventually increasing until it stops :

    


    [mjpeg @ 0x1504490] EOI missing, emulating
Input #0, video4linux2,v4l2, from '/dev/video0':
  Duration: N/A, start: 27151.039849, bitrate: N/A
    Stream #0:0: Video: mjpeg, yuvj422p(pc, bt470bg/unknown/unknown), 1920x1080, 30 fps, 30 tbr, 1000k tbn, 1000k tbc
Guessed Channel Layout for Input Stream #1.0 : mono
Input #1, alsa, from 'hw:CARD=U0x534d0x2109,DEV=0':
  Duration: N/A, start: 1596773777.825328, bitrate: 1536 kb/s
    Stream #1:0: Audio: pcm_s16le, 96000 Hz, mono, s16, 1536 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #1:0 -> #0:1 (pcm_s16le (native) -> aac (native))
Press [q] to stop, [?] for help
Output #0, tee, to 'fifo.mkv|output_%3d.jpg':
  Metadata:
    encoder         : Lavf58.20.100
    Stream #0:0: Video: mjpeg, yuvj422p(pc, bt470bg/unknown/unknown), 1920x1080, q=2-31, 32000 kb/s, 30 fps, 30 tbr, 1000k tbn, 1000k tbc
    Stream #0:1: Audio: aac (LC), 96000 Hz, mono, fltp, 128 kb/s
    Metadata:
      encoder         : Lavc58.35.100 aac
[alsa @ 0x1507300] Thread message queue blocking; consider raising the thread_queue_size option (current value: 16384)
[alsa @ 0x1507300] ALSA buffer xrun.time=00:13:55.89 bitrate=N/A speed=0.972x
[alsa @ 0x1507300] ALSA buffer xrun.time=00:14:16.02 bitrate=N/A speed=0.974x
[alsa @ 0x1507300] ALSA buffer xrun.time=00:14:27.25 bitrate=N/A speed=0.972x
[alsa @ 0x1507300] ALSA buffer xrun.time=00:14:33.35 bitrate=N/A speed=0.97x
[alsa @ 0x1507300] ALSA buffer xrun.time=00:14:44.71 bitrate=N/A speed=0.969x
[alsa @ 0x1507300] ALSA buffer xrun.time=00:14:49.71 bitrate=N/A speed=0.97x
[alsa @ 0x1507300] ALSA buffer xrun.time=00:15:01.51 bitrate=N/A speed=0.967x
[alsa @ 0x1507300] ALSA buffer xrun.time=00:15:07.78 bitrate=N/A speed=0.969x
[alsa @ 0x1507300] ALSA buffer xrun.time=00:15:14.27 bitrate=N/A speed=0.962x
[alsa @ 0x1507300] ALSA buffer xrun.time=00:15:26.44 bitrate=N/A speed=0.96x
[alsa @ 0x1507300] ALSA buffer xrun.time=00:15:32.40 bitrate=N/A speed=0.96x
[alsa @ 0x1507300] ALSA buffer xrun.time=00:15:38.63 bitrate=N/A speed=0.963x
[alsa @ 0x1507300] ALSA buffer xrun.time=00:15:45.60 bitrate=N/A speed=0.959x
[alsa @ 0x1507300] ALSA buffer xrun.time=00:15:50.93 bitrate=N/A speed=0.957x
    Last message repeated 1 times
[alsa @ 0x1507300] ALSA buffer xrun.time=00:16:00.79 bitrate=N/A speed=0.951x
    Last message repeated 1 times
[alsa @ 0x1507300] ALSA buffer xrun.time=00:16:05.29 bitrate=N/A speed=0.949x
[alsa @ 0x1507300] ALSA buffer xrun.time=00:16:07.19 bitrate=N/A speed=0.949x
[alsa @ 0x1507300] ALSA buffer xrun.time=00:16:11.72 bitrate=N/A speed=0.945x
[alsa @ 0x1507300] ALSA buffer xrun.time=00:16:16.02 bitrate=N/A speed=0.944x
[alsa @ 0x1507300] ALSA buffer xrun.time=00:16:26.39 bitrate=N/A speed=0.953x
[alsa @ 0x1507300] ALSA buffer xrun.time=00:16:30.22 bitrate=N/A speed=0.938x
[alsa @ 0x1507300] ALSA buffer xrun.time=00:16:30.98 bitrate=N/A speed=0.937x
[alsa @ 0x1507300] ALSA buffer xrun.time=00:16:37.66 bitrate=N/A speed=0.941x
[alsa @ 0x1507300] ALSA buffer xrun.time=00:16:41.28 bitrate=N/A speed=0.935x
[alsa @ 0x1507300] ALSA buffer xrun.time=00:16:42.95 bitrate=N/A speed=0.934x
[alsa @ 0x1507300] ALSA buffer xrun.time=00:16:45.82 bitrate=N/A speed=0.933x
[alsa @ 0x1507300] ALSA buffer xrun.time=00:16:46.76 bitrate=N/A speed=0.932x
[alsa @ 0x1507300] ALSA buffer xrun.time=00:16:47.05 bitrate=N/A speed=0.931x
[alsa @ 0x1507300] ALSA buffer xrun.time=00:16:50.74 bitrate=N/A speed=0.927x
[alsa @ 0x1507300] ALSA buffer xrun.time=00:16:57.05 bitrate=N/A speed=0.927x
[alsa @ 0x1507300] ALSA buffer xrun.time=00:16:58.91 bitrate=N/A speed=0.927x
[alsa @ 0x1507300] ALSA buffer xrun.time=00:17:09.41 bitrate=N/A speed=0.92x
[alsa @ 0x1507300] ALSA buffer xrun.time=00:17:12.04 bitrate=N/A speed=0.917x
[alsa @ 0x1507300] ALSA buffer xrun.time=00:17:12.61 bitrate=N/A speed=0.916x
Killed31579 fps= 28 q=-1.0 size=N/A time=00:17:32.56 bitrate=N/A speed=0.919x


    


    I also occasionally get this error :

    


    [tee @ 0x17001c0] Non-monotonous DTS in output stream 0:1; previous: 99251754, current: 99247503; changing to 99251755. This may result in incorrect timestamps in the output file.


    


    I'm assuming this has something to do with the audio getting routed to the jpg. I've tried [select=\'v\'] in front of the jpg, which doesn't change the behavior as well as [map=\'1\:a\'] in front of the mkv, which says [matroska @ 0xe446f0] Unknown option 'map'.

    


    I should also disclaim that I don't have much of an idea of what this command is doing compression-wise, I basically just copy/pasted that part.

    


    What edits do I need to make to get this into a fifo and series of jpgs at the same time ?

    


  • ffmpeg video&audio streaming from webcam

    23 février 2016, par johncarrie

    I am new to ffmpeg and I want to stream webcam video&audio by using ffmpeg and ffserver.

    ffserver config is the following :

    <stream>
    Feed feed1.ffm
    Format avi
    VideoSize 176x128
    VideoFrameRate 15
    VideoBufferSize 40
    VideoBitRate 64
    AudioBitRate 32
    AudioChannels 1
    AudioSampleRate 11025
    VideoQMin 1
    VideoQMax 20
    NoDefaults
    </stream>

    ffmpeg process is the following :

    ffmpeg -vcodec mjpeg -v verbose -r 15 -s 176x128 -f video4linux2 -i /dev/video0 -f
    alsa -ac 1 -i hw:0 http://localhost:8090/feed1.ffm
    ffmpeg version N-77547-g2893dbf Copyright (c) 2000-2015 the FFmpeg developers
     built with gcc 4.8 (Ubuntu 4.8.4-2ubuntu1~14.04)
     configuration: --prefix=/root/ffmpeg_build --extra-cflags=-I/root/ffmpeg_build/include --extra-ldflags=-L/root/ffmpeg_build/lib --bindir=/root/bin --extra-libs=-ldl --enable-gpl --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-nonfree --enable-x11grab
     libavutil      55. 11.100 / 55. 11.100
     libavcodec     57. 20.100 / 57. 20.100
     libavformat    57. 21.100 / 57. 21.100
     libavdevice    57.  0.100 / 57.  0.100
     libavfilter     6. 22.100 /  6. 22.100
     libswscale      4.  0.100 /  4.  0.100
     libswresample   2.  0.101 /  2.  0.101
     libpostproc    54.  0.100 / 54.  0.100
    [video4linux2,v4l2 @ 0xa6133a0] fd:3 capabilities:84000001
    [video4linux2,v4l2 @ 0xa6133a0] The V4L2 driver changed the video from 176x128 to 1280x720
    [mjpeg @ 0xa613ec0] Changing bps to 8
    Input #0, video4linux2,v4l2, from '/dev/video0':
     Duration: N/A, start: 77139.395765, bitrate: N/A
    Stream #0:0: Video: mjpeg, 1 reference frame, yuvj422p(pc, bt470bg/unknown/unknown), 1280x720, -2 kb/s, 15 fps, 15 tbr, 1000k tbn, 1000k tbc
    Guessed Channel Layout for  Input Stream #1.0 : mono
    Input #1, alsa, from 'hw:0':
     Duration: N/A, start: 1456086923.213492, bitrate: 768 kb/s
    Stream #1:0: Audio: pcm_s16le, 48000 Hz, 1 channels, s16, 768 kb/s
    [tcp @ 0xa622000] Connection to tcp://localhost:8090 failed (Connection refused), trying next address
    [tcp @ 0xa61e140] Connection to tcp://localhost:8090 failed (Connection refused), trying next address
    [graph 0 input from stream 1:0 @ 0xa613220] tb:1/48000 samplefmt:s16 samplerate:48000 chlayout:0x4
    [audio format for output stream 0:0 @ 0xa62a620] auto-inserting filter 'auto-inserted resampler 0' between the filter 'Parsed_anull_0' and the filter 'audio format for output stream 0:0'
    [auto-inserted resampler 0 @ 0xa6229c0] ch:1 chl:mono fmt:s16 r:48000Hz -> ch:1 chl:mono fmt:s32p r:11025Hz
    [graph 1 input from stream 0:0 @ 0xa6244c0] w:1280 h:720 pixfmt:yuvj422p tb:1/15 fr:15/1 sar:0/1 sws_param:flags=2
    [scaler for output stream 0:1 @ 0xa623fc0] w:176 h:128 flags:'bicubic' interl:0
    [graph 1 input from stream 0:0 @ 0xa6244c0] TB:0.066667 FRAME_RATE:15.000000 SAMPLE_RATE:nan
    [swscaler @ 0xa63fe40] deprecated pixel format used, make sure you did set range correctly
    [scaler for output stream 0:1 @ 0xa623fc0] w:1280 h:720 fmt:yuvj422p sar:0/1 -> w:176 h:128 fmt:yuv420p sar:0/1 flags:0x4
    [mpeg4 @ 0xa626260] Either both buffer size and max rate or neither must be specified
    Output #0, ffm, to 'http://localhost:8090/feed1.ffm':
     Metadata:
       creation_time   : 2016-02-22 03:35:23
       Stream #0:0: Audio: mp3 (libmp3lame), 11025 Hz, mono, s32p, 32 kb/s
       Metadata:
         encoder         : Lavc57.20.100 libmp3lame
       Stream #0:1: Video: mpeg4, 1 reference frame, none, 176x128 (0x0), q=1-20, 64 kb/s, 15 fps, 15 tbc
       Metadata:
         encoder         : Lavc57.20.100 mpeg4
    Stream mapping:
     Stream #1:0 -> #0:0 (pcm_s16le (native) -> mp3 (libmp3lame))
     Stream #0:0 -> #0:1 (mjpeg (native) -> mpeg4 (native))
    Error while opening encoder for output stream #0:1 - maybe incorrect parameters such as bit_rate, rate, width or height

    I am using a FEBON168 UVC HDMI GRABBER CARD as Webcam.
    USB UVC output is the following :
    1. MJPEG 1280x720 up to 30fps (full screen)
    2. YUV 1280x720 up to 10fps (full screen)

    How can I fix it ? What am I doing wrong ?

  • HTML Video Exporting Using MediaRecorder vs ffmpeg.js

    3 octobre 2020, par Owen Ovadoz

    TLDR

    &#xA;

    Imagine I have one video and one image. I want to create another video that overlays the image (e.g. watermark) at the center for 2 seconds in the beginning of the video and export it as the final video. I need to do this on the client-side only. Is it possible to use MediaRecorder + Canvas or should I resort to using ffmpeg.js ?

    &#xA;

    Context

    &#xA;

    I am making a browser-based video editor where the user can upload videos and images and combine them. So far, I implemented this by embedding the video and images inside a canvas element appropriately. The data representation looks somewhat like this :

    &#xA;

    video: {&#xA;  url: &#x27;https://archive.com/video.mp4&#x27;,&#xA;  duration: 34,&#xA;},&#xA;images: [{&#xA;  url: &#x27;https://archive.com/img1.jpg&#x27;,&#xA;  start_time: 0,&#xA;  end_time: 2,&#xA;  top: 30,&#xA;  left: 20,&#xA;  width: 50,&#xA;  height: 50,&#xA;}]&#xA;

    &#xA;

    Attempts

    &#xA;

      &#xA;
    1. I play the video and show/hide images in the canvas. Then, I can use the MediaRecorder to capture the canvas' stream and export it as a data blob at the end. The final output is as expected, but the problem with this approach is I need to play the video from the beginning to the end for me to capture the stream from the canvas. If the video is 60 seconds, exporting it also takes 60 seconds.
    2. &#xA;

    &#xA;

    &#xD;&#xA;
    &#xD;&#xA;
    function record(canvas) {&#xA;  return new Promise(function (res, rej) {&#xA;    const stream = canvas.captureStream();&#xA;    const mediaRecorder = new MediaRecorder(stream);&#xA;    const recordedData = [];&#xA;&#xA;    // Register recorder events&#xA;    mediaRecorder.ondataavailable = function (event) {&#xA;      recordedData.push(event.data);&#xA;    };&#xA;    mediaRecorder.onstop = function (event) {&#xA;      var blob = new Blob(recordedData, {&#xA;        type: "video/webm",&#xA;      });&#xA;      var url = URL.createObjectURL(blob);&#xA;      res(url);&#xA;    };&#xA;&#xA;    // Start the video and start recording&#xA;    videoRef.current.currentTime = 0;&#xA;    videoRef.current.addEventListener(&#xA;      "play",&#xA;      (e) => {&#xA;        mediaRecorder.start();&#xA;      },&#xA;      {&#xA;        once: true,&#xA;      }&#xA;    );&#xA;    videoRef.current.addEventListener(&#xA;      "ended",&#xA;      (e) => {&#xA;        mediaRecorder.stop();&#xA;      },&#xA;      {&#xA;        once: true,&#xA;      }&#xA;    );&#xA;    videoRef.current.play();&#xA;  });&#xA;}

    &#xD;&#xA;

    &#xD;&#xA;

    &#xD;&#xA;&#xA;

      &#xA;
    1. I can use ffmpeg.js to encode the video. I haven't tried this method yet as I will have to convert my image representation into ffmpeg args (I wonder how much work that is).
    2. &#xA;

    &#xA;