
Recherche avancée
Médias (1)
-
The Great Big Beautiful Tomorrow
28 octobre 2011, par
Mis à jour : Octobre 2011
Langue : English
Type : Texte
Autres articles (41)
-
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 images
15 mai 2013 -
Taille des images et des logos définissables
9 février 2011, parDans beaucoup d’endroits du site, logos et images sont redimensionnées pour correspondre aux emplacements définis par les thèmes. L’ensemble des ces tailles pouvant changer d’un thème à un autre peuvent être définies directement dans le thème et éviter ainsi à l’utilisateur de devoir les configurer manuellement après avoir changé l’apparence de son site.
Ces tailles d’images sont également disponibles dans la configuration spécifique de MediaSPIP Core. La taille maximale du logo du site en pixels, on permet (...)
Sur d’autres sites (4989)
-
FFmpeg transcode GIF into Mp4 and Mp4 to AVI using GPU
9 octobre 2023, par CristianI'm trying to convert GIF animated to mp4 and mp4 to AVI with FFmpeg.


I started to use just the CPU, but I have to process millions of GIFs/mp4 content pieces. So, I started to have a lot of errors processing them, and it ended as a bottleneck. Therefore, I'm trying to use GPU to process the videos.


Converting GIF to mp4 with CPU, I run the following command :


ffmpeg -i animated.gif -movflags faststart -pix_fmt yuv420p -vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" video.mp4



Using the GPU I'm trying the following :


ffmpeg
 -y
 -hwaccel nvdec
 -hwaccel_output_format cuda
 -i gifInputPath
 -threads 1
 -filter_threads 1
 -c:v h264_nvenc
 -vf hwupload_cuda,scale_cuda=-2:320:240:format=yuv420p
 -gpu 0
 mp4VideoPath



The above command generates an exit status 1.


The following is the dmesg command log


Converting mp4 videos to AVI videos I'm running the following command


ffmpeg
-i videoInputPath
-vcodec rawvideo
-pix_fmt yuv420p
-acodec pcm_s16le
-ar 44100
-ac 2
-s 320x240
-r 4
-f avi
aviOutputVideoPath



For GPU I tried :


ffmpeg
 -y
 -hwaccel cuda
 -hwaccel_output_format cuda
 -i videoInputPath
 -threads 1
 -filter_threads 1
 -c:a pcm_s16le
 -ac 2
 -ar 44100
 -c:v h264_nvenc
 -vf hwupload_cudascale_cuda=-2:320:240:format=yuv420p
 -r 4
 -f avi
 -gpu 0
 aviOutputVideoPath



The following is the dmseg output is log


- 

-
What should be the best command for converting the GIF into Mp4 and Mp4 into AVI based on CPU configuration using the GPU(Amazon Nvidia t4) for best performance, low CPU, and moderated GPU consumption ?


-
What are the best suggestions to Process these content pieces concurrently using GPU ?








Note : I'm using Golang to execute the FFmpeg commands.


-
-
AWS Lambda : "Unzipped size must be smaller than 106534017 bytes" after adding single file
17 septembre 2023, par leonWhen trying to deploy my lambdas using AWS through the serverless framework I had no problems until I tried adding the ffmpeg binary.


Now the ffmpeg binaries I have tried to add have ranged from 26 mb to 50 mb. Whichever I add, I get the following error :


UPDATE_FAILED: WhatsappDocumentHandlerLambdaFunction (AWS::Lambda::Function)
Resource handler returned message: "Unzipped size must be smaller than 106534017 bytes (Service: Lambda, Status Code: 400, Request ID: ...)" (RequestToken: ..., HandlerErrorCode: InvalidRequest)



The problem is that I did not add the file to this function. I added it to a completely different one.


I have tried the following things :


- 

- Creating an "empty" function that only contains the ffmpeg binary and a function handler
- Creating a layer that only contains the ffmpeg binary
- Deleting the ffmpeg binary (the error goes away and deployment succeeds
- Varying sizes of ffmpeg binaries between 26 and 50mb
- Getting the ffmpeg-lambda-layer (https://github.com/serverlesspub/ffmpeg-aws-lambda-layer ; https://serverlessrepo.aws.amazon.com/applications/us-east-1/145266761615/ffmpeg-lambda-layer) and deploying it myself












When trying every single one of these options I get the UPDATE_FAILED error in a different function that surely is not too big.


I know I can deploy using a docker image but why complicate things with docker images when it should work ?


I am very thankful for any ideas.


-
Extracting Thumbnail URL from Video URL
29 août 2023, par Deepak SangleSo, I have a video URL in an Amazon S3 bucket. I must extract the thumbnail image (preview image) from the video URL. The catch is that I do not have the luxury to download or upload the complete video since it takes time. My approach is something like this.
I first created a blob object containing the first few seconds of that video using something like this.


const chunkSize = 1024*1024; // 1MB
 const start = 0;
 const end = chunkSize - 1;
 const rangeHeader = `bytes=${start}-${end}`;
 
 const VideoResponse = await axios.get(url, { 
 responseType: 'arraybuffer',
 headers: { Range: rangeHeader }
 });

 const chunkData = VideoResponse.data; 
 
 const videoBlob = new Blob([chunkData], { type: 'video/mp4' });
 const videoUrl = URL.createObjectURL(videoBlob);
 console.log({chunkData, videoBlob, videoUrl});



Console gives me something like this


{
 chunkData: <buffer 00="00" 1c="1c" 66="66" 74="74" 79="79" 70="70" 6d="6d" 34="34" 32="32" 69="69" 73="73" 6f="6f" 61="61" 76="76" 63="63" 31="31" 02="02" bd="bd" ab="ab" 6c="6c" 68="68" 64="64" c7="c7" 1048526="1048526" more="more" bytes="bytes">,
 videoBlob: Blob { size: 1048576, type: 'video/mp4' },
 videoUrl: 'blob:nodedata:764fce87-792f-47e8-bc3e-15921ee5787f'
}
</buffer>


Now, there are many options after this. I am trying to download this blob object by converting it into a file. After I successfully convert it into an mp4 file, I can easily take a screenshot of it using
fluent-ffmpeg
package. However, I couldn't convert it into a file. If I try to do something like this

const BlobResponse = await axios({
 method: 'GET',
 url: videoUrl,
 responseType: 'stream'
 });

 const file = fs.createWriteStream(`video.mp4`);
 BlobResponse.data.pipe(file);
 
 file.on("error", (error) => {
 console.log(`There was an error writing the file. Details: $ {error}`);
 });

 file.on('finish', () => {
 file.close();
 console.log("File downloaded successfully");
 });



But it throws me the error
AxiosError: Unsupported protocol blob:


I also tried to directly convert the blob object to a jpeg object but to no avail.


I have searched complete StackOverflow, and I have not found a single solution working so please let me know why those are not working or if there is any new solution to do this.