Advanced search

Medias (91)

Other articles (27)

  • La sauvegarde automatique de canaux SPIP

    1 April 2010, by

    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 April 2011, by

    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 January 2010, by

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

On other websites (3565)

  • How do I change audio language using ffmpeg in video files contaning two or more audio tracks

    19 May 2020, by warezsoftwarez

    I am transcoding video files, that contain 2 audio tracks - Polish and English. Unfortunately my transcoder messes somehow with metadata, and at the output, when I'm checking video file using MediaInfo, i see that both audio tracks are described as English. I'd like to change description of 1st audio track to Polish, so accordingly to ffmpeg documentation:

    



    To set the language of the first audio stream:
ffmpeg -i INPUT -metadata:s:a:0 language=eng OUTPUT


    



    Unfortunately, running command:

    



    ffmpeg -i INPUTPATH -metadata:s:a:0 language=pol OUTPUTPATH


    



    to overwrite input file resulted in saving file thats size is 63KB but it is described as Polish audio (no second audio track - English somehow was deleted)

    



    When I used this command, to save output file as another file, to avoid overwriting if something misses (which is current situation), but using parameter -metadata:s:a:4 because I thought that maybe I'm reading metadata from ffmpeg incorrectly, it resulted in saving output file as 800Mb with only English (no Polish track).

    



    I don't know what should I change in this command to run as I want it to - just changing metadata of first audio track language to Polish.

    



    Here is full ffmpeg output:

    



    C:\Users\user>ffmpeg -i F:\Path\33244813_6000_1_trailer.mp4 -metadata:s:a:4 language=pol F:\Path\testtest.mp4
ffmpeg version N-91931-gb69ea742ab Copyright (c) 2000-2018 the FFmpeg developers
  built with gcc 8.2.1 (GCC) 20180813
  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enabl
e-libass --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amr
wb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enab
le-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --
enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc -
-enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --e
nable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth
  libavutil      56. 19.101 / 56. 19.101
  libavcodec     58. 30.100 / 58. 30.100
  libavformat    58. 18.100 / 58. 18.100
  libavdevice    58.  4.103 / 58.  4.103
  libavfilter     7. 29.100 /  7. 29.100
  libswscale      5.  2.100 /  5.  2.100
  libswresample   3.  2.100 /  3.  2.100
  libpostproc    55.  2.100 / 55.  2.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'F:\Path\33244813_6000_1_trailer.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 1
    compatible_brands: isom
    creation_time   : 2020-04-22T16:18:04.000000Z
  Duration: 00:40:39.12, start: 0.000000, bitrate: 8848 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 1920x1080 [SAR 1:1 DAR 16:9], Closed C
aptions, 5068 kb/s, 25 fps, 25 tbr, 120k tbn, 50 tbc (default)
    Metadata:
      creation_time   : 2020-04-22T16:18:04.000000Z
      handler_name    : Video
    Stream #0:1(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 1920x1080 [SAR 1:1 DAR 16:9], Closed C
aptions, 1857 kb/s, 25 fps, 25 tbr, 120k tbn, 50 tbc (default)
    Metadata:
      creation_time   : 2020-04-22T16:18:04.000000Z
      handler_name    : Video
    Stream #0:2(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 1280x720 [SAR 1:1 DAR 16:9], Closed Ca
ptions, 902 kb/s, 25 fps, 25 tbr, 120k tbn, 50 tbc (default)
    Metadata:
      creation_time   : 2020-04-22T16:18:04.000000Z
      handler_name    : Video
    Stream #0:3(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 640x480 [SAR 4:3 DAR 16:9], Closed Cap
tions, 628 kb/s, 25 fps, 25 tbr, 120k tbn, 50 tbc (default)
    Metadata:
      creation_time   : 2020-04-22T16:18:04.000000Z
      handler_name    : Video
    Stream #0:4(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 125 kb/s (default)
    Metadata:
      creation_time   : 2020-04-22T16:18:04.000000Z
      handler_name    : Sound
    Stream #0:5(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, 5.1, fltp, 253 kb/s (default)
    Metadata:
      creation_time   : 2020-04-22T16:18:04.000000Z
      handler_name    : Sound
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
  Stream #0:5 -> #0:1 (aac (native) -> aac (native))
Press [q] to stop, [?] for help
[libx264 @ 00000012bef91f80] using SAR=1/1
[libx264 @ 00000012bef91f80] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 @ 00000012bef91f80] profile High, level 4.0, 4:2:0, 8-bit
[libx264 @ 00000012bef91f80] 264 - core 157 r2932 303c484 - H.264/MPEG-4 AVC codec - Copyleft 2003-2018 - http://www.vid
eolan.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=34 looka
head_threads=5 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_lookah
ead=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 'F:\Path\testtest.mp4'
:
  Metadata:
    major_brand     : isom
    minor_version   : 1
    compatible_brands: isom
    encoder         : Lavf58.18.100
    Stream #0:0(und): Video: h264 (libx264) (avc1 / 0x31637661), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], q=-1--1, 25 fps,
 12800 tbn, 25 tbc (default)
    Metadata:
      creation_time   : 2020-04-22T16:18:04.000000Z
      handler_name    : Video
      encoder         : Lavc58.30.100 libx264
    Side data:
      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
    Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, 5.1, fltp, 341 kb/s (default)
    Metadata:
      creation_time   : 2020-04-22T16:18:04.000000Z
      handler_name    : Sound
      encoder         : Lavc58.30.100 aac
frame=60981 fps= 84 q=-1.0 Lsize=  816313kB time=00:40:39.12 bitrate=2741.7kbits/s dup=3 drop=0 speed=3.36x
video:713292kB audio:101322kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.208512%
[libx264 @ 00000012bef91f80] frame I:769   Avg QP:16.36  size: 46713
[libx264 @ 00000012bef91f80] frame P:37125 Avg QP:19.81  size: 15059
[libx264 @ 00000012bef91f80] frame B:23087 Avg QP:21.11  size:  5866
[libx264 @ 00000012bef91f80] consecutive B-frames: 40.4% 24.0% 10.2% 25.5%
[libx264 @ 00000012bef91f80] mb I  I16..4: 40.3% 58.0%  1.7%
[libx264 @ 00000012bef91f80] mb P  I16..4:  6.2% 12.5%  0.1%  P16..4: 29.8%  3.7%  2.7%  0.0%  0.0%    skip:45.0%
[libx264 @ 00000012bef91f80] mb B  I16..4:  1.0%  1.7%  0.0%  B16..8: 27.9%  1.1%  0.1%  direct: 2.0%  skip:66.2%  L0:49
.4% L1:49.3% BI: 1.3%
[libx264 @ 00000012bef91f80] 8x8 transform intra:65.3% inter:95.1%
[libx264 @ 00000012bef91f80] coded y,uvDC,uvAC intra: 24.7% 39.7% 3.2% inter: 7.0% 14.6% 0.0%
[libx264 @ 00000012bef91f80] i16 v,h,dc,p: 34% 26% 13% 28%
[libx264 @ 00000012bef91f80] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 25% 15% 41%  3%  3%  4%  3%  3%  2%
[libx264 @ 00000012bef91f80] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 32% 25% 20%  3%  6%  5%  4%  3%  2%
[libx264 @ 00000012bef91f80] i8c dc,h,v,p: 58% 19% 20%  3%
[libx264 @ 00000012bef91f80] Weighted P-Frames: Y:0.1% UV:0.0%
[libx264 @ 00000012bef91f80] ref P L0: 72.2%  6.3% 15.8%  5.7%  0.0%
[libx264 @ 00000012bef91f80] ref B L0: 86.6% 11.5%  1.9%
[libx264 @ 00000012bef91f80] ref B L1: 97.6%  2.4%
[libx264 @ 00000012bef91f80] kb/s:2395.53
[aac @ 00000012bef93b00] Qavg: 471.415


    


  • FFmpeg return 'invalid argument' only for some runs, even tought is the same code

    20 September 2021, by Gustavo Marinho

    I have a code in python where i need to use FFmpeg to merge a audio and a video downloaded using pytube together:

    


            for video in p.videos:
            video.streams.filter(file_extension='mp4',resolution='480p')[0].download(parent_dir+'/mp4/processing/video')
            print(video.streams.filter(only_audio=True)[1].download(parent_dir+'/mp4/processing/audio'))

            subprocess.run([

                r'c:\FFmpeg\bin\ffmpeg', '-i',
                os.path.join(parent_dir+'/mp4/processing/video',video.streams.filter(file_extension='mp4',resolution='480p')[0].default_filename)
                ,'-i',
                os.path.join(parent_dir+'/mp4/processing/audio',video.streams.filter(only_audio=True)[1].default_filename),
                '-c:v','copy','-c:a','copy',
                os.path.join(parent_dir+'/mp4',video.streams.filter(file_extension='mp4',resolution='480p')[0].title+'.mp4')

            ])


    


    I tought the code was working perfectly, but in some cases, the FFmpeg returns "invalid argument", like this example:

    


    ffmpeg version 4.4-full_build-www.gyan.dev Copyright (c) 2000-2021 the FFmpeg developers
  built with gcc 10.2.0 (Rev6, 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-libsnappy --enable-zlib --enable-librist --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libdav1d --enable-libzvbi --enable-librav1e --enable-libsvtav1 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-libass --enable-frei0r --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-libglslang --enable-vulkan --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-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      56. 70.100 / 56. 70.100
  libavcodec     58.134.100 / 58.134.100
  libavformat    58. 76.100 / 58. 76.100
  libavdevice    58. 13.100 / 58. 13.100
  libavfilter     7.110.100 /  7.110.100
  libswscale      5.  9.100 /  5.  9.100
  libswresample   3.  9.100 /  3.  9.100
  libpostproc    55.  9.100 / 55.  9.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'D:/videos/mp4/processing/video\Dropkick Murphys - Rose Tattoo (Video).mp4':
  Metadata:
    major_brand     : dash
    minor_version   : 0
    compatible_brands: iso6avc1mp41
    creation_time   : 2020-04-04T10:16:52.000000Z
  Duration: 00:05:26.08, start: 0.000000, bitrate: 557 kb/s
  Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709, progressive), 854x480 [SAR 1:1 DAR 427:240], 7 kb/s, 23.98 fps, 23.98 tbr, 24k tbn, 47.95 tbc (default)
    Metadata:
      creation_time   : 2020-04-04T10:16:52.000000Z
      handler_name    : ISO Media file produced by Google Inc.
      vendor_id       : [0][0][0][0]
Input #1, mov,mp4,m4a,3gp,3g2,mj2, from 'D:/videos/mp4/processing/audio\Dropkick Murphys - Rose Tattoo (Video).mp4':
  Metadata:
    major_brand     : dash
    minor_version   : 0
    compatible_brands: iso6mp41
    creation_time   : 2020-04-04T10:16:00.000000Z
  Duration: 00:05:26.12, start: 0.000000, bitrate: 129 kb/s
  Stream #1:0(eng): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 3 kb/s (default)
    Metadata:
      creation_time   : 2020-04-04T10:16:00.000000Z
      handler_name    : ISO Media file produced by Google Inc.
      vendor_id       : [0][0][0][0]
D:/videos/mp4\Dropkick Murphys - "Rose Tattoo" (Video).mp4: Invalid argument


    


    For some reason, the FFmpeg say that my output name is invalid, but i don't understand why, given that i ran the code multiple times before and it worked perfectly

    


    Thanks in advance, sorry for my bad english :3

    


  • Laravel FFMpeg - FFMpeg cannot edit existing files in-place

    28 September 2020, by wlaskovic

    After I wanted to upload a video in the queue was returned a failed job.

    


     [2020-09-25 13:24:25][125] Processing: App\Jobs\ConvertVideoForStreaming <br /> [2020-09-25 13:24:26][125] Failed:     App\Jobs\ConvertVideoForStreaming&#xA;

    &#xA;

    So I've took from the DB failed_jobs table the response and run the following:

    &#xA;

      C:\ffmpeg\bin\ffmpeg.exe -y -i "C:\wamp64\www\laravel-stream\storage\app/public\WF3UL8fJTSE7BMxa.mp4" -threads 12 -vcodec libx264 -acodec libmp3lame -b:v 500k -refs 6 -coder 1 -sc_threshold 40 -flags &#x2B;loop -me_range 16 -subq 7 -i_qfactor 0.71 -qcomp 0.6 -qdiff 4 -trellis 1 -b:a 128k -vf "[in]scale=720:360 [out]" -pass 1 -passlogfile "C:\Users\wlask\AppData\Local\Temp\ffmpeg-passes5f6dd36a4519fd1fev/pass-5f6dd36a452c9" "C:\wamp64\www\laravel-stream\storage\app/public\WF3UL8fJTSE7BMxa.mp4"&#xA;

    &#xA;

    Which returned the following:

    &#xA;

    ffmpeg version 4.3.1 Copyright (c) 2000-2020 the FFmpeg developers&#xA;  built with gcc 10.2.1 (GCC) 20200726&#xA;  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libsrt --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libgsm --disable-w32threads --enable-libmfx --enable-ffnvcodec --enable-cuda-llvm --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt --enable-amf&#xA;  libavutil      56. 51.100 / 56. 51.100&#xA;  libavcodec     58. 91.100 / 58. 91.100&#xA;  libavformat    58. 45.100 / 58. 45.100&#xA;  libavdevice    58. 10.100 / 58. 10.100&#xA;  libavfilter     7. 85.100 /  7. 85.100&#xA;  libswscale      5.  7.100 /  5.  7.100&#xA;  libswresample   3.  7.100 /  3.  7.100&#xA;  libpostproc    55.  7.100 / 55.  7.100&#xA;Input #0, mov,mp4,m4a,3gp,3g2,mj2, from &#x27;C:\wamp64\www\laravel-stream\storage\app/public\WF3UL8fJTSE7BMxa.mp4&#x27;:&#xA;  Metadata:&#xA;    major_brand     : mp42&#xA;    minor_version   : 0&#xA;    compatible_brands: mp42mp41isomavc1&#xA;    creation_time   : 2015-08-07T09:13:02.000000Z&#xA;  Duration: 00:00:30.53, start: 0.000000, bitrate: 411 kb/s&#xA;    Stream #0:0(und): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 480x270 [SAR 1:1 DAR 16:9], 301 kb/s, 30 fps, 30 tbr, 30 tbn, 60 tbc (default)&#xA;    Metadata:&#xA;      creation_time   : 2015-08-07T09:13:02.000000Z&#xA;      handler_name    : L-SMASH Video Handler&#xA;      encoder         : AVC Coding&#xA;    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 112 kb/s (default)&#xA;    Metadata:&#xA;      creation_time   : 2015-08-07T09:13:02.000000Z&#xA;      handler_name    : L-SMASH Audio Handler&#xA;

    &#xA;

    &#xA;

    Output C:\wamp64\www\laravel-stream\storage\app/public\WF3UL8fJTSE7BMxa.mp4 same as Input #0 - exiting

    &#xA;

    FFmpeg cannot edit existing files in-place.

    &#xA;

    &#xA;

    This was returned after i've run the command from DB failed jobs table return.

    &#xA;

    How should I solve this?

    &#xA;