
Recherche avancée
Autres articles (81)
-
Keeping control of your media in your hands
13 avril 2011, parThe vocabulary used on this site and around MediaSPIP in general, aims to avoid reference to Web 2.0 and the companies that profit from media-sharing.
While using MediaSPIP, you are invited to avoid using words like "Brand", "Cloud" and "Market".
MediaSPIP is designed to facilitate the sharing of creative media online, while allowing authors to retain complete control of their work.
MediaSPIP aims to be accessible to as many people as possible and development is based on expanding the (...) -
Les sons
15 mai 2013, par -
Soumettre bugs et patchs
10 avril 2011Un logiciel n’est malheureusement jamais parfait...
Si vous pensez avoir mis la main sur un bug, reportez le dans notre système de tickets en prenant bien soin de nous remonter certaines informations pertinentes : le type de navigateur et sa version exacte avec lequel vous avez l’anomalie ; une explication la plus précise possible du problème rencontré ; si possibles les étapes pour reproduire le problème ; un lien vers le site / la page en question ;
Si vous pensez avoir résolu vous même le bug (...)
Sur d’autres sites (5905)
-
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 !


-
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 Unrecognized option 'preset' [closed]
16 mai 2024, par LalaluyeHello I just recently upgraded ffmpeg from 4.3.1 to 7.0 and getting the following error :


my command is

ffmpeg -y -f image2pipe -framerate 24 -i pipe: -c:v libx264 -preset veryfast -crf 29 -pix_fmt yuv420


and getting the below error :


16 May 2024 06:43:28,979 [DEBUG] testIntent (pool-7-thread-3) 
ffmpeg built with gcc 7 (GCC)
16 May 2024 06:43:28,979 [DEBUG] testIntent (pool-7-thread-3) 
configuration: --prefix=/local/p4clients/pkgbuild-JklBW/workspace/src/FFmpeg/build/private/install
16 May 2024 06:43:28,979 [DEBUG] testIntent (pool-7-thread-3) 
ffmpeg libavutil 59. 8.100 / 59. 8.100
16 May 2024 06:43:28,979 [DEBUG] testIntent (pool-7-thread-3) 
ffmpeg libavcodec 61. 3.100 / 61. 3.100
16 May 2024 06:43:28,979 [DEBUG] testIntent (pool-7-thread-3) 
ffmpeg libavformat 61. 1.100 / 61. 1.100
16 May 2024 06:43:28,979 [DEBUG] testIntent (pool-7-thread-3) 
ffmpeg libavdevice 61. 1.100 / 61. 1.100
16 May 2024 06:43:28,979 [DEBUG] testIntent (pool-7-thread-3) 
ffmpeg libavfilter 10. 1.100 / 10. 1.100
16 May 2024 06:43:28,979 [DEBUG] testIntent (pool-7-thread-3) 
ffmpeg libswscale 8. 1.100 / 8. 1.100
16 May 2024 06:43:28,979 [DEBUG] testIntent (pool-7-thread-3) 
ffmpeg libswresample 5. 1.100 / 5. 1.100
16 May 2024 06:43:28,979 [DEBUG] testIntent (pool-7-thread-3) 
ffmpeg Unrecognized option 'preset'.




Haven't found a resolution so far. Any help appreciated