Recherche avancée

Médias (1)

Mot : - Tags -/biomaping

Autres articles (89)

  • Organiser par catégorie

    17 mai 2013, par

    Dans 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, par

    Utilité
    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 (...)

  • 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 (11304)

  • FFMpeg Speed up transparent webm C#/Cmd

    17 avril 2023, par Alphapixel 182004

    I am trying to speed up a webm video file while maintaining the transparency but every attempt I've made has removed the transparency.

    


    How do I speed up a transparent webm using FFMpeg without losing the transparency ?

    


    Note : I am doing this all in c# but would prefer to use commands instead of wrapper libraries.

    


    this is the general command I have tried :

    


    command = $"-i \"{input}\" -filter_complex \"[0:v]setpts = (1/{speed}) * PTS[v]; [0:a]atempo = {speed}[a]\" -map \"[v]\" -map \"[a]\" -c:v libvpx-vp9 -b:v 1M -y \"{output}";
That command did not maintain transparency though.

    


    A little info about the input video :

    


      

    • The input is transparent

      


    • 


    • the input is basically a mess of individual transparent webm's joined together that were made with either :

      


        

      • Poster with audio :
      • 


      


    • 


    


    $"-threads 4 -loop 1 -i \"{image}\" -i \"{audio}\" -c:v libvpx-vp9 -pix_fmt yuva420p -crf 10 -b:v 0 -c:a libopus -b:a 192k -shortest -movflags +faststart -y \"{output}\"";

    


      

    • Padding the clip :
    • 


    


    $"-i \"{input}\" -filter_complex \"[0:v]split=2[v1][v2];[v1]tpad=start_duration={startPadMs / 1000}:start_mode=clone:stop_duration={endPadMs / 1000}:stop_mode=clone[v1_edited];[v1_edited][v2]overlay=eof_action=pass[v];[0:a]adelay={startPadMs}|{startPadMs}[a]\" -map \"[v]\" -map \"[a]\" \"{output}\""

    


      

    • Joining videos :
    • 


    


    var temp = Path.Combine(Path.GetTempPath(), "concat.txt"); File.WriteAllText(temp, string.Join('\n', clips.Select(e => $"file '{e}'"))); var command = $"-f concat -safe 0 -i "{temp}" -c copy -y "{output}"";\

    


  • Detect if an interlaced video frame is the Top or Bottom field ?

    21 décembre 2024, par Danny

    I'm decoding video PES packets (packetized elementary stream) containing H.264/AVC and H.265/HEVC using libavcodec like this :

    


    while (remainingESBytes > 0)
{
    int bytesUsed = av_parser_parse2(
            mpParser, mpDecContext,
            &mpEncPacket->data, &mpEncPacket->size,
            pIn, remainingESBytes,
            AV_NOPTS_VALUE, AV_NOPTS_VALUE, 0);

    // send encoded packet for decoding
    int ret = avcodec_send_packet(mpDecContext, mpEncPacket);
    if (ret < 0)
    {
        // failed
        continue;
    }

    while (ret >= 0)
    {
        ret = avcodec_receive_frame(mpDecContext, mpDecFrame);
        /// Do stuff with frame ///
    }

    remainingESBytes = getMoreBytes()
}


    


    Sometimes the input video is interlaced, in which case it seems avcodec_receive_frame is returning individual fields and not a merged frame of the top and bottom fields together.

    


    I couldn't find any way for avcodec_receive_frame to emit a full, non-interlaced frame.

    


    I can merge a top and bottom field together but I haven't found any way to identify if a given AVFrame is top or bottom.

    


    How can I do that ?

    


    EDIT I

    


    Looking at the log output from the decoder, it appears the decoder knows if the field is top or bottom (carried by SEI ?) but still can't figure out how to access that information via the libavcodec API...

    


    [hevc @ 0x1afcfc0] ENTER DECODE NAL TYPE 39. sei.ni_custom.type = -1
[hevc @ 0x1afcfc0] Set sei.ni_custom.type to -1.
[hevc @ 0x1afcfc0] ff_hevc_decode_nal_sei - s->ni_custom.type = -1
[hevc @ 0x1afcfc0] Decoding SEI [NAL Type 39]. ni_custom.type=-1
[hevc @ 0x1afcfc0] TOP Field
[hevc @ 0x1afcfc0] EXIT DECODE NAL TYPE 39. sei.ni_custom.type = -1


    


  • Normalizing audio in ffmpeg - how ?

    11 novembre 2020, par Betty Crokker

    I'm creating one of those "Brady Bunch" videos for a choir using a C# application I'm writing that uses ffmpeg for all the heavy lifting, and for the most part it's working great but I'm having trouble getting the audio levels just right.

    


    What I'm doing right now, is first "normalizing" the audio from the individual singers like this :

    


      

    • Extract audio into a WAV file using ffmpeg
    • 


    • Load the WAV file into my application using NAudio
    • 


    • Find the maximum 16-bit value
    • 


    • When I create the merged video, specify a volume for this stream that boosts the maximum value to 32767
    • 


    


    So, for example, if I have 3 streams : stream A's maximum audio is 32767 already, stream B's maximum audio is 32000, and stream C's maximum audio is 16000, then when I merge these videos I will specify

    


    [0:a]volume=1.0,aresample=async=1:first_pts=0[aud0]
[1:a]volume=1.02,aresample=async=1:first_pts=0[aud1]
[2:a]volume=2.05,aresample=async=1:first_pts=0[aud2]
[aud0][aud1][aud2]amix=inputs=3[a]


    


    (I have an additional "volume tweak" that lets me adjust the volume level of individual singers as necessary, but we can ignore that for this question)

    


    I am reading the ffmpeg wiki on Audio Volume Manipulation, and I will implement that next, but I don't know what to do with the output it generates. It looks like I'm going to get mean and max volume levels in dB and while I understand decibels in a "yeah, I learned about those in college 30 years ago" kind of way, I don't know how to use those values to normalize the audio of my input videos.

    


    The problem is, in the ffmpeg output video, the audio level is quite low. If I do the same process of extracting the audio and looking at the WAV file in the merged video that ffmpeg generated, the maximum value is only 4904.

    


    How do I implement an algorithm that automatically sets the output volume to a "reasonable" level ? I realize I can simply add a manual volume filter and have the human set the level, but that's going to be a lot of back & forth of generating the merged video, listening to it, adjusting the level, merging again, etc. I want a way where my application figures out an appropriate output volume (possibly with human adjustment allowed).

    


    EDIT

    


    Asking ffmpeg to determine the mean and max volume of each clip does provide mean and max volume in dB, and I can then use those values to scale each input clip :

    


    [0:a]volume=3.40dB,aresample=async=1:first_pts=0[aud0]
[1:a]volume=3.90dB,aresample=async=1:first_pts=0[aud1]
[2:a]volume=4.40dB,aresample=async=1:first_pts=0[aud2]
[3:a]volume=-0.00dB,aresample=async=1:first_pts=0[aud3]


    


    But my final video is still strangely quiet. For now, I've added a manually-entered volume factor that gets applied at the very end :

    


    [aud0][aud1][aud2]amix=inputs=3[a]
[a]volume=volume=3.00[b]


    


    So my question is, in effect, how do I determine algorithmically what this final volume factor needs to be ?

    


    MORE EDIT

    


    There's something deeper going on here, I just set the volume filter to 100 and the output is only slightly louder. Here are my filters, and the relevant portions of the command line :

    


    color=size=1920x1080:c=0x0000FF [base];
[0:v] scale=576x324 [clip0];
[0:a]volume=1.48,aresample=async=1:first_pts=0[aud0];
[1:v] crop=808:1022:202:276,scale=384x486 [clip1];
[1:a]volume=1.57,aresample=async=1:first_pts=0[aud1];
[2:v] crop=1160:1010:428:70,scale=558x486 [clip2];
[2:a]volume=1.66,aresample=async=1:first_pts=0[aud2];
[3:v] crop=1326:1080:180:0,scale=576x469 [clip3];
[3:a]volume=1.70,aresample=async=1:first_pts=0[aud3];
[4:a]volume=0.20,aresample=async=1:first_pts=0[aud4];
[5:a]volume=0.73,aresample=async=1:first_pts=0[aud5];
[6:v] crop=1326:1080:276:0,scale=576x469 [clip4];
[6:a]volume=1.51,aresample=async=1:first_pts=0[aud6];
[base][clip0] overlay=shortest=1:x=32:y=158 [tmp0];
[tmp0][clip1] overlay=shortest=1:x=768:y=27 [tmp1];
[tmp1][clip2] overlay=shortest=1:x=1321:y=27 [tmp2];
[tmp2][clip3] overlay=shortest=1:x=32:y=625 [tmp3];
[tmp3][clip4] overlay=shortest=1:x=672:y=625 [tmp4];
[aud0][aud1][aud2][aud3][aud4][aud5][aud6]amix=inputs=7[a];
[a]adelay=delays=200:all=1[b];
[b]volume=volume=100.00[c];
[c]asplit[a1][a2];

ffmpeg -y ....
   -map "[tmp4]" -map "[a1]" -c:v libx264 "D:\voutput.mp4" 
   -map "[a2]" "D:\aoutput.mp3""


    


    When I do this, the audio I want is louder (loud enough to clip and get distorted), but definitely not 100x louder.