
Recherche avancée
Médias (91)
-
999,999
26 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
The Slip - Artworks
26 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Texte
-
Demon seed (wav version)
26 septembre 2011, par
Mis à jour : Avril 2013
Langue : English
Type : Audio
-
The four of us are dying (wav version)
26 septembre 2011, par
Mis à jour : Avril 2013
Langue : English
Type : Audio
-
Corona radiata (wav version)
26 septembre 2011, par
Mis à jour : Avril 2013
Langue : English
Type : Audio
-
Lights in the sky (wav version)
26 septembre 2011, par
Mis à jour : Avril 2013
Langue : English
Type : Audio
Autres articles (41)
-
Keeping control of your media in your hands
13 avril 2011, parThe vocabulary used on this site and around MediaSPIP in general, aims to avoid reference to Web 2.0 and the companies that profit from media-sharing.
While using MediaSPIP, you are invited to avoid using words like "Brand", "Cloud" and "Market".
MediaSPIP is designed to facilitate the sharing of creative media online, while allowing authors to retain complete control of their work.
MediaSPIP aims to be accessible to as many people as possible and development is based on expanding the (...) -
La file d’attente de SPIPmotion
28 novembre 2010, parUne file d’attente stockée dans la base de donnée
Lors de son installation, SPIPmotion crée une nouvelle table dans la base de donnée intitulée spip_spipmotion_attentes.
Cette nouvelle table est constituée des champs suivants : id_spipmotion_attente, l’identifiant numérique unique de la tâche à traiter ; id_document, l’identifiant numérique du document original à encoder ; id_objet l’identifiant unique de l’objet auquel le document encodé devra être attaché automatiquement ; objet, le type d’objet auquel (...) -
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.
Sur d’autres sites (7079)
-
Revision f6c2a6c5d6 : vp9 : rename 'near' parameters + nearest for consistency near is a reserved wor
31 janvier 2015, par James ZernChanged Paths :
Modify /vp9/common/vp9_mvref_common.c
Modify /vp9/common/vp9_mvref_common.h
vp9 : rename ’near’ parameters+ nearest for consistency
near is a reserved word in windows builds so using it as a parameter
name may cause build failures with some configurationsChange-Id : Iddf1d4ecdb39843f14e95dbfd9dca55f07f81403
-
What does "copy" do in a ffmpeg command line ?
14 juillet 2016, par PsyberAlyenI know that it copies something but other than that what does it do (to what extend it affects the output file) ? Is it a switch or option ? Why does it not have a hyphen before the word itself ?
I see from other questions that it can copy streams without transcode but what are other possibility that I can manipulate it ?
I have done
ffmpeg --help
but I don’t see any documentation about it. Is there a website I can read more about it ? -
How to add a subtitle to a video using ffmpeg in Flutter ?
3 juillet 2024, par Mohammed BekeleI'm using flutter_ffmpeg_kit_full package to add subtitles to my video. First I loop through all words and create an srt file and stored it in temp folder :


Future<string> _createSrtFile() async {
 String filePath = await getSrtOutputFilePath();

 final file = File(filePath);
 final buffer = StringBuffer();

 for (int i = 0; i < widget.words.length; i++) {
 final word = widget.words[i];
 final startTime = _formatSrtTime(word['startTime'].toDouble());
 final endTime = _formatSrtTime(word['endTime'].toDouble());
 final text = word['word'];

 buffer.writeln('${i + 1}');
 buffer.writeln('$startTime --> $endTime');
 buffer.writeln('$text');
 buffer.writeln('');
 }

 await file.writeAsString(buffer.toString());
 return filePath;
 }

 String _formatSrtTime(double seconds) {
 final int hours = seconds ~/ 3600;
 final int minutes = ((seconds % 3600) ~/ 60);
 final int secs = (seconds % 60).toInt();
 final int millis = ((seconds - secs) * 1000).toInt() % 1000;

 return '${hours.toString().padLeft(2, '0')}:${minutes.toString().padLeft(2, '0')}:${secs.toString().padLeft(2, '0')},${millis.toString().padLeft(3, '0')}';
 }
</string>


Then I create a future function to handle the export by using ffmpeg command :


Future<void> _exportVideo() async {
 final hasPermission = await _requestStoragePermission();
 if (!hasPermission) {
 ScaffoldMessenger.of(context).showSnackBar(
 const SnackBar(content: Text('Storage permission denied')));
 return;
 }

 setState(() {
 _isProcessing = true;
 _outputFilePath = "";
 });

 try {
 final srtFilePath = await _createSrtFile();

 String videoPath = widget.videoFile!.path;

 String _outputPath = await getOutputFilePath();

 final command =
 '-i $videoPath -vf "drawtext="text=\'Stack Overflow\':fontcolor=white:fontsize=24:box=1:boxcolor=black@0.5:boxborderw=5:x=(w-text_w)/2:y=(h-text_h)/2"" -codec:a copy $_outputPath';

 // final cmd = [
 // '-i',
 // videoPath,
 // '-preset',
 // 'ultrafast',
 // '-vf',
 // 'subtitles=$srtFilePath:force_style=\'Fontname=Roboto Bold,FontSize=30,MarginV=70,PrimaryColour=ffffff,OutlineColour=000000\'',
 // _outputPath
 // ];
 // FFmpegKit.executeWithArguments(cmd)

 print('Executing FFmpeg command: $command');

 await FFmpegKit.execute(command).then((session) async {
 final returnCode = await session.getReturnCode();
 final output = await session.getOutput();
 final failStackTrace = await session.getFailStackTrace();

 print('FFmpeg Output: $output');
 if (failStackTrace != null) {
 print('FFmpeg Fail StackTrace: $failStackTrace');
 }

 if (ReturnCode.isSuccess(returnCode)) {
 setState(() {
 _outputFilePath = _outputPath;
 });
 ScaffoldMessenger.of(context).showSnackBar(
 const SnackBar(content: Text('Export successful!')));
 } else {
 final logs = await session.getLogsAsString();
 print('FFmpeg Logs: $logs');
 ScaffoldMessenger.of(context)
 .showSnackBar(const SnackBar(content: Text('Export failed!')));
 }
 });
 } catch (e) {
 print('Error: $e');
 ScaffoldMessenger.of(context).showSnackBar(
 SnackBar(content: Text('Export failed with error: $e')));
 } finally {
 setState(() {
 _isProcessing = false;
 });
 }
 }
</void>


I did the export without the subtitles and it works. but the issue is when I try to do it with subtitles. I don't know what fault I'm making but this code is failing to export. Here is the path for the srt and video itself :


Future<string> getOutputFilePath() async {
 final Directory? downloadsDir = await getDownloadsDirectory();
 final timestamp = DateTime.now().millisecondsSinceEpoch;
 final name = "output-$timestamp.avi";
 return '${downloadsDir!.path}/$name'; // Save in downloads folder
 }

 Future<string> getSrtOutputFilePath() async {
 final Directory? downloadsDir = await getDownloadsDirectory();
 final timestamp = DateTime.now().millisecondsSinceEpoch;
 final name = "caption-$timestamp.srt";
 return '${downloadsDir!.path}/$name'; // Save in downloads folder
 }
</string></string>