Recherche avancée

Médias (91)

Autres articles (27)

  • Qualité du média après traitement

    21 juin 2013, par

    Le bon réglage du logiciel qui traite les média est important pour un équilibre entre les partis ( bande passante de l’hébergeur, qualité du média pour le rédacteur et le visiteur, accessibilité pour le visiteur ). Comment régler la qualité de son média ?
    Plus la qualité du média est importante, plus la bande passante sera utilisée. Le visiteur avec une connexion internet à petit débit devra attendre plus longtemps. Inversement plus, la qualité du média est pauvre et donc le média devient dégradé voire (...)

  • Ajouter notes et légendes aux images

    7 février 2011, par

    Pour pouvoir ajouter notes et légendes aux images, la première étape est d’installer le plugin "Légendes".
    Une fois le plugin activé, vous pouvez le configurer dans l’espace de configuration afin de modifier les droits de création / modification et de suppression des notes. Par défaut seuls les administrateurs du site peuvent ajouter des notes aux images.
    Modification lors de l’ajout d’un média
    Lors de l’ajout d’un média de type "image" un nouveau bouton apparait au dessus de la prévisualisation (...)

  • List of compatible distributions

    26 avril 2011, par

    The table below is the list of Linux distributions compatible with the automated installation script of MediaSPIP. Distribution nameVersion nameVersion number Debian Squeeze 6.x.x Debian Weezy 7.x.x Debian Jessie 8.x.x Ubuntu The Precise Pangolin 12.04 LTS Ubuntu The Trusty Tahr 14.04
    If you want to help us improve this list, you can provide us access to a machine whose distribution is not mentioned above or send the necessary fixes to add (...)

Sur d’autres sites (4001)

  • FFmpeg : Decoding AVPackets received from UDP socket

    8 août 2022, par strong_kobayashi

    I am trying to stream video frames encoded with FFmpeg from an Unity game to a client UI via UDP. To be specific, I am sending AVPackets (which contain the compressed frames, as far as I understand) from the server, which are then, on the client side, extracted as follows :

    



    inline UDPpacket* SDLGameClient::receiveData()
{
    if(SDLNet_UDP_Recv(socket, packet))
        return packet;
    else
        return NULL;
}

int main()
{
    ...
    // Initialize UDP
    ...
    UDPpacket *udpPacket;

    int i = 0;

    for(;;)
    {
        udpPacket = client->receiveData();

        if(udpPacket != nullptr)
        {
            i++;
            std::cout << "Packet " << i << " received!" << std::endl;

            AVPacket packet;
            av_init_packet(&packet);

            packet.data = new uint8_t[udpPacket->len];
            memcpy(packet.data, udpPacket->data, udpPacket->len);
            packet.size = udpPacket->len;

            ...


    



    To realize networking, I use the SDL_net library. Fragmenting, sending and receiving the packets seem to work without any problem. My question is, how do I decode the incoming AVPackets and stream the frames recorded in Unity to the client ?
I am aware that I need to use avcodec_send_packet and avcodec_receive_frame for decoding (since avcodec_decode_video2, that is used in many example decoding code, is deprecated), but when I do something like this :

    



    int ret = avcodec_send_packet(codecContext, &packet);
if(ret < 0 || ret == AVERROR(EAGAIN) || ret == AVERROR_EOF)
    std::cout << "avcodec_send_packet: " << ret << std::endl;
else
{
    while(ret >= 0)
    {
        ret = avcodec_receive_frame(codecContext, frame);
        if(ret == AVERROR(EAGAIN) || ret == AVERROR_EOF)
            std::cout << "avcodec_receive_frame: " << ret << std::endl;

        std::cout << "Frame: " << codecContext->frame_number << std::endl;
    }
}

av_packet_unref(packet);


    



    ret always returns a negative value (-22), so perhaps something is wrong with the AVPackets, or I'm sending the frames way too fast, I really have no clue :/

    



    Thanks in advance for any help !

    


  • I want to use Xabe.FFmpeg to convert the video size, but I found that I may be stuck in a deadlock problem

    13 mai 2021, par HalfLucky

    I now use WPF to develop the function of importing video. I want to add a code to convert the video size, but every time the program runs to this line of code, my program will deadlock here.

    


    public MyRelayCommand<string> ImportMovieCmd => new Lazy>(() =>new MyRelayCommand<string>(ImportMovie)).Value;&#xA;&#xA;private async void ImportMovie(string mediaType)&#xA;{&#xA;    string[] pathlist = ExecuteSelectFileDialog(mediaType);&#xA;&#xA;    if (pathlist == null || pathlist.Length == 0)&#xA;    {&#xA;        return;&#xA;    }&#xA;&#xA;    foreach (var path in pathlist)&#xA;    {&#xA;        ...&#xA;&#xA;        await GetMasterMovie(newMedia);&#xA;&#xA;        ...&#xA;    }&#xA;}&#xA;</string></string>

    &#xA;

    When I proceed to convert the video size, I will be stuck at this step !

    &#xA;

    private static async Task GetMasterMovie(MovieMediaInfoVM newMedia)&#xA;{&#xA;    try&#xA;    {&#xA;&#xA;        ...&#xA;&#xA;        var conversion = await Xabe.FFmpeg.FFmpeg.Conversions.FromSnippet.ChangeSize(moviepath, output, VideoSize.Nhd);&#xA;&#xA;        conversion.OnProgress &#x2B;= (sender, args) =>&#xA;        {&#xA;            var percent = (int)(Math.Round(args.Duration.TotalSeconds / args.TotalLength.TotalSeconds, 2) * 100);&#xA;            Log.Other.Info2($"[{args.Duration} / {args.TotalLength}] {percent}%");&#xA;        };&#xA;&#xA;        await conversion.Start();&#xA;&#xA;        ...&#xA;&#xA;    }&#xA;    catch (Exception ex)&#xA;    {&#xA;&#xA;        Log.Other.Info2(ex.ToString());&#xA;    }&#xA;}&#xA;

    &#xA;

    When I close the current window, the program starts to convert the video again. I have now changed all methods to asynchronous, but every time the program reaches the line of code below, it will freeze. I have no clue now. I can only ask for help !

    &#xA;

  • sdp : Add an option for sending RTCP packets to the source of the last packets

    13 août 2013, par Martin Storsjö
    sdp : Add an option for sending RTCP packets to the source of the last packets
    

    An SDP description normally only contains the target IP address
    and port for the packets. This means that we don’t really have
    any clue where to send the RTCP RR packets - previously they’re
    sent to the destination IP written in the SDP (at the same port),
    which rarely is the actual peer. And if the source for the packets
    is on a different port than the destination, it’s never correct.

    With a new option, we can choose to send the packets to the
    address that the latest packet on each socket arrived from.
    — -
    Some may even argue that this should be the default - perhaps,
    but I’d rather keep it optional at first. Additionally, I’m not
    sure if sending RTCP RR directly back to the source is
    desireable for e.g. multicast.

    Signed-off-by : Martin Storsjö <martin@martin.st>

    • [DBH] libavformat/rtsp.c
    • [DBH] libavformat/rtsp.h