
Recherche avancée
Médias (91)
-
Les Miserables
9 décembre 2019, par
Mis à jour : Décembre 2019
Langue : français
Type : Textuel
-
VideoHandle
8 novembre 2019, par
Mis à jour : Novembre 2019
Langue : français
Type : Video
-
Somos millones 1
21 juillet 2014, par
Mis à jour : Juin 2015
Langue : français
Type : Video
-
Un test - mauritanie
3 avril 2014, par
Mis à jour : Avril 2014
Langue : français
Type : Textuel
-
Pourquoi Obama lit il mes mails ?
4 février 2014, par
Mis à jour : Février 2014
Langue : français
-
IMG 0222
6 octobre 2013, par
Mis à jour : Octobre 2013
Langue : français
Type : Image
Autres articles (46)
-
MediaSPIP : Modification des droits de création d’objets et de publication définitive
11 novembre 2010, parPar défaut, MediaSPIP permet de créer 5 types d’objets.
Toujours par défaut les droits de création et de publication définitive de ces objets sont réservés aux administrateurs, mais ils sont bien entendu configurables par les webmestres.
Ces droits sont ainsi bloqués pour plusieurs raisons : parce que le fait d’autoriser à publier doit être la volonté du webmestre pas de l’ensemble de la plateforme et donc ne pas être un choix par défaut ; parce qu’avoir un compte peut servir à autre choses également, (...) -
Librairies et logiciels spécifiques aux médias
10 décembre 2010, parPour un fonctionnement correct et optimal, plusieurs choses sont à prendre en considération.
Il est important, après avoir installé apache2, mysql et php5, d’installer d’autres logiciels nécessaires dont les installations sont décrites dans les liens afférants. Un ensemble de librairies multimedias (x264, libtheora, libvpx) utilisées pour l’encodage et le décodage des vidéos et sons afin de supporter le plus grand nombre de fichiers possibles. Cf. : ce tutoriel ; FFMpeg avec le maximum de décodeurs et (...) -
MediaSPIP v0.2
21 juin 2013, parMediaSPIP 0.2 is the first MediaSPIP stable release.
Its official release date is June 21, 2013 and is announced here.
The zip file provided here only contains the sources of MediaSPIP in its standalone version.
To get a working installation, you must manually install all-software dependencies on the server.
If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...)
Sur d’autres sites (7365)
-
ffmpeg error when try co concat videos with filter_complex
29 août 2023, par Matteo PasiniI'm trying to concatenate two videos with different resolutions. Reading around I saw that before being able to concatenate them I should scale them to the same resolution, but the command I'm using (the same one they propose on stackoverflow) doesn't seem to work. Does anyone have any ideas ?


Command :


ffmpeg -i file1.mp4 -i file2.mp4 -filter_complex "[0:v]scale=1024:576:force_original_aspect_ratio=1[v0]; [1:v]scale=1024:576:force_original_aspect_ratio=1[v1]; [v0][0:a][v1][1:a]concat=n=2:v=1:a=1[v][a]" -map [v] -map [a] output.mp4



Output :


ffmpeg version 2023-08-28-git-b5273c619d-full_build-www.gyan.dev Copyright (c) 2000-2023 the FFmpeg developers
 built with gcc 12.2.0 (Rev10, 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-libzvbi --enable-librav1e --enable-libsvtav1 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs2 --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-ffnvcodec --enable-nvdec --enable-nvenc --enable-dxva2 --enable-d3d11va --enable-libvpl --enable-libshaderc --enable-vulkan --enable-libplacebo --enable-opencl --enable-libcdio --enable-libgme --enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libshine --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libcodec2 --enable-libilbc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-ladspa --enable-libbs2b --enable-libflite --enable-libmysofa --enable-librubberband --enable-libsoxr --enable-chromaprint
 libavutil 58. 17.100 / 58. 17.100
 libavcodec 60. 23.100 / 60. 23.100
 libavformat 60. 10.101 / 60. 10.101
 libavdevice 60. 2.101 / 60. 2.101
 libavfilter 9. 11.100 / 9. 11.100
 libswscale 7. 3.100 / 7. 3.100
 libswresample 4. 11.100 / 4. 11.100
 libpostproc 57. 2.100 / 57. 2.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'file1.mp4':
 Metadata:
 major_brand : mp42
 minor_version : 0
 compatible_brands: isommp42
 creation_time : 2021-10-08T12:31:56.000000Z
 Duration: 00:03:15.51, start: 0.000000, bitrate: 464 kb/s
 Stream #0:0[0x1](eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, smpte170m, progressive), 1444x876 [SAR 1:1 DAR 361:219], 335 kb/s, 30 fps, 30 tbr, 30k tbn (default)
 Metadata:
 creation_time : 2021-10-08T12:31:56.000000Z
 handler_name : Mainconcept MP4 Video Media Handler
 vendor_id : [0][0][0][0]
 encoder : AVC Coding
 Stream #0:1[0x2](eng): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 125 kb/s (default)
 Metadata:
 creation_time : 2021-10-08T12:31:56.000000Z
 handler_name : Mainconcept MP4 Sound Media Handler
 vendor_id : [0][0][0][0]
Input #1, mov,mp4,m4a,3gp,3g2,mj2, from 'file2.mp4':
 Metadata:
 major_brand : mp42
 minor_version : 0
 compatible_brands: isommp42
 creation_time : 2021-10-11T11:12:30.000000Z
 Duration: 00:02:42.01, start: 0.000000, bitrate: 380 kb/s
 Stream #1:0[0x1](eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, smpte170m, progressive), 1450x870 [SAR 1:1 DAR 5:3], 251 kb/s, 30 fps, 30 tbr, 30k tbn (default)
 Metadata:
 creation_time : 2021-10-11T11:12:30.000000Z
 handler_name : Mainconcept MP4 Video Media Handler
 vendor_id : [0][0][0][0]
 encoder : AVC Coding
 Stream #1:1[0x2](eng): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 125 kb/s (default)
 Metadata:
 creation_time : 2021-10-11T11:12:30.000000Z
 handler_name : Mainconcept MP4 Sound Media Handler
 vendor_id : [0][0][0][0]
File 'output.mp4' already exists. Overwrite? [y/N] y
Stream mapping:
 Stream #0:0 (h264) -> scale:default
 Stream #0:1 (aac) -> concat
 Stream #1:0 (h264) -> scale:default
 Stream #1:1 (aac) -> concat
 concat -> Stream #0:0 (libx264)
 concat -> Stream #0:1 (aac)
Press [q] to stop, [?] for help
[Parsed_concat_2 @ 00000228da583200] Input link in0:v0 parameters (size 960x576, SAR 1:1) do not match the corresponding output link in0:v0 parameters (949x576, SAR 69312:69277)
[Parsed_concat_2 @ 00000228da583200] Failed to configure output pad on Parsed_concat_2
[fc#0 @ 00000228d8cb7480] Error reinitializing filters!
Failed to inject frame into filter network: Invalid argument
Error while filtering: Invalid argument
[Parsed_concat_2 @ 00000228da582c00] Input link in0:v0 parameters (size 960x576, SAR 1:1) do not match the corresponding output link in0:v0 parameters (949x576, SAR 69312:69277)
[Parsed_concat_2 @ 00000228da582c00] Failed to configure output pad on Parsed_concat_2
[fc#0 @ 00000228d8cb7480] Error reinitializing filters!
Failed to inject frame into filter network: Invalid argument
[Parsed_concat_2 @ 00000228da581900] Input link in0:v0 parameters (size 960x576, SAR 1:1) do not match the corresponding output link in0:v0 parameters (949x576, SAR 69312:69277)
[Parsed_concat_2 @ 00000228da581900] Failed to configure output pad on Parsed_concat_2
[fc#0 @ 00000228d8cb7480] Error reinitializing filters!
Failed to inject frame into filter network: Invalid argument
[out#0/mp4 @ 00000228d9baab40] 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= 0kB time=N/A bitrate=N/A speed=N/A
Conversion failed!



-
FFmpeg filter_complex to merge audio from two files fails without an error due to album cover PNG stream
13 décembre 2023, par kaushalWhen you run FFmpeg filter_complex command to process two mp3 files and merge them into one, the command runs successfully, the output mp3 file is generated. No errors are reported. But the output fails to run. The result log from FFmpeg looks something like this, which points to an PNG stream in one of the mp3.


[mp3 @ 00000215d251e7c0] Estimating duration from bitrate, this may be inaccurate
Input #0, mp3, from 'C:\\vid gen\\Track_ Outwild x She Is Jules - Golden [NCS Release].mp3':
 Metadata:
 artist : Outwild x She Is Jules
 album_artist : Outwild x She Is Jules
 TCM : Outwild, She Is Jules
 album : Golden [Single]
 title : Golden
 genre : Electronic
 date : 2021
 Duration: 00:04:09.60, 
start: 0.000000, bitrate: 378 kb/s
 Stream #0:0: Audio: mp3, 48000 Hz, stereo, fltp, 320 kb/s
 Stream #0:1: Video: mjpeg (Baseline), yuvj444p(pc, bt470bg/unknown/unknown), 3000x3000, 90k tbr, 90k tbn (attached pic)
 Metadata:
 comment : Other
[mp3 @ 00000215d253f380] Estimating duration from bitrate, this may be inaccurate
Input #1, mp3, from 'E:\voiceover.mp3':
 Duration: 00:00:51.96, start: 0.000000, bitrate: 32 kb/s
 Stream #1:0: Audio: mp3, 24000 Hz, mono, fltp, 32 kb/s
Stream mapping:
 Stream #0:0 (mp3float) -> volume:default (graph 0)
 Stream #1:0 (mp3float) -> adelay:default (graph 0)
 amerge:default (graph 0) -> Stream #0:0 (libmp3lame)
 Stream #0:1 -> #0:1 (mjpeg (native) -> png (native))
Press [q] to stop, [?] for help
[swscaler @ 00000215d46ff480] deprecated pixel format used, make sure you did set range correctly
 Last message repeated 3 times
[Parsed_amerge_6 @ 00000215d470d2c0] No channel layout for input 1
Output #0, mp3, to 'output_test.mp3':
 Metadata:
 TPE1 : Outwild x She Is Jules
 TPE2 : Outwild x She Is Jules
 TCM : Outwild, She Is Jules
 TALB : Golden [Single]
 TIT2 : Golden
 TCON : Electronic
 TDRC : 2021
 TSSE : Lavf60.18.100
 Stream #0:0: Audio: mp3, 48000 Hz, stereo, fltp\r\rame= 0 fps=0.0 q=0.0 size= 0kB time=-00:00:00.02 bitrate=N/A speed=N/A \rframe= 0 fps=0.0 q=0.0 size= 0kB time=-00:00:00.02 bitrate=N/A speed=N/A \r[out#0/mp3 @ 00000215d2537400] video:3696kB audio:2kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.011831%
frame= 1 fps=0.8 q=-0.0 Lsize= 3698kB time=00:00:00.07 bitrate=415140.5kbits/s speed=0.0601x



-
How to tell ffmpeg that /tmp/phpFm6H79 is a safe file name ?
28 août 2023, par hanshenrikHow do I tell ffmpeg that
/tmp/phpFm6H79
is a safe filename ?

When I do


ffmpeg -y -f concat -i '/tmp/phpFm6H79' -c:v:libx264 -vsync vfr '/home/hans/projects/test/output2.mp4'



I get (*only the last 2 lines are interesting)


ffmpeg version 4.4.2-0ubuntu0.22.04.1 Copyright (c) 2000-2021 the FFmpeg developers
 built with gcc 11 (Ubuntu 11.2.0-19ubuntu1)
 configuration: --prefix=/usr --extra-version=0ubuntu0.22.04.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzimg --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-pocketsphinx --enable-librsvg --enable-libmfx --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
 libavutil 56. 70.100 / 56. 70.100
 libavcodec 58.134.100 / 58.134.100
 libavformat 58. 76.100 / 58. 76.100
 libavdevice 58. 13.100 / 58. 13.100
 libavfilter 7.110.100 / 7.110.100
 libswscale 5. 9.100 / 5. 9.100
 libswresample 3. 9.100 / 3. 9.100
 libpostproc 55. 9.100 / 55. 9.100
[concat @ 0x55b070e9ff40] Unsafe file name '/tmp/phpbshsmF'
/tmp/phpFm6H79: Operation not permitted



The filepath is generated with PHP's
tmpfile()
like

$ffmpegInputTxtFileHandle = tmpfile();
$ffmpegInputTxtFilePath = stream_get_meta_data($ffmpegInputTxtFileHandle)['uri'];



The code should be threadsafe, so using hardcoded paths is not really viable, and using
tmpfile()
is very convenient, it takes care of automatically deleting the file when the script exit, even if php crashes, so I'd rather tell ffmpeg that it is safe, than change it to something other thantmpfile()
, is it possible ? how ?

I tried using this fugly workaround to get it to end with ".txt"


$ffmpegInputTxtFileHandle = tmpfile();
 $ffmpegInputTxtFilePath = stream_get_meta_data($ffmpegInputTxtFileHandle)['uri'] . ".txt";
 fclose($ffmpegInputTxtFileHandle);
 $ffmpegInputTxtFileHandle = fopen($ffmpegInputTxtFilePath, 'w+b');
 register_shutdown_function(function () use ($ffmpegInputTxtFileHandle, $ffmpegInputTxtFilePath) {
 @fclose($ffmpegInputTxtFileHandle);
 @unlink($ffmpegInputTxtFilePath);
 });



but it even says that
/tmp/phpFm6H79.txt
is an unsafe filename :'(