Recherche avancée

Médias (0)

Mot : - Tags -/interaction

Aucun média correspondant à vos critères n’est disponible sur le site.

Autres articles (14)

  • Gestion générale des documents

    13 mai 2011, par

    MédiaSPIP ne modifie jamais le document original mis en ligne.
    Pour chaque document mis en ligne il effectue deux opérations successives : la création d’une version supplémentaire qui peut être facilement consultée en ligne tout en laissant l’original téléchargeable dans le cas où le document original ne peut être lu dans un navigateur Internet ; la récupération des métadonnées du document original pour illustrer textuellement le fichier ;
    Les tableaux ci-dessous expliquent ce que peut faire MédiaSPIP (...)

  • Le plugin : Podcasts.

    14 juillet 2010, par

    Le problème du podcasting est à nouveau un problème révélateur de la normalisation des transports de données sur Internet.
    Deux formats intéressants existent : Celui développé par Apple, très axé sur l’utilisation d’iTunes dont la SPEC est ici ; Le format "Media RSS Module" qui est plus "libre" notamment soutenu par Yahoo et le logiciel Miro ;
    Types de fichiers supportés dans les flux
    Le format d’Apple n’autorise que les formats suivants dans ses flux : .mp3 audio/mpeg .m4a audio/x-m4a .mp4 (...)

  • Installation en mode ferme

    4 février 2011, par

    Le mode ferme permet d’héberger plusieurs sites de type MediaSPIP en n’installant qu’une seule fois son noyau fonctionnel.
    C’est la méthode que nous utilisons sur cette même plateforme.
    L’utilisation en mode ferme nécessite de connaïtre un peu le mécanisme de SPIP contrairement à la version standalone qui ne nécessite pas réellement de connaissances spécifique puisque l’espace privé habituel de SPIP n’est plus utilisé.
    Dans un premier temps, vous devez avoir installé les mêmes fichiers que l’installation (...)

Sur d’autres sites (5634)

  • Android MediaClipsRecorder : Error starting recorder -19

    25 octobre 2017, par Burak iren

    I’m using FFmpeg at my project. It was working 4 days ago. I have changed java sdk from 1.8 to 1.7 . Later I have tried, camera shutting on some devices. I dont know what is the problem. I checkout the project to working branch but still error continue.

    My code is

    public void start() {
       if (mMediaRecorder == null) {
           return;
       }
       Log.v(LOG_TAG, "Preparing recorder");
       if (mCurrentFile == null) {
           newTempFile();
       }
       try {
           mMediaRecorderConfigurer.configureMediaRecorder(mMediaRecorder);
           mMediaRecorder.setOutputFile(mCurrentFile.getAbsolutePath());
           mMediaRecorder.setOnInfoListener(this);
           mMediaRecorder.setOnErrorListener(this);
           mMediaRecorder.prepare();
       } catch (IOException e) {
           if (mMediaRecorder != null) {
               release();
           }
           Log.e(LOG_TAG, "Error preparing recorder", e);
           if (mListener != null) {
               mListener.onMediaRecorderError(e);
           }
           return;
       }

       try {
           mMediaRecorder.start();
           // There's a slight delay before it starts recording.
           mStartTimeMillis = SystemClock.uptimeMillis() + START_DELAY_MILLIS;
       } catch (Exception e) {
           if (mMediaRecorder != null) {
               release();
           }
           Log.e(LOG_TAG, "Error starting recorder", e);
           if (mListener != null) {
               mListener.onMediaRecorderError(e);
           }
       }
    }

    My error is

    10-25 15:18:21.000 5960-5960/com.leadtimeapp.io.internal.debug
    V/FFmpegRecorderActivity: Remaining millis 60000
    10-25 15:18:21.117 5960-5960/com.leadtimeapp.io.internal.debug
    E/MediaRecorder: start failed: -19
    10-25 15:18:21.121 5960-5960/com.leadtimeapp.io.internal.debug
    E/MediaClipsRecorder: Error starting recorder
                                                                                    java.lang.RuntimeException: start failed.
                                                                                        at android.media.MediaRecorder.start(Native Method)
                                                                                        at com.amosyuen.videorecorder.recorder.MediaClipsRecorder.start(MediaClipsRecorder.java:144)
                                                                                        at com.amosyuen.videorecorder.activity.FFmpegRecorderActivity.startRecording(FFmpegRecorderActivity.java:494)
                                                                                        at com.amosyuen.videorecorder.activity.FFmpegRecorderActivity.onTouch(FFmpegRecorderActivity.java:593)
                                                                                        at android.view.View.dispatchTouchEvent(View.java:9371)
                                                                                        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2554)
                                                                                        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2198)

    10-25 15:18:21.123 5960-5960/com.leadtimeapp.io.internal.debug
    I/FFmpegRecorderActivity: Discard recording
  • FFmpeg "movflags" > "faststart" causes av_write_trailer() to return -2

    30 juin 2016, par williamtroup

    I’m setting up the format layout for the ideo as follows :

    AVOutputFormat* outputFormat = ffmpeg.av_guess_format(null, "output.mp4", null);

    AVCodec* videoCodec = ffmpeg.avcodec_find_encoder(outputFormat->video_codec);

    AVFormatContext* formatContext = ffmpeg.avformat_alloc_context();
    formatContext->oformat = outputFormat;
    formatContext->video_codec_id = videoCodec->id;

    ffmpeg.avformat_new_stream(formatContext, videoCodec);

    This is how I am setting up the Codec Context :

    AVCodecContext* codecContext = ffmpeg.avcodec_alloc_context3(videoCodec);
    codecContext->bit_rate = 400000;
    codecContext->width = 1280;
    codecContext->height = 720;
    codecContext->gop_size = 12;
    codecContext->max_b_frames = 1;
    codecContext->pix_fmt = videoCodec->pix_fmts[0];
    codecContext->codec_id = videoCodec->id;
    codecContext->codec_type = videoCodec->type;
    codecContext->time_base = new AVRational
    {
       num = 1,
       den = 30
    };

    I’m using the following code to setup the "movflags" > "faststart" option for the header of the video :

    AVDictionary* options = null;

    int result = ffmpeg.av_dict_set(&options, "movflags", "faststart", 0);

    int writeHeaderResult = ffmpeg.avformat_write_header(formatContext, &options);

    The file is opened and the header is written as follows :

    if ((formatContext->oformat->flags & ffmpeg.AVFMT_NOFILE) == 0)
    {
       int ioOptionResult = ffmpeg.avio_open(&formatContext->pb, "output.mp4", ffmpeg.AVIO_FLAG_WRITE);
    }

    int writeHeaderResult = ffmpeg.avformat_write_header(formatContext, &options);

    After this, I write each video frame as follows :

    outputFrame->pts = frameIndex;

    packet.flags |= ffmpeg.AV_PKT_FLAG_KEY;
    packet.pts = frameIndex;
    packet.dts = frameIndex;

    int encodedFrame = 0;
    int encodeVideoResult = ffmpeg.avcodec_encode_video2(codecContext, &packet, outputFrame, &encodedFrame);

    if (encodedFrame != 0)
    {
       packet.pts = ffmpeg.av_rescale_q(packet.pts, codecContext->time_base, m_videoStream->time_base);
       packet.dts = ffmpeg.av_rescale_q(packet.dts, codecContext->time_base, m_videoStream->time_base);
       packet.stream_index = m_videoStream->index;

       if (codecContext->coded_frame->key_frame > 0)
       {
           packet.flags |= ffmpeg.AV_PKT_FLAG_KEY;
       }

       int writeFrameResult = ffmpeg.av_interleaved_write_frame(formatContext, &packet);
    }

    After that, I write the trailer :

    int writeTrailerResult = ffmpeg.av_write_trailer(formatContext);

    However, writeTrailerResult is always -2. I’m been looking into this problem for days and cannot figure out what the problem is.

    The DLLs used for the AutoGen library are :

    avcodec-56.dll
    avdevice-56.dll
    avfilter-5.dll
    avformat-56.dll
    avutil-54.dll
    postproc-53.dll
    swresample-1.dll
    swscale-3.dll
  • Opencv/FFMPEG retrieving wrong fps while streaming cameras

    15 avril 2016, par Romanzo Criminale

    I’ve have been trying to retrieve the fps information from different camera stream via RTSP. This is done using the OpenCV library which uses the libavormat provided by ffmpeg. However it seems I can’t rely on the information returned by libav depending on the codec or the camera used. I would like to get a better understanding about how this frame rate are computed etc...

    OpenCV is trying to retrieve the fps of the stream using different properties of AVStream, r_frame_rate, avg_frame_rate and time_base.

    double CvCapture_FFMPEG::get_fps() const
    {
    #if LIBAVCODEC_BUILD >= CALC_FFMPEG_VERSION(54, 1, 0)
     double fps = r2d(ic->streams[video_stream]->avg_frame_rate);
    #else
     double fps = r2d(ic->streams[video_stream]->r_frame_rate);
    #endif

    #if LIBAVFORMAT_BUILD >= CALC_FFMPEG_VERSION(52, 111, 0)
     if (fps < eps_zero)
     {
       fps = r2d(ic->streams[video_stream]->avg_frame_rate);
     }
    #endif

    if (fps < eps_zero)
    {
     fps = 1.0 / r2d(ic->streams[video_stream]->codec->time_base);
    }

    return fps;
    }

    I tried two different camera brands and two different codecs H264, and JPEG. Here are the results, I get :

    Camera 1 running at 15fps (default value)

    camera 1, jpeg

    • r_frame_rate = 15/1
    • avg_frame_rate = 0/0
    • time_base = 1/ 90000
    • tick_per_frame = 1

    camera 1, h264

    • r_frame_rate = 15/1

    • avg_frame_rate = 15/2

    • time_base = 1/ 90000

    • tick_per_frame = 2

    Camera 2 running at 25fps default but the fps is changed within the rtsp url to 12

    camera 2, jpeg

    • r_frame_rate = 12/1

    • avg_frame_rate = 0/0

    • time_base = 1/ 90000

    • tick_per_frame = 1

    camera 2, h264 running at 12fps

    • r_frame_rate = 25/1

    • avg_frame_rate = 0/0

    • time_base = 1/ 90000

    • tick_per_frame = 2

    Also i tried streaming using ffmpeg command line

    ffmpeg -i rtsp://url

    and it seems that only jpeg can return the expected fps.

    Here are the questions have been asking myself :

    1/ what’s really r_frame_rate ?
    It says in the api "[i]it is the smallest frame rate that can accurately represent all timestamps. For example, if you have mixed 25 and 30 fps content, then
    will be 150 (it is the least common multiple).[/i]" I doesn’t make sense to me that it the same time the smallest frame rate (25) and the least common multiple (150).

    2/ How is the avg_frame_rate computed ?
    I had a look at the code but couldn’t really figure out how is this average computed. It seems that most of the time this is returning 0.

    3/ Is there a bug getting the frame rate while using h264 ?
    Using jpeg, it looks like r_frame_RATE can return the actual fps value, but h264 will not work. Are those information not available using h264 ?

    Any help would be appreciated, I spent two days trying to understand why i wasn’t getting the correct values but at this point i’m pretty stuck.
    Thanks in advance !