Recherche avancée

Médias (91)

Autres articles (29)

  • Demande de création d’un canal

    12 mars 2010, par

    En fonction de la configuration de la plateforme, l’utilisateur peu avoir à sa disposition deux méthodes différentes de demande de création de canal. La première est au moment de son inscription, la seconde, après son inscription en remplissant un formulaire de demande.
    Les deux manières demandent les mêmes choses fonctionnent à peu près de la même manière, le futur utilisateur doit remplir une série de champ de formulaire permettant tout d’abord aux administrateurs d’avoir des informations quant à (...)

  • Gestion de la ferme

    2 mars 2010, par

    La ferme est gérée dans son ensemble par des "super admins".
    Certains réglages peuvent être fais afin de réguler les besoins des différents canaux.
    Dans un premier temps il utilise le plugin "Gestion de mutualisation"

  • MediaSPIP Core : La Configuration

    9 novembre 2010, par

    MediaSPIP Core fournit par défaut trois pages différentes de configuration (ces pages utilisent le plugin de configuration CFG pour fonctionner) : une page spécifique à la configuration générale du squelettes ; une page spécifique à la configuration de la page d’accueil du site ; une page spécifique à la configuration des secteurs ;
    Il fournit également une page supplémentaire qui n’apparait que lorsque certains plugins sont activés permettant de contrôler l’affichage et les fonctionnalités spécifiques (...)

Sur d’autres sites (4594)

  • configure : Fix Barcelona and Bulldozer compiler options with suncc

    19 janvier 2013, par James Almer

    configure : Fix Barcelona and Bulldozer compiler options with suncc

  • Windows 2003 using php popen "start /b" because of executing ffmpeg.exe

    1er juillet 2013, par Oh Seung Kwon

    I have some problem.

    There is a php code that convert audio(wav) to mp3 file with using ffmpeg.exe.

    Here is some code.

    $cmd = "./inc/ffmpeg.exe -i ".$file_name." -acodec mp3 -y -ac 1 -ab 96k ".$mp3_file_name;

    echo $cmd;
    echo "Windows";
    $handle = popen("start /B ".$cmd, "r");
    while(!feof($handle)) {
       $read = fread($handle, 2096);
       echo $read;
    }
    pclose($handle);

    Problem is when I execute this code, ffmpeg.exe process isn't terminated. And not gonna die when I stop process with using Windows task manager.

    Do you have a solution for this situation ?

  • FFMPEG passthrough recording RTSP/H264 to MP4 container bad encoding

    16 janvier 2019, par Cédric Verstraeten

    Hello I’m using the ffmpeg 3.4.2 to record a RTSP h264 steam from an IP camera. I have a working example however at the beginning I see some corrupted images, after a couple of seconds the video is shown properly. I was wondering if this is a timing issue.

    enter image description here

    The source code which illustrates opening and reading a RTSP stream, and writing it into an MP4 container.

    #include
    #include
    #include
    #include <iostream>
    #include <fstream>
    #include <sstream>
    #include <sys></sys>time.h>

    extern "C" {
     #include <libavcodec></libavcodec>avcodec.h>
     #include <libavutil></libavutil>opt.h>
     #include <libavutil></libavutil>imgutils.h>
     #include <libavformat></libavformat>avformat.h>
     #include <libavformat></libavformat>avio.h>
     #include <libswscale></libswscale>swscale.h>
    }

    time_t get_time()
    {
     struct timeval tv;

     gettimeofday( &amp;tv, NULL );

     return tv.tv_sec;
    }

    int main(int argc, char **argv)
    {
       const char *filename, *codec_name;
       const AVCodec *codec;
       AVCodecContext *c= NULL;
       int i, ret, x, y;


       // Open the initial context variables that are needed
       AVFormatContext* format_ctx = avformat_alloc_context();
       int video_stream_index;

       // Register everything
       av_register_all();
       avformat_network_init();

       //open RTSP

       AVDictionary *ifmtdict;
       av_dict_set(&amp;ifmtdict, "rtsp_transport", "tcp", 0);

       if (avformat_open_input(&amp;format_ctx, "rtsp://192.168.0.84/user=admin_password=_channel=1_stream=0.sdp",
               NULL, &amp;ifmtdict) != 0) {
           return EXIT_FAILURE;
       }

       if (avformat_find_stream_info(format_ctx, NULL) &lt; 0) {
           return EXIT_FAILURE;
       }

       //search video stream
       for (int i = 0; i &lt; format_ctx->nb_streams; i++) {
           if (format_ctx->streams[i]->codec->codec_type == AVMEDIA_TYPE_VIDEO)
               video_stream_index = i;
       }

       AVPacket packet;
       av_init_packet(&amp;packet);

       AVStream* stream = NULL;
       int cnt = 0;

       //start reading packets from stream and write them to file
       av_read_play(format_ctx);    //play RTSP

       // Get the codec
       codec = avcodec_find_decoder(AV_CODEC_ID_H264);
       if (!codec) {
           exit(1);
       }

       // Prepare the output
       AVFormatContext* oc = avformat_alloc_context();
       oc->oformat = av_guess_format(NULL, "video.mp4", NULL);
       avio_open2(&amp;oc->pb, "video.mp4", AVIO_FLAG_WRITE, NULL, NULL);

       // Write header
       stream = avformat_new_stream(oc, (AVCodec*) format_ctx->streams[video_stream_index]->codec->codec);
       avcodec_parameters_copy(stream->codecpar, format_ctx->streams[video_stream_index]->codecpar);
       stream->sample_aspect_ratio = format_ctx->streams[video_stream_index]->codec->sample_aspect_ratio;
       stream->codecpar->codec_tag  = 0;
       stream->time_base = format_ctx->streams[video_stream_index]->time_base;
       avformat_write_header(oc, NULL);

       time_t timenow, timestart;
       timestart = timenow = get_time();
       bool got_key_frame = 0;

       while (av_read_frame(format_ctx, &amp;packet) >= 0 &amp;&amp; cnt &lt; 200000) { //read ~ 200000 frames
           if (packet.stream_index == video_stream_index) {    //packet is video
               // Make sure we start on a key frame
               if ( !got_key_frame &amp;&amp; timestart == timenow &amp;&amp; ! ( packet.flags &amp; AV_PKT_FLAG_KEY ) ) {
                 timestart = timenow = get_time();
                 continue;
               }
               got_key_frame = 1;
               std::cout &lt;&lt; cnt &lt;&lt; std::endl;
               av_interleaved_write_frame( oc, &amp;packet );
               cnt++;
           }
         av_free_packet(&amp;packet);
         av_init_packet(&amp;packet);
         timenow = get_time();
       }

       av_write_trailer(oc);
       avcodec_close(stream->codec);
       avio_close(oc->pb);
       avformat_free_context(oc);

       av_read_pause(format_ctx);

       avcodec_free_context(&amp;c);
       avformat_network_deinit();

       return 0;
    }
    </sstream></fstream></iostream>