Recherche avancée

Médias (0)

Mot : - Tags -/clipboard

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

Autres articles (88)

  • Websites made ​​with MediaSPIP

    2 mai 2011, par

    This page lists some websites based on MediaSPIP.

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

  • Creating farms of unique websites

    13 avril 2011, par

    MediaSPIP platforms can be installed as a farm, with a single "core" hosted on a dedicated server and used by multiple websites.
    This allows (among other things) : implementation costs to be shared between several different projects / individuals rapid deployment of multiple unique sites creation of groups of like-minded sites, making it possible to browse media in a more controlled and selective environment than the major "open" (...)

Sur d’autres sites (9179)

  • ffmpeg output stereoscopic by duplicating a single input

    2 septembre 2018, par daedalus

    I want to have my desktop output video to be used with a VR headset so I need to convert the X11 output to left and right eye (but as a single video), it won’t be 3D since the left and right eye input is the same but thats fine. I think I am almost there but can’t get ffmpeg to treat a single source as two inputs. Here is what I have so far>

    ffmpeg -f x11grab -framerate 60  -video_size 1920x1080 -i :0.0 -i :0.0  -filter_complex "[0:v] scale=iw/2:ih/2, pad=2*iw:ih [left]; [1:v] scale=iw/3:ih/3, fade=out:300:30:alpha=1 [right]; [left][right] overlay=main_w/2:0 [out]" -vcodec libx264 -crf 16 -preset ultrafast sidebyside.mp4

    The command above should create a single output video with a duplicate of my display input for left and right eye on the left and right part of the video.

    The ffmpeg command above fails with

    :0.0 : Protocol not found
    Did you mean file::0.0 ?

    Thanks in advance

  • ffmpeg for android, out of memory on decoding rotate mp4 file with openh264

    29 octobre 2018, par da que

    Version

    • ffmpeg : 4.0.2
    • openh264 : 1.8.0

    Problem

    I try to trim a .mp4 file which metadata info contains rotate info, but I failed with the error information.

    The file stream info :

     Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '1.mp4':
     Metadata:
       major_brand     : mp42
       minor_version   : 0
       compatible_brands: isommp42
       creation_time   : 2018-10-09T09:40:53.000000Z
       location        : +39.8983+116.4145/
       location-eng    : +39.8983+116.4145/
       com.android.version: 6.0
     Duration: 00:00:10.56, start: 0.000000, bitrate: 8671 kb/s
       Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x720, 8563 kb/s, SAR 1:1 DAR 16:9, 30.01 fps, 30 tbr, 90k tbn, 180k tbc (default)
       Metadata:
         rotate          : 180
         creation_time   : 2018-10-09T09:40:53.000000Z
         handler_name    : VideoHandle
       Side data:
         displaymatrix: rotation of -180.00 degrees
       Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s (default)
       Metadata:
         creation_time   : 2018-10-09T09:40:53.000000Z
         handler_name    : SoundHandle

    ffmpeg cmd

    ffmpeg -y -i 1.mp4 -threads 4 -b:v 2000k -vcodec libopenh264 -acodec copy -ss 0 -t 3 -f mp4 -movflags faststart -strict -2 ./output.mp4

    result

    Error reinitializing filters!
    Failed to inject frame into filter network: Out of memory
    Error while processing the decoded data for stream #0:0

    Then I found this answer : ffmpeg-for-android-out-of-memory, after i added -noautorotate command to my cmd, the video is trimmed successful.

    If I use -vcodec copy instead of -vcodec libopenh264, the result also is ok, I wonder if there is a bug when libopenh264 decode with ffmpeg’s autorotate function.

    I wipe the video’s rotate info from metadata with -metadata:s:v:0 command, the newly video can be trimmed successful with the origin cmd :(

  • How to grab ffmpeg's output as binary and write it to a file on the fly such that video players can play it in real time ?

    29 décembre 2022, par Mister Mystère

    I want to stream a RTSP-streaming device to a video player such as VLC but the catch is that, in between, the binary data needs to go through a custom high-speed serial link. I control what goes in this link from a C++ program.

    


    I was happily surprised to see that the following line allowed me to watch the RTSP stream by just opening "out.bin" from VLC which was a good lead for fast and efficient binary transmission of the stream :

    


    ffmpeg -i "rtsp://admin:password@X.X.X.X:554/h264Preview_01_main" -c:v copy -c:a copy -f mpegts out.bin


    


    I already wondered how ffmpeg manages to allow VLC to read that file, while itself writing to it at the same time. Turns out I was right to wonder, see below.

    


    I told myself I could make this command pipe its output to the standard output, and then in turn pipe the standard output to a file that I can read, (later, slice it, transmit the chunks and reconstruct it) and then write to an output file. However, this does not work :

    


    #include 
#include 
#include 

#define BUFSIZE 188 //MPEG-TS packet size

int main()
{
    char *cmd = (char*)"ffmpeg -i \"rtsp://admin:password@X.X.X.X:554/h264Preview_01_main\" -c:v copy -c:a copy -f mpegts pipe:1 -loglevel quiet";
    char buf[BUFSIZE];
    FILE *ptr, *file;

    file = fopen("./out.bin", "w");

    if (!file)
    {
        printf("Failed to open output file for writing, aborting");
       abort();
    }

    if ((ptr = popen(cmd, "r")) != NULL) {
       printf("Writing RTSP stream to file...");

       while (!kbhit())
       {
            if(fread(&buf, sizeof(char), BUFSIZE, ptr) != 0)
            {
               fwrite(buf, sizeof(char), BUFSIZE, file);
            }
            else
            {
                printf("No data\n");
            }
       }
       pclose(ptr);
    }
    else
    {
        printf("Failed to open pipe from ffmpeg command, aborting");
    }

    printf("End of program");

    fclose(file);
    return 0;
}


    


    Since VLC says "your input can't be opened" - whereas this works just fine :

    


    ffmpeg -i "rtsp://admin:password@X.X.X.X:554/h264Preview_01_main" -c:v copy -c:a copy -f mpegts pipe:1 -loglevel quiet > out.bin


    


    This is what ends up in the file after I close the program, versus the result of the command immediately above :
enter image description here

    


    The file is always 2kB regardless of how long I run the program : "No data" is shown repeatedly in the console output.

    


    Why doesn't it work ? If it is not just a bug, how can I grab the stream as binary at some point, and write it at the end to a file that VLC can read ?

    


    Update

    


    New code after applying Craig Estey's fix to my stupid mistake. The end result is that the MPEG-TS frames don't seem to shift anymore but the file writing stops partway into one of the first few frames (the console only shows a few ">" symbols and then stays silent, c.f. code).

    


    #include 
#include 
#include 

#define BUFSIZE 188                     // MPEG-TS packet size

int
main()
{
    char *cmd = (char *) "ffmpeg -i \"rtsp://127.0.0.1:8554/test.sdp\" -c:v copy -c:a copy -f mpegts pipe:1 -loglevel quiet";
    char buf[BUFSIZE];
    FILE *ptr,
    *file;

    file = fopen("./out.ts", "w");

    if (!file) {
        printf("Failed to open output file for writing, aborting");
        abort();
    }

    if ((ptr = popen(cmd, "r")) != NULL) {
        printf("Writing RTSP stream to file...");

        while(!kbhit()) {
            ssize_t rlen = fread(&buf, sizeof(char), BUFSIZE, ptr);
            if(rlen != 0)
            {
                printf(">");
                fwrite(buf, sizeof(char), rlen, file);
                fflush(file);
            }
        }
        pclose(ptr);
    }
    else {
        printf("Failed to open pipe from ffmpeg command, aborting");
    }

    printf("End of program");

    fclose(file);
    return 0;
}


    


    This can be tested on any computer with VLC and a webcam : open VLC, open capture device, capture mode directshow, (switch "play" for "stream"), next, display locally, select RTSP, Add, path=/test.sdp, next, transcoding=H264+MP3 (TS), replace rtsp ://:8554/ with rtsp ://127.0.0.1:8554/ in the generated command line, stream.

    


    To test that streaming is ok, you can just open a command terminal and enter "ffmpeg -i "rtsp ://127.0.0.1:8554/test.sdp" -c:v copy -c:a copy -f mpegts pipe:1 -loglevel quiet", the terminal should fill up with binary data.

    


    To test the program, just compile, run, and open out.ts after the program has run.