Recherche avancée

Médias (39)

Mot : - Tags -/audio

Autres articles (69)

  • Gestion générale des documents

    13 mai 2011, par

    MédiaSPIP ne modifie jamais le document original mis en ligne.
    Pour chaque document mis en ligne il effectue deux opérations successives : la création d’une version supplémentaire qui peut être facilement consultée en ligne tout en laissant l’original téléchargeable dans le cas où le document original ne peut être lu dans un navigateur Internet ; la récupération des métadonnées du document original pour illustrer textuellement le fichier ;
    Les tableaux ci-dessous expliquent ce que peut faire MédiaSPIP (...)

  • Use, discuss, criticize

    13 avril 2011, par

    Talk to people directly involved in MediaSPIP’s development, or to people around you who could use MediaSPIP to share, enhance or develop their creative projects.
    The bigger the community, the more MediaSPIP’s potential will be explored and the faster the software will evolve.
    A discussion list is available for all exchanges between users.

  • MediaSPIP Player : les contrôles

    26 mai 2010, par

    Les contrôles à la souris du lecteur
    En plus des actions au click sur les boutons visibles de l’interface du lecteur, il est également possible d’effectuer d’autres actions grâce à la souris : Click : en cliquant sur la vidéo ou sur le logo du son, celui ci se mettra en lecture ou en pause en fonction de son état actuel ; Molette (roulement) : en plaçant la souris sur l’espace utilisé par le média (hover), la molette de la souris n’exerce plus l’effet habituel de scroll de la page, mais diminue ou (...)

Sur d’autres sites (10579)

  • 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 :

    


    vaBeginPicture(...)
vaRenderPicture(...)
vaEndPicture(...)


    


    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 :

    


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


    


    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 ?

    


    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.

    


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

    


    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.
But when I use Custom I/O

    


    


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

    


    


    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.

    


    I Use Beyond Compare4 to compare file data :

    


    Beyond Compare 4 Picture Comparasion

    


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

    


    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.

    


    Is my operation improper, or is it another problem ?

    


    Source Code :

    


    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;

  • 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