
Recherche avancée
Médias (1)
-
Carte de Schillerkiez
13 mai 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Texte
Autres articles (93)
-
L’utiliser, en parler, le critiquer
10 avril 2011La première attitude à adopter est d’en parler, soit directement avec les personnes impliquées dans son développement, soit autour de vous pour convaincre de nouvelles personnes à l’utiliser.
Plus la communauté sera nombreuse et plus les évolutions seront rapides ...
Une liste de discussion est disponible pour tout échange entre utilisateurs. -
Mediabox : ouvrir les images dans l’espace maximal pour l’utilisateur
8 février 2011, parLa visualisation des images est restreinte par la largeur accordée par le design du site (dépendant du thème utilisé). Elles sont donc visibles sous un format réduit. Afin de profiter de l’ensemble de la place disponible sur l’écran de l’utilisateur, il est possible d’ajouter une fonctionnalité d’affichage de l’image dans une boite multimedia apparaissant au dessus du reste du contenu.
Pour ce faire il est nécessaire d’installer le plugin "Mediabox".
Configuration de la boite multimédia
Dès (...) -
Les autorisations surchargées par les plugins
27 avril 2010, parMediaspip core
autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs
Sur d’autres sites (7032)
-
Is there a set of working P/Invoke declarations for FFMpeg, libavutil, libavformat and libavcodec in .NET ?
30 août 2011, par casperOneI'm currently looking to access libavutil, libavformat and libavcodec (all part of FFMpeg) from .NET.
Currently, I'm getting the libraries from the automated builds of the shared FFMpeg package performed every night for Windows 32-bit.
I am also using the code from the ffmpeg-sharp project. In that project, I have removed a number of classes that were not compiling (they are wrapper classes not the P/Invoke declarations).
The code compiles fine, but I am running into a few issues.
First, it appears that the build of av*.dll uses the cdecl calling convention, as I was receiving a number of
PInvokeStackImbalanceException
when trying to callav_open_input_file
. This was easy enough to change to get it to work right. TheAVFormatContext
structure is populated.After that, I want to call
av_find_stream_info
to get information about the streams in the file. However, when calling that with theAVFormatContext
retrieved from the call toav_open_input_file
, anAccessViolationException
is thrown indicating that I am trying to read or write from protected memory.Has anyone used P/Invoke to access the libavutil, libavformat and libavcodec dll libraries through P/Invoke and have gotten it to work ?
I should mention that working with the command-line version of FFMpeg, while a solution, is not a viable solution in this case, access needs to occur through the libraries. The reason for this is that I'd have to thrash the disk way too much to do what I need to do (I have to do a frame-by-frame analysis of some very high definition video) and I want to avoid the disk as much as possible.
-
Forward youtube-dl output to ffmpeg with hardware-accelerated encoding [closed]
16 mars 2021, par YehorI'm trying to download some videos from youtube and simultaneously forward those to ffmpeg for hardware decoding to h265 (just for purpose of seeing how it works).


My command, that works, but uses (as I understand) software encoding :


youtube-dl -o "./%(playlist)s/%(title)s.%(ext)s" --merge-output-format mkv --postprocessor-args "-c:v libx265 -c:a opus -strict experimental" "target_url"



When I specify the hardware acceleration, I receive the error "Invalid argument". The command is :


youtube-dl -o "./%(playlist)s/%(title)s.%(ext)s" --merge-output-format mkv --postprocessor-args "-hwaccel cuda -c:v hevc_nvenc -c:a opus -strict experimental" "target_url"



What I've done wrong ?


System info :


- 

- OS : Windows 10 x64
- GPU : Nvidia GeForce 960M (installed the latest driver and CUDA) and should be supported by CUDA
- latest youtube-dl and ffmpeg build








The
ffmpeg -encoders
output contains 265 codecs, so they also should be supported :

V..... libx265 libx265 H.265 / HEVC (codec hevc)
V..... nvenc_hevc NVIDIA NVENC hevc encoder (codec hevc)
V..... hevc_amf AMD AMF HEVC encoder (codec hevc)
V..... hevc_nvenc NVIDIA NVENC hevc encoder (codec hevc)
V..... hevc_qsv HEVC (Intel Quick Sync Video acceleration) (codec hevc)



-
Encoding PNG to MP4 using FFMPEG.js
11 juillet 2024, par Giles ThompsonI'm attempting to convert a series of base64 encoded PNG frames (captured from a canvas) to an MP4 video using FFMPEG.js but seem to be running into following error on attempting to run the conversion process, FFMPEG reports the following error :




frame0000.png : Invalid data found when processing input




The specified file is the first in the sequence of circa 25 PNG frames I'm attempting to convert. I've confirmed that the base64 png file is formatted correctly both by checking its signature and actually downloading a single frame and opening it. However, for some reason FFMPEG doesn't appear to recognise the PNG file data. What follows is a snippet of the relevant parts of the conversion routine, some details have been omitted for the sake of brevity :


import ffmpeg from 'ffmpeg.js/ffmpeg-mp4.js';



// map each PNG frame in the array of frames to an object with 
 //with a name and data component. Crucially the data component 
 //will be the result of the conversion of the base64 data to an 
 //equivalent stream of bytes; i've listed the source of the 
 //referenced conversion function below...
 const inputFiles = videoFrames.map((dataUrl, index) => ({
 name: `frame${index.toString().padStart(4, '0')}.png`,
 data: this.#base64ToUint8Array(dataUrl)
 }));

 
 //build up the FFMPEG command to execute.
 let command = `-loglevel debug -framerate 30`;
 inputFiles.forEach((buffer, index) => {
 command += ` -i frame${index.toString().padStart(4, '0')}.png`; // Correctly padded frame names
 });
 command += ` -c:v libx264 -pix_fmt yuv420p ${outputFileName}`;
 

 //validate png frame data by checking its signature.
 inputFiles.forEach(file => {
 if (!this.#isValidPNG(file.data)) {
 throw new Error(`Invalid PNG file: ${file.name}`);
 }
 });

 // Write each input file to MEMFS
 inputFiles.forEach(file => {
 ffmpeg({
 MEMFS: [file],
 arguments: ['-version'],
 stdin: () => { }
 });
 });

 // Run ffmpeg
 const result = ffmpeg({
 MEMFS: inputFiles,
 //arguments: args,
 arguments: command.split(' '),
 stdin: () => { },
 });




Additionally, here is the referenced ancillary, helper function that converts the base64 encoded PNG files to a stream of equivalent bytes :


#base64ToUint8Array(base64) {
 const binaryString = atob(base64.split(',')[1]);
 const len = binaryString.length;
 const bytes = new Uint8Array(len);
 for (let i = 0; i < len; i++) {
 bytes[i] = binaryString.charCodeAt(i);
 }
 return bytes;
 }



Here is the referenced function that validates the PNG file by checking for the existence and validity of its signature i.e the
magic number that all PNG start with :


#isValidPNG(pngArray) {
 const signature = [0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A];
 for (let i = 0; i < signature.length; i++) {
 if (pngArray[i] !== signature[i]) {
 return false;
 }
 }
 return true;
 }




The most pertinent details of my current environment are as follows :




OS : "Ubuntu Linux".

VERSION : "21.04 (Hirsute Hippo)".

NPM VERSION : "9.5.0".

FFMPEG-JS-VERSION : "^2.8.9001".

BROWSER : "Chromium 125.0.6422.60 snap"



Is there anything obvious that I'm missing that may account for the error I'm seeing in the debug console ? I should mention that I've switched on debug-level logging in FFMPEG and can provide the full console output if necessary.