
Recherche avancée
Médias (1)
-
Somos millones 1
21 juillet 2014, par
Mis à jour : Juin 2015
Langue : français
Type : Video
Autres articles (109)
-
MediaSPIP version 0.1 Beta
16 avril 2011, parMediaSPIP 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 (...) -
Amélioration de la version de base
13 septembre 2013Jolie sélection multiple
Le plugin Chosen permet d’améliorer l’ergonomie des champs de sélection multiple. Voir les deux images suivantes pour comparer.
Il suffit pour cela d’activer le plugin Chosen (Configuration générale du site > Gestion des plugins), puis de configurer le plugin (Les squelettes > Chosen) en activant l’utilisation de Chosen dans le site public et en spécifiant les éléments de formulaires à améliorer, par exemple select[multiple] pour les listes à sélection multiple (...) -
Mise à jour de la version 0.1 vers 0.2
24 juin 2013, parExplications 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 (...)
Sur d’autres sites (9675)
-
ErrorCode 1 while merging 2 videos
10 janvier 2023, par Stéphane de LucaI am trying to merge two videos but have an error code 1.


My command is as follows :


final command =
 '-y $commandPaths -filter_complex \'[0:0][1:0]concat=n=${paths.length}:v=1:a=0[out]\' -map \'[out]\' $outputPath';



I see the following error :




I/flutter (17343) : Stream specifier ':0' in filtergraph description [0:0][1:0]concat=n=2:v=1:a=0[out] matches no streams.




Not easy to understand what caused this as I am not familiar with the lib.


I saw in a so that someone had the issue caused by the tw videos not having the same size.


The logs are as follows :


I/flutter (17343): Duration: 2.9345
I/flutter (17343): /data/user/0/com.example.shokaze/cache/PXL_20230104_041034414.TS.mp4 exists?: true
I/flutter (17343): Duration: 3.0677
I/flutter (17343): /data/user/0/com.example.shokaze/cache/PXL_20230104_041054379.TS.mp4 exists?: true
I/flutter (17343): Output duration; 6.0022


I/flutter (17343): About to executing: -y -i /data/user/0/com.example.shokaze/cache/PXL_20230104_041034414.TS.mp4 -i /data/user/0/com.example.shokaze/cache/PXL_20230104_041054379.TS.mp4 -filter_complex '[0:0][1:0]concat=n=2:v=1:a=0[out]' -map '[out]' /data/user/0/com.example.shokaze/app_flutter/output.mp4



I/flutter (17343): ffmpeg version n5.1.2
I/flutter (17343): Copyright (c) 2000-2022 the FFmpeg developers
I/flutter (17343): 
I/flutter (17343): 
I/flutter (17343): built with Android (7155654, based on r399163b1) clang version 11.0.5 (https://android.googlesource.com/toolchain/llvm-project 87f1315dfbea7c137aa2e6d362dbb457e388158d)
I/flutter (17343): 
I/flutter (17343): configuration: --cross-prefix=aarch64-linux-android- --sysroot=/files/android-sdk/ndk/22.1.7171670/toolchains/llvm/prebuilt/linux-x86_64/sysroot --prefix=/home/taner/Projects/ffmpeg-kit/prebuilt/android-arm64/ffmpeg --pkg-config=/usr/bin/pkg-config --enable-version3 --arch=aarch64 --cpu=armv8-a --target-os=android --enable-neon --enable-asm --enable-inline-asm --ar=aarch64-linux-android-ar --cc=aarch64-linux-android24-clang --cxx=aarch64-linux-android24-clang++ --ranlib=aarch64-linux-android-ranlib --strip=aarch64-linux-android-strip --nm=aarch64-linux-android-nm --extra-libs='-L/home/taner/Projects/ffmpeg-kit/prebuilt/android-arm64/cpu-features/lib -lndk_compat' --disable-autodetect --enable-cross-compile --enable-pic --enable-jni --enable-optimizations --enable-swscale --disable-static --enable-shared --enable-pthreads --enable-v4l2-m2m --disable-outdev=fbdev --disable-indev=fbdev --enable-small --disable-xmm-clobber-test --disable-debug --enable-lto --disable-neon-clobber-test --disable-programs --disab
I/flutter (17343): 
I/flutter (17343): libavutil 57. 28.100 / 57. 28.100
I/flutter (17343): 
I/flutter (17343): libavcodec 59. 37.100 / 59. 37.100
I/flutter (17343): 
I/flutter (17343): libavformat 59. 27.100 / 59. 27.100
I/flutter (17343): 
I/flutter (17343): libavdevice 59. 7.100 / 59. 7.100
I/flutter (17343): 
I/flutter (17343): libavfilter 8. 44.100 / 8. 44.100
I/flutter (17343): 
I/flutter (17343): libswscale 6. 7.100 / 6. 7.100
I/flutter (17343): 
I/flutter (17343): libswresample 4. 7.100 / 4. 7.100
I/flutter (17343): 
I/flutter (17343): Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/data/user/0/com.example.shokaze/cache/PXL_20230104_041034414.TS.mp4':
I/flutter (17343): 
I/flutter (17343): Metadata:
I/flutter (17343): 
I/flutter (17343): major_brand : 
I/flutter (17343): isom
I/flutter (17343): 
I/flutter (17343): 
I/flutter (17343): minor_version : 
I/flutter (17343): 131072
I/flutter (17343): 
I/flutter (17343): 
I/flutter (17343): compatible_brands: 
I/flutter (17343): isomiso2mp41
I/flutter (17343): 
I/flutter (17343): 
I/flutter (17343): creation_time : 
I/flutter (17343): 2023-01-04T04:10:38.000000Z
I/flutter (17343): 
I/flutter (17343): 
I/flutter (17343): location : 
I/flutter (17343): +48.8638+2.4376/
I/flutter (17343): 
I/flutter (17343): 
I/flutter (17343): location-eng : 
I/flutter (17343): +48.8638+2.4376/
I/flutter (17343): 
I/flutter (17343): 
I/flutter (17343): com.android.capture.fps: 
I/flutter (17343): 30.000000
I/flutter (17343): 
I/flutter (17343): 
I/flutter (17343): Duration: 
I/flutter (17343): 00:00:02.93
I/flutter (17343): , start: 
I/flutter (17343): 0.000000
I/flutter (17343): , bitrate: 
I/flutter (17343): 19691 kb/s
I/flutter (17343): 
I/flutter (17343): 
I/flutter (17343): Stream #0:0
I/flutter (17343): [0x1]
I/flutter (17343): (eng)
I/flutter (17343): : Data: none (mett / 0x7474656D), 53 kb/s
I/flutter (17343): (default)
I/flutter (17343): 
I/flutter (17343): 
I/flutter (17343): Metadata:
I/flutter (17343): 
I/flutter (17343): creation_time : 
I/flutter (17343): 2023-01-04T04:10:38.000000Z
I/flutter (17343): 
I/flutter (17343): 
I/flutter (17343): handler_name : 
I/flutter (17343): MetaHandle
I/flutter (17343): 
I/flutter (17343): 
I/flutter (17343): Stream #0:1
I/flutter (17343): [0x2]
I/flutter (17343): (eng)
I/flutter (17343): : Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 191 kb/s
I/flutter (17343): (default)
I/flutter (17343): 
I/flutter (17343): 
I/flutter (17343): Metadata:
I/flutter (17343): 
I/flutter (17343): creation_time : 
I/flutter (17343): 2023-01-04T04:10:38.000000Z
I/flutter (17343): 
I/flutter (17343): 
I/flutter (17343): handler_name : 
I/flutter (17343): SoundHandle
I/flutter (17343): 
I/flutter (17343): 
I/flutter (17343): vendor_id : 
I/flutter (17343): [0][0][0][0]
I/flutter (17343): 
I/flutter (17343): 
I/flutter (17343): Stream #0:2
I/flutter (17343): [0x3]
I/flutter (17343): (eng)
I/flutter (17343): : Video: hevc (hvc1 / 0x31637668), yuvj420p(pc, bt709), 1920x1080, 19436 kb/s
I/flutter (17343): , SAR 1:1 DAR 16:9
I/flutter (17343): , 
I/flutter (17343): 29.99 fps, 
I/flutter (17343): 30 tbr, 
I/flutter (17343): 90k tbn
I/flutter (17343): (default)
I/flutter (17343): 
I/flutter (17343): 
I/flutter (17343): Metadata:
I/flutter (17343): 
I/flutter (17343): creation_time : 
I/flutter (17343): 2023-01-04T04:10:38.000000Z
I/flutter (17343): 
I/flutter (17343): 
I/flutter (17343): handler_name : 
I/flutter (17343): VideoHandle
I/flutter (17343): 
I/flutter (17343): 
I/flutter (17343): vendor_id : 
I/flutter (17343): [0][0][0][0]
I/flutter (17343): 
I/flutter (17343): 
I/flutter (17343): Stream #0:3
I/flutter (17343): [0x4]
I/flutter (17343): (eng)
I/flutter (17343): : Data: none (mett / 0x7474656D)
I/flutter (17343): (default)
I/flutter (17343): 
I/flutter (17343): 
I/flutter (17343): Metadata:
I/flutter (17343): 
I/flutter (17343): creation_time : 
I/flutter (17343): 2023-01-04T04:10:38.000000Z
I/flutter (17343): 
I/flutter (17343): 
I/flutter (17343): handler_name : 
I/flutter (17343): MetaHandle
I/flutter (17343): 
I/flutter (17343): 
I/flutter (17343): Input #1, mov,mp4,m4a,3gp,3g2,mj2, from '/data/user/0/com.example.shokaze/cache/PXL_20230104_041054379.TS.mp4':
I/flutter (17343): 
I/flutter (17343): Metadata:
I/flutter (17343): 
I/flutter (17343): major_brand : 
I/flutter (17343): isom
I/flutter (17343): 
I/flutter (17343): 
I/flutter (17343): minor_version : 
I/flutter (17343): 131072
I/flutter (17343): 
I/flutter (17343): 
I/flutter (17343): compatible_brands: 
I/flutter (17343): isomiso2mp41
I/flutter (17343): 
I/flutter (17343): 
I/flutter (17343): creation_time : 
I/flutter (17343): 2023-01-04T04:10:58.000000Z
I/flutter (17343): 
I/flutter (17343): 
I/flutter (17343): location : 
I/flutter (17343): +48.8638+2.4376/
I/flutter (17343): 
I/flutter (17343): 
I/flutter (17343): location-eng : 
I/flutter (17343): +48.8638+2.4376/
I/flutter (17343): 
I/flutter (17343): 
I/flutter (17343): com.android.capture.fps: 
I/flutter (17343): 30.000000
I/flutter (17343): 
I/flutter (17343): 
I/flutter (17343): Duration: 
I/flutter (17343): 00:00:03.07
I/flutter (17343): , start: 
I/flutter (17343): 0.000000
I/flutter (17343): , bitrate: 
I/flutter (17343): 20104 kb/s
I/flutter (17343): 
I/flutter (17343): 
I/flutter (17343): Stream #1:0
I/flutter (17343): [0x1]
I/flutter (17343): (eng)
I/flutter (17343): : Data: none (mett / 0x7474656D), 54 kb/s
I/flutter (17343): (default)
I/flutter (17343): 
I/flutter (17343): 
I/flutter (17343): Metadata:
I/flutter (17343): 
I/flutter (17343): creation_time : 
I/flutter (17343): 2023-01-04T04:10:58.000000Z
I/flutter (17343): 
I/flutter (17343): 
I/flutter (17343): handler_name : 
I/flutter (17343): MetaHandle
I/flutter (17343): 
I/flutter (17343): 
I/flutter (17343): Stream #1:1
I/flutter (17343): [0x2]
I/flutter (17343): (eng)
I/flutter (17343): : Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 191 kb/s
I/flutter (17343): (default)
I/flutter (17343): 
I/flutter (17343): 
I/flutter (17343): Metadata:
I/flutter (17343): 
I/flutter (17343): creation_time : 
I/flutter (17343): 2023-01-04T04:10:58.000000Z
I/flutter (17343): 
I/flutter (17343): 
I/flutter (17343): handler_name : 
I/flutter (17343): SoundHandle
I/flutter (17343): 
I/flutter (17343): 
I/flutter (17343): vendor_id : 
I/flutter (17343): [0][0][0][0]
I/flutter (17343): 
I/flutter (17343): 
I/flutter (17343): Stream #1:2
I/flutter (17343): [0x3]
I/flutter (17343): (eng)
I/flutter (17343): : Video: hevc (hvc1 / 0x31637668), yuvj420p(pc, bt709), 1920x1080, 19848 kb/s
I/flutter (17343): , SAR 1:1 DAR 16:9
I/flutter (17343): , 
I/flutter (17343): 29.99 fps, 
I/flutter (17343): 30 tbr, 
I/flutter (17343): 90k tbn
I/flutter (17343): (default)
I/flutter (17343): 
I/flutter (17343): 
I/flutter (17343): Metadata:
I/flutter (17343): 
I/flutter (17343): creation_time : 
I/flutter (17343): 2023-01-04T04:10:58.000000Z
I/flutter (17343): 
I/flutter (17343): 
I/flutter (17343): handler_name : 
I/flutter (17343): VideoHandle
I/flutter (17343): 
I/flutter (17343): 
I/flutter (17343): vendor_id : 
I/flutter (17343): [0][0][0][0]
I/flutter (17343): 
I/flutter (17343): 
I/flutter (17343): Side data:
I/flutter (17343): 
I/flutter (17343): 
I/flutter (17343): displaymatrix: rotation of -90.00 degrees
I/flutter (17343): 
I/flutter (17343): 
I/flutter (17343): Stream #1:3
I/flutter (17343): [0x4]
I/flutter (17343): (eng)
I/flutter (17343): : Data: none (mett / 0x7474656D)
I/flutter (17343): (default)
I/flutter (17343): 
I/flutter (17343): 
I/flutter (17343): Metadata:
I/flutter (17343): 
I/flutter (17343): creation_time : 
I/flutter (17343): 2023-01-04T04:10:58.000000Z
I/flutter (17343): 
I/flutter (17343): 
I/flutter (17343): handler_name : 
I/flutter (17343): MetaHandle
I/flutter (17343): 
I/flutter (17343): 
I/flutter (17343): Stream specifier ':0' in filtergraph description [0:0][1:0]concat=n=2:v=1:a=0[out] matches no streams.
I/flutter (17343): 
I/flutter (17343): executing: -y -i /data/user/0/com.example.shokaze/cache/PXL_20230104_041034414.TS.mp4 -i /data/user/0/com.example.shokaze/cache/PXL_20230104_041054379.TS.mp4 -filter_complex '[0:0][1:0]concat=n=2:v=1:a=0[out]' -map '[out]' /data/user/0/com.example.shokaze/app_flutter/output.mp4
I/flutter (17343): error 1



Therefore I tried to add a resize in the command without success as follows :.


final command =
 '$commandPaths -filter_complex \'[0:v]scale=1920:1080[0:a] [1:v]scale=1920:1080[1:a] concat=n=${paths.length}:v=1:a=1[v][a]\' -map \'[v]\' -map \'[a]\' $outputPath';




This time the logs say :




I/flutter (17343) : [AVFilterGraph @ 0xb4000074ea6265f0] No output pad can be associated to link label '1:v'.




The logs are as follows :


I/flutter (17343): Duration: 2.9345
I/flutter (17343): /data/user/0/com.example.shokaze/cache/PXL_20230104_041034414.TS.mp4 exists?: true
I/flutter (17343): Duration: 3.0677
I/flutter (17343): /data/user/0/com.example.shokaze/cache/PXL_20230104_041054379.TS.mp4 exists?: true
I/flutter (17343): Output duration; 6.0022
I/flutter (17343): About to executing: -i /data/user/0/com.example.shokaze/cache/PXL_20230104_041034414.TS.mp4 -i /data/user/0/com.example.shokaze/cache/PXL_20230104_041054379.TS.mp4 -filter_complex '[0:v]scale=1920:1080[0:a] [1:v]scale=1920:1080[1:a] concat=n=2:v=1:a=1[v][a]' -map '[v]' -map '[a]' /data/user/0/com.example.shokaze/app_flutter/output.mp4
I/flutter (17343): ffmpeg version n5.1.2
I/flutter (17343): Copyright (c) 2000-2022 the FFmpeg developers
I/flutter (17343): 
I/flutter (17343): 
I/flutter (17343): built with Android (7155654, based on r399163b1) clang version 11.0.5 (https://android.googlesource.com/toolchain/llvm-project 87f1315dfbea7c137aa2e6d362dbb457e388158d)
I/flutter (17343): 
I/flutter (17343): configuration: --cross-prefix=aarch64-linux-android- --sysroot=/files/android-sdk/ndk/22.1.7171670/toolchains/llvm/prebuilt/linux-x86_64/sysroot --prefix=/home/taner/Projects/ffmpeg-kit/prebuilt/android-arm64/ffmpeg --pkg-config=/usr/bin/pkg-config --enable-version3 --arch=aarch64 --cpu=armv8-a --target-os=android --enable-neon --enable-asm --enable-inline-asm --ar=aarch64-linux-android-ar --cc=aarch64-linux-android24-clang --cxx=aarch64-linux-android24-clang++ --ranlib=aarch64-linux-android-ranlib --strip=aarch64-linux-android-strip --nm=aarch64-linux-android-nm --extra-libs='-L/home/taner/Projects/ffmpeg-kit/prebuilt/android-arm64/cpu-features/lib -lndk_compat' --disable-autodetect --enable-cross-compile --enable-pic --enable-jni --enable-optimizations --enable-swscale --disable-static --enable-shared --enable-pthreads --enable-v4l2-m2m --disable-outdev=fbdev --disable-indev=fbdev --enable-small --disable-xmm-clobber-test --disable-debug --enable-lto --disable-neon-clobber-test --disable-programs --disab
I/flutter (17343): 
I/flutter (17343): libavutil 57. 28.100 / 57. 28.100
I/flutter (17343): 
I/flutter (17343): libavcodec 59. 37.100 / 59. 37.100
I/flutter (17343): 
I/flutter (17343): libavformat 59. 27.100 / 59. 27.100
I/flutter (17343): 
I/flutter (17343): libavdevice 59. 7.100 / 59. 7.100
I/flutter (17343): 
I/flutter (17343): libavfilter 8. 44.100 / 8. 44.100
I/flutter (17343): 
I/flutter (17343): libswscale 6. 7.100 / 6. 7.100
I/flutter (17343): 
I/flutter (17343): libswresample 4. 7.100 / 4. 7.100
I/flutter (17343): 
I/flutter (17343): Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/data/user/0/com.example.shokaze/cache/PXL_20230104_041034414.TS.mp4':
I/flutter (17343): 
I/flutter (17343): Metadata:
I/flutter (17343): 
I/flutter (17343): major_brand : 
I/flutter (17343): isom
I/flutter (17343): 
I/flutter (17343): 
I/flutter (17343): minor_version : 
I/flutter (17343): 131072
I/flutter (17343): 
I/flutter (17343): 
I/flutter (17343): compatible_brands: 
I/flutter (17343): isomiso2mp41
I/flutter (17343): 
I/flutter (17343): 
I/flutter (17343): creation_time : 
I/flutter (17343): 2023-01-04T04:10:38.000000Z
I/flutter (17343): 
I/flutter (17343): 
I/flutter (17343): location : 
I/flutter (17343): +48.8638+2.4376/
I/flutter (17343): 
I/flutter (17343): 
I/flutter (17343): location-eng : 
I/flutter (17343): +48.8638+2.4376/
I/flutter (17343): 
I/flutter (17343): 
I/flutter (17343): com.android.capture.fps: 
I/flutter (17343): 30.000000
I/flutter (17343): 
I/flutter (17343): 
I/flutter (17343): Duration: 
I/flutter (17343): 00:00:02.93
I/flutter (17343): , start: 
I/flutter (17343): 0.000000
I/flutter (17343): , bitrate: 
I/flutter (17343): 19691 kb/s
I/flutter (17343): 
I/flutter (17343): 
I/flutter (17343): Stream #0:0
I/flutter (17343): [0x1]
I/flutter (17343): (eng)
I/flutter (17343): : Data: none (mett / 0x7474656D), 53 kb/s
I/flutter (17343): (default)
I/flutter (17343): 
I/flutter (17343): 
I/flutter (17343): Metadata:
I/flutter (17343): 
I/flutter (17343): creation_time : 
I/flutter (17343): 2023-01-04T04:10:38.000000Z
I/flutter (17343): 
I/flutter (17343): 
I/flutter (17343): handler_name : 
I/flutter (17343): MetaHandle
I/flutter (17343): 
I/flutter (17343): 
I/flutter (17343): Stream #0:1
I/flutter (17343): [0x2]
I/flutter (17343): (eng)
I/flutter (17343): : Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 191 kb/s
I/flutter (17343): (default)
I/flutter (17343): 
I/flutter (17343): 
I/flutter (17343): Metadata:
I/flutter (17343): 
I/flutter (17343): creation_time : 
I/flutter (17343): 2023-01-04T04:10:38.000000Z
I/flutter (17343): 
I/flutter (17343): 
I/flutter (17343): handler_name : 
I/flutter (17343): SoundHandle
I/flutter (17343): 
I/flutter (17343): 
I/flutter (17343): vendor_id : 
I/flutter (17343): [0][0][0][0]
I/flutter (17343): 
I/flutter (17343): 
I/flutter (17343): Stream #0:2
I/flutter (17343): [0x3]
I/flutter (17343): (eng)
I/flutter (17343): : Video: hevc (hvc1 / 0x31637668), yuvj420p(pc, bt709), 1920x1080, 19436 kb/s
I/flutter (17343): , SAR 1:1 DAR 16:9
I/flutter (17343): , 
I/flutter (17343): 29.99 fps, 
I/flutter (17343): 30 tbr, 
I/flutter (17343): 90k tbn
I/flutter (17343): (default)
I/flutter (17343): 
I/flutter (17343): 
I/flutter (17343): Metadata:
I/flutter (17343): 
I/flutter (17343): creation_time : 
I/flutter (17343): 2023-01-04T04:10:38.000000Z
I/flutter (17343): 
I/flutter (17343): 
I/flutter (17343): handler_name : 
I/flutter (17343): VideoHandle
I/flutter (17343): 
I/flutter (17343): 
I/flutter (17343): vendor_id : 
I/flutter (17343): [0][0][0][0]
I/flutter (17343): 
I/flutter (17343): 
I/flutter (17343): Stream #0:3
I/flutter (17343): [0x4]
I/flutter (17343): (eng)
I/flutter (17343): : Data: none (mett / 0x7474656D)
I/flutter (17343): (default)
I/flutter (17343): 
I/flutter (17343): 
I/flutter (17343): Metadata:
I/flutter (17343): 
I/flutter (17343): creation_time : 
I/flutter (17343): 2023-01-04T04:10:38.000000Z
I/flutter (17343): 
I/flutter (17343): 
I/flutter (17343): handler_name : 
I/flutter (17343): MetaHandle
I/flutter (17343): 
I/flutter (17343): 
I/flutter (17343): Input #1, mov,mp4,m4a,3gp,3g2,mj2, from '/data/user/0/com.example.shokaze/cache/PXL_20230104_041054379.TS.mp4':
I/flutter (17343): 
I/flutter (17343): Metadata:
I/flutter (17343): 
I/flutter (17343): major_brand : 
I/flutter (17343): isom
I/flutter (17343): 
I/flutter (17343): 
I/flutter (17343): minor_version : 
I/flutter (17343): 131072
I/flutter (17343): 
I/flutter (17343): 
I/flutter (17343): compatible_brands: 
I/flutter (17343): isomiso2mp41
I/flutter (17343): 
I/flutter (17343): 
I/flutter (17343): creation_time : 
I/flutter (17343): 2023-01-04T04:10:58.000000Z
I/flutter (17343): 
I/flutter (17343): 
I/flutter (17343): location : 
I/flutter (17343): +48.8638+2.4376/
I/flutter (17343): 
I/flutter (17343): 
I/flutter (17343): location-eng : 
I/flutter (17343): +48.8638+2.4376/
I/flutter (17343): 
I/flutter (17343): 
I/flutter (17343): com.android.capture.fps: 
I/flutter (17343): 30.000000
I/flutter (17343): 
I/flutter (17343): 
I/flutter (17343): Duration: 
I/flutter (17343): 00:00:03.07
I/flutter (17343): , start: 
I/flutter (17343): 0.000000
I/flutter (17343): , bitrate: 
I/flutter (17343): 20104 kb/s
I/flutter (17343): 
I/flutter (17343): 
I/flutter (17343): Stream #1:0
I/flutter (17343): [0x1]
I/flutter (17343): (eng)
I/flutter (17343): : Data: none (mett / 0x7474656D), 54 kb/s
I/flutter (17343): (default)
I/flutter (17343): 
I/flutter (17343): 
I/flutter (17343): Metadata:
I/flutter (17343): 
I/flutter (17343): creation_time : 
I/flutter (17343): 2023-01-04T04:10:58.000000Z
I/flutter (17343): 
I/flutter (17343): 
I/flutter (17343): handler_name : 
I/flutter (17343): MetaHandle
I/flutter (17343): 
I/flutter (17343): 
I/flutter (17343): Stream #1:1
I/flutter (17343): [0x2]
I/flutter (17343): (eng)
I/flutter (17343): : Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 191 kb/s
I/flutter (17343): (default)
I/flutter (17343): 
I/flutter (17343): 
I/flutter (17343): Metadata:
I/flutter (17343): 
I/flutter (17343): creation_time : 
I/flutter (17343): 2023-01-04T04:10:58.000000Z
I/flutter (17343): 
I/flutter (17343): 
I/flutter (17343): handler_name : 
I/flutter (17343): SoundHandle
I/flutter (17343): 
I/flutter (17343): 
I/flutter (17343): vendor_id : 
I/flutter (17343): [0][0][0][0]
I/flutter (17343): 
I/flutter (17343): 
I/flutter (17343): Stream #1:2
I/flutter (17343): [0x3]
I/flutter (17343): (eng)
I/flutter (17343): : Video: hevc (hvc1 / 0x31637668), yuvj420p(pc, bt709), 1920x1080, 19848 kb/s
I/flutter (17343): , SAR 1:1 DAR 16:9
I/flutter (17343): , 
I/flutter (17343): 29.99 fps, 
I/flutter (17343): 30 tbr, 
I/flutter (17343): 90k tbn
I/flutter (17343): (default)
I/flutter (17343): 
I/flutter (17343): 
I/flutter (17343): Metadata:
I/flutter (17343): 
I/flutter (17343): creation_time : 
I/flutter (17343): 2023-01-04T04:10:58.000000Z
I/flutter (17343): 
I/flutter (17343): 
I/flutter (17343): handler_name : 
I/flutter (17343): VideoHandle
I/flutter (17343): 
I/flutter (17343): 
I/flutter (17343): vendor_id : 
I/flutter (17343): [0][0][0][0]
I/flutter (17343): 
I/flutter (17343): 
I/flutter (17343): Side data:
I/flutter (17343): 
I/flutter (17343): 
I/flutter (17343): displaymatrix: rotation of -90.00 degrees
I/flutter (17343): 
I/flutter (17343): 
I/flutter (17343): Stream #1:3
I/flutter (17343): [0x4]
I/flutter (17343): (eng)
I/flutter (17343): : Data: none (mett / 0x7474656D)
I/flutter (17343): (default)
I/flutter (17343): 
I/flutter (17343): 
I/flutter (17343): Metadata:
I/flutter (17343): 
I/flutter (17343): creation_time : 
I/flutter (17343): 2023-01-04T04:10:58.000000Z
I/flutter (17343): 
I/flutter (17343): 
I/flutter (17343): handler_name : 
I/flutter (17343): MetaHandle
I/flutter (17343): 
I/flutter (17343): 
I/flutter (17343): [AVFilterGraph @ 0xb4000074ea6265f0] No output pad can be associated to link label '1:v'.
I/flutter (17343): 
I/flutter (17343): Error initializing complex filters.
I/flutter (17343): 
I/flutter (17343): Invalid argument
I/flutter (17343): 
I/flutter (17343): Conversion failed!
I/flutter (17343): 
I/flutter (17343): executing: -i /data/user/0/com.example.shokaze/cache/PXL_20230104_041034414.TS.mp4 -i /data/user/0/com.example.shokaze/cache/PXL_20230104_041054379.TS.mp4 -filter_complex '[0:v]scale=1920:1080[0:a] [1:v]scale=1920:1080[1:a] concat=n=2:v=1:a=1[v][a]' -map '[v]' -map '[a]' /data/user/0/com.example.shokaze/app_flutter/output.mp4
I/flutter (17343): error 1



-
FFMPEG audio transcoding using libav* libraries
25 mai 2022, par vinvinodI am writing an audio transcoding application using ffmpeg libraries. 
Here is my code



/*
 * File: main.cpp
 * Author: vinod
 * Compile with "g++ -std=c++11 -o audiotranscode main.cpp -lavformat -lavcodec -lavutil -lavfilter"
 * 
 */


 #if !defined PRId64 || PRI_MACROS_BROKEN
 #undef PRId64
 #define PRId64 "lld"
 #endif

 #define __STDC_FORMAT_MACROS

 #ifdef __cplusplus
 extern "C" {
 #endif

 #include 
 #include 
 #include <sys></sys>types.h>
 #include 
 #include <libavutil></libavutil>imgutils.h>
 #include <libavutil></libavutil>samplefmt.h>
 #include <libavutil></libavutil>frame.h>
 #include <libavutil></libavutil>timestamp.h>
 #include <libavformat></libavformat>avformat.h>
 #include <libavfilter></libavfilter>avfilter.h>
 #include <libavfilter></libavfilter>buffersrc.h>
 #include <libavfilter></libavfilter>buffersink.h>
 #include <libswscale></libswscale>swscale.h>
 #include <libavutil></libavutil>opt.h>

 #ifdef __cplusplus
 }
 #endif

 #include <iostream>
 using namespace std;

 int select_stream, got_frame, got_packet;

 AVFormatContext *in_fmt_ctx = NULL, *out_fmt_ctx = NULL;
 AVCodec *dec_codec = NULL, * enc_codec = NULL;
 AVStream *audio_st = NULL;
 AVCodecContext *enc_ctx = NULL, *dec_ctx = NULL;

 AVFrame *pFrame = NULL, * pFrameFiltered = NULL;

 AVFilterGraph *filter_graph = NULL;
 AVFilterContext *buffersrc_ctx = NULL;
 AVFilterContext *buffersink_ctx = NULL;

 AVPacket packet;

 string inFileName = "/home/vinod/vinod/Media/univac.webm";
 string outFileName = "audio_extracted.m4a";

 int target_bit_rate = 128000,
 sample_rate = 22050,
 channels = 1;
 AVSampleFormat sample_fmt = AV_SAMPLE_FMT_S16;
 string filter_description = "aresample=22050,aformat=sample_fmts=s16:channel_layouts=mono";

 int log_averror(int errcode)
 {
 char *errbuf = (char *) calloc(AV_ERROR_MAX_STRING_SIZE, sizeof(char));
 av_strerror(errcode, errbuf, AV_ERROR_MAX_STRING_SIZE);
 std::cout << "Error - " << errbuf << std::endl;
 delete [] errbuf;
 return -1;
 }

 /**
 * Initialize conversion filter */
 int initialize_audio_filter()
 {
 char args[512];
 int ret;
 AVFilter *buffersrc = avfilter_get_by_name("abuffer");
 AVFilter *buffersink = avfilter_get_by_name("abuffersink");
 AVFilterInOut *outputs = avfilter_inout_alloc();
 AVFilterInOut *inputs = avfilter_inout_alloc();
 filter_graph = avfilter_graph_alloc();
 const enum AVSampleFormat out_sample_fmts[] = {sample_fmt, AV_SAMPLE_FMT_NONE};
 const int64_t out_channel_layouts[] = {av_get_default_channel_layout(out_fmt_ctx -> streams[0] -> codec -> channels), -1};
 const int out_sample_rates[] = {out_fmt_ctx -> streams[0] -> codec -> sample_rate, -1};

 if (!dec_ctx->channel_layout)
 dec_ctx->channel_layout = av_get_default_channel_layout(dec_ctx->channels);

 snprintf(args, sizeof(args), "time_base=%d/%d:sample_rate=%d:sample_fmt=%s:channel_layout=0x%" PRIx64,
 in_fmt_ctx -> streams[select_stream] -> time_base.num, in_fmt_ctx -> streams[select_stream] -> time_base.den,
 dec_ctx->sample_rate,
 av_get_sample_fmt_name(dec_ctx->sample_fmt),
 dec_ctx->channel_layout);
 ret = avfilter_graph_create_filter(&buffersrc_ctx, buffersrc, "in", args, NULL, filter_graph);

 if (ret < 0) {
 av_log(NULL, AV_LOG_ERROR, "Cannot create buffer source\n");
 return -1;
 }

 ret = avfilter_graph_create_filter(&buffersink_ctx, buffersink, "out", NULL, NULL, filter_graph);

 if (ret < 0) {
 av_log(NULL, AV_LOG_ERROR, "Cannot create buffer sink\n");
 return ret;
 }

 ret = av_opt_set_int_list(buffersink_ctx, "sample_fmts", out_sample_fmts, -1,
 AV_OPT_SEARCH_CHILDREN);

 if (ret < 0) {
 av_log(NULL, AV_LOG_ERROR, "Cannot set output sample format\n");
 return ret;
 }

 ret = av_opt_set_int_list(buffersink_ctx, "channel_layouts", out_channel_layouts, -1,
 AV_OPT_SEARCH_CHILDREN);

 if (ret < 0) {
 av_log(NULL, AV_LOG_ERROR, "Cannot set output channel layout\n");
 return ret;
 }

 ret = av_opt_set_int_list(buffersink_ctx, "sample_rates", out_sample_rates, -1,
 AV_OPT_SEARCH_CHILDREN);

 if (ret < 0) {
 av_log(NULL, AV_LOG_ERROR, "Cannot set output sample rate\n");
 return ret;
 }

 /* Endpoints for the filter graph. */
 outputs -> name = av_strdup("in");
 outputs -> filter_ctx = buffersrc_ctx;
 outputs -> pad_idx = 0;
 outputs -> next = NULL;
 /* Endpoints for the filter graph. */
 inputs -> name = av_strdup("out");
 inputs -> filter_ctx = buffersink_ctx;
 inputs -> pad_idx = 0;
 inputs -> next = NULL;
 string filter_desc = filter_description;

 if ((ret = avfilter_graph_parse_ptr(filter_graph, filter_desc.c_str(), &inputs, &outputs, NULL)) < 0) {
 log_averror(ret);
 exit(1);
 }

 if ((ret = avfilter_graph_config(filter_graph, NULL)) < 0) {
 log_averror(ret);
 exit(1);
 }

 /* Print summary of the sink buffer
 * Note: args buffer is reused to store channel layout string */
 AVFilterLink *outlink = buffersink_ctx->inputs[0];
 av_get_channel_layout_string(args, sizeof(args), -1, outlink->channel_layout);
 av_log(NULL, AV_LOG_INFO, "Output: srate:%dHz fmt:%s chlayout:%s\n",
 (int) outlink->sample_rate,
 (char *) av_x_if_null(av_get_sample_fmt_name((AVSampleFormat) outlink->format), "?"),
 args);
 return 0;
 }

 /*
 *
 */
 int main(int argc, char **argv)
 {
 int ret;
 cout << "Hello World" << endl;
 printf("abcd");
 avcodec_register_all();
 av_register_all();
 avfilter_register_all();

 /* open input file, and allocate format context */
 if (avformat_open_input(&in_fmt_ctx, inFileName.c_str(), NULL, NULL) < 0) {
 std::cout << "error opening input file - " << inFileName << std::endl;
 return -1;
 }

 /* retrieve stream information */
 if (avformat_find_stream_info(in_fmt_ctx, NULL) < 0) {
 std::cerr << "Could not find stream information in the input file " << inFileName << std::endl;
 }

 /* Dump format details */
 printf("\n ---------------------------------------------------------------------- \n");
 av_dump_format(in_fmt_ctx, 0, inFileName.c_str(), 0);
 printf("\n ---------------------------------------------------------------------- \n");
 /* Choose a audio stream */
 select_stream = av_find_best_stream(in_fmt_ctx, AVMEDIA_TYPE_AUDIO, -1, -1, &dec_codec, 0);

 if (select_stream == AVERROR_STREAM_NOT_FOUND) {
 std::cerr << "No audio stream found" << std::endl;
 return -1;
 }

 if (select_stream == AVERROR_DECODER_NOT_FOUND) {
 std::cerr << "No suitable decoder found" << std::endl;
 return -1;
 }

 dec_ctx = in_fmt_ctx -> streams[ select_stream] -> codec;
 av_opt_set_int(dec_ctx, "refcounted_frames", 1, 0);

 /* init the audio decoder */
 if ((ret = avcodec_open2(dec_ctx, dec_codec, NULL)) < 0) {
 av_log(NULL, AV_LOG_ERROR, "Cannot open audio decoder\n");
 return ret;
 }

 /* allocate output context */
 ret = avformat_alloc_output_context2(&out_fmt_ctx, NULL, NULL,
 outFileName.c_str());

 if (ret < 0) {
 std::cerr << "Could not create output context for the file " << outFileName << std::endl;
 return -1;
 }

 /* find the encoder */
 enum AVCodecID codec_id = out_fmt_ctx -> oformat -> audio_codec;
 enc_codec = avcodec_find_encoder(codec_id);

 if (!(enc_codec)) {
 std::cerr << "Could not find encoder for - " << avcodec_get_name(codec_id) << std::endl;
 return -1;
 }

 /* add a new stream */
 audio_st = avformat_new_stream(out_fmt_ctx, enc_codec);

 if (!audio_st) {
 std::cerr << "Could not add audio stream - " << std::endl;
 }

 /* Initialise audio codec */
 audio_st -> id = out_fmt_ctx -> nb_streams - 1;
 enc_ctx = audio_st -> codec;
 enc_ctx -> codec_id = codec_id;
 enc_ctx -> codec_type = AVMEDIA_TYPE_AUDIO;
 enc_ctx -> bit_rate = target_bit_rate;
 enc_ctx -> sample_rate = sample_rate;
 enc_ctx -> sample_fmt = sample_fmt;
 enc_ctx -> channels = channels;
 enc_ctx -> channel_layout = av_get_default_channel_layout(enc_ctx -> channels);

 /* Some formats want stream headers to be separate. */
 if (out_fmt_ctx -> oformat -> flags & AVFMT_GLOBALHEADER) {
 enc_ctx -> flags |= CODEC_FLAG_GLOBAL_HEADER;
 }

 ret = avcodec_open2(out_fmt_ctx -> streams[0] -> codec, enc_codec, NULL);

 if (ret < 0) {
 std::cerr << "Could not create codec context for the file " << outFileName << std::endl;
 return -1;
 }

 /* Initialize filter */
 initialize_audio_filter();

 if (!(out_fmt_ctx -> oformat -> flags & AVFMT_NOFILE)) {
 int ret = avio_open(& out_fmt_ctx -> pb, outFileName.c_str(),
 AVIO_FLAG_WRITE);

 if (ret < 0) {
 log_averror(ret);
 return -1;
 }
 }

 /* Write header */
 if (avformat_write_header(out_fmt_ctx, NULL) < 0) {
 if (ret < 0) {
 log_averror(ret);
 return -1;
 }
 }

 /* Allocate frame */
 pFrame = av_frame_alloc();

 if (!pFrame) {
 std::cerr << "Could not allocate frame\n";
 return -1;
 }

 pFrameFiltered = av_frame_alloc();

 if (!pFrameFiltered) {
 std::cerr << "Could not allocate frame\n";
 return -1;
 }

 av_init_packet(&packet);
 packet.data = NULL;
 packet.size = 0;

 /* Read packet from the stream */
 while (av_read_frame(in_fmt_ctx, &packet) >= 0) {
 if (packet.stream_index == select_stream) {
 avcodec_get_frame_defaults(pFrame);
 ret = avcodec_decode_audio4(dec_ctx, pFrame, &got_frame, &packet);

 if (ret < 0) {
 log_averror(ret);
 return ret;
 }

 printf("Decoded packet pts : %ld ", packet.pts);
 printf("Frame Best Effor pts : %ld \n", pFrame->best_effort_timestamp);
 /* Set frame pts */
 pFrame -> pts = av_frame_get_best_effort_timestamp(pFrame);

 if (got_frame) {
 /* push the decoded frame into the filtergraph */
 ret = av_buffersrc_add_frame_flags(buffersrc_ctx, pFrame, AV_BUFFERSRC_FLAG_KEEP_REF);

 if (ret < 0) {
 log_averror(ret);
 return ret;
 }

 /* pull filtered frames from the filtergraph */
 while (1) {
 ret = av_buffersink_get_frame(buffersink_ctx, pFrameFiltered);

 if ((ret == AVERROR(EAGAIN)) || (ret == AVERROR_EOF)) {
 break;
 }

 if (ret < 0) {
 printf("Error while getting filtered frames from filtergraph\n");
 log_averror(ret);
 return -1;
 }

 /* Initialize the packets */
 AVPacket encodedPacket = {0};
 av_init_packet(&encodedPacket);
 ret = avcodec_encode_audio2(out_fmt_ctx -> streams[0] -> codec, &encodedPacket, pFrameFiltered, &got_packet);

 if (!ret && got_packet && encodedPacket.size) {
 /* Set correct pts and dts */
 if (encodedPacket.pts != AV_NOPTS_VALUE) {
 encodedPacket.pts = av_rescale_q(encodedPacket.pts, buffersink_ctx -> inputs[0] -> time_base,
 out_fmt_ctx -> streams[0] -> time_base);
 }

 if (encodedPacket.dts != AV_NOPTS_VALUE) {
 encodedPacket.dts = av_rescale_q(encodedPacket.dts, buffersink_ctx -> inputs[0] -> time_base,
 out_fmt_ctx -> streams[0] -> time_base);
 }

 printf("Encoded packet pts %ld\n", encodedPacket.pts);
 /* Write the compressed frame to the media file. */
 ret = av_interleaved_write_frame(out_fmt_ctx, &encodedPacket);

 if (ret < 0) {
 log_averror(ret);
 return -1;
 }
 } else if (ret < 0) {
 log_averror(ret);
 return -1;
 }

 av_frame_unref(pFrameFiltered);
 }

 av_frame_unref(pFrame);
 }
 }
 }

 /* Flush delayed frames from encoder*/
 got_packet=1;
 while (got_packet) {
 AVPacket encodedPacket = {0};
 av_init_packet(&encodedPacket);
 ret = avcodec_encode_audio2(out_fmt_ctx -> streams[0] -> codec, &encodedPacket, NULL, &got_packet);

 if (!ret && got_packet && encodedPacket.size) {
 /* Set correct pts and dts */
 if (encodedPacket.pts != AV_NOPTS_VALUE) {
 encodedPacket.pts = av_rescale_q(encodedPacket.pts, buffersink_ctx -> inputs[0] -> time_base,
 out_fmt_ctx -> streams[0] -> time_base);
 }

 if (encodedPacket.dts != AV_NOPTS_VALUE) {
 encodedPacket.dts = av_rescale_q(encodedPacket.dts, buffersink_ctx -> inputs[0] -> time_base,
 out_fmt_ctx -> streams[0] -> time_base);
 }

 printf("Encoded packet pts %ld\n", encodedPacket.pts);
 /* Write the compressed frame to the media file. */
 ret = av_interleaved_write_frame(out_fmt_ctx, &encodedPacket);

 if (ret < 0) {
 log_averror(ret);
 return -1;
 }
 } else if (ret < 0) {
 log_averror(ret);
 return -1;
 }
 }

 /* Write Trailer */
 av_write_trailer(out_fmt_ctx);
 avfilter_graph_free(&filter_graph);

 if (dec_ctx)
 avcodec_close(dec_ctx);

 avformat_close_input(&in_fmt_ctx);
 av_frame_free(&pFrame);
 av_frame_free(&pFrameFiltered);

 if (!(out_fmt_ctx -> oformat -> flags & AVFMT_NOFILE))
 avio_close(out_fmt_ctx -> pb);
 avcodec_close(out_fmt_ctx->streams[0]->codec);
 avformat_free_context(out_fmt_ctx);
 return 0;
 }
</iostream>



The audio file after transcoding is same duration as the input. But its completely noisy. Can somebody tell me what I am doing wrong here !


-
opencv does not find ffmpeg functions during compilation (make)
17 avril 2022, par titicplusplusI am currently trying to compile OpenCV with CUDA.
So I downloaded opencv 4.5.5 and opencv_contrib and followed this tutorial : https://gist.github.com/raulqf/f42c718a658cddc16f9df07ecc627be7


cd opencv-4.5.5/
mkdir build
cd build
cmake -D CMAKE_BUILD_TYPE=RELEASE \
-D CMAKE_INSTALL_PREFIX=/usr/local \
-D WITH_TBB=ON \
-D ENABLE_FAST_MATH=1 \
-D CUDA_FAST_MATH=1 \
-D WITH_CUBLAS=1 \
-D WITH_CUDA=ON \
-D BUILD_opencv_cudacodec=OFF \
-D WITH_CUDNN=OFF \
-D OPENCV_DNN_CUDA=OFF \
-D CUDA_ARCH_BIN=7.5 \
-D WITH_V4L=ON \
-D WITH_QT=ON \
-D WITH_OPENGL=ON \
-D WITH_GSTREAMER=ON \
-D OPENCV_GENERATE_PKGCONFIG=ON \
-D OPENCV_PC_FILE_NAME=opencv.pc \
-D OPENCV_ENABLE_NONFREE=ON \
-D INSTALL_PYTHON_EXAMPLES=OFF \
-D INSTALL_C_EXAMPLES=OFF \
-D BUILD_EXAMPLES=OFF \
-D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib-4.5.5/modules ../



The cmake command generated these lines :


-- General configuration for OpenCV 4.5.5 =====================================
-- Version control: unknown
-- 
-- Extra modules:
-- Location (extra): /mnt/704E048C4E044D72/build/opencv/opencv_contrib-4.5.5/modules
-- Version control (extra): unknown
-- 
-- Platform:
-- Timestamp: 2022-04-17T16:01:44Z
-- Host: Linux 5.4.0-107-lowlatency x86_64
-- CMake: 3.16.3
-- CMake generator: Unix Makefiles
-- CMake build tool: /usr/bin/make
-- Configuration: RELEASE
-- 
-- CPU/HW features:
-- Baseline: SSE SSE2 SSE3
-- requested: SSE3
-- Dispatched code generation: SSE4_1 SSE4_2 FP16 AVX AVX2 AVX512_SKX
-- requested: SSE4_1 SSE4_2 AVX FP16 AVX2 AVX512_SKX
-- SSE4_1 (18 files): + SSSE3 SSE4_1
-- SSE4_2 (2 files): + SSSE3 SSE4_1 POPCNT SSE4_2
-- FP16 (1 files): + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 AVX
-- AVX (5 files): + SSSE3 SSE4_1 POPCNT SSE4_2 AVX
-- AVX2 (33 files): + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 FMA3 AVX AVX2
-- AVX512_SKX (8 files): + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 FMA3 AVX AVX2 AVX_512F AVX512_COMMON AVX512_SKX
-- 
-- C/C++:
-- Built as dynamic libs?: YES
-- C++ standard: 11
-- C++ Compiler: /usr/bin/c++ (ver 8.4.0)
-- C++ flags (Release): -fsigned-char -ffast-math -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Wsuggest-override -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -msse -msse2 -msse3 -fvisibility=hidden -fvisibility-inlines-hidden -O3 -DNDEBUG -DNDEBUG
-- C++ flags (Debug): -fsigned-char -ffast-math -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Wsuggest-override -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -msse -msse2 -msse3 -fvisibility=hidden -fvisibility-inlines-hidden -g -O0 -DDEBUG -D_DEBUG
-- C Compiler: /usr/bin/cc
-- C flags (Release): -fsigned-char -ffast-math -W -Wall -Werror=return-type -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -msse -msse2 -msse3 -fvisibility=hidden -O3 -DNDEBUG -DNDEBUG
-- C flags (Debug): -fsigned-char -ffast-math -W -Wall -Werror=return-type -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -msse -msse2 -msse3 -fvisibility=hidden -g -O0 -DDEBUG -D_DEBUG
-- Linker flags (Release): -Wl,--exclude-libs,libippicv.a -Wl,--exclude-libs,libippiw.a -Wl,--gc-sections -Wl,--as-needed 
-- Linker flags (Debug): -Wl,--exclude-libs,libippicv.a -Wl,--exclude-libs,libippiw.a -Wl,--gc-sections -Wl,--as-needed 
-- ccache: NO
-- Precompiled headers: NO
-- Extra dependencies: m pthread cudart_static dl rt nppc nppial nppicc nppicom nppidei nppif nppig nppim nppist nppisu nppitc npps cublas cufft -L/usr/lib/x86_64-linux-gnu
-- 3rdparty dependencies:
-- 
-- OpenCV modules:
-- To be built: alphamat aruco barcode bgsegm bioinspired calib3d ccalib core cudaarithm cudabgsegm cudafeatures2d cudafilters cudaimgproc cudalegacy cudaobjdetect cudaoptflow cudastereo cudawarping cudev cvv datasets dnn dnn_objdetect dnn_superres dpm face features2d flann freetype fuzzy gapi hdf hfs highgui img_hash imgcodecs imgproc intensity_transform line_descriptor mcc ml objdetect optflow phase_unwrapping photo plot python2 python3 quality rapid reg rgbd saliency sfm shape stereo stitching structured_light superres surface_matching text tracking ts video videoio videostab wechat_qrcode xfeatures2d ximgproc xobjdetect xphoto
-- Disabled: cudacodec world
-- Disabled by dependency: -
-- Unavailable: java julia matlab ovis viz
-- Applications: tests perf_tests apps
-- Documentation: NO
-- Non-free algorithms: YES
-- 
-- GUI: QT5
-- QT: YES (ver 5.12.8 )
-- QT OpenGL support: YES (Qt5::OpenGL 5.12.8)
-- GTK+: YES (ver 3.24.20)
-- GThread : YES (ver 2.64.6)
-- GtkGlExt: NO
-- OpenGL support: YES (/usr/lib/x86_64-linux-gnu/libGL.so /usr/lib/x86_64-linux-gnu/libGLU.so)
-- VTK support: NO
-- 
-- Media I/O: 
-- ZLib: /usr/lib/x86_64-linux-gnu/libz.so (ver 1.2.11)
-- JPEG: /usr/lib/x86_64-linux-gnu/libjpeg.so (ver 80)
-- WEBP: build (ver encoder: 0x020f)
-- PNG: /usr/lib/x86_64-linux-gnu/libpng.so (ver 1.6.37)
-- TIFF: /usr/lib/x86_64-linux-gnu/libtiff.so (ver 42 / 4.1.0)
-- JPEG 2000: build (ver 2.4.0)
-- OpenEXR: /usr/lib/x86_64-linux-gnu/libImath.so /usr/lib/x86_64-linux-gnu/libIlmImf.so /usr/lib/x86_64-linux-gnu/libIex.so /usr/lib/x86_64-linux-gnu/libHalf.so /usr/lib/x86_64-linux-gnu/libIlmThread.so (ver 2_3)
-- HDR: YES
-- SUNRASTER: YES
-- PXM: YES
-- PFM: YES
-- 
-- Video I/O:
-- DC1394: YES (2.2.5)
-- FFMPEG: YES
-- avcodec: YES (58.54.100)
-- avformat: YES (58.29.100)
-- avutil: YES (56.31.100)
-- swscale: YES (5.5.100)
-- avresample: YES (4.0.0)
-- GStreamer: YES (1.16.2)
-- v4l/v4l2: YES (linux/videodev2.h)
-- 
-- Parallel framework: TBB (ver 2020.1 interface 11101)
-- 
-- Trace: YES (with Intel ITT)
-- 
-- Other third-party libraries:
-- Intel IPP: 2020.0.0 Gold [2020.0.0]
-- at: /mnt/704E048C4E044D72/build/opencv/opencv-4.5.5/build/3rdparty/ippicv/ippicv_lnx/icv
-- Intel IPP IW: sources (2020.0.0)
-- at: /mnt/704E048C4E044D72/build/opencv/opencv-4.5.5/build/3rdparty/ippicv/ippicv_lnx/iw
-- VA: NO
-- Lapack: NO
-- Eigen: YES (ver 3.3.7)
-- Custom HAL: NO
-- Protobuf: build (3.19.1)
-- 
-- NVIDIA CUDA: YES (ver 10.1, CUFFT CUBLAS FAST_MATH)
-- NVIDIA GPU arch: 75
-- NVIDIA PTX archs:
-- 
-- OpenCL: YES (no extra features)
-- Include path: /mnt/704E048C4E044D72/build/opencv/opencv-4.5.5/3rdparty/include/opencl/1.2
-- Link libraries: Dynamic load
-- 
-- Python 2:
-- Interpreter: /usr/bin/python2.7 (ver 2.7.18)
-- Libraries: /usr/lib/x86_64-linux-gnu/libpython2.7.so (ver 2.7.18)
-- numpy: /usr/lib/python2.7/dist-packages/numpy/core/include (ver 1.16.5)
-- install path: lib/python2.7/dist-packages/cv2/python-2.7
-- 
-- Python 3:
-- Interpreter: /usr/bin/python3 (ver 3.8.10)
-- Libraries: /usr/lib/x86_64-linux-gnu/libpython3.8.so (ver 3.8.10)
-- numpy: /home/famillevincent/.local/lib/python3.8/site-packages/numpy/core/include (ver 1.22.3)
-- install path: lib/python3.8/site-packages/cv2/python-3.8
-- 
-- Python (for build): /usr/bin/python2.7
-- 
-- Java: 
-- ant: NO
-- JNI: /usr/lib/jvm/default-java/include /usr/lib/jvm/default-java/include/linux /usr/lib/jvm/default-java/include
-- Java wrappers: NO
-- Java tests: NO
-- 
-- Install to: /usr/local
-- -----------------------------------------------------------------
-- 
-- Configuring done
-- Generating done



CMake have detected ffmpeg libraries, but when I run
make -j8
. I have this error :

[ 39%] Building CXX object apps/interactive-calibration/CMakeFiles/opencv_interactive-calibration.dir/calibPipeline.cpp.o
Scanning dependencies of target opencv_cudafilters
/usr/bin/ld : ../../lib/libopencv_videoio.so.4.5.5 : référence indéfinie vers « av_hwframe_transfer_data »
/usr/bin/ld : ../../lib/libopencv_videoio.so.4.5.5 : référence indéfinie vers « avcodec_get_hw_config »
/usr/bin/ld : ../../lib/libopencv_videoio.so.4.5.5 : référence indéfinie vers « av_hwdevice_get_hwframe_constraints »
/usr/bin/ld : ../../lib/libopencv_videoio.so.4.5.5 : référence indéfinie vers « avcodec_send_packet »
/usr/bin/ld : ../../lib/libopencv_videoio.so.4.5.5 : référence indéfinie vers « av_hwframe_get_buffer »
/usr/bin/ld : ../../lib/libopencv_videoio.so.4.5.5 : référence indéfinie vers « av_hwdevice_ctx_create_derived »
/usr/bin/ld : ../../lib/libopencv_videoio.so.4.5.5 : référence indéfinie vers « av_hwdevice_ctx_create »
/usr/bin/ld : ../../lib/libopencv_videoio.so.4.5.5 : référence indéfinie vers « av_bsf_alloc »
/usr/bin/ld : ../../lib/libopencv_videoio.so.4.5.5 : référence indéfinie vers « av_bsf_receive_packet »
/usr/bin/ld : ../../lib/libopencv_videoio.so.4.5.5 : référence indéfinie vers « av_bsf_free »
/usr/bin/ld : ../../lib/libopencv_videoio.so.4.5.5 : référence indéfinie vers « avcodec_send_frame »
/usr/bin/ld : ../../lib/libopencv_videoio.so.4.5.5 : référence indéfinie vers « avcodec_parameters_copy »
/usr/bin/ld : ../../lib/libopencv_videoio.so.4.5.5 : référence indéfinie vers « av_packet_free »
/usr/bin/ld : ../../lib/libopencv_videoio.so.4.5.5 : référence indéfinie vers « av_hwdevice_find_type_by_name »
/usr/bin/ld : ../../lib/libopencv_videoio.so.4.5.5 : référence indéfinie vers « av_bsf_init »
/usr/bin/ld : ../../lib/libopencv_videoio.so.4.5.5 : référence indéfinie vers « av_hwframe_ctx_alloc »
/usr/bin/ld : ../../lib/libopencv_videoio.so.4.5.5 : référence indéfinie vers « avcodec_receive_packet »
/usr/bin/ld : ../../lib/libopencv_videoio.so.4.5.5 : référence indéfinie vers « av_codec_iterate »
/usr/bin/ld : ../../lib/libopencv_videoio.so.4.5.5 : référence indéfinie vers « av_hwframe_ctx_init »
/usr/bin/ld : ../../lib/libopencv_videoio.so.4.5.5 : référence indéfinie vers « av_hwdevice_get_type_name »
/usr/bin/ld : ../../lib/libopencv_videoio.so.4.5.5 : référence indéfinie vers « av_hwframe_constraints_free »
/usr/bin/ld : ../../lib/libopencv_videoio.so.4.5.5 : référence indéfinie vers « avcodec_receive_frame »
/usr/bin/ld : ../../lib/libopencv_videoio.so.4.5.5 : référence indéfinie vers « av_bsf_get_by_name »
/usr/bin/ld : ../../lib/libopencv_videoio.so.4.5.5 : référence indéfinie vers « avcodec_get_hw_frames_parameters »
/usr/bin/ld : ../../lib/libopencv_videoio.so.4.5.5 : référence indéfinie vers « av_bsf_send_packet »
/usr/bin/ld : ../../lib/libopencv_videoio.so.4.5.5 : référence indéfinie vers « av_hwframe_ctx_create_derived »
/usr/bin/ld : ../../lib/libopencv_videoio.so.4.5.5 : référence indéfinie vers « av_packet_alloc »
collect2: error: ld returned 1 exit status
make[2]: *** [apps/visualisation/CMakeFiles/opencv_visualisation.dir/build.make:92 : bin/opencv_visualisation] Erreur 1
make[1]: *** [CMakeFiles/Makefile2:11412 : apps/visualisation/CMakeFiles/opencv_visualisation.dir/all] Erreur 2
make[1]: *** Attente des tâches non terminées....
[ 39%] Building CXX object apps/interactive-calibration/CMakeFiles/opencv_interactive-calibration.dir/frameProcessor.cpp.o



So what can I do to compile opencv with cuda and ffmpeg ?

Thank you in advance for your answers.

I use Ubuntu 20.04 with g++8