Recherche avancée

Médias (1)

Mot : - Tags -/biomaping

Autres articles (8)

  • Menus personnalisés

    14 novembre 2010, par

    MediaSPIP utilise le plugin Menus pour gérer plusieurs menus configurables pour la navigation.
    Cela permet de laisser aux administrateurs de canaux la possibilité de configurer finement ces menus.
    Menus créés à l’initialisation du site
    Par défaut trois menus sont créés automatiquement à l’initialisation du site : Le menu principal ; Identifiant : barrenav ; Ce menu s’insère en général en haut de la page après le bloc d’entête, son identifiant le rend compatible avec les squelettes basés sur Zpip ; (...)

  • Le plugin : Podcasts.

    14 juillet 2010, par

    Le problème du podcasting est à nouveau un problème révélateur de la normalisation des transports de données sur Internet.
    Deux formats intéressants existent : Celui développé par Apple, très axé sur l’utilisation d’iTunes dont la SPEC est ici ; Le format "Media RSS Module" qui est plus "libre" notamment soutenu par Yahoo et le logiciel Miro ;
    Types de fichiers supportés dans les flux
    Le format d’Apple n’autorise que les formats suivants dans ses flux : .mp3 audio/mpeg .m4a audio/x-m4a .mp4 (...)

  • Mise à disposition des fichiers

    14 avril 2011, par

    Par défaut, lors de son initialisation, MediaSPIP ne permet pas aux visiteurs de télécharger les fichiers qu’ils soient originaux ou le résultat de leur transformation ou encodage. Il permet uniquement de les visualiser.
    Cependant, il est possible et facile d’autoriser les visiteurs à avoir accès à ces documents et ce sous différentes formes.
    Tout cela se passe dans la page de configuration du squelette. Il vous faut aller dans l’espace d’administration du canal, et choisir dans la navigation (...)

Sur d’autres sites (4672)

  • 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 <<<
    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&)+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&)+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&), 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
  • How to add subtitles using FFmpeg-kit ?

    17 novembre 2024, par Mohammed Bekele

    I'm running a Flutter app with Ffmpeg-kit package to burn a subtitle on a video. I have a words list with the timings and map that to generate an srt and ass file, but when executing this it didn't work.

    


    Firstly, here is how I generated the Ass file.

    


    Future<string> _createAssFile() async {&#xA;    String filePath = await getAssOutputFilePath();&#xA;&#xA;    final file = File(filePath);&#xA;    final buffer = StringBuffer();&#xA;&#xA;    // Write ASS headers&#xA;    buffer.writeln(&#x27;[Script Info]&#x27;);&#xA;    buffer.writeln(&#x27;Title: Generated ASS&#x27;);&#xA;    buffer.writeln(&#x27;ScriptType: v4.00&#x2B;&#x27;);&#xA;    buffer.writeln(&#x27;Collisions: Normal&#x27;);&#xA;    buffer.writeln(&#x27;PlayDepth: 0&#x27;);&#xA;    buffer.writeln(&#x27;Timer: 100,0000&#x27;);&#xA;    buffer.writeln(&#x27;[V4&#x2B; Styles]&#x27;);&#xA;    buffer.writeln(&#xA;        &#x27;Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, OutlineColour, BackColour, Bold, Italic, Underline, StrikeOut, ScaleX, ScaleY, Spacing, Angle, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, Encoding&#x27;);&#xA;    buffer.writeln(&#xA;        &#x27;Style: Default,Arial,40,&amp;H00FFFFFF,&amp;H000000FF,&amp;H00000000,&amp;H80000000,1,1,1,1,100,100,0,0,1,1,1,2,10,10,10,1&#x27;);&#xA;    buffer.writeln(&#x27;[Events]&#x27;);&#xA;    buffer.writeln(&#xA;        &#x27;Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text&#x27;);&#xA;&#xA;    // Write events (subtitles)&#xA;    for (int i = 0; i &lt; widget.words.length; i&#x2B;&#x2B;) {&#xA;      final word = widget.words[i];&#xA;      final startTime = _formatAssTime(word[&#x27;startTime&#x27;].toDouble());&#xA;      final endTime = _formatAssTime(word[&#x27;endTime&#x27;].toDouble());&#xA;      final text = word[&#x27;word&#x27;];&#xA;&#xA;      buffer.writeln(&#x27;Dialogue: 0,$startTime,$endTime,Default,,0,0,0,,$text&#x27;);&#xA;    }&#xA;&#xA;    await file.writeAsString(buffer.toString());&#xA;    return filePath;&#xA;  }&#xA;&#xA;  String _formatAssTime(double seconds) {&#xA;    final int hours = seconds ~/ 3600;&#xA;    final int minutes = ((seconds % 3600) ~/ 60);&#xA;    final int secs = (seconds % 60).toInt();&#xA;    final int millis = ((seconds - secs) * 1000).toInt() % 1000;&#xA;&#xA;    return &#x27;${hours.toString().padLeft(1, &#x27;0&#x27;)}:${minutes.toString().padLeft(2, &#x27;0&#x27;)}:${secs.toString().padLeft(2, &#x27;0&#x27;)}.${(millis ~/ 10).toString().padLeft(2, &#x27;0&#x27;)}&#x27;;&#xA;  }&#xA;</string>

    &#xA;

    Then I used this command which was the official way of adding ass file to a video.

    &#xA;

      String newCmd = "-i $videoPath -vf ass=$assFilePath -c:a copy $_outputPath";&#xA;

    &#xA;

    Yet when executing this command it did not work. However I changed it to this command

    &#xA;

    String newCmd = "-i $videoPath -i $assFilePath $_outputPath";&#xA;

    &#xA;

    Well, that code works but the styling is not being applied. So I tried yet another command to filter and position the ass file.

    &#xA;

    String newCmd = "-i $videoPath -i $assFilePath -filter_complex \"[0:v][1:s]ass=\\an5:text=&#x27;%{event.text}&#x27;,scale=iw*0.8:ih*0.8,setdar=16/9[outv]\" -map [outv] -c:a copy $_outputPath";&#xA;

    &#xA;

    This made it even worse, because the app crashed when I ran this. Also there is a log for this command before crashing

    &#xA;

    F/libc    (19624): Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x19 in tid 21314 (pool-4-thread-7), pid 19624 (ple.caption_app)&#xA;*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***&#xA;Build fingerprint: &#x27;samsung/a15nsxx/a15:14/UP1A.231005.007/A155FXXU1AWKA:user/release-keys&#x27;&#xA;Revision: &#x27;5&#x27;&#xA;ABI: &#x27;arm64&#x27;&#xA;Processor: &#x27;7&#x27;&#xA;Timestamp: 2024-07-10 19:27:40.812476860&#x2B;0300&#xA;Process uptime: 1746s&#xA;Cmdline: com.example.caption_app&#xA;pid: 19624, tid: 21314, name: pool-4-thread-7  >>> com.example.caption_app &lt;&lt;&lt;&#xA;uid: 10377&#xA;tagged_addr_ctrl: 0000000000000001 (PR_TAGGED_ADDR_ENABLE)&#xA;signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0000000000000019&#xA;Cause: null pointer dereference&#xA;    x0  0000000000000001  x1  b400006ec98d8660  x2  0000000000000000  x3  0000000000000002&#xA;    x4  0000006f62d1ea12  x5  b400006e04f745ea  x6  352f35372f64352f  x7  7f7f7f7f7f7f7f7f&#xA;    x8  632ace36577a905e  x9  632ace36577a905e  x10 0000006e191378c0  x11 0000000000000001&#xA;    x12 0000000000000001  x13 0000000000000000  x14 0000000000000004  x15 0000000000000008&#xA;    x16 0000006e27ffa358  x17 0000006e27dbfb00  x18 0000006e00d48000  x19 0000006f62d1f0e8&#xA;    x20 0000006f62d24000  x21 0000006e27ffc5d0  x22 0000006e27ffc5f0  x23 0000000000000000&#xA;    x24 b400006f3f089248  x25 0000006f62d1f220  x26 b400006f3f057b20  x27 0000000000000002&#xA;    x28 0000000000000088  x29 0000006f62d1f100&#xA;    lr  0000006e27dbfb0c  sp  0000006f62d1f0a0  pc  0000006e27dbfb10  pst 0000000060001000&#xA;1 total frames&#xA;backtrace:&#xA;      #00 pc 0000000000121b10  /data/app/~~oWqjrGA2indQhuEw6u_J2A==/com.example.caption_app-u2Ofk54FVtMc5D-i3SLC6g==/base.apk!libavfilter.so (offset 0x10a46000) (avfilter_inout_free&#x2B;16)    &#xA;Lost connection to device.&#xA;

    &#xA;

    I tried the normal command in my local machine on Windows, and this is what I used

    &#xA;

    ffmpeg -i F:\ffmpeg\video.avi -vf subtitles=&#x27;F\:\\ffmpeg\\caption.srt&#x27;:force_style=&#x27;Fontsize=24&#x27; F:\ffmpeg\new.mp4&#xA;

    &#xA;

    As you can see above when subtitles are used it had an extra backslashes for each path and a pre backslash after the partition letter. But I don't know if this does apply for android devices. How can I make sense of this ?

    &#xA;

  • 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