Recherche avancée

Médias (1)

Mot : - Tags -/musée

Autres articles (27)

  • Les formats acceptés

    28 janvier 2010, par

    Les commandes suivantes permettent d’avoir des informations sur les formats et codecs gérés par l’installation local de ffmpeg :
    ffmpeg -codecs ffmpeg -formats
    Les format videos acceptés en entrée
    Cette liste est non exhaustive, elle met en exergue les principaux formats utilisés : h264 : H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 m4v : raw MPEG-4 video format flv : Flash Video (FLV) / Sorenson Spark / Sorenson H.263 Theora wmv :
    Les formats vidéos de sortie possibles
    Dans un premier temps on (...)

  • Dépôt de média et thèmes par FTP

    31 mai 2013, par

    L’outil MédiaSPIP traite aussi les média transférés par la voie FTP. Si vous préférez déposer par cette voie, récupérez les identifiants d’accès vers votre site MédiaSPIP et utilisez votre client FTP favori.
    Vous trouverez dès le départ les dossiers suivants dans votre espace FTP : config/ : dossier de configuration du site IMG/ : dossier des média déjà traités et en ligne sur le site local/ : répertoire cache du site web themes/ : les thèmes ou les feuilles de style personnalisées tmp/ : dossier de travail (...)

  • Les thèmes de MediaSpip

    4 juin 2013

    3 thèmes sont proposés à l’origine par MédiaSPIP. L’utilisateur MédiaSPIP peut rajouter des thèmes selon ses besoins.
    Thèmes MediaSPIP
    3 thèmes ont été développés au départ pour MediaSPIP : * SPIPeo : thème par défaut de MédiaSPIP. Il met en avant la présentation du site et les documents média les plus récents ( le type de tri peut être modifié - titre, popularité, date) . * Arscenic : il s’agit du thème utilisé sur le site officiel du projet, constitué notamment d’un bandeau rouge en début de page. La structure (...)

Sur d’autres sites (4261)

  • 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.

    


    I have implemented the recording like this :

    


    @Override
    public void startRecording(RecordingSchedule recordingSchedule) {
        logger.info("Starting recording for schedule with filename {}", recordingSchedule.getFileName());

        String m3uUrl = recordingSchedule.getM3uUrl();
        LocalDateTime endTime = timeUtils.parseStringToLocalDateTime(recordingSchedule.getEndTime());
        LocalDateTime stopTime = endTime.plusSeconds(20);
        String timeToRecord = timeUtils.calculateTimeToRecord(stopTime);
        Path outputPath = Paths.get("/recordings/" + recordingSchedule.getFileName());

        try {
            FFmpeg.atPath()
                  .addInput(UrlInput.fromUrl(m3uUrl))
                  .addArgument("-xerror")
                  .addArguments("-reconnect", "5")
                  .addArguments("-reconnect_streamed", "5")
                  .addArguments("-reconnect_delay_max", "20")
                  .addArguments("-t", timeToRecord)
                  .addArguments("-c", "copy")
                  .addOutput(
                      UrlOutput.toPath(outputPath))
                  .setLogLevel(LogLevel.WARNING)
                  .execute();
            logger.info("Recording complete. Output file: {}", outputPath.toAbsolutePath());
        } catch (Exception e) {
            logger.error("Error recording M3U stream {}: {}", recordingSchedule.getFileName(), e.getMessage());
        }
    }


    


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

    


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

    


    2024-04-18T00:54:48.689+02:00  INFO 1 --- [pool-2-thread-1] m.s.r.service.impl.FfmpegServiceImpl     : Starting recording for schedule with filename Example1.mkv
2024-04-18T00:54:48.697+02:00  WARN 1 --- [pool-2-thread-1] c.github.kokorin.jaffree.ffmpeg.FFmpeg   : ProgressListener isn't set, progress won't be reported
2024-04-18T00:54:48.698+02:00  INFO 1 --- [pool-2-thread-1] c.g.k.jaffree.process.ProcessHandler     : Command constructed:
ffmpeg -loglevel level+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
2024-04-18T00:54:48.698+02:00  INFO 1 --- [pool-2-thread-1] c.g.k.jaffree.process.ProcessHandler     : Starting process: ffmpeg
2024-04-18T00:54:48.701+02:00  INFO 1 --- [pool-2-thread-1] c.g.k.jaffree.process.ProcessHandler     : Waiting for process to finish
2024-04-18T01:31:02.633+02:00  WARN 1 --- [         StdErr] c.g.k.jaffree.process.BaseStdReader      : [h264 @ 0x559cd22dd940] [warning] Increasing reorder buffer to 2
2024-04-18T01:31:02.633+02:00  INFO 1 --- [pool-2-thread-1] c.g.k.jaffree.process.ProcessHandler     : Process has finished with status: 0
2024-04-18T01:31:02.734+02:00  INFO 1 --- [pool-2-thread-1] m.s.r.service.impl.FfmpegServiceImpl     : Recording complete. Output file: /recordings/Example1.mkv

2024-04-18T03:54:48.678+02:00  INFO 1 --- [pool-2-thread-2] m.s.r.service.impl.FfmpegServiceImpl     : Starting recording for schedule with filename Example2.mkv
2024-04-18T03:54:48.678+02:00  WARN 1 --- [pool-2-thread-2] c.github.kokorin.jaffree.ffmpeg.FFmpeg   : ProgressListener isn't set, progress won't be reported
2024-04-18T03:54:48.678+02:00  INFO 1 --- [pool-2-thread-2] c.g.k.jaffree.process.ProcessHandler     : Command constructed:
ffmpeg -loglevel level+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
2024-04-18T03:54:48.678+02:00  INFO 1 --- [pool-2-thread-2] c.g.k.jaffree.process.ProcessHandler     : Starting process: ffmpeg
2024-04-18T03:54:48.679+02:00  INFO 1 --- [pool-2-thread-2] c.g.k.jaffree.process.ProcessHandler     : Waiting for process to finish
2024-04-18T04:57:22.256+02:00  WARN 1 --- [         StdErr] c.g.k.jaffree.process.BaseStdReader      : [h264 @ 0x55707ba988c0] [warning] Increasing reorder buffer to 3
2024-04-18T04:58:47.455+02:00 ERROR 1 --- [         StdErr] c.g.k.jaffree.process.BaseStdReader      : [NULL @ 0x55707ba988c0] [error] Picture timing SEI payload too large
2024-04-18T04:58:47.456+02:00 ERROR 1 --- [         StdErr] c.g.k.jaffree.process.BaseStdReader      : [NULL @ 0x55707ba988c0] [error] non-existing PPS 1 referenced
2024-04-18T04:58:47.456+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
2024-04-18T04:58:47.456+02:00 ERROR 1 --- [         StdErr] c.g.k.jaffree.process.BaseStdReader      : [matroska @ 0x55707ba9a380] [error] Can't write packet with unknown timestamp
2024-04-18T04:58:47.463+02:00 ERROR 1 --- [         StdErr] c.g.k.jaffree.process.BaseStdReader      : [error] av_interleaved_write_frame(): Invalid argument
2024-04-18T04:58:47.463+02:00  INFO 1 --- [pool-2-thread-2] c.g.k.jaffree.process.ProcessHandler     : Process has finished with status: 1
2024-04-18T04:58:47.564+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.


    


    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.
Thank you for your help !

    


  • 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

    


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

    


    The output ffmpeg is like this :

    


    ffmpeg version 7.1 Copyright (c) 2000-2024 the FFmpeg developers
  built with Apple clang version 15.0.0 (clang-1500.1.0.2.5)
  configuration: --prefix=/opt/homebrew/Cellar/ffmpeg/7.1 --enable-shared --enable-pthreads --enable-version3 --cc=clang --host-cflags= --host-ldflags='-Wl,-ld_classic' --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
  libavutil      59. 39.100 / 59. 39.100
  libavcodec     61. 19.100 / 61. 19.100
  libavformat    61.  7.100 / 61.  7.100
  libavdevice    61.  3.100 / 61.  3.100
  libavfilter    10.  4.100 / 10.  4.100
  libswscale      8.  3.100 /  8.  3.100
  libswresample   5.  3.100 /  5.  3.100
  libpostproc    58.  3.100 / 58.  3.100
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x127704880] st: 0 edit list: 1 Missing key frame while searching for timestamp: 0
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x127704880] st: 0 edit list 1 Cannot find an index entry before timestamp: 0.
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'idurre-2024-09-17-12h33m19s.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 0
    compatible_brands: mp41avc1
    creation_time   : 2024-09-17T10:34:16.000000Z
    encoder         : vlc 3.0.21 stream output
    encoder-eng     : vlc 3.0.21 stream output
  Duration: 00:00:55.68, start: 0.000000, bitrate: 16205 kb/s
  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)
      Metadata:
        creation_time   : 2024-09-17T10:34:16.000000Z
        handler_name    : VideoHandler
        vendor_id       : [0][0][0][0]
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
Output #0, rtsp, to 'rtsp://localhost:8554/test':
  Metadata:
    major_brand     : isom
    minor_version   : 0
    compatible_brands: mp41avc1
    encoder         : Lavf61.7.100
  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)
      Metadata:
        creation_time   : 2024-09-17T10:34:16.000000Z
        handler_name    : VideoHandler
        vendor_id       : [0][0][0][0]
Press [q] to stop, [?] for help
frame=  516 fps= 26 q=-1.0 size=N/A time=00:00:20.63 bitrate=N/A speed=1.03x    

[q] command received. Exiting.

[out#0/rtsp @ 0x6000008e0240] video:40672KiB audio:0KiB subtitle:0KiB other streams:0KiB global headers:0KiB muxing overhead: unknown
frame=  528 fps= 26 q=-1.0 Lsize=N/A time=00:00:21.11 bitrate=N/A speed=1.02x    


    


    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 :

    


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


    


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

    


  • using mediamtx to stream video to browser [closed]

    18 octobre 2024, par Maximilian

    I am using rtsp to feed a video stream to mediamtx.

    


    I want to display the feed in a browser but always get some errors.

    


    I use the following to start mediamtx

    


    podman run --rm -it -e MTX_PROTOCOLS=tcp -e MTX_WEBRTCADDITIONALHOSTS=192.168.x.x -p 8554:8554 -p 1935:1935 -p 8888:8888 -p 8889:8889 -p 8890:8890/udp -p 8189:8189/udp docker.io/bluenviron/mediamtx


    


    I use this ffmpeg line to feed mediamtx :

    


    ffmpeg -i "rtsp://127.0.0.1:10000/test" -f rtsp rtsp://127.0.0.1:8554/feed


    


    I can view the feed with

    


    ffplay  rtsp://localhost:8554/feed


    


    ffplay says some things about my stream

    


    the mediamtx stream

    


    Input #0, rtsp, from 'rtsp://localhost:8554/feed':
  Metadata:
    title           : Session streamed with GStreamer
  Duration: N/A, start: 0.000000, bitrate: N/A
  Stream #0:0: Video: mpeg4 (Simple Profile), yuv420p, 320x240 [SAR 1:1 DAR 4:3], 30 tbr, 90k tbn, 30 tbc


    


    the source stream

    


    Input #0, rtsp, from 'rtsp://localhost:10000/test':
  Metadata:
    title           : Session streamed with GStreamer
    comment         : rtsp-server
  Duration: N/A, start: 0.199989, bitrate: N/A
  Stream #0:0: Video: h264 (Constrained Baseline), yuv420p(tv, smpte170m, progressive), 320x240 [SAR 1:1 DAR 4:3], 30 fps, 30 tbr, 90k tbn, 60 tbc


    


    I use this html code try to display the video :

    


    
    



    


    mediamtx gives the following output when the browser tries to connect :

    


    2024/10/18 07:52:51 INF [RTSP] [session 7fe6a91a] created by 10.0.2.100:57542
2024/10/18 07:52:51 INF [RTSP] [session 7fe6a91a] is publishing to path 'feed', 1 track (MPEG-4 Video)
2024/10/18 07:52:52 INF [WebRTC] [session 9d4fb884] created by 10.0.2.100:55070
2024/10/18 07:52:52 INF [WebRTC] [session 9d4fb884] closed: the stream doesn't contain any supported codec, which are currently AV1, VP9, VP8, H264, Opus, G722, G711, LPCM


    


    The stream is clearly h264... why is it complaining ?