Recherche avancée

Médias (91)

Autres articles (44)

  • Multilang : améliorer l’interface pour les blocs multilingues

    18 février 2011, par

    Multilang 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.

  • Les autorisations surchargées par les plugins

    27 avril 2010, par

    Mediaspip core
    autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs

  • Personnaliser les catégories

    21 juin 2013, par

    Formulaire de création d’une catégorie
    Pour ceux qui connaissent bien SPIP, une catégorie peut être assimilée à une rubrique.
    Dans le cas d’un document de type catégorie, les champs proposés par défaut sont : Texte
    On peut modifier ce formulaire dans la partie :
    Administration > Configuration des masques de formulaire.
    Dans le cas d’un document de type média, les champs non affichés par défaut sont : Descriptif rapide
    Par ailleurs, c’est dans cette partie configuration qu’on peut indiquer le (...)

Sur d’autres sites (6532)

  • FFMPeg generated video : Audio has 'glitches' when uploaded to YouTube

    7 octobre 2023, par CularBytes

    I'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 use amix instead of amerge.

    


    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).

    


  • Aspect ratio problems at transcoding with ffmpeg [closed]

    19 novembre 2023, par udippel

    I have a huge collection of videos from the last 20+ years, videos in all sorts of formats. I use gerbera as open source UPnP-AV media server. Our TV handles only very limited of these formats. Therefore I use the transcoding feature of gerbera (I don't want to convert the 2000+ files ; thereby avoiding loss of multiple audio tracks, (multiple) subtitles, and so forth).

    


    This is my current unified argument line for ffmpeg :
-c:v mpeg2video -maxrate 20000k -vf setdar=16/9 -r 24000/1001 -qscale:v 4 -top 1 -c:a mp2 -f mpeg -y
It works pretty okay, except of the aspect ratios. Well, I don't understand this fully, because ffprobe for File A states :
Stream #0:0: Video: mpeg4 (Simple Profile) (XVID / 0x44495658), yuv420p, 624x464 [SAR 1:1 DAR 39:29], 1500 kb/s, 25 fps, 25 tbr, 25 tbn, 25 tbc
This file displays very well.
File B comes as :
Stream #0:0(eng): Video: h264 (High), yuv420p(tv, bt709, progressive), 960x720, SAR 1:1 DAR 4:3, 23.98 fps, 23.98 tbr, 1k tbn, 180k tbc (default)
This file displays horribly squeezed vertically and doesn't fill the screen left and right neither, with the same settings of the TV. Also, playing this file (and others, naturally) the TV doesn't offer the 14:9 display option, which is available e.g. for the file further up.

    


    Both have same SAR, DAR, almost identical H:V ratios (1.345, 1.333) ; and almost identical DAR.

    


    My questions :

    


      

    1. Why, despite of almost identical pixel ratios, DAR and SAR are these files handled so differently in one and the same session on the same TV (SONY), please ?
    2. 


    3. With which method could I instruct ffmpeg to display the second file properly, too, please ?
(I have already tried 'scale' ; but to no avail. Which could have been foreseen, since the ratios are already very close.)
My guess is, that the (tv, bt709, progressive) mess things up.
(I have already tried to add the yuv420p in the argument line, also to no avail.)
    4. 


    


    Appreciate any help,

    


    Uwe

    


    I have already tried to add a 'scale' option ; but to no avail. Which could have been foreseen, since the ratios are already very close.
I have already tried to add the yuv420p in the argument line, also to no avail.
I have already tried force_original_aspect_ratio, but also here, nothing improving.
Also, I played with -aspect, but the aspects are okay, and would need individual corrections, which I can't and don't to do for 2000+ files. A simple 16:9 doesn't cut it.

    


  • FFMPEG Applying Mux Operation to All Files in Folder Structure

    28 septembre 2023, par EURSCVA MembroFoto

    I have two identical folder structures containing video files (containing varying audio channels) - one has the originals, one has proxy (lower res) versions.
The process of making the proxies messed with the sample rate of the audio, so now I need to replace the audio from each proxy clip with the audio of the respective original clip.

    


    It seems like that is something I can do with ffmpeg without transcoding all of the files again :

    


    $ ffmpeg -i original_clip.mov -i proxy_clip.mov -c copy -map 0:0 -map 1:1 proxy_new.mov


    


    The issue is I have no idea how to make this happen for all files in a folder structure, and with the output also ending up in an identical folder structure. Any help is really appreciated, this issue has caused quite a mess...