Recherche avancée

Médias (1)

Mot : - Tags -/lev manovitch

Autres articles (54)

  • Le profil des utilisateurs

    12 avril 2011, par

    Chaque utilisateur dispose d’une page de profil lui permettant de modifier ses informations personnelle. Dans le menu de haut de page par défaut, un élément de menu est automatiquement créé à l’initialisation de MediaSPIP, visible uniquement si le visiteur est identifié sur le site.
    L’utilisateur a accès à la modification de profil depuis sa page auteur, un lien dans la navigation "Modifier votre profil" est (...)

  • Configurer la prise en compte des langues

    15 novembre 2010, par

    Accéder à la configuration et ajouter des langues prises en compte
    Afin de configurer la prise en compte de nouvelles langues, il est nécessaire de se rendre dans la partie "Administrer" du site.
    De là, dans le menu de navigation, vous pouvez accéder à une partie "Gestion des langues" permettant d’activer la prise en compte de nouvelles langues.
    Chaque nouvelle langue ajoutée reste désactivable tant qu’aucun objet n’est créé dans cette langue. Dans ce cas, elle devient grisée dans la configuration et (...)

  • XMP PHP

    13 mai 2011, par

    Dixit Wikipedia, XMP signifie :
    Extensible Metadata Platform ou XMP est un format de métadonnées basé sur XML utilisé dans les applications PDF, de photographie et de graphisme. Il a été lancé par Adobe Systems en avril 2001 en étant intégré à la version 5.0 d’Adobe Acrobat.
    Étant basé sur XML, il gère un ensemble de tags dynamiques pour l’utilisation dans le cadre du Web sémantique.
    XMP permet d’enregistrer sous forme d’un document XML des informations relatives à un fichier : titre, auteur, historique (...)

Sur d’autres sites (4044)

  • Real time audio streaming from ffmpeg to browser (am I missing something ?)

    19 septembre 2022, par Яктенс Тид

    I have tried a couple of solutions already, but nothing works for me.
I want to stream audio from my PC to another computer with almost zero latency. Things are working fine so far in a sense of lagging and everything, sound is clear and not choppy at all, but there is something like a delay between the moment when audio starts playing on my PC and remote PC. For example when I click on Youtube 'play' button audio starts playing only after 3-4 seconds on the remote machine. The same when I click 'Pause', the sound on the remote PC stops after a couple of seconds.

    


    I've tried to use websockets\plain audio tag, but no luck so far.

    


    For example this is my solution by using websockets and pipes :

    


    def create_pipe():
    return win32pipe.CreateNamedPipe(r'\\.\pipe\__audio_ffmpeg', win32pipe.PIPE_ACCESS_INBOUND,
                                     win32pipe.PIPE_TYPE_MESSAGE |
                                     win32pipe.PIPE_READMODE_MESSAGE |
                                     win32pipe.PIPE_WAIT, 1, 1024 * 8, 1024 * 8, 0, None)


async def echo(websocket):
    pipe = create_pipe()
    win32pipe.ConnectNamedPipe(pipe, None)
    while True:
        data = win32file.ReadFile(pipe, 1024 * 2)
        await websocket.send(data[1])


async def main():
    async with websockets.serve(echo, "0.0.0.0", 7777):
        await asyncio.Future()  # run forever


if __name__ == '__main__':
    asyncio.run(main())


    


    The way I start ffmpeg

    


    .\ffmpeg.exe -f dshow -i audio="Stereo Mix (Realtek High Definition Audio)" -acodec libmp3lame  -ab 320k -f mp3 -probesize 32 -muxdelay 0.01 -y \\.\pipe\__audio_ffmpeg


    


    On the JS side the code is a little bit long, but essentially I am just reading a web socket and appending to buffer

    


    this.buffer = this.mediaSource.addSourceBuffer('audio/mpeg')


    


    Also as you see I tried to use -probesize 32 -muxdelay 0.01 flags, but no luck as well

    


    I tried to use plain tag as well, but still - this couple-of-seconds delay exists

    


    What can I do ? Am I missing something ? Maybe I have to disable buffering somewhere ?

    


  • ffmpeg trim video works on emulator but fails on arm (real device)

    21 octobre 2017, par fthopkins

    I’m trimming the videos with ffmpeg that is bigger than 10 seconds. On my JNI edit function i use commands to trim video. I try to debug but as you all know debugging on JNI function is not like native android JAVA function. Maybe it is.. but not for my knowledge. Also i used coffecatch library to catch exception but didn’t succeeded. I did go for error step by step and reached the this line of ffmpeg main function.

    EDIT

    current_time = ti = getutime(); // edited : lastly can print message on here.
    if (transcode() < 0) // transcode() < 0 => true and run exit_program(1).
       exit_program(1);
    ti = getutime() - ti;

    On emulator everything is working good and fast. But on real device it gives some kind of error but i couldn’t catch it. When i check the Android Monitor of Android Studio my JNI edit function’s logs appear but disappear in a second. It is weird. Also when i check the output path on device, ffmpeg gives an trimmed video output (but very slow). So it is working on background and gives a trimmed video. It is very weird too because app crashes while main method is working. I need help to figure it out. I stucked.

    My video edit JNI function

    JNIEXPORT jint JNICALL
    Java_com_farukest_app_library_AppVideoEditer_natives_VideoEditer_edit
    (JNIEnv *env,jclass someclass, jstring inputFile, jstring outFile, jint
    startTime,jint endTime, jstring fileSize, jboolean mustCompress) {

       log_message("Starting to cut");

       int numberOfArgs = 19;

       char** $commands = calloc(numberOfArgs, sizeof(char*));
       char start[5], end[5];
       const char *in, *out, *fileSz;
       itoa(startTime, start);
       itoa(endTime, end);

       in = (*env)->GetStringUTFChars(env, inputFile, 0);
       out = (*env)->GetStringUTFChars(env, outFile, 0);
       fileSz = (*env)->GetStringUTFChars(env, fileSize, 0);


       $commands[0] = "ffmpeg";
       $commands[1] = "-ss";
       $commands[2] = start;
       $commands[3] = "-y";
       $commands[4] = "-i";
       $commands[5] = in;
       $commands[6] = "-t";
       $commands[7] = end;
       $commands[8] =  "-vcodec";
       $commands[9] =  "mpeg4";
       $commands[10] =  "-b:v";

       if(mustCompress){
         $commands[11] =  "3072000"; // 3mb
       }else{
         $commands[11] =  fileSz;
       }
       $commands[12] =  "-b:a";
       $commands[13] =  "48000";
       $commands[14] =  "-ac";
       $commands[15] =  "2";
       $commands[16] =  "-ar";
       $commands[17] =  "22050";
       $commands[18] =  out;

       int i;
       for (i = 0; i < numberOfArgs; i++) {
           log_message($commands[i]);
       }
       log_message("Printed all"); // lastly prints on here

       main(numberOfArgs, $commands); // stuck on here
       log_message("Finished cutting"); // not reach here
       free($commands);
       (*env)->ReleaseStringUTFChars(env, inputFile, in);
       (*env)->ReleaseStringUTFChars(env, outFile, out);

       return 0;
    }

    FFMPEG main function

    int main(int argc, char **argv)
    {
    int i, ret;
    int64_t ti;

    init_dynload();

    register_exit(ffmpeg_cleanup);

    setvbuf(stderr,NULL,_IONBF,0); /* win32 runtime needs this */

    av_log_set_flags(AV_LOG_SKIP_REPEATED);
    parse_loglevel(argc, argv, options);

    if(argc>1 && !strcmp(argv[1], "-d")){
       run_as_daemon=1;
       av_log_set_callback(log_callback_null);
       argc--;
       argv++;
    }

    avcodec_register_all();
    # if CONFIG_AVDEVICE
    avdevice_register_all();
    #endif
    avfilter_register_all();
    av_register_all();
    avformat_network_init();

    show_banner(argc, argv, options);

    /* parse options and open all input/output files */
    ret = ffmpeg_parse_options(argc, argv);
    if (ret < 0)
       exit_program(1);

    if (nb_output_files <= 0 && nb_input_files == 0) {
       show_usage();
       av_log(NULL, AV_LOG_WARNING, "Use -h to get full help or, even better, run 'man %s'\n", program_name);
       exit_program(1);
    }

    /* file converter / grab */
    if (nb_output_files <= 0) {
       av_log(NULL, AV_LOG_FATAL, "At least one output file must be specified\n");
       exit_program(1);
    }

    // if (nb_input_files == 0) {
    // av_log(NULL, AV_LOG_FATAL, "At least one input file must be specified\n");
    // exit_program(1);
    //     }

    for (i = 0; i < nb_output_files; i++) {
       if (strcmp(output_files[i]->ctx->oformat->name, "rtp"))
           want_sdp = 0;
    }

    current_time = ti = getutime();
    if (transcode() < 0)
       exit_program(1);
    ti = getutime() - ti;
    if (do_benchmark) {
       av_log(NULL, AV_LOG_INFO, "bench: utime=%0.3fs\n", ti / 1000000.0);
    }
    av_log(NULL, AV_LOG_DEBUG, "%"PRIu64" frames successfully decoded, %"PRIu64" decoding errors\n",
          decode_error_stat[0], decode_error_stat[1]);
    if ((decode_error_stat[0] + decode_error_stat[1]) * max_error_rate < decode_error_stat[1])
       exit_program(69);

    exit_program(received_nb_signals ? 255 : main_return_code);
    return main_return_code;
    }

    EDIT

    I debugged and found which line exiting me from the app. It is transcode() < 0 line But couldn’t find why ? Is there anyone to help me. I really need help. Can discuss and share more code.

  • Unable to record mediasoup producer using FFmpeg on real server

    30 novembre 2020, par Sarvesh Patil

    I have built a nice app in react native for audio calling, many thanks to MediaSoup !!

    


    To take it to next level, I need to record some of my calls.
I used this tutorial for reference :
mediasoup recording demo

    


    I followed the FFmpeg way and have reached a point where I have created a plainTransport with

    


        router.createPlainTransport({
        // No RTP will be received from the remote side
        comedia: false,
        // FFmpeg and GStreamer don't support RTP/RTCP multiplexing ("a=rtcp-mux" in SDP)
        rtcpMux: false,
        listenIp: {ip:"0.0.0.0", announcedIp:"MY_PUBLIC_IP"},
    });



    


    Then I connect to this transport :

    


        rtpPlainTransport.connect({
        ip: 127.0.0.1,
        port: "port1",
        rtcpPort: "port2",
    });



    


    My first doubt : is the ip address in .connect({}) parameters supplied above correct ?

    


    Second, the FFMPEG command requires an SDP header. This is mine :

    


        v=0
    o=- 0 0 IN IP4 127.0.0.1
    s=-
    c=IN IP4 127.0.0.1
    t=0 0
    m=audio port1 RTP/AVPF 111
    a=rtcp:port2
    a=rtpmap:111 opus/48000/2
    a=fmtp:111 minptime=10;useinbandfec=1


    


    When I start recording, the FFMPEG process does not receive any data.
Moreover, on stopping, I get the following message

    


    


    Output file is empty, nothing was encoded (check -ss / -t / -frames
parameters if used) Exiting normally, received signal 2. Recording
process exit, code : 255, signal : null

    


    


    I was able to make the recording save on localhost with 127.0.0.1 when the server was itself running on localhost.

    


    However, with my actual server hosted with Nginx, I'm not able to figure out what is going wrong.

    


    I can see data being sent on my audio port :

    


    1 0.000000000    127.0.0.1 → 127.0.0.1    UDP 117 10183 → 5004 Len=75
2 0.020787740    127.0.0.1 → 127.0.0.1    UDP 108 10183 → 5004 Len=66
3 0.043201757    127.0.0.1 → 127.0.0.1    UDP 118 10183 → 5004 Len=76


    


    What do I do with FFmpeg so that it starts the recording !?

    


    Can someone please help ?