
Recherche avancée
Médias (91)
-
Les Miserables
9 décembre 2019, par
Mis à jour : Décembre 2019
Langue : français
Type : Textuel
-
VideoHandle
8 novembre 2019, par
Mis à jour : Novembre 2019
Langue : français
Type : Video
-
Somos millones 1
21 juillet 2014, par
Mis à jour : Juin 2015
Langue : français
Type : Video
-
Un test - mauritanie
3 avril 2014, par
Mis à jour : Avril 2014
Langue : français
Type : Textuel
-
Pourquoi Obama lit il mes mails ?
4 février 2014, par
Mis à jour : Février 2014
Langue : français
-
IMG 0222
6 octobre 2013, par
Mis à jour : Octobre 2013
Langue : français
Type : Image
Autres articles (25)
-
Soumettre bugs et patchs
10 avril 2011Un logiciel n’est malheureusement jamais parfait...
Si vous pensez avoir mis la main sur un bug, reportez le dans notre système de tickets en prenant bien soin de nous remonter certaines informations pertinentes : le type de navigateur et sa version exacte avec lequel vous avez l’anomalie ; une explication la plus précise possible du problème rencontré ; si possibles les étapes pour reproduire le problème ; un lien vers le site / la page en question ;
Si vous pensez avoir résolu vous même le bug (...) -
Installation en mode standalone
4 février 2011, parL’installation de la distribution MediaSPIP se fait en plusieurs étapes : la récupération des fichiers nécessaires. À ce moment là deux méthodes sont possibles : en installant l’archive ZIP contenant l’ensemble de la distribution ; via SVN en récupérant les sources de chaque modules séparément ; la préconfiguration ; l’installation définitive ;
[mediaspip_zip]Installation de l’archive ZIP de MediaSPIP
Ce mode d’installation est la méthode la plus simple afin d’installer l’ensemble de la distribution (...) -
Gestion des droits de création et d’édition des objets
8 février 2011, parPar défaut, beaucoup de fonctionnalités sont limitées aux administrateurs mais restent configurables indépendamment pour modifier leur statut minimal d’utilisation notamment : la rédaction de contenus sur le site modifiables dans la gestion des templates de formulaires ; l’ajout de notes aux articles ; l’ajout de légendes et d’annotations sur les images ;
Sur d’autres sites (6294)
-
Server side video merging with FFmpeg through oline form
1er août 2017, par San007I have a difficult problem and not enough knowledge to solve it, therefore I am hoping you guys can give me some advice or redirect me to a professional or professional software which can solve my problem.
I want something fairly simple but I simply do not know how to begin. I Googled extensively but didnt find any related topics.
What do I want ?
I want an online form on my website where people can select different options, which are videos, for example
Question 1
1 (1.mp4) / 2 (2.mp4) / 3 (3.mp4)
Question 2
X (X.mp4) / Y (Y.mp4) / Z (Z.mp4)
Question 3
Email adres :
GenerateWhen the visitor clicks the generator button it should merge the video’s the customer has selected. e.g. 1 and X will result in one video file of 1.mp4 and X.mp4 merged. The system should then after succesfully merging the videos send a download link to the users e-mail adres and ideally delete the video from the server afterwards.
I know I have not done a whole lot of research because my knowledge simply is not enough to create my own solution, but I hope you guys can send me in the right direction, I do not mind any commercial solution.
-
Trying to convert code to be compatible with macOS by not using the .exe version of FFmpeg and FFmprobe. Cant open the .mp4 file when i go to run code
9 juillet 2024, par Bruno HawkinsI am attempting to edit some code in python for extracting frames from a video (using parallel processing to make it faster) a friend created that works on windows, so that it can be used on macOS. However, i am running into some issues and i am not sure what the problem is.


Essentially, when i go to run the frame extractor and try to select a video in the formats specified, it wont let me select it.


i have commented my code best i can. i am an amateur programmer so apologies if it is straightforward.


import os
import subprocess
import multiprocessing
import tkinter as tk
from tkinter import ttk, filedialog, messagebox

def extract_frames(video_path, output_folder, fps, start_time, duration, process_number):
 video_name = os.path.splitext(os.path.basename(video_path))[0]
 part_output_folder = os.path.join(output_folder, f"part_{process_number}")
 if not os.path.exists(part_output_folder):
 os.makedirs(part_output_folder)

 # Using 'ffmpeg' instead of 'ffmpeg.exe' for macOS compatibility
 ffmpeg_command = [
 'ffmpeg', '-ss', str(start_time), '-t', str(duration), '-i', video_path, '-vf', f'fps={fps}',
 os.path.join(part_output_folder, f'{video_name}_frame_%07d.png')
 ]

 print(f"Running FFmpeg command: {' '.join(ffmpeg_command)}")

 try:
 process = subprocess.run(ffmpeg_command, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
 if process.returncode != 0:
 print(f"Cannot process the file {video_path}: {process.stderr.decode('utf-8')}")
 return part_output_folder, 0
 except Exception as e:
 print(f"Failed to run FFmpeg command: {str(e)}")
 return part_output_folder, 0

 frame_count = len([f for f in os.listdir(part_output_folder) if f.endswith('.png')])
 return part_output_folder, frame_count

def worker_function(queue, video_path, output_folder, fps, start_time, duration, process_number):
 result = extract_frames(video_path, output_folder, fps, start_time, duration, process_number)
 queue.put(result)

def parallel_frame_extraction(video_path, output_folder, fps, num_processes):
 # Use 'ffprobe' instead of 'ffprobe.exe' for macOS compatibility
 ffprobe_command = [
 'ffprobe', '-v', 'error', '-select_streams', 'v:0', '-show_entries', 'format=duration', '-of',
 'default=noprint_wrappers=1:nokey=1', video_path
 ]

 try:
 result = subprocess.run(ffprobe_command, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
 duration = float(result.stdout.strip())
 except Exception as e:
 messagebox.showerror("Error", f"Failed to get video duration: {str(e)}")
 return

 chunk_duration = duration / num_processes
 processes = []
 manager = multiprocessing.Manager()
 queue = manager.Queue()

 if not os.path.exists(output_folder):
 os.makedirs(output_folder)

 for i in range(num_processes):
 start_time = i * chunk_duration
 p = multiprocessing.Process(target=worker_function,
 args=(queue, video_path, output_folder, fps, start_time, chunk_duration, i))
 p.start()
 processes.append(p)

 for p in processes:
 p.join()

 global_frame_offset = 0
 while not queue.empty():
 part_output_folder, frame_count = queue.get()
 frame_files = sorted([f for f in os.listdir(part_output_folder) if f.endswith('.png')])
 for i, frame_file in enumerate(frame_files):
 new_name = os.path.join(output_folder,
 f'{os.path.basename(video_path)}_frame_{global_frame_offset + i:07d}.png')
 os.rename(os.path.join(part_output_folder, frame_file), new_name)
 global_frame_offset += frame_count
 os.rmdir(part_output_folder)

 messagebox.showinfo("Complete",
 f"Frame extraction completed for {video_path}. Total frames extracted: {global_frame_offset}")

def start_frame_extraction():
 video_path = filedialog.askopenfilename(filetypes=[("Video files", "*.mp4;*.avi;*.mkv")])
 if not video_path:
 return

 output_folder = output_folder_var.get()
 if not output_folder:
 return

 fps = int(fps_var.get())
 num_processes = int(num_processes_var.get())

 parallel_frame_extraction(video_path, output_folder, fps, num_processes)

if __name__ == "__main__":
 root = tk.Tk()
 root.title("Frame Extraction")

 output_folder_var = tk.StringVar()
 fps_var = tk.StringVar(value="1")
 num_processes_var = tk.StringVar(value="4")

 def browse_output_folder():
 folder_selected = filedialog.askdirectory()
 output_folder_var.set(folder_selected)

 tk.Label(root, text="Output Folder:").grid(row=0, column=0, padx=10, pady=10)
 tk.Entry(root, textvariable=output_folder_var, width=50).grid(row=0, column=1, padx=10, pady=10)
 tk.Button(root, text="Browse", command=browse_output_folder).grid(row=0, column=2, padx=10, pady=10)

 tk.Label(root, text="FPS:").grid(row=1, column=0, padx=10, pady=10)
 tk.Entry(root, textvariable=fps_var, width=10).grid(row=1, column=1, padx=10, pady=10)

 tk.Label(root, text="Number of Processes:").grid(row=2, column=0, padx=10, pady=10)
 tk.Entry(root, textvariable=num_processes_var, width=10).grid(row=2, column=1, padx=10, pady=10)

 tk.Button(root, text="Start Frame Extraction", command=start_frame_extraction).grid(row=3, column=0, columnspan=3,
 padx=10, pady=20)

 root.mainloop()



I tried changing the FFmpeg and FFmprobe path formats from


ffmpeg_path = os.path.join(os.path.dirname(__file__), 'ffmpeg-7.0.1-essentials_build', 'bin', 'ffmpeg.exe')
ffprobe_path = os.path.join(os.path.dirname(__file__), 'ffmpeg-7.0.1-essentials_build', 'bin', 'ffprobe.exe')




to


ffmpeg_command = [
 'ffmpeg', '-ss', str(start_time), '-t', str(duration), '-i', video_path, '-vf', f'fps={fps}',
 os.path.join(part_output_folder, f'{video_name}_frame_%07d.png')
]

ffprobe_command = [
 'ffprobe', '-v', 'error', '-select_streams', 'v:0', '-show_entries', 'format=duration', '-of',
 'default=noprint_wrappers=1:nokey=1', video_path
]




I found this online so im not sure if it is the correct thing to do.


Thanks for any help.


-
ffmpeg streaming to rtmp at 30fps
19 janvier 2018, par user6326558I am trying to stream my desktop to facebook rtmp server using screen-capture-recorder :
-re -rtbufsize 256M -f dshow -i audio="Mikrofon (Realtek Audio)"
-rtbufsize 256M -f dshow -i audio="virtual-audio-capturer"
-rtbufsize 1024M -f dshow -i video=screen-capture-recorder -r 30
-filter:v scale=1280:720 -c:v h264_nvenc -pix_fmt yuv420p -preset fast
-b:v 8M -maxrate:v 10M -c:a aac -b:a 128k -ar 44100
-f flv rtmp://live-api.facebook.com:80/rtmp/..............I am using h264_nvenc codec for gpu acceleration, but I can stream at only 12-18 fps. However, when I stream into a file :
-re -rtbufsize 256M -f dshow -i audio="Mikrofon (Realtek Audio)"
-rtbufsize 256M -f dshow -i audio="virtual-audio-capturer"
-rtbufsize 1024M -f dshow -i video=screen-capture-recorder -r 30
-filter:v scale=1280:720 -c:v h264_nvenc -pix_fmt yuv420p -preset fast
-b:v 8M -maxrate:v 10M -c:a aac -b:a 128k -ar 44100
D:\test.mp4 -yI get 30 fps without problem, even when playing game (eg. Call of duty 6, pretty HW draining). Is it also possible to stream to rtmp at 30 fps with my command configuration ? Thank you
If needed, my ffmpeg build config is :
ffmpeg version 3.3.3 Copyright (c) 2000-2017 the FFmpeg developers
built with gcc 7.1.0 (GCC)
configuration : —disable-static —enable-shared —enable-gpl —enable-version3 —enable-cuda —enable-cuvid —enable-d3d11va —enable-dxva2 —enable-libmfx —enable-nvenc —enable-avisynth —enable-bzlib —enable-fontconfig —enable-frei0r —enable-gnutls —enable-iconv —enable-libass —enable-libbluray —enable-libbs2b —enable-libcaca —enable-libfreetype —enable-libgme —enable-libgsm —enable-libilbc —enable-libmodplug —enable-libmp3lame —enable-libopencore-amrnb —enable-libopencore-amrwb —enable-libopenh264 —enable-libopenjpeg —enable-libopus —enable-librtmp —enable-libsnappy —enable-libsoxr —enable-libspeex —enable-libtheora —enable-libtwolame —enable-libvidstab —enable-libvo-amrwbenc —enable-libvorbis —enable-libvpx —enable-libwavpack —enable-libwebp —enable-libx264 —enable-libx265 —enable-libxavs —enable-libxvid —enable-libzimg —enable-lzma —enable-zlib