
Recherche avancée
Autres articles (94)
-
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 (...) -
Les sons
15 mai 2013, par -
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"
Sur d’autres sites (5986)
-
Extract audio from video in mp3 format using android-ffmpeg-library
28 mai 2014, par user2870161I want extrat audio from any type of video file and save it in mp3 format using android-ffmpeg-library.
My most of work is done here i am create wav file using this code but problame is when i create mp3 file it make only 0kb file in sdcard.
I hope I’ve made myself clear, and thanks for taking the time to read this.
if (inputPath == null || outputPath == null) {
throw new IllegalStateException("Need an input and output filepath!");
}
final List<string> cmd = new LinkedList<string>();
String baseDir = Environment.getExternalStorageDirectory().getAbsolutePath();
String fileName = "3.mp4";
String fileName1 = "2.mp3";
String path = baseDir + "/" + fileName;
String path1 = baseDir + "/" + fileName1;
File f = new File(path);
if(f.exists()){
System.out.println("File existed");
}else{
System.out.println("File not found!");
}
cmd.add(mFfmpegPath);
cmd.add("-i");
cmd.add(path);
cmd.add("-vn");
cmd.add("-acodec");
cmd.add("copy");
cmd.add(path1);
final ProcessBuilder pb = new ProcessBuilder(cmd);
return new ProcessRunnable(pb);
</string></string> -
How to Write the Numpy array video to Disk While adding Audio from File using the python ffmpegio
31 décembre 2023, par soham tilekarI Have an A NumPy array Representing the Video in the memory how Can I Use the
ffmpegio
python module to save it on the File on the disk While adding the audio.

I Try Many things. I Also Ask answer on the python-ffmpegio github page.
Discussinnon link


The Whole module Code is on the vidiopy


I Get an Error : -


Traceback (most recent call last):
 File "d:\soham_code\video_py\test.py", line 5, in <module>
 clip.write_videofile(r'D:\soham_code\video_py\test\test_video.mp4')
 File "d:\soham_code\video_py\vidiopy\video\VideoClips.py", line 190, in write_videofile
 with ffmpegio.open(
 File "C:\Users\Lenovo\AppData\Local\Programs\Python\Python312\Lib\contextlib.py", line 137, in __enter__
 return next(self.gen)
 ^^^^^^^^^^^^^^
 File "C:\Users\Lenovo\AppData\Local\Programs\Python\Python312\Lib\site-packages\ffmpegio\__init__.py", line 324, in open
 stream = StreamClass(*args, **kwds)
 ^^^^^^^^^^^^^^^^^^^^^^^^^^
 File "C:\Users\Lenovo\AppData\Local\Programs\Python\Python312\Lib\site-packages\ffmpegio\streams\SimpleStreams.py", line 489, in __init__
 super().__init__(
 File "C:\Users\Lenovo\AppData\Local\Programs\Python\Python312\Lib\site-packages\ffmpegio\streams\SimpleStreams.py", line 365, in __init__
 configure.add_url(ffmpeg_args, "input", *input)
TypeError: add_url() takes from 3 to 5 positional arguments but 765 were given
</module>


Modified Code : -


def write_videofile(self, filename, fps=None, codec=None, 
 bitrate=None, audio=True, audio_fps=44100,
 preset="medium", pixel_format=None,
 audio_codec=None, audio_bitrate=None,
 write_logfile=False, verbose=True,
 threads=None, ffmpeg_params: dict[str, str] | None = None,
 logger='bar', over_write_output=True):
 
 # video_np = np.asarray(tuple(self.iterate_frames_array_t(fps if fps else self.fps if self.fps else (_ for _ in ()
 # ).throw(Exception('Make Frame is Not Set.')))))

 audio_name, _ = os.path.splitext(filename)


 ffmpeg_options = {
 'preset': preset,
 
 **(ffmpeg_params if ffmpeg_params is not None else {}),
 **({'c:v': codec} if codec else {}),
 **({'b:v': bitrate} if bitrate else {}),
 **({'pix_fmt': pixel_format} if pixel_format else {}),
 **({'c:a': audio_codec} if audio_codec else {}),
 **({'ar': audio_fps} if audio_fps else {}),
 **({'b:a': audio_bitrate} if audio_bitrate else {}),
 **({'threads': threads} if threads else {}),
 }

 with tempfile.NamedTemporaryFile(
 suffix=".wav", prefix=audio_name + "_temp_audio_"
 ) as temp_audio_file:
 if self.audio and audio:
 self.audio.write_audio_file(temp_audio_file)
 # audio_file_name = temp_audio_file.name

 ffmpeg_options.update(
 {"extra_inputs": [temp_audio_file.name], "acodec": "copy", "map": ["0:v", "1:a"]}
 )

 with ffmpegio.open(
 filename,
 "wv",
 fps,
 **ffmpeg_options,
 overwrite=over_write_output,
 show_log=True,) as f:
 
 for I in self.iterate_frames_array_t(fps): # if fps else self.fps if self.fps else (_ for _ in ()
 # ).throw(Exception('Make Frame is Not Set.'))):
 f.write(I)



I Tried Many things : -
using transcode, providing the
-i
flag with audio name While using theffmpegio.write
, etc.

-
Write tests to check if a ffmpeg is installed
7 novembre 2018, par gldraphaelTLDR : I need a test that ensures
FooAsync()
throwsFfmpegNotFoundInPathException
ifffmpeg
is not in path.
I have a method like :
public Task FooAsync() { /* ... */ }
that throws an
FfmpegNotFoundInPathException
ifffmpeg
is not in path.
How do I go about writing tests for this ?(It’s okay if the test passes only within docker. I can selectively skip the test outside of Docker using Nate McMaster’s xunit extensions.)
For completeness,
FooAsync()
looks something like this :public async Task FooAsync()
{
try
{
new Cli("ffmpeg")
.SetArguments(args)
.EnableStandardErrorValidation(false)
.ExecuteAsync();
}
catch (Exception e)
{
// ...
throw new FfmpegNotFoundInPathException(e);
}
}(
Cli
is from the CliWrap package.)