Recherche avancée

Médias (91)

Autres articles (81)

  • Le profil des utilisateurs

    12 avril 2011, par

    Chaque utilisateur dispose d’une page de profil lui permettant de modifier ses informations personnelle. Dans le menu de haut de page par défaut, un élément de menu est automatiquement créé à l’initialisation de MediaSPIP, visible uniquement si le visiteur est identifié sur le site.
    L’utilisateur a accès à la modification de profil depuis sa page auteur, un lien dans la navigation "Modifier votre profil" est (...)

  • Configurer la prise en compte des langues

    15 novembre 2010, par

    Accéder à la configuration et ajouter des langues prises en compte
    Afin de configurer la prise en compte de nouvelles langues, il est nécessaire de se rendre dans la partie "Administrer" du site.
    De là, dans le menu de navigation, vous pouvez accéder à une partie "Gestion des langues" permettant d’activer la prise en compte de nouvelles langues.
    Chaque nouvelle langue ajoutée reste désactivable tant qu’aucun objet n’est créé dans cette langue. Dans ce cas, elle devient grisée dans la configuration 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 (13181)

  • PHP - FFMPEG - Unable to apply multiple regular expressions on media output

    9 avril 2012, par Parth G

    I am writing a php script (I have to use php) to cycle through a dir of media files and displaying media information in a chart.

    Right now, I'm trying to do it on 1 file.

    I can successfully do so. I currently can parse the output (using regular expressions) to obtain information such as file name, duration, resolution, etc

    I was told that I can combine the regular expressions to make it more efficient.

    When I do however, I am unable to parse the ffmpeg output correctly.

    Consequently, I've tried copying the output to a string and parsing that using multiple expressions and it works just fine.

    Any help is appreciated.

    Thanks.


    Working code

    $media_info = "'test.mkv': Metadata: creation_time : 2011-03-12 09:04:18 Duration: 00:21:44.10, start: 0.000000, bitrate: 500 kb/s Chapter #0.0: start 0.097000, end 1304.107000 Metadata: title : 00:00:00.097 Stream #0:0: Video: h264 (High), yuv420p, 720x400 [SAR 80:81 DAR 16:9], 23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc (default) Stream #0:1: Audio: aac, 48000 Hz, stereo, s16 (default) At least one output file must be specified";


    $file = array();
    $file_test = preg_match_all("/'([a-zA-Z0-9\._]*\.[a-zA-Z0-9]*)'.* Duration: ([0-9]{2,}:[0-9]{2}:[0-9]{2}\.[0-9]*)/", $media_info, $file);;
    var_dump($file)

    Not Working Code

    ob_start();
    passthru("C:\\wamp\\www\\ffmpeg\\bin\\ffmpeg.exe -i \"{$videofile}\" 2>&1");
    $raw_data = ob_get_contents();
    ob_end_clean();


    $ffmpeg_info =  explode("from", $raw_data);


    $media_info = $ffmpeg_info[1];

    $file = array();
    $file_test = preg_match_all("/'([a-zA-Z0-9\._]*\.[a-zA-Z0-9]*)'.* Duration: ([0-9]{2,}:[0-9]{2}:[0-9]{2}\.[0-9]*)/", $media_info, $file);;
    var_dump($file)

    New Code

    I tried using the ffmpeg-php extension and the following works (except for printing the bit rate)

    $movie = new ffmpeg_movie($video_file);

    echo $movie->getFilename();
    echo "<br />" ;
    echo $movie->getDuration();
    echo "<br />" ;
    echo $movie->getFrameWidth();
    echo "x";
    echo $movie->getFrameHeight();
    echo "<br />" ;
    echo $movie->getBitRate();
    echo "<br />" ;
    echo $movie->getVideoBitRate();
    echo "<br />" ;
    echo $movie->getAudioBitRate();
    echo "<br />" ;
    echo $movie->getVideoCodec();
    echo "<br />" ;
    echo $movie->getAudioCodec();
    ?>
  • muxing into MPEG-TS : wrong parameters for audio stream

    18 janvier 2017, par user1058600

    I am trying to mux video (H.264) and audio (PCM_S16LE, no compression) into an MPEG transport stream using ffmpeg. The video shows fine. The audio stream, however, does not play. The audio stream, shown by ffprobe is AAC, which is obviously not my intention. So I must be doing something wrong in adding the audio stream. Any idea how I can correct this ?

    This is my code for adding an audio stream :

    void add_audio_stream()
    {

       CodecID codec_id = CODEC_ID_PCM_S16LE;

       AVStream *p_ast = av_new_stream(fc, 1);

       if (!p_ast) {
           fprintf(stderr, "Could not alloc audio stream\n");
           exit(1);
       }

       ai = p_ast->index;

       AVCodecContext *pcc = p_ast->codec;
       avcodec_get_context_defaults2( pcc, AVMEDIA_TYPE_AUDIO );

       pcc->codec_type = AVMEDIA_TYPE_AUDIO;
       pcc->codec_id = codec_id;
       pcc->sample_fmt = AV_SAMPLE_FMT_S16;
       //pcc->bit_rate = 44100*16*2;
       pcc->bit_rate = 0;
       pcc->sample_rate = 44100;
       pcc->channels = 2;
       pcc->time_base = (AVRational){1, 44100};


       // some formats want stream headers to be separate
       if (fc->oformat->flags &amp; AVFMT_GLOBALHEADER)
       {
           printf(" **** 1 ****\n");
           pcc->flags |= CODEC_FLAG_GLOBAL_HEADER;
       }
       else
           printf(" **** 2 ****\n");


       AVCodec *codec;

       /* find the audio encoder */
       codec = avcodec_find_encoder(pcc->codec_id);
       if (!codec) {
           fprintf(stderr, "codec not found\n");
           exit(1);
       }


       /* open it */
       if (avcodec_open(pcc, codec) &lt; 0)
       {
           fprintf(stderr, "could not open codec\n");
           exit(1);
       }
    }

    Here is the output of ffprobe :

    ffprobe version N-32405-g6337de9, Copyright (c) 2007-2011 the FFmpeg developers
     built on Sep  8 2011 11:20:12 with gcc 4.4.3
     configuration: --enable-gpl --enable-version3 --enable-nonfree --enable-postproc --enable-libfaac --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --enable-x11grab --enable-libmp3lame
     libavutil    51. 16. 0 / 51. 16. 0
     libavcodec   53. 13. 0 / 53. 13. 0
     libavformat  53. 12. 0 / 53. 12. 0
     libavdevice  53.  3. 0 / 53.  3. 0
     libavfilter   2. 39. 0 /  2. 39. 0
     libswscale    2.  1. 0 /  2.  1. 0
     libpostproc  51.  2. 0 / 51.  2. 0
    [mpegts @ 0xa96daa0] Continuity Check Failed
    [mpegts @ 0xa96daa0] Continuity Check Failed
    [aac @ 0xa974da0] channel element 0.1 is not allocated
    [aac @ 0xa974da0] More than one AAC RDB per ADTS frame is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented.

    .
    .
    lot of gobbly-gook about missing AAC parameters . . .
    .
    .

    [aac @ 0xa974da0] More than one AAC RDB per ADTS frame is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented.
    [aac @ 0xa974da0] Error decoding AAC frame header.
    [mpegts @ 0xa96daa0] max_analyze_duration 5000000 reached at 5429789
    [mpegts @ 0xa96daa0] Continuity Check Failed
    [mpegts @ 0xa96daa0] Continuity Check Failed

    Input #0, mpegts, from 'test_audio_video.mts':
     Duration: 00:00:40.35, start: 0.010000, bitrate: 1907 kb/s
     Program 1
       Metadata:
         service_name    : Service01
         service_provider: FFmpeg
    Stream #0.0[0x100]: Video: h264 (Constrained Baseline) ([27][0][0][0] / 0x001B), yuv420p, 640x480, 30 fps, 30 tbr, 90k tbn, 60 tbc

    Stream #0.1[0x101]: Audio: aac ([6][0][0][0] / 0x0006), 96000 Hz, 4.0, s16, 9 kb/s
  • avutil/common : Don't auto-include mem.h

    25 mars 2024, par Andreas Rheinhardt
    avutil/common : Don't auto-include mem.h
    

    There are lots of files that don't need it : The number of object
    files that actually need it went down from 2011 to 884 here.

    Keep it for external users in order to not cause breakages.

    Also improve the other headers a bit while just at it.

    Signed-off-by : Andreas Rheinhardt <andreas.rheinhardt@outlook.com>

    • [DH] compat/w32dlfcn.h
    • [DH] doc/examples/avio_read_callback.c
    • [DH] doc/examples/decode_filter_audio.c
    • [DH] doc/examples/decode_filter_video.c
    • [DH] doc/examples/hw_decode.c
    • [DH] doc/examples/qsv_transcode.c
    • [DH] doc/examples/remux.c
    • [DH] doc/examples/transcode.c
    • [DH] doc/examples/transcode_aac.c
    • [DH] fftools/cmdutils.c
    • [DH] fftools/ffmpeg.c
    • [DH] fftools/ffmpeg_dec.c
    • [DH] fftools/ffmpeg_demux.c
    • [DH] fftools/ffmpeg_enc.c
    • [DH] fftools/ffmpeg_filter.c
    • [DH] fftools/ffmpeg_hw.c
    • [DH] fftools/ffmpeg_opt.c
    • [DH] fftools/ffplay.c
    • [DH] fftools/ffplay_renderer.c
    • [DH] fftools/ffprobe.c
    • [DH] fftools/fopen_utf8.h
    • [DH] libavcodec/4xm.c
    • [DH] libavcodec/8svx.c
    • [DH] libavcodec/a64multienc.c
    • [DH] libavcodec/aacdec.c
    • [DH] libavcodec/aacdec_template.c
    • [DH] libavcodec/aacenc.c
    • [DH] libavcodec/aacpsy.c
    • [DH] libavcodec/ac3_parser.c
    • [DH] libavcodec/ac3dec.c
    • [DH] libavcodec/ac3enc.c
    • [DH] libavcodec/ac3enc_fixed.c
    • [DH] libavcodec/ac3enc_float.c
    • [DH] libavcodec/ac3enc_template.c
    • [DH] libavcodec/adpcmenc.c
    • [DH] libavcodec/adts_parser.c
    • [DH] libavcodec/agm.c
    • [DH] libavcodec/aic.c
    • [DH] libavcodec/alac.c
    • [DH] libavcodec/alacenc.c
    • [DH] libavcodec/alsdec.c
    • [DH] libavcodec/amfenc_av1.c
    • [DH] libavcodec/amfenc_h264.c
    • [DH] libavcodec/amfenc_hevc.c
    • [DH] libavcodec/apac.c
    • [DH] libavcodec/apedec.c
    • [DH] libavcodec/ass.c
    • [DH] libavcodec/atrac1.c
    • [DH] libavcodec/atrac3.c
    • [DH] libavcodec/atrac3plusdec.c
    • [DH] libavcodec/atrac9dec.c
    • [DH] libavcodec/atsc_a53.c
    • [DH] libavcodec/audio_frame_queue.c
    • [DH] libavcodec/audiotoolboxdec.c
    • [DH] libavcodec/audiotoolboxenc.c
    • [DH] libavcodec/av1dec.c
    • [DH] libavcodec/avdct.c
    • [DH] libavcodec/avuienc.c
    • [DH] libavcodec/bfi.c
    • [DH] libavcodec/bgmc.c
    • [DH] libavcodec/bink.c
    • [DH] libavcodec/bonk.c
    • [DH] libavcodec/bsf/dts2pts.c
    • [DH] libavcodec/bsf/evc_frame_merge.c
    • [DH] libavcodec/bsf/extract_extradata.c
    • [DH] libavcodec/bsf/filter_units.c
    • [DH] libavcodec/bsf/h264_metadata.c
    • [DH] libavcodec/bsf/noise.c
    • [DH] libavcodec/cavs.c
    • [DH] libavcodec/cavsdec.c
    • [DH] libavcodec/cbs.c
    • [DH] libavcodec/cbs_h2645.c
    • [DH] libavcodec/cbs_jpeg.c
    • [DH] libavcodec/cbs_sei.c
    • [DH] libavcodec/cdtoons.c
    • [DH] libavcodec/cdxl.c
    • [DH] libavcodec/cfhd.c
    • [DH] libavcodec/cfhdenc.c
    • [DH] libavcodec/cinepakenc.c
    • [DH] libavcodec/clearvideo.c
    • [DH] libavcodec/cllc.c
    • [DH] libavcodec/cngdec.c
    • [DH] libavcodec/cngenc.c
    • [DH] libavcodec/cook.c
    • [DH] libavcodec/cscd.c
    • [DH] libavcodec/cuviddec.c
    • [DH] libavcodec/d3d12va_av1.c
    • [DH] libavcodec/d3d12va_decode.c
    • [DH] libavcodec/dca_core.c
    • [DH] libavcodec/dca_lbr.c
    • [DH] libavcodec/dca_xll.c
    • [DH] libavcodec/dcaadpcm.c
    • [DH] libavcodec/dcadec.c
    • [DH] libavcodec/dcaenc.c
    • [DH] libavcodec/decode.c
    • [DH] libavcodec/dirac.c
    • [DH] libavcodec/diracdec.c
    • [DH] libavcodec/dnxhddec.c
    • [DH] libavcodec/dnxhdenc.c
    • [DH] libavcodec/dovi_rpu.c
    • [DH] libavcodec/dsddec.c
    • [DH] libavcodec/dsicinvideo.c
    • [DH] libavcodec/dvbsubdec.c
    • [DH] libavcodec/dvdsubdec.c
    • [DH] libavcodec/dvdsubenc.c
    • [DH] libavcodec/dxa.c
    • [DH] libavcodec/dxv.c
    • [DH] libavcodec/dxva2.c
    • [DH] libavcodec/dxva2_av1.c
    • [DH] libavcodec/dxvenc.c
    • [DH] libavcodec/eamad.c
    • [DH] libavcodec/eatqi.c
    • [DH] libavcodec/elbg.c
    • [DH] libavcodec/encode.c
    • [DH] libavcodec/error_resilience.c
    • [DH] libavcodec/escape124.c
    • [DH] libavcodec/evc_ps.c
    • [DH] libavcodec/exr.c
    • [DH] libavcodec/exrenc.c
    • [DH] libavcodec/fastaudio.c
    • [DH] libavcodec/faxcompr.c
    • [DH] libavcodec/ffv1.c
    • [DH] libavcodec/ffv1dec.c
    • [DH] libavcodec/ffv1enc.c
    • [DH] libavcodec/ffwavesynth.c
    • [DH] libavcodec/fic.c
    • [DH] libavcodec/flac_parser.c
    • [DH] libavcodec/flacdec.c
    • [DH] libavcodec/flacenc.c
    • [DH] libavcodec/flashsv.c
    • [DH] libavcodec/flashsv2enc.c
    • [DH] libavcodec/fmvc.c
    • [DH] libavcodec/frame_thread_encoder.c
    • [DH] libavcodec/fraps.c
    • [DH] libavcodec/g2meet.c
    • [