Recherche avancée

Médias (2)

Mot : - Tags -/media

Autres articles (58)

  • Websites made ​​with MediaSPIP

    2 mai 2011, par

    This page lists some websites based on MediaSPIP.

  • Gestion générale des documents

    13 mai 2011, par

    MédiaSPIP ne modifie jamais le document original mis en ligne.
    Pour chaque document mis en ligne il effectue deux opérations successives : la création d’une version supplémentaire qui peut être facilement consultée en ligne tout en laissant l’original téléchargeable dans le cas où le document original ne peut être lu dans un navigateur Internet ; la récupération des métadonnées du document original pour illustrer textuellement le fichier ;
    Les tableaux ci-dessous expliquent ce que peut faire MédiaSPIP (...)

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

  • Why JPEG compressing an uncompressed image differs its original (FFmpeg, NvJPEG, ...)

    22 juin 2021, par Fruchtzwerg

    I am currently struggling to understand why recompressing an uncompressed JPEG image differs its original.

    


    It's clear, that JPEG is a lossy compression, but what if the image to compress is already uncompressed, which means all sampling losses are already included ? In other words : Downsampling and DCT should be inversable at this point without loosing data.

    


    JPEG algorithm

    


    To make sure losses are not effected by the color space conversion, this step is skipped and YUV images are used.

    


      

    1. Compress YUV image to JPEG (image.yuv —> image.yuv.jpg)
    2. 


    3. Uncompress JPEG image to YUV image (image.yuv.jpg —> image.yuv.jpg.yuv)
    4. 


    5. Compress YUV image to JPEG (image.yuv.jpg.yuv —> image.yuv.jpg.yuv.jpg)
    6. 


    7. Uncompress JPEG image to YUV image (image.yuv.jpg.yuv.jpg —> image.yuv.jpg.yuv.jpg.yuv)
    8. 


    


    Step 1 includes a lossy compression, so we will not deal with this step anymore. For me, intresting is what happens afterwards :

    


    Uncompressing the JPEG image back to YUV (step 2) leads to an image which perfectly fits all sampling steps if compressed again (step 3). So the JPEG image after step 3 should (from my understanding) be exactly the same as after step 1. Also the YUV images after step 4 and step 2 should equal each other.

    


    Looking at the steps for one 8x8 block the following simplified sequence should illustrate what I am trying to descibe. Lets start with the original YUV image, which can only be decompressed loosing all decimal places :

    


    [ 1.123, 2.345, 3.456, ... ]    (YUV)
    DTC + Quantization
[ -26, -3, -6, ... ]            (Quantized frequency space)
    Inverse DTC + Quantization
[ 1, 2, 3, ... ]                (YUV)


    


    Doing this with input, which already matches all steps, which may lead to loss of data afterwards (using round numbers in my example), the decompressed image should match its original :

    


    [ 1, 2, 3, ... ]                (YUV)
    DTC + Quantization
[ -26, -3, -6, ... ]            (Quantized frequency space)
    Inverse DTC + Quantization
[ 1, 2, 3, ... ]                (YUV)


    


    There are also some sources and discussions, which are confirming my idea :

    


    


    So much for theory. In praxis, I've runned these steps using ffmpeg and Nvidias jpeg samples (using NvJPEGEncoder).

    


    ffmpeg :

    


    #Create YUV image
ffmpeg -y -i image.jpg -s 1920x1080 -pix_fmt yuv420p image.yuv
#YUV to JPEG
ffmpeg -y -s 1920x1080 -pix_fmt yuv420p -i image.yuv image.yuv.jpg
#JPEG TO YUV
ffmpeg -y -i image.yuv.jpg -s 1920x1080 -pix_fmt yuv420p image.yuv.jpg.yuv
#YUV to JPEG
ffmpeg -y -s 1920x1080 -pix_fmt yuv420p -i image.yuv.jpg.yuv image.yuv.jpg.yuv.jpg
#JPEG TO YUV
ffmpeg -y -i image.yuv.jpg.yuv.jpg -s 1920x1080 -pix_fmt yuv420p image.yuv.jpg.yuv.jpg.yuv
#YUV to JPEG
ffmpeg -y -s 1920x1080 -pix_fmt yuv420p -i image.yuv.jpg.yuv.jpg.yuv image.yuv.jpg.yuv.jpg.yuv.jpg


    


    Nvidia :

    


    #Create YUV image
./jpeg_decode num_files 1 image.jpg image.yuv
#YUV to JPEG
./jpeg_encode image.yuv 1920 1080 image.yuv.jpg
#JPEG TO YUV
./jpeg_decode num_files 1 image.yuv.jpg image.yuv.jpg.yuv
#YUV to JPEG
./jpeg_encode image.yuv.jpg.yuv 1920 1080 image.yuv.jpg.yuv.jpg
#JPEG TO YUV
./jpeg_decode num_files 1 image.yuv.jpg.yuv.jpg image.yuv.jpg.yuv.jpg.yuv
#YUV to JPEG
./jpeg_encode image.yuv.jpg.yuv.jpg.yuv 1920 1080 image.yuv.jpg.yuv.jpg.yuv.jpg


    


    But a comparison of the images

    


      

    • image.yuv.jpg.yuv and image.yuv.jpg.yuv.jpg.yuv
    • 


    • image.yuv.jpg.yuv.jpg and image.yuv.jpg.yuv.jpg.yuv.jpg
    • 


    


    showing differences in the files. That brings me to my question why and where the difference gets happen, since from my understanding the files should be equal.

    


  • FFmpeg error while adding watermark : Not overwriting - exiting

    10 août 2021, par Ryan Wang

    I'm implementing a video editing feature on my Flutter App using the Flutter-FFmpeg package, [Adding watermarks on video] specifically, while executing the code I got this error :

    


    E/mobile-ffmpeg( 5731): Not overwriting - exiting
D/flutter-ffmpeg( 5731): FFmpeg exited with rc: 1


    


    Most importantly, the output file cannot be played by the VideoPlayer. And it just LOADS FOREVER, the VideoController Widget shows that the player is buffering. I've tested My VideoPlayer widget, and it works very well on the videos that were not processed.

    


    Here's the code I'm using :

    


        await FlutterFFmpeg().execute(
        '-i video.mp4 -i logo.png -filter_complex [0:v][1:v]overlay=5:5 -c:a copy -movflags +faststart output.mp4'
    );


    


    A full log of the executing process in case it helps :

    


    D/flutter-ffmpeg( 5731): Running FFmpeg with arguments: [-i, /data/user/0/com.raheyo.cheese/cache/REC5995709221575585296.mp4, -i, /data/user/0/com.raheyo.cheese/cache/e0baa6a8-4d4c-407a-a73e-be4dcf4d08fd.mp4, -filter_complex, [0:v][1:v]overlay=5:5, -c:a, copy, -movflags, +faststart, /data/user/0/com.raheyo.cheese/cache/e0baa6a8-4d4c-407a-a73e-be4dcf4d08fd.mp4].
I/mobile-ffmpeg( 5731): Loading mobile-ffmpeg.
I/mobile-ffmpeg( 5731): Loaded mobile-ffmpeg-full-arm64-v8a-4.4-20200725.
D/mobile-ffmpeg( 5731): Callback thread started.
I/mobile-ffmpeg( 5731): ffmpeg version v4.4-dev-416
I/mobile-ffmpeg( 5731):  Copyright (c) 2000-2020 the FFmpeg developers
I/mobile-ffmpeg( 5731):
I/mobile-ffmpeg( 5731):   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)
I/mobile-ffmpeg( 5731):   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
I/mobile-ffmpeg( 5731):   libavutil      56. 55.100 / 56. 55.100
I/mobile-ffmpeg( 5731):   libavcodec     58. 96.100 / 58. 96.100
I/mobile-ffmpeg( 5731):   libavformat    58. 48.100 / 58. 48.100
I/mobile-ffmpeg( 5731):   libavdevice    58. 11.101 / 58. 11.101
I/mobile-ffmpeg( 5731):   libavfilter     7. 87.100 /  7. 87.100
I/mobile-ffmpeg( 5731):   libswscale      5.  8.100 /  5.  8.100
I/mobile-ffmpeg( 5731):   libswresample   3.  8.100 /  3.  8.100
I/mobile-ffmpeg( 5731): Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/data/user/0/com.raheyo.cheese/cache/REC5995709221575585296.mp4':
I/mobile-ffmpeg( 5731):   Metadata:
I/mobile-ffmpeg( 5731):     major_brand     :
I/mobile-ffmpeg( 5731): mp42
I/mobile-ffmpeg( 5731):
I/mobile-ffmpeg( 5731):     minor_version   :
I/mobile-ffmpeg( 5731): 0
I/mobile-ffmpeg( 5731):
I/mobile-ffmpeg( 5731):     compatible_brands:
I/mobile-ffmpeg( 5731): isommp42
I/mobile-ffmpeg( 5731):
I/mobile-ffmpeg( 5731):     creation_time   :
I/mobile-ffmpeg( 5731): 2021-08-06T19:50:53.000000Z
I/mobile-ffmpeg( 5731):
I/mobile-ffmpeg( 5731):     com.android.version:
I/mobile-ffmpeg( 5731): 9
I/mobile-ffmpeg( 5731):
I/mobile-ffmpeg( 5731):   Duration:
I/mobile-ffmpeg( 5731): 00:00:01.69
I/mobile-ffmpeg( 5731): , start:
I/mobile-ffmpeg( 5731): 0.000000
I/mobile-ffmpeg( 5731): , bitrate:
I/mobile-ffmpeg( 5731): 12834 kb/s
I/mobile-ffmpeg( 5731):
I/mobile-ffmpeg( 5731):     Stream #0:0
I/mobile-ffmpeg( 5731): (eng)
I/mobile-ffmpeg( 5731): : Video: h264 (avc1 / 0x31637661), yuvj420p(pc, bt470bg/bt470bg/smpte170m), 1920x1080, 12728 kb/s
I/mobile-ffmpeg( 5731): , SAR 1:1 DAR 16:9
I/mobile-ffmpeg( 5731): ,
I/mobile-ffmpeg( 5731): 20.09 fps,
I/mobile-ffmpeg( 5731): 30 tbr,
I/mobile-ffmpeg( 5731): 90k tbn,
I/mobile-ffmpeg( 5731): 180k tbc
I/mobile-ffmpeg( 5731):  (default)
I/mobile-ffmpeg( 5731):
I/mobile-ffmpeg( 5731):     Metadata:
I/mobile-ffmpeg( 5731):       rotate          :
I/mobile-ffmpeg( 5731): 90
I/mobile-ffmpeg( 5731):
I/mobile-ffmpeg( 5731):       creation_time   :
I/mobile-ffmpeg( 5731): 2021-08-06T19:50:53.000000Z
I/mobile-ffmpeg( 5731):
I/mobile-ffmpeg( 5731):       handler_name    :
I/mobile-ffmpeg( 5731): VideoHandle
I/mobile-ffmpeg( 5731):
I/mobile-ffmpeg( 5731):     Side data:
I/mobile-ffmpeg( 5731):
I/mobile-ffmpeg( 5731): displaymatrix: rotation of -90.00 degrees
I/mobile-ffmpeg( 5731):
I/mobile-ffmpeg( 5731):     Stream #0:1
I/mobile-ffmpeg( 5731): (eng)
I/mobile-ffmpeg( 5731): : Audio: aac (mp4a / 0x6134706D), 48000 Hz, mono, fltp, 96 kb/s
I/mobile-ffmpeg( 5731):  (default)
I/mobile-ffmpeg( 5731):
I/mobile-ffmpeg( 5731):     Metadata:
I/mobile-ffmpeg( 5731):       creation_time   :
I/mobile-ffmpeg( 5731): 2021-08-06T19:50:53.000000Z
I/mobile-ffmpeg( 5731):
I/mobile-ffmpeg( 5731):       handler_name    :
I/mobile-ffmpeg( 5731): SoundHandle
I/mobile-ffmpeg( 5731):
I/mobile-ffmpeg( 5731): Input #1, png_pipe, from '/data/user/0/com.raheyo.cheese/cache/e0baa6a8-4d4c-407a-a73e-be4dcf4d08fd.mp4':
I/mobile-ffmpeg( 5731):   Duration:
I/mobile-ffmpeg( 5731): N/A
I/mobile-ffmpeg( 5731): , bitrate:
I/mobile-ffmpeg( 5731): N/A
I/mobile-ffmpeg( 5731):
I/mobile-ffmpeg( 5731):     Stream #1:0
I/mobile-ffmpeg( 5731): : Video: png, rgba(pc), 393x822
I/mobile-ffmpeg( 5731): ,



 


    


  • FFMPEG Artwork cover image not set [duplicate]

    16 août 2021, par DP_Dev

    Bellow is my FFMPEG command where is converting video file to audio and also setting artwork, but artwork not setting in audio file. FFMPEG command not giving any error.

    


    [-y, -i, input.mp4, -i, artwork.jpg, -ss, 00:00:00.00, -to, 00:00:15.00, -map, 0:1, -map, 1, -vn, -acodec, copy, -metadata, comment=Cover (Front), -id3v2_version, 3, -write_id3v1, 1, output.m4a]

    


    I am extracting audio file from video file and adding art cover to audio output file. Output generated in FFmpeg process. Cover of output file is not set and no error in output. :

    


    I/ffmpeg-kit: ffmpeg version v4.4-dev-3015-gc0d0b1c4f6
I/ffmpeg-kit:  Copyright (c) 2000-2021 the FFmpeg developers
I/ffmpeg-kit:   configuration: --cross-prefix=aarch64-linux-android- --sysroot=/files/android-sdk/ndk/22.0.7026061/toolchains/llvm/prebuilt/linux-x86_64/sysroot --prefix=/storage/dark/projects/ffmpeg-kit/prebuilt/android-arm64-lts/ffmpeg --pkg-config=/usr/bin/pkg-config --enable-version3 --arch=aarch64 --cpu=armv8-a --cc=aarch64-linux-android21-clang --cxx=aarch64-linux-android21-clang++ --ranlib=aarch64-linux-android-ranlib --strip=aarch64-linux-android-strip --nm=aarch64-linux-android-nm --extra-libs='-L/storage/dark/projects/ffmpeg-kit/prebuilt/android-arm64-lts/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 --disable-static --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-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 --disable-sdl2 --enable-libmp3lame --enable-iconv --enable-libvorbis --enable-libopencore-amrnb --enable-libshine --enable-libspeex --enable-libilbc --enable-libopus --enable-libsoxr --enable-libtwolame --enable-libvo-amrwbenc --enable-zlib --enable-mediacodec
V/FA: Activity resumed, time: 113363059
I/ffmpeg-kit:   libavutil      56. 65.100 / 56. 65.100
I/ffmpeg-kit:   libavcodec     58.123.100 / 58.123.100
I/ffmpeg-kit:   libavformat    58. 67.100 / 58. 67.100
I/ffmpeg-kit:   libavdevice    58. 12.100 / 58. 12.100
I/ffmpeg-kit:   libavfilter     7.106.100 /  7.106.100
I/ffmpeg-kit:   libswscale      5.  8.100 /  5.  8.100
I/ffmpeg-kit:   libswresample   3.  8.100 /  3.  8.100

I/ffmpeg-kit: Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'input.mp4'
I/ffmpeg-kit:   Metadata:
I/ffmpeg-kit:     major_brand     : 
I/ffmpeg-kit: mp42
I/ffmpeg-kit:     minor_version   : 
I/ffmpeg-kit: 0
I/ffmpeg-kit:     compatible_brands: 
I/ffmpeg-kit: isommp42
I/ffmpeg-kit:     creation_time   : 
I/ffmpeg-kit: 2021-05-30T10:25:09.000000Z
I/ffmpeg-kit:     com.android.version: 
I/ffmpeg-kit: 10
I/ffmpeg-kit:   Duration: 
I/ffmpeg-kit: 00:00:51.40
I/ffmpeg-kit: , start: 
I/ffmpeg-kit: 0.000000
I/ffmpeg-kit: , bitrate: 
I/ffmpeg-kit: 20306 kb/s
I/ffmpeg-kit:   Stream #0:0
I/ffmpeg-kit: (eng)
I/ffmpeg-kit: : Video: h264 (avc1 / 0x31637661), yuvj420p(pc, bt470bg/bt470bg/smpte170m), 1920x1080, 20084 kb/s
I/ffmpeg-kit: , SAR 1:1 DAR 16:9
I/ffmpeg-kit: , 
I/ffmpeg-kit: 30 fps, 
I/ffmpeg-kit: 30 tbr, 
I/ffmpeg-kit: 90k tbn, 
I/ffmpeg-kit: 180k tbc
I/ffmpeg-kit:  (default)
I/ffmpeg-kit:     Metadata:
I/ffmpeg-kit:       rotate          : 
I/ffmpeg-kit: 90
I/ffmpeg-kit:       creation_time   : 
I/ffmpeg-kit: 2021-05-30T10:25:09.000000Z
I/ffmpeg-kit:       handler_name    : 
I/ffmpeg-kit: VideoHandle
I/ffmpeg-kit:       vendor_id       : 
I/ffmpeg-kit: [0][0][0][0]
I/ffmpeg-kit:     Side data:
I/ffmpeg-kit:       
I/ffmpeg-kit: displaymatrix: rotation of -90.00 degrees
I/ffmpeg-kit:   Stream #0:1
I/ffmpeg-kit: (eng)
I/ffmpeg-kit: : Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 96 kb/s
I/ffmpeg-kit:  (default)
I/ffmpeg-kit:     Metadata:
I/ffmpeg-kit:       creation_time   : 
I/ffmpeg-kit: 2021-05-30T10:25:09.000000Z
I/ffmpeg-kit:       handler_name    : 
I/ffmpeg-kit: SoundHandle
I/ffmpeg-kit:       vendor_id       : 
I/ffmpeg-kit: [0][0][0][0]
W/turn.videotomp: Accessing hidden method Lsun/misc/Unsafe;->compareAndSwapObje
I/ffmpeg-kit: Input #1, image2, from 'cover.jpg'
I/ffmpeg-kit:   Duration: 
I/ffmpeg-kit: 00:00:00.04
I/ffmpeg-kit: , start: 
I/ffmpeg-kit: 0.000000
I/ffmpeg-kit: , bitrate: 
I/ffmpeg-kit: 245926 kb/s
I/ffmpeg-kit:   Stream #1:0
I/ffmpeg-kit: : Video: mjpeg, yuvj420p(pc, bt470bg/unknown/unknown), 2420x3226 
I/ffmpeg-kit: , 
I/ffmpeg-kit: 25 fps, 
I/ffmpeg-kit: 25 tbr, 
I/ffmpeg-kit: 25 tbn, 
I/ffmpeg-kit: 25 tbc
I/ffmpeg-kit: Output #0, ipod, to 'output.m4a'
I/ffmpeg-kit:   Metadata:
I/ffmpeg-kit:     major_brand     : 
I/ffmpeg-kit: mp42
I/ffmpeg-kit:     minor_version   : 
I/ffmpeg-kit: 0
I/ffmpeg-kit:     compatible_brands: 
I/ffmpeg-kit: isommp42
I/ffmpeg-kit:     com.android.version: 
I/ffmpeg-kit: 10
I/ffmpeg-kit:     encoder         : 
I/ffmpeg-kit: Lavf58.67.100
I/ffmpeg-kit:   Stream #0:0
I/ffmpeg-kit: (eng)
I/ffmpeg-kit: : Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 96 kb/s
I/ffmpeg-kit:  (default)
I/ffmpeg-kit:     Metadata:
I/ffmpeg-kit:       creation_time   : 
I/ffmpeg-kit: 2021-05-30T10:25:09.000000Z
I/ffmpeg-kit:       handler_name    : 
I/ffmpeg-kit: SoundHandle
I/ffmpeg-kit:       vendor_id       : 
I/ffmpeg-kit: [0][0][0][0]
I/ffmpeg-kit: Stream mapping:
I/ffmpeg-kit:   Stream #0:1 -> #0:0
I/ffmpeg-kit:  (copy)
I/ffmpeg-kit: Press [q] to stop, [?] for help
I/ffmpeg-kit: size=       0kB time=00:00:00.00 bitrate=N/A speed=   0x