Recherche avancée

Médias (91)

Autres articles (63)

  • Mise à jour de la version 0.1 vers 0.2

    24 juin 2013, par

    Explications des différents changements notables lors du passage de la version 0.1 de MediaSPIP à la version 0.3. Quelles sont les nouveautés
    Au niveau des dépendances logicielles Utilisation des dernières versions de FFMpeg (>= v1.2.1) ; Installation des dépendances pour Smush ; Installation de MediaInfo et FFprobe pour la récupération des métadonnées ; On n’utilise plus ffmpeg2theora ; On n’installe plus flvtool2 au profit de flvtool++ ; On n’installe plus ffmpeg-php qui n’est plus maintenu au (...)

  • Personnaliser en ajoutant son logo, sa bannière ou son image de fond

    5 septembre 2013, par

    Certains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;

  • Ecrire une actualité

    21 juin 2013, par

    Présentez les changements dans votre MédiaSPIP ou les actualités de vos projets sur votre MédiaSPIP grâce à la rubrique actualités.
    Dans le thème par défaut spipeo de MédiaSPIP, les actualités sont affichées en bas de la page principale sous les éditoriaux.
    Vous pouvez personnaliser le formulaire de création d’une actualité.
    Formulaire de création d’une actualité Dans le cas d’un document de type actualité, les champs proposés par défaut sont : Date de publication ( personnaliser la date de publication ) (...)

Sur d’autres sites (11159)

  • Got a crash when I run a ffmpeg comand on an certain phone

    31 août 2016, par Kingty Teng

    here is the code I change from ffmpeg.c ,it can be run correct.
    BUT,IT ALWAYS crashed on an cenrtain phone after run this code.

    JNIEXPORT jstring JNICALL Java_com_p1_mobile_android_media_VideoKit_run(
       JNIEnv* env, jobject thiz, jobjectArray strArray)
    {


       int ret, i, pid;
       int pipeFD[2];
       char retBuffer[2];
       char resultString[4096];

       int argc = (*env)->GetArrayLength(env, strArray);

       char ** argv = (char **)malloc(sizeof(char*)*argc);

       for (i = 0; i < argc; i++) {
           argv[i] = (*env)->GetStringUTFChars(env,
                                 (jstring)(*env)->GetObjectArrayElement(env, strArray, i), NULL);
       }

       // reset to FAIL
       ret = 1;
       memset(retBuffer, 0, sizeof(retBuffer));
       memset(resultString, 0, sizeof(resultString));

       pipe(pipeFD);

       pid = fork();


       if (pid < 0) {
           goto done;
       } else if (pid == 0) {
           // in child process, do command work


           close(pipeFD[0]);

           init();

           av_log_set_callback(log_callback);

           ret = run_ffempeg_command(argc, argv);


           s_task_completed = 1;

           sprintf(retBuffer, "%d", ret);
           write(pipeFD[1], retBuffer, sizeof(retBuffer));

           char * result_record = get_record_result();
           if (result_record != NULL && strlen(result_record) > 0) {
               sprintf(resultString, "%s", result_record);
           } else {
               if (ret == 0 && s_task_completed == 1) {
                   sprintf(resultString, "%s", "SUCCESS");
               } else {
                   sprintf(resultString, "%s", "FAIL");
               }
           }

           write(pipeFD[1], resultString, sizeof(resultString));

           exit(0);
       } else {
           close(pipeFD[1]);

           read(pipeFD[0], retBuffer, sizeof(retBuffer));

           ret = (retBuffer[0] == '1') ? 1 : 0;
           memset(resultString, 0, sizeof(resultString));
           read(pipeFD[0], resultString, sizeof(resultString));
       }

    done:

       for (i=0; iReleaseStringUTFChars(env,
                       (jstring)(*env)->GetObjectArrayElement(env, strArray, i), argv[i]);
       }

       free(argv);

       //close();

       if (strlen(resultString) > 0) {
           // workaround for UTF-8 issue
           jbyteArray array = (*env)->NewByteArray(env, sizeof(resultString));
           (*env)->SetByteArrayRegion(env, array, 0, sizeof(resultString), resultString);
           jstring strEncode = (*env)->NewStringUTF(env, "UTF-8");
           jclass cls = (*env)->FindClass(env, "java/lang/String");
           jmethodID ctor = (*env)->GetMethodID(env, cls, "<init>", "([BLjava/lang/String;)V");

           jstring object = (jstring) (*env)->NewObject(env, cls, ctor, array, strEncode);

           return object;
       } else {
           return (*env)->NewStringUTF(env, "FAIL");
       }
    }
    </init>

    here is the crash log.almost phone can run this well,only on one phone after run the jni ,any button i touched will bring this crash
    ,it’s really appreciate if anybody can help

       08-31 14:59:23.580 279-279/? D/AEE/AED: $===AEE===AEE===AEE===$
    08-31 14:59:23.580 279-279/? D/AEE/AED: p 0 poll events 1 revents 0
    08-31 14:59:23.580 279-279/? D/AEE/AED: not know revents:0
    08-31 14:59:23.580 279-279/? D/AEE/AED: p 1 poll events 1 revents 0
    08-31 14:59:23.580 279-279/? D/AEE/AED: not know revents:0
    08-31 14:59:23.580 279-279/? D/AEE/AED: p 2 poll events 1 revents 1
    08-31 14:59:23.580 279-279/? D/AEE/AED: aed_main_fork_worker: generator 0xf7017148, worker 0xffbe76d8, recv_fd 0
    08-31 14:59:23.580 279-279/? D/AEE/AED: p 3 poll events 1 revents 0
    08-31 14:59:23.580 279-279/? D/AEE/AED: not know revents:0
    08-31 14:59:23.580 279-279/? D/AEE/AED: p 4 poll events 1 revents 0
    08-31 14:59:23.580 279-279/? D/AEE/AED: not know revents:0
    08-31 14:59:23.580 279-279/? D/AEE/AED: p 5 poll events 0 revents 0
    08-31 14:59:23.580 279-279/? D/AEE/AED: not know revents:0
    08-31 14:59:23.580 8546-8546/? I/AEE/AED: handle_request(0)
    08-31 14:59:23.581 8546-8546/? I/AEE/AED: check process 29910 name:1.mobile.putong
    08-31 14:59:23.581 8546-8546/? I/AEE/AED: tid 29961 abort msg address is:0x83b09000, si_code is:-6 (request from 29910:10152)
    08-31 14:59:23.581 8546-8546/? I/AEE/AED: BOOM: pid=29910 uid=10152 gid=10152 tid=29961
    08-31 14:59:23.582 8546-8546/? I/AEE/AED: [OnPurpose Redunant in void preset_info(aed_report_record*, int, int)] pid: 29910, tid: 29961, name: RenderThread  >>> com.p1.mobile.putong &lt;&lt;&lt;
    08-31 14:59:23.634 8546-8546/? I/AEE/AED: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
    08-31 14:59:23.634 8546-8546/? I/AEE/AED: Build fingerprint: 'Letv/Le1s_CN/X3:5.0.2/DBXCNOP5501304201S/66:user/release-keys'
    08-31 14:59:23.634 8546-8546/? I/AEE/AED: Revision: '0'
    08-31 14:59:23.634 8546-8546/? I/AEE/AED: ABI: 'arm'
    08-31 14:59:23.635 8546-8546/? I/AEE/AED: pid: 29910, tid: 29961, name: RenderThread  >>> com.p1.mobile.putong &lt;&lt;&lt;
    08-31 14:59:23.635 8546-8546/? I/AEE/AED: signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
    08-31 14:59:23.662 8546-8546/? I/AEE/AED: Abort message: 'Failed to make current on surface 0x8c8b6e40, error=EGL_BAD_NATIVE_WINDOW'
    08-31 14:59:23.662 8546-8546/? I/AEE/AED:     r0 00000000  r1 00007509  r2 00000006  r3 00000000
    08-31 14:59:23.662 8546-8546/? I/AEE/AED:     r4 863fddc8  r5 00000006  r6 0000000b  r7 0000010c
    08-31 14:59:23.662 8546-8546/? I/AEE/AED:     r8 675bdb6c  r9 863fdd30  sl 863fdd28  fp 675bdba8
    08-31 14:59:23.662 8546-8546/? I/AEE/AED:     ip 00007509  sp 863fd838  lr 4002ee43  pc 4005206c  cpsr 600f0010
    08-31 14:59:23.662 8546-8546/? I/AEE/AED: backtrace:
    08-31 14:59:23.662 8546-8546/? I/AEE/AED:     #00 pc 0003a06c  /system/lib/libc.so (tgkill+12)
    08-31 14:59:23.662 8546-8546/? I/AEE/AED:     #01 pc 00016e3f  /system/lib/libc.so (pthread_kill+66)
    08-31 14:59:23.662 8546-8546/? I/AEE/AED:     #02 pc 00017a0b  /system/lib/libc.so (raise+10)
    08-31 14:59:23.662 8546-8546/? I/AEE/AED:     #03 pc 00014317  /system/lib/libc.so (__libc_android_abort+34)
    08-31 14:59:23.662 8546-8546/? I/AEE/AED:     #04 pc 00012a4c  /system/lib/libc.so (abort+4)
    08-31 14:59:23.662 8546-8546/? I/AEE/AED:     #05 pc 000083c1  /system/lib/libcutils.so (__android_log_assert+88)
    08-31 14:59:23.662 8546-8546/? I/AEE/AED:     #06 pc 0003f07b  /system/lib/libhwui.so
    08-31 14:59:23.662 8546-8546/? I/AEE/AED:     #07 pc 0003d9e1  /system/lib/libhwui.so
    08-31 14:59:23.662 8546-8546/? I/AEE/AED:     #08 pc 0003ec23  /system/lib/libhwui.so
    08-31 14:59:23.662 8546-8546/? I/AEE/AED:     #09 pc 0003ed1b  /system/lib/libhwui.so
    08-31 14:59:23.662 8546-8546/? I/AEE/AED:     #10 pc 00040257  /system/lib/libhwui.so
    08-31 14:59:23.662 8546-8546/? I/AEE/AED:     #11 pc 00040eab  /system/lib/libhwui.so (android::uirenderer::renderthread::RenderThread::threadLoop()+66)
    08-31 14:59:23.662 8546-8546/? I/AEE/AED:     #12 pc 00010973  /system/lib/libutils.so (android::Thread::_threadLoop(void*)+110)
    08-31 14:59:23.662 8546-8546/? I/AEE/AED:     #13 pc 000609dd  /system/lib/libandroid_runtime.so (android::AndroidRuntime::javaThreadShell(void*)+72)
    08-31 14:59:23.662 8546-8546/? I/AEE/AED:     #14 pc 000165bf  /system/lib/libc.so (__pthread_start(void*)+30)
    08-31 14:59:23.662 8546-8546/? I/AEE/AED:     #15 pc 0001466b  /system/lib/libc.so (__start_thread+6)
    08-31 14:59:33.720 8546-8546/? E/AEE/AED: timed out waiting for tid=29910 to stop
    08-31 14:59:33.821 8546-8546/? E/AEE/AED: timed out waiting for tid=29915 to stop

    08-31 14:59:36.912 8546-8546/? E/AEE/AED: timed out waiting for tid=8434 to stop
  • Trying to upload a video to a server and then play it back to a video view (Xamarin android)

    31 juillet 2016, par stackOverNo

    I’m currently working on a xamarin.android project, and am attempting to upload a video to an aws server, and then also be able to play it back. The upload is working correctly as far as I can tell.

    I’m retrieving the file from the user’s phone, turning it into a byte array, and uploading that. This is the code to upload :

    if (isImageAttached || isVideoAttached)
               {
                   //upload the file
                   byte[] fileInfo = System.IO.File.ReadAllBytes(filePath);
                   Task<media> task = client.SaveMediaAsync(fileInfo, nameOfFile);
                   mediaObj = await task;

                   //other code below is irrelevant to example
               }
    </media>

    and SaveMediaAsync is a function I wrote in a PCL :

    public async Task<media> SaveMediaAsync(byte[] fileInfo, string fName)
       {        
           Media a = new Media();
           var uri = new Uri(RestUrl);

           try
           {

               MultipartFormDataContent form = new MultipartFormDataContent();
               form.Add(new StreamContent(new MemoryStream(fileInfo)), "file", fName);  //add file

               var response = await client.PostAsync(uri, form);            //post the form   client is an httpclient object
               string info = await response.Content.ReadAsStringAsync();

       //save info to media object
               string[] parts = info.Split('\"');
               a.Name = parts[3];
               a.Path = parts[7];
               a.Size = Int32.Parse(parts[10]);

           }
           catch(Exception ex)
           {
       //handle exception
           }

           return a;

       }
    </media>

    After uploading the video like that, I’m able to view it in a browser using the public url. The quality is the same, and there is no issue with lag or load time. However when I try to play back the video using the same public url on my app on an android device, it takes an unbelievably long time to load the video. Even once it is loaded, it plays less than a second of it, and then seems to start loading the video again(the part of the progress bar that shows how much of the video has loaded jumps back to the current position and starts loading again).

    VideoView myVideo = FindViewById<videoview>(Resource.Id.TestVideo);

    myVideo.SetVideoURI(Android.Net.Uri.Parse(url));

    //add media controller
    MediaController cont = new MediaController(this);
    cont.SetAnchorView(myVideo);
    myVideo.SetMediaController(cont);

    //start video
    myVideo.Start();
    </videoview>

    Now I’m trying to play a 15 second video that is 5.9mb. When I try to play a 5 second video that’s 375kb it plays with no issue. This leads me to believe I need to make the video file smaller before playing it back, but I’m not sure how to do that. I’m trying to allow the user to upload their own videos, so I’ll have all different file formats and sizes.

    I’ve seen some people suggesting ffmpeg for a c# library to alter video files, but I’m not quite sure what it is I need to do to the video file. Can anyone fill in the gaps in my knowledge here ?

    Thanks for your time, it’s greatly appreciated !

  • How do i compress a video file in c# (Xamarin android)

    1er août 2016, par stackOverNo

    I’m currently working on a xamarin.android project, and am attempting to upload a video to an aws server, and then also be able to play it back. The upload is working correctly as far as I can tell.

    I’m retrieving the file from the user’s phone, turning it into a byte array, and uploading that. This is the code to upload :

    if (isImageAttached || isVideoAttached)
               {
                   //upload the file
                   byte[] fileInfo = System.IO.File.ReadAllBytes(filePath);
                   Task<media> task = client.SaveMediaAsync(fileInfo, nameOfFile);
                   mediaObj = await task;

                   //other code below is irrelevant to example
               }
    </media>

    and SaveMediaAsync is a function I wrote in a PCL :

    public async Task<media> SaveMediaAsync(byte[] fileInfo, string fName)
       {        
           Media a = new Media();
           var uri = new Uri(RestUrl);

           try
           {

               MultipartFormDataContent form = new MultipartFormDataContent();
               form.Add(new StreamContent(new MemoryStream(fileInfo)), "file", fName);  //add file

               var response = await client.PostAsync(uri, form);            //post the form   client is an httpclient object
               string info = await response.Content.ReadAsStringAsync();

       //save info to media object
               string[] parts = info.Split('\"');
               a.Name = parts[3];
               a.Path = parts[7];
               a.Size = Int32.Parse(parts[10]);

           }
           catch(Exception ex)
           {
       //handle exception
           }

           return a;

       }
    </media>

    After uploading the video like that, I’m able to view it in a browser using the public url. The quality is the same, and there is no issue with lag or load time. However when I try to play back the video using the same public url on my app on an android device, it takes an unbelievably long time to load the video. Even once it is loaded, it plays less than a second of it, and then seems to start loading the video again(the part of the progress bar that shows how much of the video has loaded jumps back to the current position and starts loading again).

    VideoView myVideo = FindViewById<videoview>(Resource.Id.TestVideo);

    myVideo.SetVideoURI(Android.Net.Uri.Parse(url));

    //add media controller
    MediaController cont = new MediaController(this);
    cont.SetAnchorView(myVideo);
    myVideo.SetMediaController(cont);

    //start video
    myVideo.Start();
    </videoview>

    Now I’m trying to play a 15 second video that is 5.9mb. When I try to play a 5 second video that’s 375kb it plays with no issue. This leads me to believe I need to make the video file smaller before playing it back, but I’m not sure how to do that. I’m trying to allow the user to upload their own videos, so I’ll have all different file formats and sizes.

    I’ve seen some people suggesting ffmpeg for a c# library to alter video files, but I’m not quite sure what it is I need to do to the video file. Can anyone fill in the gaps in my knowledge here ?

    Thanks for your time, it’s greatly appreciated !