Recherche avancée

Médias (1)

Mot : - Tags -/lev manovitch

Autres articles (104)

  • Mise à jour de la version 0.1 vers 0.2

    24 juin 2013, par

    Explications des différents changements notables lors du passage de la version 0.1 de MediaSPIP à la version 0.3. Quelles sont les nouveautés
    Au niveau des dépendances logicielles Utilisation des dernières versions de FFMpeg (>= v1.2.1) ; Installation des dépendances pour Smush ; Installation de MediaInfo et FFprobe pour la récupération des métadonnées ; On n’utilise plus ffmpeg2theora ; On n’installe plus flvtool2 au profit de flvtool++ ; On n’installe plus ffmpeg-php qui n’est plus maintenu au (...)

  • Personnaliser en ajoutant son logo, sa bannière ou son image de fond

    5 septembre 2013, par

    Certains 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 ;

  • Ecrire une actualité

    21 juin 2013, par

    Présentez les changements dans votre MédiaSPIP ou les actualités de vos projets sur votre MédiaSPIP grâce à la rubrique actualités.
    Dans le thème par défaut spipeo de MédiaSPIP, les actualités sont affichées en bas de la page principale sous les éditoriaux.
    Vous pouvez personnaliser le formulaire de création d’une actualité.
    Formulaire de création d’une actualité Dans le cas d’un document de type actualité, les champs proposés par défaut sont : Date de publication ( personnaliser la date de publication ) (...)

Sur d’autres sites (4878)

  • (ffmpeg) How to sync dshow inputs, dropping frames, and -rtbufsize [closed]

    29 juillet 2021, par Zach Fleeman

    I wrote a quick batch script to capture anything from my Elgato HD60 Pro capture card, and while it works in some ways, I don't really understand how certain parameters are affecting my capture.

    


    Whenever I run this command without the -rtbufsize 2048M -thread_queue_size 5096 params, I drop a ton of frames. I only added those params with those values because I found them on another stackoverflow thread. I wouldn't mind actually knowing what these do, and how I can fine-tune them for my script.

    


    ffmpeg.exe -y -rtbufsize 2048M -thread_queue_size 5096 -fflags +igndts ^
-f dshow -i video="Game Capture HD60 Pro":audio="Game Capture HD60 Pro Audio" ^
-filter:v "crop=1410:1080:255:0, scale=706x540" ^
-c:v libx264 -preset veryfast -b:v 1500k -pix_fmt yuv420p ^
-c:a aac ^
-f tee -map 0:v -map 0:a "%mydate%_%mytime%_capture.mp4|[f=flv]rtmp://xxx.xxx.xxx.xxx/live"


    


    In Open Broadcaster Software, my Elgato is a near-instant video feed, but this captures/streams things at a 3-ish second delay, which is okay until I work on this second command. I'm using gdigrab to capture the window from LiveSplit for my speedrunning, but I can't get the video streams to be synced up. I tried adding and modifying another -rtbufsize before the gdigrab input, but again, I'm not sure if this is what I need to do to delay the LiveSplit grab. It seems to always be 2 to 3 seconds ahead of my capture card. How can I get these inputs to be synced and react at the same time ? i.e., I start the timer in LiveSplit at the same time that I hit a button on my super nintendo.

    


    ffmpeg.exe -y -rtbufsize 750M -thread_queue_size 5096 ^
-f dshow  -i video="Game Capture HD60 Pro":audio="Game Capture HD60 Pro Audio" ^
-rtbufsize 2000M -thread_queue_size 5096 ^
-f gdigrab -r 60 -i title=LiveSplit ^
-filter_complex "[0:v][0:v]overlay=255:0 [game];[game][1:v]overlay=0:40 [v]" ^
-c:v libx264 -preset veryfast -b:v 1500k -pix_fmt yuv420p ^
-c:a aac ^
-f tee -map "[v]" -map 0:a "%mydate%_%mytime%_capture.mp4|[f=flv]rtmp://192.168.1.7/live"


    


    tl ;dr
Where should I put -rtbufsize ? What value should it be ? And how about -thread_queue_size ? Are these things that I have to specify once or multiple times for each input ? How can I get my different input sources to sync up ?

    


    p.s., I'm cropping and overlaying my Elgato inputs because my capture card does 1920x1080, but my video is most likely a 4:3-ish SNES/NES game.

    


  • Evolution #4487 : Une option sur image_recadre_mini pour vraiment recadrer au mini (et sans garder...

    15 février 2021, par cedric -

    bon j’ai relu tout le code à tête reposé et donc il y a pas de bug, ou plutot la doc est pas claire : la fonction recadre uniquement de manière symétrique haut vs bas et gauche vs droite, pour garder le centre de l’image au centre.
    Donc si tu as un pixel non transparent en 1ère ligne de l’image, le bas ne sera pas recadré non plus.

    Il faudrait donc ajouter une option pour recadrer effectivement au plus juste, indépendamment du centre, mais du coup c’est une évolution et c’est pour plus tard
    (sauf si tu veux proposer une PR prête à l’intégration)

  • RAW audio capture from HDMI using DeckLink Mini Recorder 4K

    12 mars 2020, par Amir Raza

    I need to capture audio from TI DSP hardware/Laptop. So I opted "DeckLink Mini Recorder 4K Audio" and it connected to desktop.
    By using Decklink API’s I am able to capture audio (PCM) with 32-bit depth. But when I used media express to capture, and extracted audio
    using FFmpeg and I am getting audio (PCM) with 24-bit depth.

    Question
    1) Does this device "DeckLink Mini Recorder 4K Audio" converts audio from 32-bit to 24-bit ?
    2) Is this device "DeckLink Mini Recorder 4K Audio" bit-exact/loss-less ?

    consider the below test scenario.

    I am playing audio(PCM) by MPC-HC/VLC/Groove player in laptop and capture audio(PCM) using "DeckLink Mini Recorder 4K Audio"
    connected to desktop, The capture audio is bit-exact with the streamed input.?

    i.e ffmpeg.exe -i HDMI_Output1.av1 -vn -c:a copy out.wav

    Note :
    i am using Blackmagic_Desktop_Video_Windows_11.5 & Blackmagic_DeckLink_SDK_11.5 softwares.

    I have added the Decklink API code snippet.

    void main()
    {
     IDeckLinkIterator* deckLinkIterator = NULL;
     IDeckLinkAttributes* deckLinkAttributes = NULL;
     IDeckLink* deckLink = NULL;
     IDeckLinkInput* deckLinkInput = NULL;
     NotificationCallback* notificationCallback = NULL;
     HRESULT result;
     BOOL supported;
     int returnCode = 1;
    #ifdef WRITE_WAV_FILE
     wave_header wh;
     unsigned octet_depth;
    #endif
     Initialize();
    #ifdef _WIN32
     MutexHandle = CreateMutex(NULL, /* security attributes */
                               FALSE, /* initially not owned */
                               NULL); /* Name */
    #endif
     /* Create an IDeckLinkIterator object to enumerate all DeckLink cards in the system */
     if (GetDeckLinkIterator(&deckLinkIterator) != S_OK)
     {
       fprintf(stderr, "A DeckLink iterator could not be created.  The DeckLink drivers may not be installed.\n");
       goto bail;
     }
     /* Obtain the first DeckLink device */
     result = deckLinkIterator->Next(&deckLink);
     if (result != S_OK)
     {
       fprintf(stderr, "Could not find DeckLink device - result = %08x\n", result);
       goto bail;
     }

     /* Obtain the Attributes interface for the DeckLink device */
     result = deckLink->QueryInterface(IID_IDeckLinkAttributes, (void**)&deckLinkAttributes);
     if (result != S_OK)
     {
       fprintf(stderr, "Could not obtain the IDeckLinkAttributes interface - result = %08x\n", result);
       goto bail;
     }

     /* Determine whether the DeckLink device supports input format detection */
     result = deckLinkAttributes->GetFlag(BMDDeckLinkSupportsInputFormatDetection, &supported);
     if ((result != S_OK) || (supported == false))
     {
       fprintf(stderr, "Device does not support automatic mode detection\n");
       goto bail;
     }

     /* Obtain the input interface for the DeckLink device */
     result = deckLink->QueryInterface(IID_IDeckLinkInput, (void**)&deckLinkInput);
     if (result != S_OK)
     {
       fprintf(stderr, "Could not obtain the IDeckLinkInput interface - result = %08x\n", result);
       goto bail;
     }

     /* Create an instance of notification callback */
     notificationCallback = new NotificationCallback(deckLinkInput);
     if (notificationCallback == NULL)
     {
       fprintf(stderr, "Could not create notification callback object\n");
       goto bail;
     }

     /* Set the callback object to the DeckLink device's input interface */
     result = deckLinkInput->SetCallback(notificationCallback);
     if (result != S_OK)
     {
       fprintf(stderr, "Could not set callback - result = %08x\n", result);
       goto bail;
     }

     /*  Enable video input with a default video mode and the automatic format detection feature enabled */
     result = deckLinkInput->EnableVideoInput(bmdModeHD1080p5994, bmdFormat8BitYUV, bmdVideoInputFlagDefault);
     if (result != S_OK)
     {
       fprintf(stderr, "Could not enable video input - result = %08x\n", result);
       goto bail;
     }
     nBytesPerSample = (bmdAudioSampleType32bitInteger >> 3);
     nChannels = 2;
     /*  Enable audio input with a default audio mode and the automatic format detection feature enabled */
     result = deckLinkInput->EnableAudioInput(bmdAudioSampleRate48kHz, bmdAudioSampleType32bitInteger, nChannels);
     if (result != S_OK)
     {
       fprintf(stderr, "Could not enable audio input - result = %08x\n", result);
       goto bail;
     }

    #ifdef WRITE_WAV_FILE
     /* Populate the wave headers */
     /* RIFF */
     sprintf(&wh.riff.name1[0], "RIFF");
     sprintf(&wh.riff.name2[0], "WAVE");
     /* format */
     octet_depth = (bmdAudioSampleType32bitInteger + 7) / 8;
     sprintf(&wh.fmt.name[0], "fmt ");
     wh.fmt.size = FMT_SIZE;
     wh.fmt.format_type = FMT_TAG_PCM;
     wh.fmt.channel_count = (unsigned short)nChannels;
     wh.fmt.sample_rate = bmdAudioSampleRate48kHz;
     wh.fmt.bits_per_sample = (unsigned short)octet_depth * 8;
     wh.fmt.block_alignment = (unsigned short)(octet_depth*nChannels);
     wh.fmt.bytes_per_second = (unsigned long)wh.fmt.block_alignment*bmdAudioSampleRate48kHz;
     wh.fmt.extra_bytes = (unsigned short)0;
     /* data */
     sprintf(&wh.data.name[0], "data");
    #endif

     printf("Starting streams\n");

     /* Start capture */
     result = deckLinkInput->StartStreams();
     if (result != S_OK)
     {
       fprintf(stderr, "Could not start capture - result = %08x\n", result);
       goto bail;
     }
    #ifdef WRITE_WAV_FILE
     FILE *fp = fopen("HDMI_Output.wav", "wb");
    #else
     FILE *fp = fopen("HDMI_Output.bin","wb");
    #endif
     char *ptrCopy;
     float *fPtr;
     unsigned int zeroCntr, trailingZerosCnt;
     do
     {
         zeroCntr = 0;
         trailingZerosCnt = 0;
    #ifdef _WIN32
         WaitForSingleObject(MutexHandle, /* handle */
                             INFINITE); /* time-out interval */
    #endif
         int bytesInQueue = (int)((long long)aBufPtr - (long long)aBufWritePtr);
         ptrCopy = (char *)aBufPtr;
    #ifdef _WIN32
         ReleaseMutex(MutexHandle);
    #endif
         if (bytesInQueue > 0)
         {
    #ifdef STRIP_ZEROS
             /* Parse data for zeros */
             fPtr = (float *)aBufWritePtr;
             for (int i = 0; i < (bytesInQueue >> 2); i++)
             {
                 if (*(fPtr + i) == 0.0)
                     zeroCntr++;
                 else
                     break;
             }
             aBufWritePtr += (zeroCntr << 2);
             bytesInQueue -= (zeroCntr << 2);
    #endif
             if (bytesInQueue > 0)
             {
                 fPtr = (float *)aBufWritePtr;
                 for (int i = 0; i < (bytesInQueue >> 2); i++)
                 {
                     fwrite(fPtr, 4, 1, fp);
                     fflush(fp);

                     if (*fPtr == 0.0)
                         trailingZerosCnt++;
                     else
                         trailingZerosCnt = 0;

                     if (trailingZerosCnt >= NUM_TRAIL_ZEROS_TRESHOLD)
                         break;

                     fPtr++;
                 }
             }
         }
         aBufWritePtr = ptrCopy;
         Sleep(100);
     } while (trailingZerosCnt < NUM_TRAIL_ZEROS_TRESHOLD);

     fclose (fp);
    #ifdef STRIP_ZEROS
     /* Remove trailing zeros, write wave header */
    #ifdef WRITE_WAV_FILE
     fp = fopen("HDMI_Output.wav", "rb");
    #else
     fp = fopen("HDMI_Output.bin", "rb");
    #endif
     fseek(fp, 0, SEEK_END);
     int size = ftell(fp);
     size = size - (NUM_TRAIL_ZEROS_TRESHOLD << 2);
     printf(" \n size of hearder = %d", size);
    #ifdef WRITE_WAV_FILE
     wh.data.size = size;
     wh.riff.size = wh.data.size + sizeof(wave_format) + sizeof(wave_RIFF);
     printf(" \n size of hearderwh.riff.size = %d", wh.riff.size);
    #endif
     char * tmpBuf = (char *)malloc(size);
     fseek(fp, 0, SEEK_SET);
     fread(tmpBuf, 1, size, fp);
     fclose(fp);
    #endif
    #ifdef WRITE_WAV_FILE
     fp = fopen("HDMI_Output.wav", "wb");
     /* write the wave header */
     fwrite(&wh, 1, sizeof(wave_header), fp);
     /* Write the zero stripped PCM data */
     fwrite(tmpBuf, 1, size, fp);
     free(tmpBuf);
     fflush(fp);
     fclose(fp);
    #endif
    bail:
     /* Stop capture */
     result = deckLinkInput->StopStreams();

     /* Disable the video input interface */
     result = deckLinkInput->DisableVideoInput();

     /* return success */
     returnCode = 0;

     /* Release resources */

     /* Release the attributes interface */
     if (deckLinkAttributes != NULL)
       deckLinkAttributes->Release();

     /* Release the video input interface */
     if (deckLinkInput != NULL)
       deckLinkInput->Release();

     /* Release the Decklink object */
     if (deckLink != NULL)
       deckLink->Release();

     /* Release the DeckLink iterator */
     if (deckLinkIterator != NULL)
       deckLinkIterator->Release();

     /* Release the notification callback object */
     if (notificationCallback)
       delete notificationCallback;
    }