
Recherche avancée
Médias (1)
-
The Great Big Beautiful Tomorrow
28 octobre 2011, par
Mis à jour : Octobre 2011
Langue : English
Type : Texte
Autres articles (12)
-
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 -
Gestion de la ferme
2 mars 2010, parLa ferme est gérée dans son ensemble par des "super admins".
Certains réglages peuvent être fais afin de réguler les besoins des différents canaux.
Dans un premier temps il utilise le plugin "Gestion de mutualisation" -
Les tâches Cron régulières de la ferme
1er décembre 2010, parLa gestion de la ferme passe par l’exécution à intervalle régulier de plusieurs tâches répétitives dites Cron.
Le super Cron (gestion_mutu_super_cron)
Cette tâche, planifiée chaque minute, a pour simple effet d’appeler le Cron de l’ensemble des instances de la mutualisation régulièrement. Couplée avec un Cron système sur le site central de la mutualisation, cela permet de simplement générer des visites régulières sur les différents sites et éviter que les tâches des sites peu visités soient trop (...)
Sur d’autres sites (2604)
-
ffmpeg sequence of multiple filters syntax
5 juillet 2021, par otomarii am trying to use multiple filters in ffpmeg, but it does not allow more than one -af.
so, then i decided to try to do it with a -complex_filter.


sudo ffmpeg -f alsa -i default:CARD=Device \
 -filter_complex \
 "lowpass=5000,highpass=200; \
 volume=+5dB; \
 afftdn=nr=0.01:nt=w;" \
 -c:a libmp3lame -b:a 128k -ar 48000 -ac 1 -t 00:00:05 -y $recdir/audio_$(date '+%Y_%m_%d_%H_%M_%S').mp3



it must work, but for some reason i get an error :


Guessed Channel Layout for Input Stream #0.0 : stereo
Input #0, alsa, from 'default:CARD=Device':
 Duration: N/A, start: 1625496748.441207, bitrate: 1536 kb/s
 Stream #0:0: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
[AVFilterGraph @ 0xaaab0a8b14e0] No such filter: ''
Error initializing complex filters.
Invalid argument



i have tried quotes and others, nothing helps..


-
How to manipulate a Uri as File in android
3 juin 2021, par Omid.NI am trying to use FFmpeg in android. As you know the framework no longer lets you to use absolute paths or open files freely even with WRITE_EXTERNAL_STORAGE permission :|

So, using the SAF, I get the file as an Uri, then I need to put it as an argument to ffmpeg to encode it but it only accepts file paths.

How can i achieve this ?


Note : There are some bad practices in my code but I hope we can ignore them for now because that's not the problem here :)


public class MainActivity extends AppCompatActivity {

 private static final int PICK_VIDEO_FILE = 2;

 private static final String TAG = "MainActivity";
 
 File theFile;
 TextView textView;

 @Override
 protected void onCreate(Bundle savedInstanceState) {


 super.onCreate(savedInstanceState);
 setContentView(R.layout.activity_main);

 textView = (TextView) findViewById(R.id.text_view);

 
 if (theFile == null) {
 openFile(Uri.fromFile(new File("/storage/emulated/0/")));
 }


 }

 @Override
 protected void onResume() {
 super.onResume();
 if (theFile !=null) {

 FFmpegSession fFmpegSession = FFmpegKit.executeAsync("-i " + theFile.getAbsolutePath()
 + " -c:v mpeg4 file:///storage/emulated/0/out.mp4",
 new ExecuteCallback() {
 @Override
 public void apply(Session session) {

 }
 });
 try {
 Thread.sleep(5000);
 } catch (InterruptedException e) {
 e.printStackTrace();
 }
 textView.setText("" + fFmpegSession.getState().name() + " " + fFmpegSession.getOutput());
 }
 }

 private void openFile(Uri pickerInitialUri) {
 Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT);
 intent.addCategory(Intent.CATEGORY_OPENABLE);
 intent.setType("video/mp4");
 
 // Optionally, specify a URI for the file that should appear in the
 // system file picker when it loads.
 intent.putExtra(DocumentsContract.EXTRA_INITIAL_URI, pickerInitialUri);

 startActivityForResult(intent, PICK_VIDEO_FILE);
 }
 @Override
 protected void onActivityResult(int requestCode, int resultCode, Intent data) {

 super.onActivityResult(requestCode, resultCode, data);
 if (requestCode == PICK_VIDEO_FILE) {
 if (resultCode == RESULT_OK) {
 theFile = new File(data.getData().getPath());
 }
 }

 }




-
How to get a file converted by ffmpeg in Android : permission denied
2 juin 2021, par Omid.NI am trying to use FFmpeg in my android app. So I want to test it if it works before moving on. I use an external library : github link

The code looks like this :

package net.omidn.aslanmediaconverter;

import android.net.Uri;
import android.os.Bundle;
import android.util.Log;
import android.widget.TextView;

import androidx.appcompat.app.AppCompatActivity;

import com.arthenica.ffmpegkit.ExecuteCallback;
import com.arthenica.ffmpegkit.FFmpegKit;
import com.arthenica.ffmpegkit.FFmpegSession;
import com.arthenica.ffmpegkit.Session;

import net.bramp.ffmpeg.job.FFmpegJob;

import java.io.BufferedInputStream;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;


public class MainActivity extends AppCompatActivity {
 
 private static final String TAG = "MainActivity";
 FFmpegJob myjob;

 @Override
 protected void onCreate(Bundle savedInstanceState) {


 super.onCreate(savedInstanceState);
 setContentView(R.layout.activity_main);

 TextView textView = (TextView) findViewById(R.id.text_view);


 FFmpegJob job = null;

 File inFile = new File("/storage/emulated/0/video_2021-05-29_17-50-20.mp4");
 String inputName = Uri.fromFile(inFile).toString();
 Log.d(TAG, inputName);
 Log.d(TAG,"file exists : " + String.valueOf(inFile.exists()));
 Log.d(TAG,"file canRead : " + String.valueOf(inFile.canRead()));

 FFmpegSession fFmpegSession = FFmpegKit.executeAsync("-i file:///storage/emulated/0/video_2021-05-29_17-50-20.mp4 -c:v mpeg4 file:///storage/emulated/0/out.mp4",
 new ExecuteCallback() {
 @Override
 public void apply(Session session) {

 }
 });
 try {
 Thread.sleep(5000);
 } catch (InterruptedException e) {
 e.printStackTrace();
 }
 textView.setText("" + fFmpegSession.getState().name() + " " + fFmpegSession.getOutput());
 }

}




As you can see I give the files with
file:///
protocol. If I don't use that the resault is the same. The three lines ofLog.d(...)
will print :

2021-06-03 00:58:08.869 8376-8376/net.omidn.aslanmediaconverter D/MainActivity: file:///storage/emulated/0/video_2021-05-29_17-50-20.mp4
2021-06-03 00:58:08.869 8376-8376/net.omidn.aslanmediaconverter D/MainActivity: file exists : true
2021-06-03 00:58:08.869 8376-8376/net.omidn.aslanmediaconverter D/MainActivity: file canRead : false



The video file has read access on the storage :