Recherche avancée

Médias (91)

Autres articles (63)

  • MediaSPIP v0.2

    21 juin 2013, par

    MediaSPIP 0.2 est la première version de MediaSPIP stable.
    Sa date de sortie officielle est le 21 juin 2013 et est annoncée ici.
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Comme pour la version précédente, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
    Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...)

  • Les tâches Cron régulières de la ferme

    1er décembre 2010, par

    La gestion de la ferme passe par l’exécution à intervalle régulier de plusieurs tâches répétitives dites Cron.
    Le super Cron (gestion_mutu_super_cron)
    Cette tâche, planifiée chaque minute, a pour simple effet d’appeler le Cron de l’ensemble des instances de la mutualisation régulièrement. Couplée avec un Cron système sur le site central de la mutualisation, cela permet de simplement générer des visites régulières sur les différents sites et éviter que les tâches des sites peu visités soient trop (...)

  • Mise à disposition des fichiers

    14 avril 2011, par

    Par défaut, lors de son initialisation, MediaSPIP ne permet pas aux visiteurs de télécharger les fichiers qu’ils soient originaux ou le résultat de leur transformation ou encodage. Il permet uniquement de les visualiser.
    Cependant, il est possible et facile d’autoriser les visiteurs à avoir accès à ces documents et ce sous différentes formes.
    Tout cela se passe dans la page de configuration du squelette. Il vous faut aller dans l’espace d’administration du canal, et choisir dans la navigation (...)

Sur d’autres sites (9091)

  • FFMPEG : Reconnect not working for HTTP source with UDP output [closed]

    5 octobre 2023, par Quinnell

    I am streaming an audio input with a static video slate. Audio comes from an HTTP source. I output to a multicast IP via UDP.

    


    The stream periodically fails. The process needs to be killed and manually restarted. Would like to have the stream automatically reconnect itself upon failure.

    


    Server runs CentOS 7.
FFMPEG version : ffmpeg version N-107408-g882aac99d2 Copyright (c) 2000-2022 the FFmpeg developers
built with gcc 4.8.5 (GCC) 20150623 (Red Hat 4.8.5-44)

    


    The server will eventually be replaced with AlmaLinux 8.8 running the latest version of ffmpeg.

    


    Currently experimenting with the RECONNECT option but so far it has failed to restore the stream automatically.

    


    note : IPs and identifying variables have been sanitized.

    


    #! /bin/bash

filename="test1.yuv"
streamTitle="Reconnect_TEST1" # friendly name for stream. Helps when running pgrep
streamInput="100.100.100.100:8002" # Input IP:Port we're receiving on.
multicastOut="232.100.100.100:5500" # Multicast IP:Port we're sending to
logFile=/home/username/logs/${streamTitle}.log # Log file we output the nohup data to.

nohup ffmpeg \
    -re \
    -video_size 854x480 \
    -i $filename \
    -i http://${streamInput} \
    -reconnect 1 \
    -reconnect_at_eof 1 \
    -reconnect_streamed 1 \
    -reconnect_on_network_error 1 \
    -reconnect_on_http_error 1 \
    -reconnect_delay_max 10 \
    -c:a ac3 \
    -ac 1 \
    -af loudnorm \
    -vf loop=loop=-1:size=1:start=0 \
    -c:v libx264 \
    -profile:v main \
    -s:v 854x480 \
    -aspect 16:9 \
    -r 15 -g 30 -bf 0 -crf 30 \
    -fflags +genpts -flags +cgop+ilme \
    -metadata title=$streamTitle \
    -metadata:s:a:0 language=eng \
    -mpegts_flags +pat_pmt_at_frames \
    -flush_packets 0 -threads 1 \
    -v verbose \
    -f mpegts udp://${multicastOut}?pkt_size=1316 \
    -loglevel verbose >$logFile &


    


  • FFmpeg 6.0 won't work because the header files can't connect or interact with each other. How do I fix the files ?

    11 septembre 2023, par Señor Tonto

    I am creating a win32 API C++ application with Microsoft Visual Studio 2022 in a .sln file. I've got quite far in basic functionalities & decided to try out video decoding & playing ; I've practiced this before but not with C++. So, I looked to see good libraries & found FFmpeg. Of course, I thought this would be quite straightforward - just import the headers & code, right ? No. Firstly, the FFmpeg I'm using is one of the pre-built binaries. The 'ffmpeg-master-latest-win64-gpl-shared.zip' From the BtbN Github repository. I decompressed it with WinRar & placed the files in Program Files (x86). Later on, I realised my mistake of placing it with 32-bit programs since it's a 64-bit build. So I transferred it to Program Files. Even after this though my issue persists. The issue being that the .h files of FFmpeg cannot communicate with each other. For some reason, they can't navigate to where the header files are. I am quite sure the reason for this may have something to do with where I save the files, the directory. Nowhere on the FFmpeg website can I see where you're expected to have the file directory at. I am sure there's a preset file path that is expected. Maybe I've named the FFmpeg folder incorrectly ? Or maybe it's not meant to go in Program Files ? The current directory for the FFmpeg folder for me is : C :\Program Files\FFmpeg. Below I will provide pictures of the errors I get where the code can't connect to other .h files as well as the file path. I'll also provide my code.

    


    #include  //imports the main win32 API library&#xA;#include  //imports macros for handling Unicode &amp; ASCII char sets&#xA;#include  //defines the common control classes&#xA;#include  //imports the standard C library&#xA;#include &#xA;#include &#xA;#include <iostream>&#xA;#include <fstream>&#xA;#include <string>&#xA;&#xA;extern "C"&#xA;{&#xA;#include &#xA;#include &#xA;#include &#xA;#include &#xA;}&#xA;&#xA;#pragma comment(lib, "Comctl32.lib") //tells the linker to include Comctl32.lib in the .exe&#xA;#pragma comment(lib, "C:\\Program Files\\FFmpeg\\lib\\avcodec.lib")&#xA;#pragma comment(lib, "C:\\Program Files\\FFmpeg\\lib\\avformat.lib")&#xA;#pragma comment(lib, "C:\\Program Files\\FFmpeg\\lib\\avutil.lib")&#xA;#pragma comment(lib, "C:\\Program Files\\FFmpeg\\lib\\swscale.lib")&#xA;&#xA;#define EDIT_CONTROL 1&#xA;#define OPEN_FILE_BTN 2&#xA;#define SAVE_FILE_BTN 3&#xA;#define EMBOLDEN_BTN 4&#xA;#define ITALICISE_BTN 5&#xA;#define SCROLL_CONTAINER 6&#xA;#define FILEMENU_OPEN_FILE_BTN 7&#xA;#define ADD_ROW_BTN 8&#xA;#define CELL_1_ID 9&#xA;#define CELL_2_ID 10&#xA;#define CELL_3_ID 11&#xA;#define SCROLL_CONTAINER_TBL 12&#xA;// 946 0759 0609 | 163 739&#xA;&#xA;HINSTANCE g_hInstance;&#xA;HWND g_hWndMain, g_hWndTabs, openFileBtn, saveFileBtn, hOpenFileEdit, hScrollContainer, hEditControl, tabHandle, emboldenBtn, italiciseBtn, FilemenuOpenFileBtn, tableContainer, tblHeaderOne,&#xA;tblHeaderTwo, tblHeaderThree, addRowBtn, hAddRowDialogue, hWnd, hWndCell1Label, hWndCell1Edit, hWndCell2Label, hWndCell2Edit, hWndCell3Label, hWndCell3Edit, hWndOkButton, hWndCancelButton, hRow, hCell1, hCell2, hCell3,&#xA;hWMP, OpenMp4Btn, hWMPContainer, hPlayBtn;&#xA;HMENU  hMenu, hSubMenu;&#xA;bool isBold = false, isItalic = false;&#xA;&#xA;&#xA;const int startX = 0;&#xA;const int startY = 60;&#xA;const int ROW_HEIGHT = 20;&#xA;const int CELL_WIDTH = 110;&#xA;static int numRows = 1;&#xA;static int numCols = 3;&#xA;&#xA;LRESULT CALLBACK WindowProcessMessages(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);&#xA;INT_PTR CALLBACK AddRowDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);&#xA;&#xA;int WINAPI wWinMain(&#xA;    _In_ HINSTANCE currentInstance,&#xA;    _In_opt_ HINSTANCE previousInstance,&#xA;    _In_ LPWSTR cmdLine,&#xA;    _In_ int cmdCount)&#xA;{&#xA;    const wchar_t* CLASS_NAME = L"Windows App";&#xA;    WNDCLASS wc{};&#xA;    wc.hInstance = currentInstance;&#xA;    wc.lpszClassName = CLASS_NAME;&#xA;    wc.hCursor = LoadCursor(nullptr, IDC_ARROW);&#xA;    wc.hbrBackground = (HBRUSH)COLOR_WINDOW;&#xA;    wc.lpfnWndProc = WindowProcessMessages;&#xA;    RegisterClass(&amp;wc);&#xA;&#xA;    g_hWndMain = CreateWindow(CLASS_NAME, L"Windows App",&#xA;        WS_OVERLAPPEDWINDOW,&#xA;        CW_USEDEFAULT, CW_USEDEFAULT,&#xA;        800, 600,&#xA;        nullptr, nullptr, nullptr, nullptr);&#xA;&#xA;    if (g_hWndMain == NULL) {&#xA;        return 0;&#xA;    }&#xA;&#xA;    // Initialize common controls&#xA;    INITCOMMONCONTROLSEX icex;&#xA;    icex.dwSize = sizeof(INITCOMMONCONTROLSEX);&#xA;    icex.dwICC = ICC_TAB_CLASSES;&#xA;    InitCommonControlsEx(&amp;icex);&#xA;&#xA;    // Create tab control&#xA;    g_hWndTabs = CreateWindow(WC_TABCONTROL, L"",&#xA;        WS_CHILD | WS_CLIPSIBLINGS | WS_VISIBLE | TCS_SINGLELINE,&#xA;        0, 0, 800, 600,&#xA;        g_hWndMain, nullptr, currentInstance, nullptr);&#xA;&#xA;    if (g_hWndTabs == NULL) {&#xA;        return 0;&#xA;    }&#xA;&#xA;    // Add tabs to tab control, seperate tab later&#xA;    TCITEM tcitem;&#xA;    tcitem.mask = TCIF_TEXT;&#xA;&#xA;    wchar_t buf1[] = L"Table View";&#xA;    tcitem.pszText = buf1;&#xA;    TabCtrl_InsertItem(g_hWndTabs, 0, &amp;tcitem);&#xA;&#xA;    wchar_t buf2[] = L"Text Files";&#xA;    tcitem.pszText = buf2;&#xA;    TabCtrl_InsertItem(g_hWndTabs, 1, &amp;tcitem);&#xA;&#xA;    wchar_t buf3[] = L"mp4 Files";&#xA;    tcitem.pszText = buf3;&#xA;    TabCtrl_InsertItem(g_hWndTabs, 2, &amp;tcitem);&#xA;&#xA;&#xA;&#xA;    //original location of button intitialisation&#xA;&#xA;&#xA;    ShowWindow(g_hWndMain, SW_SHOWDEFAULT);&#xA;    UpdateWindow(g_hWndMain);&#xA;&#xA;    MSG msg{};&#xA;    while (GetMessage(&amp;msg, nullptr, 0, 0)) {&#xA;        TranslateMessage(&amp;msg);&#xA;        DispatchMessage(&amp;msg);&#xA;    }&#xA;    return 0;&#xA;}&#xA;&#xA;</string></fstream></iostream>

    &#xA;

    I severely doubt my code has anything to do with the issue though. It's probably directory-based. I just placed wWinmain here to keep with the character limit.

    &#xA;

    The .h files can't find each other&#xA;The file path for the FFmpeg files

    &#xA;

  • memcpy to av_malloc's memory crash

    26 octobre 2023, par PeacefulWindy

    I use the code in x64 windows :

    &#xA;

    #include<iostream>&#xA;#include<memory>&#xA;#include<vector>&#xA;extern "C"&#xA;{&#xA;#include <libavcodec></libavcodec>avcodec.h>&#xA;#include<libavformat></libavformat>avformat.h>&#xA;#include <libavutil></libavutil>imgutils.h>&#xA;#include<libswscale></libswscale>swscale.h>&#xA;#include<libswresample></libswresample>swresample.h>&#xA;}&#xA;&#xA;struct BufferData&#xA;{&#xA;    uint8_t* ptr;&#xA;    size_t size;&#xA;    size_t file_size;&#xA;};&#xA;&#xA;int main()&#xA;{&#xA;    auto file=fopen("E:/test.jpg", "rb");&#xA;    fseek(file, 0, SEEK_END);&#xA;    auto fileSize = ftell(file);&#xA;    fseek(file, 0, SEEK_SET);&#xA;    auto data = std::vector(fileSize);&#xA;    fread(data.data(), sizeof(uint8_t), fileSize, file);&#xA;    fclose(file);&#xA;&#xA;    auto test = BufferData();&#xA;    test.ptr = data.data();&#xA;    test.size = data.size();&#xA;    test.file_size = data.size();&#xA;    auto buffer = (uint8_t*)av_malloc(4096 * 10);&#xA;    char errStr[128] = { 0 };&#xA;&#xA;    auto avformatContext = avformat_alloc_context();&#xA;    auto avioContext = avio_alloc_context(buffer, 4096, 0, &amp;test, [](void* opaque, uint8_t* buf, int buf_size)&#xA;        {&#xA;            BufferData* bd = (BufferData*)opaque;&#xA;            auto size = std::min(bd->size, (size_t)buf_size);&#xA;&#xA;            if (!size)&#xA;            {&#xA;                return -1;&#xA;            }&#xA;&#xA;            memcpy(buf, bd->ptr, size);&#xA;            bd->ptr &#x2B;= size;&#xA;            bd->size -= size;&#xA;            return (int)size;&#xA;        }, NULL, NULL);&#xA;    avformatContext->pb = avioContext;&#xA;    avformatContext->flags = AVFMT_FLAG_CUSTOM_IO;&#xA;&#xA;    auto ret = avformat_open_input(&amp;avformatContext, nullptr, nullptr, nullptr);&#xA;    if (ret != 0)&#xA;    {&#xA;        av_strerror(ret, errStr, sizeof(errStr));&#xA;        std::cout &lt;&lt; errStr &lt;&lt; std::endl;&#xA;        av_free(buffer);&#xA;        avformat_close_input(&amp;avformatContext);&#xA;        return 0;&#xA;    }&#xA;&#xA;    ret = avformat_find_stream_info(avformatContext, nullptr);&#xA;    if (ret &lt; 0)&#xA;    {&#xA;        av_strerror(ret, errStr, sizeof(errStr));&#xA;        std::cout &lt;&lt; errStr &lt;&lt; std::endl;&#xA;        av_free(buffer);&#xA;        avformat_close_input(&amp;avformatContext);&#xA;        return 0;&#xA;    }&#xA;&#xA;    av_dump_format(avformatContext, 0, nullptr, 0);&#xA;&#xA;    auto videoIndex = av_find_best_stream(avformatContext, AVMEDIA_TYPE_VIDEO, -1, -1, nullptr, 0);&#xA;    if (videoIndex == AVERROR_STREAM_NOT_FOUND)&#xA;    {&#xA;        av_free(buffer);&#xA;        avformat_close_input(&amp;avformatContext);&#xA;        return 0;&#xA;    }&#xA;    else if (videoIndex == AVERROR_DECODER_NOT_FOUND)&#xA;    {&#xA;        av_free(buffer);&#xA;        avformat_close_input(&amp;avformatContext);&#xA;        return 0;&#xA;    }&#xA;&#xA;    auto videoCodecPar = avformatContext->streams[videoIndex]->codecpar;&#xA;    auto videoCodec = avcodec_find_decoder(videoCodecPar->codec_id);&#xA;    if (!videoCodec)&#xA;    {&#xA;        av_free(buffer);&#xA;        avformat_close_input(&amp;avformatContext);&#xA;        return 0;&#xA;    }&#xA;&#xA;    av_free(buffer);&#xA;    avformat_close_input(&amp;avformatContext);&#xA;}&#xA;</vector></memory></iostream>

    &#xA;

    I use memcpy to copy data to buffer,it run to av_free(buffer) get crash.&#xA;ffmpeg version is 6.0.&#xA;Visual Studio version is 2022 with CMake.

    &#xA;

    Use fread replace memcpy,it can work !But I need to resolve load from std::vector memory,not fread.&#xA;I think maybe memory-align problem when run av_free,but I no way to find the cause.

    &#xA;