
Recherche avancée
Médias (1)
-
Rennes Emotion Map 2010-11
19 octobre 2011, par
Mis à jour : Juillet 2013
Langue : français
Type : Texte
Autres articles (35)
-
La file d’attente de SPIPmotion
28 novembre 2010, parUne file d’attente stockée dans la base de donnée
Lors de son installation, SPIPmotion crée une nouvelle table dans la base de donnée intitulée spip_spipmotion_attentes.
Cette nouvelle table est constituée des champs suivants : id_spipmotion_attente, l’identifiant numérique unique de la tâche à traiter ; id_document, l’identifiant numérique du document original à encoder ; id_objet l’identifiant unique de l’objet auquel le document encodé devra être attaché automatiquement ; objet, le type d’objet auquel (...) -
Organiser par catégorie
17 mai 2013, parDans MédiaSPIP, une rubrique a 2 noms : catégorie et rubrique.
Les différents documents stockés dans MédiaSPIP peuvent être rangés dans différentes catégories. On peut créer une catégorie en cliquant sur "publier une catégorie" dans le menu publier en haut à droite ( après authentification ). Une catégorie peut être rangée dans une autre catégorie aussi ce qui fait qu’on peut construire une arborescence de catégories.
Lors de la publication prochaine d’un document, la nouvelle catégorie créée sera proposée (...) -
Gestion générale des documents
13 mai 2011, parMédiaSPIP ne modifie jamais le document original mis en ligne.
Pour chaque document mis en ligne il effectue deux opérations successives : la création d’une version supplémentaire qui peut être facilement consultée en ligne tout en laissant l’original téléchargeable dans le cas où le document original ne peut être lu dans un navigateur Internet ; la récupération des métadonnées du document original pour illustrer textuellement le fichier ;
Les tableaux ci-dessous expliquent ce que peut faire MédiaSPIP (...)
Sur d’autres sites (5638)
-
Convert png images to HEVC with alpha video via ffmpeg [closed]
6 mai 2024, par foxhableI am trying to create a video from a sequence of png images in the HEVC with alpha codec via ffmpeg.


After the command


ffmpeg -i a%d.png -r 30 -c:v hevc_videotoolbox -allow_sw 1 -alpha_quality 1 -vtag hvc1 ffmpeg-hevc.mov



I get a video with a transparent background that opens in QuickTime, but not Safari.


Info about this video via ffprobe :


ffprobe .\ffmpeg-hevc.mov
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '.\ffmpeg-hevc.mov':
 Metadata:
 major_brand : qt
 minor_version : 512
 compatible_brands: qt
 encoder : Lavf61.3.103
 Duration: 00:00:12.77, start: 0.000000, bitrate: 3437 kb/s
 Stream #0:0[0x1]: Video: hevc (Main) (hvc1 / 0x31637668), yuv420p(tv, bottom coded first (swapped)), 1920x1920, 3435 kb/s, 30 fps, 30 tbr, 15360 tbn (default)
 Metadata:
 handler_name : VideoHandler
 vendor_id : FFMP
 encoder : Lavc61.5.103 hevc_videotoolbox



I compared this to a video that has a transparent background and works in Safari and QuickTime


ffprobe movie-hevc.mov
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '.\movie-hevc.mov':
 Metadata:
 major_brand : qt
 minor_version : 0
 compatible_brands: qt
 creation_time : 2021-01-02T10:33:38.000000Z
 Duration: 00:00:09.02, start: 0.000000, bitrate: 4053 kb/s
 Stream #0:0[0x1](und): Video: hevc (Main) (hvc1 / 0x31637668), yuv420p(tv, progressive), 1280x720 [SAR 1:1 DAR 16:9], 4046 kb/s, 60 fps, 60 tbr, 600 tbn (default)
 Metadata:
 creation_time : 2021-01-02T10:33:38.000000Z
 handler_name : Core Media Video
 vendor_id : [0][0][0][0]
 encoder : HEVC



The only thing I noticed is the encoder. In the working version this is HEVC but in my Lavc61.5.103 hevc_videotoolbox.


The question is, is it possible to create a video with a native HEVC codec via ffmpeg ?


Tried answers :




PC info :


- 

- macOS Monterey 12.7.2
- Mac mini (Late 2012)
- Core i5 3210M
- Graphics Intel HD 4000










-
Struggling to add subtitles to a video using FFMPEG and C#
19 mars 2024, par MattHodsonI'm trying to add subtitles to my videos, 100% with code using FFMPEG and C#.


But I'm getting the following error :




ffmpeg version 2024-02-04-git-7375a6ca7b-essentials_build-www.gyan.dev Copyright (c) 2000-2024 the FFmpeg developers
built with gcc 12.2.0 (Rev10, Built by MSYS2 project)
configuration : —enable-gpl —enable-version3 —enable-static —pkg-config=pkgconf —disable-w32threads —disable-autodetect —enable-fontconfig —enable-iconv —enable-gnutls —enable-libxml2 —enable-gmp —enable-bzlib —enable-lzma —enable-zlib —enable-libsrt —enable-libssh —enable-libzmq —enable-avisynth —enable-sdl2 —enable-libwebp —enable-libx264 —enable-libx265 —enable-libxvid —enable-libaom —enable-libopenjpeg —enable-libvpx —enable-mediafoundation —enable-libass —enable-libfreetype —enable-libfribidi —enable-libharfbuzz —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-libgme —enable-libopenmpt —enable-libopencore-amrwb —enable-libmp3lame —enable-libtheora —enable-libvo-amrwbenc —enable-libgsm —enable-libopencore-amrnb —enable-libopus —enable-libspeex —enable-libvorbis —enable-librubberband
libavutil 58. 36.101 / 58. 36.101
libavcodec 60. 38.100 / 60. 38.100
libavformat 60. 20.100 / 60. 20.100
libavdevice 60. 4.100 / 60. 4.100
libavfilter 9. 17.100 / 9. 17.100
libswscale 7. 6.100 / 7. 6.100
libswresample 4. 13.100 / 4. 13.100
libpostproc 57. 4.100 / 57. 4.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'C :\Users\Gamer\source\repos\XXXX\bin\Debug\net8.0\ce31c8ab-4b53-44e8-9e25-d02ba5466144\output.mp4' :
Metadata :
major_brand : isom
minor_version : 512
compatible_brands : isomiso2avc1mp41
encoder : Lavf60.20.100
Duration : 00:03:18.84, start : 0.000000, bitrate : 101 kb/s
Stream #0:00x1 : Video : h264 (High) (avc1 / 0x31637661), yuv420p(progressive), 1024x1792, 26 kb/s, 1 fps, 1 tbr, 16384 tbn (default)
Metadata :
handler_name : VideoHandler
vendor_id : [0][0][0][0]
encoder : Lavc60.38.100 libx264
Stream #0:10x2 : Audio : aac (LC) (mp4a / 0x6134706D), 24000 Hz, mono, fltp, 74 kb/s (default)
Metadata :
handler_name : SoundHandler
vendor_id : [0][0][0][0]
[Parsed_subtitles_0 @ 000001a87404e3c0] Unable to parse option value "UsersGamersourcereposXXXXbinDebugnet8.0ce31c8ab-4b53-44e8-9e25-d02ba5466144output.srt" as image size
Error applying option 'original_size' to filter 'subtitles' : Invalid argument
[vost#0:0/libx264 @ 000001a874064a40] Error initializing a simple filtergraph
Error opening output file C :\Users\Gamer\source\repos\XXXX\bin\Debug\net8.0\ce31c8ab-4b53-44e8-9e25-d02ba5466144\videoWithSubtitles.mp4.
Error opening output files : Invalid argument




It seems to be something related to paths, but I have tried EVERYTHING in my knowledge to fix this, still no luck... spent the majority of the day on it, no luck... so StackOverflow here I come !


My code :


public static async Task AddSubtitlesToVideoAsync(string videoPath, string subtitlesPath, string outputPath)
 {
 if (File.Exists(videoPath) && File.Exists(subtitlesPath))
 {
 //string subtitlesPathForwardSlashes = subtitlesPath.Replace("\\", "/");
 //string ffmpegCommand = $"-i \"{videoPath}\" -filter_complex \"subtitles='{subtitlesPathForwardSlashes}'\" \"{outputPath}\"";
 //string ffmpegCommand = $"-i \"{videoPath}\" -vf subtitles={subtitlesPathForwardSlashes} \"{outputPath}\"";
 //string ffmpegCommand = $"-i \"{videoPath}\" -vf subtitles=\"{subtitlesPath}\" \"{outputPath}\"";
 string subtitlesPathEscaped = subtitlesPath.Replace("\\", "\\\\");
 string ffmpegCommand = $"-i \"{videoPath}\" -vf subtitles=\"{subtitlesPathEscaped}\" \"{outputPath}\"";


 //output -i C:\Users\Gamer\source\repos\XXXX\bin\Debug\net8.0\d745a08d-b932-47ac-a81c-45e9483590a7\output.mp4 -vf subtitles="C:/Users/Gamer/source/repos/XXXX/bin/Debug/net8.0/d745a08d-b932-47ac-a81c-45e9483590a7/generatedSubtitles.srt" C:\Users\Gamer\source\repos\XXXX\bin\Debug\net8.0\d745a08d-b932-47ac-a81c-45e9483590a7\videoWithSubtitles.mp4
 await ExecuteSubtitleCommandAsync(ffmpegCommand);
 }
 else
 {
 Console.WriteLine("Files can't be found.");
 }
 }

 public static async Task ExecuteSubtitleCommandAsync(string arguments)
 {
 string ffmpegExecutablePath = ffmpegRoot;
 var startInfo = new ProcessStartInfo(ffmpegExecutablePath, arguments)
 {
 CreateNoWindow = true,
 UseShellExecute = false,
 RedirectStandardOutput = true,
 RedirectStandardError = true
 };

 using (var process = new Process { StartInfo = startInfo })
 {
 process.EnableRaisingEvents = true; // Enable the Exited event.
 process.Exited += (sender, e) =>
 {
 Console.WriteLine($"FFmpeg process exited with code {process.ExitCode}.");
 };

 try
 {
 process.Start();
 // Asynchronously read the standard output and standard error of the process
 var outputTask = process.StandardOutput.ReadToEndAsync();
 var errorTask = process.StandardError.ReadToEndAsync();
 // Wait for both asynchronous tasks to complete
 await Task.WhenAll(outputTask, errorTask);

 var output = await outputTask;
 var error = await errorTask;

 if (!string.IsNullOrEmpty(error))
 {
 Console.WriteLine("FFmpeg error: " + error);
 }
 else
 {
 Console.WriteLine("FFmpeg process completed successfully.");
 }
 }
 catch (Exception ex)
 {
 Console.WriteLine("Error: " + ex.Message);
 }
 finally
 {
 // Wait for the process to exit if it hasn't already.
 if (!process.HasExited)
 {
 process.WaitForExit();
 }
 }
 }
 }



-
OpenCV on MacOS : Match Camera Index and Name
15 janvier, par rpi_guruI have a builtin camera and a USB webcam connected to my MacOS.


Here is a result of
system_profiler SPCameraDataType -xml
command :

<?xml version="1.0" encoding="UTF-8"?>

<plist version="1.0">
<array>
 <dict>
 <key>_SPCommandLineArguments</key>
 <array>
 <string>/usr/sbin/system_profiler</string>
 <string>-nospawn</string>
 <string>-xml</string>
 <string>SPCameraDataType</string>
 <string>-detailLevel</string>
 <string>full</string>
 </array>
 <key>_SPCompletionInterval</key>
 <real>1.1997909545898438</real>
 <key>_SPResponseTime</key>
 <real>1.2810090780258179</real>
 <key>_dataType</key>
 <string>SPCameraDataType</string>
 <key>_detailLevel</key>
 <integer>-1</integer>
 <key>_items</key>
 <array>
 <dict>
 <key>_name</key>
 <string>USB Camera</string>
 <key>spcamera_model-id</key>
 <string>UVC Camera VendorID_3141 ProductID_25453</string>
 <key>spcamera_unique-id</key>
 <string>0x11000000c45636d</string>
 </dict>
 <dict>
 <key>_name</key>
 <string>FaceTime HD Camera</string>
 <key>spcamera_model-id</key>
 <string>FaceTime HD Camera</string>
 <key>spcamera_unique-id</key>
 <string>EAB7A68F-EC2B-4487-AADF-D8A91C1CB782</string>
 </dict>
 </array>
 <key>_parentDataType</key>
 <string>SPHardwareDataType</string>
 <key>_properties</key>
 <dict>
 <key>_name</key>
 <dict>
 <key>_isColumn</key>
 <string>NO</string>
 <key>_isOutlineColumn</key>
 <string>NO</string>
 <key>_order</key>
 <string>0</string>
 </dict>
 <key>spcamera</key>
 <dict>
 <key>_order</key>
 <string>10</string>
 </dict>
 <key>spcamera_model-id</key>
 <dict>
 <key>_order</key>
 <string>30</string>
 </dict>
 <key>spcamera_unique-id</key>
 <dict>
 <key>_order</key>
 <string>40</string>
 </dict>
 <key>volumes</key>
 <dict>
 <key>_detailLevel</key>
 <string>0</string>
 </dict>
 </dict>
 <key>_timeStamp</key>
 <date>2024-11-29T21:57:28Z</date>
 <key>_versionInfo</key>
 <dict>
 <key>com.apple.SystemProfiler.SPCameraReporter</key>
 <string>1.2.0</string>
 </dict>
 </dict>
</array>
</plist>



As you can see, I have a couple of video input devices :
USB Camera
&FaceTime HD Camera


The problem is that when I use
cap = cv2.VideoCapture(0)
, it uses theFaceTime HD Camera
.

Can we match the camera index in OpenCV with the camera names ?


P.S. I tried
ffmpeg
, but it returned similar result :



ioreg | grep -i cam
result :