Recherche avancée

Médias (0)

Mot : - Tags -/content

Aucun média correspondant à vos critères n’est disponible sur le site.

Autres articles (21)

  • La file d’attente de SPIPmotion

    28 novembre 2010, par

    Une file d’attente stockée dans la base de donnée
    Lors de son installation, SPIPmotion crée une nouvelle table dans la base de donnée intitulée spip_spipmotion_attentes.
    Cette nouvelle table est constituée des champs suivants : id_spipmotion_attente, l’identifiant numérique unique de la tâche à traiter ; id_document, l’identifiant numérique du document original à encoder ; id_objet l’identifiant unique de l’objet auquel le document encodé devra être attaché automatiquement ; objet, le type d’objet auquel (...)

  • Contribute to documentation

    13 avril 2011

    Documentation is vital to the development of improved technical capabilities.
    MediaSPIP welcomes documentation by users as well as developers - including : critique of existing features and functions articles contributed by developers, administrators, content producers and editors screenshots to illustrate the above translations of existing documentation into other languages
    To contribute, register to the project users’ mailing (...)

  • Déploiements possibles

    31 janvier 2010, par

    Deux types de déploiements sont envisageable dépendant de deux aspects : La méthode d’installation envisagée (en standalone ou en ferme) ; Le nombre d’encodages journaliers et la fréquentation envisagés ;
    L’encodage de vidéos est un processus lourd consommant énormément de ressources système (CPU et RAM), il est nécessaire de prendre tout cela en considération. Ce système n’est donc possible que sur un ou plusieurs serveurs dédiés.
    Version mono serveur
    La version mono serveur consiste à n’utiliser qu’une (...)

Sur d’autres sites (5891)

  • Array Getting Lost While Passing From C++ to C Using Callback [duplicate]

    23 décembre 2020, par Abhishek Sharma

    I am trying to write Video Using FFmpeg by generating frame at run time using direct3d and the frames are generated using sharp dx at c# and I use window runtime to callback to c# to generate Frame And return Platform::Array of Byte ;

    


    so for writing video using FFmpeg, I used C code that writes video, and to ask for generating frame I implemented a callback to generate a frame and all that in StaticLib

    


    uint8_t*(*genrate_frame_callback)(int) = NULL;   


    


    now in C-File, I call fill_image to get the frame and write to the video

    


    static void fill_image(int frame_index, int width, int height)
{
    int x, y, i;

    i = frame_index;
    auto result = genrate_frame_callback(frame_index);// after passing this point while using debugger reults single element not even array
    .
    .
    .
    code to write video
    
}


    


    now when I call to Write Video before that pass this function to the callback that is in the c++ file in a Window Runtime Component that reference to static lib

    


    uint8_t* genrate_frame(int args)&#xA;{&#xA;    auto frame = FireGenrateFramet(args); // returns Platform::Array<byte>&#xA;    vector v(frame->begin(), frame->end());&#xA;    return v.data();// data is abilabe to this point &#xA;}&#xA;</byte>

    &#xA;

    now the result variable contains a single element&#xA;I am new to c++ and c and unable to understand why is data not passed to the function using call back

    &#xA;

    Edit :

    &#xA;

    then can you help me with how to pass Data I tried using the global Scope Variable c++ file too but still,&#xA;it gets lost,&#xA;but after introducing another call back to read data stored in global Variable it read the whole data correctly

    &#xA;

    vector frame_v;&#xA;uint8_t* genrate_frame(int args)&#xA;{&#xA;    auto frame = FireGenrateFrame(args);&#xA;     vector v(frame->begin(), frame->end());&#xA;    frame_v = v;&#xA;    return v.data();// this loose the Same &#xA;}&#xA;&#xA;uint8_t read_pixal(int args)&#xA;{&#xA;    return frame_v[args];// where as it read out correctly&#xA;}&#xA;

    &#xA;

    but I don't want to store and add new call back an read from their just pass the array

    &#xA;

  • play video with secure link in laravel ffmpeg

    1er mars 2023, par abc abc

    I convert my video file to m3u8 with ffmpeg and upload in download host.&#xA;I have no problem when I want to display Blade in Laravel without a secure link.

    &#xA;

    Now, I am asking my friends to help me display those videos using a safe link, something like this link :

    &#xA;

    https://dl4.your-domain.com/stream.m3u8?path=path-to-your-video-of-m3u8&expires=1677764366&signature=3e302aedefa62b4414beba4957927afa

    &#xA;

    I did it myself without a secure link and got the output.&#xA;These are the routes I defined :

    &#xA;

    Route::get(&#x27;/video/secret/{key}&#x27;, function ($key) {&#xA;    return Storage::disk(&#x27;secrets&#x27;)->download(&#x27;29/&#x27; . $key);&#xA;})->name(&#x27;video.key&#x27;);&#xA; &#xA;Route::get(&#x27;/video/{playlist}&#x27;, function ($playlist) {&#xA;    return FFMpeg::dynamicHLSPlaylist()&#xA;        ->fromDisk(&#x27;static&#x27;)&#xA;        ->open("stream/video/29/{$playlist}")&#xA;        ->setKeyUrlResolver(function ($key) {&#xA;            return route(&#x27;video.key&#x27;, [&#x27;key&#x27; => $key]);&#xA;        })&#xA;        ->setMediaUrlResolver(function ($mediaFilename) {&#xA;            return Storage::disk(&#x27;static&#x27;)->url("stream/video/29/{$mediaFilename}");&#xA;        })&#xA;        ->setPlaylistUrlResolver(function ($playlistFilename) {&#xA;            return route(&#x27;video.playlist&#x27;, [&#x27;playlist&#x27; => $playlistFilename]);&#xA;        });&#xA;})->name(&#x27;video.playlist&#x27;);&#xA;

    &#xA;

    This is the source of the video :

    &#xA;

    <code class="echappe-js">&lt;script src=&quot;https://cdn.rawgit.com/video-dev/hls.js/18bb552/dist/hls.min.js&quot;&gt;&lt;/script&gt;&#xA;    &lt;script&gt;&amp;#xA;        document.addEventListener(&amp;#x27;DOMContentLoaded&amp;#x27;, () =&gt; {&amp;#xA;            const source = &quot;{{ route(&amp;#x27;video.playlist&amp;#x27;, [&amp;#x27;playlist&amp;#x27; =&gt; &amp;#x27;29.m3u8&amp;#x27;]) }}&quot;;&amp;#xA;            const video = document.querySelector(&amp;#x27;#video&amp;#x27;);&amp;#xA; &amp;#xA;            const defaultOptions = {};&amp;#xA; &amp;#xA;            if (!Hls.isSupported()) {&amp;#xA;                video.src = source;&amp;#xA;                var player = new Plyr(video, defaultOptions);&amp;#xA;            } else {&amp;#xA;                // For more Hls.js options, see https://github.com/dailymotion/hls.js&amp;#xA;                const hls = new Hls();&amp;#xA;                hls.loadSource(source);&amp;#xA; &amp;#xA;                // From the m3u8 playlist, hls parses the manifest and returns&amp;#xA;                        // all available video qualities. This is important, in this approach,&amp;#xA;                        // we will have one source on the Plyr player.&amp;#xA;                       hls.on(Hls.Events.MANIFEST_PARSED, function (event, data) {&amp;#xA; &amp;#xA;                           // Transform available levels into an array of integers (height values).&amp;#xA;                          const availableQualities = hls.levels.map((l) =&gt; l.height)&amp;#xA;                      availableQualities.unshift(0) //prepend 0 to quality array&amp;#xA; &amp;#xA;                          // Add new qualities to option&amp;#xA;                    defaultOptions.quality = {&amp;#xA;                        default: 0, //Default - AUTO&amp;#xA;                        options: availableQualities,&amp;#xA;                        forced: true,&amp;#xA;                        onChange: (e) =&gt; updateQuality(e),&amp;#xA;                    }&amp;#xA;                    // Add Auto Label&amp;#xA;                    defaultOptions.i18n = {&amp;#xA;                        qualityLabel: {&amp;#xA;                            0: &amp;#x27;Auto&amp;#x27;,&amp;#xA;                        },&amp;#xA;                    }&amp;#xA; &amp;#xA;                    hls.on(Hls.Events.LEVEL_SWITCHED, function (event, data) {&amp;#xA;                      var span = document.querySelector(&quot;.plyr__menu__container [data-plyr=&amp;#x27;quality&amp;#x27;][value=&amp;#x27;0&amp;#x27;] span&quot;)&amp;#xA;                      if (hls.autoLevelEnabled) {&amp;#xA;                        span.innerHTML = `AUTO (${hls.levels[data.level].height}p)`&amp;#xA;                      } else {&amp;#xA;                        span.innerHTML = `AUTO`&amp;#xA;                      }&amp;#xA;                    })&amp;#xA; &amp;#xA;                     // Initialize new Plyr player with quality options&amp;#xA;                     var player = new Plyr(video, defaultOptions);&amp;#xA;                 });&amp;#xA; &amp;#xA;            hls.attachMedia(video);&amp;#xA;                window.hls = hls;&amp;#xA;            }&amp;#xA; &amp;#xA;            function updateQuality(newQuality) {&amp;#xA;              if (newQuality === 0) {&amp;#xA;                window.hls.currentLevel = -1; //Enable AUTO quality if option.value = 0&amp;#xA;              } else {&amp;#xA;                window.hls.levels.forEach((level, levelIndex) =&gt; {&amp;#xA;                  if (level.height === newQuality) {&amp;#xA;                    console.log(&quot;Found quality match with &quot; &amp;#x2B; newQuality);&amp;#xA;                    window.hls.currentLevel = levelIndex;&amp;#xA;                  }&amp;#xA;                });&amp;#xA;              }&amp;#xA;            }&amp;#xA;        });&amp;#xA;    &lt;/script&gt;&#xA;

    &#xA;

    But these work without secure links and signatures.&#xA;I want to create a secure link using token, signature and expires for each part of the video.&#xA;It means to close the direct access on the download host and to access the video files only through Laravel.&#xA;Thank you if anyone knows how to help.

    &#xA;

    Something similar to the following link to display the video :

    &#xA;

    https://dl4.your-domain.com/stream.m3u8?path=path-to-your-video-of-m3u8&expires=1677764366&signature=3e302aedefa62b4414beba4957927afa

    &#xA;

  • How to send libmmpeg AVPacket through WebRTC (using libdatachannel)

    29 mars 2022, par mike

    I'm encoding a video frame with the ffmpeg libraries, generating an AVPacket with compressed data.

    &#xA;

    Thanks to some recent advice here on S/O, I am trying to send that frame over a network using the WebRTC library libdatachannel, specifically by adapting the example here :

    &#xA;

    https://github.com/paullouisageneau/libdatachannel/tree/master/examples/streamer

    &#xA;

    I am seeing problems inside h264rtppacketizer.cpp (part of the library, not the example) which are almost certainly to do with how I'm providing the sample data.&#xA;(I don't think that this is anything to do with libdatachannel specifically, it will be an issue with what I'm sending)

    &#xA;

    The example code reads each encoded frame from a file, and populates a sample by setting the content of the file to the contents of the file :

    &#xA;

    sample = *reinterpret_cast *>(&amp;fileContents);

    &#xA;

    sample is just a std::vector<byte>;</byte>

    &#xA;

    I have naively copied the contents of an AVPacket->data pointer into the sample vector :

    &#xA;

    sample.resize(pkt->size);&#xA;memcpy(sample.data(), pkt->data, pkt->size * sizeof(std::byte));    &#xA;

    &#xA;

    but the packetizer is falling over when trying to get length values out of that data.&#xA;Specifically, in the following code, the first iteration gets a length of 1, but the second, looking up index 5, gives 1119887324. This is way too big for my data, which is only 3526 bytes (the whole frame is a single colour so likely to be small once encoded) :

    &#xA;

    while (index &lt; message->size()) {&#xA;assert(index &#x2B; 4 &lt; message->size());&#xA;auto lengthPtr = (uint32_t *)(message->data() &#x2B; index);&#xA;uint32_t length = ntohl(*lengthPtr);&#xA;auto naluStartIndex = index &#x2B; 4;&#xA;auto naluEndIndex = naluStartIndex &#x2B; length;&#xA;assert(naluEndIndex &lt;= message->size());    &#xA;        &#xA;auto begin = message->begin() &#x2B; naluStartIndex;&#xA;auto end = message->begin() &#x2B; naluEndIndex;&#xA;nalus->push_back(std::make_shared<nalunit>(begin, end));&#xA;index = naluEndIndex;&#xA;}&#xA;</nalunit>

    &#xA;

    Here is a dump of

    &#xA;

    uint32_t length = ntohl(*lengthPtr);&#xA;

    &#xA;

    for the first few elements of the message (*lengthPtr in parentheses) :

    &#xA;

    [2022-03-29 15:12:01.182] [info] index 0: 1  (16777216)&#xA;[2022-03-29 15:12:01.183] [info] index 1: 359  (1728118784)&#xA;[2022-03-29 15:12:01.184] [info] index 2: 91970  (1114046720)&#xA;[2022-03-29 15:12:01.186] [info] index 3: 23544512  (3225577217)&#xA;[2022-03-29 15:12:01.186] [info] index 4: 1732427807  (532693607)&#xA;[2022-03-29 15:12:01.187] [info] index 5: 1119887324  (3693068354)&#xA;[2022-03-29 15:12:01.188] [info] index 6: 3223313413  (98312128)&#xA;[2022-03-29 15:12:01.188] [info] index 7: 534512896  (384031)&#xA;[2022-03-29 15:12:01.188] [info] index 8: 3691315291  (1526728156)&#xA;[2022-03-29 15:12:01.189] [info] index 9: 83909537  (2707095557)&#xA;[2022-03-29 15:12:01.189] [info] index 10: 6004992  (10574592)&#xA;[2022-03-29 15:12:01.190] [info] index 11: 1537277952  (41307)&#xA;[2022-03-29 15:12:01.190] [info] index 12: 2701131779  (50331809)&#xA;[2022-03-29 15:12:01.192] [info] index 13: 768  (196608)&#xA;

    &#xA;

    (I know I should post a complete sample, I am working on it)

    &#xA;

      &#xA;
    • I am fairly sure I am just missing something basic. E.g. am I supposed to do something with the AVPacket side_data, does AVPacket have or miss some header info ?

      &#xA;

    • &#xA;

    • If I just fwrite the pkt->data for a single frame to disk, I can read the codec information with ffprobe :

      &#xA;

    • &#xA;

    &#xA;

    Input #0, h264, from &#x27;encodedOut.h264&#x27;:&#xA;Duration: N/A, bitrate: N/A&#xA;Stream #0:0: Video: h264 (Constrained Baseline), yuv420p(progressive), 1280x720, 30 tbr, 1200k tbn&#xA;

    &#xA;

      &#xA;
    • whereas the same for the example input files (again a single frame) gives the following :
    • &#xA;

    &#xA;

    [h264 @ 000001c88d1135c0] Format h264 detected only with low score of 1, misdetection possible!&#xA;[h264 @ 000001c88f337400] missing picture in access unit with size 85306&#xA;[extract_extradata @ 000001c88d11ee40] No start code is found.&#xA;sample-0.h264: Invalid data found when processing input&#xA;

    &#xA;