
Recherche avancée
Autres articles (70)
-
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 ;
-
Supporting all media types
13 avril 2011, parUnlike most software and media-sharing platforms, MediaSPIP aims to manage as many different media types as possible. The following are just a few examples from an ever-expanding list of supported formats : images : png, gif, jpg, bmp and more audio : MP3, Ogg, Wav and more video : AVI, MP4, OGV, mpg, mov, wmv and more text, code and other data : OpenOffice, Microsoft Office (Word, PowerPoint, Excel), web (html, CSS), LaTeX, Google Earth and (...)
-
Keeping control of your media in your hands
13 avril 2011, parThe vocabulary used on this site and around MediaSPIP in general, aims to avoid reference to Web 2.0 and the companies that profit from media-sharing.
While using MediaSPIP, you are invited to avoid using words like "Brand", "Cloud" and "Market".
MediaSPIP is designed to facilitate the sharing of creative media online, while allowing authors to retain complete control of their work.
MediaSPIP aims to be accessible to as many people as possible and development is based on expanding the (...)
Sur d’autres sites (5139)
-
What Are Website KPIs (10 KPIs and Best Ways to Track Them)
3 mai 2024, par Erin -
ffmpeg output with label 'v' does not exist in any defined filtler graph
15 avril 2024, par David RoyaleBeen trying to make this Python code work but it fails up until rendering the final part :


import subprocess
import re
import os

def detect_idle_sections(video_path):
 command = ['ffmpeg', '-i', video_path, '-vf', 'select=\'gt(scene,0.1)\'', '-vsync', 'vfr', '-f', 'null', '-']
 output = subprocess.check_output(command, stderr=subprocess.STDOUT).decode('utf-8')
 
 idle_sections = []
 duration = 0.0
 for line in output.split('\n'):
 match = re.search(r'scene:(\d+)', line)
 if match:
 scene = int(match.group(1))
 if scene == 0:
 duration += 1.0 / 30 # Assuming 30 fps
 else:
 if duration > 0:
 idle_sections.append((duration, duration - (1.0 / 30))) # Duration and start time
 duration = 0.0
 
 return idle_sections

def cut_idle_sections(video_path, idle_sections, output_path, total_duration):
 print("starting to cut things")
 filters = []
 start_time = 0.0
 for duration, _ in idle_sections:
 filters.append(f'[0:v]trim=start={start_time}:end={start_time + duration},setpts=PTS-STARTPTS[v{len(filters)}]')
 start_time += duration
 
 if start_time < total_duration:
 filters.append(f'[0:v]trim=start={start_time},setpts=PTS-STARTPTS[v{len(filters)}]')

 filter_str = ';'.join(filters)
 print("finished chopping")
 command = ['ffmpeg', '-i', video_path, '-filter_complex', filter_str, '-map', '[v]', output_path]
 subprocess.call(command)

def get_total_duration(video_path):
 print("prior getting time")
 command = ['ffprobe', '-v', 'error', '-show_entries', 'format=duration', '-of', 'default=noprint_wrappers=1:nokey=1', video_path]
 output = subprocess.check_output(command).decode('utf-8').strip()
 print("after getting time")
 return float(output)

input_file = r"C:\Users\D\Videos\2024-04-15 08-42-53.mkv"
output_file = r"C:\Users\D\Videos\output_video.mp4"

# Get full paths
input_path = os.path.abspath(input_file)
output_path = os.path.abspath(output_file)

total_duration = get_total_duration(input_path)
idle_sections = detect_idle_sections(input_path)
cut_idle_sections(input_path, idle_sections, output_path, total_duration)



The error I am getting is :


[out#0/mp4 @ 000001af60f9d3c0] Output with label 'v' does not exist in any defined filter graph, or was already used elsewhere.
Error opening output file C:\Users\D_era\Videos\output_video.mp4.
Error opening output files: Invalid argument



The code is intended to cut "iddle" frames where frame a = frame b. I want to point out that I don't really care about audio, so it's just comparing if frames "A" through "H" are the same and keeping a and continuing with the rest of the video.


Putting some comments to determine which part was successful and which broke, I found that the line failig is this :


command = ['ffmpeg', '-i', video_path, '-filter_complex', filter_str, '-map', '[v]', output_path]



and apparently is the -map part.


-
Consent Mode v2 : Everything You Need to Know
7 mai 2024, par Alex — Analytics Tips