Recherche avancée

Médias (2)

Mot : - Tags -/kml

Autres articles (69)

  • Participer à sa traduction

    10 avril 2011

    Vous pouvez nous aider à améliorer les locutions utilisées dans le logiciel ou à traduire celui-ci dans n’importe qu’elle nouvelle langue permettant sa diffusion à de nouvelles communautés linguistiques.
    Pour ce faire, on utilise l’interface de traduction de SPIP où l’ensemble des modules de langue de MediaSPIP sont à disposition. ll vous suffit de vous inscrire sur la liste de discussion des traducteurs pour demander plus d’informations.
    Actuellement MediaSPIP n’est disponible qu’en français et (...)

  • Librairies et logiciels spécifiques aux médias

    10 décembre 2010, par

    Pour un fonctionnement correct et optimal, plusieurs choses sont à prendre en considération.
    Il est important, après avoir installé apache2, mysql et php5, d’installer d’autres logiciels nécessaires dont les installations sont décrites dans les liens afférants. Un ensemble de librairies multimedias (x264, libtheora, libvpx) utilisées pour l’encodage et le décodage des vidéos et sons afin de supporter le plus grand nombre de fichiers possibles. Cf. : ce tutoriel ; FFMpeg avec le maximum de décodeurs et (...)

  • XMP PHP

    13 mai 2011, par

    Dixit Wikipedia, XMP signifie :
    Extensible Metadata Platform ou XMP est un format de métadonnées basé sur XML utilisé dans les applications PDF, de photographie et de graphisme. Il a été lancé par Adobe Systems en avril 2001 en étant intégré à la version 5.0 d’Adobe Acrobat.
    Étant basé sur XML, il gère un ensemble de tags dynamiques pour l’utilisation dans le cadre du Web sémantique.
    XMP permet d’enregistrer sous forme d’un document XML des informations relatives à un fichier : titre, auteur, historique (...)

Sur d’autres sites (9310)

  • php - convert avi to mp4, webm and flv using ffmpeg command

    5 juin 2015, par Aisha

    My problem is I am trying to convert and upload videos into three formats at upload button. I am stuck at the very first step when i am trying to convert avi to mp4, webm and flv. I have tried various commands to convert in to mp4 and webm but nothing worked. its converting to flv smoothly. i searched a lot on internet but none of the commands worked. i have set execution_time to 0 and set_time_limit(0) as well for unlimited execution time. here are the commands i tried to convert in to mp4 and webm

    **For mp4:**

    exec("ffmpeg -i input.avi -c:v libx264 -crf 19 output.mp4");
    exec("ffmpeg -i input.avi -c:v libx264 -pix_fmt yuv420p output.mp4");
    exec("ffmpeg -i input.avi -c:v libx264 -c:a libfaac \ -movflags +faststart output.mp4");

    **For webm**
    passthru("ffmpeg -i input.avi output.webm");
    passthru("ffmpeg -i input.avi -b 1500k -vcodec libvpx -acodec libvorbis -ab 160000 -f webm -g 30 output.webm");

    Note :
    For avi to mp4 files that are less than 1mb are converting successfully but more than 1mb files are showing its converting but its size is 0bytes.

    Similarly, i am facing a problem in converting mp4 to flv. Some files are converting and some are not. Some of the large files are converting but some small files are not converting. It was strange. there was no problem of permission or php configuration settings all was fine. I tried renaming a file which was not converting and it got uploaded. I am confused why this happened.

    Any help for both the issues is highly appreciated.

    Thanks in advance.

    Edited
    /bin$ ffmpeg -v
    ffmpeg version 0.10.15 Copyright (c) 2000-2014 the FFmpeg developers
    built on Aug 30 2014 15:49:19 with gcc 4.4.7 20120313 (Red Hat 4.4.7-3)
    configuration : —prefix=/usr —bindir=/usr/bin —datadir=/usr/share/ffmpeg —incdir=/usr/include/ffmpeg —libdir=/usr/lib64 —mandir=/usr/share/man —arch=x86_64 —extra-cflags=’-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector —param=ssp-buffer-size=4 -m64 -mtune=generic’ —enable-bzlib —disable-crystalhd —enable-gnutls —enable-libass —enable-libcdio —enable-libcelt —enable-libdc1394 —disable-indev=jack —enable-libfreetype —enable-libgsm —enable-libmp3lame —enable-openal —enable-libopenjpeg —enable-libpulse —enable-librtmp —enable-libschroedinger —enable-libspeex —enable-libtheora —enable-libvorbis —enable-libv4l2 —enable-libx264 —enable-libxvid —enable-x11grab —enable-avfilter —enable-postproc —enable-pthreads —disable-static —enable-shared —enable-gpl —disable-debug —disable-stripping —shlibdir=/usr/lib64 —enable-runtime-cpudetect
    libavutil 51. 35.100 / 51. 35.100
    libavcodec 53. 61.100 / 53. 61.100
    libavformat 53. 32.100 / 53. 32.100
    libavdevice 53. 4.100 / 53. 4.100
    libavfilter 2. 61.100 / 2. 61.100
    libswscale 2. 1.100 / 2. 1.100
    libswresample 0. 6.100 / 0. 6.100
    libpostproc 52. 0.100 / 52. 0.100
    Missing argument for option ’v’

  • Make video frames from a livestream identifiable across multiple clients

    23 septembre 2016, par mschwaig

    I need to distribute a video stream from a live source to several clients with the additional requirement that each frame is identifiable across all clients.

    I have already done research into the topic, and I have arrived at a possible solution that I can share. My solution seems suboptimal and this is my first experience of working with video streams, so I want to see if somebody knows a better way.

    The reason why I need to be able to identify specific frames within the video stream is that the streaming clients need to be able to talk about the time differences between events each of them identifies in their video stream.

    A little clarifying example

    I want to enable the following interaction :

    • Two client applications Dewey and Stevie connect to the streaming server
    • Dewey displays the stream and Stevie saves it to disk
    • Dewey identifies a specific video frame that is of interest to Stevie, so he wants to tell Stevie about it
    • Dewey extracts some identifying information from the video frame and sends it to Stevie
    • Stevie uses the identifying information to extract the same frame from the copy of the livestream he is currently saving

    Dewey cannot send the frame to Stevie directly, because Malcolm and Reese also want to tell him about specific video frames and Stevie is interested in the time difference between their findings.

    Suggested solution

    The solution that I found was using ffserver to broadcast a RTP stream and use the timestamps from the RTCP packets to identify frames. These timestamps are normally used to synchronize audio and video, and not to provide a shared timeline across several clients, which is why I am skeptical this is the best way to solve my problem.

    It also seems beneficial to have frame numbers, like an increasing counter of frames instead of arbitrary timestamps which increase by some perhaps varying offset as for my application I also have to reference neighboring frames and it seems easier to compute time differences from frame numbers, than the other way around.

  • Raw H264 + ADTS AAC audio streams muxing results in wrong duration and bitrate using ffmpeg libraries

    17 avril 2015, par Muhammad Ali

    I have an imaging hardware that outputs two streams :

    Video : H264 bitstream
    Audio : ADTS AAC

    I am aware of Input Sources params e-g bitrate , FPS (video), Sampling Rate(audio) etc and I’ve set the params for ffmpeg accordingly.

    My desired output is an FLV container with these two streams .

    At Stage 1, I was able to Mux H264 bitstream into an FLV container which would play just fine in ffplay. No errors reported on console, duration and bitrate calculations were fine too.

    At Stage 2, I tried to mux Audio (ADTS AAC) audio stream with video stream into FLV container. Audio stream required adtstoasc bitstream filter though. But now the duration of the file was wrong and so was the bitrate.

    I should mention that my source of PTS is hardware provided PTS which claims that audio and video streams use the same counter for PTS so Audio video frames should always be considered in order.

    The playback of the resultant file using ffplay stucks on first video frame but audio keeps playing fine. And console complains a lot about "AVC NAL Size (very large number)".

    Any ideas why is the duration / bitrate wrong when I mux the audio along ?

    Here is the muxing code :

    if ((packet.header.dataType == AM_TRANSFER_PACKET_TYPE_H264) || (packet.header.dataType == AM_TRANSFER_PACKET_TYPE_AAC))
         {


           AVCodecContext *cn;

           raw_fd_index = packet.header.streamId << 1;
           //printf("GOT VIDEO FRAME : DATA LEN : %d \n",packet.header.dataLen);
           if(packet.header.dataType == AM_TRANSFER_PACKET_TYPE_H264)
           {  
             //printf("VIDEO STREAM ID %d | PTS : %d | V.SEQ: %d \n\n",packet.header.streamId,packet.header.dataPTS,packet.header.seqNum);
             if(!firstVideoRecvd)
             {
               //still waiting for I Frame
               if(packet.header.frameType == AM_TRANSFER_FRAME_IDR_VIDEO)
               {
                 firstVideoRecvd = 1;
                 audioEnabled = 1;
                 lastvPts = packet.header.dataPTS;
                 printf("\n\n IDR received : AudioEnabled : true  |  MuxingEnabled : true \n");
               }
               else
               {
                 printf("... waiting for IDR frame \n\n ");
                 continue;
               }
             }


           }
           else
           {
             //printf("AUDIO STREAM ID %d | PTS : %d | A.SEQ: %d \n\n",packet.header.streamId + 1,packet.header.dataPTS,packet.header.seqNum);
             if(!firstVideoRecvd)
             {
               printf("\n\n Waiting for a video Frame before we start packing audio... ignoring packet\n");
               continue;
             }
             if(!audioEnabled)
             {  printf("\n\n First Video received but audio still not enabled \n\n");
               continue;
             }

             if(recvFirstAudio)
             {
               recvFirstAudio = 0;
               lastaPts = packet.header.dataPTS;
             }

           }


           //******** FFMPEG SPECIFICS

           //printf("FRAME SIZE : %d \t FRAME TYPE : %d \n",packet.header.dataLen, packet.header.frameType);

           av_init_packet(&pkt);

           //pkt.flags        |= AV_PKT_FLAG_KEY;

           if(packet.header.dataType == AM_TRANSFER_PACKET_TYPE_H264)
             {
               pkt.stream_index  = packet.header.streamId;//0;//ost->st->index;     //stream index 0 for vid : 1 for aud
               outStreamIndex = outputVideoStreamIndex;
               vDuration += (packet.header.dataPTS - lastvPts);
               lastvPts = packet.header.dataPTS;

             }
           else if(packet.header.dataType == AM_TRANSFER_PACKET_TYPE_AAC)
             {
               pkt.stream_index  = packet.header.streamId + 1;//1;//ost->st->index;     //stream index 0 for vid : 1 for aud
               outStreamIndex = outputAudioStreamIndex;
               aDuration += (packet.header.dataPTS - lastaPts);
               lastaPts = packet.header.dataPTS;
             }


           //packet.header.streamId
           pkt.data          = (uint8_t *)packet.data;//raw_data;
           pkt.size          = packet.header.dataLen;

           pkt.pts = pkt.dts= packet.header.dataPTS;
           //pkt.duration = 24000;      //24000 assumed basd on observation

           //duration calculation
           if(packet.header.dataType == AM_TRANSFER_PACKET_TYPE_H264)
             {
               pkt.duration = vDuration;

             }
           else if(packet.header.dataType == AM_TRANSFER_PACKET_TYPE_AAC)
             {
               pkt.duration = aDuration;
             }

           in_stream  = ifmt_ctx->streams[pkt.stream_index];
           out_stream = ofmt_ctx->streams[outStreamIndex];

           cn = out_stream->codec;

           if(packet.header.dataType == AM_TRANSFER_PACKET_TYPE_AAC)
             av_bitstream_filter_filter(aacbsfc, in_stream->codec, NULL, &pkt.data, &pkt.size, pkt.data, pkt.size, 0);

           //if(packet.header.dataType == AM_TRANSFER_PACKET_TYPE_H264)
           // av_bitstream_filter_filter(h264bsfc, in_stream->codec, NULL, &pkt.data, &pkt.size, pkt.data, pkt.size, 0);


            if(packet.header.dataType == AM_TRANSFER_PACKET_TYPE_H264)
            {
              //commented on Tuesday
             av_packet_rescale_ts(&pkt, cn->time_base, out_stream->time_base);

             pkt.pts = av_rescale_q_rnd(pkt.pts, in_stream->time_base, out_stream->time_base, AV_ROUND_NEAR_INF|AV_ROUND_PASS_MINMAX);

             pkt.dts = av_rescale_q_rnd(pkt.dts, in_stream->time_base, out_stream->time_base, AV_ROUND_NEAR_INF|AV_ROUND_PASS_MINMAX);

             //printf("Pkt Duration before scaling: %d \n ",pkt.duration);
             pkt.duration = av_rescale_q(pkt.duration, in_stream->time_base, out_stream->time_base);
             //printf("Pkt Duration after scaling: %d \n ",pkt.duration);
           }

           //enabled on Tuesday
           pkt.pos = -1;

           pkt.stream_index = outStreamIndex;

           //doxygen suggests i use av_write_frame if i am taking care of interleaving
           ret = av_interleaved_write_frame(ofmt_ctx, &pkt);
           //ret = av_write_frame(ofmt_ctx, &pkt);
           if (ret < 0)
            {
                fprintf(stderr, "Error muxing packet\n");
                continue;
            }

          av_free_packet(&pkt);
         }

    Notice that I am not using pkt.flags . I am not sure what I should set it to and would it matter ? I am not doing so when I am muxing just the video into FLV or muxing both audio and video into flv.