
Recherche avancée
Médias (91)
-
MediaSPIP Simple : futur thème graphique par défaut ?
26 septembre 2013, par
Mis à jour : Octobre 2013
Langue : français
Type : Video
-
avec chosen
13 septembre 2013, par
Mis à jour : Septembre 2013
Langue : français
Type : Image
-
sans chosen
13 septembre 2013, par
Mis à jour : Septembre 2013
Langue : français
Type : Image
-
config chosen
13 septembre 2013, par
Mis à jour : Septembre 2013
Langue : français
Type : Image
-
SPIP - plugins - embed code - Exemple
2 septembre 2013, par
Mis à jour : Septembre 2013
Langue : français
Type : Image
-
GetID3 - Bloc informations de fichiers
9 avril 2013, par
Mis à jour : Mai 2013
Langue : français
Type : Image
Autres articles (65)
-
Ecrire une actualité
21 juin 2013, parPrésentez les changements dans votre MédiaSPIP ou les actualités de vos projets sur votre MédiaSPIP grâce à la rubrique actualités.
Dans le thème par défaut spipeo de MédiaSPIP, les actualités sont affichées en bas de la page principale sous les éditoriaux.
Vous pouvez personnaliser le formulaire de création d’une actualité.
Formulaire de création d’une actualité Dans le cas d’un document de type actualité, les champs proposés par défaut sont : Date de publication ( personnaliser la date de publication ) (...) -
Les tâches Cron régulières de la ferme
1er décembre 2010, parLa gestion de la ferme passe par l’exécution à intervalle régulier de plusieurs tâches répétitives dites Cron.
Le super Cron (gestion_mutu_super_cron)
Cette tâche, planifiée chaque minute, a pour simple effet d’appeler le Cron de l’ensemble des instances de la mutualisation régulièrement. Couplée avec un Cron système sur le site central de la mutualisation, cela permet de simplement générer des visites régulières sur les différents sites et éviter que les tâches des sites peu visités soient trop (...) -
Les formats acceptés
28 janvier 2010, parLes 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 (...)
Sur d’autres sites (6755)
-
FFmpeg -ss parameter is the video duration, Output file is empty
16 avril 2024, par noun nilThe main function is to obtain the corresponding video frame based on the input seconds.Before processing, the duration of the video will be obtained to determine whether the input is within the duration range of the video. If so, the corresponding instruction will be executed.


> ffprobe input.mp4
 ...
 Duration: 00:00:28.05, start: 0.000000, bitrate: 1136 kb/s



> ffmpeg -ss 00:00:28 -i input.mp4 -frames:v 1 output.png
 ffmpeg version 7.0 Copyright (c) 2000-2024 the FFmpeg developers
 built with Apple clang version 15.0.0 (clang-1500.3.9.4)
 configuration: --prefix=/opt/homebrew/Cellar/ffmpeg/7.0 --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-libopenvino --enable-libspeex --enable-libsoxr --enable-libzmq --enable-libzimg --disable-libjack --disable-indev=jack --enable-videotoolbox --enable-audiotoolbox --enable-neon
 libavutil 59. 8.100 / 59. 8.100
 libavcodec 61. 3.100 / 61. 3.100
 libavformat 61. 1.100 / 61. 1.100
 libavdevice 61. 1.100 / 61. 1.100
 libavfilter 10. 1.100 / 10. 1.100
 libswscale 8. 1.100 / 8. 1.100
 libswresample 5. 1.100 / 5. 1.100
 libpostproc 58. 1.100 / 58. 1.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'input.mp4':
 Metadata:
 major_brand : isom
 minor_version : 512
 compatible_brands: isomiso2avc1mp41
 encoder : Lavf58.29.100
 description : Packed by Bilibili XCoder v2.0.2
 Duration: 00:00:28.05, start: 0.000000, bitrate: 1136 kb/s
 Stream #0:0[0x1](und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709, progressive), 720x1280 [SAR 1:1 DAR 9:16], 1005 kb/s, 25.27 fps, 25.25 tbr, 16k tbn (default)
 Metadata:
 handler_name : VideoHandler
 vendor_id : [0][0][0][0]
 Stream #0:1[0x2](und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s (default)
 Metadata:
 handler_name : SoundHandler
 vendor_id : [0][0][0][0]
Stream mapping:
 Stream #0:0 -> #0:0 (h264 (native) -> png (native))
Press [q] to stop, [?] for help
[swscaler @ 0x1187a0000] [swscaler @ 0x110e48000] No accelerated colorspace conversion found from yuv420p to rgb24.
[swscaler @ 0x1187a0000] [swscaler @ 0x110e58000] No accelerated colorspace conversion found from yuv420p to rgb24.
[swscaler @ 0x1187a0000] [swscaler @ 0x110e68000] No accelerated colorspace conversion found from yuv420p to rgb24.
[swscaler @ 0x1187a0000] [swscaler @ 0x110e78000] No accelerated colorspace conversion found from yuv420p to rgb24.
[swscaler @ 0x1187a0000] [swscaler @ 0x110e88000] No accelerated colorspace conversion found from yuv420p to rgb24.
[swscaler @ 0x1187a0000] [swscaler @ 0x110e98000] No accelerated colorspace conversion found from yuv420p to rgb24.
[swscaler @ 0x1187a0000] [swscaler @ 0x110ea8000] No accelerated colorspace conversion found from yuv420p to rgb24.
[swscaler @ 0x1187a0000] [swscaler @ 0x110eb8000] No accelerated colorspace conversion found from yuv420p to rgb24.
[swscaler @ 0x1187a0000] [swscaler @ 0x110ec8000] No accelerated colorspace conversion found from yuv420p to rgb24.
[vost#0:0/png @ 0x12ce06840] No filtered frames for output stream, trying to initialize anyway.
Output #0, image2, to 'output.png':
 Metadata:
 major_brand : isom
 minor_version : 512
 compatible_brands: isomiso2avc1mp41
 description : Packed by Bilibili XCoder v2.0.2
 encoder : Lavf61.1.100
 Stream #0:0(und): Video: png, rgb24(progressive), 720x1280 [SAR 1:1 DAR 9:16], q=2-31, 200 kb/s, 25.25 fps, 16k tbn (default)
 Metadata:
 handler_name : VideoHandler
 vendor_id : [0][0][0][0]
 encoder : Lavc61.3.100 png
[out#0/image2 @ 0x600000e983c0] video:0KiB audio:0KiB subtitle:0KiB other streams:0KiB global headers:0KiB muxing overhead: unknown
[out#0/image2 @ 0x600000e983c0] Output file is empty, nothing was encoded(check -ss / -t / -frames parameters if used)
frame= 0 fps=0.0 q=0.0 Lsize=N/A time=N/A bitrate=N/A speed=N/A 




-ss 00:00:28
within the video duration range, but still cannot obtain frames...

-ss 00:00:27
Can obtain video frames

-
FFmpeg - record from stream terminating unexpectedly using kokorin/Jaffree ffmpeg wrapper for Java
18 avril 2024, par pyrmonI 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 !


-
Thumbnail generation using golang+ffmpeg
23 avril 2024, par godvlprI try to generate thumbnail from video mp4 using Golang+ffmpeg.


Let me provide some steps :


- 

- Tried to generate using terminal
ffmpeg -i test.mp4 -ss 00:00:00 -vframes 1 thumbnail.jpg
- all works successfully - Tried to generate from golang and put result into stdout
cmd := exec.Command("ffmpeg", "-i", "test.mp4", "-ss", "00:00:00", "-vframes", "1", "-f", "image2pipe", "-")
- all works successfully - Trying to open video using
os.ReadFile
andbytes.NewReader
and after that -cmd := exec.Command("ffmpeg", "-i", "pipe:", "-ss", "00:00:00", "-vframes", "1", "-f", "image2pipe", "-")
And in this step I have an error.
Below provided all code and na error








r, err := os.ReadFile("test.mp4")
 if err != nil {
 log.Fatalf("Failed to read video file: %v", err)
 }
 
 videoBuffer := bytes.NewReader(r)

 cmd := exec.Command("ffmpeg", "-i", "pipe:", "-ss", "00:00:00", "-vframes", "1", "-f", "image2pipe", "-")

 cmd.Stdin = videoBuffer

 // Capture output as bytes
 var out bytes.Buffer
 cmd.Stdout = &out

 var stderr bytes.Buffer
 cmd.Stderr = &stderr

 // Run the command
 err = cmd.Run()
 if err != nil {
 log.Fatalf("ffmpeg command failed: %v, stderr: %s", err, stderr.String())
 }

 // Convert bytes to image.Image
 img, _, err := image.Decode(&out)
 if err != nil {
 log.Fatalf("Failed to decode thumbnail: %v", err)
 }



Error


2024/04/23 13:25:51 ffmpeg command failed: exit status 183, stderr: ffmpeg version 7.0 Copyright (c) 2000-2024 the FFmpeg developers
 built with Apple clang version 15.0.0 (clang-1500.3.9.4)
 configuration: --prefix=/opt/homebrew/Cellar/ffmpeg/7.0 --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-libopenvino --enable-libspeex --enable-libsoxr --enable-libzmq --enable-libzimg --disable-libjack --disable-indev=jack --enable-videotoolbox --enable-audiotoolbox --enable-neon
 libavutil 59. 8.100 / 59. 8.100
 libavcodec 61. 3.100 / 61. 3.100
 libavformat 61. 1.100 / 61. 1.100
 libavdevice 61. 1.100 / 61. 1.100
 libavfilter 10. 1.100 / 10. 1.100
 libswscale 8. 1.100 / 8. 1.100
 libswresample 5. 1.100 / 5. 1.100
 libpostproc 58. 1.100 / 58. 1.100
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x136504080] stream 0, offset 0x30: partial file
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x136504080] Could not find codec parameters for stream 0 (Video: h264 (avc1 / 0x31637661), none, 1920x1080, 3496 kb/s): unspecified pixel format
Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'pipe:':
 Metadata:
 major_brand : isom
 minor_version : 512
 compatible_brands: isomiso2avc1mp41
 encoder : Lavf58.26.100
 Duration: 00:00:02.01, start: 0.000000, bitrate: N/A
 Stream #0:0[0x1](und): Video: h264 (avc1 / 0x31637661), none, 1920x1080, 3496 kb/s, 25 fps, 25 tbr, 12800 tbn (default)
 Metadata:
 handler_name : VideoHandler
 vendor_id : [0][0][0][0]
 Stream #0:1[0x2](und): Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 96 kb/s (default)
 Metadata:
 handler_name : SoundHandler
 vendor_id : [0][0][0][0]
Stream mapping:
 Stream #0:0 -> #0:0 (h264 (native) -> mjpeg (native))
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x136504080] stream 0, offset 0x30: partial file
[in#0/mov,mp4,m4a,3gp,3g2,mj2 @ 0x600001134000] Error during demuxing: Invalid data found when processing input
Cannot determine format of input 0:0 after EOF
[vf#0:0 @ 0x600001f2c000] Task finished with error code: -1094995529 (Invalid data found when processing input)
[vf#0:0 @ 0x600001f2c000] Terminating thread with return code -1094995529 (Invalid data found when processing input)
[vost#0:0/mjpeg @ 0x104a04650] Could not open encoder before EOF
[vost#0:0/mjpeg @ 0x104a04650] Task finished with error code: -22 (Invalid argument)
[vost#0:0/mjpeg @ 0x104a04650] Terminating thread with return code -22 (Invalid argument)
[out#0/image2pipe @ 0x60000182c000] Nothing was written into output file, because at least one of its streams received no packets.
frame= 0 fps=0.0 q=0.0 Lsize= 0KiB time=N/A bitrate=N/A speed=N/A 
Conversion failed!



Also tried to do something like this
cmd := exec.Command("ffmpeg", "-analyzeduration", "10000M", "-probesize", "10000M", "-i", "pipe:", "-ss", "00:00:00", "-vframes", "1", "-f", "image2pipe", "-")
- and had the same error (almost the same).

How to fix code or ffmpeg command - to bring this code workable ?


- Tried to generate using terminal