
Recherche avancée
Autres articles (103)
-
Les autorisations surchargées par les plugins
27 avril 2010, parMediaspip core
autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs -
Support de tous types de médias
10 avril 2011Contrairement à beaucoup de logiciels et autres plate-formes modernes de partage de documents, MediaSPIP a l’ambition de gérer un maximum de formats de documents différents qu’ils soient de type : images (png, gif, jpg, bmp et autres...) ; audio (MP3, Ogg, Wav et autres...) ; vidéo (Avi, MP4, Ogv, mpg, mov, wmv et autres...) ; contenu textuel, code ou autres (open office, microsoft office (tableur, présentation), web (html, css), LaTeX, Google Earth) (...)
-
ANNEXE : Les plugins utilisés spécifiquement pour la ferme
5 mars 2010, parLe site central/maître de la ferme a besoin d’utiliser plusieurs plugins supplémentaires vis à vis des canaux pour son bon fonctionnement. le plugin Gestion de la mutualisation ; le plugin inscription3 pour gérer les inscriptions et les demandes de création d’instance de mutualisation dès l’inscription des utilisateurs ; le plugin verifier qui fournit une API de vérification des champs (utilisé par inscription3) ; le plugin champs extras v2 nécessité par inscription3 (...)
Sur d’autres sites (11989)
-
FFmpeg - Libavcodec - unable to compile, errors on files not found, but files are there
3 octobre 2020, par QRrabbitThis is less about C++, and more about specific compiling avcodec and avformat as those are used inside FFmpeg. I'm trying to compile for the first time ffmpeg project code. All the linking has been resolved, and the program errors our.


I'm writing my first program - attempt at avformat libraries inside my C++ code. Linker errors on this line :


/Applications/CLion.app/Contents/bin/cmake/mac/bin/cmake --build /Users/sasha/CLionProjects/ffmpeg-01 --target all -- -j 12
Scanning dependencies of target docs
[ 5%] Generating HTML documentation
[ 20%] Building C object lib/glfw/src/CMakeFiles/glfw.dir/input.c.o
[ 20%] Building C object lib/glfw/src/CMakeFiles/glfw.dir/init.c.o
[ 20%] Building C object lib/glfw/src/CMakeFiles/glfw.dir/context.c.o
[ 30%] Building C object lib/glfw/src/CMakeFiles/glfw.dir/vulkan.c.o
[ 30%] Building C object lib/glfw/src/CMakeFiles/glfw.dir/monitor.c.o
[ 35%] Building C object lib/glfw/src/CMakeFiles/glfw.dir/cocoa_init.m.o
[ 45%] Building C object lib/glfw/src/CMakeFiles/glfw.dir/cocoa_joystick.m.o
[ 45%] Building C object lib/glfw/src/CMakeFiles/glfw.dir/window.c.o
[ 50%] Building C object lib/glfw/src/CMakeFiles/glfw.dir/cocoa_monitor.m.o
[ 60%] Building C object lib/glfw/src/CMakeFiles/glfw.dir/cocoa_window.m.o
[ 60%] Building C object lib/glfw/src/CMakeFiles/glfw.dir/cocoa_time.c.o
[ 60%] Built target docs
[ 65%] Building C object lib/glfw/src/CMakeFiles/glfw.dir/posix_thread.c.o
[ 70%] Building C object lib/glfw/src/CMakeFiles/glfw.dir/nsgl_context.m.o
[ 75%] Building C object lib/glfw/src/CMakeFiles/glfw.dir/egl_context.c.o
[ 80%] Building C object lib/glfw/src/CMakeFiles/glfw.dir/osmesa_context.c.o
[ 85%] Linking C static library libglfw3.a
[ 85%] Built target glfw
[ 95%] Building CXX object CMakeFiles/ffmpeg_01.dir/src/main.cpp.o
[ 95%] Building CXX object CMakeFiles/ffmpeg_01.dir/src/load_frame.cpp.o
[100%] Linking CXX executable ffmpeg_01
clang: error: no such file or directory: 'VideoToolbox'
clang: error: no such file or directory: 'CoreFoundation'
clang: error: no such file or directory: 'CoreMedia'
clang: error: no such file or directory: 'CoreVideo'
clang: error: no such file or directory: 'CoreServices'
clang: error: no such file or directory: 'OpenGL'
clang: error: no such file or directory: 'CoreImage'
clang: error: no such file or directory: 'AppKit'
clang: error: no such file or directory: 'Foundation'
clang: error: no such file or directory: 'CoreAudio'
clang: error: no such file or directory: 'AVFoundation'
clang: error: no such file or directory: 'CoreGraphics'
make[2]: *** [ffmpeg_01] Error 1
make[1]: *** [CMakeFiles/ffmpeg_01.dir/all] Error 2
make: *** [all] Error 2



This is the content of my *libavcodec.pc file, and it has an entry of conflicts : which lists all of the items that clang cannot find, I don't know if those are linked somehow. I found a source pointing that similar error appears if I had other forks of ffmpeg, but I do not.


prefix=/usr/local
exec_prefix=${prefix}
libdir=/usr/local/lib
includedir=/usr/local/include

Name: libavcodec
Description: FFmpeg codec library
Version: 58.108.100
Requires: libswresample >= 3.8.100, libavutil >= 56.60.100
Requires.private: 
Conflicts:
Libs: -L${libdir} -lavcodec -liconv -lm -llzma -lz -framework AudioToolbox -L/usr/local/Cellar/x264/r3011/lib -lx264 -pthread -framework VideoToolbox -framework CoreFoundation -framework CoreMedia -framework CoreVideo -framework CoreServices
Libs.private: 
Cflags: -I${includedir}



I don't have experience in cmakefile, I can paste it here if needed.
Any help is greatly appreciated, because I'm stuck for the past several days.


I have two CMakeLists :


cmake_minimum_required(VERSION 3.17)
project(ffmpeg_01)

set(CMAKE_CXX_STANDARD 14)

add_subdirectory(lib/glfw)
add_subdirectory(lib/FFmpeg)

add_definitions(-DGL_SILENCE_DEPRECIATION)

if(APPLE)
 list(APPEND EXTRA_LIBS
 "-framework OpenGL"
 )
elseif(LINUX)
 list(APPEND EXTRA_LIBS
 "-lGL -lGLU -lX11")
endif()

add_executable(ffmpeg_01 src/main.cpp src/load_frame.cpp)
target_link_libraries(ffmpeg_01 FFmpeg glfw ${EXTRA_LIBS})



and the interface for FFmpeg under FFmpeg sub directory :


cmake_minimum_required(VERSION 3.17)
project(FFMPEG)

find_package(PkgConfig REQUIRED)

pkg_check_modules(AVCODEC REQUIRED IMPORTED_TARGET libavcodec)
pkg_check_modules(AVFORMAT REQUIRED IMPORTED_TARGET libavformat)
pkg_check_modules(AVFILTER REQUIRED IMPORTED_TARGET libavfilter)
pkg_check_modules(AVDEVICE REQUIRED IMPORTED_TARGET libavdevice)
pkg_check_modules(AVUTIL REQUIRED IMPORTED_TARGET libavutil)
pkg_check_modules(SWRESAMPLE REQUIRED IMPORTED_TARGET libswresample)
pkg_check_modules(SWSCALE REQUIRED IMPORTED_TARGET libswscale)

add_library(FFmpeg INTERFACE IMPORTED GLOBAL)

target_link_libraries(FFmpeg INTERFACE PkgConfig::AVCODEC)
target_link_libraries(FFmpeg INTERFACE PkgConfig::AVFORMAT)
target_link_libraries(FFmpeg INTERFACE PkgConfig::AVFILTER)
target_link_libraries(FFmpeg INTERFACE PkgConfig::AVDEVICE)
target_link_libraries(FFmpeg INTERFACE PkgConfig::AVUTIL)
target_link_libraries(FFmpeg INTERFACE PkgConfig::SWRESAMPLE)
target_link_libraries(FFmpeg INTERFACE PkgConfig::SWSCALE)



I also tried adding the following block below target_link_libraries, but no difference on compilation outcome :


target_link_options(FFmpeg INTERFACE
 ${AVCODEC_LDFLAGS_OTHERS}
 ${AVFORMAT_LDFLAGS_OTHERS}
 ${AVFILTER_LDFLAGS_OTHERS}
 ${AVDEVICE_LDFLAGS_OTHERS}
 ${AVUTIL_LDFLAGS_OTHERS}
 ${SWRESAMPLE_LDFLAGS_OTHERS}
 ${SWSCALE_LDFLAGS_OTHERS}
 )



-
Merge Audio with Video is not working probably using android 9 & 8
22 juillet 2021, par ebdaa appI am trying to use the following code to merge audio with video,


cmd = "-stream_loop -1 -i " + videoUri + " -i " + audioPath + " -shortest -map 0:v:0 -map 1:a:0 -y " + videoOutputPath;

 long executionId = FFmpeg.executeAsync(cmd, new ExecuteCallback() {

 @Override
 public void apply(final long executionId, final int returnCode) {
 if (returnCode == RETURN_CODE_SUCCESS) {
 playVedio(videoOutputPath);
 } else {
 ErrorLogger();
 }
 }
 });



as you can see the above code does the following things :


- 

- replace audio in video with new one.
- loop the video until the new audio ends.






everything works perfectly when trying to run the code using both android 11 and 10 , however , when try to use android 9 or 8 , the first and the last 2 seconds of the new audio will be trimmed in the generated video and I am not able to know why


I am using 4.4 version of the mobile-ffmpeg


com.arthenica:mobile-ffmpeg-full:4.4



please find the log from android 8/9


I/mobile-ffmpeg: ffmpeg version v4.4-dev-416
 Copyright (c) 2000-2020 the FFmpeg developers
 built with Android (6454773 based on r365631c2) clang version 9.0.8 (https://android.googlesource.com/toolchain/llvm-project 98c855489587874b2a325e7a516b99d838599c6f) (based on LLVM 9.0.8svn)
 configuration: --cross-prefix=i686-linux-android- --sysroot=/files/android-sdk/ndk/21.3.6528147/toolchains/llvm/prebuilt/linux-x86_64/sysroot --prefix=/home/taner/Projects/mobile-ffmpeg/prebuilt/android-x86/ffmpeg --pkg-config=/usr/bin/pkg-config --enable-version3 --arch=i686 --cpu=i686 --cc=i686-linux-android24-clang --cxx=i686-linux-android24-clang++ --extra-libs='-L/home/taner/Projects/mobile-ffmpeg/prebuilt/android-x86/cpu-features/lib -lndk_compat' --target-os=android --disable-neon --disable-asm --disable-inline-asm --enable-cross-compile --enable-pic --enable-jni --enable-optimizations --enable-swscale --enable-shared --enable-v4l2-m2m --disable-outdev=fbdev --disable-indev=fbdev --enable-small --disable-openssl --disable-xmm-clobber-test --disable-debug --enable-lto --disable-neon-clobber-test --disable-programs --disable-postproc --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-static --disable-sndio --disable-schannel --disable-securetransport --disable-xlib --disable-cuda --disable-cuvid --disable-nvenc --disable-vaapi --disable-vdpau --disable-videotoolbox --disable-audiotoolbox --disable-appkit --disable-alsa --disable-cuda --disable-cuvid --disable-nvenc --disable-vaapi --disable-vdpau --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-gmp --enable-gnutls --enable-libmp3lame --enable-libass --enable-iconv --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libxml2 --enable-libopencore-amrnb --enable-libshine --enable-libspeex --enable-libwavpack --enable-libkvazaar --enable-libilbc --enable-libopus --enable-libsnappy --enable-libsoxr --enable-libaom --enable-libtwolame --disable-sdl2 --enable-libvo-amrwbenc --enable-zlib --enable-mediacodec
 libavutil 56. 55.100 / 56. 55.100
 libavcodec 58. 96.100 / 58. 96.100
 libavformat 58. 48.100 / 58. 48.100
 libavdevice 58. 11.101 / 58. 11.101
 libavfilter 7. 87.100 / 7. 87.100
 libswscale 5. 8.100 / 5. 8.100
 libswresample 3. 8.100 / 3. 8.100
 I/mobile-ffmpeg: Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/storage/emulated/0/Download/Videoes/share_video_2.mp4':
 Metadata:
 major_brand : 
 isom
 minor_version : 
 512
 compatible_brands: 
 isomiso2avc1mp41
 encoder : 
 I/mobile-ffmpeg: Lavf58.44.100
 Duration: 
 00:00:08.21
 , start: 
 0.000000
 , bitrate: 
 477 kb/s
 Stream #0:0
 (und)
 : Video: h264 (avc1 / 0x31637661), yuv420p, 640x360 [SAR 1:1 DAR 16:9], 473 kb/s
 , 
 29.97 fps, 
 29.97 tbr, 
 30k tbn, 
 59.94 tbc
 (default)
 Metadata:
 handler_name : 
 VideoHandler
 I/mobile-ffmpeg: Input #1, mp3, from '/storage/emulated/0/Download/001001.mp3':
 I/mobile-ffmpeg: Metadata:
 album : 
 Mishary Alafasi Musshaf
 artist : 
 Mishary Alafasi
 comment : 
 www.mp3quran.net
 genre : 
 Quran
 title : 
 Al-Fatihah
 date : 
 2007
 encoder : 
 Lavf58.48.100
 Duration: 
 00:00:12.41
 , start: 
 0.011995
 , bitrate: 
 132 kb/s
 Stream #1:0
 I/mobile-ffmpeg: : Audio: mp3, 44100 Hz, stereo, fltp, 128 kb/s
 Metadata:
 encoder : 
 Lavf
 Stream #1:1
 : Video: png, pal8(pc), 200x159 [SAR 2835:2835 DAR 200:159]
 , 
 90k tbr, 
 90k tbn, 
 90k tbc
 (attached pic)
 Metadata:
 comment : 
 Cover (front)
 I/mobile-ffmpeg: Stream mapping:
 Stream #0:0 -> #0:0
 (h264 (native) -> mpeg4 (native))
 Stream #1:0 -> #0:1
 (mp3 (mp3float) -> aac (native))
 Press [q] to stop, [?] for help
 I/mobile-ffmpeg: frame= 0 fps=0.0 q=0.0 size= 0kB time=-577014:32:22.77 bitrate= -0.0kbits/s speed=N/A 
 W/mobile-ffmpeg: [graph 0 input from stream 0:0 @ 0xd429d2e0] sws_param option is deprecated and ignored
 D/EGL_emulation: eglMakeCurrent: 0xf08c6ee0: ver 2 0 (tinfo 0xf08d2810)
 I/mobile-ffmpeg: Output #0, mp4, to '/storage/emulated/0/Download/v001001.mp4':
 Metadata:
 major_brand : 
 isom
 minor_version : 
 I/mobile-ffmpeg: 512
 compatible_brands: 
 isomiso2avc1mp41
 encoder : 
 Lavf58.48.100
 Stream #0:0
 (und)
 : Video: mpeg4 (mp4v / 0x7634706D), yuv420p(progressive), 640x360 [SAR 1:1 DAR 16:9], q=2-31, 200 kb/s
 , 
 29.97 fps, 
 30k tbn, 
 29.97 tbc
 (default)
 Metadata:
 handler_name : 
 VideoHandler
 encoder : 
 Lavc58.96.100 mpeg4
 Side data:
 I/mobile-ffmpeg: 
 cpb: 
 bitrate max/min/avg: 0/0/200000 buffer size: 0 
 vbv_delay: N/A
 I/mobile-ffmpeg: Stream #0:1
 : Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s
 Metadata:
 encoder : 
 Lavc58.96.100 aac
 I/mobile-ffmpeg: frame= 83 fps=0.0 q=30.2 size= 0kB time=00:00:02.78 bitrate= 0.1kbits/s speed=5.54x 
 I/mobile-ffmpeg: frame= 199 fps=198 q=31.0 size= 256kB time=00:00:06.64 bitrate= 315.8kbits/s speed=6.61x 
 I/mobile-ffmpeg: frame= 300 fps=199 q=31.0 size= 512kB time=00:00:10.00 bitrate= 419.1kbits/s speed=6.65x 
 I/mobile-ffmpeg: frame= 372 fps=204 q=31.0 Lsize= 733kB time=00:00:12.39 bitrate= 484.5kbits/s speed= 6.8x 
 video:526kB audio:195kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 
 1.630239%
 I/mobile-ffmpeg: [aac @ 0xd431fc00] Qavg: 164.571



-
Flutter : How to use "ffmpeg_kit_flutter" to merge videos ?
28 mai 2024, par Hani Kanakrii am using "ffmpeg_kit_flutter" to merge two videos with code



import 'dart:io';

import 'package:ffmpeg_kit_flutter/ffmpeg_kit.dart';
import 'package:ffmpeg_kit_flutter/abstract_session.dart';
import 'package:ffmpeg_kit_flutter/return_code.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:wechat_assets_picker/wechat_assets_picker.dart';

import '/features/merge_videos/cubit/merge_videos_state.dart';

class MergeVideosCubit extends Cubit<mergevideosstate> {
 MergeVideosCubit(this.originalFile) : super(InitialMergeVideos());
 final File? originalFile;

 Future<void> selectVideo(BuildContext context) async {
 final List<assetentity>? videos = await AssetPicker.pickAssets(
 context,
 pickerConfig: const AssetPickerConfig(requestType: RequestType.video),
 );

 if (videos != null && videos.isNotEmpty) {
 for (AssetEntity asset in videos) {
 File? videoFile = await asset.file;
 if (videoFile != null) {
 print('Selected Asset Path: ${videoFile.path}');
 mergeVideos(originalFile!.path, videoFile.path);
 }
 }
 }
 }

 Future<void> mergeVideos(String inputPath1, String inputPath2) async {
 final String outputPath = "/storage/emulated/0/merged_video_${now()}.mp4";
 // final String command =
 // '-i $inputPath1 -i $inputPath2 -filter_complex "[0:v][0:a][1:v][1:a] concat=n=2:v=1:a=1[outv][outa]" -map "[outv]" -map "[outa]" -y $outputPath';
 final String command =
 '-i $inputPath1 -i $inputPath2 -filter_complex "[0:v][1:v]concat=n=2:v=1:a=0[outv]" -map "[outv]" -y $outputPath';
 print("FFmpeg process starting with command: $command");
 print(command);
 print("LOADING LOADING LOADING LOADING LOADING LOADING LOADING MERGE");
 emit(LoadMergeVideos());
 await FFmpegKit.execute(command).then((value) async {
 await value.getDuration();
 var id = await value.getSessionId();

 print(value);
 print(id);
 print(await value.getDuration());
 });
 await FFmpegKit.executeAsync(command, (session) async {
 final returnCode = await session.getReturnCode();
 await session.getSessionId();
 print(await session.getSessionId());

 if (ReturnCode.isSuccess(returnCode)) {
 print("SUCCESS: Video merged successfully at $outputPath");
 print("SUCCESS SUCCESS SUCCESS SUCCESS SUCCESS SUCCESS MERGE");
 emit(SuccessMergeVideos());

 } else if (ReturnCode.isCancel(returnCode)) {
 print("CANCELLED: Video merging was cancelled.");
 print("CANCEL CANCEL CANCEL CANCEL CANCEL CANCEL CANCEL MERGE");
 emit(CancelMergeVideos());

 } else {
 print("ERROR: Failed to merge videos.");
 print("ERROR ERROR ERROR ERROR ERROR ERROR ERROR ERROR MERGE");
 emit(ErrorMergeVideos());

 final failLog = await session.getFailStackTrace();

 print("FFmpeg Failure Log: $failLog");
 }
 });
 }

 String now() {
 final DateTime now = DateTime.now();
 return "${now.year}${now.month}${now.day}_${now.hour}${now.minute}${now.second}";
 }
}
</void></assetentity></void></mergevideosstate>


The console when i run the code



D/EGL_emulation(23858): app_time_stats: avg=2379.66ms min=5.87ms max=23160.09ms count=10
I/PhotoManager(23858): uri: content://media/external/file
I/PhotoManager(23858): projection: _display_name, _data, _id, title, bucket_id, bucket_display_name, width, height, orientation, date_added, date_modified, mime_type, datetaken, duration, media_type, relative_path
I/PhotoManager(23858): selection: _id = ?
I/PhotoManager(23858): selectionArgs: 1000000039
I/PhotoManager(23858): sortOrder: null
I/PhotoManager(23858): sql: _id = 1000000039
I/PhotoManager(23858): cursor count: 1
I/flutter (23858): Selected Asset Path: /storage/emulated/0/Movies/VID_20240512_115116.mp4
I/flutter (23858): FFmpeg process starting with command: -i /storage/emulated/0/Movies/VID_20240512_115128.mp4 -i /storage/emulated/0/Movies/VID_20240512_115116.mp4 -filter_complex "[0:v][1:v]concat=n=2:v=1:a=0[outv]" -map "[outv]" -y /storage/emulated/0/merged_video_2024513_122719.mp4
I/flutter (23858): -i /storage/emulated/0/Movies/VID_20240512_115128.mp4 -i /storage/emulated/0/Movies/VID_20240512_115116.mp4 -filter_complex "[0:v][1:v]concat=n=2:v=1:a=0[outv]" -map "[outv]" -y /storage/emulated/0/merged_video_2024513_122719.mp4
I/flutter (23858): LOADING LOADING LOADING LOADING LOADING LOADING LOADING MERGE
I/flutter (23858): Instance of 'FFmpegSession'
I/flutter (23858): 1
I/flutter (23858): 246
I/flutter (23858): 2
I/flutter (23858): ERROR: Failed to merge videos.
I/flutter (23858): ERROR ERROR ERROR ERROR ERROR ERROR ERROR ERROR MERGE
D/EGL_emulation(23858): app_time_stats: avg=87.27ms min=4.92ms max=319.92ms count=13
I/flutter (23858): FFmpeg Failure Log: null



In "mergeVideos" function the "returnCode" it return value "1" when i look in the package code


getState() async {
 try {
 return _platform
 .abstractSessionGetState(this.getSessionId())
 .then((state) {
 switch (state) {
 case 0:
 return SessionState.created;
 case 1:
 return SessionState.running;
 case 2:
 return SessionState.failed;
 case 3:
 default:
 return SessionState.completed;
 }
 });
 } on PlatformException catch (e, stack) {
 print("Plugin getState error: ${e.message}");
 return Future.error("getState failed.", stack);
 }
}



Which mean its keep running but in my code it does not wait until complete merging


how can i fix that ??!


but i think my problem is in command(concat)



-i /storage/emulated/0/Movies/VID_20240512_115128.mp4 -i /storage/emulated/0/Movies/VID_20240512_115116.mp4 -filter_complex "[0:v][1:v]concat=n=2:v=1:a=0[outv]" -map "[outv]" -y /storage/emulated/0/merged_video_2024513_122719.mp4



(This is my command when i run the code) ??