
Recherche avancée
Médias (1)
-
Video d’abeille en portrait
14 mai 2011, par
Mis à jour : Février 2012
Langue : français
Type : Video
Autres articles (95)
-
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. -
ANNEXE : Les plugins utilisés spécifiquement pour la ferme
5 mars 2010, parLe site central/maître de la ferme a besoin d’utiliser plusieurs plugins supplémentaires vis à vis des canaux pour son bon fonctionnement. le plugin Gestion de la mutualisation ; le plugin inscription3 pour gérer les inscriptions et les demandes de création d’instance de mutualisation dès l’inscription des utilisateurs ; le plugin verifier qui fournit une API de vérification des champs (utilisé par inscription3) ; le plugin champs extras v2 nécessité par inscription3 (...)
Sur d’autres sites (5708)
-
With ffmpeg print onto clipped video hh:mm:ss time *from original* and hh:mm:ss total duration from original
25 mai 2023, par KesI am using arch linux and bash and ffmpeg, all are up to date and the latest versions.


I am clipping a video that is 30 seconds long and wish to clip from 5 secs to 10 seconds to a new file, from the original.


In the bottom right hand corner of the clip I wish to show timestamps from the original video as follows


- 

- in the 5th second "00:00:05/ 00:00:30"
- in the 6th second "00:00:06/ 00:00:30"

etc - in the 10th second "00:00:10/ 00:00:30"








This is an apparentley simple question(?) but the syntax of the command is not at all obvious and I am hoping an expert may shed some light on this.


All I have so far for the drawtext part, which does not do what I want as it only counts the elapsed time from t=0 of the new clip, whereas I want it to show the timestamp and total duration of the original clip


drawtext
I started with

"drawtext=text='%{pts\:gmtime\:0\:%M\\\\\:%S}':fontsize=24:fontcolor=black:x=(w-text_w-10):y=(h-text_h-10)"



ffmpeg line with drawtext I have started with


ffmpeg -ss 00:00:05 -i "$in_file" -filter_complex "drawtext=fontfile=font.ttf:text='sample text':x=10:y=10:fontsize=12:fontcolor=white:box=1:boxcolor=black@0.5:boxborderw=5,drawtext=text='%{duration\:hms}':fontsize=12:fontcolor=black:x=(w-text_w-10):y=(h-text_h-10)" -t 5 -c:a copy -c:v libx264 out_file.mp4



-
Getting the total samples of an audio file using ffmpeg.exe in C#
12 juillet 2023, par hello worldI'm currently working on a C# project where I need to determine the total number of samples in an audio file using ffmpeg.exe. I've been attempting to achieve this by executing the ffmpeg.exe command within my C# code and parsing the output, but I haven't been successful so far.


Here's the code I've tried :


using System;
using System.Diagnostics;

public class AudioUtils
{
 public static int GetTotalSamples(string audioFilePath)
 {
 string ffmpegPath = "path/to/ffmpeg.exe"; // Path to ffmpeg.exe

 Process process = new Process();
 ProcessStartInfo startInfo = new ProcessStartInfo
 {
 FileName = ffmpegPath,
 Arguments = $"-i \"{audioFilePath}\" -af \"volumedetect\" -vn -sn -dn -f null /dev/null 2>&1",
 RedirectStandardOutput = true,
 RedirectStandardError = true,
 UseShellExecute = false,
 CreateNoWindow = true
 };

 process.StartInfo = startInfo;
 process.Start();

 string output = process.StandardError.ReadToEnd();
 process.WaitForExit();

 int totalSamples = 0;
 // Parsing logic to extract total samples from output goes here...

 return totalSamples;
 }
}



I suspect there might be an issue with the command or the parsing logic in the code snippet above. Could someone please guide me on how to correctly execute ffmpeg.exe and extract the total number of samples from the output in C# ? Any insights, alternative approaches, or modifications to the code would be greatly appreciated. Thank you in advance for your assistance !


-
Why does the PyAV-encoded video have a different total time in seconds than the original file
13 octobre 2023, par Diego MedeirosI'm taking a mp4 file, decoding it frame by frame and reencoding it. I'm using PyAV and the reencoding is running on h265.
When the code is running, it seems that all frames are passed from the decoder to the encoder, but at the end I have a file with 3 seconds less. For longer videos I'll have bigger differences.


I have already checked the fps, it comes out with a very small variation, even if I use the Fraction type to avoid decimal differences.


I'd like to know if it's some parametrization error, or if this is something to do with the encoder itself like keyframes and all those sort of things. Is there a way to fix it ?


import av


container = av.open('input.mp4')

# create an output container to receive the transcoded video packets
output_container = av.open('output.mp4', 'w', format='mp4')
# add a stream to output container with same fps as input and h265 codec
output_stream = output_container.add_stream(
 'libx265', rate=container.streams.video[0].average_rate)
# set the output stream size
output_stream.width = 640
output_stream.height = 480

print('Starting transcoding...')

actual_frame = 0
container_total_frames = container.streams.video[0].frames

# start decoding packets and reading frames from the container
try:
 for packet_input in container.demux():
 if packet_input.dts is None:
 break
 for frame in packet_input.decode():

 try:
 actual_frame += 1
 # convert the frame to a numpy array
 img = frame.to_ndarray(format='bgr24')

 # prepare the ndarray frame and encode it
 frame_nd = av.VideoFrame.from_ndarray(img, format='bgr24')
 packet_output = output_stream.encode(frame_nd)
 output_container.mux(packet_output)
 print('Frame: {}/{}'.format(actual_frame, container_total_frames))
 except Exception as e:
 print("Error writing frame: ", e)
 break
except Exception as e:
 print('Finished transcoding')

output_container.close()

print('Finished transcoding')