Recherche avancée

Médias (0)

Mot : - Tags -/performance

Aucun média correspondant à vos critères n’est disponible sur le site.

Autres articles (78)

  • Organiser par catégorie

    17 mai 2013, par

    Dans MédiaSPIP, une rubrique a 2 noms : catégorie et rubrique.
    Les différents documents stockés dans MédiaSPIP peuvent être rangés dans différentes catégories. On peut créer une catégorie en cliquant sur "publier une catégorie" dans le menu publier en haut à droite ( après authentification ). Une catégorie peut être rangée dans une autre catégorie aussi ce qui fait qu’on peut construire une arborescence de catégories.
    Lors de la publication prochaine d’un document, la nouvelle catégorie créée sera proposée (...)

  • Récupération d’informations sur le site maître à l’installation d’une instance

    26 novembre 2010, par

    Utilité
    Sur le site principal, une instance de mutualisation est définie par plusieurs choses : Les données dans la table spip_mutus ; Son logo ; Son auteur principal (id_admin dans la table spip_mutus correspondant à un id_auteur de la table spip_auteurs)qui sera le seul à pouvoir créer définitivement l’instance de mutualisation ;
    Il peut donc être tout à fait judicieux de vouloir récupérer certaines de ces informations afin de compléter l’installation d’une instance pour, par exemple : récupérer le (...)

  • Demande de création d’un canal

    12 mars 2010, par

    En fonction de la configuration de la plateforme, l’utilisateur peu avoir à sa disposition deux méthodes différentes de demande de création de canal. La première est au moment de son inscription, la seconde, après son inscription en remplissant un formulaire de demande.
    Les deux manières demandent les mêmes choses fonctionnent à peu près de la même manière, le futur utilisateur doit remplir une série de champ de formulaire permettant tout d’abord aux administrateurs d’avoir des informations quant à (...)

Sur d’autres sites (4819)

  • Matching a specific media format with ffmpeg/avconv

    5 mai 2020, par Markus A.

    I need to encode a video from static images in such a way that it format-matches another one so I can splice the video streams together.

    



    Here is the mediainfo of the file I'm trying to match :

    



    Video
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : Baseline@L3.1
Format settings, CABAC                   : No
Format settings, ReFrames                : 1 frame
Codec ID                                 : 7
Duration                                 : 2mn 46s
Bit rate                                 : 1 614 Kbps
Width                                    : 1 280 pixels
Height                                   : 720 pixels
Display aspect ratio                     : 16:9
Frame rate mode                          : Variable
Standard                                 : NTSC
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Stream size                              : 32.0 MiB (87%)
Color primaries                          : BT.601 PAL
Transfer characteristics                 : BT.601
Matrix coefficients                      : BT.601


    



    So far, what I have been able to come up with is the following :

    



    avconv -f image2 -framerate 1.2 -i loop_%d.tif -c:v libx264 -preset veryslow -profile:v baseline -level:v 31 -b:v 1614K -refs 1 loop.flv


    



    This gets me to :

    



    Video
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : Baseline@L3.1
Format settings, CABAC                   : No
Format settings, ReFrames                : 1 frame
Codec ID                                 : 7
Duration                                 : 2s 917ms
Bit rate                                 : 1 614 Kbps
Width                                    : 1 280 pixels
Height                                   : 720 pixels
Display aspect ratio                     : 16:9
Frame rate mode                          : Constant
Frame rate                               : 1.200 fps
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 1.459
Stream size                              : 575 KiB
Writing library                          : x264 core 142 r2431 a5831aa
Encoding settings                        : cabac=0 / ref=1 / deblock=1:0:0 / analyse=0x1:0x131 / me=umh / subme=10 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=0 / me_range=24 / chroma_me=1 / trellis=2 / 8x8dct=0 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=6 / lookahead_threads=1 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=0 / weightp=0 / keyint=250 / keyint_min=1 / scenecut=40 / intra_refresh=0 / rc_lookahead=60 / rc=abr / mbtree=1 / bitrate=1614 / ratetol=1.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / ip_ratio=1.40 / aq=1:1.00


    



    Which, unfortunately, still isn't good enough as VLC Media Player crashes hard (just closes), logging main error: Failed to compensate for the format changes, removing all filters; main error: Failed to create video converter as soon as the stream splice occurs. I tried splicing another stream in that does have the exact same encoding, and it works fine. I'm also making sure to only splice on key-frames and I am including the NALU containing the AVCDecoderConfigRecord, so I'm pretty sure I'm not doing anything else wrong, especially since a couple other programs are fine with the splice. It's just VLC that expects an even closer match.

    



    Here are things I've tried :

    



      

    • Adding -vsync 2 to get variable frame rate mode. Doesn't change anything.
    • 


    • Adding -color_primaries bt470bg -color_trc gamma28 -colorspace bt470bg to try to get BT.601 PAL settings (several websites mentioned this). Doesn't change anything.
    • 


    • Adding -s ntsc to set the standard to NTSC. This also changes the resolution to 720x480 (not OK), and specifying -s 1280x720 in addition gets rid of the NTSC tag again.
    • 


    



    If anyone knows what flags I need to supply to get closer, that would be super-helpful ! The stream I'm trying to match is encoded on an Android device (it's a live-stream), so I'm assuming it is built using the standard Android MediaCoder framework, in case that helps.

    


  • Matching a specific media format with ffmpeg/avconv

    5 mai 2020, par Markus A.

    I need to encode a video from static images in such a way that it format-matches another one so I can splice the video streams together.

    



    Here is the mediainfo of the file I'm trying to match :

    



    Video
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : Baseline@L3.1
Format settings, CABAC                   : No
Format settings, ReFrames                : 1 frame
Codec ID                                 : 7
Duration                                 : 2mn 46s
Bit rate                                 : 1 614 Kbps
Width                                    : 1 280 pixels
Height                                   : 720 pixels
Display aspect ratio                     : 16:9
Frame rate mode                          : Variable
Standard                                 : NTSC
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Stream size                              : 32.0 MiB (87%)
Color primaries                          : BT.601 PAL
Transfer characteristics                 : BT.601
Matrix coefficients                      : BT.601


    



    So far, what I have been able to come up with is the following :

    



    avconv -f image2 -framerate 1.2 -i loop_%d.tif -c:v libx264 -preset veryslow -profile:v baseline -level:v 31 -b:v 1614K -refs 1 loop.flv


    



    This gets me to :

    



    Video
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : Baseline@L3.1
Format settings, CABAC                   : No
Format settings, ReFrames                : 1 frame
Codec ID                                 : 7
Duration                                 : 2s 917ms
Bit rate                                 : 1 614 Kbps
Width                                    : 1 280 pixels
Height                                   : 720 pixels
Display aspect ratio                     : 16:9
Frame rate mode                          : Constant
Frame rate                               : 1.200 fps
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 1.459
Stream size                              : 575 KiB
Writing library                          : x264 core 142 r2431 a5831aa
Encoding settings                        : cabac=0 / ref=1 / deblock=1:0:0 / analyse=0x1:0x131 / me=umh / subme=10 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=0 / me_range=24 / chroma_me=1 / trellis=2 / 8x8dct=0 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=6 / lookahead_threads=1 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=0 / weightp=0 / keyint=250 / keyint_min=1 / scenecut=40 / intra_refresh=0 / rc_lookahead=60 / rc=abr / mbtree=1 / bitrate=1614 / ratetol=1.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / ip_ratio=1.40 / aq=1:1.00


    



    Which, unfortunately, still isn't good enough as VLC Media Player crashes hard (just closes), logging main error: Failed to compensate for the format changes, removing all filters; main error: Failed to create video converter as soon as the stream splice occurs. I tried splicing another stream in that does have the exact same encoding, and it works fine. I'm also making sure to only splice on key-frames and I am including the NALU containing the AVCDecoderConfigRecord, so I'm pretty sure I'm not doing anything else wrong, especially since a couple other programs are fine with the splice. It's just VLC that expects an even closer match.

    



    Here are things I've tried :

    



      

    • Adding -vsync 2 to get variable frame rate mode. Doesn't change anything.
    • 


    • Adding -color_primaries bt470bg -color_trc gamma28 -colorspace bt470bg to try to get BT.601 PAL settings (several websites mentioned this). Doesn't change anything.
    • 


    • Adding -s ntsc to set the standard to NTSC. This also changes the resolution to 720x480 (not OK), and specifying -s 1280x720 in addition gets rid of the NTSC tag again.
    • 


    



    If anyone knows what flags I need to supply to get closer, that would be super-helpful ! The stream I'm trying to match is encoded on an Android device (it's a live-stream), so I'm assuming it is built using the standard Android MediaCoder framework, in case that helps.

    


  • Libav Transcoding to H264 : Frames being dropped

    21 juin 2014, par roman

    I’m sorry if my question isn’t too well formulated, I’m only now getting started with FFmpeg and Libav. I’m not too knowledgable about media formats either, I pretty much learned all I know about the topic this past month. I’ve been doing as much research as I can, and have gotten pretty far, but I’ve only now gotten to the point where I’m almost unsure what my question actually is ! These are more like observations, but hopefully some of the experts can help me out here.

    I’m trying to transcode Gifs into MP4s using FFmpeg’s libraries, but I’m running into a strange issue when using the H264 Codec. In my transcoding loop, I keep a count of the number of frames that I write out (by verifying the return value of av_write_frame). In a particular sample, I count a total of 166 frames written out. If I examine FFmpeg’s converted file using FFprobe (the functionality I’m wanting to emulate using my program, a conversion from Gif to MP4), FFmpeg’s output file also seems to have 166 frames, but when I examine my output with FFprobe, I seem to only have 144 frames. What I find a bit interesting is that if I simply change my codec from H264 to MPEG4, my output appears to have the 166 frames, matching FFmpeg’s output and my counter. I get very similar results with different Gif files, where my counter of frames written matches FFmpeg’s output’s frame count, but my output seems to drop some frames.

    Encoder settings :

    ostream_codec_context->codec_id = CODEC_IN_USE;  //CODEC_ID_H264 or CODEC_ID_MPEG4
    ostream_codec_context->pix_fmt = AV_PIX_FMT_YUV420P;
    ostream_codec_context->codec_type = AVMEDIA_TYPE_VIDEO;
    ostream_codec_context->flags = CODEC_FLAG_GLOBAL_HEADER;
    ostream_codec_context->profile = FF_PROFILE_MPEG4_SIMPLE;

    ostream_codec_context->gop_size = istream_codec_context->gop_size;
    ostream_codec_context->time_base = istream_codec_context->time_base;

    ostream_codec_context->width  = (istream_codec_context->width  / 2) * 2;
    ostream_codec_context->height = (istream_codec_context->height / 2) * 2;    

    Transcoding loop :

    I’ve omitted some error-checking code and debugging statements

    avformat_write_header(oformat_context, NULL);
    while (av_read_frame(iformat_context, &packet) == 0 )
    {
      if (packet.stream_index == istream_index)
      {  
         avcodec_decode_video2(istream_codec_context, ipicture, &full_frame, &packet);
         if (full_frame)
         {
            sws_scale(image_conversion_context,
                      (uint8_t const * const *) ipicture->data,
                      ipicture->linesize, 0, istream_codec_context->height,
                      opicture->data, opicture->linesize);

            opicture->pts = av_rescale_q(packet.pts, istream_codec_context->time_base,
                                         ostream->time_base);

            ret = avcodec_encode_video2(ostream_codec_context, &packet,
                                        opicture, &got_packet);
            if (!ret)
            {
               ret = av_write_frame(oformat_context, &packet);
               if (ret < 0)
                  num_frames_written++;
            }
         }
      }
      av_free_packet(&packet);
      av_init_packet(&packet);
    }

    I’m also having issues with my output’s bit-rate. I can try setting it with the rest of my encoder settings, but the bit-rate that FFprobe shows is not the same as what I give the codec context. I tried setting the bit-rate to constant values just to see how it affected my output, and although my output’s bit-rate isn’t the same as what I give it, I found that my input definitely seems to influence the output’s actual bit-rate. I found a post that seems to be dealing with my issue, but the solution listed there does not seem to fix my issue.

    http://ffmpeg.org/pipermail/libav-user/2012-July/002492.html

    Another thing worth mentioning is that my various time bases don’t seem to match up with those of FFmpeg’s output. Notably, my output’s TBC seems to be twice the inverse of my output codec context’s time base. I’m not too sure if this is an issue with the Gif file format, my output codec context’s always seems to be set to 1/100.

    Bit-rate calculation and setting

    int calculated_br = istream_codec_context->time_base.den *    
                       avpicture_get_size(AV_PIX_FMT_YUV420P, ostream_codec_context->width,
                                          ostream_codec_context->height);    

    ostream_codec_context->bit_rate = calculated_br;
    ostream_codec_context->rc_min_rate = calculated_br;
    ostream_codec_context->rc_max_rate = calculated_br;
    ostream_codec_context->rc_buffer_size = calculated_br;

    I’ve got a hunch that all these issues could be related to me not setting my PTS/DTS correctly, even though my output’s pts/dts values match those of FFmpeg’s output.

    I would appreciate some help,
    Thank you !