Recherche avancée

Médias (91)

Autres articles (41)

  • Websites made ​​with MediaSPIP

    2 mai 2011, par

    This page lists some websites based on MediaSPIP.

  • Creating farms of unique websites

    13 avril 2011, par

    MediaSPIP platforms can be installed as a farm, with a single "core" hosted on a dedicated server and used by multiple websites.
    This allows (among other things) : implementation costs to be shared between several different projects / individuals rapid deployment of multiple unique sites creation of groups of like-minded sites, making it possible to browse media in a more controlled and selective environment than the major "open" (...)

  • Other interesting software

    13 avril 2011, par

    We don’t claim to be the only ones doing what we do ... and especially not to assert claims to be the best either ... What we do, we just try to do it well and getting better ...
    The following list represents softwares that tend to be more or less as MediaSPIP or that MediaSPIP tries more or less to do the same, whatever ...
    We don’t know them, we didn’t try them, but you can take a peek.
    Videopress
    Website : http://videopress.com/
    License : GNU/GPL v2
    Source code : (...)

Sur d’autres sites (7613)

  • FFMPEG result video freezes in the middle of playback

    10 mai 2013, par Revoluzifer

    I'm trying stitch four source videos together into one grid. For testing purposes I'm working with a single source flv using this command :

    ffmpeg -i woohoo.flv -i woohoo.flv -i woohoo.flv -i woohoo.flv \
    -filter_complex "[0:0]pad=iw:ih[a];[1:0]scale=w=iw/2:h=ih/2[b];
    [2:0]scale=w=iw/2:h=ih/2[c];[3:0]scale=w=iw/2:h=ih/2[d];
    [0:0]scale=w=iw/2:h=ih/2[e];[a][b]overlay=w[x];[x][c]overlay=0:h[y];
    [y][d]overlay=w:h[z];[z][e]overlay=0:0" -qscale 1 stitched.avi

    The stitching itself is working great, but somehow the resulting video does not show as expected.
    After running for a few frames, it gets stuck at a single frame for most of the video, skipping the frames which should be there.

    While encoding ffmpeg throws a freaking lot of messages like :

    [Parsed_overlay_8 @ 000000000459e080] Buffer queue overflow, dropping.

    Any hints on how to solve my problem ?
    My source flv is h.264 encoded, coming from Red5 media server.

    Edit : Output is :

    root@s15757871:/opt/red5/webapps/woohoo/streams# ffmpeg -i out_3.mp4 -i 3.mp4 -filter_complex "[0:0]pad=iw:ih[a];[1:0]scale=w=iw/2:h=ih/2[b];[a][b]overlay=w:h" -vcodec libx264 -r 30 -acodec copy out_final.mp4
    ffmpeg version N-52943-g500220a Copyright (c) 2000-2013 the FFmpeg developers
    built on May 10 2013 09:46:03 with gcc 4.4.3 (Ubuntu 4.4.3-4ubuntu5.1)
    configuration: --enable-gpl --enable-libx264 --enable-libmp3lame --enable-nonfree --enable-libaacplus
     libavutil      52. 30.100 / 52. 30.100
     libavcodec     55.  7.100 / 55.  7.100
     libavformat    55.  4.101 / 55.  4.101
     libavdevice    55.  0.100 / 55.  0.100
     libavfilter     3. 63.101 /  3. 63.101
     libswscale      2.  3.100 /  2.  3.100
     libswresample   0. 17.102 /  0. 17.102
     libpostproc    52.  3.100 / 52.  3.100
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'out_3.mp4':
     Metadata:
       major_brand     : isom
       minor_version   : 512
       compatible_brands: isomiso2avc1mp41
       encoder         : Lavf55.4.101
    Duration: 00:00:26.53, start: 0.000000, bitrate: 513 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 640x360 [SAR 1:1 DAR 16:9], 447 kb/s, 30 fps, 30 tbr, 15360 tbn, 60 tbc
    Metadata:
     handler_name    : VideoHandler
    Stream #0:1(und): Audio: mp3 (mp4a / 0x6134706D), 44100 Hz, mono, s16p, 62 kb/s
    Metadata:
     handler_name    : SoundHandler
    Input #1, mov,mp4,m4a,3gp,3g2,mj2, from '3.mp4':
     Metadata:
       major_brand     : isom
       minor_version   : 512
       compatible_brands: isomiso2avc1mp41
       encoder         : Lavf55.4.101
    Duration: 00:00:26.60, start: 0.000000, bitrate: 639 kb/s
    Stream #1:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 640x360 [SAR 1:1 DAR 16:9], 574 kb/s, 30 fps, 30 tbr, 15360 tbn, 60 tbc
    Metadata:
     handler_name    : VideoHandler
    Stream #1:1(und): Audio: mp3 (mp4a / 0x6134706D), 44100 Hz, mono, s16p, 62 kb/s
    Metadata:
     handler_name    : SoundHandler
    File 'out_final.mp4' already exists. Overwrite ? [y/N] y
    [libx264 @ 0x19baee0] using SAR=1/1
    [libx264 @ 0x19baee0] using cpu capabilities: MMX2 SSE2Fast SSEMisalign LZCNT
    [libx264 @ 0x19baee0] profile High, level 3.0
    [libx264 @ 0x19baee0] 264 - core 132 r2310 76a5c3a - H.264/MPEG-4 AVC codec - Copyleft 2003-2013 - http://www.videolan.org/x264.html - options:  cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=12 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=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
    Output #0, mp4, to 'out_final.mp4':
     Metadata:
       major_brand     : isom
       minor_version   : 512
       compatible_brands: isomiso2avc1mp41
    encoder         : Lavf55.4.101
    Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 640x360 [SAR 1:1 DAR 16:9], q=-1--1, 15360 tbn, 30 tbc
    Stream #0:1(und): Audio: mp3 (i[0][0][0] / 0x0069), 44100 Hz, mono, 62 kb/s
    Metadata:
     handler_name    : SoundHandler
    Stream mapping:
     Stream #0:0 (h264) -> pad
     Stream #1:0 (h264) -> scale
     overlay -> Stream #0:0 (libx264)
     Stream #0:1 -> #0:1 (copy)
    Press [q] to stop, [?] for help
    Buffer queue overflow, dropping.     583kB time=00:00:08.00 bitrate= 597.3kbits/s
    [Parsed_overlay_2 @ 0x19be420] Buffer queue overflow, dropping.
    Last message repeated 202 times
    frame=  795 fps= 96 q=-2.0 Lsize=    1700kB time=00:00:27.04 bitrate= 514.9kbits/s dup=203 drop=0
    video:1487kB audio:196kB subtitle:0 global headers:0kB muxing overhead 1.025454%
    [libx264 @ 0x19baee0] frame I:4     Avg QP:19.83  size: 34019
    [libx264 @ 0x19baee0] frame P:322   Avg QP:22.85  size:  3858
    [libx264 @ 0x19baee0] frame B:469   Avg QP:24.57  size:   305
    [libx264 @ 0x19baee0] consecutive B-frames: 13.8% 15.8% 20.0% 50.3%
    [libx264 @ 0x19baee0] mb I  I16..4: 10.5% 47.8% 41.7%
    [libx264 @ 0x19baee0] mb P  I16..4:  1.4%  3.0%  0.8%  P16..4: 27.1% 14.4%  9.2%  0.0% 0.0%    skip:44.1%
    [libx264 @ 0x19baee0] mb B  I16..4:  0.0%  0.1%  0.0%  B16..8: 15.3%  1.5%  0.2%  direct: 0.3%  skip:82.6%  L0:39.7% L1:53.8% BI: 6.5%
    [libx264 @ 0x19baee0] 8x8 transform intra:56.6% inter:64.9%
    [libx264 @ 0x19baee0] coded y,uvDC,uvAC intra: 58.4% 72.9% 39.0% inter: 8.3% 11.9% 1.0%
    [libx264 @ 0x19baee0] i16 v,h,dc,p: 63% 18% 10% 10%
    [libx264 @ 0x19baee0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 23% 17% 20%  4%  7%  9%  6%  6%  8%
    [libx264 @ 0x19baee0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 27% 21% 13%  5%  7%  8%  6%  6%  7%
    [libx264 @ 0x19baee0] i8c dc,h,v,p: 52% 18% 22%  9%
    [libx264 @ 0x19baee0] Weighted P-Frames: Y:7.5% UV:4.0%
    [libx264 @ 0x19baee0] ref P L0: 70.8% 16.9%  9.3%  2.8%  0.2%
    [libx264 @ 0x19baee0] ref B L0: 90.6%  8.1%  1.3%
    [libx264 @ 0x19baee0] ref B L1: 96.4%  3.6%
    [libx264 @ 0x19baee0] kb/s:459.39

    The source mp4 files used here have successfully been converted from flv by ffmpeg before.

  • How can I record, encrypt (in memory), and mux audio and video on android without the files getting out of sync ?

    9 février 2021, par Robert

    We’re attempting to save video and audio from an Android device into an encrypted file. Our current implementation pipes the outputs from microphone and camera through the MediaEncoder class. As the data is output from MediaEncoder, we are encrypting and writing the contents of the byte buffer to disk. This approach works, however, when attempting to stitch the files back together with FFMPEG, we notice that the two streams seem to get out of sync somewhere mid stream. It appears that a lot of important metadata is lost with this method, specifically presentation timestamps and frame rate data as ffmpeg has to do some guess work to mux the files.

    


    Are there techniques for keeping these streams in sync without using MediaMuxer ? The video is encoded with H.264 and the audio with AAC.

    


    Other Approaches :
We attempted to use the MediaMuxer to mux the output data to a file, but our use case requires that we encrypt the bytes of data before they are saved to disk which eliminates the possibility of using the default constructor.

    


    Additionally, we have attempted to use the newly added (API 26) constructor that takes a FileDescriptor instead and have that pointed to a ParcelFileDescriptor that wrapped an Encrypted Document (https://android.googlesource.com/platform/development/+/master/samples/Vault/src/com/example/android/vault/EncryptedDocument.java). However, this approach led to crashes at the native layer and we believe it may have to do with this comment from the source code (https://android.googlesource.com/platform/frameworks/base.git/+/master/media/java/android/media/MediaMuxer.java#353) about the native writer trying to memory map the output file.

    


    import android.graphics.YuvImage&#xA;import android.media.MediaCodec&#xA;import android.media.MediaCodecInfo&#xA;import android.media.MediaFormat&#xA;import android.media.MediaMuxer&#xA;import com.callyo.video_10_21.Utils.YuvImageUtils.convertNV21toYUV420Planar&#xA;import java.io.FileDescriptor&#xA;import java.util.*&#xA;import java.util.concurrent.atomic.AtomicReference&#xA;import kotlin.properties.Delegates&#xA;&#xA;class VideoEncoderProcessor(&#xA;   private val fileDescriptor: FileDescriptor,&#xA;   private val width: Int,&#xA;   private val height: Int,&#xA;   private val frameRate: Int&#xA;): MediaCodec.Callback() {&#xA;   private lateinit var videoFormat: MediaFormat&#xA;   private var trackIndex by Delegates.notNull<int>()&#xA;   private var mediaMuxer: MediaMuxer&#xA;   private val mediaCodec = createEncoder()&#xA;   private val pendingVideoEncoderInputBufferIndices = AtomicReference>(LinkedList())&#xA;&#xA;   companion object {&#xA;       private const val VIDEO_FORMAT = "video/avc"&#xA;   }&#xA;&#xA;  init {&#xA;       mediaMuxer = MediaMuxer(fileDescriptor, MediaMuxer.OutputFormat.MUXER_OUTPUT_MPEG_4)&#xA;       mediaCodec.setCallback(this)&#xA;       mediaCodec.start()&#xA;   }&#xA;&#xA;   private fun createEncoder(): MediaCodec {&#xA;       videoFormat = MediaFormat.createVideoFormat(VIDEO_FORMAT, width, height).apply {&#xA;           setInteger(MediaFormat.KEY_FRAME_RATE, frameRate)&#xA;           setInteger(MediaFormat.KEY_COLOR_FORMAT, MediaCodecInfo.CodecCapabilities.COLOR_FormatYUV420Flexible)&#xA;           setInteger(MediaFormat.KEY_BIT_RATE, width * height * 5)&#xA;           setInteger(MediaFormat.KEY_I_FRAME_INTERVAL, 1)&#xA;       }&#xA;&#xA;       return MediaCodec.createEncoderByType(VIDEO_FORMAT).apply {&#xA;           configure(videoFormat, null, null, MediaCodec.CONFIGURE_FLAG_ENCODE)&#xA;       }&#xA;   }&#xA;&#xA;   override fun onInputBufferAvailable(codec: MediaCodec, index: Int) {&#xA;       // logic for handling stream end omitted for clarity&#xA;&#xA;       /* Video frames come in asynchronously from input buffer availability&#xA;        * so we need to keep track of available buffers in queue */&#xA;       pendingVideoEncoderInputBufferIndices.get().add(index)&#xA;   }&#xA;&#xA;   override fun onError(codec: MediaCodec, e: MediaCodec.CodecException) {}&#xA;&#xA;   override fun onOutputFormatChanged(codec: MediaCodec, format: MediaFormat) {&#xA;       trackIndex = mediaMuxer.addTrack(format)&#xA;       mediaMuxer.start()&#xA;   }&#xA;&#xA;   override fun onOutputBufferAvailable(codec: MediaCodec, index: Int, bufferInfo: MediaCodec.BufferInfo) {&#xA;       val buffer = mediaCodec.getOutputBuffer(index)&#xA;       buffer?.apply {&#xA;           if (bufferInfo.size != 0) {&#xA;               limit(bufferInfo.offset &#x2B; bufferInfo.size)&#xA;               rewind()&#xA;               mediaMuxer.writeSampleData(trackIndex, this, bufferInfo)&#xA;           }&#xA;       }&#xA;&#xA;       mediaCodec.releaseOutputBuffer(index, false)&#xA;&#xA;       if (bufferInfo.flags == MediaCodec.BUFFER_FLAG_END_OF_STREAM) {&#xA;           mediaCodec.stop()&#xA;           mediaCodec.release()&#xA;           mediaMuxer.stop()&#xA;           mediaMuxer.release()&#xA;       }&#xA;   }&#xA;&#xA;   // Public method that receives raw unencoded video data&#xA;   fun encode(yuvImage: YuvImage) {&#xA;       // logic for handling stream end omitted for clarity&#xA;&#xA;       pendingVideoEncoderInputBufferIndices.get().poll()?.let { index ->&#xA;           val buffer = mediaCodec.getInputBuffer(index)&#xA;           buffer?.clear()&#xA;           // converting frame to correct color format&#xA;           val input =&#xA;                   yuvImage.convertNV21toYUV420Planar(ByteArray(yuvImage.yuvData.size), yuvImage.width, yuvImage.height)&#xA;           buffer?.put(input)&#xA;           buffer?.let {&#xA;               mediaCodec.queueInputBuffer(index, 0, input.size, System.nanoTime() / 1000, 0)&#xA;           }&#xA;       }&#xA;   }&#xA;}&#xA;&#xA;&#xA;</int>

    &#xA;


    &#xA;

    Additional Info :&#xA;I’m using MediaCodec.Callback() (https://developer.android.com/reference/kotlin/android/media/MediaCodec.Callback?hl=en) to handle the encoding asynchronously.

    &#xA;

  • what is the correct command using gstreamer to convert mp4 to 264 file ?

    25 mars 2020, par hilow

    My english is pool, i am sorry !

    I use ffmpeg and gstreamer convert mp4 file to 264 format, but the output file is different.
    The question is :

    • 1.Why they are different file ?

    • 2.What is the level mean in gst-discoverer-1.0 ?

      Use ffmpeg it is Codec:     video/x-h264, ...... level=(string)1.2.

      Use gstreamer it is Codec:     video/x-h264, ...... level=(string)3.

    • 3.How to use gstreamer to convert the correct 264 file ?

    The original video file is come from https://github.com/notedit/media-server-go-demo/blob/master/video-mixer/public/big_buck_bunny.mp4 .

    command :

    gst-launch-1.0 filesrc location=big_buck_bunny.mp4 ! \
       qtdemux name=demux \
         demux.video_0 ! queue ! \
         decodebin ! \
         videoconvert ! \
         videoscale ! \
         videorate ! \
         video/x-raw,width=320,height=240,framerate=15/1,pixel-aspect-ratio=1/1,level=1.2 ! \
         x264enc bframes=0 byte-stream=true bitrate=9000 ! \
         filesink location=videogst.264

    ffmpeg -i big_buck_bunny.mp4 -f h264 -vcodec libx264 -s 320x240 -bf 0 -r 15 videoffmpeg.264

    output file :

    -rw-r--r-- 1 xxx staff 1.9M 3 25 13:39 videoffmpeg.264
    -rw-r--r-- 1 xxx staff 17M 3 25 13:40 videogst.264

    video codec :

    xxx@xxxs-MacBook-Pro resource %  gst-discoverer-1.0 videoffmpeg.264 -v
    Analyzing file:///Users/xxx/tool/resource/videoffmpeg.264
    Done discovering file:///Users/xxx/tool/resource/videoffmpeg.264

    Topology:
     video: video/x-h264, width=(int)320, height=(int)240, framerate=(fraction)15/1, chroma-format=(string)4:2:0, bit-depth-luma=(uint)8, bit-depth-chroma=(uint)8, parsed=(boolean)true, stream-format=(string)avc, alignment=(string)au, profile=(string)high, level=(string)1.2, codec_data=(buffer)0164000cffe100176764000cacb20283f420000003002000000303c1e2854901000668ebc3cb22c0
       Tags:
         视频编码: H.264 (High Profile)

       Codec:
         video/x-h264, width=(int)320, height=(int)240, framerate=(fraction)15/1, chroma-format=(string)4:2:0, bit-depth-luma=(uint)8, bit-depth-chroma=(uint)8, parsed=(boolean)true, stream-format=(string)avc, alignment=(string)au, profile=(string)high, level=(string)1.2, codec_data=(buffer)0164000cffe100176764000cacb20283f420000003002000000303c1e2854901000668ebc3cb22c0
       Additional info:
         None
       Stream ID: 349989c8845fcc23360fb0ab02ea7510051b926669bf8f3862879823fbab6daf
       Width: 320
       Height: 240
       Depth: 24
       Frame rate: 15/1
       Pixel aspect ratio: 1/1
       Interlaced: false
       Bitrate: 0
       Max bitrate: 0

    Properties:
     Duration: 0:01:32.995000000
     Seekable: yes
     Live: no
     Tags:
         视频编码: H.264 (High Profile)


    xxx@xxxs-MacBook-Pro resource % gst-discoverer-1.0 videogst.264 -v
    Analyzing file:///Users/xxx/tool/resource/videogst.264
    Done discovering file:///Users/xxx/tool/resource/videogst.264

    Topology:
     video: video/x-h264, pixel-aspect-ratio=(fraction)1/1, width=(int)320, height=(int)240, framerate=(fraction)15/1, chroma-format=(string)4:2:0, bit-depth-luma=(uint)8, bit-depth-chroma=(uint)8, parsed=(boolean)true, stream-format=(string)avc, alignment=(string)au, profile=(string)high, level=(string)3, codec_data=(buffer)0164001effe1001d6764001eacb20283f602d4180416940000030004000003007a3c58b92001000568ebccb22c
       Tags:
         视频编码: H.264 (High Profile)

       Codec:
         video/x-h264, pixel-aspect-ratio=(fraction)1/1, width=(int)320, height=(int)240, framerate=(fraction)15/1, chroma-format=(string)4:2:0, bit-depth-luma=(uint)8, bit-depth-chroma=(uint)8, parsed=(boolean)true, stream-format=(string)avc, alignment=(string)au, profile=(string)high, level=(string)3, codec_data=(buffer)0164001effe1001d6764001eacb20283f602d4180416940000030004000003007a3c58b92001000568ebccb22c
       Additional info:
         None
       Stream ID: fb99f4104b347e5682d52c0bd65bcee91b765e42f89ce2e3553be5d6d743a666
       Width: 320
       Height: 240
       Depth: 24
       Frame rate: 15/1
       Pixel aspect ratio: 1/1
       Interlaced: false
       Bitrate: 0
       Max bitrate: 0

    Properties:
     Duration: 0:01:45.505000000
     Seekable: yes
     Live: no
     Tags:
         视频编码: H.264 (High Profile)