Recherche avancée

Médias (0)

Mot : - Tags -/signalement

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

Autres articles (66)

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

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

  • Gestion de la ferme

    2 mars 2010, par

    La ferme est gérée dans son ensemble par des "super admins".
    Certains réglages peuvent être fais afin de réguler les besoins des différents canaux.
    Dans un premier temps il utilise le plugin "Gestion de mutualisation"

Sur d’autres sites (6244)

  • Rotate Video- Could not write header for output file #0 (incorrect codec parameters ?)

    26 août 2018, par varmashrivastava

    I am using below command to rotate video-

    {"-y", "-ss", "" + startMs / 1000, "-t", "" + (endMs - startMs) / 1000, "-i", inputPath, "-vf", "transpose=" + type,"-c:a", "copy", outputPath}

    I am getting below failure message in Android Oreo-

    "ffmpeg version n3.0.1 Copyright (c) 2000-2016 the FFmpeg developers\n
    built with gcc 4.8 (GCC)\n 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=\n libavutil 55. 17.103 / 55. 17.103\n libavcodec 57. 24.102 / 57. 24.102\n libavformat 57. 25.100 /
    57. 25.100\n libavdevice 57. 0.101 / 57. 0.101\n libavfilter 6. 31.100 / 6. 31.100\n libswscale 4. 0.100 / 4. 0.100\n libswresample 2. 0.101 / 2. 0.101\n libpostproc 54. 0.100 /
    54. 0.100\nInput #0, mov,mp4,m4a,3gp,3g2,mj2, from ’/storage/emulated/0/Download/dolbycanyon.3gp’ :\n Metadata :\n
    major_brand : 3gp4\n minor_version : 512\n
    compatible_brands : isomiso23gp4\n Duration : 00:00:38.07, start :
    0.006250, bitrate : 402 kb/s\n Stream #0:0(und) : Video : h263 (s263 / 0x33363273), yuv420p, 704x576 [SAR 12:11 DAR 4:3], 384 kb/s, 29.97
    fps, 29.97 tbr, 30k tbn, 29.97 tbc (default)\n Metadata :\n
    handler_name : VideoHandler\n Stream #0:1(und) : Audio : amr_nb
    (samr / 0x726D6173), 8000 Hz, mono, flt, 12 kb/s (default)\n
    Metadata :\n handler_name : SoundHandler\n[libx264 @
    0xf64e5400] using SAR=11/12\n[libx264 @ 0xf64e5400] using cpu
    capabilities : none !\n[libx264 @ 0xf64e5400] profile High, level
    3.1\n[libx264 @ 0xf64e5400] 264 - core 148 - H.264/MPEG-4 AVC codec - Copyleft 2003-2015 - http://www.videolan.org/x264.html - options :
    cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1
    psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1
    8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2
    threads=12 lookahead_threads=2 sliced_threads=0 nr=0 decimate=1
    interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2
    b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250
    keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf
    mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40
    aq=1:1.00\n[mp4 @ 0xf64a8600] Could not find tag for codec amr_nb in
    stream #1, codec not currently supported in container\nOutput #0, mp4,
    to ’/storage/emulated/0/Movies/rotate_video4.mp4’ :\n Metadata :\n
    major_brand : 3gp4\n minor_version : 512\n
    compatible_brands : isomiso23gp4\n encoder : Lavf57.25.100\n
    Stream #0:0(und) : Video : h264 (libx264) ([33][0][0][0] / 0x0021),
    yuv420p, 576x704 [SAR 11:12 DAR 3:4], q=-1—1, 29.97 fps, 30k tbn,
    29.97 tbc (default)\n Metadata :\n handler_name : VideoHandler\n encoder : Lavc57.24.102 libx264\n Side
    data :\n unknown side data type 10 (24 bytes)\n Stream
    0:1(und) : Audio : amr_nb (samr / 0x726D6173), 8000 Hz, mono, 12 kb/s (default)\n Metadata :\n handler_name : SoundHandler\nStream
    mapping :\n Stream #0:0 -> #0:0 (h263 (native) -> h264 (libx264))\n
    Stream #0:1 -> #0:1 (copy)\nCould not write header for output file #0
    (incorrect codec parameters ?) : Invalid argument\n"

    Why am i getting this error and how can i resolve it ?

  • Code runs when in a main method but not when in another method

    8 août 2018, par Zubair Ahmed

    I created the setArtwork method to set the artwork of an aac file in an .m4a container and it does exactly what I want it to when I run the main method

    public static void setArtwork(File art, File m4a) throws Exception{
       Mp4TagReader reader = new Mp4TagReader();
       Mp4TagWriter writer = new Mp4TagWriter();
       RandomAccessFile song = new RandomAccessFile(m4a.toString(),"rw");
       Mp4Tag mp4tag = reader.read(song);

       Artwork artwork = ArtworkFactory.createArtworkFromFile(art);
       mp4tag.addField(artwork);
       mp4tag.setField(artwork);

       RandomAccessFile temp = new RandomAccessFile(m4a,"rw");
       writer.write(mp4tag,song,temp);
    }
    public static void main(String[] args) throws Exception{
       File art = new File("C:\\Users\\Zubair\\Documents\\music\\coverArt.jpeg");
       File m4a = new File("C:\\Users\\Zubair\\Documents\\music\\song.m4a");
       setArtwork(art,m4a);
    }

    BUT, when I try to use the setArtwork method in a different method in a different class it doesn’t actually save the mp4 tag to the File. I did some debugging to see if the picture was even being added to the artwork tag and it all looks good, but it seems that the tag doesn’t get written to the file.

    public static void mp3Tom4a(File mp3File, File m4aFolder, File coverArt) throws Exception {
       String input = mp3File.toString();
       String name = mp3File.getName();

       String output = name.substring(0,name.indexOf(MP3)) + M4A;
       output = m4aFolder.toString() + "\\" + output;

       //cd ffmpeg\bin && ffmpeg -y -i input.mp3 -an -vcodec copy cover.jpg && ffmpeg -y -i input.mp3 -c:a aac -b:a 192k -vn output.m4a
       ProcessBuilder builder = new ProcessBuilder(
               "cmd.exe","/c","cd ffmpeg\\bin && ffmpeg -y -i "
               + input +" -an -vcodec copy "+coverArt+
               " && ffmpeg -y -i " + input + " -c:a aac -b:a 128k -vn " + output);
       builder.redirectErrorStream(true);
       builder.start();
       JAudioData.setArtwork(coverArt,new File(output));
    }
    public static void main(String[] args) throws Exception {
       mp3Tom4a(new File("C:\\Users\\Zubair\\Documents\\music\\song.mp3"),
               new File("C:\\Users\\Zubair\\Documents\\music"),
               new File("C:\\Users\\Zubair\\Documents\\music\\coverArt.jpeg"));
    }

    it doesn’t make sense that setArtwork only works when it’s in the main method of its own class, especially because the objects I am using for the parameters are identical to eachother, so there should be no difference in the result. I think it might have something to do with the RandomAccessFile object being updated but the physical storage not getting updated

    Edit- If I comment out builder.start() then it can successfully write the mp4tag to the m4a file. But I don’t see why having builder.start() would prevent that from happenning. My best guess is that because builder.start() is what creates song.m4a it is still being "edited" by that and can’t be edited by any other processes.

  • Adding watermark bitmap over video in android : 4.3's MediaMuxer or ffmpeg

    24 novembre 2018, par Alin

    Here is my scenario :

    • Download an avi movie from the web
    • Open a bitmap resource
    • Overlay this bitmap at the bottom of the movie on all frames in the background
    • Save the video on extarnal storage
    • The video length is 15 seconds usually

    Is this possible to achieve using MediaMuxer ? Any info on the matter is gladly received

    I’ve been looking to http://bigflake.com/mediacodec/#DecodeEditEncodeTest (Thanks @fadden) and it says there :

    "Decoding the frame and copying it into a ByteBuffer with
    glReadPixels() takes about 8ms on the Nexus 5, easily fast enough to
    keep pace with 30fps input, but the additional steps required to save
    it to disk as a PNG are expensive (about half a second)"

    So having almost 1 sec/frame is not acceptable. From what I am thinking one way would be to save each frame as PNG, open it, add the bitmap overlay on it and then save it. However this would take an enormous time to accomplish.

    I wonder if there is a way to do things like this :

    1. Open video file from external storage
    2. Start decoding it
    3. Each decoded frame will be altered with the bitmap overlay in memory
    4. The frame is sent to an encoder.

    On iOS I saw that there a way to take the original audio + original video + an image and add them in a container and then just encode the whole thing...

    Should I switch to ffmpeg ? How stable and compatible is ffmpeg ? Am I risking compatibility issues with android 4.0+ devices ? Is there a way to use ffmpeg to acomplish this ? I am new to this domain and still doing research.


    Years later edit :
    Years have passed since the question and ffmpeg isn’t really easy to add to a commercial software in terms of license. How did this evolved ? Newer versions of android are more capable on this with the default sdk ?


    Some more time later edit

    I got some negative votes for posting info as an answer so I’ll edit the original question. Here is a great library which, from my testing does apply watermark to video and does it with progress callback making it a lot easier to show progress to the user and also uses the default android sdks. https://github.com/MasayukiSuda/Mp4Composer-android

    This library generate an Mp4 movie using Android MediaCodec API and apply filter, scale, and rotate Mp4.

    Sample code, could look like :

    new mp4Composer(sourcePath, destinationPath)
           .filter(new GlWatermarkFilter(watermarkBitmap)
           .listener(){
                 @Override
                 private void onProgress(double value){}

                 @Override
                 private void onCompleted(double value){
                     runOnUiThread( () ->{
                        showSneakbar
                     }
                 }

                 @Override
                 private void onCancelled(double value){}

                 @Override
                 private void onFailed(Exception e){}

           }).start();

    Testing on emulator, seems to work fine on android 8+ while on older generates a black video file.However, when testing on real device seems to work.