
Recherche avancée
Médias (1)
-
Somos millones 1
21 juillet 2014, par
Mis à jour : Juin 2015
Langue : français
Type : Video
Autres articles (65)
-
Ajouter notes et légendes aux images
7 février 2011, parPour pouvoir ajouter notes et légendes aux images, la première étape est d’installer le plugin "Légendes".
Une fois le plugin activé, vous pouvez le configurer dans l’espace de configuration afin de modifier les droits de création / modification et de suppression des notes. Par défaut seuls les administrateurs du site peuvent ajouter des notes aux images.
Modification lors de l’ajout d’un média
Lors de l’ajout d’un média de type "image" un nouveau bouton apparait au dessus de la prévisualisation (...) -
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 (...) -
Contribute to documentation
13 avril 2011Documentation is vital to the development of improved technical capabilities.
MediaSPIP welcomes documentation by users as well as developers - including : critique of existing features and functions articles contributed by developers, administrators, content producers and editors screenshots to illustrate the above translations of existing documentation into other languages
To contribute, register to the project users’ mailing (...)
Sur d’autres sites (8763)
-
Trying to merge two videos from my photo roll with Flutter ffmpeg without success
4 avril 2023, par Stéphane de LucaMy goal is to merge too video I pick from my photo roll.
My code starts as follows :


// videos[0] contains: "content://media/external/video/media/2779"
 final v1 = await videos[0].getMediaUrl();
 if (v1 == null) return;
 final v1Path = await LecleFlutterAbsolutePath.getAbsolutePath(uri: v1);



But printing
v1Path
give a path withjpeg
extension :
/data/user/0/com.example.shokaze/cache/OutputFile_1669939088711.jpeg' which I though would have bear
mp4` as it is a video.

Why is it so ?


Another question I have is how can I make a relevant path so that the ffmpeg video appears in my roll after its creation ? Should I do the following and provide
outputPath
to the code ?

The command it executes is :

-i /data/user/0/com.example.shokaze/cache/OutputFile_1669940421875.jpeg -i /data/user/0/com.example.shokaze/cache/OutputFile_1669940428723.jpeg -filter_complex '[0:0][1:0]concat=n=2:v=1:a=0[out]' -map '[out]' /data/user/0/com.example.shokaze/app_flutter/output.mp4


And I get an error :

I/flutter (30190): error 1


My code is as follows :


String output = "content://media/external/video/media/output";
 final outputPath = await LecleFlutterAbsolutePath.getAbsolutePath(uri: output);
 if (outputPath == null) return;



The full code is as follows :


// Makes the final video by merging all videos from the mixing table
 void makeFinalVideo() async {
 if (videos.length < 2) return;

 final v1 = await videos[0].getMediaUrl();
 if (v1 == null) return;
 final v1Path = await LecleFlutterAbsolutePath.getAbsolutePath(uri: v1);
 if (v1Path == null) return;
 //String v1 = "";
 final v2 = await videos[1].getMediaUrl();
 if (v2 == null) return;
 final v2Path = await LecleFlutterAbsolutePath.getAbsolutePath(uri: v2);
 if (v2Path == null) return;
 String output = "content://media/external/video/media/output";
 final outputPath = "";
 // await LecleFlutterAbsolutePath.getAbsolutePath(uri: output);
 // if (outputPath == null) return;

 Video.merge(v1Path, v2Path, outputPath);
 }



class Video {
 /// Merges the video [v1] with [v2] as [output] video located in app doc path
 static void merge(String v1, String v2, String output) async {
 final appDocDir = await getApplicationDocumentsDirectory();

 //final appDir = await syspaths.getApplicationDocumentsDirectory();
 String rawDocumentPath = appDocDir.path;
 final outputPath = '$rawDocumentPath/output.mp4';

 final command =
 '-i $v1 -i $v2 -filter_complex \'[0:0][1:0]concat=n=2:v=1:a=0[out]\' -map \'[out]\' $outputPath';
 //await execute(command);
 try {
 final r = await FFmpegKit.execute(command);

 //.then((rc) => print("FFmpeg process exited with rc $rc"));
 print("Result: $r");
 } catch (e) {
 print("Exception: $e");
 }
 }
}



-
ffmpeg boxblur filter takes too long
12 juin 2020, par Prashant_SarinI am using below command to blur a video but it is very slow. Can anyone please help if i can improve the speed somehow.



"ffmpeg -i $inputPath -lavfi [0:v]split=2[original][copy];[copy]scale=ih*16/9:-1,crop=h=iw*9/16,boxblur=luma_radius=50:chroma_radius=25:luma_power=2[blurred];[blurred][original]overlay=(main_w-overlay_w)/2:(main_h-overlay_h)/2[final] -map [final] -map a:0 -g 2 -preset ultrafast $outputPath -y"



-
Humble Video take snapshot of given time
23 mai 2021, par Boldbayar- 

-
Hello, I'm using https://github.com/artclarke/humble-video to take a thumbnail from a video.
So far I have successfully managed to take a snapshot from a video at start with following method.


private static Path generateThumbnail(final Path videoFile)
 throws InterruptedException, IOException {

 final Demuxer demuxer = Demuxer.make();
 demuxer.open(videoFile.toString(), null, false, true, null, null);

 int streamIndex = -1;
 Decoder videoDecoder = null;
 String rotate = null;
 final int numStreams = demuxer.getNumStreams();
 for (int i = 0; i < numStreams; ++i) {
 final DemuxerStream stream = demuxer.getStream(i);
 final KeyValueBag metaData = stream.getMetaData();
 final Decoder decoder = stream.getDecoder();
 if (decoder != null
 && decoder.getCodecType() == MediaDescriptor.Type.MEDIA_VIDEO) {
 videoDecoder = decoder;
 streamIndex = i;
 rotate = metaData.getValue("rotate", KeyValueBag.Flags.KVB_NONE);
 break;
 }
 }

 if (videoDecoder == null) {
 throw new IOException("Not a valid video file");
 }
 videoDecoder.open(null, null);

 final MediaPicture picture = MediaPicture.make(videoDecoder.getWidth(),
 videoDecoder.getHeight(), videoDecoder.getPixelFormat());

 final MediaPictureConverter converter = MediaPictureConverterFactory
 .createConverter(MediaPictureConverterFactory.HUMBLE_BGR_24, picture);

 final MediaPacket packet = MediaPacket.make();
 BufferedImage image = null;
 MUX : while (demuxer.read(packet) >= 0) {
 if (packet.getStreamIndex() != streamIndex) {
 continue;
 }
 int offset = 0;
 int bytesRead = 0;
 videoDecoder.decodeVideo(picture, packet, offset);
 do {
 bytesRead += videoDecoder.decode(picture, packet, offset);
 if (picture.isComplete()) {
 image = converter.toImage(null, picture);
 break MUX;
 }
 offset += bytesRead;

 } while (offset < packet.getSize());
 }
 if (image == null) {
 throw new IOException("Unable to find a complete video frame");
 }
 if (rotate != null) {
 final AffineTransform transform = new AffineTransform();
 transform.translate(0.5 * image.getHeight(), 0.5 * image.getWidth());
 transform.rotate(Math.toRadians(Double.parseDouble(rotate)));
 transform.translate(-0.5 * image.getWidth(), -0.5 * image.getHeight());
 final AffineTransformOp op = new AffineTransformOp(transform,
 AffineTransformOp.TYPE_BILINEAR);
 image = op.filter(image, null);
 }

 final Path target = videoFile.getParent()
 .resolve(videoFile.getFileName() + ".thumb.jpg");

 final double mul;
 if (image.getWidth() > image.getHeight()) {
 mul = 216 / (double) image.getWidth();
 } else {
 mul = 216 / (double) image.getHeight();
 }

 final int newW = (int) (image.getWidth() * mul);
 final int newH = (int) (image.getHeight() * mul);
 final Image thumbnailImage = image.getScaledInstance(newW, newH,
 Image.SCALE_SMOOTH);
 image = new BufferedImage(newW, newH, BufferedImage.TYPE_INT_BGR);

 final Graphics2D g2d = image.createGraphics();
 g2d.drawImage(thumbnailImage, 0, 0, null);
 g2d.dispose();

 ImageIO.write(image, "jpeg", target.toFile());
 return target.toAbsolutePath(); }



-
Now, what I want to do is take a snapshot after 2 seconds after the video starts, is it possible ? I
have tried using the "Demuxer" -s seek method but no luck.








-