
Recherche avancée
Médias (91)
-
Chuck D with Fine Arts Militia - No Meaning No
15 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Paul Westerberg - Looking Up in Heaven
15 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Le Tigre - Fake French
15 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Thievery Corporation - DC 3000
15 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Dan the Automator - Relaxation Spa Treatment
15 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Gilberto Gil - Oslodum
15 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
Autres articles (94)
-
Contribute to a better visual interface
13 avril 2011MediaSPIP is based on a system of themes and templates. Templates define the placement of information on the page, and can be adapted to a wide range of uses. Themes define the overall graphic appearance of the site.
Anyone can submit a new graphic theme or template and make it available to the MediaSPIP community. -
Le profil des utilisateurs
12 avril 2011, parChaque utilisateur dispose d’une page de profil lui permettant de modifier ses informations personnelle. Dans le menu de haut de page par défaut, un élément de menu est automatiquement créé à l’initialisation de MediaSPIP, visible uniquement si le visiteur est identifié sur le site.
L’utilisateur a accès à la modification de profil depuis sa page auteur, un lien dans la navigation "Modifier votre profil" est (...) -
Configuration spécifique pour PHP5
4 février 2011, parPHP5 est obligatoire, vous pouvez l’installer en suivant ce tutoriel spécifique.
Il est recommandé dans un premier temps de désactiver le safe_mode, cependant, s’il est correctement configuré et que les binaires nécessaires sont accessibles, MediaSPIP devrait fonctionner correctement avec le safe_mode activé.
Modules spécifiques
Il est nécessaire d’installer certains modules PHP spécifiques, via le gestionnaire de paquet de votre distribution ou manuellement : php5-mysql pour la connectivité avec la (...)
Sur d’autres sites (6348)
-
Error : Output format mp4 is not available
12 avril 2024, par alpaca pwaaI'm using fluent-ffmpeg in my nextjs application, I'm trying to process the video and specified a format to stream on my s3 bucket but it keeps on failing. My terminal keeps on throwing "Error : Error : Output format mp4 is not available". I already verify my ffmpeg format "ffmpeg -format" and confirm that it supports encoding and decoding mp4 files. I've already tried solutions from other forums but it's not working for me.


createVideo: privateProcedure
 .input(
 z.object({
 fileId: z.string(),
 })
 )
 .mutation(async ({ ctx, input }) => {
 const { getUser } = getKindeServerSession();
 const user = await getUser();

 if (!user || !user.id || !user.email) {
 throw new TRPCError({ code: "UNAUTHORIZED" });
 }

 const dbUser = await db.user.findFirst({
 where: {
 id: user.id,
 },
 });

 if (!dbUser) {
 throw new TRPCError({
 code: "UNAUTHORIZED",
 message: "User not found in the database.",
 });
 }

 const putObjectCommand = new PutObjectCommand({
 Bucket: process.env.AWS_BUCKET_NAME!,
 Key: generateFileName(),
 });

 const s3 = new S3Client({
 region: process.env.AWS_BUCKET_REGION!,
 credentials: {
 accessKeyId: process.env.AWS_ACCESS_KEY!,
 secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY!,
 },
 });

 const singedURL = await getSignedUrl(s3, putObjectCommand, {
 expiresIn: 60,
 });

 const ffmpeg = require("fluent-ffmpeg");
 const passthroughStream = new PassThrough();

 ffmpeg({ source: "./template1.mp4" })
 .on("end", async () => {
 console.log("Job done");
 await uploadToS3(passthroughStream);
 })
 .on("error", (error: string) => {
 console.error("Error:", error);
 throw new Error("Error processing video");
 })
 .videoFilter({
 filter: "drawtext",
 options: {
 text: "hi",
 fontsize: 24,
 fontcolor: "white",
 x: "(w-text_w)/2",
 y: "(h-text_h)/2",
 box: 1,
 boxcolor: "black@0.5",
 boxborderw: 5,
 fontfile: "/Windows/fonts/calibri.ttf",
 },
 })
 .videoCodec("libx264")
 .outputFormat("mp4")
 .outputOptions(["-movflags frag_keyframe+empty_moov"])
 .pipe(passthroughStream, { end: true });

 const uploadToS3 = async (stream: PassThrough) => {
 const upload = new Upload({
 client: s3,
 params: {
 Bucket: process.env.AWS_BUCKET_NAME!,
 Key: generateFileName(),
 Body: stream,
 },
 });
 await upload.done();
 };

 await new Promise((resolve, reject) => {
 passthroughStream.on("end", resolve);
 passthroughStream.on("error", reject);
 });

 const createdVideo = await db.video.create({
 data: {
 name: "Test Name",
 url: singedURL.split("?")[0],
 key: singedURL,
 fileId: input.fileId,
 },
 });

 return createdVideo;
 }),



Here's the ffmpeg log.


ffmpeg started on 2024-04-11 at 20:58:56
Report written to "ffmpeg-20240411-205856.log"
Log level: 48
Command line:
"C:\\ProgramData\\chocolatey\\lib\\ffmpeg-full\\tools\\ffmpeg\\bin\\ffmpeg.exe" -i ./template1.mp4 -filter:v "drawtext=text=hi:fontsize=24:fontcolor=white:x=(w-text_w)/2:y=(h-text_h)/2:box=1:boxcolor=black@0.5:boxborderw=5:fontfile=/Windows/fonts/calibri.ttf" -report pipe:1
ffmpeg version 7.0-full_build-www.gyan.dev Copyright (c) 2000-2024 the FFmpeg developers
 built with gcc 13.2.0 (Rev5, Built by MSYS2 project)
 configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-bzlib --enable-lzma --enable-libsnappy --enable-zlib --enable-librist --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libaribb24 --enable-libaribcaption --enable-libdav1d --enable-libdavs2 --enable-libuavs3d --enable-libxevd --enable-libzvbi --enable-librav1e --enable-libsvtav1 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxeve --enable-libxvid --enable-libaom --enable-libjxl --enable-libopenjpeg --enable-libvpx --enable-mediafoundation --enable-libass --enable-frei0r --enable-libfreetype --enable-libfribidi --enable-libharfbuzz --enable-liblensfun --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-dxva2 --enable-d3d11va --enable-d3d12va --enable-f 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
Splitting the commandline.
Reading option '-i' ... matched as input url with argument './template1.mp4'.
Reading option '-filter:v' ... matched as option 'filter' (apply specified filters to audio/video) with argument 'drawtext=text=hi:fontsize=24:fontcolor=white:x=(w-text_w)/2:y=(h-text_h)/2:box=1:boxcolor=black@0.5:boxborderw=5:fontfile=/Windows/fonts/calibri.ttf'.
Reading option '-report' ... matched as option 'report' (generate a report) with argument '1'.
Reading option 'pipe:1' ... matched as output url.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option report (generate a report) with argument 1.
Successfully parsed a group of options.
Parsing a group of options: input url ./template1.mp4.
Successfully parsed a group of options.
Opening an input file: ./template1.mp4.
[AVFormatContext @ 00000262cd0888c0] Opening './template1.mp4' for reading
[file @ 00000262cd0a94c0] Setting default whitelist 'file,crypto,data'
[mov,mp4,m4a,3gp,3g2,mj2 @ 00000262cd0888c0] Format mov,mp4,m4a,3gp,3g2,mj2 probed with size=2048 and score=100
[mov,mp4,m4a,3gp,3g2,mj2 @ 00000262cd0888c0] ISO: File Type Major Brand: isom
[mov,mp4,m4a,3gp,3g2,mj2 @ 00000262cd0888c0] Unknown dref type 0x206c7275 size 12
[mov,mp4,m4a,3gp,3g2,mj2 @ 00000262cd0888c0] Processing st: 0, edit list 0 - media time: 1024, duration: 126981
[mov,mp4,m4a,3gp,3g2,mj2 @ 00000262cd0888c0] Offset DTS by 1024 to make first pts zero.
[mov,mp4,m4a,3gp,3g2,mj2 @ 00000262cd0888c0] Setting codecpar->delay to 2 for stream st: 0
[mov,mp4,m4a,3gp,3g2,mj2 @ 00000262cd0888c0] Before avformat_find_stream_info() pos: 6965 bytes read:32768 seeks:0 nb_streams:1
[h264 @ 00000262cd0bb140] nal_unit_type: 7(SPS), nal_ref_idc: 3
[h264 @ 00000262cd0bb140] Decoding VUI
[h264 @ 00000262cd0bb140] nal_unit_type: 8(PPS), nal_ref_idc: 3
[h264 @ 00000262cd0bb140] nal_unit_type: 7(SPS), nal_ref_idc: 3
[h264 @ 00000262cd0bb140] Decoding VUI
[h264 @ 00000262cd0bb140] nal_unit_type: 8(PPS), nal_ref_idc: 3
[h264 @ 00000262cd0bb140] Decoding VUI
[h264 @ 00000262cd0bb140] nal_unit_type: 6(SEI), nal_ref_idc: 0
[h264 @ 00000262cd0bb140] nal_unit_type: 7(SPS), nal_ref_idc: 3
[h264 @ 00000262cd0bb140] nal_unit_type: 8(PPS), nal_ref_idc: 3
[h264 @ 00000262cd0bb140] nal_unit_type: 5(IDR), nal_ref_idc: 3
[h264 @ 00000262cd0bb140] Decoding VUI
[h264 @ 00000262cd0bb140] Format yuv420p chosen by get_format().
[h264 @ 00000262cd0bb140] Reinit context to 1088x1920, pix_fmt: yuv420p
[h264 @ 00000262cd0bb140] no picture 
[mov,mp4,m4a,3gp,3g2,mj2 @ 00000262cd0888c0] All info found
[mov,mp4,m4a,3gp,3g2,mj2 @ 00000262cd0888c0] After avformat_find_stream_info() pos: 82242 bytes read:82242 seeks:0 frames:1
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from './template1.mp4':
 Metadata:
 major_brand : isom
 minor_version : 512
 compatible_brands: isomiso2avc1mp41
 encoder : Lavf58.76.100
 Duration: 00:00:08.27, start: 0.000000, bitrate: 3720 kb/s
 Stream #0:0[0x1](und), 1, 1/15360: Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709, progressive), 1080x1920, 3714 kb/s, 30 fps, 30 tbr, 15360 tbn (default)
 Metadata:
 handler_name : VideoHandler
 vendor_id : [0][0][0][0]
Successfully opened the file.
Parsing a group of options: output url pipe:1.
Applying option filter:v (apply specified filters to audio/video) with argument drawtext=text=hi:fontsize=24:fontcolor=white:x=(w-text_w)/2:y=(h-text_h)/2:box=1:boxcolor=black@0.5:boxborderw=5:fontfile=/Windows/fonts/calibri.ttf.
Successfully parsed a group of options.
Opening an output file: pipe:1.
[AVFormatContext @ 00000262cd0b2240] Unable to choose an output format for 'pipe:1'; use a standard extension for the filename or specify the format manually.
[out#0 @ 00000262cd0bb300] Error initializing the muxer for pipe:1: Invalid argument
Error opening output file pipe:1.
Error opening output files: Invalid argument
[AVIOContext @ 00000262cd0a9580] Statistics: 82242 bytes read, 0 seeks



I should be able to stream the processed video to my s3, but it keeps on throwing "Error : Error : Output format mp4 is not available"


-
Unable to stream video file from MediaMTX media server to browser via WebRTC
8 juin 2024, par thegreatjediI took over a repository at work. It's a working demo comprising a web server which receives video and camera feeds from a media server (built from the rtsp-simple-server Docker image) via a RTSP relay server and streams the feeds to the client, all deployed via Docker Compose.


I'm trying to switch over to use WebRTC instead. rtsp-simple-server has upgraded into MediaMTX since the time the demo was created 2 years ago. This is the relevant section of the updated Docker Compose configuration :


media-server:
 image: bluenviron/mediamtx:latest-ffmpeg
 expose:
 - 8889
 init: true
 ports:
 - 8889:8889
 restart: unless-stopped
 volumes:
 - type: bind
 source: ./demo/vids
 target: /vids
 - type: bind
 source: ./demo/mediamtx.yml
 target: /mediamtx.yml



Relevant part of the MediaMTX custom configuration in
mediamtx.yml
:

###############################################
# Path settings

# Settings in "paths" are applied to specific paths, and the map key
# is the name of the path.
# Any setting in "pathDefaults" can be overridden here.
# It's possible to use regular expressions by using a tilde as prefix,
# for example "~^(test1|test2)$" will match both "test1" and "test2",
# for example "~^prefix" will match all paths that start with "prefix".
paths:
 # example:
 # my_camera:
 # source: rtsp://my_camera
 ~^demo\d+$:
 runOnDemand: ffmpeg -re -stream_loop -1 -i /vids/$MTX_PATH.mp4 -c:v libvpx -b:v 0 -crf 18 -qmin 18 -qmax 18 -f webm http://localhost:8889/$MTX_PATH/whip

 # Settings under path "all_others" are applied to all paths that
 # do not match another entry.
 all_others:



I've absolutely no experience with WebRTC. This is my first time hearing of this protocol, let alone working with it. From what I understand, I need to convert my demo mp4 videos (which were successfully streaming via RTSP in the previous implementation) to a compatible video codec, so I've opted for VP8.


Before trying to stream the videos into my web server, I tested the stream directly in the browser (tried with both the latest versions of Chrome and Edge). I went to
http://localhost:8889/demo0
(which should convert demo0.mp4 to VP8 and then stream it over WebRTC). The video player loaded in the browser but no video data was received and nothing played. After several seconds, the screen displayed "Error : bad status code 400, retrying in some seconds". In the browser console, it showed :

Failed to load resource : the server responded with a status of 400 (Bad Request)


Inside the MediaMTX container's runtime logs, this is what's displayed :


2024-04-02 14:53:08 ffmpeg version 6.1.1 Copyright (c) 2000-2023 the FFmpeg developers
2024-04-02 14:53:08 built with gcc 13.2.1 (Alpine 13.2.1_git20231014) 20231014
2024-04-02 14:53:08 configuration: --prefix=/usr --disable-librtmp --disable-lzma --disable-static --disable-stripping --enable-avfilter --enable-gpl --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libdav1d --enable-libdrm --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libharfbuzz --enable-libmp3lame --enable-libopenmpt --enable-libopus --enable-libplacebo --enable-libpulse --enable-librav1e --enable-librist --enable-libsoxr --enable-libsrt --enable-libssh --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxml2 --enable-libxvid --enable-libzimg --enable-libzmq --enable-lto=auto --enable-lv2 --enable-openssl --enable-pic --enable-postproc --enable-pthreads --enable-shared --enable-vaapi --enable-vdpau --enable-version3 --enable-vulkan --optflags=-O3 --enable-libjxl --enable-libsvtav1 --enable-libvpl
2024-04-02 14:53:08 libavutil 58. 29.100 / 58. 29.100
2024-04-02 14:53:08 libavcodec 60. 31.102 / 60. 31.102
2024-04-02 14:53:08 libavformat 60. 16.100 / 60. 16.100
2024-04-02 14:53:08 libavdevice 60. 3.100 / 60. 3.100
2024-04-02 14:53:08 libavfilter 9. 12.100 / 9. 12.100
2024-04-02 14:53:08 libswscale 7. 5.100 / 7. 5.100
2024-04-02 14:53:08 libswresample 5. 0.100 / 5. 0.100
2024-04-02 14:53:08 libpostproc 57. 3.100 / 57. 3.100
2024-04-02 14:53:08 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/vids/demo0.mp4':
2024-04-02 14:53:08 Metadata:
2024-04-02 14:53:08 major_brand : isom
2024-04-02 14:53:08 minor_version : 512
2024-04-02 14:53:08 compatible_brands: isomiso2mp41
2024-04-02 14:53:08 encoder : Lavf58.76.100
2024-04-02 14:53:08 Duration: 00:00:03.47, start: 0.000000, bitrate: 1675 kb/s
2024-04-02 14:53:08 Stream #0:0[0x1](und): Video: mpeg1video (mp4v / 0x7634706D), yuv420p(tv, progressive), 640x360 [SAR 1:1 DAR 16:9], 104857 kb/s, 30 fps, 30 tbr, 90k tbn (default)
2024-04-02 14:53:08 Metadata:
2024-04-02 14:53:08 handler_name : VideoHandler
2024-04-02 14:53:08 vendor_id : [0][0][0][0]
2024-04-02 14:53:08 Side data:
2024-04-02 14:53:08 cpb: bitrate max/min/avg: 0/0/0 buffer size: 49152 vbv_delay: N/A
2024-04-02 14:53:08 Stream mapping:
2024-04-02 14:53:08 Stream #0:0 -> #0:0 (mpeg1video (native) -> vp8 (libvpx))
2024-04-02 14:53:08 Press [q] to stop, [?] for help
2024-04-02 14:53:08 [libvpx @ 0x7faa8591b8c0] v1.13.1
2024-04-02 14:53:08 [libvpx @ 0x7faa8591b8c0] Bitrate not specified for constrained quality mode, using default of 256kbit/sec
2024-04-02 14:53:08 Output #0, webm, to 'http://localhost:8889/demo0/whip':
2024-04-02 14:53:08 Metadata:
2024-04-02 14:53:08 major_brand : isom
2024-04-02 14:53:08 minor_version : 512
2024-04-02 14:53:08 compatible_brands: isomiso2mp41
2024-04-02 14:53:08 encoder : Lavf60.16.100
2024-04-02 14:53:08 Stream #0:0(und): Video: vp8, yuv420p(tv, progressive), 640x360 [SAR 1:1 DAR 16:9], q=2-31, 256 kb/s, 30 fps, 1k tbn (default)
2024-04-02 14:53:08 Metadata:
2024-04-02 14:53:08 handler_name : VideoHandler
2024-04-02 14:53:08 vendor_id : [0][0][0][0]
2024-04-02 14:53:08 encoder : Lavc60.31.102 libvpx
2024-04-02 14:53:08 Side data:
2024-04-02 14:53:08 cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A
2024-04-02 14:53:18 2024/04/02 06:53:18 INF [path demo0] runOnDemand command stopped: timed out
2024-04-02 14:53:18 2024/04/02 06:53:18 INF [WebRTC] [session 0f460c76] closed: source of path 'demo0' has timed out
[out#0/webm @ 0x7faa859487c0] video:272kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 1.042856%
2024-04-02 14:53:18 frame= 315 fps= 32 q=18.0 Lsize= 275kB time=00:00:10.46 bitrate= 215.1kbits/s speed=1.05x 
2024-04-02 14:53:18 Exiting normally, received signal 2.



I'm not sure what this is supposed to mean ? Why isn't the server able to stream this 3-second, 709kb video even once ? The browser connected to the server and the URL successfully, but no data was being transferred.


Just in case, I decided to manually convert all of my mp4 files to webm using ffmpeg, and verified with Window's media player that the webm videos work. Then, I modified MediaMTX's configuration to stream the webm videos directly :


paths:
 # example:
 # my_camera:
 # source: rtsp://my_camera
 ~^demo\d+$:
 runOnDemand: ffmpeg -re -stream_loop -1 -i /vids/$MTX_PATH.webm -c copy -f webm http://localhost:8889/$MTX_PATH/whip



However, the error persists :


2024-04-02 15:03:58 ffmpeg version 6.1.1 Copyright (c) 2000-2023 the FFmpeg developers
2024-04-02 15:03:58 built with gcc 13.2.1 (Alpine 13.2.1_git20231014) 20231014
2024-04-02 15:03:58 configuration: --prefix=/usr --disable-librtmp --disable-lzma --disable-static --disable-stripping --enable-avfilter --enable-gpl --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libdav1d --enable-libdrm --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libharfbuzz --enable-libmp3lame --enable-libopenmpt --enable-libopus --enable-libplacebo --enable-libpulse --enable-librav1e --enable-librist --enable-libsoxr --enable-libsrt --enable-libssh --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxml2 --enable-libxvid --enable-libzimg --enable-libzmq --enable-lto=auto --enable-lv2 --enable-openssl --enable-pic --enable-postproc --enable-pthreads --enable-shared --enable-vaapi --enable-vdpau --enable-version3 --enable-vulkan --optflags=-O3 --enable-libjxl --enable-libsvtav1 --enable-libvpl
2024-04-02 15:03:58 libavutil 58. 29.100 / 58. 29.100
2024-04-02 15:03:58 libavcodec 60. 31.102 / 60. 31.102
2024-04-02 15:03:58 libavformat 60. 16.100 / 60. 16.100
2024-04-02 15:03:58 libavdevice 60. 3.100 / 60. 3.100
2024-04-02 15:03:58 libavfilter 9. 12.100 / 9. 12.100
2024-04-02 15:03:58 libswscale 7. 5.100 / 7. 5.100
2024-04-02 15:03:58 libswresample 5. 0.100 / 5. 0.100
2024-04-02 15:03:58 libpostproc 57. 3.100 / 57. 3.100
2024-04-02 15:03:58 Input #0, matroska,webm, from '/vids/demo0.webm':
2024-04-02 15:03:58 Metadata:
2024-04-02 15:03:58 COMPATIBLE_BRANDS: isomiso2mp41
2024-04-02 15:03:58 MAJOR_BRAND : isom
2024-04-02 15:03:58 MINOR_VERSION : 512
2024-04-02 15:03:58 ENCODER : Lavf60.16.100
2024-04-02 15:03:58 Duration: 00:00:03.47, start: 0.000000, bitrate: 217 kb/s
2024-04-02 15:03:58 Stream #0:0: Video: vp8, yuv420p(tv, progressive), 640x360, SAR 1:1 DAR 16:9, 30 fps, 30 tbr, 1k tbn (default)
2024-04-02 15:03:58 Metadata:
2024-04-02 15:03:58 HANDLER_NAME : VideoHandler
2024-04-02 15:03:58 VENDOR_ID : [0][0][0][0]
2024-04-02 15:03:58 ENCODER : Lavc60.31.102 libvpx
2024-04-02 15:03:58 DURATION : 00:00:03.466000000
2024-04-02 15:03:58 Output #0, webm, to 'http://localhost:8889/demo0/whip':
2024-04-02 15:03:58 Metadata:
2024-04-02 15:03:58 COMPATIBLE_BRANDS: isomiso2mp41
2024-04-02 15:03:58 MAJOR_BRAND : isom
2024-04-02 15:03:58 MINOR_VERSION : 512
2024-04-02 15:03:58 encoder : Lavf60.16.100
2024-04-02 15:03:58 Stream #0:0: Video: vp8, yuv420p(tv, progressive), 640x360 [SAR 1:1 DAR 16:9], q=2-31, 30 fps, 30 tbr, 1k tbn (default)
2024-04-02 15:03:58 Metadata:
2024-04-02 15:03:58 HANDLER_NAME : VideoHandler
2024-04-02 15:03:58 VENDOR_ID : [0][0][0][0]
2024-04-02 15:03:58 ENCODER : Lavc60.31.102 libvpx
2024-04-02 15:03:58 DURATION : 00:00:03.466000000
2024-04-02 15:03:58 Stream mapping:
2024-04-02 15:03:58 Stream #0:0 -> #0:0 (copy)
2024-04-02 15:03:58 Press [q] to stop, [?] for help
2024-04-02 15:04:08 2024/04/02 07:04:08 INF [path demo0] runOnDemand command stopped: timed out
2024-04-02 15:04:08 2024/04/02 07:04:08 INF [WebRTC] [session 829664cb] closed: source of path 'demo0' has timed out
[out#0/webm @ 0x7f04b00515c0] video:281kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 1.023511%
2024-04-02 15:04:08 size= 284kB time=00:00:10.49 bitrate= 221.3kbits/s speed=1.05x 
2024-04-02 15:04:08 Exiting normally, received signal 2.



This is the same when I try to stream my other videos (demo1.mp4, demo2.mp4 etc.). What am I doing wrong ?


-
I am converting images to video using ffmpeg in koltin but i am getting error
28 mars 2024, par Mohith_karthikeyai implement ffmpeg by using this gitbub by this reference :5

https://github.com/tanersener/mobile-ffmpeg
in koltin
my code is :

class BurstModeToVideo(
 private val context: Context,
 private val onVideoConverted: (File) -> Unit
) {

 private val vibeDirectory = File(context.getExternalFilesDir(Environment.DIRECTORY_PICTURES), "vibes")
 private val outputDirectory = context.getExternalFilesDir(Environment.DIRECTORY_MOVIES)

 fun convertBitmapToJpeg(vibes: List<bitmap>) {
 if (!vibeDirectory.exists()) {
 vibeDirectory.mkdirs()
 }

 vibes.forEachIndexed { index, vibe ->
 val fileName = "$index.jpg"
 val file = File(vibeDirectory, fileName)
 FileOutputStream(file).use { fos ->
 vibe.compress(Bitmap.CompressFormat.JPEG, 100, fos)
 }
 }
 }

 private val callback = ExecuteCallback { _, returnCode ->
 if (returnCode == Config.RETURN_CODE_SUCCESS) {
 try {
 val tempFile = File("${outputDirectory?.absolutePath}/vibe.mp4")
 onVideoConverted(tempFile)
 Log.e(TAG, "FFmpeg output found $tempFile")
 Toast.makeText(context,"$tempFile",Toast.LENGTH_LONG).show()
 Log.e(TAG, "FFmpeg output found $")
 } catch (e: IOException) {
 Log.e(TAG, "Error handling FFmpeg output", e)
 }
 } else {
 Log.i(TAG, "Async command execution failed with returnCode=$returnCode.")
 }
 }

 fun convertShotsToVideo() {
 if (!vibeDirectory.exists() || vibeDirectory.listFiles()?.isEmpty() == true) {
 Log.e(TAG, "No images to convert")
 return
 }

 Log.d(TAG, "Images are stored in: ${vibeDirectory.absolutePath}")

 val imageFiles = vibeDirectory.listFiles { file -> file.isFile && file.extension.equals("jpg", ignoreCase = true) }
 if (imageFiles.isNullOrEmpty()) {
 Log.e(TAG, "No image files found in directory")
 return
 }

 Log.d(TAG, "List of image files:")
 imageFiles.forEach { file ->
 Log.d(TAG, file.name)
 }

 val cmd = "-i ${vibeDirectory.absolutePath}/%d.jpg -c:v mpeg4 -y ${outputDirectory?.absolutePath}/vibe.mp4"

 FFmpevubeg.executeAsync(cmd, callback)
 }

 companion object {
 private const val TAG = "BurstModeToVideo"
 }
}
</bitmap>


above function convert images from bimtap to jpeg files and then it converts to video by using ffmpeg. And i initialize this fun in mainactivity.kt and it goes here :


var vibe by remember {
 mutableStateOf(null)
 }

 val burstModeToVideo = BurstModeToVideo(
 context,
 onVideoConverted = {
 vibe = it
 }
 )
coroutineScope.launch {
 withContext(Dispatchers.IO) {
 burstModeToVideo.convertBitmapToJpeg(vibesList)
 burstModeToVideo.convertShotsToVideo()
 }
 }

VideoPlayer(vibe)



now this vibe variable is used in videoPlayer function and it goes here :


@OptIn(UnstableApi::class)
@Composable
fun VideoPlayer(file: File) {
 val context = LocalContext.current

 val exoPlayer = remember {
 ExoPlayer.Builder(context)
 .build()
 .apply {
 val defaultDataSourceFactory = DefaultDataSource.Factory(context)
 val dataSourceFactory: DataSource.Factory = DefaultDataSource.Factory(
 context,
 defaultDataSourceFactory
 )
 this.repeatMode = ExoPlayer.REPEAT_MODE_ALL
 this.playWhenReady = true
 val source = file.let {
 ProgressiveMediaSource.Factory(dataSourceFactory)
 .createMediaSource(MediaItem.fromUri(Uri.fromFile(file)))
 }
 this.setMediaSource(source)
 this.prepare()
 this.play()
 this.volume = 0f
 }
 }

 DisposableEffect(Unit) {
 onDispose {
 exoPlayer.release()
 }
 }

 AndroidView(
 factory = { ctx ->
 PlayerView(ctx).apply {
 useController = false
 resizeMode = AspectRatioFrameLayout.RESIZE_MODE_ZOOM
 player = exoPlayer
 }
 },
 modifier = Modifier.fillMaxSize()
 )
}



the error is :


MediaCodec will operate in async mode
2024-03-28 20:08:53.065 18946-27920 OplusCCodec com.example.flenzey D initiateShutdown [475]: (0xb400007656569fc0) keepComponentAllocated=0
2024-03-28 20:08:53.067 18946-27920 BpBinder com.example.flenzey I onLastStrongRef automatically unlinking death recipients: android.media.IResourceManagerService
2024-03-28 20:08:53.069 18946-27926 hw-BpHwBinder com.example.flenzey I onLastStrongRef automatically unlinking death recipients
2024-03-28 20:08:53.071 18946-27926 OplusCCodec com.example.flenzey D ~OplusCCodec [144]: (0xb400007656569fc0)
2024-03-28 20:08:53.077 18946-27889 MediaCodecRenderer com.example.flenzey W Failed to initialize decoder: c2.android.mpeg4.decoder
 java.lang.IllegalArgumentException
 at android.media.MediaCodec.native_configure(Native Method)
 at android.media.MediaCodec.configure(MediaCodec.java:2176)
 at android.media.MediaCodec.configure(MediaCodec.java:2092)
 at androidx.media3.exoplayer.mediacodec.AsynchronousMediaCodecAdapter.initialize(AsynchronousMediaCodecAdapter.java:174)
 at androidx.media3.exoplayer.mediacodec.AsynchronousMediaCodecAdapter.access$100(AsynchronousMediaCodecAdapter.java:54)
 at androidx.media3.exoplayer.mediacodec.AsynchronousMediaCodecAdapter$Factory.createAdapter(AsynchronousMediaCodecAdapter.java:119)
 at androidx.media3.exoplayer.mediacodec.DefaultMediaCodecAdapterFactory.createAdapter(DefaultMediaCodecAdapterFactory.java:117)
 at androidx.media3.exoplayer.mediacodec.MediaCodecRenderer.initCodec(MediaCodecRenderer.java:1195)
 at androidx.media3.exoplayer.mediacodec.MediaCodecRenderer.maybeInitCodecWithFallback(MediaCodecRenderer.java:1103)
 at androidx.media3.exoplayer.mediacodec.MediaCodecRenderer.maybeInitCodecOrBypass(MediaCodecRenderer.java:551)
 at androidx.media3.exoplayer.mediacodec.MediaCodecRenderer.onInputFormatChanged(MediaCodecRenderer.java:1560)
 at androidx.media3.exoplayer.video.MediaCodecVideoRenderer.onInputFormatChanged(MediaCodecVideoRenderer.java:1152)
 at androidx.media3.exoplayer.mediacodec.MediaCodecRenderer.readSourceOmittingSampleData(MediaCodecRenderer.java:994)
 at androidx.media3.exoplayer.mediacodec.MediaCodecRenderer.render(MediaCodecRenderer.java:814)
 at androidx.media3.exoplayer.video.MediaCodecVideoRenderer.render(MediaCodecVideoRenderer.java:940)
 at androidx.media3.exoplayer.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:1102)
 at androidx.media3.exoplayer.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:541)
 at android.os.Handler.dispatchMessage(Handler.java:102)
 at android.os.Looper.loopOnce(Looper.java:238)
 at android.os.Looper.loop(Looper.java:349)
 at android.os.HandlerThread.run(HandlerThread.java:67)
2024-03-28 20:08:53.091 18946-27889 MediaCodecVideoRenderer com.example.flenzey E Video codec error
 androidx.media3.exoplayer.mediacodec.MediaCodecRenderer$DecoderInitializationException: Decoder init failed: c2.android.mpeg4.decoder, Format(1, null, null, video/mp4v-es, null, 22800180, null, [2448, 3264, 24.999998, ColorInfo(Unset color space, Unset color range, Unset color transfer, false, 8bit Luma, 8bit Chroma)], [-1, -1])
 at androidx.media3.exoplayer.mediacodec.MediaCodecRenderer.maybeInitCodecWithFallback(MediaCodecRenderer.java:1114)
 at androidx.media3.exoplayer.mediacodec.MediaCodecRenderer.maybeInitCodecOrBypass(MediaCodecRenderer.java:551)
 at androidx.media3.exoplayer.mediacodec.MediaCodecRenderer.onInputFormatChanged(MediaCodecRenderer.java:1560)
 at androidx.media3.exoplayer.video.MediaCodecVideoRenderer.onInputFormatChanged(MediaCodecVideoRenderer.java:1152)
 at androidx.media3.exoplayer.mediacodec.MediaCodecRenderer.readSourceOmittingSampleData(MediaCodecRenderer.java:994)
 at androidx.media3.exoplayer.mediacodec.MediaCodecRenderer.render(MediaCodecRenderer.java:814)
 at androidx.media3.exoplayer.video.MediaCodecVideoRenderer.render(MediaCodecVideoRenderer.java:940)
 at androidx.media3.exoplayer.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:1102)
 at androidx.media3.exoplayer.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:541)
 at android.os.Handler.dispatchMessage(Handler.java:102)
 at android.os.Looper.loopOnce(Looper.java:238)
 at android.os.Looper.loop(Looper.java:349)
 at android.os.HandlerThread.run(HandlerThread.java:67)
 Caused by: java.lang.IllegalArgumentException
 at android.media.MediaCodec.native_configure(Native Method)
 at android.media.MediaCodec.configure(MediaCodec.java:2176)
 at android.media.MediaCodec.configure(MediaCodec.java:2092)
 at androidx.media3.exoplayer.mediacodec.AsynchronousMediaCodecAdapter.initialize(AsynchronousMediaCodecAdapter.java:174)
 at androidx.media3.exoplayer.mediacodec.AsynchronousMediaCodecAdapter.access$100(AsynchronousMediaCodecAdapter.java:54)
 at androidx.media3.exoplayer.mediacodec.AsynchronousMediaCodecAdapter$Factory.createAdapter(AsynchronousMediaCodecAdapter.java:119)
 at androidx.media3.exoplayer.mediacodec.DefaultMediaCodecAdapterFactory.createAdapter(DefaultMediaCodecAdapterFactory.java:117)
 at androidx.media3.exoplayer.mediacodec.MediaCodecRenderer.initCodec(MediaCodecRenderer.java:1195)
 at androidx.media3.exoplayer.mediacodec.MediaCodecRenderer.maybeInitCodecWithFallback(MediaCodecRenderer.java:1103)
 at androidx.media3.exoplayer.mediacodec.MediaCodecRenderer.maybeInitCodecOrBypass(MediaCodecRenderer.java:551) 
 at androidx.media3.exoplayer.mediacodec.MediaCodecRenderer.onInputFormatChanged(MediaCodecRenderer.java:1560) 
 at androidx.media3.exoplayer.video.MediaCodecVideoRenderer.onInputFormatChanged(MediaCodecVideoRenderer.java:1152) 
 at androidx.media3.exoplayer.mediacodec.MediaCodecRenderer.readSourceOmittingSampleData(MediaCodecRenderer.java:994) 
 at androidx.media3.exoplayer.mediacodec.MediaCodecRenderer.render(MediaCodecRenderer.java:814) 
 at androidx.media3.exoplayer.video.MediaCodecVideoRenderer.render(MediaCodecVideoRenderer.java:940) 
 at androidx.media3.exoplayer.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:1102) 
 at androidx.media3.exoplayer.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:541) 
 at android.os.Handler.dispatchMessage(Handler.java:102) 
 at android.os.Looper.loopOnce(Looper.java:238) 
 at android.os.Looper.loop(Looper.java:349) 
 at android.os.HandlerThread.run(HandlerThread.java:67) 
2024-03-28 20:08:53.092 18946-27889 MediaCodecInfo com.example.flenzey D NoSupport [sizeAndRate.support, 2448x3264@24.999998092651367] [c2.android.mpeg4.decoder, video/mp4v-es] [OP535DL1, CPH2381, OnePlus, 31]
2024-03-28 20:08:53.108 18946-27889 ExoPlayerImplInternal com.example.flenzey E Playback error
 androidx.media3.exoplayer.ExoPlaybackException: MediaCodecVideoRenderer error, index=0, format=Format(1, null, null, video/mp4v-es, null, 22800180, null, [2448, 3264, 24.999998, ColorInfo(Unset color space, Unset color range, Unset color transfer, false, 8bit Luma, 8bit Chroma)], [-1, -1]), format_supported=NO_EXCEEDS_CAPABILITIES
 at androidx.media3.exoplayer.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:620)
 at android.os.Handler.dispatchMessage(Handler.java:102)
 at android.os.Looper.loopOnce(Looper.java:238)
 at android.os.Looper.loop(Looper.java:349)
 at android.os.HandlerThread.run(HandlerThread.java:67)
 Caused by: androidx.media3.exoplayer.mediacodec.MediaCodecRenderer$DecoderInitializationException: Decoder init failed: c2.android.mpeg4.decoder, Format(1, null, null, video/mp4v-es, null, 22800180, null, [2448, 3264, 24.999998, ColorInfo(Unset color space, Unset color range, Unset color transfer, false, 8bit Luma, 8bit Chroma)], [-1, -1])
 at androidx.media3.exoplayer.mediacodec.MediaCodecRenderer.maybeInitCodecWithFallback(MediaCodecRenderer.java:1114)
 at androidx.media3.exoplayer.mediacodec.MediaCodecRenderer.maybeInitCodecOrBypass(MediaCodecRenderer.java:551)
 at androidx.media3.exoplayer.mediacodec.MediaCodecRenderer.onInputFormatChanged(MediaCodecRenderer.java:1560)
 at androidx.media3.exoplayer.video.MediaCodecVideoRenderer.onInputFormatChanged(MediaCodecVideoRenderer.java:1152)
 at androidx.media3.exoplayer.mediacodec.MediaCodecRenderer.readSourceOmittingSampleData(MediaCodecRenderer.java:994)
 at androidx.media3.exoplayer.mediacodec.MediaCodecRenderer.render(MediaCodecRenderer.java:814)
 at androidx.media3.exoplayer.video.MediaCodecVideoRenderer.render(MediaCodecVideoRenderer.java:940)
 at androidx.media3.exoplayer.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:1102)
 at androidx.media3.exoplayer.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:541)
 at android.os.Handler.dispatchMessage(Handler.java:102) 
 at android.os.Looper.loopOnce(Looper.java:238) 
 at android.os.Looper.loop(Looper.java:349) 
 at android.os.HandlerThread.run(HandlerThread.java:67) 
 Caused by: java.lang.IllegalArgumentException
 at android.media.MediaCodec.native_configure(Native Method)
 at android.media.MediaCodec.configure(MediaCodec.java:2176)
 at android.media.MediaCodec.configure(MediaCodec.java:2092)
 at androidx.media3.exoplayer.mediacodec.AsynchronousMediaCodecAdapter.initialize(AsynchronousMediaCodecAdapter.java:174)
 at androidx.media3.exoplayer.mediacodec.AsynchronousMediaCodecAdapter.access$100(AsynchronousMediaCodecAdapter.java:54)
 at androidx.media3.exoplayer.mediacodec.AsynchronousMediaCodecAdapter$Factory.createAdapter(AsynchronousMediaCodecAdapter.java:119)
 at androidx.media3.exoplayer.mediacodec.DefaultMediaCodecAdapterFactory.createAdapter(DefaultMediaCodecAdapterFactory.java:117)
 at androidx.media3.exoplayer.mediacodec.MediaCodecRenderer.initCodec(MediaCodecRenderer.java:1195)
 at androidx.media3.exoplayer.mediacodec.MediaCodecRenderer.maybeInitCodecWithFallback(MediaCodecRenderer.java:1103)



can anybody solve it


i tried to implement but i don't how to solve it . please decode this and get me correct result.