Recherche avancée

Médias (1)

Mot : - Tags -/Christian Nold

Autres articles (96)

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

  • Publier sur MédiaSpip

    13 juin 2013

    Puis-je poster des contenus à partir d’une tablette Ipad ?
    Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir

Sur d’autres sites (4996)

  • How to combine multiple videos in android using ffmpeg ?

    23 mai 2023, par Haeiny

    I added dependency to use ffmpeg on Android.

    


    implementation "com.arthenica:mobile-ffmpeg-full:4.4"


    


    And I wanted to combine the videos from the gallery, so I temporarily saved the imported video in the cache directory in the app.

    


    After that, I wrote the following function to take the saved images and merge them using ffmpeg :

    


    
fun mergeVideos(videoPaths: List\): Int {
        val cacheDirectory = this.externalCacheDir
        mergedVideoFile = File(cacheDirectory, "merged_video.mp4").absolutePath

        val command = StringBuilder()
        command.append("ffmpeg")
        for (videoPath in videoPaths) {
            command.append(" -i ").append(videoPath)
        }

        command.append(" -filter_complex ").append("\"")
        for (i in videoPaths.indices) {
            command.append("[$i:v] ").append("[$i:a] ")
        }

        command.append("concat=n=").append(videoPaths.size).append(":v=1:a=1 [v] [a]").append("\"")
        command.append(" -map \"[v]\" -map \"[a]\" ").append(mergedVideoFile)
    
        return FFmpeg.execute(command.toString())
    }


    


    I wanted to temporarily save the merged video in the "mergedVideoFile" so that I could save them in the cache directory, and videoPaths would get the Urls of the videos I wanted to merge into the list.

    


    The command verified through Log.d :

    


    
ffmpeg -i /storage/emulated/0/Android/data/"project name"/files/Movies/VIDEO1.mp4 -i /storage/emulated/0/Android/data/"project name"/files/Movies/VIDEO2.mp4 -filter_complex "\[0:v\] \[0:a\] \[1:v\] \[1:a\] concat=n=2:v=1:a=1 \[v\] \[a\]" -map "\[v\]" -map "\[a\]" /storage/emulated/0/Android/data/"project name"/cache/merged_video.mp4


    


    result of mergeVideos execution :

    


    
Loading mobile-ffmpeg.
Loaded mobile-ffmpeg-full-arm64-v8a-4.4-20210207.
Callback thread started.
ffmpeg version v4.4-dev-416
Copyright (c) 2000-2020 the FFmpeg developers
built with Android (6454773 based on r365631c2) clang version 9.0.8 (https://android.googlesource.com/toolchain/llvm-project 98c855489587874b2a325e7a516b99d838599c6f) (based on LLVM 9.0.8svn)

configuration: --cross-prefix=aarch64-linux-android- --sysroot=/files/android-sdk/ndk/21.3.6528147/toolchains/llvm/prebuilt/linux-x86_64/sysroot --prefix=/home/taner/Projects/mobile-ffmpeg/prebuilt/android-arm64/ffmpeg --pkg-config=/usr/bin/pkg-config --enable-version3 --arch=aarch64 --cpu=armv8-a --cc=aarch64-linux-android24-clang --cxx=aarch64-linux-android24-clang++ --extra-libs='-L/home/taner/Projects/mobile-ffmpeg/prebuilt/android-arm64/cpu-features/lib -lndk_compat' --target-os=android --enable-neon --enable-asm --enable-inline-asm --enable-cross-compile --enable-pic --enable-jni --enable-optimizations --enable-swscale --enable-shared --enable-v4l2-m2m --disable-outdev=fbdev --disable-indev=fbdev --enable-small --disable-openssl --disable-xmm-clobber-test --disable-debug --enable-lto --disable-neon-clobber-test --disable-programs --disable-postproc --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --disable-sndio --disable-schannel --disable-securetransport --disable-xlib --disable-cuda --disable-cuvid --disable-nvenc --disable-vaapi --disable-vdpau --disable-videotoolbox --disable-audiotoolbox --disable-appkit --disable-alsa --disable-cuda --disable-cuvid --disable-nvenc --disable-vaapi --disable-vdpau --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-gmp --enable-gnutls --enable-libmp3lame --enable-libass --enable-iconv --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libxml2 --enable-libopencore-amrnb --enable-libshine --enable-libspeex --enable-libwavpack --enable-libkvazaar --enable-libilbc --enable-libopus --enable-libsnappy --enable-libsoxr --enable-libaom --enable-libtwolame --disable-sdl2 --enable-libvo-amrwbenc --enable-zlib --enable-mediacodec

libavutil      56. 55.100 / 56. 55.100
libavcodec     58. 96.100 / 58. 96.100
libavformat    58. 48.100 / 58. 48.100
libavdevice    58. 11.101 / 58. 11.101
libavfilter     7. 87.100 /  7. 87.100
libswscale      5.  8.100 /  5.  8.100
libswresample   3.  8.100 /  3.  8.100

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/storage/emulated/0/Android/data/"project name"/files/Movies/VIDEO1.mp4':

Metadata:
major_brand     :   mp42
minor_version   :   0
compatible_brands:  isommp42
creation_time   :   2023-05-02T12:22:45.000000Z
com.android.version:  11
com.android.capture.fps:  30.000000
Duration:  00:00:02.51  , start:   0.000000  , bitrate:  14232 kb/s

      Stream #0:0

(eng)
: Video: h264 (avc1 / 0x31637661), yuv420p(tv, bt709), 1920x1080, 14022 kb/s
, SAR 1:1 DAR 16:9 ,  30 fps, 30 tbr,  90k tbn,  180k tbc   (default)

Metadata:
rotate          :  90
creation_time   : 2023-05-02T12:22:45.000000Z
handler_name    :  VideoHandle
Side data:
displaymatrix: rotation of -90.00 degrees

      Stream #0:1

(eng)
: Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 256 kb/s   (default)

     Metadata:
        creation_time   :   2023-05-02T12:22:45.000000Z
        handler_name    :   SoundHandle

Input #1, mov,mp4,m4a,3gp,3g2,mj2, from '/storage/emulated/0/Android/data/"project name"/files/Movies/VIDEO2.mp4':

... Input #1's video metadatas ...

\[NULL @ 0x78367662e0\] Unable to find a suitable output format for 'ffmpeg'
ffmpeg: Invalid argument


    


    I don't know what is the problem in my code.
Please help me.

    


  • Error setting option use_wallclock_as_timestamps to value 1 in FFmpegFrameGrabber - avformat_open_input() error -22

    29 mai 2023, par githubwyj

    avformat_open_input() error -22 Error setting option

    


    FFmpegFrameGrabber grabber = new FFmpegFrameGrabber("rtsp://xxxxx");
grabber.setOption("use_wallclock_as_timestamps", "1");
grabber.setOption("rtsp_transport", "tcp");
grabber.setOption("rtsp_flags", "prefer_tcp");

grabber.start();


    


    I used ffmpeg in JavaCV to pull rtsp streams, but there was an error like this

    


    Error: [rtsp @ 0x7f2770145a60] Invalid option type.

Error: [rtsp @ 0x7f2770145a60] Error setting option use_wallclock_as_timestamps to value 1.

Error: [rtsp @ 0x7f2770145a60] Invalid option type.

Error: [rtsp @ 0x7f2770145a60] Error setting option use_wallclock_as_timestamps to value 1.

org.bytedeco.javacv.FFmpegFrameGrabber$Exception: avformat_open_input() error -22: Could not open input "rtsp://xxxx@10.10.10.119:554/video/1". (Has setFormat() been called?) (For more details, make sure FFmpegLogCallback.set() has been called.)
        at org.bytedeco.javacv.FFmpegFrameGrabber.startUnsafe(FFmpegFrameGrabber.java:975)
        at org.bytedeco.javacv.FFmpegFrameGrabber.start(FFmpegFrameGrabber.java:903)
        at org.bytedeco.javacv.FFmpegFrameGrabber.start(FFmpegFrameGrabber.java:898)




    


    When I removed grabber.setOption("use_wallclock_as_timestamps", "1");, the following error occurred:

    


    2023-05-29 11:11:02.169 [pool-2-thread-9] ERROR [FFmpegLogCallback:54] - [RTSP demuxer @ 0x7f2b8c007240] [Eval @ 0x7f2b32790080] Undefined constant or missing '(' in 'prefer_tcp'

2023-05-29 11:11:02.169 [pool-2-thread-9] ERROR [FFmpegLogCallback:54] - [RTSP demuxer @ 0x7f2b8c007240] Unable to parse option value "prefer_tcp"

2023-05-29 11:11:02.170 [pool-2-thread-9] ERROR [FFmpegLogCallback:54] - [RTSP demuxer @ 0x7f2b8c007240] Error setting option rtsp_flags to value prefer_tcp.

2023-05-29 11:11:02.170 [pool-2-thread-9] ERROR [FFmpegLogCallback:54] - [RTSP demuxer @ 0x7f2b8c007240] [Eval @ 0x7f2b32790080] Undefined constant or missing '(' in 'prefer_tcp'

2023-05-29 11:11:02.170 [pool-2-thread-9] ERROR [FFmpegLogCallback:54] - [RTSP demuxer @ 0x7f2b8c007240] Unable to parse option value "prefer_tcp"

2023-05-29 11:11:02.170 [pool-2-thread-9] ERROR [FFmpegLogCallback:54] - [RTSP demuxer @ 0x7f2b8c007240] Error setting option rtsp_flags to value prefer_tcp.



org.bytedeco.javacv.FFmpegFrameGrabber$Exception: avformat_open_input() error -22: Could not open input "rtsp://xxxx@10.10.10.119:554/video/1". (Has setFormat() been called?) (For more details, make sure FFmpegLogCallback.set() has been called.)
        at org.bytedeco.javacv.FFmpegFrameGrabber.startUnsafe(FFmpegFrameGrabber.java:975)
        at org.bytedeco.javacv.FFmpegFrameGrabber.start(FFmpegFrameGrabber.java:903)
        at org.bytedeco.javacv.FFmpegFrameGrabber.start(FFmpegFrameGrabber.java:898)



    


    javacv&ffmpeg :

    


    'org.bytedeco:javacv-platform:1.5.8',
'org.bytedeco:ffmpeg-platform:5.1.2-1.5.8',


    


  • The latest ffmpeg shows "get_buffer() failed". Is this a bug ?

    20 juin 2023, par Ryan

    ffmpeg version 2023-06-19-git-1617d1a752-full_build-www.gyan.dev

    


    i7-1255U, Windows 11

    


    The command line is

    


    "ffmpeg.exe"  -y  -hwaccel qsv  -ss 00:00:03.461  -to 00:00:12.009  -i "input.mov"   -c:v h264_qsv -global_quality 25 -look_ahead 1 -preset veryslow -c:a aac -ar 48000 -ac 2 -ab 128k output.mp4


    


    The "input.mov" is mjpeg.

    


    The result is :

    


    [mjpeg_qsv @ 0000019930260080] get_buffer() failed
[vist#0:0/mjpeg @ 000001993025ff00] Error submitting packet to decoder: Cannot allocate memory
[mjpeg_qsv @ 0000019930260080] get_buffer() failed
[vist#0:0/mjpeg @ 000001993025ff00] Error submitting packet to decoder: Cannot allocate memory
[mjpeg_qsv @ 0000019930260080] get_buffer() failed
[vist#0:0/mjpeg @ 000001993025ff00] Error submitting packet to decoder: Cannot allocate memory
[mjpeg_qsv @ 0000019930260080] get_buffer() failed
[vist#0:0/mjpeg @ 000001993025ff00] Error submitting packet to decoder: Cannot allocate memory
[mjpeg_qsv @ 0000019930260080] get_buffer() failed
[vist#0:0/mjpeg @ 000001993025ff00] Error submitting packet to decoder: Cannot allocate memory


    


    The messages above repeats many many many times. Finally, it shows :

    


    [vist#0:0/mjpeg @ 000001993025ff00] Error submitting EOF to decoder: Cannot allocate memory


    


    I tried the same command line on a very old version, and it works fine. Is this a bug or there is something new that comes with the new version ?

    


    Thank you for your help.