
Recherche avancée
Autres articles (67)
-
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 ;
-
Ecrire une actualité
21 juin 2013, parPrésentez les changements dans votre MédiaSPIP ou les actualités de vos projets sur votre MédiaSPIP grâce à la rubrique actualités.
Dans le thème par défaut spipeo de MédiaSPIP, les actualités sont affichées en bas de la page principale sous les éditoriaux.
Vous pouvez personnaliser le formulaire de création d’une actualité.
Formulaire de création d’une actualité Dans le cas d’un document de type actualité, les champs proposés par défaut sont : Date de publication ( personnaliser la date de publication ) (...) -
(Dés)Activation de fonctionnalités (plugins)
18 février 2011, parPour gérer l’ajout et la suppression de fonctionnalités supplémentaires (ou plugins), MediaSPIP utilise à partir de la version 0.2 SVP.
SVP permet l’activation facile de plugins depuis l’espace de configuration de MediaSPIP.
Pour y accéder, il suffit de se rendre dans l’espace de configuration puis de se rendre sur la page "Gestion des plugins".
MediaSPIP est fourni par défaut avec l’ensemble des plugins dits "compatibles", ils ont été testés et intégrés afin de fonctionner parfaitement avec chaque (...)
Sur d’autres sites (8848)
-
Python can't access FFmpeg binary in /data/user/0/com.app.name/files/ in Android Studio
18 octobre 2024, par Dudek 3DI'm a beginner in android development (and java). I'm making a hybrid application in java which runs python (using chaquopy).
MainActivity.java runs the python script fine, the only problem is that the yt_dlp library that I've used can't access FFmpeg.
The FFmpeg binary file (for linuxarm64, I don't think that's the problem) is located in the assets folder (src/main/assets), then it's copied to /data/user/0/com.app.name/files :


//FileUtils.java
public class FileUtils {
 public static void copyAsset(Context context, String assetName, String outputPath) {
 AssetManager assetManager = context.getAssets();
 try {
 InputStream in = assetManager.open(assetName);
 File outFile = new File(outputPath);
 OutputStream out = new FileOutputStream(outFile);
 byte[] buffer = new byte[1024];
 int read;
 while ((read = in.read(buffer)) != -1) {
 out.write(buffer, 0, read);
 }
 in.close();
 out.close();

 // Set executable permissions for the binary
 outFile.setExecutable(true); // Ensure the file is executable
 outFile.setReadable(true);
 outFile.setWritable(true);
 Log.d("FileUtils", "FFmpeg File - Exists: " + outFile.exists() +
 ", Executable: " + outFile.canExecute());

 } catch (Exception e) {
 e.printStackTrace();
 }
 }
}


//MainActivity.java
public class MainActivity extends AppCompatActivity {
 private pyRun pyrun;
 private static final int REQUEST_CODE_PERMISSION = 123;
 private static final String TAG = "MainActivity";

 @Override
 protected void onCreate(Bundle savedInstanceState) {
 super.onCreate(savedInstanceState);
 setContentView(R.layout.activity_main);

 Log.d("YTDownloader", "onCreate: Starting...");
 String ffmpegPath = getFilesDir() + "/ffmpeg";

 // Copy the binary
 FileUtils.copyAsset(this, "ffmpeg", ffmpegPath);

 // Check if file exist and log
 Log.d(TAG, "FFmpeg exists: " + new File(ffmpegPath).exists());
 Log.d(TAG, "PATH: "+ffmpegPath);

 //load python
 //load webview
 }
 //other functions
}



And finally it should be loaded by yt_dlp in python :


import os
import yt_dlp as youtube_dl
ffmpeg_path='/data/user/0/com.dudek3d.ytdownloader/files/ffmpeg'

ydl_opts = {
'ffmpeg_location': ffmpeg_path,
'format': 'bestvideo+bestaudio/best',
'postprocessors': [{
 'key': 'FFmpegVideoConvertor',
 'preferedformat': 'mp4'}],
'noplaylist': True,
'quiet': True,
'merge_output_format': 'mp4',
'outtmpl': filename+'.%(ext)s',
}

with youtube_dl.YoutubeDL(ydl_opts) as ydl:
 ydl.download([url])



The downloaded file is corrupted because FFmpeg is not found.
I've found out that ffmpeg file cannot be accessed from neither Java nor Python.


I've tried :


1)
Changing the paths to cache :
ffmpeg_path='/data/user/0/com.dudek3d.ytdownloader/cache/ffmpeg'

Changing the paths to data :ffmpeg_path='/data/data/com.dudek3d.ytdownloader/files/ffmpeg'

Changing the paths to data cache :ffmpeg_path='/data/data/com.dudek3d.ytdownloader/cache/ffmpeg'


2)
Accessing ffmpeg path from MainActivity.java and got "Permission Denied" Error, so I added







to AndroidManifest.xml but still the same error occurs.


3)
Using ffmpeg implementations in dependecies in build.gradle (app Module) such as : 'com.arthenica:ffmpeg-kit-full:4.5'
but this won't work because I think that's accessible by java and not python.


4)
I've changed location of ffmpeg to src/main/jniLibs/arc64-v8a :

ffmpegPath = getApplicationInfo().nativeLibraryDir + "/ffmpeg";

passed that to python :

def run(format_choice, listt, ffmpeg_pat, ffprobe_pat):
 global ffmpeg_path, ffprobe_path
 ffmpeg_path, ffprobe_path= ffmpeg_pat, ffprobe_pat



but I got :

WARNING: ffmpeg-location /data/app/~~42sSKOephY26jjdLYW7wmw==/com.dudek3d.ytdownloader-OWqWbazkZobYNlsqTsxfyA==/lib/x86_64/ffmpeg does not exist!


I hope it's clear, thanks in advance.


-
using ffmpeg.jar with android (in android studio)
7 mai 2016, par Dany YI’m trying to use
FFmpegFrameRecorder
in android. I tried all the possible configurations and still havingjava.lang.UnsatisfiedLinkError: org.bytedeco.javacpp.avutil
on runtime.I already added the files :
- ffmpeg.jar
- ffmpeg-android-arm.jar
- javacpp.jar
- javacv.jar
- opencv-android-arm.jar
- opencv.jarI tried from the javacv-presets and javacvbin
I tried to extract opencv.jar and ffmpeg.jar and copy the .so files in the jnlibs and in jnlibs/armvebi
Any idea what should be done ?
-
Errors in compiling FFmpeg for windows10/aarch64 using Microsoft Visual Studio 2017 Preview edition
29 octobre 2018, par NarsingaI am trying to compile FFmpeg (the Chromium version) for Windows10/Aarch64 configuration using Microsoft Visual Studio 2017 Preview community edition. I am running into errors in the assembly files as copied below (highlighted few errors). I believe FFmpeg is working for Linux/Aarch64 configuration (probably using GNU assembler) already in which case the same assembly code should also work for Microsoft ARM Macro Assembler as well. Please let me know if I am missing anything here and any pointers to help resolve the errors.
D :\Work\Chromium_FFmpeg\chromium\src>ninja -C out\ARM64V8 third_party\ffmpeg
ninja : Entering directory `out\ARM64V8’
[2/9] ASM obj/third_party/ffmpeg/ffmpeg_internal/autorename_libavcodec_aarch64_fft_neon.obj
FAILED : obj/third_party/ffmpeg/ffmpeg_internal/autorename_libavcodec_aarch64_fft_neon.obj
D :/Work/Chromium_FFmpeg/depot_tools/win_tools-2_7_6_bin/python/bin/python.exe ../../build/toolchain/win/tool_wrapper.py asm-wrapper environment.arm64 armasm64.exe /Foobj/third_party/ffmpeg/ffmpeg_internal/autorename_libavcodec_aarch64_fft_neon.obj ../../third_party/ffmpeg/libavcodec/aarch64/autorename_libavcodec_aarch64_fft_neon.S
Microsoft (R) ARM Macro Assembler Version 14.16.26926.0 for 64 bits
D :\Work\Chromium_FFmpeg\chromium\src\third_party\ffmpeg\libavcodec\aarch64\autorename_libavcodec_aarch64_fft_neon.S(1) : error A2003 : improper line syntax : /
// File automatically generated. See crbug.com/495833.
D :\Work\Chromium_FFmpeg\chromium\src\third_party\ffmpeg\libavcodec\aarch64\autorename_libavcodec_aarch64_fft_neon.S(2) : error A2230 : Illegal preprocessor directive ; only "#line [filename]" is recognized
include "fft_neon.S"
D :\Work\Chromium_FFmpeg\chromium\src\third_party\ffmpeg\libavcodec\aarch64\autorename_libavcodec_aarch64_fft_neon.S(3) : warning A4045 : missing END directive
include "fft_neon.S"
.
.
.
[6/9] ASM obj/third_party/ffmpeg/ffmpeg_internal/mpegaudiodsp_neon.obj
FAILED : obj/third_party/ffmpeg/ffmpeg_internal/mpegaudiodsp_neon.obj
D :/Work/Chromium_FFmpeg/depot_tools/win_tools-2_7_6_bin/python/bin/python.exe ../../build/toolchain/win/tool_wrapper.py asm-wrapper environment.arm64 armasm64.exe /Foobj/third_party/ffmpeg/ffmpeg_internal/mpegaudiodsp_neon.obj ../../third_party/ffmpeg/libavcodec/aarch64/mpegaudiodsp_neon.S
Microsoft (R) ARM Macro Assembler Version 14.16.26926.0 for 64 bits
D :\Work\Chromium_FFmpeg\chromium\src\third_party\ffmpeg\libavcodec\aarch64\mpegaudiodsp_neon.S(1) : error A2003 : improper line syntax : /
/*
D :\Work\Chromium_FFmpeg\chromium\src\third_party\ffmpeg\libavcodec\aarch64\mpegaudiodsp_neon.S(2) : error A2079 : improper line syntax ; symbol expected
* Copyright (c) 2014 Janne Grunau
D :\Work\Chromium_FFmpeg\chromium\src\third_party\ffmpeg\libavcodec\aarch64\mpegaudiodsp_neon.S(3) : error A2079 : improper line syntax ; symbol expected
*
D :\Work\Chromium_FFmpeg\chromium\src\third_party\ffmpeg\libavcodec\aarch64\mpegaudiodsp_neon.S(4) : error A2079 : improper line syntax ; symbol expected
* This file is part of FFmpeg.
D :\Work\Chromium_FFmpeg\chromium\src\third_party\ffmpeg\libavcodec\aarch64\mpegaudiodsp_neon.S(5) : error A2079 : improper line syntax ; symbol expected
*
D :\Work\Chromium_FFmpeg\chromium\src\third_party\ffmpeg\libavcodec\aarch64\mpegaudiodsp_neon.S(6) : error A2079 : improper line syntax ; symbol expected
* FFmpeg is free software ; you can redistribute it and/or
D :\Work\Chromium_FFmpeg\chromium\src\third_party\ffmpeg\libavcodec\aarch64\mpegaudiodsp_neon.S(7) : error A2079 : improper line syntax ; symbol expected
* modify it under the terms of the GNU Lesser General Public
D :\Work\Chromium_FFmpeg\chromium\src\third_party\ffmpeg\libavcodec\aarch64\mpegaudiodsp_neon.S(8) : error A2079 : improper line syntax ; symbol expected
* License as published by the Free Software Foundation ; either
D :\Work\Chromium_FFmpeg\chromium\src\third_party\ffmpeg\libavcodec\aarch64\mpegaudiodsp_neon.S(9) : error A2079 : improper line syntax ; symbol expected
* version 2.1 of the License, or (at your option) any later version.
D :\Work\Chromium_FFmpeg\chromium\src\third_party\ffmpeg\libavcodec\aarch64\mpegaudiodsp_neon.S(10) : error A2079 : improper line syntax ; symbol expected
*
D :\Work\Chromium_FFmpeg\chromium\src\third_party\ffmpeg\libavcodec\aarch64\mpegaudiodsp_neon.S(11) : error A2079 : improper line syntax ; symbol expected
* FFmpeg is distributed in the hope that it will be useful,
D :\Work\Chromium_FFmpeg\chromium\src\third_party\ffmpeg\libavcodec\aarch64\mpegaudiodsp_neon.S(12) : error A2079 : improper line syntax ; symbol expected
* but WITHOUT ANY WARRANTY ; without even the implied warranty of
D :\Work\Chromium_FFmpeg\chromium\src\third_party\ffmpeg\libavcodec\aarch64\mpegaudiodsp_neon.S(13) : error A2079 : improper line syntax ; symbol expected
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
D :\Work\Chromium_FFmpeg\chromium\src\third_party\ffmpeg\libavcodec\aarch64\mpegaudiodsp_neon.S(14) : error A2079 : improper line syntax ; symbol expected
* Lesser General Public License for more details.
D :\Work\Chromium_FFmpeg\chromium\src\third_party\ffmpeg\libavcodec\aarch64\mpegaudiodsp_neon.S(15) : error A2079 : improper line syntax ; symbol expected
*
D :\Work\Chromium_FFmpeg\chromium\src\third_party\ffmpeg\libavcodec\aarch64\mpegaudiodsp_neon.S(16) : error A2079 : improper line syntax ; symbol expected
* You should have received a copy of the GNU Lesser General Public
D :\Work\Chromium_FFmpeg\chromium\src\third_party\ffmpeg\libavcodec\aarch64\mpegaudiodsp_neon.S(17) : error A2079 : improper line syntax ; symbol expected
* License along with FFmpeg ; if not, write to the Free Software
D :\Work\Chromium_FFmpeg\chromium\src\third_party\ffmpeg\libavcodec\aarch64\mpegaudiodsp_neon.S(18) : error A2079 : improper line syntax ; symbol expected
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
D :\Work\Chromium_FFmpeg\chromium\src\third_party\ffmpeg\libavcodec\aarch64\mpegaudiodsp_neon.S(19) : error A2079 : improper line syntax ; symbol expected
*/
D :\Work\Chromium_FFmpeg\chromium\src\third_party\ffmpeg\libavcodec\aarch64\mpegaudiodsp_neon.S(21) : error A2230 : Illegal preprocessor directive ; only "#line [filename]" is recognized
include "libavutil/aarch64/asm.S"
D :\Work\Chromium_FFmpeg\chromium\src\third_party\ffmpeg\libavcodec\aarch64\mpegaudiodsp_neon.S(23) : error A2230 : Illegal preprocessor directive ; only "#line [filename]" is recognized
define FRAC_BITS 23 // fractional bits for sb_samples and dct
D :\Work\Chromium_FFmpeg\chromium\src\third_party\ffmpeg\libavcodec\aarch64\mpegaudiodsp_neon.S(24) : error A2230 : Illegal preprocessor directive ; only "#line [filename]" is recognized
define WFRAC_BITS 16 // fractional bits for window
D :\Work\Chromium_FFmpeg\chromium\src\third_party\ffmpeg\libavcodec\aarch64\mpegaudiodsp_neon.S(25) : error A2230 : Illegal preprocessor directive ; only "#line [filename]" is recognized
define OUT_SHIFT (WFRAC_BITS + FRAC_BITS - 15)
D :\Work\Chromium_FFmpeg\chromium\src\third_party\ffmpeg\libavcodec\aarch64\mpegaudiodsp_neon.S(27) : error A2034 : unknown opcode : tbl_rev128_s
const tbl_rev128_s, align=4
D :\Work\Chromium_FFmpeg\chromium\src\third_party\ffmpeg\libavcodec\aarch64\mpegaudiodsp_neon.S(28) : error A2034 : unknown opcode : .
.byte 12, 13, 14, 15
D :\Work\Chromium_FFmpeg\chromium\src\third_party\ffmpeg\libavcodec\aarch64\mpegaudiodsp_neon.S(29) : error A2034 : unknown opcode : .
.byte 8, 9, 10, 11
D :\Work\Chromium_FFmpeg\chromium\src\third_party\ffmpeg\libavcodec\aarch64\mpegaudiodsp_neon.S(30) : error A2034 : unknown opcode : .
.byte 4, 5, 6, 7
D :\Work\Chromium_FFmpeg\chromium\src\third_party\ffmpeg\libavcodec\aarch64\mpegaudiodsp_neon.S(31) : error A2034 : unknown opcode : .
.byte 0, 1, 2, 3
D :\Work\Chromium_FFmpeg\chromium\src\third_party\ffmpeg\libavcodec\aarch64\mpegaudiodsp_neon.S(34) : error A2003 : improper line syntax : .
.macro apply_window type, st
D :\Work\Chromium_FFmpeg\chromium\src\third_party\ffmpeg\libavcodec\aarch64\mpegaudiodsp_neon.S(35) : error A2034 : unknown opcode : ff_mpadsp_apply_window_
function ff_mpadsp_apply_window_\type()_neon, export=1
D :\Work\Chromium_FFmpeg\chromium\src\third_party\ffmpeg\libavcodec\aarch64\mpegaudiodsp_neon.S(42) : error A2034 : unknown opcode : movrel
movrel x15, tbl_rev128_s
D :\Work\Chromium_FFmpeg\chromium\src\third_party\ffmpeg\libavcodec\aarch64\mpegaudiodsp_neon.S(44) : error A2003 : improper line syntax : .
.ifc \type, fixed
D :\Work\Chromium_FFmpeg\chromium\src\third_party\ffmpeg\libavcodec\aarch64\mpegaudiodsp_neon.S(46) : error A2003 : improper line syntax : .
.else
D :\Work\Chromium_FFmpeg\chromium\src\third_party\ffmpeg\libavcodec\aarch64\mpegaudiodsp_neon.S(48) : error A2003 : improper line syntax : .
.endif
D :\Work\Chromium_FFmpeg\chromium\src\third_party\ffmpeg\libavcodec\aarch64\mpegaudiodsp_neon.S(53) : error A2173 : syntax error in expression
sub x5, x5, x4 // samples2
D :\Work\Chromium_FFmpeg\chromium\src\third_party\ffmpeg\libavcodec\aarch64\mpegaudiodsp_neon.S(53) : error A2003 : improper line syntax : Trouble parsing operands
sub x5, x5, x4 // samples2
D :\Work\Chromium_FFmpeg\chromium\src\third_party\ffmpeg\libavcodec\aarch64\mpegaudiodsp_neon.S(54) : error A2173 : syntax error in expression
neg x13, x4 // -incr
D :\Work\Chromium_FFmpeg\chromium\src\third_party\ffmpeg\libavcodec\aarch64\mpegaudiodsp_neon.S(54) : error A2003 : improper line syntax : Trouble parsing operands
neg x13, x4 // -incr
D :\Work\Chromium_FFmpeg\chromium\src\third_party\ffmpeg\libavcodec\aarch64\mpegaudiodsp_neon.S(56) : error A2003 : improper line syntax : .
.ifc \type, fixed
D :\Work\Chromium_FFmpeg\chromium\src\third_party\ffmpeg\libavcodec\aarch64\mpegaudiodsp_neon.S(57) : error A2173 : syntax error in expression
ld1r v16.2s, [x2] // dither_state
D :\Work\Chromium_FFmpeg\chromium\src\third_party\ffmpeg\libavcodec\aarch64\mpegaudiodsp_neon.S(57) : error A2003 : improper line syntax : Trouble parsing operands
ld1r v16.2s, [x2] // dither_state
D :\Work\Chromium_FFmpeg\chromium\src\third_party\ffmpeg\libavcodec\aarch64\mpegaudiodsp_neon.S(60) : error A2061 : illegal expression type ; expected absolute numeric
movi v30.2d, #(1/ 64 * 8 * sizeof(int32_t)
D :\Work\Chromium_FFmpeg\chromium\src\third_party\ffmpeg\libavcodec\aarch64\mpegaudiodsp_neon.S(101) : error A2003 : improper line syntax : Trouble parsing operands
sub x10, x10, #64<<5 // 64 * 8 * sizeof(int32_t)
D :\Work\Chromium_FFmpeg\chromium\src\third_party\ffmpeg\libavcodec\aarch64\mpegaudiodsp_neon.S(103) : error A2003 : improper line syntax : .
.ifc \type, fixed
D :\Work\Chromium_FFmpeg\chromium\src\third_party\ffmpeg\libavcodec\aarch64\mpegaudiodsp_neon.S(105) : error A2034 : unknown opcode : ext
ext v28.16b, v29.16b, v28.16b, #8
.
.
.