Recherche avancée

Médias (91)

Autres articles (32)

  • La sauvegarde automatique de canaux SPIP

    1er avril 2010, par

    Dans le cadre de la mise en place d’une plateforme ouverte, il est important pour les hébergeurs de pouvoir disposer de sauvegardes assez régulières pour parer à tout problème éventuel.
    Pour réaliser cette tâche on se base sur deux plugins SPIP : Saveauto qui permet une sauvegarde régulière de la base de donnée sous la forme d’un dump mysql (utilisable dans phpmyadmin) mes_fichiers_2 qui permet de réaliser une archive au format zip des données importantes du site (les documents, les éléments (...)

  • HTML5 audio and video support

    13 avril 2011, par

    MediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
    The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
    For older browsers the Flowplayer flash fallback is used.
    MediaSPIP allows for media playback on major mobile platforms with the above (...)

  • De l’upload à la vidéo finale [version standalone]

    31 janvier 2010, par

    Le chemin d’un document audio ou vidéo dans SPIPMotion est divisé en trois étapes distinctes.
    Upload et récupération d’informations de la vidéo source
    Dans un premier temps, il est nécessaire de créer un article SPIP et de lui joindre le document vidéo "source".
    Au moment où ce document est joint à l’article, deux actions supplémentaires au comportement normal sont exécutées : La récupération des informations techniques des flux audio et video du fichier ; La génération d’une vignette : extraction d’une (...)

Sur d’autres sites (4523)

  • How to remove tx3g stream from m4a file [closed]

    12 novembre 2023, par KWottrich

    I have an audiobook that I'm trying to play on my phone. My audio app of choice is struggling with the file, and I think it's because there's an additional stream in the file that it can't handle. VLC for Android plays the file without issue, but I'd rather use my audio app of choice.

    


    When I open the m4a file in VLC for Windows, I see two streams :

    


    VLC Codec Info

    


    I want to get rid of the tx3g stream, and just keep the audio stream. So I turned to ffmpeg to try to copy over only the audio stream. However, no matter what I try, the tx3g stream seems to come along for the ride. I referred to this post to figure out how to remove the tx3g stream, but so far I've been unsuccessful. Can anyone help me figure out how to remove just the tx3g track ? Ideally, I'd like to keep the metadata and album art as well.

    


    I tried to run ffmpeg -i input.m4a -map 0:a:0 -sn -dn -c copy output.m4a, but the tx3g stream is still there. Here is the command output :

    


    ffmpeg version 2021-12-06-git-ef00d40e32-essentials_build-www.gyan.dev Copyright (c) 2000-2021 the FFmpeg developers
  built with gcc 11.2.0 (Rev2, Built by MSYS2 project)
  configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-lzma --enable-zlib --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-sdl2 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-libass --enable-libfreetype --enable-libfribidi --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-libgme --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libtheora --enable-libvo-amrwbenc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-librubberband
  libavutil      57. 10.101 / 57. 10.101
  libavcodec     59. 14.100 / 59. 14.100
  libavformat    59.  9.102 / 59.  9.102
  libavdevice    59.  0.101 / 59.  0.101
  libavfilter     8. 19.100 /  8. 19.100
  libswscale      6.  1.101 /  6.  1.101
  libswresample   4.  0.100 /  4.  0.100
  libpostproc    56.  0.100 / 56.  0.100
[mov,mp4,m4a,3gp,3g2,mj2 @ 000002773b2db200] stream 0, timescale not set
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '.\input.m4a':
  Metadata:
    major_brand     : M4A
    minor_version   : 512
    compatible_brands: isomiso2
    artist          : [removed]
    title           : [removed]
    album           : [removed]
    date            : 2020
    genre           : Audiobook
    track           : 1/22
    disc            : 1/1
    comment         : [removed]
    copyright       : [removed]
    encoder         : Lavf58.29.100
  Duration: 00:01:45.14, start: 0.000000, bitrate: 132 kb/s
  Chapters:
    Chapter #0:0: start 0.000000, end 105.000000
      Metadata:
        title           : [removed]
  Stream #0:0[0x1](und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 125 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
      vendor_id       : [0][0][0][0]
  Stream #0:1[0x2](und): Data: bin_data (text / 0x74786574), 0 kb/s
    Metadata:
      creation_time   : 2021-11-29T16:23:41.000000Z
  Stream #0:2[0x0]: Video: mjpeg (Baseline), yuvj420p(pc, bt470bg/unknown/unknown), 500x500 [SAR 1:1 DAR 1:1], 90k tbr, 90k tbn (attached pic)
Output #0, ipod, to 'output.m4a':
  Metadata:
    major_brand     : M4A
    minor_version   : 512
    compatible_brands: isomiso2
    artist          : [removed]
    title           : [removed]
    album           : [removed]
    date            : 2020
    genre           : Audiobook
    track           : 1/22
    disc            : 1/1
    comment         : [removed]
    copyright       : [removed]
    encoder         : Lavf59.9.102
  Chapters:
    Chapter #0:0: start 0.000000, end 105.000000
      Metadata:
        title           : [removed]
  Stream #0:0(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 125 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
      vendor_id       : [0][0][0][0]
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
Press [q] to stop, [?] for help
size=    1632kB time=00:01:45.11 bitrate= 127.2kbits/s speed=1.48e+04x
video:0kB audio:1612kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 1.233040%


    


  • Fragmented MP4 not playing in ffplay/QuickTime/Safari, but in VLC

    6 août 2020, par Stack64

    I encoded a fMP4-Video (HEVC) in Swift using VideoToolbox and CoreMedia. The resulting fragmented MP4 is only playing in VLC.

    


    The library I am using to write the fMP4 is an HEVC-adapted version of this GitHub-Project : https://github.com/krad/morsel

    


    Process of encoding and writing :

    


      

    1. VideoToolbox : Encoding SampleBuffer from the camera (VTCompressionSession, as described in WWDC 2014 Session 513)
    2. 


    3. Using CoreMedia-Functions (e.g. CMVideoFormatDescriptionGetHEVCParameterSetAtIndex, CMVideoFormatDescriptionGetDimensions) to get the encoded streams metadata. I am writing the content of CMFormatDescriptionGetExtension(description, extensionKey: "SampleDescriptionExtensionAtoms" as CFString)["hvcC"] directly to the hvcC box. This box is obviously written correctly, when I alter one bit of the box of the mp4, QuickTime throws an error.
    4. 


    5. I am appending the sample buffer data to the morsel-library, which manages fragmentation and creates the moof and mdat atoms.
    6. 


    


    The result file is playable in VLC, when I just let the playback "run" without doing anything. When I scroll the time in VLC, VLC crashes and the playback stops.

    


    It is also sort of "playable" in Safari and QuickTime (no error message shown, the playback window opens and the correct length of the file is shown, I can even change to playback time / play/pause, but there is no video shown. The window remains empty. And that is the problem I have. I need to get an fMP4 running in Safari and QuickTime.

    


    The file is not playing at all in ffplay (same problem when converting with ffmpeg). The line where the playback time is shown remains nan M-V:    nan fd=   0 aq=    0KB vq=    0KB sq=    0B f=0/0 , there are no error messages. The playback just does not start.
When playing the file with ffplay, this is the output :

    


    ffplay version 4.3 Copyright (c) 2003-2020 the FFmpeg developers
  built with Apple clang version 11.0.3 (clang-1103.0.32.62)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/4.3_2 --enable-shared --enable-pthreads --enable-version3 --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libdav1d --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librtmp --enable-libspeex --enable-libsoxr --enable-videotoolbox --disable-libjack --disable-indev=jack
  libavutil      56. 51.100 / 56. 51.100
  libavcodec     58. 91.100 / 58. 91.100
  libavformat    58. 45.100 / 58. 45.100
  libavdevice    58. 10.100 / 58. 10.100
  libavfilter     7. 85.100 /  7. 85.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  7.100 /  5.  7.100
  libswresample   3.  7.100 /  3.  7.100
  libpostproc    55.  7.100 / 55.  7.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'test.mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 1
    compatible_brands: mp41mp42isomhlsf
    creation_time   : 2020-08-03T20:41:08.000000Z
  Duration: N/A, bitrate: N/A
    Stream #0:0(und): Video: hevc (Main) (hvc1 / 0x31637668), yuv420p(tv), 1920x1080, SAR 1:1 DAR 16:9, 1000000000.00 tbr, 1000000000.00 tbn, 1000000000.00 tbc (default)
    Metadata:
      creation_time   : 2020-08-03T20:41:08.000000Z
      handler_name    : video
    nan M-V:    nan fd=   0 aq=    0KB vq=    0KB sq=    0B f=0/0 


    


    My file has this structure :

    


    ftyp
moov
    mvhd
    trak
        tkhd
        mdia
            mdhd
            hdlr
            minf
                vmhd
                dinf
                    dref
                stbl
                    stsd
                    stts
                    stsc
                    stsz
                    stco
    mvex
        trex
moof-(1)
mdat
moof-(2)
mdat 
...


    


    The result file I want to create should be like the fMP4 served within this HLS playlist : (Example : https://developer.apple.com/streaming/examples/advanced-stream-hevc.html, Playlist : https://devstreaming-cdn.apple.com/videos/streaming/examples/bipbop_adv_example_hevc/master.m3u8)
This file has the following structure :

    


    ftyp
moov
    mvhd
    trak
        tkhd
        mdia
            mdhd
            hdlr
            minf
                vmhd
                dinf
                    dref
                stbl
                    stsd
                    stts
                    stsc
                    stsz
                    stco
    trak (same structure as above)
    mvex
        trex
moof-(1)
mdat
moof-(2)
mdat 
...


    


    This file from Apple plays perfectly in ffmpeg and QuickTime/Safari. Except for the second trak atom, it has the same structure.

    


    The "good" file is : https://devstreaming-cdn.apple.com/videos/streaming/examples/bipbop_adv_example_hevc/v14/main.mp4 (It is intended for use in a HLS Playlist I've downloaded it with curl)

    


    The "bad" file is : https://www.transfernow.net/ddl/fmp4_bad (link should work, tested it just now :) ). The video shows a slowly rotating sheet of paper.

    


    Any suggestions what the problem with my file is ?
Thanks in advance !

    


  • Prevent ffmpeg from changing the intensity of colors while downscaling the resolution of the video

    29 août 2022, par dravit

    I have a use case where I need to downscale a 716x1280 mp4 video to 358x640 (half of the original). Command that I used is

    


    ffmpeg -i ./input.mp4 -vf "scale=640:640:force_original_aspect_ratio=decrease,pad=ceil(iw/2)*2:ceil(ih/2)*2" ./output.mp4


    


    Out of 10 sample videos, 2 of the them suffered impact on colors. Below I have attached a comparison from the one which was impacted the most.

    


    Comparison of frames from the most impacted video

    


    NOTE : The one on the right is a frame from the original video and the frame on the left is the one from the processed (down scaled) video. Notice the colors red and green in the image (even the skin color and hair color were changed).

    


    What I am looking for is

    


      

    • Is there any way I can prevent changes like these happening ? Probably some flag on saturation, brightness, contrast or any other parameter.
    • 


    • I am assuming that ffmpeg uses some default settings while downscaling a video. What made ffmpeg change colors only for these two videos ? If it made similar changes for the rest of the videos as well, how to predict this behaviour before hand ?
    • 


    


    EDIT :

    


    What I already have Tried ?

    


      

    • -crf with values 0 and 18.
    • 


    • -preset veryslow as mentioned here
    • 


    


    None helped

    


    Mediainfo input V/S output

    


    





    


    


    


    


    


    



    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    


    param input output
    color range Limited NA (attribute not in description)
    color primaries BT.2020 NA (attribute not in description)
    transfer characteristics HLG NA (attribute not in description)
    matrix coefficients BT.2020 non-constant NA (attribute not in description)
    bit deapth 8 8

    


    


    Logs of the ffmpeg command

    


    ffmpeg -i ./input.mp4 -vf "scale=640:640:force_original_aspect_ratio=decrease,pad=ceil(iw/2)*2:ceil(ih/2)*2" -movflags +faststart ./output.mp4
ffmpeg version 4.3.1 Copyright (c) 2000-2020 the FFmpeg developers
  built with Apple clang version 12.0.0 (clang-1200.0.32.28)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/4.3.1_9 --enable-shared --enable-pthreads --enable-version3 --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libdav1d --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librtmp --enable-libspeex --enable-libsoxr --enable-videotoolbox --enable-libzmq --enable-libzimg --disable-libjack --disable-indev=jack
  libavutil      56. 51.100 / 56. 51.100
  libavcodec     58. 91.100 / 58. 91.100
  libavformat    58. 45.100 / 58. 45.100
  libavdevice    58. 10.100 / 58. 10.100
  libavfilter     7. 85.100 /  7. 85.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  7.100 /  5.  7.100
  libswresample   3.  7.100 /  3.  7.100
  libpostproc    55.  7.100 / 55.  7.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from './input.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf58.45.100
  Duration: 00:00:30.05, start: 0.000000, bitrate: 10366 kb/s
    Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt2020nc/bt2020/arib-std-b67), 716x1280, 10116 kb/s, 30 fps, 30 tbr, 19200 tbn, 38400 tbc (default)
    Metadata:
      handler_name    : Core Media Video
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 245 kb/s (default)
    Metadata:
      handler_name    : Core Media Audio
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
  Stream #0:1 -> #0:1 (aac (native) -> aac (native))
Press [q] to stop, [?] for help
[libx264 @ 0x7faab4808800] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 @ 0x7faab4808800] profile High, level 3.0, 4:2:0, 8-bit
[libx264 @ 0x7faab4808800] 264 - core 161 r3027 4121277 - H.264/MPEG-4 AVC codec - Copyleft 2003-2020 - 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
Output #0, mp4, to './output.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf58.45.100
    Stream #0:0(und): Video: h264 (libx264) (avc1 / 0x31637661), yuv420p, 358x640, q=-1--1, 30 fps, 15360 tbn, 30 tbc (default)
    Metadata:
      handler_name    : Core Media Video
      encoder         : Lavc58.91.100 libx264
    Side data:
      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s (default)
    Metadata:
      handler_name    : Core Media Audio
      encoder         : Lavc58.91.100 aac
[mp4 @ 0x7faab5808800] Starting second pass: moving the moov atom to the beginning of the file
frame=  901 fps=210 q=-1.0 Lsize=    3438kB time=00:00:30.02 bitrate= 938.0kbits/s speed=7.01x
video:2933kB audio:472kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.974633%
[libx264 @ 0x7faab4808800] frame I:6     Avg QP:22.60  size: 20769
[libx264 @ 0x7faab4808800] frame P:228   Avg QP:24.84  size:  7657
[libx264 @ 0x7faab4808800] frame B:667   Avg QP:27.59  size:  1697
[libx264 @ 0x7faab4808800] consecutive B-frames:  0.9%  0.9%  1.0% 97.2%
[libx264 @ 0x7faab4808800] mb I  I16..4:  9.5% 64.6% 26.0%
[libx264 @ 0x7faab4808800] mb P  I16..4:  2.5% 12.2%  2.5%  P16..4: 37.2% 20.6% 11.2%  0.0%  0.0%    skip:13.7%
[libx264 @ 0x7faab4808800] mb B  I16..4:  0.4%  2.1%  0.2%  B16..8: 42.2%  7.1%  1.2%  direct: 1.8%  skip:44.9%  L0:39.4% L1:52.8% BI: 7.8%
[libx264 @ 0x7faab4808800] 8x8 transform intra:72.2% inter:74.2%
[libx264 @ 0x7faab4808800] coded y,uvDC,uvAC intra: 61.8% 67.2% 20.2% inter: 16.7% 13.9% 1.3%
[libx264 @ 0x7faab4808800] i16 v,h,dc,p: 24% 19%  7% 50%
[libx264 @ 0x7faab4808800] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 21% 16% 15%  6%  9% 11%  7% 10%  6%
[libx264 @ 0x7faab4808800] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 25% 16% 13%  7%  9% 10%  7%  9%  4%
[libx264 @ 0x7faab4808800] i8c dc,h,v,p: 53% 16% 26%  5%
[libx264 @ 0x7faab4808800] Weighted P-Frames: Y:3.9% UV:1.8%
[libx264 @ 0x7faab4808800] ref P L0: 57.8% 19.5% 14.8%  7.8%  0.1%
[libx264 @ 0x7faab4808800] ref B L0: 90.7%  7.2%  2.1%
[libx264 @ 0x7faab4808800] ref B L1: 95.3%  4.7%
[libx264 @ 0x7faab4808800] kb/s:799.80
[aac @ 0x7faab2036a00] Qavg: 189.523