
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 (31)
-
MediaSPIP Core : La Configuration
9 novembre 2010, parMediaSPIP Core fournit par défaut trois pages différentes de configuration (ces pages utilisent le plugin de configuration CFG pour fonctionner) : une page spécifique à la configuration générale du squelettes ; une page spécifique à la configuration de la page d’accueil du site ; une page spécifique à la configuration des secteurs ;
Il fournit également une page supplémentaire qui n’apparait que lorsque certains plugins sont activés permettant de contrôler l’affichage et les fonctionnalités spécifiques (...) -
Creating farms of unique websites
13 avril 2011, parMediaSPIP platforms can be installed as a farm, with a single "core" hosted on a dedicated server and used by multiple websites.
This allows (among other things) : implementation costs to be shared between several different projects / individuals rapid deployment of multiple unique sites creation of groups of like-minded sites, making it possible to browse media in a more controlled and selective environment than the major "open" (...) -
Personnaliser en ajoutant son logo, sa bannière ou son image de fond
5 septembre 2013, parCertains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;
Sur d’autres sites (7732)
-
FFMPeg generated video : Audio has 'glitches' when uploaded to YouTube
7 octobre 2023, par CularBytesI've generated a voice from Azure AI Speech at 48KHz and 96K Bit Rate, generated a video of some stock footages and I'm trying to combine all of that with a background music.
The voice-over is generated per setence, so that I know how long each setence is and to include relevant video footage.


I'm using FFMpeg through the FFMpegCore nuget package.


The problem


After the video is complete with background music, I play it on my computer and it's perfect (no audio glitches, music keeps playing). But when uploaded to youtube it has 'breaks' in the music inbetween sentences (basically everytime a new voice-fragment is starting).


Example : https://www.youtube.com/watch?v=ieNvQ2TNq44


The code


All of the footage is combined with mostly
FFMpeg.Join(string output, string[] videos)
. These video files also contain the voice-overs (per sentance).

After that I try to add the music like this :


string outputTimelineWithMusicPath = _workingDir + $@"\{videoTitle}_withmusic.mp4";
 FFMpegArguments
 .FromFileInput(inputVideoPath)
 .AddFileInput(musicPath)
 .OutputToFile(outputPath, true, options => options
 .CopyChannel()
 .WithAudioCodec(AudioCodec.Aac)
 .WithAudioBitrate(AudioQuality.Good)
 .UsingShortest(true)
 .WithCustomArgument("-filter_complex \"[0:a]aformat=fltp:44100:stereo,apad[0a];[1]aformat=fltp:44100:stereo,volume=0.05[1a];[0a][1a]amerge[a]\" -map 0:v -map \"[a]\" -ac 2"))
 .ProcessSynchronously();



I've tried to mess around with the CustomArgument, but so far no success.


For example, I thought removing
apad
from the argument so no 'blank spots' are added, should perhaps fix the issue. Also tried to useamix
instead ofamerge
.

Last try


I've tried to first make sure both files had the same sample rate, in the hope to fix the issue. So far, no success


string outputVideoVoicePath = _workingDir + $@"\{title}_voiceonly_formatting.mp4";
 string musicReplacePath = _workingDir + $@"\{title}_music_formatted.aac";
 FFMpegArguments
 .FromFileInput(inputVideoPath)
 .OutputToFile(outputVideoVoicePath, true, options => options
 .WithAudioCodec(AudioCodec.Aac)
 .WithAudioBitrate(128)
 .WithAudioSamplingRate(44100)
 )
 .ProcessSynchronously();
 
 FFMpegArguments
 .FromFileInput(music.FilePath)
 .OutputToFile(musicReplacePath, true, options => options
 .WithAudioCodec(AudioCodec.Aac)
 .WithAudioBitrate(256) //also tried 96 (which is original format)
 .WithAudioSamplingRate(44100)
 )
 .ProcessSynchronously();
 
 
 Console.WriteLine("Add music...");
 var videoTitle = Regex.Replace(title, "[^a-zA-Z]+", "");
 string outputTimelineWithMusicPath = _workingDir + $@"\{videoTitle}_withmusic.mp4";
 FFMpegArguments
 .FromFileInput(outputVideoVoicePath)
 .AddFileInput(musicReplacePath)
 .OutputToFile(outputTimelineWithMusicPath, true, options => options
 .CopyChannel()
 .WithAudioCodec(AudioCodec.Aac)
 .WithAudioBitrate(AudioQuality.Good)
 .UsingShortest(true)
 .WithCustomArgument("-filter_complex \"[0:a]aformat=fltp:44100:stereo[0a];[1]aformat=fltp:44100:stereo,volume=0.05[1a];[0a][1a]amix=inputs=2[a]\" -map 0:v -map \"[a]\" -ac 2"))
 .ProcessSynchronously();
 return outputTimelineWithMusicPath;



I'm not much of an expert when it comes to audio/video codecs. I do scale each stock video to 24fps, 1920x1080 and the music has a original bitrate of 256Kbps / 44100 sample rate (so I probably don't even have to convert the audio file).


-
Compressing videos from a smartphone
21 septembre 2019, par fejesjocoI have a Nexus 6p with the stock camera. It’s set to record at 1080p, 30fps. Here’s a 5 second sample (11 MB).
Videos from this phone come out at about 17 Mbps on average. I tried to compress it with ffmpeg with
-c:v libx264 -crf 23 -preset veryslow
, the result comes out at about 5.5 MB, which is about 9 Mbps.I think this bitrate is a bit too much. When I look at torrent file listings, I can see high quality videos at 3 GB in size on average, and if such a movie is 90 minutes long on average, that is about 4-5 Mbps which sounds okay.
I’m wondering, why the big difference ? I can notice that my video is noisy/grainy (which is expected from a phone), and that might reduce compressibility. I tried a few ffmpeg filters, like hqdn3d and atadenoise, but the noise mostly remained (maybe I didn’t play with it enough). Then I figured, the video is also shaky (which is also expected), and that might reduce compressibility too (and even makes temporal noise filtering less effective). I tried to stabilize it with the deshake filter, but that didn’t help either.
I know I could just limit the bandwidth to whatever I like, but there must be a reason why ffmpeg thinks it needs a high bandwidth to maintain a certain quality, and a lower bandwidth would just decrease the quality.
Why do these videos have such a high bitrate ? What’s the best way to compress them more while keeping or even increasing their quality ?
-
Compressing videos from a smartphone
9 novembre 2016, par fejesjocoI have a Nexus 6p with the stock camera. It’s set to record at 1080p, 30fps. Here’s a 5 second sample (11 MB).
Videos from this phone come out at about 17 Mbps on average. I tried to compress it with ffmpeg with
-c:v libx264 -crf 23 -preset veryslow
, the result comes out at about 5.5 MB, which is about 9 Mbps.I think this bitrate is a bit too much. When I look at torrent file listings, I can see high quality videos at 3 GB in size on average, and if such a movie is 90 minutes long on average, that is about 4-5 Mbps which sounds okay.
I’m wondering, why the big difference ? I can notice that my video is noisy/grainy (which is expected from a phone), and that might reduce compressibility. I tried a few ffmpeg filters, like hqdn3d and atadenoise, but the noise mostly remained (maybe I didn’t play with it enough). Then I figured, the video is also shaky (which is also expected), and that might reduce compressibility too (and even makes temporal noise filtering less effective). I tried to stabilize it with the deshake filter, but that didn’t help either.
I know I could just limit the bandwidth to whatever I like, but there must be a reason why ffmpeg thinks it needs a high bandwidth to maintain a certain quality, and a lower bandwidth would just decrease the quality.
Why do these videos have such a high bitrate ? What’s the best way to compress them more while keeping or even increasing their quality ?