Recherche avancée

Médias (3)

Mot : - Tags -/spip

Autres articles (40)

  • La file d’attente de SPIPmotion

    28 novembre 2010, par

    Une file d’attente stockée dans la base de donnée
    Lors de son installation, SPIPmotion crée une nouvelle table dans la base de donnée intitulée spip_spipmotion_attentes.
    Cette nouvelle table est constituée des champs suivants : id_spipmotion_attente, l’identifiant numérique unique de la tâche à traiter ; id_document, l’identifiant numérique du document original à encoder ; id_objet l’identifiant unique de l’objet auquel le document encodé devra être attaché automatiquement ; objet, le type d’objet auquel (...)

  • Publier sur MédiaSpip

    13 juin 2013

    Puis-je poster des contenus à partir d’une tablette Ipad ?
    Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir

  • Contribute to documentation

    13 avril 2011

    Documentation is vital to the development of improved technical capabilities.
    MediaSPIP welcomes documentation by users as well as developers - including : critique of existing features and functions articles contributed by developers, administrators, content producers and editors screenshots to illustrate the above translations of existing documentation into other languages
    To contribute, register to the project users’ mailing (...)

Sur d’autres sites (7420)

  • Using libavcodec to read .mkv video file

    10 mars 2020, par Slav

    Trying to read .mkv file and write it to .bmp, but resulting .bmp is black-and-white and consists of multiple mini-images of what supposed to be written :

    int main()
    {
       av_register_all();
       avformat_network_init();
       avfilter_register_all();

       //crashes on -Ofast without =NULL initialization:
       AVFormatContext * format = NULL;
       if ( avformat_open_input( & format, VIDEO_FILE, NULL, NULL ) != 0 ) {
           cerr << "Could not open file " << VIDEO_FILE << endl;
           return -1;
       }

       // Retrieve stream information
       if ( avformat_find_stream_info( format, NULL ) < 0) {
           cerr << "avformat_find_stream_info() failed." << endl;
           return -1;
       }
       av_dump_format( format, 0, VIDEO_FILE, false );

       AVCodec * video_dec = (AVCodec*)1;
       AVCodec * audio_dec = (AVCodec*)1;
       const auto video_stream_index = av_find_best_stream( format, AVMEDIA_TYPE_VIDEO, -1, -1, & video_dec, 0 );
       const auto audio_stream_index = av_find_best_stream( format, AVMEDIA_TYPE_AUDIO, -1, -1, & audio_dec, 0 );
       if ( video_stream_index < 0 ) {
           cerr << "Failed to find video stream." << endl;
           return -1;
       }
       if ( audio_stream_index < 0 ) {
           cerr << "Failed to find audio stream." << endl;
           return -1;
       }

       AVCodecParameters * videoParams = format->streams[ video_stream_index ]->codecpar;
       cout << "Having " << videoParams->width << " | " << videoParams->height << " video." << endl;

       av_read_play( format );

       // create decoding context
       AVCodecContext * video_ctx = avcodec_alloc_context3( video_dec );
       AVCodecContext * audio_ctx = avcodec_alloc_context3( audio_dec );
       if ( ! video_ctx || ! audio_ctx ) {
           cerr << "Failed to avcodec_alloc_context3()" << endl;
           return -1;
       }
       if ( video_dec->capabilities & AV_CODEC_CAP_TRUNCATED ) video_ctx->flags |= AV_CODEC_FLAG_TRUNCATED; // we do not send complete frames

       /* For some codecs, such as msmpeg4 and mpeg4, width and height
          MUST be initialized there because this information is not
          available in the bitstream. */

       avcodec_parameters_to_context( video_ctx, format->streams[ video_stream_index ]->codecpar );
       avcodec_parameters_to_context( audio_ctx, format->streams[ audio_stream_index ]->codecpar );
       if ( avcodec_open2( video_ctx, video_dec, NULL ) < 0 ) {
           cout << "Failed to open video decoder." << endl;
           return -1;
       }
       if ( avcodec_open2( audio_ctx, audio_dec, NULL ) < 0 ) {
           cout << "Failed to open audio decoder." << endl;
           return -1;
       }

       uint8_t* picture_buffer = (uint8_t*) (av_malloc( avpicture_get_size( AV_PIX_FMT_RGB24 , videoParams->width, videoParams->height ) ));
       AVFrame* picture = av_frame_alloc();
       avpicture_fill( (AVPicture *) picture, picture_buffer, AV_PIX_FMT_RGB24, video_ctx->width, video_ctx->height );

       AVPacket packet;
       av_init_packet( & packet );

       int cnt = 0;
       while ( av_read_frame( format, & packet ) >= 0 && cnt < 10 ) {
           if ( packet.stream_index == video_stream_index ) {
               int check;
               const auto result = avcodec_decode_video2( video_ctx, picture, & check, & packet );
               cout << "Bytes decoded " << result << " check " << check << endl;

               std::string name = "debug/av/";
               name += std::to_string( cnt ) + ".bmp";
               cout << "Writing frame " << name << " with linesize " << picture->linesize[0] << " ..." << endl;
               write_bmp( (uint8_t*) picture->data, videoParams->width, videoParams->height, name.c_str() );

               av_frame_unref( picture );

               ++ cnt;
           }
           else if ( packet.stream_index == audio_stream_index ) {
               cout << "Sound packet" << endl;
           }
           av_free_packet( & packet );
           av_init_packet( & packet );
       }
    }

    How can I fix it ?

  • Anomalie #4495 (Nouveau) : migration 3.2.7 vers 3.3.0

    24 mai 2020, par josiane aletto

    test 1-
    j’ai installée en local un site qui était en SPIP 3.2.7 [24473] pour le migrer en SPIP 3.3.0-dev [24578].
    fichier mesoptions.php avec

    1. <span class="CodeRay"><span class="predefined">define</span>(<span class="string"><span class="delimiter">'</span><span class="content">_IMG_MAX_HEIGHT</span><span class="delimiter">'</span></span>,<span class="integer">1200</span>); <span class="comment">// largeur en pixels</span>
    2. <span class="predefined">define</span>(<span class="string"><span class="delimiter">'</span><span class="content">_IMG_MAX_WIDTH</span><span class="delimiter">'</span></span>, <span class="integer">1024</span>);  <span class="comment">// hauteur en pixels</span>
    3. <span class="predefined">define</span>(<span class="string"><span class="delimiter">'</span><span class="content">_IMG_MAX_SIZE</span><span class="delimiter">'</span></span>,  <span class="integer">650</span>);   <span class="comment">// taille en kilo-octets</span>
    4. </span>

    Télécharger


    Des logos de taille superieure a _IMG_MAX_SIZE’, 650 ne sont plus dans IMG Pas non plus dans logo_erreur non plus.
    par exemple rubon3 : 1630 × 648 pixels
    Plugins :
    Adaptive Images 1.9.2 -
    Agenda 3.26.0 -
    API de vérification 1.8.1 - stable
    Centre image 0.10.4 - dev
    Couleur de rubrique 2.3.8
    Facteur 3.6.2 - stable
    Formidable 3.34.3 - stable
    Insérer Modèles 1.3.3 - stable
    Massicot 0.8.1 -
    Mini Calendrier 2.4.1 - stable
    oEmbed 2.0.10 - stable
    Owl Carousel 1.0.18
    Carousel responsive avec support du multi-touch.
    Palette 4.0.7
    pdf.js 0.6.3
    Picto mod avec FontAwesome 2.1.0
    Saisies pour formulaires 3.11.1
    SPIP Bonux 3.4.6
    YAML 2.0.10
    test2
    Pour mieux voir J’ai recommencé installation /migration en désinstallant le plugin massicot et en le supprimant du repertoire plugin et en mettant dans mes_options.php
    define(’_IMG_MAX_HEIGHT’,800) ; // largeur en pixels
    define(’_IMG_MAX_WIDTH’, 500) ; // hauteur en pixels
    define(’_IMG_MAX_SIZE’, 400) ; // taille en kilo-octets

    je constate ; que les logos de taille >400Ko sont présent mais retaillé, rubon3 qui avait 1630 × 648 pixels a maintenant à 500 × 199 pixels 221 ko dans logo/IMG alors qu’il n’ y a pas massicot.
    si je supprime ce rubon3 par logo de la rubrique et télécharge l’image originale j’obtiens une image retaillé avec du noir en plus. mais si je clique dessus l’image est retaillée mais ok et elle est bien en 500*199 dans IMG sans le noir.

    • les images migrées ont bien gardées leurs dimensions*.

    test3
    je telecharge le logo rubon3 de 1630 × 648 pixels comme un document d’un article —> il est enregistré directement en 500 × 199 pixels 221 ko . Ce mécanisme a changé, en mieux, car dans la version 3.2 j’avais un message "Les images doivent obligatoirement faire moins de 650 ko (ce fichier fait 847.5 ko)".

  • FFMPEG stereo track stops capturing at random times during a capture session

    26 mai 2022, par mrwassen

    I am currently working on building a workflow to capture and archive a large stash of family and friends PAL and NTSC VHS tapes. The hardware setup is as follows :

    &#xA;

      &#xA;
    • JVC HR-7860S VCR
    • &#xA;

    • s-video / RCA audio >
    • &#xA;

    • ADVC-3000 converter
    • &#xA;

    • SDI / BNC cable >
    • &#xA;

    • Blackmagic Decklink Mini Recorder 4K PCIe card
    • &#xA;

    • installed in a fairly hi-spec windows machine : AMD Ryzen 9 5900X 3.7 Ghz base 12 core, GEFORCE RTX 3060 12 gB, 32 gB ram
    • &#xA;

    &#xA;

    The plan is to capture to lossless AVI, then drop into an NLE (Vegas Pro v.16) to do a minimal amount of cleanup / trimming, then render to a more compressed video format (TBD) for upload to AWS S3 accessible through a family website.

    &#xA;

    The issue I am having is that when I run the capture using ffmpeg/directshow e.g. for a perfectly fine 90 min. PAL tape, at some random point of time during the capture one of the 2 stereo channels just stops capturing. This has happened with all of the tapes I have tested so far, and it happens at different times during the same video. I have examined the frames surrounding points in time when this happens, and it doesn't correlate to any transitions or jitter, but often just randomly in the middle of a perfectly smooth scene. Once the one channel stops capturing it never starts back up again during that capture session.

    &#xA;

    The ADVC-3000 and the VCR are both showing both stereo channels playing normally throughout the capture. The windows machine running the capture hardly breaks a sweat at any time, and the transfer easily keeps up constantly showing a speed = 1x which I assume means nothing lagging. Also there are no video/audio sync issues at any point in time even towards the end of long tapes e.g. 90 mins.

    &#xA;

    I am fairly new at ffmpeg, so I have spent extensive amounts of time reading up on forum posts and experimenting and have ended up with the following syntax :

    &#xA;

    ffmpeg -y -f dshow -rtbufsize 2000M -i video="Blackmagic WDM Capture":audio="Blackmagic WDM Capture" -codec:v v210 -pix_fmt yuv422p -codec:a pcm_s16le -b:a 128k -t 02:00:00 -r 25 -threads 4 -maxrate 2500k -filter:a "volume=1.5" output_v210_audio.avi&#xA;

    &#xA;

    The capture runs without a single dropped frame, the only error I am getting when launching (and perhaps this is a smoking gun ?) is :

    &#xA;

    &#xA;

    "Non-monotonous DTS in output stream 0:1 ; previous : 0, current : -30 ;&#xA;changing to 1. This may result in incorrect timestamps in the output&#xA;file."

    &#xA;

    &#xA;

    I have tried to troubleshoot this in the hopes that it is tied to my issue but so far without luck.

    &#xA;

    Hoping somebody can help correct or modify my command line or perhaps other ideas to help resolve the issue.

    &#xA;