Recherche avancée

Médias (1)

Mot : - Tags -/publier

Autres articles (33)

  • List of compatible distributions

    26 avril 2011, par

    The table below is the list of Linux distributions compatible with the automated installation script of MediaSPIP. Distribution nameVersion nameVersion number Debian Squeeze 6.x.x Debian Weezy 7.x.x Debian Jessie 8.x.x Ubuntu The Precise Pangolin 12.04 LTS Ubuntu The Trusty Tahr 14.04
    If you want to help us improve this list, you can provide us access to a machine whose distribution is not mentioned above or send the necessary fixes to add (...)

  • Selection of projects using MediaSPIP

    2 mai 2011, par

    The examples below are representative elements of MediaSPIP specific uses for specific projects.
    MediaSPIP farm @ Infini
    The non profit organizationInfini develops hospitality activities, internet access point, training, realizing innovative projects in the field of information and communication technologies and Communication, and hosting of websites. It plays a unique and prominent role in the Brest (France) area, at the national level, among the half-dozen such association. Its members (...)

  • Automated installation script of MediaSPIP

    25 avril 2011, par

    To overcome the difficulties mainly due to the installation of server side software dependencies, an "all-in-one" installation script written in bash was created to facilitate this step on a server with a compatible Linux distribution.
    You must have access to your server via SSH and a root account to use it, which will install the dependencies. Contact your provider if you do not have that.
    The documentation of the use of this installation script is available here.
    The code of this (...)

Sur d’autres sites (4320)

  • Use ffmpeg to send custom header for RTSP session

    29 janvier 2020, par senojsitruc

    I am trying to use the ffmpeg library (not the command line) to open an RTSP stream and push that stream to a server. In ONVIF parlance, this is a backchannel (for sending audio to a camera).

    Where I am stuck is in sending a custom header (Require: ...) with the DESCRIBE command, and being able to handle the reply.

    Is there a way to do this with ffmpeg ?

    DESCRIBE rtsp://192.168.0.1 RTSP/1.0 CSeq: 1
    User-Agent: ONVIF Rtsp client Accept: application/sdp
    Require: www.onvif.org/ver20/backchannel

    I noticed in rtsp.c that there are various *_rtsp_send_cmd_*() functions that look interesting, but they all appear to be private to the library.

  • Access violation reading location when opening avfromat_open_input

    28 mai 2023, par nokla

    I am trying to build a function for reading a video from .mp4 file using ffmpeg and c++.

    


    This function was already working on one computer but when I copied the code to another one, with the same environment it returned the following error :

    


    Exception thrown at 0x00007FFC81B7667C (avutil-57.dll)
in VideoEditor.exe: 0xC0000005: Access violation 
reading location 0x0000000000000000.


    


    If anyone has ever encountered such an issue or have any idea how to solve it please share.

    



    


    This is the function :

    


    void VideoSource::ReadSource()
{
    auto lock = this->LockSource();
    std::vector> newSource;

    // Open the file using libavformat
    AVFormatContext* av_format_ctx = avformat_alloc_context();
    if (!av_format_ctx) {
        //wxMessageBox("Couldn't create AVFormatContext\n");
        read = false;
        return;
    }
    if (avformat_open_input(&av_format_ctx, path.c_str(), NULL, NULL) != 0) { // error here
        //wxMessageBox("Couldn't open video file\n");
        read = false;
        return;
    }

    // Find the first valid video stream inside the file
    int video_stream_index = -1;
    AVCodecParameters* av_codec_params = NULL;
    const AVCodec* av_codec = NULL;
    for (uint i = 0; i < av_format_ctx->nb_streams; i)
    {
        av_codec_params = av_format_ctx->streams[i]->codecpar;
        av_codec = avcodec_find_decoder(av_codec_params->codec_id);

        if (!av_codec) {
            continue;
        }
        if (av_codec_params->codec_type == AVMEDIA_TYPE_VIDEO) {
            video_stream_index = i;
            break;
        }
    }

    if (video_stream_index == -1) {
        //wxMessageBox("Couldn't find valid video stream inside file\n");
        read = false;
        return;
    }

    // Set up a codec context for the decoder
    AVCodecContext* av_codec_ctx = avcodec_alloc_context3(av_codec);
    if (!av_codec_ctx) {
        //wxMessageBox("Couldn't create AVCpdecContext\n");
        read = false;
        return;
    }

    if (avcodec_parameters_to_context(av_codec_ctx, av_codec_params) < 0)
    {
        //wxMessageBox("Couldn't initialize AVCodecContext\n");
        read = false;
        return;
    }
    if (avcodec_open2(av_codec_ctx, av_codec, NULL) < 0) {
        //wxMessageBox("Couldn't open codec\n");

        read = false;
        return;
    }

    AVFrame* av_frame = av_frame_alloc();
    if (!av_frame) {
        //wxMessageBox("Couldn't allocate AVFrame\n");

        read = false;
        return;
    }
    AVPacket* av_packet = av_packet_alloc();
    if (!av_packet) {
        //wxMessageBox("Couldn't allocate AVPacket\n");

        read = false;
        return;
    }
    int response;
    int counter = 0;
    while (av_read_frame(av_format_ctx, av_packet) >= 0 && counter < 100000) {
        if (av_packet->stream_index != video_stream_index) {
            av_packet_unref(av_packet);
            continue;
        }
        response = avcodec_send_packet(av_codec_ctx, av_packet);
        if (response < 0) {
            //wxMessageBox("Failed to decode packet: %s\n", av_err2str(response));

            read = false;
            return;
        }
        response = avcodec_receive_frame(av_codec_ctx, av_frame);
        if (response == AVERROR(EAGAIN) || response == AVERROR_EOF) {
            av_packet_unref(av_packet);
            continue;
        }
        else if (response < 0) {
            //wxMessageBox("Failed to decode frame: %s\n", av_err2str(response));

            read = false;
            return;
        }
        counter++;
        av_packet_unref(av_packet);

        av_packet = av_packet_alloc();

        response = avcodec_send_frame(av_codec_ctx, av_frame);
        std::string tmp = av_err2str(response);
        //source.push_back(*av_frame);
        //auto mat_frame = Avframe2Cvmat(av_frame);

        //source.push_back(im);
        //bool isEqual = (cv::sum(Avframe2Cvmat(av_frame) != Avframe2Cvmat(&source[0])) == cv::Scalar(0, 0, 0, 0));
        //bool isEqual = (cv::sum(im != source[0]) == cv::Scalar(0, 0, 0, 0));
        //im.release();
        newSource.push_back(SyncObject(av_frame_clone(av_frame)));

        /*
        if (int iRet = av_frame_copy(&source.back(), av_frame) == 0) {
            av_log(NULL, AV_LOG_INFO, "Ok");
        }
        else {
            av_log(NULL, AV_LOG_INFO, "Error: %s\n", av_err2str(iRet));
        }*/
        av_frame_unref(av_frame);
    }


    avformat_close_input(&av_format_ctx);
    avformat_free_context(av_format_ctx);
    av_frame_free(&av_frame);
    av_packet_free(&av_packet);
    avcodec_free_context(&av_codec_ctx);
    //this->LockSource();
    source_.swap(newSource);
}


    


    This function is inside A class and those are its memebers :

    


        bool created;
    bool read;
    std::string path; // THE PATH TO THE FILE
    std::vector> source_; // vector containing all of the video frames


    


    This is what I get in Call Stack

    


    This is what I get in the debugger when the error accures :

    


    [![Debugger values][1]][1]


    


  • getting ffmpeg to work with php website error 500 or access denied

    20 février 2020, par user3725395

    I have two ways without success and different results, with exec method the ffmpeg actually works and creates the output file but then the website crashes with error 500.
    if I use the proc_open method then it runs and creates the log file atest.log in the output store folder, but ffmpeg errors at the end with : store\audio_recording_1441120844021u.mp3 : Permission denied and doesn’t write the file out.

    ffmpeg has IUSR full control permissions and those permissions are also on the store folder.

    any ideas ???

    exec method :-

    $cmd = "ffmpeg.exe -i C:\\Windows\\Temp\\recordings\\".$filename." -i watermark.mp3 -filter_complex amerge -c:a libmp3lame -q:a 4 store\\".$filename;
    echo exec($cmd, $o, $v);

    proc_open method :-

    $cmd = "ffmpeg.exe -i C:\\Windows\\Temp\\recordings\\".$filename." -i watermark.mp3 -filter_complex amerge -c:a libmp3lame -q:a 4 store\\".$filename;
    $pipes = array();
    $descriptors = array(2 => array('file', 'store\\atest.log', 'a'));

    $p = proc_open($cmd, $descriptors, $pipes);
    $done = 0;
    while (!$done)
    {
         sleep(1);

         $status = proc_get_status($p);
         if (!$status['running']) $done = 1;

         echo "STEEL RUN\n";
         // some manipulations with "store\\atest.log"

    }