
Recherche avancée
Médias (1)
-
Bug de détection d’ogg
22 mars 2013, par
Mis à jour : Avril 2013
Langue : français
Type : Video
Autres articles (69)
-
Organiser par catégorie
17 mai 2013, parDans MédiaSPIP, une rubrique a 2 noms : catégorie et rubrique.
Les différents documents stockés dans MédiaSPIP peuvent être rangés dans différentes catégories. On peut créer une catégorie en cliquant sur "publier une catégorie" dans le menu publier en haut à droite ( après authentification ). Une catégorie peut être rangée dans une autre catégorie aussi ce qui fait qu’on peut construire une arborescence de catégories.
Lors de la publication prochaine d’un document, la nouvelle catégorie créée sera proposée (...) -
Récupération d’informations sur le site maître à l’installation d’une instance
26 novembre 2010, parUtilité
Sur le site principal, une instance de mutualisation est définie par plusieurs choses : Les données dans la table spip_mutus ; Son logo ; Son auteur principal (id_admin dans la table spip_mutus correspondant à un id_auteur de la table spip_auteurs)qui sera le seul à pouvoir créer définitivement l’instance de mutualisation ;
Il peut donc être tout à fait judicieux de vouloir récupérer certaines de ces informations afin de compléter l’installation d’une instance pour, par exemple : récupérer le (...) -
Demande de création d’un canal
12 mars 2010, parEn fonction de la configuration de la plateforme, l’utilisateur peu avoir à sa disposition deux méthodes différentes de demande de création de canal. La première est au moment de son inscription, la seconde, après son inscription en remplissant un formulaire de demande.
Les deux manières demandent les mêmes choses fonctionnent à peu près de la même manière, le futur utilisateur doit remplir une série de champ de formulaire permettant tout d’abord aux administrateurs d’avoir des informations quant à (...)
Sur d’autres sites (2853)
-
Automatically detect box/coordinates of burned-in subtitles in a video source
8 mars 2021, par AndroidXIn reality I'd like to detect the coordinates of the "biggest" (both in height and width) burned-in subtitle of a given video source. But in order to do this I first need to detect the box coordinates of every distinct subtitle in the sample video, and compare them to find the biggest one. I didn't know where to start about this, so the closest thing I found (sort of) was ffmpeg's
bbox
video filter which according to the documentation computes"the bounding box for the non-black pixels in the input frame luminance plane"
, based on a given luminance value :

ffmpeg -i input.mkv -vf bbox=min_val=130 -f null -



This gives me a line with coordinates for each input frame in the video, ex. :


[Parsed_bbox_0 @ 0ab734c0] n:123 pts:62976 pts_time:4.1 x1:173 x2:1106 y1:74 y2:694 w:934 h:621 crop=934:621:173:74 drawbox=173:74:934:621



The idea was to make a script and loop through the filter's output, detect the "biggest" box by comparing them all, and output its coordinates and frame number as representative of the longest subtitle.


The
bbox
filter though can't properly detect the subtitle box even in a relatively dark video with white hardsubs. By trial and error and only for a particular video sample which I used to run my tests, the "best" result for detecting the box of any subtitle was to use amin_val
of 130 (supposedly the meaningful values ofmin_val
are in the range of 0-255, although the docs don't say anything). Using thedrawbox
filter withffplay
to test the coordinates reported for a particular frame, I can see that it correctly detects only the bottom/left/right boundary of the subtitle, presumably because the outline of the globe in the image below is equally bright :



Raising
min_val
to 230 slightly breaks the previously correct boundaries at the bottom/left/right side :



And raising it to 240 gives me a weird result :




However even if I was able to achieve a perfect outcome with the
bbox
filter, this technique wouldn't be bulletproof for obvious reasons (themin_val
should be arbitrarily chosen, the burned-in subtitles can be of different color, the image behind the subtitles can be equally or even more bright depending the video source, etc.).

So if possible I would like to know :


- 

- Is there a filter or another technique I can use with ffmpeg to do what I want
- Is there perhaps another CLI tool or programming library to achieve this
- Any hint that could help (perhaps I'm looking at the problem the wrong way)








-
Recording of Full HD 60 FPS videos in C#
17 mars 2021, par Alexander NaumovMy application works with a high-speed camera. I am trying to record a videofile using C#.


The task is pretty "simple" : to record the video from the camera. We need to record medium (higher-better) quality videos to save as many details as possible.


- 

- Resolution : 1920 x 1080 (FullHD)
- Frames per second (FPS) : 60
- Bitrate : I've started from 10000*1000 (but now I don't know)
- Mediacontainer : MP4, AVI (does not really matter, we just need to
solve our task)
- Codec : also does not matter, we just need speed and quality.
- Maximum size of videofile : 10 GB/hour














Framerate of the camera can be changed during the recording by the camera itself (not by user), so it's necessary to have something like timestamps for every frame or anything else.


The problem is not fast enough recording.
Example : using AForge libs, generated pictures ("white" noise), duration of test videos is 20 seconds.


Duration of video creating using different codecs (provided by AForge) :


- 

- Codec : MPEG4, Time : 33,703
- Codec : WMV1, Time : 45,338
- Codec : WMV2, Time : 45,530
- Codec : MSMPEG4v2, Time : 43,775
- Codec : MSMPEG4v3, Time : 44,390
- Codec : H263P, Time : 38,894
- Codec : FLV1, Time : 39,151
- Codec : MPEG2, Time : 35,561
- Codec : Raw, Time : 61,456




















Another libs we've tried is not satisfied us.
Accord.FFMPEG is slow because of strange inner exceptions.
EmguCV.FFMPEG has no timestamps, therefore it creates corrupted video.


Recording the video to the SSD drive did not give us any visible acceleration.


Google search gives no clear examples or modern solutions to solve this task. That's the main reason to write here.


There is a code sample of our test :


private static void AForge_test()
 {
 Console.WriteLine("AForge test started...");
 unsafe
 {
 Stopwatch watch = new Stopwatch();

 Console.WriteLine("FPS: {0}, W:{1}, H:{2}, T:{3}", fps, w, h, time);

 AForge.Video.FFMPEG.VideoCodec[] codecs = (AForge.Video.FFMPEG.VideoCodec[]) Enum.GetValues(typeof(AForge.Video.FFMPEG.VideoCodec));

 for(int k = 0; k < codecs.Length; k++)
 {
 /* if (codecs[k] != VideoCodec.MPEG4)
 continue;*/
 try
 {
 watch.Restart();

 Random r2 = new Random(200);
 AForge.Video.FFMPEG.VideoFileWriter vw = new AForge.Video.FFMPEG.VideoFileWriter();
 string name = String.Format("E:\\VideosHDD\\AForge_test_{0}_mid.avi", Enum.GetName(typeof(AForge.Video.FFMPEG.VideoCodec), codecs[k]));
 vw.Open(name, w, h, fps, codecs[k], 10000 * 1000);

 for (int i = 0; i < frames; i++)
 {
 vw.WriteVideoFrame(bmps[i%N]);
 }

 vw.Close();
 vw.Dispose();

 watch.Stop();

 Console.WriteLine("Codec: {0}, Time: {1:F3}", Enum.GetName(typeof(AForge.Video.FFMPEG.VideoCodec), codecs[k]), watch.ElapsedMilliseconds / 1000d);
 }
 catch(Exception ex)
 {
 Console.WriteLine("Error " + codecs[k].ToString());
 }

 }
 
 }

 Console.ReadKey();
 }



Additional :


- 

- We are ready to use not-for-free solutions, but free is preferable.
- One of the supposed reasons for low recording speed : (x86) building of applications. I tried so hard to find x64 Aforge building but failed in this. We really don't know is there any influence of application architecture on recording speed.






I am ensured that I don't know all the background of video recording and another "little" thing, so I would be very pleased to solutions with clear explanations.


-
Audio not playing in discord bot(discord.js)
25 juin 2021, par Manas PrakashI have created a discord bot using discord.js that plays music.
But it is not playing any music...
I tried this but it didn't work, also tried installing multiple ffmpeg libraries.
Here is my Code :


const Discord = require("discord.js");
const dotenv = require("dotenv");
const ytdl = require("ytdl-core");
const ytSearch = require("yt-search");

dotenv.config();

const prefix = "#";
const queue = new Map();

let loop = false;
let count = 1;

const bot = new Discord.Client();

bot.on("ready", () => {
 bot.user.setActivity("Doomer", { type: "LISTENING" });
 console.log("Boomer Online");
});

bot.on("message", async (message) => {
 const args = message.content.slice(prefix.length + 4).split(" ");
 const voice_channel = message.member.voice.channel;
 if (!voice_channel) return;

 const server_queue = queue.get(message.guild.id);

 if (message.content.toLowerCase().startsWith(`${prefix}play`)) {
 if (message.content === `${prefix}play`)
 return message.channel.send("Pls Enter the second srgument");
 let song = {};

 if (ytdl.validateURL(args[1])) {
 const song_info = await ytdl.getInfo(args[1]);
 song = {
 title: song_info.videoDetails.title,
 url: song_info.videoDetails.video_url
 };
 } else {
 const video_finder = async (query) => {
 const video_result = await ytSearch(query);
 return video_result.videos.length > 1 ? video_result.videos[0] : null;
 };

 const video = await video_finder(args.join(" "));
 if (video) {
 song = { title: video.title, url: video.url };
 } else {
 message.channel.send("Error finding video.");
 }
 }

 if (!server_queue) {
 const queue_constructor = {
 voice_channel: voice_channel,
 text_channel: message.channel,
 connection: null,
 songs: []
 };

 queue.set(message.guild.id, queue_constructor);
 queue_constructor.songs.push(song);

 try {
 const connection = await message.member.voice.channel.join();
 queue_constructor.connection = connection;
 video_player(message.guild, queue_constructor.songs[0]);
 } catch (err) {
 queue.delete(message.guild.id);
 message.channel.send("There was an error connecting!");
 throw err;
 }
 } else {
 server_queue.songs.push(song);
 return message.channel.send(`-