Recherche avancée

Médias (39)

Mot : - Tags -/audio

Autres articles (52)

  • Les autorisations surchargées par les plugins

    27 avril 2010, par

    Mediaspip core
    autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs

  • Librairies et binaires spécifiques au traitement vidéo et sonore

    31 janvier 2010, par

    Les logiciels et librairies suivantes sont utilisées par SPIPmotion d’une manière ou d’une autre.
    Binaires obligatoires FFMpeg : encodeur principal, permet de transcoder presque tous les types de fichiers vidéo et sonores dans les formats lisibles sur Internet. CF ce tutoriel pour son installation ; Oggz-tools : outils d’inspection de fichiers ogg ; Mediainfo : récupération d’informations depuis la plupart des formats vidéos et sonores ;
    Binaires complémentaires et facultatifs flvtool2 : (...)

  • Contribute to a better visual interface

    13 avril 2011

    MediaSPIP is based on a system of themes and templates. Templates define the placement of information on the page, and can be adapted to a wide range of uses. Themes define the overall graphic appearance of the site.
    Anyone can submit a new graphic theme or template and make it available to the MediaSPIP community.

Sur d’autres sites (9544)

  • ffmpeg removing silence makes mp3 longer ?

    13 août 2017, par pocketg99

    I’ve been using the following command to attempt to remove silent segments from an mp3 file

    ffmpeg -i "podcasts/audio1.mp3" -af silenceremove=1:0:-50dB "/tmp/pod-sil.mp3"

    For some reason the resulting mp3 is twice as log as the input mp3. It is not half as fast. There does not appear to be any duplicated audio. There is some silence, but not an hour’s worth. For a given portion of the input file, you can find the same thing in the output file by going to twice the timestamp of the input file.

    The files are long so I have not yet listened to them all the way through. I really have no idea where the extra length is coming from, the files seem normal.

    Here is the full output from ffmpeg

    ffmpeg version 2.8.11-0ubuntu0.16.04.1 Copyright (c) 2000-2017 the FFmpeg developers
     built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.4) 20160609
     configuration: --prefix=/usr --extra-version=0ubuntu0.16.04.1 --build-suffix=-ffmpeg --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --cc=cc --cxx=g++ --enable-gpl --enable-shared --disable-stripping --disable-decoder=libopenjpeg --disable-decoder=libschroedinger --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-libmodplug --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librtmp --enable-libschroedinger --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-libxvid --enable-libzvbi --enable-openal --enable-opengl --enable-x11grab --enable-libdc1394 --enable-libiec61883 --enable-libzmq --enable-frei0r --enable-libx264 --enable-libopencv
     libavutil      54. 31.100 / 54. 31.100
     libavcodec     56. 60.100 / 56. 60.100
     libavformat    56. 40.101 / 56. 40.101
     libavdevice    56.  4.100 / 56.  4.100
     libavfilter     5. 40.101 /  5. 40.101
     libavresample   2.  1.  0 /  2.  1.  0
     libswscale      3.  1.101 /  3.  1.101
     libswresample   1.  2.101 /  1.  2.101
     libpostproc    53.  3.100 / 53.  3.100
    [mp3 @ 0x21880e0] Skipping 0 bytes of junk at 0.
    [mp3 @ 0x21880e0] Estimating duration from bitrate, this may be inaccurate
    Input #0, mp3, from 'podcasts/audio1.mp3':
     Duration: 01:00:00.20, start: 0.000000, bitrate: 320 kb/s
       Stream #0:0: Audio: mp3, 44100 Hz, stereo, s16p, 320 kb/s
    File '/tmp/pod-sil.mp3' already exists. Overwrite ? [y/N] y
    Output #0, mp3, to '/tmp/pod-sil.mp3':
     Metadata:
       TSSE            : Lavf56.40.101
       Stream #0:0: Audio: mp3 (libmp3lame), 44100 Hz, stereo, fltp
       Metadata:
         encoder         : Lavc56.60.100 libmp3lame
    Stream mapping:
     Stream #0:0 -> #0:0 (mp3 (native) -> mp3 (libmp3lame))
    Press [q] to stop, [?] for help
    [libmp3lame @ 0x21999e0] Trying to remove 1152 samples, but the queue is empty
    size=   56253kB time=01:00:00.16 bitrate= 128.0kbits/s    
    video:0kB audio:56253kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.000439%
  • FFmpeg : concatenate video files (containing audio) without filter_complex

    28 décembre 2016, par DSalenga

    I have a problem when trying to concatenate multiple files in FFmpeg ; my goal is to create a video presentation by concatenating different types of slides :

    (a) Image slides, which are converted into videos by looping the frame for a while. These type of slides do not have audio, so I add a silent audio track to them :

    ffmpeg -f lavfi -i anullsrc=channel_layout=stereo:sample_rate=44100 -loop 1 -i inputFile.png -c:v libx264 -shortest -c:a aac -pix_fmt yuv420p -movflags faststart -profile:v high -r 30 -t 3 -level 4.0 -preset veryfast -crf 23 outputA.mp4

    (b) Video slides, which have an overlaid watermark and last until the video is over. If the file does not contain audio, this is added in the same way as in the previous case :

    -y -i inputFile.mp4 -i Watermark.jpg -filter_complex "[0]scale=1280:720,setsar=sar=1/1[0b]; [1]scale=1280:720[1b]; [0b][1b]overlay=0:0[ov]"  -c:v libx264 -shortest -c:a aac -pix_fmt yuv420p -movflags faststart -profile:v high -r 30 -t 2.8400055 -level 4.0 -preset veryfast -crf 23 outputB.mp4

    -y -i inputFile.mp4 -i Watermark.jpg -f lavfi -i anullsrc=channel_layout=stereo:sample_rate=44100 -filter_complex "[0]scale=1280:720,setsar=sar=1/1[0b]; [1]scale=1280:720[1b]; [0b][1b]overlay=0:0[ov]"  -c:v libx264 -shortest -c:a aac -pix_fmt yuv420p -movflags faststart -profile:v high -r 30 -t 2.8400055 -level 4.0 -preset veryfast -crf 23 outputC.mp4

    So, once I have all the generated files and a .txt file with all filenames, I want to concatenate using the simple command :

    -y -f concat -safe 0 -i textfile.txt -c copy  outputConcat.mp4

    Unfortunately, the result I obtain is far from perfect, as the audio screw everything up ; I know that audio is the problem because calling the same instruction without taking audio into account (that is, with -c:v copy -an instead of -c copy) works fine.

    One solution I’ve been testing is to use the concat filter inside filter_complex (transcoding both audio and video again), but I am concerned about speed, and this process is slow enough to be discarded.

    -y  -i Slide1.mp4 -i Slide2.mp4 -i Slide3.mp4 -filter_complex " [0:v:0][0:a:0] [1:v:0][1:a:0] [2:v:0][2:a:0] concat=n=3:v=1:a=1[v][a]" -map "[v]" -map "[a]" -c:v libx264 -c:a aac -pix_fmt yuv420p -movflags faststart -profile:v high -r 30 -level 4.0 -preset veryfast -crf 23 Report.mp4

    Another idea I had was to : (1) concatenate only audio tracks inside the filter_complex (much faster), (2) concatenate only video without using filter_complex (using a .txt file and -c:v copy -an), (3) add the audio obtained in (1) in the result obtained in (2). However, the duration of the resulting audio obtained in (1) is shorter than duration of the video obtained in (2).
    Knowing that all audio tracks are encoded with aac and have the same sampling frequency, the only parameter that changes from one to another is the number of kb/s.

    Can you please help me finding out a way to concatenate these video slides without having to use filter_complex ?

    Thank you very much !

  • High pitched audio or no audio at all when converting AVI video to MP4 with FFmpeg [closed]

    15 août 2023, par Karen S

    I'm pretty new to FFmpeg and I'm having trouble converting a video from AVI format to MP4. I'm trying to convert pcm_s16le to aac. No matter what audio stream I use, the resulting audio in the MP4 file is either very high pitched and choppy (stream 1) or the audio stream is silent (stream 2).

    


    The AVI video has two audio streams :

    


    Stream #0:1: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
Stream #0:2: Audio: pcm_s16le, 32000 Hz, stereo, s16, 1024 kb/s


    


    In VLC Media Player the video plays fine and it uses the second audio stream.

    


    When I run ffmpeg -i input.avi -vcodec libx264 -crf 27 output.mp4 in my terminal, the output audio in the MP4 file is very high pitched and choppy in VLC.
This is the codec information for the audio stream in VLC after the conversion :

    


    Codec: MPEG AAC Audio (mp4a)
Type: Audio
Channels: Stereo
Sample rate: 48000 Hz
Bits per sample: 32


    


    When I specify the audio stream and codec the resulting video is silent.

    


    ffmpeg -i input.avi -map 0:v:0 -vcodec libx264 -crf 29 -map 0:a:1 -acodec aac output.mp4


    


    This is the terminal output from FFmpeg :

    


    FILEPATH -i "input.avi" -map 0:v:0 -vcodec libx264 -crf 29 -map 0:a:1 -acodec aac "output.mp4"
ffmpeg version 2023-06-11-git-09621fd7d9-full_build-www.gyan.dev Copyright (c) 2000-2023 the FFmpeg developers
  built with gcc 12.2.0 (Rev10, 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-bzlib --enable-lzma --enable-libsnappy --enable-zlib --enable-librist --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libaribb24 --enable-libaribcaption --enable-libdav1d --enable-libdavs2 --enable-libuavs3d --enable-libzvbi --enable-librav1e --enable-libsvtav1 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libaom --enable-libjxl --enable-libopenjpeg --enable-libvpx --enable-mediafoundation --enable-libass --enable-frei0r --enable-libfreetype --enable-libfribidi --enable-liblensfun --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libvpl --enable-libshaderc --enable-vulkan --enable-libplacebo --enable-opencl --enable-libcdio --enable-libgme --enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libshine --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libcodec2 --enable-libilbc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-ladspa --enable-libbs2b --enable-libflite --enable-libmysofa --enable-librubberband --enable-libsoxr --enable-chromaprint
  libavutil      58. 13.100 / 58. 13.100
  libavcodec     60. 17.100 / 60. 17.100
  libavformat    60.  6.100 / 60.  6.100
  libavdevice    60.  2.100 / 60.  2.100
  libavfilter     9.  8.101 /  9.  8.101
  libswscale      7.  3.100 /  7.  3.100
  libswresample   4. 11.100 /  4. 11.100
  libpostproc    57.  2.100 / 57.  2.100
[avi @ 000002533665a400] Switching to NI mode, due to poor interleaving
Input #0, avi, from 'input.avi':
  Duration: 00:10:40.64, start: 0.000000, bitrate: 28852 kb/s
  Stream #0:0: Video: dvvideo, yuv411p, 720x480 [SAR 32:27 DAR 16:9], 25000 kb/s, SAR 8:9 DAR 4:3, 60k fps, 29.97 tbr, 60k tbn
  Stream #0:1: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
  Stream #0:2: Audio: pcm_s16le, 32000 Hz, stereo, s16, 1024 kb/s
File 'output.mp4' already exists. Overwrite? [y/N] y
Stream mapping:
  Stream #0:0 -> #0:0 (dvvideo (native) -> h264 (libx264))
  Stream #0:2 -> #0:1 (pcm_s16le (native) -> aac (native))
Press [q] to stop, [?] for help
[libx264 @ 00000253366702c0] using SAR=8/9
[libx264 @ 00000253366702c0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 @ 00000253366702c0] profile High 4:2:2, level 3.0, 4:2:2, 8-bit
[libx264 @ 00000253366702c0] 264 - core 164 r3107 a8b68eb - H.264/MPEG-4 AVC codec - Copyleft 2003-2023 - 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=29.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:
    encoder         : Lavf60.6.100
  Stream #0:0: Video: h264 (avc1 / 0x31637661), yuv422p(tv, bottom coded first (swapped)), 720x480 [SAR 8:9 DAR 4:3], q=2-31, 29.97 fps, 30k tbn
    Metadata:
      encoder         : Lavc60.17.100 libx264
    Side data:
      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A
  Stream #0:1: Audio: aac (LC) (mp4a / 0x6134706D), 32000 Hz, stereo, fltp, 128 kb/s
    Metadata:
      encoder         : Lavc60.17.100 aac
[dvvideo @ 000002533879d780] Concealing bitstream errors.41 bitrate= 901.6kbits/s speed=2.01x
    Last message repeated 76 times
[dvvideo @ 000002533878f640] Concealing bitstream errors.43 bitrate= 925.1kbits/s speed=1.97x
    Last message repeated 19 times
[out#0/mp4 @ 00000253366770c0] video:72743kB audio:119kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.649282%
frame=19200 fps= 58 q=-1.0 Lsize=   73335kB time=00:10:40.61 bitrate= 937.8kbits/s speed=1.92x
[libx264 @ 00000253366702c0] frame I:99    Avg QP:28.84  size: 35252
[libx264 @ 00000253366702c0] frame P:4922  Avg QP:31.82  size:  9208
[libx264 @ 00000253366702c0] frame B:14179 Avg QP:36.03  size:  1811
[libx264 @ 00000253366702c0] consecutive B-frames:  1.2%  0.8%  1.1% 97.0%
[libx264 @ 00000253366702c0] mb I  I16..4: 13.7% 74.6% 11.7%
[libx264 @ 00000253366702c0] mb P  I16..4:  1.7%  6.7%  1.1%  P16..4: 38.6% 13.2%  9.3%  0.0%  0.0%    skip:29.3%
[libx264 @ 00000253366702c0] mb B  I16..4:  0.2%  0.5%  0.0%  B16..8: 37.3%  2.8%  0.7%  direct: 2.1%  skip:56.3%  L0:42.5% L1:52.2% BI: 5.3%
[libx264 @ 00000253366702c0] 8x8 transform intra:69.6% inter:71.7%
[libx264 @ 00000253366702c0] coded y,uvDC,uvAC intra: 65.4% 59.0% 8.7% inter: 12.9% 7.0% 0.1%
[libx264 @ 00000253366702c0] i16 v,h,dc,p: 12% 64%  7% 16%
[libx264 @ 00000253366702c0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 11% 26% 26%  5%  6%  5%  8%  5%  8%
[libx264 @ 00000253366702c0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu:  9% 48% 15%  4%  5%  4%  7%  3%  5%
[libx264 @ 00000253366702c0] i8c dc,h,v,p: 61% 19% 16%  4%
[libx264 @ 00000253366702c0] Weighted P-Frames: Y:3.5% UV:1.3%
[libx264 @ 00000253366702c0] ref P L0: 55.4% 15.5% 20.6%  8.2%  0.3%
[libx264 @ 00000253366702c0] ref B L0: 89.3%  8.2%  2.5%
[libx264 @ 00000253366702c0] ref B L1: 95.5%  4.5%
[libx264 @ 00000253366702c0] kb/s:930.17
[aac @ 00000253382c31c0] Qavg: 65536.000


    


    Could someone point me in the right direction please ? I've tried doing the conversion with Handbrake as well and the audio is still choppy.