Recherche avancée

Médias (91)

Autres articles (37)

  • Publier sur MédiaSpip

    13 juin 2013

    Puis-je poster des contenus à partir d’une tablette Ipad ?
    Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir

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

  • Configuration spécifique pour PHP5

    4 février 2011, par

    PHP5 est obligatoire, vous pouvez l’installer en suivant ce tutoriel spécifique.
    Il est recommandé dans un premier temps de désactiver le safe_mode, cependant, s’il est correctement configuré et que les binaires nécessaires sont accessibles, MediaSPIP devrait fonctionner correctement avec le safe_mode activé.
    Modules spécifiques
    Il est nécessaire d’installer certains modules PHP spécifiques, via le gestionnaire de paquet de votre distribution ou manuellement : php5-mysql pour la connectivité avec la (...)

Sur d’autres sites (3397)

  • Extended client ownership of MediaCodec encoder output buffers for RTMP streaming

    13 février 2014, par dbro

    Background :

    I've connected Android's MediaCodec to FFmpeg for muxing a variety of formats not supported by MediaMuxer, including rtmp:// output via a .flv container. Such streaming muxers require longer, unpredictable ownership of MediaCodec's output buffers, as they may perform networking I/O on any packet processing step. For my video stream, I'm using MediaCodec configured for Surface input. To decouple muxing from encoding, I queue MediaCodec's ByteBuffer output buffers to my muxer via a Handler.

    All works splendidly if I mux the .flv output to file, rather than rtmp endpoint.

    Problem :

    When muxing to rtmp://... endpoint I notice my streaming application begins to block on calls to eglSwapBuffers(mEGLDisplay, mEncodingEGLSurface) at dequeueOutputBuffer() once I'm retaining even a few MediaCodec output buffers in my muxing queue as MediaCodec seems to be locked to only 4 output buffers.

    Any tricks to avoid copying all encoder output returned by MediaCodec#dequeueOutputBuffers and immediately calling releaseOutputBuffer(...) ?

    The full source of my project is available on Github. Specifically, see :

    • AndroidEncoder.java : Abstract Encoder class with shared behavior between Audio and Video encoders : mainly drainEncoder(). Writes data to a Muxer instance.
    • FFmpegMuxer.java : Implements Muxer
    • CameraEncoder.java. Sends camera frames to an AndroidEncoder subclass configured for Video encoding.

    Systrace

    Systrace output

    Here's some systrace output streaming 720p @ 2Mbps video to Zencoder.

    Solved

    Copying then releasing the MediaCodec encoder output ByteBuffers as soon as they're available solves the issue without significantly affecting performance. I recycle the ByteBuffer copies in an ArrayDeque<bytebuffer></bytebuffer> for each muxer track, which limits the number of allocations.

  • multithreaded client/server listener using ffmpeg to record video

    29 janvier 2014, par user1895639

    I've got a python project where I need to trigger start/stop of two Axis IP cameras using ffmpeg. I've gotten bits and pieces of this to work but can't put the whole thing together. A "listener" program runs on one machine that can accept messages from other machines to start and stop recordings.

    The listener responds to two commands only :

    START v :/video_dir/myvideo.mov
    STOP

    The START command is followed by the full path of a video file that it will record.
    When receiving a STOP command, the video recording should stop.

    I am using ffmpeg to attach to cameras, and manually doing this works :

    ffmpeg.exe -i rtsp ://cameraip/blah/blah -vcodec copy -acodec copy -y c :\temp\output.mov

    I can attach to the stream and upon hitting 'q' I can stop the recording.

    What I'd like to be able to do is relatively simple, I just can't wrap my head around it :

    Listener listens
    When it receives a START signal, it spawns two processes to start recording from each camera
    When it receives a STOP signal, it sends the 'q' keystroke to each process to tell ffmpeg to stop recording.

    I've got the listener part, but I'm just not sure how to get the multithreaded part down :

    while True:
       client,address = s.accept()
       data = client.recv( size )
       if data:
           if data.startswith(&#39;START&#39;):
               # start threads here
           elif data.startswith(&#39;STOP&#39;):
               # how to send a stop to the newly-created processes?

    In the thread code I'm doing this (which may be very incorrect) :

    subprocess.call(&#39;ffmpeg.exe -i "rtsp://cameraipstuff -vcodec copy -acodec copy -t 3600 -y &#39;+filename)  

    I can get this process to spawn off and I see it recording, but how can I send it a "q" message ? I can use a Queue to pass a stop message and then do something like

    win32com.client.Dispatch(&#39;WScript.Shell&#39;).SendKeys(&#39;q&#39;)

    but that seems awkward. Perhaps a pipe and sending q to stdin ? Regardless, I'm pretty sure using threads is the right approach (as opposed to calling subprocess.call('ffmpeg.exe ...') twice in a row), but I just don't know how to tie things together.

  • How to get rtp(javacv ffmpeg) stream from VLC as client

    15 avril 2015, par Sezertt

    I am trying to play rtp stream from vlc player which I created using javacv. Here is the code :

           FFmpegFrameGrabber frameGrabber = new FFmpegFrameGrabber("rtsp://10.6.0.147:554/ufirststream");
           frameGrabber.start();  // First I take another stream

           FFmpegFrameRecorder frameRecorder = new FFmpegFrameRecorder("rtp://239.31.31.69:4433", frameGrabber.getImageWidth(), frameGrabber.getImageHeight());

           frameRecorder.setFormat("rtp");
           frameRecorder.setPixelFormat(AV_PIX_FMT_YUV420P);
           frameRecorder.setVideoCodec(AV_CODEC_ID_MPEG2VIDEO); &lt;-- AV_CODEC_ID_H264
           frameRecorder.setFrameRate(25);          
           frameRecorder.setVideoBitrate(1024); &lt;--1024*1024*2            
           frameRecorder.start();
           while (true) {
               frameRecorder.record(frameGrabber.grab()); //grab from stream, stream with rtp
           }

    If I choose my codec as AV_CODEC_ID_MPEG2VIDEO I can play the stream from VLC using rtp ://239.31.31.69:4433 with open network.

    If I increase the quality using setVideoBitrate(1024*1024*2) the stream lags too much and if I decrease the quality is so bad.

    I want to use AV_CODEC_ID_H264 as my codec to fasten things with better quality but i can’t play the stream from VLC getting error :

    SDP required A description in SDP format is required to receive the RTP stream. Note that rtp :// URIs cannot work with dynamic RTP payload format (96).

    I tried to get sdp using wireshark and then I realized rtp stream doesn’t have sdp :) so I tried to create my own sdp like this

    c=IN IP4 239.31.31.69
    m=video 4433 RTP/AVP 96
    a=rtpmap:96 H264/90000

    and this

    v=0
    c=IN IP4 239.31.31.69
    a=recvonly
    t=0 0
    m=video 4433 RTP/AVP 99
    a=rtpmap:99 H264/90000
    a=fmtp:99 packetization-mode=1;profile-level-id=42c01e;sprop-parameter sets=Z0LAHukBQHsg,aM4G4g==;

    but both seems to fail similar to this

    > core debug: adding item `asf.sdp' ( file:///C:/Users/Sezer/Desktop/asf.sdp )
    core debug: processing request item: asf.sdp, node: null, skip: 0
    core debug: rebuilding array of current - root Playlist
    core debug: rebuild done - 7 items, index 6
    core debug: starting playback of the new playlist item
    core debug: resyncing on asf.sdp
    core debug: asf.sdp is at 6
    core debug: creating new input thread
    core debug: Creating an input for 'asf.sdp'
    core debug: Creating an input for 'asf.sdp'
    core debug: requesting art for asf.sdp
    core debug: using timeshift granularity of 50 MiB, in path 'C:\Users\Sezer\AppData\Local\Temp'
    core debug: `file:///C:/Users/Sezer/Desktop/asf.sdp' gives access `file' demux `' path `/C:/Users/Sezer/Desktop/asf.sdp'
    core debug: specified demux `any'
    core debug: creating demux: access='file' demux='any' location='/C:/Users/Sezer/Desktop/asf.sdp' file='C:\Users\Sezer\Desktop\asf.sdp'
    core debug: looking for access_demux module matching "file": 12 candidates
    core debug: looking for meta fetcher module matching "any": 1 candidates
    core debug: no access_demux modules matched
    core debug: creating access 'file' location='/C:/Users/Sezer/Desktop/asf.sdp', path='C:\Users\Sezer\Desktop\asf.sdp'
    core debug: looking for access module matching "file": 21 candidates
    filesystem debug: opening file `C:\Users\Sezer\Desktop\asf.sdp'
    lua debug: Trying Lua scripts in C:\Users\Sezer\AppData\Roaming\vlc\lua\meta\fetcher
    core debug: using access module "filesystem"
    core debug: Using stream method for AStream*
    lua debug: Trying Lua scripts in C:\Program Files (x86)\VideoLAN\VLC\lua\meta\fetcher
    core debug: starting pre-buffering
    core debug: received first data after 0 ms
    core debug: pre-buffering done 193 bytes in 0s - 188476 KiB/s
    core debug: looking for stream_filter module matching "any": 6 candidates
    core debug: no stream_filter modules matched
    lua debug: Trying Lua playlist script C:\Program Files (x86)\VideoLAN\VLC\lua\meta\fetcher\tvrage.luac
    core debug: looking for stream_filter module matching "record": 6 candidates
    core debug: using stream_filter module "record"
    core debug: creating demux: access='file' demux='any' location='/C:/Users/Sezer/Desktop/asf.sdp' file='C:\Users\Sezer\Desktop\asf.sdp'
    core debug: looking for demux module matching "any": 65 candidates
    live555 debug: version 2014.07.25
    live555 debug: RTP subsession 'video/H264'
    core debug: selecting program id=0
    core debug: adding item `file.sdp' ( file:///C:/Users/Sezer/Desktop/file.sdp )
    live555 debug: setup start: 0.000000 stop:0.000000
    live555 debug: play start: 0.000000 stop:0.000000
    core debug: using demux module "live555"
    lua debug: skipping script (unmatched scope) C:\Program Files (x86)\VideoLAN\VLC\lua\meta\fetcher\tvrage.luac
    core debug: no meta fetcher modules matched
    core debug: looking for a subtitle file in C:\Users\Sezer\Desktop\
    core debug: searching art for asf.sdp
    core debug: looking for art finder module matching "any": 2 candidates
    core debug: looking for decoder module matching "any": 43 candidates
    avcodec debug: CPU flags: 0x010053db
    lua debug: Trying Lua scripts in C:\Users\Sezer\AppData\Roaming\vlc\lua\meta\art
    lua debug: Trying Lua scripts in C:\Program Files (x86)\VideoLAN\VLC\lua\meta\art
    avcodec debug: trying to use direct rendering
    avcodec debug: allowing 4 thread(s) for decoding
    avcodec warning: threaded frame decoding is not compatible with DXVA2, disabled
    lua debug: Trying Lua playlist script C:\Program Files (x86)\VideoLAN\VLC\lua\meta\art\00_musicbrainz.luac
    core debug: meta ok for (null), need to fetch art
    core debug: Creating an input for 'file.sdp'
    avcodec debug: avcodec codec (H264 - MPEG-4 AVC (part 10)) started
    avcodec debug: using slice thread mode with 4 threads
    core debug: using decoder module "avcodec"
    core debug: looking for meta fetcher module matching "any": 1 candidates
    core debug: looking for packetizer module matching "any": 23 candidates
    core debug: using packetizer module "packetizer_h264"
    lua debug: skipping script (unmatched scope) C:\Program Files (x86)\VideoLAN\VLC\lua\meta\art\00_musicbrainz.luac
    lua debug: Trying Lua playlist script C:\Program Files (x86)\VideoLAN\VLC\lua\meta\art\01_googleimage.luac
    lua debug: Trying Lua scripts in C:\Users\Sezer\AppData\Roaming\vlc\lua\meta\fetcher
    lua debug: Trying Lua scripts in C:\Program Files (x86)\VideoLAN\VLC\lua\meta\fetcher
    core debug: looking for meta reader module matching "any": 2 candidates
    lua debug: Trying Lua playlist script C:\Program Files (x86)\VideoLAN\VLC\lua\meta\fetcher\tvrage.luac
    lua debug: Trying Lua scripts in C:\Users\Sezer\AppData\Roaming\vlc\lua\meta\reader
    lua debug: Trying Lua scripts in C:\Program Files (x86)\VideoLAN\VLC\lua\meta\reader
    lua debug: skipping script (unmatched scope) C:\Program Files (x86)\VideoLAN\VLC\lua\meta\art\01_googleimage.luac
    lua debug: Trying Lua playlist script C:\Program Files (x86)\VideoLAN\VLC\lua\meta\reader\filename.luac
    lua debug: Trying Lua playlist script C:\Program Files (x86)\VideoLAN\VLC\lua\meta\art\02_frenchtv.luac
    lua debug: skipping script (unmatched scope) C:\Program Files (x86)\VideoLAN\VLC\lua\meta\fetcher\tvrage.luac
    core debug: no meta fetcher modules matched
    core debug: searching art for asf.sdp
    core debug: looking for art finder module matching "any": 2 candidates
    core debug: no meta reader modules matched
    lua debug: skipping script (unmatched scope) C:\Program Files (x86)\VideoLAN\VLC\lua\meta\art\02_frenchtv.luac
    core debug: `file:///C:/Users/Sezer/Desktop/asf.sdp' successfully opened
    lua debug: Trying Lua playlist script C:\Program Files (x86)\VideoLAN\VLC\lua\meta\art\03_lastfm.luac
    lua debug: Trying Lua scripts in C:\Users\Sezer\AppData\Roaming\vlc\lua\meta\art
    core debug: meta ok for (null), need to fetch art
    lua debug: Trying Lua scripts in C:\Program Files (x86)\VideoLAN\VLC\lua\meta\art
    lua debug: Trying Lua playlist script C:\Program Files (x86)\VideoLAN\VLC\lua\meta\art\00_musicbrainz.luac
    lua debug: skipping script (unmatched scope) C:\Program Files (x86)\VideoLAN\VLC\lua\meta\art\03_lastfm.luac
    core debug: no art finder modules matched
    lua debug: skipping script (unmatched scope) C:\Program Files (x86)\VideoLAN\VLC\lua\meta\art\00_musicbrainz.luac
    core debug: looking for meta fetcher module matching "any": 1 candidates
    lua debug: Trying Lua playlist script C:\Program Files (x86)\VideoLAN\VLC\lua\meta\art\01_googleimage.luac
    lua debug: Trying Lua scripts in C:\Users\Sezer\AppData\Roaming\vlc\lua\meta\fetcher
    lua debug: Trying Lua scripts in C:\Program Files (x86)\VideoLAN\VLC\lua\meta\fetcher
    lua debug: Trying Lua playlist script C:\Program Files (x86)\VideoLAN\VLC\lua\meta\fetcher\tvrage.luac
    lua debug: skipping script (unmatched scope) C:\Program Files (x86)\VideoLAN\VLC\lua\meta\art\01_googleimage.luac
    lua debug: Trying Lua playlist script C:\Program Files (x86)\VideoLAN\VLC\lua\meta\art\02_frenchtv.luac
    lua debug: skipping script (unmatched scope) C:\Program Files (x86)\VideoLAN\VLC\lua\meta\art\02_frenchtv.luac
    lua debug: Trying Lua playlist script C:\Program Files (x86)\VideoLAN\VLC\lua\meta\art\03_lastfm.luac
    core debug: using meta fetcher module "lua"
    core debug: removing module "lua"
    core debug: searching art for asf.sdp
    core debug: looking for art finder module matching "any": 2 candidates
    lua debug: skipping script (unmatched scope) C:\Program Files (x86)\VideoLAN\VLC\lua\meta\art\03_lastfm.luac
    qt4 debug: IM: Setting an input
    core debug: no art finder modules matched
    core debug: looking for meta fetcher module matching "any": 1 candidates
    lua debug: Trying Lua scripts in C:\Users\Sezer\AppData\Roaming\vlc\lua\meta\art
    lua debug: Trying Lua scripts in C:\Program Files (x86)\VideoLAN\VLC\lua\meta\art
    lua debug: Trying Lua scripts in C:\Users\Sezer\AppData\Roaming\vlc\lua\meta\fetcher
    lua debug: Trying Lua playlist script C:\Program Files (x86)\VideoLAN\VLC\lua\meta\art\00_musicbrainz.luac
    lua debug: Trying Lua scripts in C:\Program Files (x86)\VideoLAN\VLC\lua\meta\fetcher
    lua debug: Trying Lua playlist script C:\Program Files (x86)\VideoLAN\VLC\lua\meta\fetcher\tvrage.luac
    lua debug: Trying Lua playlist script C:\Program Files (x86)\VideoLAN\VLC\lua\meta\art\01_googleimage.luac
    lua debug: skipping script (unmatched scope) C:\Program Files (x86)\VideoLAN\VLC\lua\meta\fetcher\tvrage.luac
    core debug: no meta fetcher modules matched
    core debug: searching art for file.sdp
    core debug: looking for art finder module matching "any": 2 candidates
    lua debug: Trying Lua playlist script C:\Program Files (x86)\VideoLAN\VLC\lua\meta\art\02_frenchtv.luac
    lua debug: Trying Lua scripts in C:\Users\Sezer\AppData\Roaming\vlc\lua\meta\art
    lua debug: Trying Lua scripts in C:\Program Files (x86)\VideoLAN\VLC\lua\meta\art
    lua debug: Trying Lua playlist script C:\Program Files (x86)\VideoLAN\VLC\lua\meta\art\00_musicbrainz.luac
    lua debug: Trying Lua playlist script C:\Program Files (x86)\VideoLAN\VLC\lua\meta\art\03_lastfm.luac
    lua debug: skipping script (unmatched scope) C:\Program Files (x86)\VideoLAN\VLC\lua\meta\art\00_musicbrainz.luac
    lua debug: Trying Lua playlist script C:\Program Files (x86)\VideoLAN\VLC\lua\meta\art\01_googleimage.luac
    core debug: no art finder modules matched
    core debug: art not found for asf.sdp
    lua debug: skipping script (unmatched scope) C:\Program Files (x86)\VideoLAN\VLC\lua\meta\art\01_googleimage.luac
    lua debug: Trying Lua playlist script C:\Program Files (x86)\VideoLAN\VLC\lua\meta\art\02_frenchtv.luac
    lua debug: skipping script (unmatched scope) C:\Program Files (x86)\VideoLAN\VLC\lua\meta\art\02_frenchtv.luac
    lua debug: Trying Lua playlist script C:\Program Files (x86)\VideoLAN\VLC\lua\meta\art\03_lastfm.luac
    lua debug: skipping script (unmatched scope) C:\Program Files (x86)\VideoLAN\VLC\lua\meta\art\03_lastfm.luac
    core debug: no art finder modules matched
    core debug: looking for meta fetcher module matching "any": 1 candidates
    lua debug: Trying Lua scripts in C:\Users\Sezer\AppData\Roaming\vlc\lua\meta\fetcher
    lua debug: Trying Lua scripts in C:\Program Files (x86)\VideoLAN\VLC\lua\meta\fetcher
    lua debug: Trying Lua playlist script C:\Program Files (x86)\VideoLAN\VLC\lua\meta\fetcher\tvrage.luac
    core debug: using meta fetcher module "lua"
    core debug: removing module "lua"
    core debug: searching art for asf.sdp
    core debug: looking for art finder module matching "any": 2 candidates
    lua debug: Trying Lua scripts in C:\Users\Sezer\AppData\Roaming\vlc\lua\meta\art
    lua debug: Trying Lua scripts in C:\Program Files (x86)\VideoLAN\VLC\lua\meta\art
    lua debug: Trying Lua playlist script C:\Program Files (x86)\VideoLAN\VLC\lua\meta\art\00_musicbrainz.luac
    lua debug: Trying Lua playlist script C:\Program Files (x86)\VideoLAN\VLC\lua\meta\art\01_googleimage.luac
    lua debug: Trying Lua playlist script C:\Program Files (x86)\VideoLAN\VLC\lua\meta\art\02_frenchtv.luac
    lua debug: Trying Lua playlist script C:\Program Files (x86)\VideoLAN\VLC\lua\meta\art\03_lastfm.luac
    core debug: no art finder modules matched
    core debug: art not found for asf.sdp
    core debug: looking for meta fetcher module matching "any": 1 candidates
    lua debug: Trying Lua scripts in C:\Users\Sezer\AppData\Roaming\vlc\lua\meta\fetcher
    lua debug: Trying Lua scripts in C:\Program Files (x86)\VideoLAN\VLC\lua\meta\fetcher
    lua debug: Trying Lua playlist script C:\Program Files (x86)\VideoLAN\VLC\lua\meta\fetcher\tvrage.luac
    core debug: using meta fetcher module "lua"
    core debug: removing module "lua"
    core debug: searching art for file.sdp
    core debug: looking for art finder module matching "any": 2 candidates
    lua debug: Trying Lua scripts in C:\Users\Sezer\AppData\Roaming\vlc\lua\meta\art
    lua debug: Trying Lua scripts in C:\Program Files (x86)\VideoLAN\VLC\lua\meta\art
    lua debug: Trying Lua playlist script C:\Program Files (x86)\VideoLAN\VLC\lua\meta\art\00_musicbrainz.luac
    lua debug: Trying Lua playlist script C:\Program Files (x86)\VideoLAN\VLC\lua\meta\art\01_googleimage.luac
    lua debug: Trying Lua playlist script C:\Program Files (x86)\VideoLAN\VLC\lua\meta\art\02_frenchtv.luac
    lua debug: Trying Lua playlist script C:\Program Files (x86)\VideoLAN\VLC\lua\meta\art\03_lastfm.luac
    core debug: no art finder modules matched
    core debug: art not found for file.sdp

    Can you lead me to the right direction ? What should I do to get fair quality and no lag using rtp ?