Recherche avancée

Médias (0)

Mot : - Tags -/utilisateurs

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

Autres articles (56)

  • Websites made ​​with MediaSPIP

    2 mai 2011, par

    This page lists some websites based on MediaSPIP.

  • Possibilité de déploiement en ferme

    12 avril 2011, par

    MediaSPIP peut être installé comme une ferme, avec un seul "noyau" hébergé sur un serveur dédié et utilisé par une multitude de sites différents.
    Cela permet, par exemple : de pouvoir partager les frais de mise en œuvre entre plusieurs projets / individus ; de pouvoir déployer rapidement une multitude de sites uniques ; d’éviter d’avoir à mettre l’ensemble des créations dans un fourre-tout numérique comme c’est le cas pour les grandes plate-formes tout public disséminées sur le (...)

  • Ajouter des informations spécifiques aux utilisateurs et autres modifications de comportement liées aux auteurs

    12 avril 2011, par

    La manière la plus simple d’ajouter des informations aux auteurs est d’installer le plugin Inscription3. Il permet également de modifier certains comportements liés aux utilisateurs (référez-vous à sa documentation pour plus d’informations).
    Il est également possible d’ajouter des champs aux auteurs en installant les plugins champs extras 2 et Interface pour champs extras.

Sur d’autres sites (11395)

  • riscv : Tweak names of cpu flags, print flags in libavutil/tests/cpu

    14 décembre 2023, par Martin Storsjö
    riscv : Tweak names of cpu flags, print flags in libavutil/tests/cpu
    

    The names of the cpu flags, when parsed from a string with
    av_parse_cpu_caps, are parsed by the libavutil eval functions. These
    interpret dashes as subtractions. Therefore, these previous cpu flag
    names haven't been possible to set.

    Use the official names for these extensions, as the previous ad-hoc
    names wasn't parseable.

    libavutil/tests/cpu tests that the cpu flags can be set, and prints
    the detected flags.

    Acked-by : Rémi Denis-Courmont <remi@remlab.net>
    Signed-off-by : Martin Storsjö <martin@martin.st>

    • [DH] libavutil/cpu.c
    • [DH] libavutil/tests/cpu.c
    • [DH] libavutil/version.h
  • For custom FFmpeg I/O API : incorrect data about write_packet Callback function of avio_alloc_context()

    13 avril 2021, par oaho

    I would like to ask a question about ffmpeg custom I/O api.

    &#xA;

    Description of the problem : I used the FFmpeg official example - remuxing.c to test a simple conversion package operation. (test1.ts -> test1.mp4). This operation result is normal.&#xA;But when I use Custom I/O

    &#xA;

    &#xA;

    avio_alloc_context(buf, 65535, 1, nullptr, nullptr, write_cb, seek) ;

    &#xA;

    &#xA;

    function, the custom I/O output is written to the memory, and then the mp4 file is written from this memory. It is found that the output file data is different from Internal file Protocol write. VLC and MediaInfo can't probe it.

    &#xA;

    I Use Beyond Compare4 to compare file data :

    &#xA;

    Beyond Compare 4 Picture Comparasion

    &#xA;

    In this picture, the left is my customized I/O output, and the right is the official example (according to file URLProtocol to Output)

    &#xA;

    I tested it many times, and each time the data size, data location, and data content are all in the same place. When I change the data of the few bytes with the difference on the left to the data on the right, VLC can play normally.

    &#xA;

    Is my operation improper, or is it another problem ?

    &#xA;

    Source Code :

    &#xA;

    extern "C"{&#xA;#include <libavformat></libavformat>avformat.h>&#xA;#include <libavcodec></libavcodec>avcodec.h>&#xA;}&#xA;#include &#xA;#include <cstdio>&#xA;#include &#xA;void process_error(int ret, const char* info)&#xA;{&#xA;   if( ret &lt; 0)&#xA;   {&#xA;      fprintf(stderr, info);&#xA;      std::exit(-1);&#xA;   }&#xA;}&#xA;int fd;&#xA;int write_packet(void *opaque, uint8_t *buf, int buf_size)&#xA; {&#xA;      int ret;&#xA;      ret = write(fd, buf, buf_size);&#xA;      printf("write bytes %d\n", ret);&#xA;      return (ret == -1) ? AVERROR(errno) : ret;&#xA; }&#xA; int64_t seek(void *opaque, int64_t offset, int whence)&#xA; {&#xA;      return offset;&#xA; }&#xA;&#xA; int main()&#xA; {&#xA;&#xA;     fd = open("/home/oaho/Desktop/22.mp4", O_CREAT | O_WRONLY, 0777);&#xA;     if ( fd &lt; 0)&#xA;     {&#xA;        return -1;&#xA;     }&#xA;&#xA;&#xA;     AVFormatContext *inputContext = nullptr;&#xA;     AVFormatContext *ouputContext = nullptr;&#xA;&#xA;     int ret = avformat_open_input(&amp;inputContext, "/home/oaho/Desktop/test1.ts", nullptr, nullptr);&#xA;     process_error(ret, "could&#x27;not open input\n");&#xA;     ret = avformat_find_stream_info(inputContext, nullptr);&#xA;     process_error(ret, "could&#x27;not find stream information\n");&#xA;&#xA;     avformat_alloc_output_context2(&amp;ouputContext, nullptr, "mp4", nullptr);&#xA;     if( ouputContext == nullptr)&#xA;     process_error(-1, "could&#x27;not alloc outputContext\n");&#xA;&#xA;&#xA;     if( ouputContext->oformat==nullptr)&#xA;     {&#xA;        ouputContext->oformat = av_guess_format("mp4", nullptr, nullptr);&#xA;     }&#xA;&#xA;     uint8_t* buf = nullptr;&#xA;     buf = (uint8_t*)av_malloc(200 * 1024);&#xA;     if( buf == nullptr)&#xA;     {&#xA;        return -1;&#xA;     }&#xA;     ouputContext->pb = nullptr;&#xA;     ouputContext->pb = avio_alloc_context(buf, 200 * 1024, 1, nullptr, nullptr, write_packet, seek);&#xA;     if( ouputContext->pb == nullptr)&#xA;     {&#xA;        return -1;&#xA;     }&#xA;     ouputContext->flags = AVFMT_FLAG_CUSTOM_IO;&#xA;     //pre the stream avalible&#xA;     int *arr = new int[inputContext->nb_streams];&#xA;     if( arr == nullptr )&#xA;       process_error(-1, "can&#x27;t alloc array\n");&#xA;     int stream_index = 0;&#xA;     //get stream : video stream , audio stream , subtitle stream&#xA;     for(int i = 0;i &lt; inputContext->nb_streams;i&#x2B;&#x2B;)&#xA;     {&#xA;        //get the single stream&#xA;        AVStream *stream = inputContext->streams[i];&#xA;        AVStream *outStream = nullptr;&#xA;        AVCodecParameters *codec = stream->codecpar;&#xA;        if(   codec -> codec_type != AVMediaType::AVMEDIA_TYPE_VIDEO&#xA;           &amp;&amp; codec -> codec_type != AVMediaType::AVMEDIA_TYPE_AUDIO&#xA;           &amp;&amp; codec -> codec_type != AVMediaType::AVMEDIA_TYPE_SUBTITLE)&#xA;        {&#xA;            arr[i] = -1;&#xA;            continue;&#xA;        }&#xA;        arr[i] = stream_index&#x2B;&#x2B;;&#xA;        outStream = avformat_new_stream(ouputContext, nullptr);&#xA;        if(outStream == nullptr)&#xA;           goto end;&#xA;        int ret = avcodec_parameters_copy(outStream->codecpar, stream->codecpar);&#xA;        if( ret &lt; 0)&#xA;           goto end;&#xA;         //not include additional information&#xA;        outStream->codecpar->codec_tag = 0;&#xA;      }&#xA;      ret = avformat_write_header(ouputContext, nullptr);&#xA;      process_error(ret, "can&#x27;t write header\n");&#xA;&#xA;      while(1)&#xA;      {&#xA;          AVPacket pkt;&#xA;          av_init_packet(&amp;pkt);&#xA;          AVStream *in_stream, *out_stream;&#xA;          ret = av_read_frame(inputContext, &amp;pkt);&#xA;          if( ret &lt; 0)&#xA;             break;  &#xA;          in_stream  = inputContext->streams[pkt.stream_index];&#xA;          if (arr[pkt.stream_index] &lt; 0) {&#xA;             av_packet_unref(&amp;pkt);&#xA;             continue;&#xA;          }&#xA;          pkt.stream_index = arr[pkt.stream_index];&#xA;          out_stream = ouputContext->streams[pkt.stream_index];&#xA;          /* copy packet */&#xA;          pkt.pts = av_rescale_q(pkt.pts, in_stream->time_base, out_stream->time_base);&#xA;          pkt.dts = av_rescale_q(pkt.dts, in_stream->time_base, out_stream->time_base);&#xA;          pkt.duration = av_rescale_q(pkt.duration, in_stream->time_base, out_stream->time_base);&#xA;          pkt.pos = -1;&#xA;          //log_packet(ofmt_ctx, &amp;pkt, "out");&#xA;          ret = av_interleaved_write_frame(ouputContext, &amp;pkt);&#xA;          if (ret &lt; 0) {&#xA;            fprintf(stderr, "Error muxing packet\n");&#xA;            break;&#xA;          }&#xA;          av_packet_unref(&amp;pkt);&#xA;       }&#xA;       av_write_trailer(ouputContext);&#xA;  end:&#xA;       close(fd);&#xA;       delete [] arr;&#xA;       avformat_free_context(inputContext);&#xA;       avformat_free_context(ouputContext);&#xA;       return 0;&#xA; }&#xA;</cstdio>

    &#xA;

  • Exactly what parameters are needed by libva/VAAPI to decode an H.264 video frame ?

    12 juillet 2022, par Synthetix

    I've got a basic Linux app running on supported Intel hardware that uses Intel's libva (VAAPI) to decode H.264 frames from an MP4 file. I have the entire thing working except the part where the frame gets submitted to the GPU/decoder. What's unclear is exactly what information to submit, when, and it what order. I don't see any official documentation on this, either. Here's the point in the code I'm referring to :

    &#xA;

    vaBeginPicture(...)&#xA;vaRenderPicture(...)&#xA;vaEndPicture(...)&#xA;

    &#xA;

    The functions vaBeginPicture and vaEndPicture are self-explanatory, but my issue is with vaRenderPicture. I would expect to need to send the SPS and PPS (out of the AVCC atom in the MP4 file), then each frame, or slice of frames to the decoder via vaRenderPicture(). But this isn't mentioned anywhere other than in code examples I've found online. From some of these examples, I've surmised the following :

    &#xA;

    vaRenderPicture() // call 1/4: VAPictureParameterBufferH264: Send picture params? e.g. frame size and SPS/PPS?&#xA;vaRenderPicture() // call 2/4: VAIQMatrixBufferH264: Send inverse matrix? Where do I get this?&#xA;vaRenderPicture() // call 3/4: VASliceParameterBufferH264: Parameters of the next slice of H.264 picture data?&#xA;vaRenderPicture() // call 4/4: Slice Data? The actual compressed H.264 data from the file?&#xA;

    &#xA;

    I have a very rudimentary understanding of how H.264 data is arranged in an MP4. But the libva documentation, as far as I can tell, does not explain exactly what is needed and in what order to successfully decode a frame. Furthermore, the buffer structures submitted to the decoder have an extensive amount of fields, which implies I need to know a ton of information about the frames before I submit them. In other video APIs I've used, none of this is needed. Why so complex ?

    &#xA;

    Any pointers to documentation on exactly what parameters, data and how to arrange it all before submitting to the VAAPI decoder would be much appreciated.

    &#xA;