Recherche avancée

Médias (1)

Mot : - Tags -/MediaSPIP

Autres articles (111)

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

  • Les formats acceptés

    28 janvier 2010, par

    Les commandes suivantes permettent d’avoir des informations sur les formats et codecs gérés par l’installation local de ffmpeg :
    ffmpeg -codecs ffmpeg -formats
    Les format videos acceptés en entrée
    Cette liste est non exhaustive, elle met en exergue les principaux formats utilisés : h264 : H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 m4v : raw MPEG-4 video format flv : Flash Video (FLV) / Sorenson Spark / Sorenson H.263 Theora wmv :
    Les formats vidéos de sortie possibles
    Dans un premier temps on (...)

  • Ajouter notes et légendes aux images

    7 février 2011, par

    Pour pouvoir ajouter notes et légendes aux images, la première étape est d’installer le plugin "Légendes".
    Une fois le plugin activé, vous pouvez le configurer dans l’espace de configuration afin de modifier les droits de création / modification et de suppression des notes. Par défaut seuls les administrateurs du site peuvent ajouter des notes aux images.
    Modification lors de l’ajout d’un média
    Lors de l’ajout d’un média de type "image" un nouveau bouton apparait au dessus de la prévisualisation (...)

Sur d’autres sites (10544)

  • FFMPEG - Pipe Different HLS Resolutions to S3

    17 juillet 2019, par Mike

    I’m trying to save all my HLS output files directly to S3. As you can see in the code, I’m saving output files for many different sizes and bitrates. My issue is I can’t figure out how to save the files onto S3. I have managed to get this working on an EC2 instance where I save all the files on the same server, but once I try to use aws cli it fails. I can also get this working if it’s just one resolution.

    I’m guessing it has something to do with piping multiple aws cli commands since I can see it tells me Unknown options:, but I don’t see any other way of doing this.

    Also, I’m using the -progress flag so I can show the transcode progress to the user, can I pipe that directly to S3 as-well ?

    Note, the code below has been formatted to make it readable, it obviously doesn’t look like this when ran on the server.

    FFMPEG Command

    ffmpeg
    -hide_banner -y
    -i https://my-bucket.s3.us-west-1.amazonaws.com/in.mp4
    -progress https://mybucket.s3.us-west-1.amazonaws.com/progress.log
    -c:a aac
    -c:v libx264
    -f mp4
    -profile:v high
    -level:v 4.0
    -crf 20
    -sc_threshold 0
    -flags +cgop
    -movflags frag_keyframe+faststart
    -pix_fmt yuv420p
    -preset ultrafast
    -g 100
    -keyint_min 100
    -hls_time 5000
    -hls_playlist_type vod

    -vf scale='trunc(oh*a/2)*2:288'
    -b:v 600k
    -maxrate 642k
    -bufsize 900k
    -b:a 64k
    -hls_segment_filename https://my-bucket.s3.us-west-1.amazonaws.com/288p_600k_%03d.ts
    pipe:1 | aws s3 cp - s3://my-bucket/288p_600k.m3u8

    -vf scale='trunc(oh*a/2)*2:360'
    -b:v 900k
    -maxrate 963k
    -bufsize 1350k
    -b:a 96k
    -hls_segment_filename https://my-bucket.s3.us-west-1.amazonaws.com/360p_900k_%03d.ts
    pipe:1 | aws s3 cp - s3://my-bucket/360p_900k.m3u8

    -vf scale='trunc(oh*a/2)*2:432'
    -b:v 1600k
    -maxrate 1712k
    -bufsize 2400k
    -b:a 128k
    -hls_segment_filename https://my-bucket.s3.us-west-1.amazonaws.com/432p_1600k_%03d.ts
    pipe:1 | aws s3 cp - s3://my-bucket/432p_1600k.m3u8

    -vf scale='trunc(oh*a/2)*2:720'
    -b:v 3200k
    -maxrate 3424k
    -bufsize 4800k
    -b:a 128k
    -hls_segment_filename https://my-bucket.s3.us-west-1.amazonaws.com/720p_3200k_%03d.ts
    pipe:1 | aws s3 cp - s3://my-bucket/720p_3200k.m3u8

    -vf scale='trunc(oh*a/2)*2:1080'
    -b:v 5300k
    -maxrate 5671k
    -bufsize 7950k
    -b:a 192k
    -hls_segment_filename https://my-bucket.s3.us-west-1.amazonaws.com/1080p_5300k_%03d.ts
    pipe:1 | aws s3 cp - s3://my-bucket/1080p_5300k.m3u8

    Error Message

    Exit Code: 1(General error)
    Working directory: /home/backend/public
    Output:
    ================
    Error Output:
    ================
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'https://my-bucket.s3.us-west-1.amazonaws.com/in.mp4':
     Metadata:
       major_brand     : isom
       minor_version   : 512
       compatible_brands: isomiso2avc1mp41
       creation_time   : 1970-01-01T00:00:00.000000Z
       encoder         : Lavf53.24.2
    Duration: 00:00:05.31, start: 0.000000, bitrate: 1589 kb/s
     Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 1205 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
     Metadata:
       creation_time   : 1970-01-01T00:00:00.000000Z
       handler_name    : VideoHandler
     Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, 5.1, fltp, 384 kb/s (default)
     Metadata:
       creation_time   : 1970-01-01T00:00:00.000000Z
       handler_name    : SoundHandler
    Stream mapping:
     Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
     Stream #0:1 -> #0:1 (aac (native) -> aac (native))
    Press [q] to stop, [?] for help
    [libx264 @ 0x55ba09a95300] using SAR=1/1
    [libx264 @ 0x55ba09a95300] using cpu capabilities: MMX2 SSE2Fast LZCNT SSSE3 SSE4.2 AVX
    [libx264 @ 0x55ba09a95300] profile Constrained Baseline, level 4.0
    [libx264 @ 0x55ba09a95300] 264 - core 152 r2854 e9a5903 - H.264/MPEG-4 AVC codec - Copyleft 2003-2017 - http://www.videolan.org/x264.html - options: cabac=0 ref=1 deblock=0:0:0 analyse=0:0 me=dia subme=0 psy=1 psy_rd=1.00:0.00 mixed_ref=0 me_range=16 chroma_me=1 trellis=0 8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=0 threads=3 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=0 weightp=0 keyint=100 keyint_min=51 scenecut=0 intra_refresh=0 rc_lookahead=0 rc=crf mbtree=0 crf=20.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 vbv_maxrate=642 vbv_bufsize=900 crf_max=0.0 nal_hrd=none filler=0 ip_ratio=1.40 aq=0
    Output #0, mp4, to 'pipe:':
     Metadata:
       major_brand     : isom
       minor_version   : 512
       compatible_brands: isomiso2avc1mp41
       encoder         : Lavf57.83.100
       Stream #0:0(und): Video: h264 (libx264) (avc1 / 0x31637661), yuv420p, 512x288 [SAR 1:1 DAR 16:9], q=-1--1, 600 kb/s, 25 fps, 12800 tbn, 25 tbc (default)
       Metadata:
         creation_time   : 1970-01-01T00:00:00.000000Z
         handler_name    : VideoHandler
         encoder         : Lavc57.107.100 libx264
       Side data:
         cpb: bitrate max/min/avg: 642000/0/600000 buffer size: 900000 vbv_delay: -1
       Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, 5.1, fltp, 64 kb/s (default)
       Metadata:
         creation_time   : 1970-01-01T00:00:00.000000Z
         handler_name    : SoundHandler
         encoder         : Lavc57.107.100 aac
    frame=   27 fps=0.0 q=28.0 size=       0kB time=00:00:01.13 bitrate=  
    0.3kbits/s speed=2.21x
    Unknown options: -vf,scale=trunc(oh*a/2)*2:360,-b:v,900k,-maxrate,963k,-bufsize,1350k,-b:a,96k,-hls_segment_filename,https://my-bucket.s3.us-west-1.amazonaws.com/360p_900k_%03d.ts,-

    Unknown options: -vf,scale=trunc(oh*a/2)*2:432,-b:v,1600k,-maxrate,1712k,-bufsize,2400k,-b:a,128k,-hls_segment_filename,https://my-bucket.s3.us-west-1.amazonaws.com/432p_1600k_%03d.ts,-

    Unknown options: -vf,scale=trunc(oh*a/2)*2:720,-b:v,3200k,-maxrate,3424k,-bufsize,4800k,-b:a,128k,-hls_segment_filename,https://my-bucket.s3.us-west-1.amazonaws.com/720p_3200k_%03d.ts,-

    Unknown options: -vf,scale=trunc(oh*a/2)*2:1080,-b:v,5300k,-maxrate,5671k,-bufsize,7950k,-b:a,192k,-hls_segment_filename,https://my-bucket.s3.us-west-1.amazonaws.com/1080p_5300k_%03d.ts,-
    upload failed: - to s3://my-bucket/1080p_5300k.m3u8 seek() takes 2 positional arguments but 3 were given
    av_interleaved_write_frame(): Broken pipe
    Error writing trailer of pipe:: Broken pipe
    frame=  105 fps=104 q=27.0 Lsize=       0kB time=00:00:04.26 bitrate=  
    0.1kbits/s speed=4.24x
    video:405kB audio:36kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
    [libx264 @ 0x55ba09a95300] frame I:2     Avg QP:27.31  size: 31711
    [libx264 @ 0x55ba09a95300] frame P:103   Avg QP:29.12  size:  3522
    [libx264 @ 0x55ba09a95300] mb I  I16..4: 100.0%  0.0%  0.0%
    [libx264 @ 0x55ba09a95300] mb P  I16..4:  0.8%  0.0%  0.0%  P16..4: 58.1%  
    0.0%  0.0%  0.0%  0.0%    skip:41.2%
    [libx264 @ 0x55ba09a95300] coded y,uvDC,uvAC intra: 71.6% 66.1% 45.5%
    inter: 29.8% 10.3% 1.5%
    [libx264 @ 0x55ba09a95300] i16 v,h,dc,p: 16% 26% 35% 23%
    [libx264 @ 0x55ba09a95300] i8c dc,h,v,p: 47% 22% 20% 11%
    [libx264 @ 0x55ba09a95300] kb/s:811.77
    [aac @ 0x55ba09e26c60] Qavg: 88.610
    Conversion failed!
  • avcodec library not extracting all the frames from a video

    22 novembre 2018, par Guru Govindan

    I have written a library that could be used with python to extract frames from a video in a buffer for some processing. I used the examples from the ffmpeg to build my library using libavcodec.
    This and seems to be working fine for most of the videos. But I see on some videos where my library does not extract all the frames (way less than the FPS).

    It seems like somehow the packets might be out of order and docoder is not able to handle it. I keep getting a lot of the following errors

    pid=100 pes_code=0x1e0

    nal_unit_type : 9, nal_ref_idc : 0

    nal_unit_type : 1, nal_ref_idc : 2

    deblocking_filter_idc 7 out of range

    decode_slice_header error

    no frame !

    I use the following steps to setup the decoder.

       //open input file, allocate context
    if ((ret = avformat_open_input(&format_ctx, in_filename, 0, 0)) < 0) {
       PyErr_SetString(ExtractorError, "Could not open input file!");
       goto end;
    }

    if ((ret = avformat_find_stream_info(format_ctx, 0)) < 0) {
       PyErr_SetString(ExtractorError, "Failed to retrieve input stream information!");
       goto end;
    }

    av_dump_format(format_ctx, 0, in_filename, 0);

    // Get the video index from the stream
    for(int i=0; inb_streams ;i++ )
    {
       if( format_ctx->streams[i]->codecpar->codec_type == AVMEDIA_TYPE_VIDEO )
       {
           video_stream_index = i;
           break;
       }
    }

    /* if video stream not availabe */
    if((video_stream_index) == -1)
    {
       PyErr_SetString(ExtractorError, "video stream to retreive fps is not found!");
       return NULL;
    }

    long duration = format_ctx->duration + (format_ctx->duration <= INT64_MAX - 5000 ? 5000 : 0);

    float duration_in_secs = (float)duration / AV_TIME_BASE;

    stream_mapping_size = format_ctx->nb_streams;
    stream_mapping = av_mallocz_array(stream_mapping_size, sizeof(*stream_mapping));
    if (!stream_mapping) {
       ret = AVERROR(ENOMEM);
       goto end;
    }

    AVCodec *pCodec = NULL;
    AVCodecParameters *in_codecpar = NULL;
    for (i = 0; i < format_ctx->nb_streams; i++) {
       AVStream *in_stream = format_ctx->streams[i];
       in_codecpar = in_stream->codecpar;

       if (in_codecpar->codec_type != AVMEDIA_TYPE_AUDIO &&
           in_codecpar->codec_type != AVMEDIA_TYPE_VIDEO &&
           in_codecpar->codec_type != AVMEDIA_TYPE_SUBTITLE) {
           stream_mapping[i] = -1;
           continue;
       }

       if (in_codecpar->codec_type == AVMEDIA_TYPE_VIDEO){
           pCodec = avcodec_find_decoder(in_codecpar->codec_id);
           stream_mapping[i] = stream_index++;
           break;
       }
    }

    if(!pCodec){
       PyErr_SetString(ExtractorError, "error, no pCodec!");
       return NULL;
    }

    // convert CodecParam to CodecCtx
    AVCodecContext *pCodecCtx = avcodec_alloc_context3(pCodec);
    if (!pCodecCtx) {
       PyErr_SetString(ExtractorError, "Failed to convert codecParam to CodecCtx!");
       return NULL;
    }

    ret = avcodec_parameters_to_context(pCodecCtx, in_codecpar);
    if (ret < 0)
       goto end;

    //open video decoder
    if (avcodec_open2(pCodecCtx, pCodec, NULL) < 0)
    {
       logging("EXTRACTOR: failed to open codec through avcodec_open2\n");
       return NULL;
    }

    In order to test it I used the following command from ffmpeg to extract frames from the same video and it worked fine.

    ffmpeg -i /thuuz/extractor/03000.ts -f image2 -qscale:v 7 ffmpeg-detect—%03d.jpg -hide_banner -v quiet

    Am I not passing the right codec params ? Please let me know some inputs on how to debug this issue.
    Thanks a lot.

  • How to display live video stream from ffmpeg in C#/WPF ?

    9 avril 2019, par Kevin McDaniel

    I am trying to get an output from FFmpeg.exe to display live on my wpf media player. The inputs to FFmpeg are an IP camera and a video file (mp4).

    The WPF media player needs a URI as the input. So, I have tried hosting a Udp server for FFmpeg to post to (which I can log the data coming in on the console). Then I try to get the stream using the media player, but no success.

    My Udp listener :

    UdpClient _udpServer = new UdpClient(5000);
    UdpClient _udpClient = new UdpClient(5001);
    private void UdpListen() {
      while (true)
      {
         IPEndPoint RemoteIpEndPoint = new IPEndPoint(IPAddress.Any, 0);
         Byte[] receiveBytes = _udpServer.Receive(ref RemoteIpEndPoint);
         if (RemoteIpEndPoint.ToString() != "192.168.1.110:5001")
         {
            IPEndPoint ep = new IPEndPoint(IPAddress.Parse("192.168.1.110"), 5001);
            _udpClient.Send(receiveBytes, receiveBytes.Length, ep);
         }
         Console.WriteLine("receive data from " + RemoteIpEndPoint.ToString() + ": " + receiveBytes.Length);
      }
    }

    The ffmpeg output : ... -f mpegts udp ://192.168.1.110:5000

    I pass this into the media player : udp ://192.168.1.110:5001

    I am expecting to see the video file being displayed as ffmpeg is processing the output. But, I just see ffmpeg do its processing, and the Udp listener writing to the console.
    Let me know where I am going wrong, thanks in advance