Recherche avancée

Médias (1)

Mot : - Tags -/publier

Autres articles (98)

  • MediaSPIP 0.1 Beta version

    25 avril 2011, par

    MediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
    The zip file provided here only contains the sources of MediaSPIP in its standalone version.
    To get a working installation, you must manually install all-software dependencies on the server.
    If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...)

  • Multilang : améliorer l’interface pour les blocs multilingues

    18 février 2011, par

    Multilang est un plugin supplémentaire qui n’est pas activé par défaut lors de l’initialisation de MediaSPIP.
    Après son activation, une préconfiguration est mise en place automatiquement par MediaSPIP init permettant à la nouvelle fonctionnalité d’être automatiquement opérationnelle. Il n’est donc pas obligatoire de passer par une étape de configuration pour cela.

  • Personnaliser en ajoutant son logo, sa bannière ou son image de fond

    5 septembre 2013, par

    Certains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;

Sur d’autres sites (10498)

  • Java Xuggler Metadata List of Chapters MP4/M4V Video

    27 juin 2017, par MrSax

    I’m trying to use Xuggler like FFMPEG Metadata Wrapper (I just need the list of Chapters of MP4/M4V Video).

    So far I have not been able to find a solution.
    Can anyone help me ?

    I was only able to get the following information :

       final String filename = "...path...";
       IContainer container = IContainer.make();
       int result = container.open(filename, IContainer.Type.READ, null);
       if (result < 0)
           throw new RuntimeException("Failed to open media file");
       int numStreams = container.getNumStreams();
       long duration = container.getDuration();
       long fileSize = container.getFileSize();
       long bitRate = container.getBitRate();
       System.out.println("Number of streams: " + numStreams);
       System.out.println("Duration (ms): " + duration);
       System.out.println("File Size (bytes): " + fileSize);
       System.out.println("Bit Rate: " + bitRate);
       for (int i = 0; i < numStreams; i++) {
           IStream stream = container.getStream(i);
           IStreamCoder coder = stream.getStreamCoder();
           System.out.println("*** Start of Stream Info ***");
           System.out.printf("stream %d: ", i);
           System.out.printf("type: %s; ", coder.getCodecType());
           System.out.printf("codec: %s; ", coder.getCodecID());
           System.out.printf("duration: %s; ", stream.getDuration());
           System.out.printf("start time: %s; ", container.getStartTime());
           System.out.printf("timebase: %d/%d; ", stream.getTimeBase().getNumerator(),
                   stream.getTimeBase().getDenominator());
           System.out.printf("coder tb: %d/%d; ", coder.getTimeBase().getNumerator(),
                   coder.getTimeBase().getDenominator());
           System.out.println();
           if (coder.getCodecType() == ICodec.Type.CODEC_TYPE_AUDIO) {
               System.out.printf("sample rate: %d; ", coder.getSampleRate());
               System.out.printf("channels: %d; ", coder.getChannels());
               System.out.printf("format: %s", coder.getSampleFormat());
           } else if (coder.getCodecType() == ICodec.Type.CODEC_TYPE_VIDEO) {
               System.out.printf("width: %d; ", coder.getWidth());
               System.out.printf("height: %d; ", coder.getHeight());
               System.out.printf("format: %s; ", coder.getPixelType());
               System.out.printf("frame-rate: %5.2f; ", coder.getFrameRate().getDouble());
           }
           System.out.println();
           System.out.println("*** End of Stream Info ***");

    UPDATE 07.06.2017
    I just tried it with VLCJ, but still I can not get the list of chapters.

       File file = new File("ia_ISL_13_r720P.m4v");

       NativeLibrary.addSearchPath(RuntimeUtil.getLibVlcLibraryName(), "vlc64/");
       Native.loadLibrary(RuntimeUtil.getLibVlcLibraryName(), LibVlc.class);

       MediaPlayerFactory mpf = new MediaPlayerFactory();
       EmbeddedMediaPlayer emp = mpf.newEmbeddedMediaPlayer();

       MediaMeta mediaMeta = mpf.getMediaMeta(file.getAbsolutePath(), true);
       MediaMetaData asMediaMetaData = mediaMeta.asMediaMetaData();
       System.out.println(asMediaMetaData.getAlbum());
       System.out.println(asMediaMetaData.getArtist());
       System.out.println(asMediaMetaData.getTitle());

       emp.prepareMedia(file.getAbsolutePath());
       emp.play();
       emp.nextChapter(); // -> GO NEXT CHAPTER - SUCCESS

       List> allChapterDescriptions = emp.getAllChapterDescriptions();

       for (List<string> list : allChapterDescriptions) {
           for (String string : list) {
               System.out.println(string);
           }
       }
    </string>
  • vf_format : rework format list parsing

    24 mai 2014, par Anton Khirnov
    vf_format : rework format list parsing
    

    Avoid using AV_PIX_FMT_NB, since that hardcodes the number of pixel
    formats into lavfi and will break when a shared lavu is updated, adding
    new pixel formats.

    • [DH] libavfilter/vf_format.c
  • libav C++ sw_scale returns variable byte size of BGR24 buffer

    6 mars 2021, par igor

    I'm trying to convert my local /dev/video0 cam to BGR24 format. It works if I resize the image (although not 100% of the time, more like 85% of the time), but I'd like to keep the same size as input video.

    &#xA;

    I initialize BGR image like so including the sws context :

    &#xA;

    AVPixelFormat outputPixFormat = AV_PIX_FMT_BGR24;&#xA;&#xA;    AVFrame* pFrameBGR = av_frame_alloc();&#xA;    pFrameBGR->width = decoder->video_codec_context->width;&#xA;    pFrameBGR->height = decoder->video_codec_context->height;&#xA;    pFrameBGR->format = outputPixFormat;&#xA;&#xA;    int alloRet = av_image_alloc(pFrameBGR->data, pFrameBGR->linesize, decoder->video_codec_context->width, decoder->video_codec_context->height, outputPixFormat, 1);&#xA;    if (alloRet &lt; 0) {&#xA;        logging("failed to allocate image");&#xA;        return -1;&#xA;    }&#xA;&#xA;    struct SwsContext *sws_ctx = NULL;&#xA;&#xA;    sws_ctx = sws_getContext(decoder->video_codec_context->width,&#xA;    decoder->video_codec_context->height,&#xA;    decoder->video_codec_context->pix_fmt,&#xA;    decoder->video_codec_context->width,&#xA;    decoder->video_codec_context->height,&#xA;    outputPixFormat,&#xA;    SWS_DIRECT_BGR,&#xA;    0,&#xA;    0,&#xA;    0&#xA;    );&#xA;

    &#xA;

    This is the portion of my decoding loop :

    &#xA;

    int response = avcodec_send_packet(pCodecContext, pPacket);&#xA;    if (response &lt; 0) {&#xA;        logging("Error while sending a packet to decoder: %s", av_err2str(response));&#xA;        return response;&#xA;    }&#xA;&#xA;    while (response >= 0) {&#xA;        response = avcodec_receive_frame(pCodecContext, pFrame);&#xA;         if (response == AVERROR(EAGAIN) || response == AVERROR_EOF) {&#xA;            break;&#xA;        } else if (response &lt; 0) {&#xA;            logging("Error while receiving a frame from the decoder: %s", av_err2str(response));&#xA;            return response;&#xA;        }&#xA;        if (response >= 0) {&#xA;&#xA;            sws_scale(sws_ctx,  (uint8_t const * const *)pFrame->data, pFrame->linesize, 0, pCodecContext->height, pFrameBGR->data, pFrameBGR->linesize);&#xA;&#xA;

    &#xA;

    THe question is how to copy the plane of AVFrame into a buffer :

    &#xA;

      size_t rgb_size = av_image_get_buffer_size(AV_PIX_FMT_BGR24, bgrFrame->width, bgrFrame->height, 1);&#xA;&#xA;    uint8_t *dst_data;&#xA;    dst_data = (uint8_t *)(av_malloc(rgb_size));&#xA;&#xA;    av_image_copy_to_buffer(dst_data, rgb_size, (const uint8_t* const *)bgrFrame->data, bgrFrame->linesize, AV_PIX_FMT_BGR24, bgrFrame->width, bgrFrame->height, 1);&#xA;&#xA;

    &#xA;

    If I try to save to file the BGR image is correctly copied :

    &#xA;

    char filebuf[256];&#xA;snprintf(filebuf, sizeof filebuf, "%s%d%s", "out_", pPacket->dts, ".rgb");&#xA;std::FILE *output=fopen(filebuf,"wb&#x2B;");  &#xA;&#xA;fwrite(bgrFrame->data[0],(pFrame->width)*(pFrame->height)*3,1,output);  &#xA;std::fclose(output);&#xA;

    &#xA;

    So it looks like my copy to buffer function is faulty, but I can figure out what's wrong with it :

    &#xA;

      uint8_t *dst_data;&#xA;    dst_data = (uint8_t *)(av_malloc(rgb_size));&#xA;&#xA;    av_image_copy_to_buffer(dst_data, rgb_size, (const uint8_t* const *)bgrFrame->data, bgrFrame->linesize, AV_PIX_FMT_BGR24, bgrFrame->width, bgrFrame->height, 1);&#xA;

    &#xA;