Recherche avancée

Médias (91)

Autres articles (107)

  • HTML5 audio and video support

    13 avril 2011, par

    MediaSPIP 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 2011

    MediaSPIP 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, par

    Le 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 waps12b

    My 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 noori

    hello 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) {&#xA;    String s = "";&#xA;    String s_index = "";&#xA;    String fileSize = "concat=n="&#x2B;musicDbs.size()&#x2B;":v=0:a=1[out] -map [out] "&#x2B; dir4.getPath();&#xA;&#xA;    for (int i = 0; i &lt; musicDbs.size(); i&#x2B;&#x2B;) {&#xA;&#xA;        s = s &#x2B; " -i " &#x2B; musicDbs.get(i).getSongPath();&#xA;        s_index = s_index &#x2B; "[" &#x2B; i &#x2B; ":0]";&#xA;&#xA;    }&#xA;    s = s.replaceFirst(" ","");&#xA;    String str_cmd = s &#x2B; " -filter_complex " &#x2B; s_index &#x2B; fileSize ;&#xA;    String[] cmd = str_cmd.split(" ");&#xA;    FFmpeg ffmpeg = FFmpeg.getInstance(context);&#xA;    try {&#xA;        ffmpeg.loadBinary(new LoadBinaryResponseHandler() {&#xA;            @Override&#xA;            public void onStart() {&#xA;            }&#xA;&#xA;            @Override&#xA;            public void onFailure() {&#xA;            }&#xA;&#xA;            @Override&#xA;            public void onSuccess() {&#xA;            }&#xA;&#xA;            @Override&#xA;            public void onFinish() {&#xA;            }&#xA;        });&#xA;    } catch (Exception e) {&#xA;        Toast.makeText(context, e.getMessage(), Toast.LENGTH_SHORT).show();&#xA;    }&#xA;&#xA;    try {&#xA;        ffmpeg.execute(cmd, new ExecuteBinaryResponseHandler() {&#xA;            @Override&#xA;            public void onStart() {&#xA;            }&#xA;&#xA;            @Override&#xA;            public void onProgress(String message) {&#xA;                Toast.makeText(context, message, Toast.LENGTH_SHORT).show();&#xA;            }&#xA;&#xA;            @Override&#xA;            public void onFailure(String message) {&#xA;                Toast.makeText(context, message, Toast.LENGTH_SHORT).show();&#xA;            }&#xA;&#xA;            @Override&#xA;            public void onSuccess(String message) {&#xA;                Toast.makeText(context, "Build has been successful", Toast.LENGTH_SHORT).show();&#xA;            }&#xA;&#xA;            @Override&#xA;            public void onFinish() {&#xA;&#xA;            }&#xA;        });&#xA;    } catch (Exception e) {&#xA;        Toast.makeText(context, e.getMessage(), Toast.LENGTH_SHORT).show();&#xA;    } finally {&#xA;        if (ffmpeg.isFFmpegCommandRunning()) {&#xA;            ffmpeg.killRunningProcesses();&#xA;        }&#xA;    }&#xA;}&#xA;</musicselecteddatabase>

    &#xA;&#xA;

    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 :

    &#xA;&#xA;

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

    &#xA;&#xA;

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

    &#xA;&#xA;

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

    &#xA;

  • python [WinError 2] the System Cannot Find the File Specified

    15 août 2024, par user26831166

    Code cant create a certain file&#xA;The thing is code isn't mine a took it from a friend and my friend get it from another person&#xA;and this 2 person can run code without any problem&#xA;but i have.

    &#xA;

    import os&#xA;import random&#xA;import shutil&#xA;import subprocess&#xA;&#xA;# Путь к папке с видео&#xA;video_folder = r&#x27;D:\bots\ttvidads\VID\Videorez&#x27;&#xA;&#xA;# Путь к папке для сохранения результатов&#xA;output_folder = r&#x27;D:\bots\ttvidads\VID\ZAGOTOVKI\Videopod1&#x27;&#xA;&#xA;# Очищаем содержимое конечной папки перед сохранением&#xA;for file in os.listdir(output_folder):&#xA;    file_path = os.path.join(output_folder, file)&#xA;    try:&#xA;        if os.path.isfile(file_path):&#xA;            os.unlink(file_path)&#xA;    except Exception as e:&#xA;        print(f"Failed to delete {file_path}. Reason: {e}")&#xA;&#xA;# Получаем список видеофайлов&#xA;video_files = [os.path.join(video_folder, file) for file in os.listdir(video_folder) if file.endswith((&#x27;.mp4&#x27;, &#x27;.avi&#x27;))]&#xA;&#xA;# Выбираем случайное видео&#xA;random_video = random.choice(video_files)&#xA;&#xA;# Получаем длительность видео в секундах&#xA;video_duration_command = f&#x27;ffprobe -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 "{random_video}"&#x27;&#xA;video_duration_process = subprocess.Popen(video_duration_command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)&#xA;video_duration_output, _ = video_duration_process.communicate()&#xA;video_duration = float(video_duration_output)&#xA;&#xA;# Выбираем случайное начальное время для вырезания&#xA;random_start = random.randrange(0, int(video_duration) - 19, 8)&#xA;&#xA;# Получаем ширину и высоту исходного видео&#xA;video_info_command = f&#x27;ffprobe -v error -select_streams v:0 -show_entries stream=width,height -of csv=s=x:p=0 "{random_video}"&#x27;&#xA;video_info_process = subprocess.Popen(video_info_command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)&#xA;video_info_output, _ = video_info_process.communicate()&#xA;video_width, video_height = map(int, video_info_output.strip().split(b&#x27;x&#x27;))&#xA;&#xA;# Вычисляем новые координаты x1 и x2 для обрезки&#xA;max_x1 = video_width - int(video_height * 9 / 16)&#xA;random_x1 = random.randint(0, max_x1)&#xA;random_x2 = random_x1 &#x2B; int(video_height * 9 / 16)&#xA;&#xA;# Формируем команду для FFmpeg для выборки случайного отрезка видео с соотношением 9:16&#xA;ffmpeg_command = f&#x27;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"&#x27;&#xA;&#xA;# Выполняем команду с помощью subprocess&#xA;subprocess.run(ffmpeg_command, shell=True)&#xA;&#xA;# Изменяем яркость, контрастность и размываем видео&#xA;brightness_factor = random.uniform(-0.18, -0.12)  # Случайный коэффициент яркости&#xA;contrast_factor = random.uniform(0.95, 1.05)  # Случайный коэффициент контрастности&#xA;blur_factor = random.uniform(4, 5)  # Случайный коэффициент размытия&#xA;&#xA;# Формируем команду для FFmpeg для изменения яркости, контрастности и размытия видео&#xA;ffmpeg_modify_command = f&#x27;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"&#x27;&#xA;&#xA;# Выполняем команду с помощью subprocess&#xA;subprocess.run(ffmpeg_modify_command, shell=True)&#xA;&#xA;# Растягиваем видео до нужного разрешения (1080x1920)&#xA;ffmpeg_stretch_command = f&#x27;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"&#x27;&#xA;&#xA;# Выполняем команду с помощью subprocess&#xA;subprocess.run(ffmpeg_stretch_command, shell=True)&#xA;&#xA;# Удаляем временные файлы&#xA;os.remove(os.path.join(output_folder, &#x27;temp.mp4&#x27;))&#xA;os.remove(os.path.join(output_folder, &#x27;temp_modify.mp4&#x27;))&#xA;&#xA;print("Видеофайл успешно обработан и сохранен.")&#xA;

    &#xA;

    Error i got after run the code

    &#xA;

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

    &#xA;

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

    &#xA;