
Recherche avancée
Médias (91)
-
GetID3 - Boutons supplémentaires
9 avril 2013, par
Mis à jour : Avril 2013
Langue : français
Type : Image
-
Core Media Video
4 avril 2013, par
Mis à jour : Juin 2013
Langue : français
Type : Video
-
The pirate bay depuis la Belgique
1er avril 2013, par
Mis à jour : Avril 2013
Langue : français
Type : Image
-
Bug de détection d’ogg
22 mars 2013, par
Mis à jour : Avril 2013
Langue : français
Type : Video
-
Exemple de boutons d’action pour une collection collaborative
27 février 2013, par
Mis à jour : Mars 2013
Langue : français
Type : Image
-
Exemple de boutons d’action pour une collection personnelle
27 février 2013, par
Mis à jour : Février 2013
Langue : English
Type : Image
Autres articles (103)
-
Mise à disposition des fichiers
14 avril 2011, parPar défaut, lors de son initialisation, MediaSPIP ne permet pas aux visiteurs de télécharger les fichiers qu’ils soient originaux ou le résultat de leur transformation ou encodage. Il permet uniquement de les visualiser.
Cependant, il est possible et facile d’autoriser les visiteurs à avoir accès à ces documents et ce sous différentes formes.
Tout cela se passe dans la page de configuration du squelette. Il vous faut aller dans l’espace d’administration du canal, et choisir dans la navigation (...) -
Problèmes fréquents
10 mars 2010, parPHP et safe_mode activé
Une des principales sources de problèmes relève de la configuration de PHP et notamment de l’activation du safe_mode
La solution consiterait à soit désactiver le safe_mode soit placer le script dans un répertoire accessible par apache pour le site -
Gestion générale des documents
13 mai 2011, parMédiaSPIP ne modifie jamais le document original mis en ligne.
Pour chaque document mis en ligne il effectue deux opérations successives : la création d’une version supplémentaire qui peut être facilement consultée en ligne tout en laissant l’original téléchargeable dans le cas où le document original ne peut être lu dans un navigateur Internet ; la récupération des métadonnées du document original pour illustrer textuellement le fichier ;
Les tableaux ci-dessous expliquent ce que peut faire MédiaSPIP (...)
Sur d’autres sites (7709)
-
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 ?
-
avconv : make -map_metadata work consistently with the other options
29 juillet 2011, par Anton Khirnovavconv : make -map_metadata work consistently with the other options