Recherche avancée

Médias (91)

Autres articles (103)

  • ANNEXE : Les plugins utilisés spécifiquement pour la ferme

    5 mars 2010, par

    Le site central/maître de la ferme a besoin d’utiliser plusieurs plugins supplémentaires vis à vis des canaux pour son bon fonctionnement. le plugin Gestion de la mutualisation ; le plugin inscription3 pour gérer les inscriptions et les demandes de création d’instance de mutualisation dès l’inscription des utilisateurs ; le plugin verifier qui fournit une API de vérification des champs (utilisé par inscription3) ; le plugin champs extras v2 nécessité par inscription3 (...)

  • Qu’est ce qu’un éditorial

    21 juin 2013, par

    Ecrivez votre de point de vue dans un article. Celui-ci sera rangé dans une rubrique prévue à cet effet.
    Un éditorial est un article de type texte uniquement. Il a pour objectif de ranger les points de vue dans une rubrique dédiée. Un seul éditorial est placé à la une en page d’accueil. Pour consulter les précédents, consultez la rubrique dédiée.
    Vous pouvez personnaliser le formulaire de création d’un éditorial.
    Formulaire de création d’un éditorial Dans le cas d’un document de type éditorial, les (...)

  • Activation de l’inscription des visiteurs

    12 avril 2011, par

    Il est également possible d’activer l’inscription des visiteurs ce qui permettra à tout un chacun d’ouvrir soit même un compte sur le canal en question dans le cadre de projets ouverts par exemple.
    Pour ce faire, il suffit d’aller dans l’espace de configuration du site en choisissant le sous menus "Gestion des utilisateurs". Le premier formulaire visible correspond à cette fonctionnalité.
    Par défaut, MediaSPIP a créé lors de son initialisation un élément de menu dans le menu du haut de la page menant (...)

Sur d’autres sites (11604)

  • FFmpeg C demo generates "Could not update timestamps for skipped samples" warning

    14 juillet 2024, par aabiji

    When I run my demo code I get these warnings when testing it on a webm video :

    


    [opus @ 0x5ec0fc1b4580] Could not update timestamps for skipped samples.
[opus @ 0x5ec0fc1b4580] Could not update timestamps for discarded samples.


    


    But it's not limited to webm, I also get this warning when running with a mp4 :

    


    [aac @ 0x61326fb83700] Could not update timestamps for skipped samples.


    


    I know I'm getting warnings because ffmpeg must be skipping packets, but I have no idea why. Why are we skipping packets (and if that's not the problem, what is) and how can we fix the problem ?

    


    Here's my code for context :

    


    #include <libavcodec></libavcodec>avcodec.h>&#xA;#include <libavformat></libavformat>avformat.h>&#xA;&#xA;int main()&#xA;{&#xA;    int ret = 0;&#xA;&#xA;    const AVCodec* codec;&#xA;    AVFormatContext* fmt_ctx = avformat_alloc_context();&#xA;&#xA;    const char* file2 = "/home/aabiji/Videos/sync-test.webm";&#xA;    if ((ret = avformat_open_input(&amp;fmt_ctx, file2, NULL, NULL)) &lt; 0) {&#xA;        av_log(NULL, AV_LOG_ERROR, "Couldn&#x27;t open input file\n");&#xA;        return -1;&#xA;    }&#xA;&#xA;    ret = av_find_best_stream(fmt_ctx, AVMEDIA_TYPE_AUDIO, -1, -1, &amp;codec, 0);&#xA;    if (ret &lt; 0) {&#xA;        av_log(NULL, AV_LOG_ERROR, "Couldn&#x27;t find a media stream\n");&#xA;        return -1;&#xA;    }&#xA;&#xA;    int stream_index = ret;&#xA;    AVStream* media = fmt_ctx->streams[stream_index];&#xA;&#xA;    AVCodecContext* codec_context = avcodec_alloc_context3(codec);&#xA;    if (avcodec_parameters_to_context(codec_context, media->codecpar) &lt; 0) {&#xA;        return -1;&#xA;    }&#xA;&#xA;    if ((ret = avcodec_open2(codec_context, codec, NULL)) &lt; 0) {&#xA;        av_log(NULL, AV_LOG_ERROR, "Couldn&#x27;t open media decoder\n");&#xA;        return -1;&#xA;    }&#xA;&#xA;    AVPacket* packet = av_packet_alloc();&#xA;    AVFrame* frame = av_frame_alloc();&#xA;&#xA;    while ((ret = av_read_frame(fmt_ctx, packet)) >= 0) {&#xA;        if (packet->stream_index != stream_index) {&#xA;            continue;&#xA;        }&#xA;&#xA;        ret = avcodec_send_packet(codec_context, packet);&#xA;        if (ret &lt; 0) {&#xA;            break; // Error&#xA;        }&#xA;&#xA;        while (ret >= 0) {&#xA;            ret = avcodec_receive_frame(codec_context, frame);&#xA;            if (ret == AVERROR_EOF || ret == AVERROR(EAGAIN)) {&#xA;                break;&#xA;            } else if (ret &lt; 0) {&#xA;                fprintf(stderr, "Error during decoding\n");&#xA;                break;&#xA;            }&#xA;            av_frame_unref(frame);&#xA;        }&#xA;&#xA;        av_packet_unref(packet);&#xA;    }&#xA;&#xA;    avcodec_flush_buffers(codec_context);&#xA;&#xA;    av_packet_unref(packet);&#xA;    av_frame_free(&amp;frame);&#xA;    av_packet_free(&amp;packet);&#xA;    avcodec_free_context(&amp;codec_context);&#xA;    avformat_close_input(&amp;fmt_ctx);&#xA;    return 0;&#xA;}&#xA;

    &#xA;

  • Ffmpeg RTSP stream with size=N/A bitrate=N/A [closed]

    6 octobre 2024, par Comycos

    When I try to stream a video it seems to work but bitrate and size are N/A frame=  277 fps= 26 q=-1.0 size=N/A time=00:00:11.07 bitrate=N/A speed=1.05x

    &#xA;

    I run the following command to stream a video to a RTSP server :&#xA;ffmpeg -re -stream_loop -1 -i idurre-2024-09-17-12h33m19s.mp4 -c copy -f rtsp -rtsp_transport tcp rtsp://localhost:8554/test

    &#xA;

    The output ffmpeg is like this :

    &#xA;

    ffmpeg version 7.1 Copyright (c) 2000-2024 the FFmpeg developers&#xA;  built with Apple clang version 15.0.0 (clang-1500.1.0.2.5)&#xA;  configuration: --prefix=/opt/homebrew/Cellar/ffmpeg/7.1 --enable-shared --enable-pthreads --enable-version3 --cc=clang --host-cflags= --host-ldflags=&#x27;-Wl,-ld_classic&#x27; --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libaribb24 --enable-libbluray --enable-libdav1d --enable-libharfbuzz --enable-libjxl --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librist --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libspeex --enable-libsoxr --enable-libzmq --enable-libzimg --disable-libjack --disable-indev=jack --enable-videotoolbox --enable-audiotoolbox --enable-neon&#xA;  libavutil      59. 39.100 / 59. 39.100&#xA;  libavcodec     61. 19.100 / 61. 19.100&#xA;  libavformat    61.  7.100 / 61.  7.100&#xA;  libavdevice    61.  3.100 / 61.  3.100&#xA;  libavfilter    10.  4.100 / 10.  4.100&#xA;  libswscale      8.  3.100 /  8.  3.100&#xA;  libswresample   5.  3.100 /  5.  3.100&#xA;  libpostproc    58.  3.100 / 58.  3.100&#xA;[mov,mp4,m4a,3gp,3g2,mj2 @ 0x127704880] st: 0 edit list: 1 Missing key frame while searching for timestamp: 0&#xA;[mov,mp4,m4a,3gp,3g2,mj2 @ 0x127704880] st: 0 edit list 1 Cannot find an index entry before timestamp: 0.&#xA;Input #0, mov,mp4,m4a,3gp,3g2,mj2, from &#x27;idurre-2024-09-17-12h33m19s.mp4&#x27;:&#xA;  Metadata:&#xA;    major_brand     : isom&#xA;    minor_version   : 0&#xA;    compatible_brands: mp41avc1&#xA;    creation_time   : 2024-09-17T10:34:16.000000Z&#xA;    encoder         : vlc 3.0.21 stream output&#xA;    encoder-eng     : vlc 3.0.21 stream output&#xA;  Duration: 00:00:55.68, start: 0.000000, bitrate: 16205 kb/s&#xA;  Stream #0:0[0x1](eng): Video: h264 (High) (avc1 / 0x31637661), yuvj420p(pc, bt709, progressive), 1920x1080, 16203 kb/s, 25 fps, 25 tbr, 1000k tbn (default)&#xA;      Metadata:&#xA;        creation_time   : 2024-09-17T10:34:16.000000Z&#xA;        handler_name    : VideoHandler&#xA;        vendor_id       : [0][0][0][0]&#xA;Stream mapping:&#xA;  Stream #0:0 -> #0:0 (copy)&#xA;Output #0, rtsp, to &#x27;rtsp://localhost:8554/test&#x27;:&#xA;  Metadata:&#xA;    major_brand     : isom&#xA;    minor_version   : 0&#xA;    compatible_brands: mp41avc1&#xA;    encoder         : Lavf61.7.100&#xA;  Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuvj420p(pc, bt709, progressive), 1920x1080, q=2-31, 16203 kb/s, 25 fps, 25 tbr, 90k tbn (default)&#xA;      Metadata:&#xA;        creation_time   : 2024-09-17T10:34:16.000000Z&#xA;        handler_name    : VideoHandler&#xA;        vendor_id       : [0][0][0][0]&#xA;Press [q] to stop, [?] for help&#xA;frame=  516 fps= 26 q=-1.0 size=N/A time=00:00:20.63 bitrate=N/A speed=1.03x    &#xA;&#xA;[q] command received. Exiting.&#xA;&#xA;[out#0/rtsp @ 0x6000008e0240] video:40672KiB audio:0KiB subtitle:0KiB other streams:0KiB global headers:0KiB muxing overhead: unknown&#xA;frame=  528 fps= 26 q=-1.0 Lsize=N/A time=00:00:21.11 bitrate=N/A speed=1.02x    &#xA;

    &#xA;

    The server I'm streaming to is a MediaMTX which is supposed to receive the stream. It seems to be connected as it logs it :

    &#xA;

    mediamtx-rtsp  | 2024/10/06 10:35:13 INF MediaMTX v1.9.0&#xA;mediamtx-rtsp  | 2024/10/06 10:35:13 INF configuration loaded from /mediamtx.yml&#xA;mediamtx-rtsp  | 2024/10/06 10:35:13 INF [RTSP] listener opened on :8554 (TCP), :8000 (UDP/RTP), :8001 (UDP/RTCP)&#xA;mediamtx-rtsp  | 2024/10/06 10:35:13 INF [SRT] listener opened on :8890 (UDP)&#xA;mediamtx-rtsp  | 2024/10/06 10:35:16 INF [RTSP] [conn 192.168.65.1:17069] opened&#xA;mediamtx-rtsp  | 2024/10/06 10:35:16 INF [RTSP] [session b3bb2623] created by 192.168.65.1:17069&#xA;mediamtx-rtsp  | 2024/10/06 10:35:16 INF [RTSP] [session b3bb2623] is publishing to path &#x27;test&#x27;, 1 track (H264)&#xA;

    &#xA;

    But when I try to read it with ffplay nothing is showing...

    &#xA;

  • FFmpeg - record from stream terminating unexpectedly using kokorin/Jaffree ffmpeg wrapper for Java

    18 avril 2024, par pyrmon

    I am programming a Spring Boot Application using Maven and Java 21. I am trying to record a stream from a url and save it to a mkv file. I intend to do this with kokorin/Jaffree in version 2023.09.10. The recording seems to work ok, however longer videos are terminating unexpectedly. Sometimes after 5 minutes, other times an hour or even longer. Sometimes with Exit Code 0 and sometimes with 1.

    &#xA;

    I have implemented the recording like this :

    &#xA;

    @Override&#xA;    public void startRecording(RecordingSchedule recordingSchedule) {&#xA;        logger.info("Starting recording for schedule with filename {}", recordingSchedule.getFileName());&#xA;&#xA;        String m3uUrl = recordingSchedule.getM3uUrl();&#xA;        LocalDateTime endTime = timeUtils.parseStringToLocalDateTime(recordingSchedule.getEndTime());&#xA;        LocalDateTime stopTime = endTime.plusSeconds(20);&#xA;        String timeToRecord = timeUtils.calculateTimeToRecord(stopTime);&#xA;        Path outputPath = Paths.get("/recordings/" &#x2B; recordingSchedule.getFileName());&#xA;&#xA;        try {&#xA;            FFmpeg.atPath()&#xA;                  .addInput(UrlInput.fromUrl(m3uUrl))&#xA;                  .addArgument("-xerror")&#xA;                  .addArguments("-reconnect", "5")&#xA;                  .addArguments("-reconnect_streamed", "5")&#xA;                  .addArguments("-reconnect_delay_max", "20")&#xA;                  .addArguments("-t", timeToRecord)&#xA;                  .addArguments("-c", "copy")&#xA;                  .addOutput(&#xA;                      UrlOutput.toPath(outputPath))&#xA;                  .setLogLevel(LogLevel.WARNING)&#xA;                  .execute();&#xA;            logger.info("Recording complete. Output file: {}", outputPath.toAbsolutePath());&#xA;        } catch (Exception e) {&#xA;            logger.error("Error recording M3U stream {}: {}", recordingSchedule.getFileName(), e.getMessage());&#xA;        }&#xA;    }&#xA;

    &#xA;

    And I am calling the method like this :&#xA;executorConfig.executorService().submit(() -> ffmpegService.startRecording(recording));

    &#xA;

    Any ideas what I am doing wrong ?&#xA;Here are the log lines at the beginning and end of recording of the past two attempts :

    &#xA;

    2024-04-18T00:54:48.689&#x2B;02:00  INFO 1 --- [pool-2-thread-1] m.s.r.service.impl.FfmpegServiceImpl     : Starting recording for schedule with filename Example1.mkv&#xA;2024-04-18T00:54:48.697&#x2B;02:00  WARN 1 --- [pool-2-thread-1] c.github.kokorin.jaffree.ffmpeg.FFmpeg   : ProgressListener isn&#x27;t set, progress won&#x27;t be reported&#xA;2024-04-18T00:54:48.698&#x2B;02:00  INFO 1 --- [pool-2-thread-1] c.g.k.jaffree.process.ProcessHandler     : Command constructed:&#xA;ffmpeg -loglevel level&#x2B;warning -i http://example.stream.url.com -n -xerror -reconnect 5 -reconnect_streamed 5 -reconnect_delay_max 20 -t 10771 -c copy /recordings/Example1.mkv&#xA;2024-04-18T00:54:48.698&#x2B;02:00  INFO 1 --- [pool-2-thread-1] c.g.k.jaffree.process.ProcessHandler     : Starting process: ffmpeg&#xA;2024-04-18T00:54:48.701&#x2B;02:00  INFO 1 --- [pool-2-thread-1] c.g.k.jaffree.process.ProcessHandler     : Waiting for process to finish&#xA;2024-04-18T01:31:02.633&#x2B;02:00  WARN 1 --- [         StdErr] c.g.k.jaffree.process.BaseStdReader      : [h264 @ 0x559cd22dd940] [warning] Increasing reorder buffer to 2&#xA;2024-04-18T01:31:02.633&#x2B;02:00  INFO 1 --- [pool-2-thread-1] c.g.k.jaffree.process.ProcessHandler     : Process has finished with status: 0&#xA;2024-04-18T01:31:02.734&#x2B;02:00  INFO 1 --- [pool-2-thread-1] m.s.r.service.impl.FfmpegServiceImpl     : Recording complete. Output file: /recordings/Example1.mkv&#xA;&#xA;2024-04-18T03:54:48.678&#x2B;02:00  INFO 1 --- [pool-2-thread-2] m.s.r.service.impl.FfmpegServiceImpl     : Starting recording for schedule with filename Example2.mkv&#xA;2024-04-18T03:54:48.678&#x2B;02:00  WARN 1 --- [pool-2-thread-2] c.github.kokorin.jaffree.ffmpeg.FFmpeg   : ProgressListener isn&#x27;t set, progress won&#x27;t be reported&#xA;2024-04-18T03:54:48.678&#x2B;02:00  INFO 1 --- [pool-2-thread-2] c.g.k.jaffree.process.ProcessHandler     : Command constructed:&#xA;ffmpeg -loglevel level&#x2B;warning -i http://example.stream.url.com/ -n -xerror -reconnect 5 -reconnect_streamed 5 -reconnect_delay_max 20 -t 11431 -c copy /recordings/Example2.mkv&#xA;2024-04-18T03:54:48.678&#x2B;02:00  INFO 1 --- [pool-2-thread-2] c.g.k.jaffree.process.ProcessHandler     : Starting process: ffmpeg&#xA;2024-04-18T03:54:48.679&#x2B;02:00  INFO 1 --- [pool-2-thread-2] c.g.k.jaffree.process.ProcessHandler     : Waiting for process to finish&#xA;2024-04-18T04:57:22.256&#x2B;02:00  WARN 1 --- [         StdErr] c.g.k.jaffree.process.BaseStdReader      : [h264 @ 0x55707ba988c0] [warning] Increasing reorder buffer to 3&#xA;2024-04-18T04:58:47.455&#x2B;02:00 ERROR 1 --- [         StdErr] c.g.k.jaffree.process.BaseStdReader      : [NULL @ 0x55707ba988c0] [error] Picture timing SEI payload too large&#xA;2024-04-18T04:58:47.456&#x2B;02:00 ERROR 1 --- [         StdErr] c.g.k.jaffree.process.BaseStdReader      : [NULL @ 0x55707ba988c0] [error] non-existing PPS 1 referenced&#xA;2024-04-18T04:58:47.456&#x2B;02:00  WARN 1 --- [         StdErr] c.g.k.jaffree.process.BaseStdReader      : [matroska @ 0x55707ba9a380] [warning] Timestamps are unset in a packet for stream 0. This is deprecated and will stop working in the future. Fix your code to set the timestamps properly&#xA;2024-04-18T04:58:47.456&#x2B;02:00 ERROR 1 --- [         StdErr] c.g.k.jaffree.process.BaseStdReader      : [matroska @ 0x55707ba9a380] [error] Can&#x27;t write packet with unknown timestamp&#xA;2024-04-18T04:58:47.463&#x2B;02:00 ERROR 1 --- [         StdErr] c.g.k.jaffree.process.BaseStdReader      : [error] av_interleaved_write_frame(): Invalid argument&#xA;2024-04-18T04:58:47.463&#x2B;02:00  INFO 1 --- [pool-2-thread-2] c.g.k.jaffree.process.ProcessHandler     : Process has finished with status: 1&#xA;2024-04-18T04:58:47.564&#x2B;02:00 ERROR 1 --- [pool-2-thread-2] m.s.r.service.impl.FfmpegServiceImpl     : Error recording M3U stream Example2.mkv: Process execution has ended with non-zero status: 1. Check logs for detailed error message.&#xA;

    &#xA;

    They were supposed to run nearly 3 hours and the other one over 3 hours. And with the timestamps you can see that they are not running nearly as long.&#xA;Thank you for your help !

    &#xA;