
Recherche avancée
Autres articles (47)
-
List of compatible distributions
26 avril 2011, parThe table below is the list of Linux distributions compatible with the automated installation script of MediaSPIP. Distribution nameVersion nameVersion number Debian Squeeze 6.x.x Debian Weezy 7.x.x Debian Jessie 8.x.x Ubuntu The Precise Pangolin 12.04 LTS Ubuntu The Trusty Tahr 14.04
If you want to help us improve this list, you can provide us access to a machine whose distribution is not mentioned above or send the necessary fixes to add (...) -
Personnaliser en ajoutant son logo, sa bannière ou son image de fond
5 septembre 2013, parCertains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;
-
Configuration spécifique pour PHP5
4 février 2011, parPHP5 est obligatoire, vous pouvez l’installer en suivant ce tutoriel spécifique.
Il est recommandé dans un premier temps de désactiver le safe_mode, cependant, s’il est correctement configuré et que les binaires nécessaires sont accessibles, MediaSPIP devrait fonctionner correctement avec le safe_mode activé.
Modules spécifiques
Il est nécessaire d’installer certains modules PHP spécifiques, via le gestionnaire de paquet de votre distribution ou manuellement : php5-mysql pour la connectivité avec la (...)
Sur d’autres sites (8721)
-
Merging two audio files in Android using FFMPEG
1er juillet 2021, par JeremyI'm working on an application that takes two audio files, and merges them into the respected channels. The way they are being equalized are not as good as I had hoped, So I want to adjust the volume of each file during the mixing phase. I've seen a couple of examples online, like this, this, and
[this][3]
.. but none of them are working for me. Can someone direct me in the right direction with this ? Much appreciation !


I am using this library to execute : https://github.com/WritingMinds/ffmpeg-android-java



Here is my code (EDIT)



String files = "-i " + mVoiceFile.getAbsolutePath() + " -i " + mBeatFile.getAbsolutePath();
String filter = "-filter_complex [0:a]volume=0.99[a1];[1:a]volume=0.3[a2][a1][a2]amerge=inputs=2,volume=1.3,pan=stereo|c0



enter code here



and here are my errors from running.



04-06 12:17:34.079 30975-30975/me.rapchat.rapchat E/Studio Process: WARNING: linker: /data/user/0/me.rapchat.rapchat/files/ffmpeg has text relocations. This is wasting memory and prevents security hardening. Please fix.
04-06 12:17:34.306 30975-30975/me.rapchat.rapchat E/Studio Process: ffmpeg version n2.4.2 Copyright (c) 2000-2014 the FFmpeg developers
04-06 12:17:34.306 30975-30975/me.rapchat.rapchat E/Studio Process: built on Oct 7 2014 15:08:46 with gcc 4.8 (GCC)
04-06 12:17:34.306 30975-30975/me.rapchat.rapchat E/Studio Process: configuration: --target-os=linux --cross-prefix=/home/sb/Source-Code/ffmpeg-android/toolchain-android/bin/arm-linux-androideabi- --arch=arm --cpu=cortex-a8 --enable-runtime-cpudetect --sysroot=/home/sb/Source-Code/ffmpeg-android/toolchain-android/sysroot --enable-pic --enable-libx264 --enable-libass --enable-libfreetype --enable-libfribidi --enable-fontconfig --enable-pthreads --disable-debug --disable-ffserver --enable-version3 --enable-hardcoded-tables --disable-ffplay --disable-ffprobe --enable-gpl --enable-yasm --disable-doc --disable-shared --enable-static --pkg-config=/home/sb/Source-Code/ffmpeg-android/ffmpeg-pkg-config --prefix=/home/sb/Source-Code/ffmpeg-android/build/armeabi-v7a-neon --extra-cflags='-I/home/sb/Source-Code/ffmpeg-android/toolchain-android/include -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fno-strict-overflow -fstack-protector-all -mfpu=neon' --extra-ldflags='-L/home/sb/Source-Code/ffmpeg-android/toolchain-android/lib -Wl,-z,relro -Wl,-z,now -pie' --extra-libs='-lpng -lexpat -lm' --extra-cxxflags=
04-06 12:17:34.307 30975-30975/me.rapchat.rapchat E/Studio Process: libavutil 54. 7.100 / 54. 7.100
04-06 12:17:34.307 30975-30975/me.rapchat.rapchat E/Studio Process: libavcodec 56. 1.100 / 56. 1.100
04-06 12:17:34.307 30975-30975/me.rapchat.rapchat E/Studio Process: libavformat 56. 4.101 / 56. 4.101
04-06 12:17:34.307 30975-30975/me.rapchat.rapchat E/Studio Process: libavdevice 56. 0.100 / 56. 0.100
04-06 12:17:34.308 30975-30975/me.rapchat.rapchat E/Studio Process: libavfilter 5. 1.100 / 5. 1.100
04-06 12:17:34.308 30975-30975/me.rapchat.rapchat E/Studio Process: libswscale 3. 0.100 / 3. 0.100
04-06 12:17:34.308 30975-30975/me.rapchat.rapchat E/Studio Process: libswresample 1. 1.100 / 1. 1.100
04-06 12:17:34.308 30975-30975/me.rapchat.rapchat E/Studio Process: libpostproc 53. 0.100 / 53. 0.100
04-06 12:17:34.372 30975-30975/me.rapchat.rapchat E/Studio Process: Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/data/user/0/me.rapchat.rapchat/cache/recording.m4a':
04-06 12:17:34.373 30975-30975/me.rapchat.rapchat E/Studio Process: Metadata:
04-06 12:17:34.373 30975-30975/me.rapchat.rapchat E/Studio Process: major_brand : mp42
04-06 12:17:34.373 30975-30975/me.rapchat.rapchat E/Studio Process: minor_version : 0
04-06 12:17:34.374 30975-30975/me.rapchat.rapchat E/Studio Process: compatible_brands: isommp42
04-06 12:17:34.374 30975-30975/me.rapchat.rapchat E/Studio Process: creation_time : 2016-04-06 19:17:33
04-06 12:17:34.374 30975-30975/me.rapchat.rapchat E/Studio Process: Duration: 00:00:01.56, start: 0.000000, bitrate: 144 kb/s
04-06 12:17:34.375 30975-30975/me.rapchat.rapchat E/Studio Process: Stream #0:0(eng): Audio: aac (mp4a / 0x6134706D), 44100 Hz, mono, fltp, 128 kb/s (default)
04-06 12:17:34.375 30975-30975/me.rapchat.rapchat E/Studio Process: Metadata:
04-06 12:17:34.375 30975-30975/me.rapchat.rapchat E/Studio Process: creation_time : 2016-04-06 19:17:33
04-06 12:17:34.375 30975-30975/me.rapchat.rapchat E/Studio Process: handler_name : SoundHandle
04-06 12:17:34.401 30975-30975/me.rapchat.rapchat E/Studio Process: Input #1, mov,mp4,m4a,3gp,3g2,mj2, from '/data/user/0/me.rapchat.rapchat/cache/beats/d3c37d60-ed50-4c00-b454-4e399a7858ff.m4a':
04-06 12:17:34.401 30975-30975/me.rapchat.rapchat E/Studio Process: Metadata:
04-06 12:17:34.401 30975-30975/me.rapchat.rapchat E/Studio Process: major_brand : mp42
04-06 12:17:34.401 30975-30975/me.rapchat.rapchat E/Studio Process: minor_version : 0
04-06 12:17:34.401 30975-30975/me.rapchat.rapchat E/Studio Process: compatible_brands: mp42isom
04-06 12:17:34.401 30975-30975/me.rapchat.rapchat E/Studio Process: creation_time : 1993-11-24 14:46:42
04-06 12:17:34.401 30975-30975/me.rapchat.rapchat E/Studio Process: encoder : Max 0.9.1
04-06 12:17:34.401 30975-30975/me.rapchat.rapchat E/Studio Process: iTunSMPB : 00000000 00000840 000003c0 000000000035dc00 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
04-06 12:17:34.401 30975-30975/me.rapchat.rapchat E/Studio Process: date : 2015
04-06 12:17:34.401 30975-30975/me.rapchat.rapchat E/Studio Process: Duration: 00:01:20.04, start: 0.047891, bitrate: 129 kb/s
04-06 12:17:34.402 30975-30975/me.rapchat.rapchat E/Studio Process: Stream #1:0(eng): Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 127 kb/s (default)
04-06 12:17:34.402 30975-30975/me.rapchat.rapchat E/Studio Process: Metadata:
04-06 12:17:34.402 30975-30975/me.rapchat.rapchat E/Studio Process: creation_time : 1993-11-24 14:46:42
04-06 12:17:34.404 30975-30975/me.rapchat.rapchat E/Studio Process: [NULL @ 0xb5e4fc00] Unable to find a suitable output format for '[a1][a2]amerge,pan=stereo|c0me.rapchat.rapchat E/Studio Process: [a1][a2]amerge,pan=stereo|c0me.rapchat.rapchat E/Studio Status Failed: WARNING: linker: /data/user/0/me.rapchat.rapchat/files/ffmpeg has text relocations. This is wasting memory and prevents security hardening. Please fix.
 ffmpeg version n2.4.2 Copyright (c) 2000-2014 the FFmpeg developers
 built on Oct 7 2014 15:08:46 with gcc 4.8 (GCC)
 configuration: --target-os=linux --cross-prefix=/home/sb/Source-Code/ffmpeg-android/toolchain-android/bin/arm-linux-androideabi- --arch=arm --cpu=cortex-a8 --enable-runtime-cpudetect --sysroot=/home/sb/Source-Code/ffmpeg-android/toolchain-android/sysroot --enable-pic --enable-libx264 --enable-libass --enable-libfreetype --enable-libfribidi --enable-fontconfig --enable-pthreads --disable-debug --disable-ffserver --enable-version3 --enable-hardcoded-tables --disable-ffplay --disable-ffprobe --enable-gpl --enable-yasm --disable-doc --disable-shared --enable-static --pkg-config=/home/sb/Source-Code/ffmpeg-android/ffmpeg-pkg-config --prefix=/home/sb/Source-Code/ffmpeg-android/build/armeabi-v7a-neon --extra-cflags='-I/home/sb/Source-Code/ffmpeg-android/toolchain-android/include -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fno-strict-overflow -fstack-protector-all -mfpu=neon' --extra-ldflags='-L/home/sb/Source-Code/ffmpeg-android/toolchain-android/lib -Wl,-z,relro -Wl,-z,now -pie' --extra-libs='-lpng -lexpat -lm' --extra-cxxflags=
 libavutil 54. 7.100 / 54. 7.100
 libavcodec 56. 1.100 / 56. 1.100
 libavformat 56. 4.101 / 56. 4.101
 libavdevice 56. 0.100 / 56. 0.100
 libavfilter 5. 1.100 / 5. 1.100
 libswscale 3. 0.100 / 3. 0.100
 libswresample 1. 1.100 / 1. 1.100
 libpostproc 53. 0.100 / 53. 0.100
 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/data/user/0/me.rapchat.rapchat/cache/recording.m4a':
 Metadata:
 major_brand : mp42
 minor_version : 0
 compatible_brands: isommp42
 creation_time : 2016-04-06 19:17:33
 Duration: 00:00:01.56, start: 0.000000, bitrate: 144 kb/s
 Stream #0:0(eng): Audio: aac (mp4a / 0x6134706D), 44100 Hz, mono, fltp, 128 kb/s (default)
 Metadata:
 creation_time : 2016-04-06 19:17:33
 handler_name : SoundHandle
 Input #1, mov,mp4,m4a,3gp,3g2,mj2, from '/data/user/0/me.rapchat.rapchat/cache/beats/d3c37d60-ed50-4c00-b454-4e399a7858ff.m4a':
 Metadata:
 major_brand : mp42
 minor_version : 0
 compatible_brands: mp42isom
 creation_time : 1993-11-24 14:46:42
 encoder : Max 0.9.1
 iTunSMPB : 00000000 00000840 000003c0 000000000035dc00 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
 date : 2015
 Duration: 00:01:20.04, start: 0.047891, bitrate: 129 kb/s
 Stream #1:0(eng): Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 127 kb/s (default)
 Metadata:
 creation_time : 1993-11-24 14:46:42
 [NULL @ 0xb5e4fc00] Unable to find a suitable output format for '[a1][a2]amerge,pan=stereo|c0code>


-
How to speed up creating video mosaic with ffmpeg
7 janvier 2020, par DALER RAHIMOVI’m looking to speed up ffmpeg pipeline in some way (camera configuration, different filters or any other ideas would be appreciated).
I have a device that captures videos streams and later creates mosaic video view from 4 cameras. The main issue I’m having is that it’s taking too long to create mosaic video. There is no GPU on the device that could be used to accelerate the process so I’m left with camera configurations (Hikvision).
Here is what I have so far
About 160 sec on Intel J-1900 :
- 5 min video files,
- 640*480 resolution,
- h264 encoding,
- 10 fps,
- 1024 max bitrate,
- 10 I-frame interval,Command that I’m using :
ffmpeg -y -i 1578324600-1-stitched.mp4 -i 1578324600-1-stitched.mp4 -i 1578324600-1-stitched.mp4 -i 1578324600-1-stitched.mp4 \
-filter_complex " \
color=c=black:size=1280x720 [base]; \
[0:v] setpts=PTS-STARTPTS, scale=640x360 [cam0]; \
[1:v] setpts=PTS-STARTPTS, scale=640x360 [cam1]; \
[2:v] setpts=PTS-STARTPTS, scale=640x360 [cam2]; \
[3:v] setpts=PTS-STARTPTS, scale=640x360 [cam3]; \
[base][cam0] overlay=shortest=1:x=0:y=0 [z1]; \
[z1][cam1] overlay=shortest=1:x=640:y=0 [z2]; \
[z2][cam2] overlay=shortest=1:x=0:y=360 [z3]; \
[z3][cam3] overlay=shortest=1:x=640:y=360 \
" \
-an -c:v libx264 -x264-params keyint=10 \
-movflags faststart -preset fast -nostats -loglevel quiet -r 10.000000 mosaic.mp4Thanks
Here is full output as requested
ffmpeg -y -i 1578324600-1-stitched.mp4 -i 1578324600-1-stitched.mp4 -i 1578324600-1-stitched.mp4 -i 1578324600-1-stitched.mp4 \
> -filter_complex " \
> color=c=black:size=1280x720 [base]; \
> [0:v] setpts=PTS-STARTPTS, scale=640x360 [cam0]; \
> [1:v] setpts=PTS-STARTPTS, scale=640x360 [cam1]; \
> [2:v] setpts=PTS-STARTPTS, scale=640x360 [cam2]; \
> [3:v] setpts=PTS-STARTPTS, scale=640x360 [cam3]; \
> [base][cam0] overlay=shortest=1:x=0:y=0 [z1]; \
> [z1][cam1] overlay=shortest=1:x=640:y=0 [z2]; \
> [z2][cam2] overlay=shortest=1:x=0:y=360 [z3]; \
> [z3][cam3] overlay=shortest=1:x=640:y=360 \
> " \
> -an -c:v libx264 -x264-params keyint=10 \
> -movflags faststart -preset fast -nostats -r 10.000000 mosaic.mp4
ffmpeg version 2.8.15-0ubuntu0.16.04.1 Copyright (c) 2000-2018 the FFmpeg developers
built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.10) 20160609
configuration: --prefix=/usr --extra-version=0ubuntu0.16.04.1 --build-suffix=-ffmpeg -y -i 1578324600-1-stitched.mp4 -i 1578324600-1-stitched.mp4 -i 1578324600-1-stitched.mp4 -i 1578324600-1-stitched.mp4 -filter_complex " \
color=c=black:size=1280x720 [base]; \
[0:v] setpts=PTS-STARTPTS, scale=640x360 [cam0]; \
[1:v] setpts=PTS-STARTPTS, scale=640x360 [cam1]; \
[2:v] setpts=PTS-STARTPTS, scale=640x360 [cam2]; \
[3:v] setpts=PTS-STARTPTS, scale=640x360 [cam3]; \
[base][cam0] overlay=shortest=1:x=0:y=0 [z1]; \
[z1][cam1] overlay=shortest=1:x=640:y=0 [z2]; \
[z2][cam2] overlay=shortest=1:x=0:y=360 [z3]; \
[z3][cam3] overlay=shortest=1:x=640:y=360 \
" -an -c:v libx264 -x264-params keyint=10 -movflags faststart -preset fast -r 10.000000 mosaic.mp4
ffmpeg version 2.8.15-0ubuntu0.16.04.1 Copyright (c) 2000-2018 the FFmpeg developers
built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.10) 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
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '1578324600-1-stitched.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf56.40.101
Duration: 00:05:00.07, start: 0.000000, bitrate: 96 kb/s
Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709), 640x480, 95 kb/s, 10 fps, 25 tbr, 10240 tbn, 20 tbc (default)
Metadata:
handler_name : VideoHandler
Input #1, mov,mp4,m4a,3gp,3g2,mj2, from '1578324600-1-stitched.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf56.40.101
Duration: 00:05:00.07, start: 0.000000, bitrate: 96 kb/s
Stream #1:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709), 640x480, 95 kb/s, 10 fps, 25 tbr, 10240 tbn, 20 tbc (default)
Metadata:
handler_name : VideoHandler
Input #2, mov,mp4,m4a,3gp,3g2,mj2, from '1578324600-1-stitched.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf56.40.101
Duration: 00:05:00.07, start: 0.000000, bitrate: 96 kb/s
Stream #2:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709), 640x480, 95 kb/s, 10 fps, 25 tbr, 10240 tbn, 20 tbc (default)
Metadata:
handler_name : VideoHandler
Input #3, mov,mp4,m4a,3gp,3g2,mj2, from '1578324600-1-stitched.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf56.40.101
Duration: 00:05:00.07, start: 0.000000, bitrate: 96 kb/s
Stream #3:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709), 640x480, 95 kb/s, 10 fps, 25 tbr, 10240 tbn, 20 tbc (default)
Metadata:
handler_name : VideoHandler
[libx264 @ 0x171c9e0] using SAR=1/1
[libx264 @ 0x171c9e0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2
[libx264 @ 0x171c9e0] profile High, level 3.1
[libx264 @ 0x171c9e0] 264 - core 148 r2643 5c65704 - H.264/MPEG-4 AVC codec - Copyleft 2003-2015 - http://www.videolan.org/x264.html - options: cabac=1 ref=2 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=6 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=6 lookahead_threads=1 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=1 keyint=10 keyint_min=1 scenecut=40 intra_refresh=0 rc_lookahead=10 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 'mosaic.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf56.40.101
Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], q=-1--1, 10 fps, 10240 tbn, 10 tbc (default)
Metadata:
encoder : Lavc56.60.100 libx264
Stream mapping:
Stream #0:0 (h264) -> setpts
Stream #1:0 (h264) -> setpts
Stream #2:0 (h264) -> setpts
Stream #3:0 (h264) -> setpts
overlay -> Stream #0:0 (libx264)
Press [q] to stop, [?] for help
[mp4 @ 0x1730600] Starting second pass: moving the moov atom to the beginning of the filerop=4497
frame= 3002 fps= 17 q=-1.0 Lsize= 51052kB time=00:05:00.00 bitrate=1394.1kbits/s dup=0 drop=4498
video:51017kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.068308%
[libx264 @ 0x171c9e0] frame I:301 Avg QP:15.80 size:154257
[libx264 @ 0x171c9e0] frame P:959 Avg QP:21.69 size: 5486
[libx264 @ 0x171c9e0] frame B:1742 Avg QP:22.73 size: 315
[libx264 @ 0x171c9e0] consecutive B-frames: 22.0% 0.0% 5.8% 72.2%
[libx264 @ 0x171c9e0] mb I I16..4: 9.7% 31.0% 59.4%
[libx264 @ 0x171c9e0] mb P I16..4: 0.6% 0.7% 0.2% P16..4: 14.5% 2.8% 2.4% 0.0% 0.0% skip:78.7%
[libx264 @ 0x171c9e0] mb B I16..4: 0.0% 0.0% 0.0% B16..8: 2.7% 0.3% 0.0% direct: 1.4% skip:95.5% L0:25.9% L1:73.3% BI: 0.9%
[libx264 @ 0x171c9e0] 8x8 transform intra:31.8% inter:43.5%
[libx264 @ 0x171c9e0] coded y,uvDC,uvAC intra: 83.2% 85.2% 69.5% inter: 3.0% 6.3% 0.7%
[libx264 @ 0x171c9e0] i16 v,h,dc,p: 35% 21% 8% 36%
[libx264 @ 0x171c9e0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 27% 42% 10% 3% 2% 3% 6% 4% 5%
[libx264 @ 0x171c9e0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 25% 33% 9% 6% 5% 5% 7% 5% 6%
[libx264 @ 0x171c9e0] i8c dc,h,v,p: 44% 29% 20% 7%
[libx264 @ 0x171c9e0] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 @ 0x171c9e0] ref P L0: 93.8% 6.2%
[libx264 @ 0x171c9e0] ref B L0: 91.7% 8.3%
[libx264 @ 0x171c9e0] ref B L1: 89.3% 10.7%
[libx264 @ 0x171c9e0] kb/s:1392.16 -
ffmpeg determine correct codec to use
8 avril 2020, par nhaI am trying to use
.y4m
files that I feed into Chrome for playing.
This is the only format that I can use.


I have a set of
.y4m
files that are working for my use case, taken from here.
For example let's say that I use the file mobile_qcif_7.5fps.y4m.


I also have a
.mp4
file (specifically the samplesmall.mp4
file from techslides ). I know how to convertsmall.mp4
tosmall.y4m
with the following command :


ffmpeg -y -i small.mp4 small.y4m



I would like the resulting file to be accepted by Chrome, just like the other file.
What options should I use (and how to find them) ?



Additional information



ffprobe
gives :


$ ffprobe small.y4m 
avprobe version 0.8.13-6:0.8.13-0ubuntu0.13.10.1, Copyright (c) 2007-2014 the Libav developers
 built on Jul 15 2014 13:48:35 with gcc 4.8.1
[yuv4mpegpipe @ 0x23160c0] Estimating duration from bitrate, this may be inaccurate
Input #0, yuv4mpegpipe, from 'small.y4m':
 Duration: N/A, bitrate: N/A
 Stream #0.0: Video: rawvideo, yuv420p, 560x320, 30 fps, 30 tbr, 30 tbn, 30 tbc


$ ffprobe mobile_qcif_7.5fps.y4m
avprobe version 0.8.13-6:0.8.13-0ubuntu0.13.10.1, Copyright (c) 2007-2014 the Libav developers
 built on Jul 15 2014 13:48:35 with gcc 4.8.1
[yuv4mpegpipe @ 0x1e080c0] max_analyze_duration reached
[yuv4mpegpipe @ 0x1e080c0] Estimating duration from bitrate, this may be inaccurate
Input #0, yuv4mpegpipe, from 'mobile_qcif_7.5fps.y4m':
 Duration: N/A, bitrate: N/A
 Stream #0.0: Video: rawvideo, yuv420p, 176x144, PAR 128:117 DAR 1408:1053, 7.50 fps, 7.50 tbr, 7.50 tbn, 7.50 tbc




OS : I am using ffmpeg in Ubuntu 13.10 from the default repository : I ran
sudo apt-get install ffmpeg libavcodec-extra-53



Complete console output



$ ffmpeg -y -i small.mp4 small.y4m
ffmpeg version 0.8.13-6:0.8.13-0ubuntu0.13.10.1, Copyright (c) 2000-2014 the Libav developers
 built on Jul 15 2014 13:48:35 with gcc 4.8.1
*** THIS PROGRAM IS DEPRECATED ***
This program is only provided for compatibility and will be removed in a future release. Please use avconv instead.
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'small.mp4':
 Metadata:
 major_brand : mp42
 minor_version : 0
 compatible_brands: mp42isomavc1
 creation_time : 2010-03-20 21:29:11
 encoder : HandBrake 0.9.4 2009112300
 Duration: 00:00:05.56, start: 0.000000, bitrate: 551 kb/s
 Stream #0.0(und): Video: h264 (Constrained Baseline), yuv420p, 560x320, 465 kb/s, 30 fps, 30 tbr, 90k tbn, 60 tbc
 Metadata:
 creation_time : 2010-03-20 21:29:11
 Stream #0.1(eng): Audio: aac, 48000 Hz, mono, s16, 83 kb/s
 Metadata:
 creation_time : 2010-03-20 21:29:11
[buffer @ 0x7274e0] w:560 h:320 pixfmt:yuv420p
Output #0, yuv4mpegpipe, to 'small.y4m':
 Metadata:
 major_brand : mp42
 minor_version : 0
 compatible_brands: mp42isomavc1
 creation_time : 2010-03-20 21:29:11
 encoder : Lavf53.21.1
 Stream #0.0(und): Video: rawvideo, yuv420p, 560x320, q=2-31, 200 kb/s, 90k tbn, 30 tbc
 Metadata:
 creation_time : 2010-03-20 21:29:11
Stream mapping:
 Stream #0.0 -> #0.0
Press ctrl-c to stop encoding
frame= 166 fps= 0 q=0.0 Lsize= 43576kB time=5.53 bitrate=64513.5kbits/s 
video:0kB audio:0kB global headers:0kB muxing overhead inf%




Head of the files



Not sure if this is relevant, but the text content of both files begin like that :



mobile_qcif_7.5fps.y4m
YUV4MPEG2 W176 H144 F15:2 Ip A128:117
FRAME

small.y4m (invalid)
YUV4MPEG2 W560 H320 F15:2 Ip A0:0 C420mpeg2 XYSCSS=420MPEG2
FRAME




Additional experiment



Taking the sample
mobile_qcif_7.5fps.y4m
, turning it into a.mp4
file and then back into a.y4m
produces an invalid file (at least for Chrome).


Answer to comments in the answer of @SirDarius



Following the suggestion of @SirDarius ; I tried the following commands.
They failed to produce a valid file.



# [COMMAND] # [RESULT] [HEADER]
ffmpeg -i small.mp4 -vf fps=7.5 -an -c:v rawvideo -f yuv4mpegpipe -pix_fmt yuv444p -y small_yuv444p.y4m # KO YUV4MPEG2 W560 H320 F15:2 Ip A0:0 C444 XYSCSS=444
ffmpeg -i small.mp4 -vf fps=7.5 -an -c:v rawvideo -f yuv4mpegpipe -pix_fmt yuv422p -y small_yuv422p.y4m # KO YUV4MPEG2 W560 H320 F15:2 Ip A0:0 C422 XYSCSS=422
ffmpeg -i small.mp4 -vf fps=7.5 -an -c:v rawvideo -f yuv4mpegpipe -pix_fmt yuv420p -y small_yuv420p.y4m # KO YUV4MPEG2 W560 H320 F15:2 Ip A0:0 C420mpeg2 XYSCSS=420MPEG2
ffmpeg -i small.mp4 -vf fps=7.5 -an -c:v rawvideo -f yuv4mpegpipe -pix_fmt yuv411p -y small_yuv411p.y4m # KO YUV4MPEG2 W560 H320 F15:2 Ip A0:0 C411 XYSCSS=411

ffmpeg -i small.mp4 -vf fps=7.5 -an -c:v rawvideo -f yuv4mpegpipe -strict -1 -pix_fmt yuv420p9 -y small_yuv420p9.y4m # KO YUV4MPEG2 W560 H320 F15:2 Ip A0:0 C420p9 XYSCSS=420P9
ffmpeg -i small.mp4 -vf fps=7.5 -an -c:v rawvideo -f yuv4mpegpipe -strict -1 -pix_fmt yuv420p12 -y small_yuv420p12.y4m # KO YUV4MPEG2 W560 H320 F15:2 Ip A0:0 C420p12 XYSCSS=420P12
ffmpeg -i small.mp4 -vf fps=7.5 -an -c:v rawvideo -f yuv4mpegpipe -strict -1 -pix_fmt yuv420p14 -y small_yuv420p14.y4m # KO YUV4MPEG2 W560 H320 F15:2 Ip A0:0 C420p14 XYSCSS=420P14
ffmpeg -i small.mp4 -vf fps=7.5 -an -c:v rawvideo -f yuv4mpegpipe -strict -1 -pix_fmt yuv420p16 -y small_yuv420p16.y4m # KO YUV4MPEG2 W560 H320 F15:2 Ip A0:0 C420p16 XYSCSS=420P16




When trying other formats (like
yuv420p12be
, which was in the output of-pix_fmts
), I had the following output (hence my previous trials) :


$ ffmpeg -i small.mp4 -vf fps=7.5 -an -c:v rawvideo -f yuv4mpegpipe -pix_fmt yuv420p12be -y small_yuv420p12be.y4m 
ffmpeg version N-68884-g3ebd76a Copyright (c) 2000-2015 the FFmpeg developers
 built on Jan 6 2015 11:03:21 with gcc 4.8 (Ubuntu/Linaro 4.8.1-10ubuntu9)
 configuration: 
 libavutil 54. 16.100 / 54. 16.100
 libavcodec 56. 19.100 / 56. 19.100
 libavformat 56. 18.100 / 56. 18.100
 libavdevice 56. 3.100 / 56. 3.100
 libavfilter 5. 6.100 / 5. 6.100
 libswscale 3. 1.101 / 3. 1.101
 libswresample 1. 1.100 / 1. 1.100
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x21d0220] overread end of atom 'colr' by 1 bytes
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'small.mp4':
 Metadata:
 major_brand : mp42
 minor_version : 0
 compatible_brands: mp42isomavc1
 creation_time : 2010-03-20 21:29:11
 encoder : HandBrake 0.9.4 2009112300
 Duration: 00:00:05.57, start: 0.000000, bitrate: 551 kb/s
 Stream #0:0(und): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p(tv, bt709), 560x320, 465 kb/s, 30 fps, 30 tbr, 90k tbn, 60 tbc (default)
 Metadata:
 creation_time : 2010-03-20 21:29:11
 encoder : JVT/AVC Coding
 Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, mono, fltp, 83 kb/s (default)
 Metadata:
 creation_time : 2010-03-20 21:29:11
[yuv4mpegpipe @ 0x21d8180] ERROR: yuv4mpeg can only handle yuv444p, yuv422p, yuv420p, yuv411p and gray8 pixel formats. And using 'strict -1' also yuv444p9, yuv422p9, yuv420p9, yuv444p10, yuv422p10, yuv420p10, yuv444p12, yuv422p12, yuv420p12, yuv444p14, yuv422p14, yuv420p14, yuv444p16, yuv422p16, yuv420p16 and gray16 pixel formats. Use -pix_fmt to select one.
Output #0, yuv4mpegpipe, to 'small_yuv420p12be.y4m':
 Metadata:
 major_brand : mp42
 minor_version : 0
 compatible_brands: mp42isomavc1
 encoder : Lavf56.18.100
 Stream #0:0(und): Video: rawvideo ([12][11]3Y / 0x59330B0C), yuv420p12be, 560x320, q=2-31, 200 kb/s, 7.50 fps, 7.50 tbn, 7.50 tbc (default)
 Metadata:
 creation_time : 2010-03-20 21:29:11
 encoder : Lavc56.19.100 rawvideo
Stream mapping:
 Stream #0:0 -> #0:0 (h264 (native) -> rawvideo (native))
Could not write header for output file #0 (incorrect codec parameters ?): Input/output error




After that, I also tried to edit with an hexadecimal editor (bless) the small_yuv420p.y4m file. I replace
C420mpeg2
byC420
, and the file was accepted by Chrome.
What does the number in420p[number]
correspond to ? It is not explained there.
Is there any way to makeffmpeg
output this kind of header files ?


@SirDarius, thank you again for your help.



The question



(in case you forgot after this text blob)



How can I convert the
small.mp4
into asmall.y4m
file that has the same properties as themobile_qcif_7.5fps.y4m
file ?