
Recherche avancée
Médias (91)
-
Spitfire Parade - Crisis
15 mai 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Wired NextMusic
14 mai 2011, par
Mis à jour : Février 2012
Langue : English
Type : Video
-
Video d’abeille en portrait
14 mai 2011, par
Mis à jour : Février 2012
Langue : français
Type : Video
-
Sintel MP4 Surround 5.1 Full
13 mai 2011, par
Mis à jour : Février 2012
Langue : English
Type : Video
-
Carte de Schillerkiez
13 mai 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Texte
-
Publier une image simplement
13 avril 2011, par ,
Mis à jour : Février 2012
Langue : français
Type : Video
Autres articles (92)
-
MediaSPIP 0.1 Beta version
25 avril 2011, parMediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
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 (...) -
Multilang : améliorer l’interface pour les blocs multilingues
18 février 2011, parMultilang est un plugin supplémentaire qui n’est pas activé par défaut lors de l’initialisation de MediaSPIP.
Après son activation, une préconfiguration est mise en place automatiquement par MediaSPIP init permettant à la nouvelle fonctionnalité d’être automatiquement opérationnelle. Il n’est donc pas obligatoire de passer par une étape de configuration pour cela. -
HTML5 audio and video support
13 avril 2011, parMediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
For older browsers the Flowplayer flash fallback is used.
MediaSPIP allows for media playback on major mobile platforms with the above (...)
Sur d’autres sites (4310)
-
VP8 And FFmpeg
18 juin 2010, par Multimedia Mike — VP8UPDATE, 2010-06-17 : You don’t need to struggle through these instructions anymore. libvpx 0.9.1 and FFmpeg 0.6 work together much better. Please see this post for simple instructions on getting up and running quickly.
Let’s take the VP8 source code (in Google’s new libvpx library) for a spin ; get it to compile and hook it up to FFmpeg. I am hesitant to publish specific instructions for building in the somewhat hackish manner available on day 1 (download FFmpeg at a certain revision and apply a patch) since that kind of post has a tendency to rise in Google rankings. I will just need to remember to update this post after the library patches are applied to the official FFmpeg tree.
Statement of libvpx’s Relationship to FFmpeg
I don’t necessarily speak officially for FFmpeg. But I’ve been with the project long enough to explain how certain things work.Certainly, some may wonder if FFmpeg will incorporate Google’s newly open sourced libvpx library into FFmpeg. In the near term, FFmpeg will support encoding and decoding VP8 via external library as it does with a number of other libraries (most popularly, libx264). FFmpeg will not adopt the code for its own codebase, even if the license may allow it. That just isn’t how the FFmpeg crew rolls.
In the longer term, expect the FFmpeg project to develop an independent, interoperable implementation of the VP8 decoder. Sometime after that, there may also be an independent VP8 encoder as well.
Building libvpx
Download and build libvpx. This is a basic ’configure && make’ process. The build process creates a static library, a bunch of header files, and 14 utilities. A bunch of these utilities operate on a file format called IVF which is apparently a simple transport method for VP8. I have recorded the file format on the wiki.We could use a decoder for this in the FFmpeg code base for testing VP8 in the future.
Who’s game ?Just as I was proofreading this post, I saw that David Conrad has sent an IVF demuxer to the ffmpeg-devel list.There doesn’t seem to be a ’make install’ step for the library. Instead, go into the overly long directory (on my system, this is generated as vpx-vp8-nopost-nodocs-generic-gnu-v0.9.0), copy the contents of include/ to /usr/local/include and the static library in lib/ to /usr/local/lib .
Building FFmpeg with libvpx
Download FFmpeg source code at the revision specified or take your chances with the latest version (as I did). Download and apply provided patches. This part hurts since there is one diff per file. Most of them applied for me.Configure FFmpeg with
'configure --enable-libvpx_vp8 --enable-pthreads'
. Ideally, this should yield no complaints and ’libvpx_vp8’ should show up in the enabled decoders and encoders sections. The library apparently relies on threading which is why'--enable-pthreads'
is necessary. After I did this, I was able to create a new webm/VP8/Vorbis file simply with :ffmpeg -i input_file output_file.webm
Unfortunately, I can’t complete the round trip as decoding doesn’t seem to work. Passing the generated .webm file back into FFmpeg results in a bunch of errors of this format :
[libvpx_vp8 @ 0x8c4ab20]v0.9.0 [libvpx_vp8 @ 0x8c4ab20]Failed to initialize decoder : Codec does not implement requested capability
Maybe this is the FFmpeg revision mismatch biting me.
FFmpeg Presets
FFmpeg features support for preset files which contain collections of tuning options to be loaded into the program. Google provided some presets along with their FFmpeg patches :- 1080p50
- 1080p
- 360p
- 720p50
- 720p
To invoke one of these (assuming the program has been installed via ’make install’ so that the presets are in the right place) :
ffmpeg -i input_file -vcodec libvpx_vp8 -vpre 720p output_file.webm
This will use a set of parameters that are known to do well when encoding a 720p video.
Code Paths
One of goals with this post was to visualize a call graph after I got the decoder hooked up to FFmpeg. Fortunately, this recon is greatly simplified by libvpx’s simple_decoder utility. Steps :- Build libvpx with
--enable-gprof
- Run simple_decoder on an IVF file
- Get the pl_from_gprof.pl and dot_from_pl.pl scripts frome Graphviz’s gprof filters
- gprof simple_decoder | ./pl_from_gprof.pl | ./dot_from_pl.pl > 001.dot
- Remove the 2 [graph] and 1 [node] modifiers from the dot file (they only make the resulting graph very hard to read)
- dot -Tpng 001.dot > 001.png
Here are call graphs generated from decoding test vectors 001 and 017.
It’s funny to see several functions calling an empty bubble. Probably nothing to worry about. More interesting is the fact that a lot of function_c() functions are called. The ’_c’ at the end is important— that generally indicates that there are (or could be) SIMD-optimized versions. I know this codebase has plenty of assembly. All of the x86 ASM files appear to be written such that they could be compiled with NASM.
Leftovers
One interesting item in the code was vpx_scale/leapster. Is this in reference to the Leapster handheld educational gaming unit ? Based on this item from 2005 (archive.org copy), some Leapster titles probably used VP6. This reminds me of finding references to the PlayStation in Duck/On2’s original VpVision source release. I don’t know of any PlayStation games that used Duck’s original codecs but with thousands to choose from, it’s possible that we may find a few some day. -
FFmpeg Concatenation Command Fails in Flutter App
18 février 2024, par PetroI'm developing a Flutter application where I need to concatenate several images into a single video file using FFmpeg. Despite following the recommended practices and trying multiple variations of the FFmpeg command, all my attempts result in failure with an exit code of 1.


FFMPEG Version :
ffmpeg_kit_flutter: ^6.0.3-LTS


All of the files are present when this happens...



Environment :
Flutter app targeting Android
Using ffmpeg-kit-flutter for FFmpeg operations


Objective :
To concatenate multiple images stored in the app's file system into a video.


Code Snippet :
I'm generating a list of image paths, writing them to a file (ffmpeg_list.txt), and using that file with FFmpeg's concat demuxer. Here's a simplified version of my code :


Future<void> _createVideoFromImages() async {
 final Directory appDir = await getApplicationDocumentsDirectory();
 final Uuid uuid = Uuid();
 final String videoFileName = uuid.v4();
 final String outputPath = '${appDir.path}/$videoFileName.mp4';
 
 final Directory tempImageDir = await Directory('${appDir.path}/tempImages').create();
 final StringBuffer ffmpegInput = StringBuffer();
 int index = 0;

 for (var image in _images) {
 String newFileName = 'img${index++}${Path.extension(image.path)}'.replaceAll(' ', '_');
 final String newPath = '${tempImageDir.path}/$newFileName';
 await image.copy(newPath);
 ffmpegInput.writeln("file '$newPath'");
 }

 final String listFilePath = '${appDir.path}/ffmpeg_list.txt';
 await File(listFilePath).writeAsString(ffmpegInput.toString());

 if(await File(listFilePath).exists()) {
 String ffmpegCommand = "-v verbose -f concat -safe 0 -i $listFilePath -vsync vfr -pix_fmt yuv420p -c:v libx264 -r 30 $outputPath";
 // Additional commands tried here...
 await FFmpegKit.execute(ffmpegCommand).then((session) async {
 // Error handling code...
 });
 }
}

Result Logs:
I/flutter: file exists at /data/user/0/com.example.app/app_flutter/ffmpeg_list.txt
I/flutter: FFmpeg command: -v verbose -f concat -safe 0 -i /data/user/0/com.example.app/app_flutter/ffmpeg_list.txt -vsync vfr -pix_fmt yuv420p -c:v libx264 -r 30 /data/user/0/com.example.app/app_flutter/58fdf92b-47b0-49d1-be93-d9c95870c733.mp4
I/flutter: Failed to create video
I/flutter: FFmpeg process exited with:1
I/flutter: FFmpeg command failed with logs: ffmpeg version n6.0 Copyright (c) 2000-2023 the FFmpeg developers...
</void>


Attempts :
-Simplified the FFmpeg command by removing -vsync vfr, -pix_fmt yuv420p, and adjusting -r 30 parameters.
-Tried using the -c copy option to avoid re-encoding.
-Tested with a single image to ensure basic functionality works.
-Checked file permissions and ensured all images and the list file are accessible.


Despite these attempts, the command fails without providing specific error messages related to the command's execution. The verbose logs do not offer insights beyond the FFmpeg version and configuration.


Questions :
Are there known issues with FFmpeg's concat that might lead to such failures ?
Are there alternative approaches ?


I appreciate any insights or suggestions the community might have. Thank you !


Full code :


Future<void> _createVideoFromImages() async {
 final Directory appDir = await getApplicationDocumentsDirectory();
 final Uuid uuid = Uuid();
 final String videoFileName = uuid.v4();
 final String outputPath = '${appDir.path}/$videoFileName.mp4';
 final String singleImagePath = _images[0]!.path;

// Create a directory to store renamed images to avoid any naming conflict
 final Directory tempImageDir = await Directory('${appDir.path}/tempImages').create();

 final StringBuffer ffmpegInput = StringBuffer();
 int index = 0; // To ensure unique filenames

 for (var image in _images) {
 // Generate a new filename by replacing spaces with underscores and adding an index
 String newFileName = 'img${index++}${p.extension(image!.path)}'.replaceAll(' ', '_');
 final String newPath = '${tempImageDir.path}/$newFileName';

 // Copy and rename the original file to the new path
 await image!.copy(newPath);

 // Add the new, safely named file path to the ffmpegInput
 ffmpegInput.writeln("file '$newPath'");
 }

// Write the paths to a temporary text file for FFmpeg's concat demuxer
 final String listFilePath = '${appDir.path}/ffmpeg_list.txt';
 await File(listFilePath).writeAsString(ffmpegInput.toString());

 //check if file exists
 if(await File(listFilePath).exists()) {
 print("file exists at $listFilePath");

// Use the generated list file in the concat command
 String ffmpegCommand = "-v verbose -f concat -safe 0 -i $listFilePath -vsync vfr -pix_fmt yuv420p -c:v libx264 -r 30 $outputPath";
 String ffmpegCommand2 = "-v verbose -f concat -safe 0 -i $listFilePath -c:v libx264 $outputPath";
 String ffmpegCommand3 = "-v verbose -i $singleImagePath -frames:v 1 $outputPath";
 //print command
 print("FFmpeg command: $ffmpegCommand");


 await FFmpegKit.execute(ffmpegCommand).then((session) async {
 // Check the session for success or failure
 final returnCode = await session.getReturnCode();
 if (returnCode!.isValueSuccess()) {
 print("Video created successfully: $outputPath");
 //okay all set, now set the video to be this:
 _actual_video_file_ready_to_upload = File(outputPath);
 print ("video path is: ${outputPath}");
 } else {
 print("Failed to create video");
 print("FFmpeg process exited with:" + returnCode.toString());
 // Command failed; capture and log error details
 await session.getLogsAsString().then((logs) {
 print("FFmpeg command failed with logs: $logs");
 });
 // Handle failure, e.g., by showing an error message
 showSnackBarHelperERRORWrapLongString(context, "Failed to create video");
 }
 });

 //try command 2
 if(_actual_video_file_ready_to_upload == null) {
 await FFmpegKit.execute(ffmpegCommand2).then((session) async {
 // Check the session for success or failure
 final returnCode = await session.getReturnCode();
 if (returnCode!.isValueSuccess()) {
 print("Video created successfully: $outputPath");
 //okay all set, now set the video to be this:
 _actual_video_file_ready_to_upload = File(outputPath);
 print ("video path is: ${outputPath}");
 } else {
 print("Failed to create video");
 print("FFmpeg process exited with:" + returnCode.toString());
 // Command failed; capture and log error details
 await session.getLogsAsString().then((logs) {
 print("FFmpeg command failed with logs: $logs");
 });
 // Handle failure, e.g., by showing an error message
 showSnackBarHelperERRORWrapLongString(context, "Failed to create video");
 }
 });
 }
 //try command 3
 if(_actual_video_file_ready_to_upload == null) {
 await FFmpegKit.execute(ffmpegCommand3).then((session) async {
 // Check the session for success or failure
 final returnCode = await session.getReturnCode();
 if (returnCode!.isValueSuccess()) {
 print("Video created successfully: $outputPath");
 //okay all set, now set the video to be this:
 _actual_video_file_ready_to_upload = File(outputPath);
 print ("video path is: ${outputPath}");
 } else {
 print("Failed to create video");
 print("FFmpeg process exited with:" + returnCode.toString());
 // Command failed; capture and log error details
 await session.getLogsAsString().then((logs) {
 print("FFmpeg command failed with logs: $logs");
 });
 // Handle failure, e.g., by showing an error message
 showSnackBarHelperERRORWrapLongString(context, "Failed to create video");
 }
 });
 }
 }else{
 print("file does not exist at $listFilePath");
 }
 }
</void>


-
9 Form Optimisation Tips to Convert More Visitors
15 février 2024, par Erin