
Recherche avancée
Médias (1)
-
SPIP - plugins - embed code - Exemple
2 septembre 2013, par
Mis à jour : Septembre 2013
Langue : français
Type : Image
Autres articles (35)
-
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 (...) -
Librairies et logiciels spécifiques aux médias
10 décembre 2010, parPour un fonctionnement correct et optimal, plusieurs choses sont à prendre en considération.
Il est important, après avoir installé apache2, mysql et php5, d’installer d’autres logiciels nécessaires dont les installations sont décrites dans les liens afférants. Un ensemble de librairies multimedias (x264, libtheora, libvpx) utilisées pour l’encodage et le décodage des vidéos et sons afin de supporter le plus grand nombre de fichiers possibles. Cf. : ce tutoriel ; FFMpeg avec le maximum de décodeurs et (...) -
Use, discuss, criticize
13 avril 2011, parTalk to people directly involved in MediaSPIP’s development, or to people around you who could use MediaSPIP to share, enhance or develop their creative projects.
The bigger the community, the more MediaSPIP’s potential will be explored and the faster the software will evolve.
A discussion list is available for all exchanges between users.
Sur d’autres sites (7578)
-
I want to use Xabe.FFmpeg to convert the video size, but I found that I may be stuck in a deadlock problem
13 mai 2021, par HalfLuckyI now use WPF to develop the function of importing video. I want to add a code to convert the video size, but every time the program runs to this line of code, my program will deadlock here.


public MyRelayCommand<string> ImportMovieCmd => new Lazy>(() =>new MyRelayCommand<string>(ImportMovie)).Value;

private async void ImportMovie(string mediaType)
{
 string[] pathlist = ExecuteSelectFileDialog(mediaType);

 if (pathlist == null || pathlist.Length == 0)
 {
 return;
 }

 foreach (var path in pathlist)
 {
 ...

 await GetMasterMovie(newMedia);

 ...
 }
}
</string></string>


When I proceed to convert the video size, I will be stuck at this step !


private static async Task GetMasterMovie(MovieMediaInfoVM newMedia)
{
 try
 {

 ...

 var conversion = await Xabe.FFmpeg.FFmpeg.Conversions.FromSnippet.ChangeSize(moviepath, output, VideoSize.Nhd);

 conversion.OnProgress += (sender, args) =>
 {
 var percent = (int)(Math.Round(args.Duration.TotalSeconds / args.TotalLength.TotalSeconds, 2) * 100);
 Log.Other.Info2($"[{args.Duration} / {args.TotalLength}] {percent}%");
 };

 await conversion.Start();

 ...

 }
 catch (Exception ex)
 {

 Log.Other.Info2(ex.ToString());
 }
}



When I close the current window, the program starts to convert the video again. I have now changed all methods to asynchronous, but every time the program reaches the line of code below, it will freeze. I have no clue now. I can only ask for help !


-
ffmpeg : Create a fake shadow below alpha channel webm/png sequence
6 mai 2021, par Beneos BattlemapsPurpose : I'd like to render out animated 3D meshes as png sequence to use them as animated tokens for virtual tabletop games. To make the mesh looks more natural I'd like to create a fake show beneath the actual token.


Problem : I have a png sequence
1
(as well as a webm file created with ffmpet out of this png sequence if it makes it easier) with alpha channel. To create the webm I use :
ffmpeg -framerate 24 -f image2 -i Idle_Top.%04d.png -c:v libvpx-vp9 -crf 25 -pix_fmt yuva420p Idle_Top.webm
(If its relevant). I'd like to render out the png sequence to a webm file that have the current images as well as the transparent shadow beneath the token combined.

Possible workflow : I think a good way to achieve the wanted shadow effect is to use the alpha channel image as a mask on a black picture with the same resolution as the source image
2
. Then you have a complete black version of the image. Then you need to place this image beneath the colored image and make a offset of 10px left and 10px down to create the ilusion of perspective3
. At the end the black image below the colored image must have a transparency as well ( 30% visibility should be enough)4
.



Assets : I've put the webm file and the png files on my gDrive https://drive.google.com/drive/folders/1wznGaPwhKc2UyPpSZBSISa1gs3oixsHR?usp=sharing


Though I work with ffmpeg on a regular basis I have no clue where to start. Can you please help me out with this interesting problem ?


Best regards
Ben


-
Why can't I reorder the streams in my mpg container with ffmpeg ?
15 octobre 2023, par kaltorakBackground : Could having audio as stream 0 and video as stream 1 explain why my MPG will play on OSX QuickTime Player, but not Win10 Movies & TV ?

I've got an mpg file with audio as stream 0 and video as stream 1.

It plays fine under OSX QT Player, but not under Win10's default app.

For lack of a better idea, I'm assuming the unusual stream ordering is my problem, and I'm trying to fix it with ffmpeg.
What luck ! https://trac.ffmpeg.org/wiki/Map describes exactly my case !



Re-order streams


The order of your -map options determines the order of the streams in the output. In this example the input file has audio as stream #0 and video as stream #1 (which is possible but unusual). Example to re-position video so it is listed first, followed by the audio :


ffmpeg -i input.mp4 -map 0:v -map 0:a -c copy output.mp4


This example stream copies (re-mux) with -c copy to avoid re-encoding.




I use exactly that command, but the flipping doesn't seem to work, like so :


ffprobe -hide_banner myfile.trimmed.mpg
[h264 @ 000001b965b569c0] Increasing reorder buffer to 2
Input #0, mpeg, from 'myfile.trimmed.mpg':
 Duration: 00:02:41.09, start: 0.500000, bitrate: 6255 kb/s
 Stream #0:0[0x80]: Audio: ac3, 48000 Hz, 5.1(side), fltp, 384 kb/s
 Stream #0:1[0x1e2]: Video: h264 (High), yuv420p(tv, progressive), 1280x720 [SAR 1:1 DAR 16:9], Closed Captions, 59.94 fps, 59.94 tbr, 90k tbn, 119.88 tbc



ffmpeg -hide_banner -i myfile.trimmed.mpg -map 0:v -map 0:a -c copy myfile.trimmed.flipped.mpg
[h264 @ 000001fa0ee94680] Increasing reorder buffer to 2
Input #0, mpeg, from 'myfile.trimmed.mpg':
 Duration: 00:02:41.09, start: 0.500000, bitrate: 6255 kb/s
 Stream #0:0[0x80]: Audio: ac3, 48000 Hz, 5.1(side), fltp, 384 kb/s
 Stream #0:1[0x1e2]: Video: h264 (High), yuv420p(tv, progressive), 1280x720 [SAR 1:1 DAR 16:9], Closed Captions, 59.94 fps, 59.94 tbr, 90k tbn, 119.88 tbc
[mpeg @ 000001fa0ee88dc0] VBV buffer size not set, using default size of 230KB
If you want the mpeg file to be compliant to some specification
Like DVD, VCD or others, make sure you set the correct buffer size
[mpeg @ 000001fa0ee88dc0] ac3 in MPEG-1 system streams is not widely supported, consider using the vob or the dvd muxer to force a MPEG-2 program stream.
Output #0, mpeg, to 'myfile.trimmed.flipped.mpg':
 Metadata:
 encoder : Lavf58.45.100
 Stream #0:0: Video: h264 (High), yuv420p(tv, progressive), 1280x720 [SAR 1:1 DAR 16:9], q=2-31, 59.94 fps, 59.94 tbr, 90k tbn, 59.94 tbc
 Stream #0:1: Audio: ac3, 48000 Hz, 5.1(side), fltp, 384 kb/s
Stream mapping:
 Stream #0:1 -> #0:0 (copy)
 Stream #0:0 -> #0:1 (copy)
Press [q] to stop, [?] for help
frame= 9570 fps=0.0 q=-1.0 Lsize= 123008kB time=00:02:40.95 bitrate=6260.6kbits/s speed= 518x
video:114772kB audio:7545kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.565047%



ffprobe -hide_banner myfile.trimmed.flipped.mpg
[h264 @ 0000021edcf36ac0] Increasing reorder buffer to 2
Input #0, mpeg, from 'myfile.trimmed.flipped.mpg':
 Duration: 00:02:41.09, start: 0.500000, bitrate: 6255 kb/s
 Stream #0:0[0x80]: Audio: ac3, 48000 Hz, 5.1(side), fltp, 384 kb/s
 Stream #0:1[0x1e2]: Video: h264 (High), yuv420p(tv, progressive), 1280x720 [SAR 1:1 DAR 16:9], Closed Captions, 59.94 fps, 59.94 tbr, 90k tbn, 119.88 tbc



What, what ?!
The command output looks like it did exactly what I asked, but the resulting file has the same stream ordering as the original file. What am I missing ?

One possible clue : It looks like the audio stream starts before the video stream. The smallest pkt_pts_time I see in the audio stream is 00:00:00.500000, while the smallest I see in the video stream is 0:00:01.912967. Could that matter ?