Recherche avancée

Médias (0)

Mot : - Tags -/objet éditorial

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

Autres articles (76)

  • Websites made ​​with MediaSPIP

    2 mai 2011, par

    This page lists some websites based on MediaSPIP.

  • Amélioration de la version de base

    13 septembre 2013

    Jolie sélection multiple
    Le plugin Chosen permet d’améliorer l’ergonomie des champs de sélection multiple. Voir les deux images suivantes pour comparer.
    Il suffit pour cela d’activer le plugin Chosen (Configuration générale du site > Gestion des plugins), puis de configurer le plugin (Les squelettes > Chosen) en activant l’utilisation de Chosen dans le site public et en spécifiant les éléments de formulaires à améliorer, par exemple select[multiple] pour les listes à sélection multiple (...)

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

  • Issue in concatenating two video files using FFMPEG

    12 mai 2014, par intrepidkarthi

    I am trying to concatenate two mp4 files taken from gallery. I am getting issue with process execution failure. I have added the code and the error log. Using the ffmpeg library taken from guardian project.

    I am running this in Samsung Galaxy S3 device.

    The error is thrown in this particular line.

    ProcessBuilder pb = new ProcessBuilder(cmds);
    pb.directory(fileExec);
    Process process = pb.start();  

    When I replace the last line above with this,

    Process process = Runtime.getRuntime().exec("chmod 777 "+cmds.toArray(new String[cmds.size()]));

    It works with out the exception as shown below. But the output doesn’t seem to come.

    File concatenation Code :

       File fileVideoOutput = new File(getApplicationContext()
               .getExternalFilesDir("test") + "hello.mp4");
       fileVideoOutput.delete();

       File fileTmp = getApplicationContext().getCacheDir();
       File fileAppRoot = new File(getApplicationContext()
               .getApplicationInfo().dataDir);

       try {
           FfmpegController fc = new FfmpegController(fileTmp, fileAppRoot);

           ArrayList<clip> listVideos = new ArrayList<clip>();
           Clip clip = new Clip();
           clip.path = video1;
           fc.getInfo(clip);
           clip.duration = clip.duration;
           System.out.println("Clip1 duration " + clip.duration);
           listVideos.add(clip);

           Clip clip2 = new Clip();
           clip2.path = video2;
           fc.getInfo(clip2);
           clip2.duration = clip2.duration;
           System.out.println("Clip2 duration " + clip2.duration);
           listVideos.add(clip2);

           Clip clipOut = new Clip();
           clipOut.path = fileVideoOutput.getCanonicalPath();

           fc.concatAndTrimFilesMP4Stream(listVideos, clipOut, false, false,
                   new ShellUtils.ShellCallback() {

                       @Override
                       public void shellOut(String shellLine) {

                           System.out.println("fc>" + shellLine);
                       }

                       @Override
                       public void processComplete(int exitValue) {

                           if (exitValue &lt; 0)
                               System.err.println("concat non-zero exit: "
                                       + exitValue);
                       }
                   });
       } catch (Exception e1) {
           e1.printStackTrace();
       }
    </clip></clip>

    Error log :

    05-08 11:17:03.765: W/System.err(25209): java.io.IOException: Error running exec(). Command: [ffmpeg, -y, -i, /storage/emulated/0/DCIM/Camera/20140507_155713.mp4, -f, mpegts, -c, copy, -an, -bsf:v, h264_mp4toannexb, /data/data/com.yoyo.videoeditor/cache/0.ts] Working Directory: /data/data/com.yoyo.videoeditor/lib Environment: [VIBE_PIPE_PATH=/dev/pipes, ANDROID_ROOT=/system, EMULATED_STORAGE_SOURCE=/mnt/shell/emulated, LOOP_MOUNTPOINT=/mnt/obb, EMULATED_STORAGE_TARGET=/storage/emulated, ANDROID_BOOTLOGO=1, LD_LIBRARY_PATH=/vendor/lib:/system/lib, EXTERNAL_STORAGE=/storage/emulated/legacy, ANDROID_SOCKET_zygote=9, ANDROID_DATA=/data, PATH=/sbin:/vendor/bin:/system/sbin:/system/bin:/system/xbin, ANDROID_ASSETS=/system/app, ASEC_MOUNTPOINT=/mnt/asec, BOOTCLASSPATH=/system/framework/core.jar:/system/framework/core-junit.jar:/system/framework/bouncycastle.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/framework2.jar:/system/framework/telephony-common.jar:/system/framework/voip-common.jar:/system/framework/mms-common.jar:/system/framework/android.policy.jar:/system/framework/services.jar:/system/framework/apache-xml.jar:/system/framework/sec_edm.jar:/system/framework/seccamera.jar:/system/framework/scrollpause.jar:/system/framework/stayrotation.jar:/system/framework/smartfaceservice.jar:/system/framework/sc.jar:/system/framework/secocsp.jar:/system/framework/commonimsinterface.jar, ANDROID_PROPERTY_WORKSPACE=8,66560, SECONDARY_STORAGE=/storage/extSdCard:/storage/UsbDriveA:/storage/UsbDriveB:/storage/UsbDriveC:/storage/UsbDriveD:/storage/UsbDriveE:/storage/UsbDriveF, ANDROID_STORAGE=/storage]
    05-08 11:17:03.770: W/System.err(25209):    at java.lang.ProcessManager.exec(ProcessManager.java:211)
    05-08 11:17:03.770: W/System.err(25209):    at java.lang.ProcessBuilder.start(ProcessBuilder.java:195)
    05-08 11:17:03.770: W/System.err(25209):    at org.ffmpeg.android.FfmpegController.execProcess(FfmpegController.java:101)
    05-08 11:17:03.770: W/System.err(25209):    at org.ffmpeg.android.FfmpegController.execFFMPEG(FfmpegController.java:71)
    05-08 11:17:03.770: W/System.err(25209):    at org.ffmpeg.android.FfmpegController.execFFMPEG(FfmpegController.java:75)
    05-08 11:17:03.775: W/System.err(25209):    at org.ffmpeg.android.FfmpegController.convertToMP4Stream(FfmpegController.java:657)
    05-08 11:17:03.775: W/System.err(25209):    at org.ffmpeg.android.FfmpegController.concatAndTrimFilesMP4Stream(FfmpegController.java:1107)
    05-08 11:17:03.775: W/System.err(25209):    at com.yoyo.videoeditor.EditorActivity.mergeVideosOld(EditorActivity.java:271)
    05-08 11:17:03.775: W/System.err(25209):    at com.yoyo.videoeditor.EditorActivity.access$0(EditorActivity.java:243)
    05-08 11:17:03.775: W/System.err(25209):    at com.yoyo.videoeditor.EditorActivity$3.onClick(EditorActivity.java:85)
    05-08 11:17:03.775: W/System.err(25209):    at android.view.View.performClick(View.java:4475)
    05-08 11:17:03.775: W/System.err(25209):    at android.view.View$PerformClick.run(View.java:18786)
    05-08 11:17:03.780: W/System.err(25209):    at android.os.Handler.handleCallback(Handler.java:730)
    05-08 11:17:03.780: W/System.err(25209):    at android.os.Handler.dispatchMessage(Handler.java:92)
    05-08 11:17:03.780: W/System.err(25209):    at android.os.Looper.loop(Looper.java:176)
    05-08 11:17:03.780: W/System.err(25209):    at android.app.ActivityThread.main(ActivityThread.java:5419)
    05-08 11:17:03.780: W/System.err(25209):    at java.lang.reflect.Method.invokeNative(Native Method)
    05-08 11:17:03.785: W/System.err(25209):    at java.lang.reflect.Method.invoke(Method.java:525)
    05-08 11:17:03.785: W/System.err(25209):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1046)
    05-08 11:17:03.785: W/System.err(25209):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:862)
    05-08 11:17:03.785: W/System.err(25209):    at dalvik.system.NativeStart.main(Native Method)
    05-08 11:17:03.785: W/System.err(25209): Caused by: java.io.IOException: Permission denied
    05-08 11:17:03.785: W/System.err(25209):    at java.lang.ProcessManager.exec(Native Method)
    05-08 11:17:03.790: W/System.err(25209):    at java.lang.ProcessManager.exec(ProcessManager.java:209)
    05-08 11:17:03.790: W/System.err(25209):    ... 20 more

    Here is my ffmpeg commands as given in the ffmpeg tutorial page.

    ffmpeg -i input1.mp4 -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate1.ts
    ffmpeg -i input2.mp4 -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate2.ts
    ffmpeg -i "concat:intermediate1.ts|intermediate2.ts" -c copy -bsf:a aac_adtstoasc output.mp4

    FFMPEG library doesn’t seem to be working as expected. When I add commands and create output file using "touch" shell command file is being created. Still I am unable to see the output from ffmpeg as expected.

  • fastest ffmpeg without caring about quality

    31 mai 2019, par RedDeath

    I would like to convert any video into .mp4 as fast as possible without caring about quality loss. I have used the next commands with which I have been able to finish the process in 37 seconds for a 10 second video.

    -vcodec h264
    -crf 32
    -preset ultrafast

    However 37 seconds is still too long for a 10 seconds video. Is there any improvements that I can do to the command in order to reduce the execution time ?


    Edit (Extra info) :

    I’m using FFmpeg Android (implementation 'com.writingminds:FFmpegAndroid:0.3.2') even though commands usually work for any FFmpeg (with a few variants depending on the FFmpeg version).

    The command used in my case which gave me the fastest result so far is :

       mFfmpeg.execute(
           arrayOf(
               "-i" , videoCopy?.path,
               "-vcodec", "h264",
               "-crf", "32",
               "-preset", "ultrafast",
               "-y", uploadFile?.path),
           object : ExecuteBinaryResponseHandler() { ... }

    Which for regular FFmpeg command would be

    "-ffmpeg -i {video?.path} -vcodec h264 -crf 32 -preset ultrafast -y {uploadFile?.path}"

    Where video is my original video File and uploadFile is the File where I want to save the result into.

    In a Samsung J3 (SM-J320M, you can find its specifications online) such command takes the aforementioned 37 seconds.

    After executing such command the first onProgress message returned by FFmpeg prints :

    ffmpeg version n3.0.1 Copyright (c) 2000-2016 the FFmpeg developers  built with gcc 4.8 (GCC)  
    configuration:
       --target-os=linux
       --cross-prefix=/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/bin/arm-linux-androideabi-
       --arch=arm
       --cpu=cortex-a8
       --enable-runtime-cpudetect
       --sysroot=/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/sysroot
       --enable-pic
       --enable-libx264
       --enable-libass
       --enable-libfreetype
       --enable-libfribidi
       --enable-libmp3lame
       --enable-fontconfig
       --enable-pthreads
       --disable-debug
       --disable-ffserver
       --enable-version3
       --enable-hardcoded-tables
       --disable-ffplay
       --disable-ffprobe
       --enable-gpl
       --enable-yasm
       --disable-doc
       --disable-shared
       --enable-static
       --pkg-config=/home/vagrant/SourceCode/ffmpeg-android/ffmpeg-pkg-config
       --prefix=/home/vagrant/SourceCode/ffmpeg-android/build/armeabi-v7a
       --extra-cflags='-I/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/include -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fno-strict-overflow -fstack-protector-all'
       --extra-ldflags='-L/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/lib -Wl,-z,relro -Wl,-z,now -pie'
       --extra-libs='-lpng -lexpat -lm'
       --extra-cxxflags=  
           libavutil    55. 17.103 / 55. 17.103  
           libavcodec    57. 24.102 / 57. 24.102
           libavformat    57. 25.100 / 57. 25.100  
           libavdevice    57.  0.101 / 57.  0.101  
           libavfilter    6. 31.100 /  6. 31.100  
           libswscale      4.  0.100 /  4.  0.100  
           libswresample   2.  0.101 /  2.  0.101  
           libpostproc    54.  0.100 / 54.  0.100
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/storage/emulated/0/DCIM/Yakatak/656.mp4':  Metadata:    major_brand     : mp42    minor_version   : 0    compatible_brands: isommp42    creation_time   : 2019-05-29 11:27:56    location        : +51.5202-000.1435/    location-eng    : +51.5202-000.1435/  Duration: 00:00:09.47, start: 0.000000, bitrate: 12147 kb/s    Stream #0:0(eng): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 1280x720, 11899 kb/s, 30.02 fps, 30 tbr, 90k tbn, 180k tbc (default)    Metadata:      rotate          : 90      creation_time   : 2019-05-29 11:27:56      handler_name    : VideoHandle    Side data:      displaymatrix: rotation of -90.00 degrees    Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 256 kb/s (default)    Metadata:      creation_time   : 2019-05-29 11:27:56      handler_name    : SoundHandle[libx264 @ 0xb5428800] using cpu capabilities: none![libx264 @ 0xb5428800] profile Constrained Baseline, level 3.1[libx264 @ 0xb5428800] 264 - core 148 - H.264/MPEG-4 AVC codec - Copyleft 2003-2015 - http://www.videolan.org/x264.html - options: cabac=0 ref=1 deblock=0:0:0 analyse=0:0 me=dia subme=0 psy=1 psy_rd=1.00:0.00 mixed_ref=0 me_range=16 chroma_me=1 trellis=0 8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=0 threads=6 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=0 weightp=0 keyint=250 keyint_min=25 scenecut=0 intra_refresh=0 rc=crf mbtree=0 crf=32.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=0

    Output #0, mp4, to '/storage/emulated/0/DCIM/Yakatak/uploadFile.mp4':  Metadata:    major_brand     : mp42    minor_version   : 0    compatible_brands: isommp42    location-eng    : +51.5202-000.1435/    location        : +51.5202-000.1435/    encoder         : Lavf57.25.100    Stream #0:0(eng): Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 720x1280, q=-1--1, 30 fps, 15360 tbn, 30 tbc (default)    Metadata:      handler_name    : VideoHandle      creation_time   : 2019-05-29 11:27:56      encoder         : Lavc57.24.102 libx264    Side data:      unknown side data type 10 (24 bytes)    Stream #0:1(eng): Audio: aac (LC) ([64][0][0][0] / 0x0040), 48000 Hz, stereo, fltp, 128 kb/s (default)    Metadata:      creation_time   : 2019-05-29 11:27:56      handler_name    : SoundHandle      encoder         : Lavc57.24.102 aacStream mapping:  Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))  Stream #0:1 -> #0:1 (aac (native) -> aac (native))Press [q] to stop, [?] for helpframe=    0 fps=0.0
  • JavaCV/FFmpeg causes crash only on Lollipop

    13 novembre 2015, par WeirdHat

    I get reports of this crash from users of my app on Galaxy Note devices running Android Lollipop (might happen on other devices but the majority of my users have Galaxy Note because it’s a drawing app). Below is the relevant code from my ASyncTask which exports a series of images (plus audio) to a video file using JavaCV/FFmpeg, and the stack trace from the reported crash. It works fine on my Note 8.0 running KitKat (there’s no Lollipop update available for that device), and works fine in Lollipop on the emulator, so I’m having a hard time tracking down the cause and don’t know what to do.

    @Override
    protected String doInBackground(final File... params) {
       FFmpegFrameRecorder recorder = new FFmpegFrameRecorder(params[0],canvas_width,canvas_height, 0);
       FrameGrabber audiograbber = null;
       if(audio!=null) audiograbber = new FFmpegFrameGrabber(audio);
       Frame audioframe;
       Frame image;
       AndroidFrameConverter converter = new AndroidFrameConverter();

       try {
           recorder.setVideoCodec(avcodec.AV_CODEC_ID_H264);
           recorder.setFrameRate(framerate);
           recorder.setPixelFormat(0);
           if(audio!=null) {
               audiograbber.setFrameRate(framerate);
               audiograbber.start();
               recorder.setAudioChannels(audiograbber.getAudioChannels());
               recorder.setSampleRate(audiograbber.getSampleRate());
           }
           recorder.start();

           Bitmap drawframe = createBitmap(canvas_width, canvas_height, Bitmap.Config.ARGB_8888);
           Canvas c = new Canvas(drawframe);
           Paint p = new Paint();

           for(int frame=0; frame/code to draw image

               image = converter.convert(drawframe);
               recorder.record(image);
           }

           if(isCancelled()) {
               bgbitmap.recycle();
               drawframe.recycle();
               return "Cancelled";
           }

           if(audio!=null) {
               while((audioframe = audiograbber.grabFrame()) != null) {
                   recorder.record(audioframe);
               }
           }

           recorder.stop();
           bgbitmap.recycle();
           drawframe.recycle();
           if(audio!=null) audiograbber.stop();
           return "Saved "+params[0];
       } catch (Exception e) {
           e.printStackTrace();
       }
       return "Failed";
    }

    -

    *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
    Build fingerprint: 'samsung/treltexx/trelte:5.1.1/LMY47X/N910CXXU1COH4:user/release-keys'
    Revision: '21'
    ABI: 'arm'
    pid: 12039, tid: 12053, name: GCDaemon  >>> com.weirdhat.roughanimator &lt;&lt;&lt;
    signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
    Abort message: 'sart/runtime/gc/collector/mark_sweep.cc:381] Can't mark invalid object'
       r0 00000000  r1 00002f15  r2 00000006  r3 00000000
       r4 b366bdb8  r5 00000006  r6 00000002  r7 0000010c
       r8 00000001  r9 b446f550  sl b4429000  fp 9a975c60
       ip 00002f15  sp b366b008  lr b6db9cb9  pc b6ddd3ac  cpsr 60070010

    backtrace:
       #00 pc 0003b3ac  /system/lib/libc.so (tgkill+12)
       #01 pc 00017cb5  /system/lib/libc.so (pthread_kill+52)
       #02 pc 000188c7  /system/lib/libc.so (raise+10)
       #03 pc 00015165  /system/lib/libc.so (__libc_android_abort+36)
       #04 pc 00012fac  /system/lib/libc.so (abort+4)
       #05 pc 00242f17  /system/lib/libart.so (art::Runtime::Abort()+170)
       #06 pc 000ad991  /system/lib/libart.so (art::LogMessage::~LogMessage()+1360)
       #07 pc 0013ec53  /system/lib/libart.so (bool art::gc::accounting::HeapBitmap::AtomicTestAndSet(art::mirror::Object const*, art::gc::collector::MarkSweepMarkObjectSlowPath const&amp;)+422)
       #08 pc 0013ed27  /system/lib/libart.so (art::gc::collector::MarkSweep::MarkObjectParallel(art::mirror::Object const*)+142)
       #09 pc 0013ff23  /system/lib/libart.so (art::gc::collector::MarkSweep::MarkRootParallelCallback(art::mirror::Object**, void*, art::RootInfo const&amp;)+26)
       #10 pc 0025893d  /system/lib/libart.so (art::ReferenceMapVisitor::VisitQuickFrame()+1024)
       #11 pc 00258cad  /system/lib/libart.so (art::ReferenceMapVisitor::VisitFrame()+224)
       #12 pc 0024c8e9  /system/lib/libart.so (art::StackVisitor::WalkStack(bool)+276)
       #13 pc 0024e617  /system/lib/libart.so (art::Thread::VisitRoots(void (*)(art::mirror::Object**, void*, art::RootInfo const&amp;), void*)+994)
       #14 pc 0013ef9f  /system/lib/libart.so (art::gc::collector::CheckpointMarkThreadRoots::Run(art::Thread*)+126)
       #15 pc 0025b44d  /system/lib/libart.so (art::ThreadList::RunCheckpoint(art::Closure*)+296)
       #16 pc 0013dc0d  /system/lib/libart.so (art::gc::collector::MarkSweep::MarkRootsCheckpoint(art::Thread*, bool)+96)
       #17 pc 0014165d  /system/lib/libart.so (art::gc::collector::MarkSweep::PreCleanCards()+172)
       #18 pc 001417d3  /system/lib/libart.so (art::gc::collector::MarkSweep::MarkingPhase()+126)
       #19 pc 001418b9  /system/lib/libart.so (art::gc::collector::MarkSweep::RunPhases()+176)
       #20 pc 00138527  /system/lib/libart.so (art::gc::collector::GarbageCollector::Run(art::gc::GcCause, bool)+246)
       #21 pc 0015865b  /system/lib/libart.so (art::gc::Heap::CollectGarbageInternal(art::gc::collector::GcType, art::gc::GcCause, bool)+1426)
       #22 pc 00159af5  /system/lib/libart.so (art::gc::Heap::ConcurrentGC(art::Thread*)+56)
       #23 pc 000003ef  /system/framework/arm/boot.oat