
Recherche avancée
Autres articles (31)
-
Encodage et transformation en formats lisibles sur Internet
10 avril 2011MediaSPIP transforme et ré-encode les documents mis en ligne afin de les rendre lisibles sur Internet et automatiquement utilisables sans intervention du créateur de contenu.
Les vidéos sont automatiquement encodées dans les formats supportés par HTML5 : MP4, Ogv et WebM. La version "MP4" est également utilisée pour le lecteur flash de secours nécessaire aux anciens navigateurs.
Les documents audios sont également ré-encodés dans les deux formats utilisables par HTML5 :MP3 et Ogg. La version "MP3" (...) -
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 -
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.
Sur d’autres sites (3281)
-
Using FFmpeg to detect alpha channel in PR4444 file [closed]
8 décembre 2023, par Justin MyersI wanted to comment on a thread that already exists on this topic in general, but I just signed up to SO and have not earned my contribution credits yet ! If anyone has advice on how to better handle that in the future, I am all ears !!


None-the-less, here is that thread :


A good way to detect alpha channel in a video using ffmpeg/ffprobe


I tried both the answers listed in that post to detect the presence of an alpha channel in a PR4444 video file.


For Gyan's answer, I get the following pixel format from any PR4444 file (regardless if encoded with alpha or no alpha), when running part 1 :


yuva444p12le


As you will see in Gyan's notes, even if a FFprobe returns an "a" in the return string (for the call for pixel format), that does not equate to the presence of an alpha channel. Hence their note for the subsequent (part 2) call...


I then plugged that into the part 2 of Gyan's answer, but that produced an empty from FFmpeg, and a message providing valid arguments to pair with grep. It seems as though -oP is not a valid arg for grep ? Because it wasn't listed in the returned list of options. This is the template I used (pulled verbatim from Gyan's posted solution) :


ffprobe -v 0 -show_entries pixel_format=name:flags=alpha -of compact=p=0 | grep "$PIX_FMT|" | grep -oP "(?<=alpha=)\d"


Where $PIX_FMT is to be replaced with yuva444p121e (per Gyan's instructions).


I then tried Benji's solution for part 2, but that just returns the following :


pix_fmt=yuva444p12le


Of course, this isn't any more useful than part 1...


I suspect Gyan is on the right track as he mentions part 2 should produce a boolean result for the presence of an alpha channel. However, either I am misunderstanding the syntax of his template, or something has changed in FFprobe since. There is so limited information out there for this specific task. Hoping someone with more experience and knowledge can help shed some light for me ??


-
MP4Box : Concatenating track ID 1 even though sample descriptions do not match
29 avril 2021, par Lysander CoxEssentially, I wish to concatenate a series of videos using MP4Box. When I attempt to do so, I receive the following error :


No suitable destination track found - creating new one (type soun)
0.500 secs Interleaving 



I can circumvent the issue, at least temporarily, by adding a
-force-cat
parameter to theMP4Box
command. However, this creates issues with the alignment of audio and video and produces the following warning :

Concatenating track ID 1 even though sample descriptions do not match



Now, as far as I can tell, this has to do with differing parameters between video types. I will display the
ffprobe
output of each video type below in order to hopefully shed some light on the issue.

VIDEO TYPE 1 FFPROBE OUTPUT :


Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '0.mp4':
 Metadata:
 major_brand : isom
 minor_version : 512
 compatible_brands: isomiso2avc1mp41
 encoder : Lavf58.29.100
 Duration: 00:00:02.25, start: 0.000000, bitrate: 851 kb/s
 Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x1080, 816 kb/s, 4 fps, 4 tbr, 16384 tbn, 8 tbc (default)
 Metadata:
 handler_name : VideoHandler
 Stream #0:1(und): Audio: mp3 (mp4a / 0x6134706D), 24000 Hz, mono, fltp, 32 kb/s (default)
 Metadata:
 handler_name : SoundHandler



VIDEO TYPE 2 FFPROBE OUTPUT :


Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'static.mp4':
 Metadata:
 major_brand : isom
 minor_version : 512
 compatible_brands: isomiso2avc1mp41
 encoder : Lavf58.78.100
 Duration: 00:00:01.00, start: 0.000000, bitrate: 662 kb/s
 Stream #0:0(eng): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 654 kb/s, 29.97 fps, 29.97 tbr, 30k tbn, 59.94 tbc (default)
 Metadata:
 handler_name : VideoHandler




Can anyone identify what the incongruity between video types is and how I can resolve it ? Thanks.


-
exe file not executing from deployed ASP.NET MVC app in TAS (Tanzu /PCF)
24 juin, par Darshan AdakaneI am facing an issue for my ASP.NET MVC web application on .NET 4 being deployed to TAS.


I am trying to do image compression using
ffmpeg.exe
.

While it is working on my local machine, I get an "500 internal server error" when deployed to TAS (tanzu application server). I am using
hwc_buildpack
and storing the file inPath.GetTemp()
folder for testing.

applications:
- name: MyApp-Dev
 memory: 1G
 instances: 1
 stack: windows
 buildpacks:
 - hwc_buildpack
 path: \MyAppnew\obj\Release\Package\PackageTmp
 env:
 services:
 routes:
 - route: myapp-dev.apps.company.com
 - route: myapp-dev.company.com



I also see that the
.exe
is being published when app I deployed. I am assuming if TAS has NO permission to read exe or read exe 'not allowed' policy.

This is my code :


[HttpPost]
[Route("uploadimage")]
public async Task<ihttpactionresult> UploadImage()
{
 try
 {
 if (!Request.Content.IsMimeMultipartContent())
 return BadRequest("Unsupported media type.");

 Console.WriteLine("UploadImage method started.");

 var provider = new MultipartMemoryStreamProvider();
 await Request.Content.ReadAsMultipartAsync(provider);

 Console.WriteLine($"Total Files available: {provider.Contents.Count}, {provider.Contents}");

 foreach (var file in provider.Contents)
 {
 try
 {
 var imageFile = await file.ReadAsByteArrayAsync();
 Console.WriteLine($"imageFile, { imageFile.Length }");
 var rawFileName = file.Headers.ContentDisposition.FileName.Trim('"');
 Console.WriteLine($"rawFileName, {rawFileName}");
 var fileName = Path.GetFileName(rawFileName); // Sanitize filename
 Console.WriteLine($"fileName, {fileName}");

 // Check file size limit (300MB)
 if (imageFile.Length > 300 * 1024 * 1024) // 300MB limit
 {
 Console.WriteLine("File size exceeds 300MB limit.");
 return BadRequest("File size exceeds 300MB limit.");
 }

 var inputFilePath = Path.Combine(_uploadFolder, fileName);
 Console.WriteLine($"inputFilePath, {inputFilePath}");

 var outputFilePath = Path.Combine(_uploadFolder, "compressed_" + fileName);
 Console.WriteLine($"outputFilePath, {outputFilePath}");

 // Save uploaded file to disk
 File.WriteAllBytes(inputFilePath, imageFile);

 // Check if the input file exists
 if (!File.Exists(inputFilePath))
 {
 Console.WriteLine($"Input file does not exist: {inputFilePath}");
 return InternalServerError(new Exception($"❌ Input file does not exist: {inputFilePath}"));
 }

 //Console.WriteLine($"✅ FFmpeg found at path: {ffmpegFullPath}");

 await FFMpegArguments
 .FromFileInput(inputFilePath)
 .OutputToFile(outputFilePath, overwrite: true, options => options
 .WithCustomArgument("-vf scale=800:-1")
 .WithCustomArgument("-q:v 10")
 )
 .ProcessAsynchronously();

 Console.WriteLine($"outputFilePath, {outputFilePath}");

 // Check if the output file was created
 if (File.Exists(outputFilePath))
 {
 var fileInfo = new FileInfo(outputFilePath); // Get file info

 Console.WriteLine($"outputFileInfoPropsFullName, {fileInfo.FullName}");
 Console.WriteLine($"outputFileInfoPropsLength, {fileInfo.Length}");

 var compressedFileBytes = File.ReadAllBytes(outputFilePath);
 var compressedFileBase64 = Convert.ToBase64String(compressedFileBytes);

 return Ok(new
 {
 Message = "Image uploaded and compressed successfully.",
 CompressedImagePath = outputFilePath,
 CompressedFileSize = fileInfo.Length, // Size in bytes
 CompressedFileBase64 = compressedFileBase64
 });
 }
 else
 {
 Console.WriteLine("OutputFilePath File not exists.");
 return InternalServerError(new Exception($"❌ Failed to create compressed file: {outputFilePath}"));
 });
 }
 catch (Exception ex)
 {
 Console.WriteLine($"File TRYCATCH:{ex}");
 return InternalServerError(new Exception("Image compression failed: " + ex.Message));
 }
 }
 }
 catch (Exception ex)
 {
 Console.WriteLine($"Method TRYCATCH:{ex}");
 throw;
 }

 return BadRequest("No image file uploaded.");
}
</ihttpactionresult>


I'm getting this error in my tanzu environment logs from the code when I execute :


await FFMpegArguments



This is the exception log :


FFMpegCore.Exceptions.FFMpegException: ffmpeg was not found on your system



I also see that the
.exe
files do exist in TAS in these logs :

2025-06-13T16:07:55.878+05:30 [APP/PROC/WEB/0] [OUT] PATH of FFmpeg Executable: C:\Users\vcap\app\ffmpeg-bin\ffmpeg.exe
2025-06-13T16:07:55.878+05:30 [APP/PROC/WEB/0] [OUT] PATH of ffmpegPath: C:\Users\vcap\app\ffmpeg-bin
2025-06-13T16:07:55.878+05:30 [APP/PROC/WEB/0] [OUT] PATH of BaseDirectory: C:\Users\vcap\app\
2025-06-13T16:07:55.881+05:30 [APP/PROC/WEB/0] [OUT] TempPath: C:\Users\vcap\AppData\Local\Temp\ 
 2025-06-24T18:39:50.684+05:30 [APP/PROC/WEB/0] [OUT] at MCANew.Controllers.Api.MessagesController.<uploadimage>d__6.MoveNext() in I:\Agents\Agent-Win-B\_work\3033\s\MCANew\Controllers\Api\MessagesController.cs:line 133
2025-06-24T18:39:50.684+05:30 [APP/PROC/WEB/0] [OUT] at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
2025-06-24T18:39:50.684+05:30 [APP/PROC/WEB/0] [OUT] --- End of stack trace from previous location where exception was thrown ---
2025-06-24T18:39:50.684+05:30 [APP/PROC/WEB/0] [OUT] at FFMpegCore.FFMpegArgumentProcessor.<processasynchronously>d__24.MoveNext()
2025-06-24T18:39:50.684+05:30 [APP/PROC/WEB/0] [OUT] at FFMpegCore.FFMpegArgumentProcessor.PrepareProcessArguments(FFOptions ffOptions, CancellationTokenSource& cancellationTokenSource)
2025-06-24T18:39:50.684+05:30 [APP/PROC/WEB/0] [OUT] at FFMpegCore.Helpers.FFMpegHelper.VerifyFFMpegExists(FFOptions ffMpegOptions)
2025-06-24T18:39:50.684+05:30 [APP/PROC/WEB/0] [OUT] File TRYCATCH:FFMpegCore.Exceptions.FFMpegException: ffmpeg was not found on your system
</processasynchronously></uploadimage>


My objective is to run successfully exe on TAS and image compression to happen.