Recherche avancée

Médias (91)

Autres articles (63)

  • Mise à jour de la version 0.1 vers 0.2

    24 juin 2013, par

    Explications des différents changements notables lors du passage de la version 0.1 de MediaSPIP à la version 0.3. Quelles sont les nouveautés
    Au niveau des dépendances logicielles Utilisation des dernières versions de FFMpeg (>= v1.2.1) ; Installation des dépendances pour Smush ; Installation de MediaInfo et FFprobe pour la récupération des métadonnées ; On n’utilise plus ffmpeg2theora ; On n’installe plus flvtool2 au profit de flvtool++ ; On n’installe plus ffmpeg-php qui n’est plus maintenu au (...)

  • MediaSPIP v0.2

    21 juin 2013, par

    MediaSPIP 0.2 est la première version de MediaSPIP stable.
    Sa date de sortie officielle est le 21 juin 2013 et est annoncée ici.
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Comme pour la version précédente, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
    Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...)

  • MediaSPIP version 0.1 Beta

    16 avril 2011, par

    MediaSPIP 0.1 beta est la première version de MediaSPIP décrétée comme "utilisable".
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Pour avoir une installation fonctionnelle, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
    Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...)

Sur d’autres sites (8705)

  • Python FFmpeg : Setting VBR and BT.709

    14 décembre 2019, par Cryptonaut

    I’m using this Python library to programmatically generate a short video using an image (.png) as input. The video needs to match the specifications of another video created by someone else.

    The key differences between my output and the other are the following (these are the media attributes I desire to have) :

    How would I achieve VBR ? It was my understanding ProRes 422 HQ natively used unconstrained VBR yet my output specifies CBR.

    Secondly, as can be seen from my code, I’m attempting to conform to BT.709. However, my media information output does not specify this. What am I doing incorrectly ?

    Here’s my code :

       image = ffmpeg.input(input_image, t='00:00:10', framerate='24000/1001', loop='1', probesize='42M')

       output = ffmpeg.output(image, output_video,
       f='mov',
       vcodec='prores_ks',
       vprofile='3',
       pix_fmt='yuv422p10le',
       g='48',
       video_track_timescale='24000',
       movflags='use_metadata_tags',
       timecode='00:00:00:00',
       color_primaries='bt709',
       color_trc='bt709',
       colorspace='bt709',
       qcomp='1',
       # BT.709 issue solved by adding the bsf option as seen via the line below
       bsf='prores_metadata=color_primaries=bt709:color_trc=bt709:colorspace=bt709',
       vf='scale=in_range=full:in_color_matrix=bt709:out_range=full:out_color_matrix=bt709')

       output.run()

    Here’s the media information produced by my output :

    {
      "media":{
         "@ref":"Redacted",
         "track":[
            {
               "@type":"General",
               "VideoCount":"1",
               "OtherCount":"1",
               "FileExtension":"mov",
               "Format":"MPEG-4",
               "Format_Profile":"QuickTime",
               "CodecID":"qt  ",
               "CodecID_Version":"0000.02",
               "CodecID_Compatible":"qt  ",
               "FileSize":"196366623",
               "Duration":"10.010",
               "OverallBitRate":"156936362",
               "FrameRate":"23.976",
               "FrameCount":"240",
               "StreamSize":"2463",
               "HeaderSize":"28",
               "DataSize":"196364172",
               "FooterSize":"2423",
               "IsStreamable":"No",
               "File_Created_Date":"UTC 2019-12-13 19:26:37.150",
               "File_Created_Date_Local":"2019-12-13 19:26:37.150",
               "File_Modified_Date":"UTC 2019-12-13 19:27:20.303",
               "File_Modified_Date_Local":"2019-12-13 19:27:20.303"
            },
            {
               "@type":"Video",
               "StreamOrder":"0",
               "ID":"1",
               "Format":"ProRes",
               "Format_Version":"0",
               "Format_Profile":"422 HQ",
               "CodecID":"apch",
               "Duration":"10.010",
               "BitRate_Mode":"CBR",
               "BitRate":"156934237",
               "Width":"1920",
               "Height":"1080",
               "Sampled_Width":"1920",
               "Sampled_Height":"1080",
               "PixelAspectRatio":"1.000",
               "DisplayAspectRatio":"1.778",
               "Rotation":"0.000",
               "FrameRate_Mode":"CFR",
               "FrameRate":"23.976",
               "FrameCount":"240",
               "ColorSpace":"YUV",
               "ChromaSubsampling":"4:2:2",
               "ScanType":"Progressive",
               "Delay":"0.000",
               "StreamSize":"196364160",
               "Encoded_Library":"Lavc",
               "colour_description_present":"Yes",
               "colour_description_present_Source":"Stream",
               "colour_primaries_Source":"Stream",
               "transfer_characteristics_Source":"Stream",
               "matrix_coefficients_Source":"Stream"
            },
            {
               "@type":"Other",
               "StreamOrder":"1",
               "ID":"2",
               "Type":"Time code",
               "Format":"QuickTime TC",
               "Duration":"10.010",
               "FrameRate":"23.976",
               "TimeCode_FirstFrame":"00:00:00:00",
               "TimeCode_Striped":"Yes",
               "Language":"en",
               "Default":"No"
            }
         ]
      }
    }

    Here’s the media information spec I’m trying to match :

    {
      "media":{
         "@ref":"Redacted",
         "track":[
            {
               "@type":"General",
               "VideoCount":"1",
               "OtherCount":"1",
               "FileExtension":"mov",
               "Format":"MPEG-4",
               "Format_Profile":"QuickTime",
               "CodecID":"qt  ",
               "CodecID_Version":"2005.03",
               "CodecID_Compatible":"qt  ",
               "FileSize":"1397430682",
               "Duration":"70.737",
               "OverallBitRate_Mode":"VBR",
               "OverallBitRate":"158042403",
               "FrameRate":"23.976",
               "FrameCount":"1696",
               "StreamSize":"9898",
               "HeaderSize":"28",
               "DataSize":"1397420796",
               "FooterSize":"9858",
               "IsStreamable":"No",
               "Encoded_Date":"UTC 2019-04-29 22:26:32",
               "Tagged_Date":"UTC 2019-04-29 22:26:32",
               "File_Created_Date":"UTC 2019-12-12 16:52:57.215",
               "File_Created_Date_Local":"2019-12-12 16:52:57.215",
               "File_Modified_Date":"UTC 2019-12-12 17:25:58.903",
               "File_Modified_Date_Local":"2019-12-12 17:25:58.903",
               "Encoded_Application":"DVP Factory r561 (2019-04-25), Host: dvp07"
            },
            {
               "@type":"Video",
               "StreamOrder":"0",
               "ID":"1",
               "Format":"ProRes",
               "Format_Version":"0",
               "Format_Profile":"422 HQ",
               "CodecID":"apch",
               "Duration":"70.737",
               "Duration_LastFrame":"-0.000",
               "BitRate_Mode":"VBR",
               "BitRate":"158040381",
               "Width":"1920",
               "Height":"1080",
               "Sampled_Width":"1920",
               "Sampled_Height":"1080",
               "PixelAspectRatio":"1.000",
               "DisplayAspectRatio":"1.778",
               "Rotation":"0.000",
               "FrameRate_Mode":"CFR",
               "FrameRate":"23.976",
               "FrameCount":"1696",
               "ColorSpace":"YUV",
               "ChromaSubsampling":"4:2:2",
               "ScanType":"Progressive",
               "Delay":"0.000",
               "StreamSize":"1397420784",
               "Encoded_Library":"agi0",
               "Language":"en",
               "Encoded_Date":"UTC 2019-04-29 22:26:32",
               "Tagged_Date":"UTC 2019-04-29 22:26:32",
               "colour_description_present":"Yes",
               "colour_description_present_Source":"Container / Stream",
               "colour_primaries":"BT.709",
               "colour_primaries_Source":"Container",
               "colour_primaries_Original_Source":"Stream",
               "transfer_characteristics":"BT.709",
               "transfer_characteristics_Source":"Container",
               "transfer_characteristics_Original_Source":"Stream",
               "matrix_coefficients":"BT.709",
               "matrix_coefficients_Source":"Container / Stream"
            },
            {
               "@type":"Other",
               "StreamOrder":"1",
               "ID":"2",
               "Type":"Time code",
               "Format":"QuickTime TC",
               "Duration":"70.737",
               "FrameRate":"23.976",
               "TimeCode_FirstFrame":"00:00:00:00",
               "TimeCode_Striped":"Yes",
               "Language":"en",
               "extra":{
                  "Encoded_Date":"UTC 2019-04-29 22:26:32",
                  "Tagged_Date":"UTC 2019-04-29 22:26:32"
               }
            }
         ]
      }
    }
  • Empty stream when cutting a video using ffmpeg

    17 décembre 2019, par dscv

    When I try cutting a video, it outputs an empty stream (262 byte video with 0s duration). Would appreciate any insight, thanks.

    Command used :
    ffmpeg -i /path/to/long/video.mp4 -ss 37.69 -t 4.96 -c copy /path/to/short/video.mp4

    However, when I the following (more inaccurate) command, it outputs a video. This video also has some problems, as the last frame is repeated several times, making the video one second longer (with a frozen image for one second).

    ffmpeg -ss 37.69 -i /path/to/long/video.mp4 -t 4.96 -c copy /path/to/short/video.mp4

    ffmpeg version : ffmpeg version 3.4.6-0ubuntu0.18.04.1

    The outputs for the two commands are :

    First command :

     built with gcc 7 (Ubuntu 7.3.0-16ubuntu3)
     configuration: --prefix=/usr --extra-version=0ubuntu0.18.04.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-librsvg --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared
     libavutil      55. 78.100 / 55. 78.100
     libavcodec     57.107.100 / 57.107.100
     libavformat    57. 83.100 / 57. 83.100
     libavdevice    57. 10.100 / 57. 10.100
     libavfilter     6.107.100 /  6.107.100
     libavresample   3.  7.  0 /  3.  7.  0
     libswscale      4.  8.100 /  4.  8.100
     libswresample   2.  9.100 /  2.  9.100
     libpostproc    54.  7.100 / 54.  7.100
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/proj/vondrick/datasets/HowTo100M/video/Cars_&_Other_Vehicles/Motorcycles/52907/video_nVbIUDjzWY4.mp4':
     Metadata:
       major_brand     : dash
       minor_version   : 0
       compatible_brands: iso6avc1mp41
       creation_time   : 2015-06-26T00:39:04.000000Z
     Duration: 00:07:14.40, start: 0.000000, bitrate: 244 kb/s
       Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(progressive), 426x240 [SAR 1:1 DAR 71:40], 2 kb/s, 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc (default)
       Metadata:
         creation_time   : 2015-06-26T00:39:04.000000Z
         handler_name    : VideoHandler
    Output #0, mp4, to '/proj/vondrick/datasets/HowTo100M/cropped_video/Cars_&_Other_Vehicles/Motorcycles/52907/nVbIUDjzWY4/video_000000_p.mp4':
     Metadata:
       major_brand     : dash
       minor_version   : 0
       compatible_brands: iso6avc1mp41
       encoder         : Lavf57.83.100
       Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(progressive), 426x240 [SAR 1:1 DAR 71:40], q=2-31, 2 kb/s, 29.97 fps, 29.97 tbr, 90k tbn, 90k tbc (default)
       Metadata:
         creation_time   : 2015-06-26T00:39:04.000000Z
         handler_name    : VideoHandler
    Stream mapping:
     Stream #0:0 -> #0:0 (copy)
    Press [q] to stop, [?] for help
    frame=    0 fps=0.0 q=-1.0 Lsize=       0kB time=00:00:00.00 bitrate=N/A speed=   0x    
    video:0kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown

    Second command :

    ffmpeg version 3.4.6-0ubuntu0.18.04.1 Copyright (c) 2000-2019 the FFmpeg developers
     built with gcc 7 (Ubuntu 7.3.0-16ubuntu3)
     configuration: --prefix=/usr --extra-version=0ubuntu0.18.04.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-librsvg --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared
     libavutil      55. 78.100 / 55. 78.100
     libavcodec     57.107.100 / 57.107.100
     libavformat    57. 83.100 / 57. 83.100
     libavdevice    57. 10.100 / 57. 10.100
     libavfilter     6.107.100 /  6.107.100
     libavresample   3.  7.  0 /  3.  7.  0
     libswscale      4.  8.100 /  4.  8.100
     libswresample   2.  9.100 /  2.  9.100
     libpostproc    54.  7.100 / 54.  7.100
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/proj/vondrick/datasets/HowTo100M/video/Cars_&_Other_Vehicles/Motorcycles/52907/video_nVbIUDjzWY4.mp4':
     Metadata:
       major_brand     : dash
       minor_version   : 0
       compatible_brands: iso6avc1mp41
       creation_time   : 2015-06-26T00:39:04.000000Z
     Duration: 00:07:14.40, start: 0.000000, bitrate: 244 kb/s
       Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(progressive), 426x240 [SAR 1:1 DAR 71:40], 2 kb/s, 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc (default)
       Metadata:
         creation_time   : 2015-06-26T00:39:04.000000Z
         handler_name    : VideoHandler
    Output #0, mp4, to '/proj/vondrick/datasets/HowTo100M/cropped_video/Cars_&_Other_Vehicles/Motorcycles/52907/nVbIUDjzWY4/video_000000_3.mp4':
     Metadata:
       major_brand     : dash
       minor_version   : 0
       compatible_brands: iso6avc1mp41
       encoder         : Lavf57.83.100
       Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(progressive), 426x240 [SAR 1:1 DAR 71:40], q=2-31, 2 kb/s, 29.97 fps, 29.97 tbr, 90k tbn, 90k tbc (default)
       Metadata:
         creation_time   : 2015-06-26T00:39:04.000000Z
         handler_name    : VideoHandler
    Stream mapping:
     Stream #0:0 -> #0:0 (copy)
    Press [q] to stop, [?] for help
    frame=  159 fps=0.0 q=-1.0 Lsize=     159kB time=00:00:04.95 bitrate= 263.0kbits/s speed=1.89e+03x    
    video:158kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.909119%
  • How to build the Exoplayer ffmpeg extension with the GSM codec ?

    4 mars 2020, par MadCoconut

    I wanted to use Exoplayer to play an audio file but when I tried I got this exception :

    2019-12-13 10:08:14.827 28972-29388/com.XXX.XXX E/ExoPlayerImplInternal: Source error.
       com.google.android.exoplayer2.ParserException: Expected block alignment: 0; got: 65
           at com.google.android.exoplayer2.extractor.wav.WavHeaderReader.peek(WavHeaderReader.java:81)
           at com.google.android.exoplayer2.extractor.wav.WavExtractor.sniff(WavExtractor.java:50)
           at com.google.android.exoplayer2.source.ProgressiveMediaPeriod$ExtractorHolder.selectExtractor(ProgressiveMediaPeriod.java:1061)
           at com.google.android.exoplayer2.source.ProgressiveMediaPeriod$ExtractingLoadable.load(ProgressiveMediaPeriod.java:952)
           at com.google.android.exoplayer2.upstream.Loader$LoadTask.run(Loader.java:394)
           at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
           at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
           at java.lang.Thread.run(Thread.java:764)

    The audio files I have to play are wav files (GSM_MS, 13kb/s)

    I tried to build the the Exoplayer Ffmpeg extension following the tutorial :
    https://github.com/google/ExoPlayer/tree/release-v2/extensions/ffmpeg

    I cloned the Exoplayer repository and I downloaded the Android NDK version r20b.

    I modified the build script build_ffmpeg.sh to enable the libgsm :

    COMMON_OPTIONS=“

      —enable-libgsm
    "

    I defined the required environment variables :

    Then I built the library using the provided command line :

    cd "${FFMPEG_EXT_PATH}" && \
    ./build_ffmpeg.sh \
    "${FFMPEG_EXT_PATH}" "${NDK_PATH}" "${HOST_PLATFORM}" "${ENABLED_DECODERS[@]}"

    But something goes wrong during the build process :

    remote: Enumerating objects: 38, done.
    remote: Counting objects: 100% (38/38), done.
    remote: Compressing objects: 100% (26/26), done.
    remote: Total 26 (delta 20), reused 0 (delta 0)
    Unpacking objects: 100% (26/26), done.
    From git://source.ffmpeg.org/ffmpeg
     377a095dc3..bd83191271  master     -> origin/master
    Already up to date.
    Already on 'release/4.2'
    Your branch is up to date with 'origin/release/4.2'.
    ERROR: libgsm not found

    If you think configure made a mistake, make sure you are using the latest
    version from Git.  If the latest version fails, report the problem to the
    ffmpeg-user@ffmpeg.org mailing list or IRC #ffmpeg on irc.freenode.net.
    Include the log file "ffbuild/config.log" produced by configure as this will help
    solve the problem.
    GEN libavutil/libavutil.version
    GEN libswresample/libswresample.version
    GEN libavresample/libavresample.version
    GEN libavcodec/libavcodec.version
    CC  libavcodec/aac_ac3_parser.o
    CC  libavcodec/aacdec.o
    CC  libavcodec/aacps_float.o
    CC  libavcodec/aacpsdsp_float.o
    CC  libavcodec/aacsbr.o
    CC  libavcodec/aactab.o
    CC  libavcodec/ac3.o
    CC  libavcodec/ac3_parser.o
    CC  libavcodec/ac3dec_data.o
    CC  libavcodec/ac3dec_float.o

    Here is a part of the content of the config.log file located in the ffmpeg checked out library (/extensions/ffmpeg/src/main/jni/ffmpeg/ffbuild/config.log :


    /Users/USER/Documents/Android/android-ndk-r20b/toolchains/llvm/prebuilt/darwin-x86_64/bin/i686-linux-android16-clang -march=i686 -Wl,--as-needed -Wl,-z,noexecstack -pie -fPIE -pie -o /var/folders/9l/trkjpc091_79vk3krfpykbsh0000gn/T//ffconf.hv2yROG1/test /var/folders/9l/trkjpc091_79vk3krfpykbsh0000gn/T//ffconf.hv2yROG1/test.o
    /var/folders/9l/trkjpc091_79vk3krfpykbsh0000gn/T//ffconf.hv2yROG1/test.o:test.c:function foo: error: undefined reference to 'cexp'
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    check_lib libgsm gsm.h gsm_create -lgsm
    check_func_headers gsm.h gsm_create -lgsm
    test_ld cc -lgsm
    test_cc
    BEGIN /var/folders/9l/trkjpc091_79vk3krfpykbsh0000gn/T//ffconf.hv2yROG1/test.c
       1   #include
       2   #include
       3   long check_gsm_create(void) { return (long) gsm_create; }
       4   int main(void) { int ret = 0;
       5    ret |= ((intptr_t)check_gsm_create) & 0xFFFF;
       6   return ret; }
    END /var/folders/9l/trkjpc091_79vk3krfpykbsh0000gn/T//ffconf.hv2yROG1/test.c
    /Users/USER/Documents/Android/android-ndk-r20b/toolchains/llvm/prebuilt/darwin-x86_64/bin/i686-linux-android16-clang -D_ISOC99_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Dstrtod=avpriv_strtod -DPIC -march=i686 -std=c11 -fPIE -fomit-frame-pointer -fPIC -pthread -c -o /var/folders/9l/trkjpc091_79vk3krfpykbsh0000gn/T//ffconf.hv2yROG1/test.o /var/folders/9l/trkjpc091_79vk3krfpykbsh0000gn/T//ffconf.hv2yROG1/test.c
    /var/folders/9l/trkjpc091_79vk3krfpykbsh0000gn/T//ffconf.hv2yROG1/test.c:1:10: fatal error: 'gsm.h' file not found

    The gsm.h file is located there : /extensions/ffmpeg/src/main/jni/ffmpeg/libavcodec

    I assume this path has been configured to be used by the build script.

    Any help is much appreciated.