
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 (107)
-
HTML5 audio and video support
13 avril 2011, parMediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
For older browsers the Flowplayer flash fallback is used.
MediaSPIP allows for media playback on major mobile platforms with the above (...) -
Support audio et vidéo HTML5
10 avril 2011MediaSPIP utilise les balises HTML5 video et audio pour la lecture de documents multimedia en profitant des dernières innovations du W3C supportées par les navigateurs modernes.
Pour les navigateurs plus anciens, le lecteur flash Flowplayer est utilisé.
Le lecteur HTML5 utilisé a été spécifiquement créé pour MediaSPIP : il est complètement modifiable graphiquement pour correspondre à un thème choisi.
Ces technologies permettent de distribuer vidéo et son à la fois sur des ordinateurs conventionnels (...) -
De l’upload à la vidéo finale [version standalone]
31 janvier 2010, parLe chemin d’un document audio ou vidéo dans SPIPMotion est divisé en trois étapes distinctes.
Upload et récupération d’informations de la vidéo source
Dans un premier temps, il est nécessaire de créer un article SPIP et de lui joindre le document vidéo "source".
Au moment où ce document est joint à l’article, deux actions supplémentaires au comportement normal sont exécutées : La récupération des informations techniques des flux audio et video du fichier ; La génération d’une vignette : extraction d’une (...)
Sur d’autres sites (9440)
-
is there a JAVA library for ffmpeg ? [on hold]
14 avril 2014, par waps12bMy company is developing an android application that provide some video to client.
my boss ask me to use ffmpeg to capture a picture at a certain time in video.
is there a library for that ?
-
how to concentrate two audios in android in my way ?
14 mai 2020, par tohid noorihello guys i have selectActivity that u can select the audios after that u can merge them using ffmpeg library but i get error that said "no such file or directory" i thick the paths that use have problem 
this is my code below u can check it out .Then if u know how to get all music that exist in my storage ,tell me. I use this function below to get all music.



private void getMusic(){
 ContentResolver resolver = getContentResolver();
 Uri uri = MediaStore.Audio.Media.EXTERNAL_CONTENT_URI;
 Cursor cursor = resolver.query(uri,null,null,null,null);
 if(cursor != null && cursor.moveToFirst()){
 int songTitle = cursor.getColumnIndex(MediaStore.Audio.Media.TITLE);
 int data = cursor.getColumnIndex(MediaStore.Audio.Media.DATA);
 int artist =cursor.getColumnIndex(MediaStore.Audio.Media.ARTIST);
 int size =cursor.getColumnIndex(MediaStore.Audio.Media.SIZE);
 int duration =cursor.getColumnIndex(MediaStore.Audio.Media.DURATION);

 do {
 Music music = new Music();
 music.setSongName(cursor.getString(songTitle));
 music.setSongArtist(cursor.getString(artist));
 music.setSongDuration(cursor.getString(duration));
 music.setSongSize(cursor.getString(size));
 music.setSongPath(cursor.getString(data));
 music.setSongBitmap(getAlbumImage(cursor.getString(data)));
 musicArrayList.add(music);
 }while (cursor.moveToNext());
 }
}




Then at the function below i merge the selected audios.



public void OMG(final Context context,List<musicselecteddatabase> musicDbs) {
 String s = "";
 String s_index = "";
 String fileSize = "concat=n="+musicDbs.size()+":v=0:a=1[out] -map [out] "+ dir4.getPath();

 for (int i = 0; i < musicDbs.size(); i++) {

 s = s + " -i " + musicDbs.get(i).getSongPath();
 s_index = s_index + "[" + i + ":0]";

 }
 s = s.replaceFirst(" ","");
 String str_cmd = s + " -filter_complex " + s_index + fileSize ;
 String[] cmd = str_cmd.split(" ");
 FFmpeg ffmpeg = FFmpeg.getInstance(context);
 try {
 ffmpeg.loadBinary(new LoadBinaryResponseHandler() {
 @Override
 public void onStart() {
 }

 @Override
 public void onFailure() {
 }

 @Override
 public void onSuccess() {
 }

 @Override
 public void onFinish() {
 }
 });
 } catch (Exception e) {
 Toast.makeText(context, e.getMessage(), Toast.LENGTH_SHORT).show();
 }

 try {
 ffmpeg.execute(cmd, new ExecuteBinaryResponseHandler() {
 @Override
 public void onStart() {
 }

 @Override
 public void onProgress(String message) {
 Toast.makeText(context, message, Toast.LENGTH_SHORT).show();
 }

 @Override
 public void onFailure(String message) {
 Toast.makeText(context, message, Toast.LENGTH_SHORT).show();
 }

 @Override
 public void onSuccess(String message) {
 Toast.makeText(context, "Build has been successful", Toast.LENGTH_SHORT).show();
 }

 @Override
 public void onFinish() {

 }
 });
 } catch (Exception e) {
 Toast.makeText(context, e.getMessage(), Toast.LENGTH_SHORT).show();
 } finally {
 if (ffmpeg.isFFmpegCommandRunning()) {
 ffmpeg.killRunningProcesses();
 }
 }
}
</musicselecteddatabase>



at the end i tell u how to get all music path exist in my mobile whit the function getmusic() i get a path something like this :



/storage/72AD-2013/Music/music_name.mp3



but i need something like this "i mean the real path of file that music is exist :



/storage/emulated/0/music/music_name.mp3


-
python [WinError 2] the System Cannot Find the File Specified
15 août 2024, par user26831166Code cant create a certain file
The thing is code isn't mine a took it from a friend and my friend get it from another person
and this 2 person can run code without any problem
but i have.


import os
import random
import shutil
import subprocess

# Путь к папке с видео
video_folder = r'D:\bots\ttvidads\VID\Videorez'

# Путь к папке для сохранения результатов
output_folder = r'D:\bots\ttvidads\VID\ZAGOTOVKI\Videopod1'

# Очищаем содержимое конечной папки перед сохранением
for file in os.listdir(output_folder):
 file_path = os.path.join(output_folder, file)
 try:
 if os.path.isfile(file_path):
 os.unlink(file_path)
 except Exception as e:
 print(f"Failed to delete {file_path}. Reason: {e}")

# Получаем список видеофайлов
video_files = [os.path.join(video_folder, file) for file in os.listdir(video_folder) if file.endswith(('.mp4', '.avi'))]

# Выбираем случайное видео
random_video = random.choice(video_files)

# Получаем длительность видео в секундах
video_duration_command = f'ffprobe -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 "{random_video}"'
video_duration_process = subprocess.Popen(video_duration_command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
video_duration_output, _ = video_duration_process.communicate()
video_duration = float(video_duration_output)

# Выбираем случайное начальное время для вырезания
random_start = random.randrange(0, int(video_duration) - 19, 8)

# Получаем ширину и высоту исходного видео
video_info_command = f'ffprobe -v error -select_streams v:0 -show_entries stream=width,height -of csv=s=x:p=0 "{random_video}"'
video_info_process = subprocess.Popen(video_info_command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
video_info_output, _ = video_info_process.communicate()
video_width, video_height = map(int, video_info_output.strip().split(b'x'))

# Вычисляем новые координаты x1 и x2 для обрезки
max_x1 = video_width - int(video_height * 9 / 16)
random_x1 = random.randint(0, max_x1)
random_x2 = random_x1 + int(video_height * 9 / 16)

# Формируем команду для FFmpeg для выборки случайного отрезка видео с соотношением 9:16
ffmpeg_command = f'ffmpeg -hwaccel cuda -ss {random_start} -i "{random_video}" -t 19 -vf "crop={random_x2-random_x1}:{video_height}:{random_x1}:0" -c:v h264_nvenc -preset default -an -c:a aac -b:a 128k "{output_folder}\\temp.mp4"'

# Выполняем команду с помощью subprocess
subprocess.run(ffmpeg_command, shell=True)

# Изменяем яркость, контрастность и размываем видео
brightness_factor = random.uniform(-0.18, -0.12) # Случайный коэффициент яркости
contrast_factor = random.uniform(0.95, 1.05) # Случайный коэффициент контрастности
blur_factor = random.uniform(4, 5) # Случайный коэффициент размытия

# Формируем команду для FFmpeg для изменения яркости, контрастности и размытия видео
ffmpeg_modify_command = f'ffmpeg -hwaccel cuda -i "{output_folder}\\temp.mp4" -vf "eq=brightness={brightness_factor}:contrast={contrast_factor},boxblur={blur_factor}:{blur_factor}" -c:v h264_nvenc -preset default -an -c:a aac -b:a 128k "{output_folder}\\temp_modify.mp4"'

# Выполняем команду с помощью subprocess
subprocess.run(ffmpeg_modify_command, shell=True)

# Растягиваем видео до нужного разрешения (1080x1920)
ffmpeg_stretch_command = f'ffmpeg -hwaccel cuda -i "{output_folder}\\temp_modify.mp4" -vf "scale=1080:1920" -c:v h264_nvenc -preset default -an -c:a aac -b:a 128k -r 30 "{output_folder}\\final_output.mp4"'

# Выполняем команду с помощью subprocess
subprocess.run(ffmpeg_stretch_command, shell=True)

# Удаляем временные файлы
os.remove(os.path.join(output_folder, 'temp.mp4'))
os.remove(os.path.join(output_folder, 'temp_modify.mp4'))

print("Видеофайл успешно обработан и сохранен.")



Error i got after run the code


= RESTART: D:\Bots\2vidpod.py
Traceback (most recent call last):
 File "D:\Bots\2vidpod.py", line 71, in <module>
 os.remove(os.path.join(output_folder, 'temp.mp4'))
FileNotFoundError: [WinError 2] Не удается найти указанный файл: 'D:\\bots\\ttvidads\\VID\\ZAGOTOVKI\\Videopod1\\temp.mp4'
</module>


so things i checked is
path is right
programs is installed FFMPEG and PYTHON all additional libraries downloaded
i pretty sure error caused by regular path and i wanna know if absolute path can do the thing