
Recherche avancée
Médias (29)
-
#7 Ambience
16 octobre 2011, par
Mis à jour : Juin 2015
Langue : English
Type : Audio
-
#6 Teaser Music
16 octobre 2011, par
Mis à jour : Février 2013
Langue : English
Type : Audio
-
#5 End Title
16 octobre 2011, par
Mis à jour : Février 2013
Langue : English
Type : Audio
-
#3 The Safest Place
16 octobre 2011, par
Mis à jour : Février 2013
Langue : English
Type : Audio
-
#4 Emo Creates
15 octobre 2011, par
Mis à jour : Février 2013
Langue : English
Type : Audio
-
#2 Typewriter Dance
15 octobre 2011, par
Mis à jour : Février 2013
Langue : English
Type : Audio
Autres articles (104)
-
Publier sur MédiaSpip
13 juin 2013Puis-je poster des contenus à partir d’une tablette Ipad ?
Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir -
Personnaliser en ajoutant son logo, sa bannière ou son image de fond
5 septembre 2013, parCertains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;
-
Création définitive du canal
12 mars 2010, parLorsque votre demande est validée, vous pouvez alors procéder à la création proprement dite du canal. Chaque canal est un site à part entière placé sous votre responsabilité. Les administrateurs de la plateforme n’y ont aucun accès.
A la validation, vous recevez un email vous invitant donc à créer votre canal.
Pour ce faire il vous suffit de vous rendre à son adresse, dans notre exemple "http://votre_sous_domaine.mediaspip.net".
A ce moment là un mot de passe vous est demandé, il vous suffit d’y (...)
Sur d’autres sites (10435)
-
ffmpeg timeout with rtsp
17 janvier 2024, par eSlavkoI have script that capture image from wifi camera with ffmpeg.
It works fine until camera is not reachable due to network troubles.
The script stuck in ffmpeg capture and never exit. Is it possible to have some kind of timeout ? -stimeout (in miliseconds) seems not working.


There is part of script that capture images. (there are some manipulation after that)


#!/bin/bash
week="$(date '+%Y_%U')"
ts="$(date '+%Y-%m-%d_%H:%M:%S')"
ffmpeg -rtsp_transport tcp -y -i "rtsp://192.168.64.101" -frames:v 1 $week/$ts.jpg -stimeout 3000 -y



I did test on other camera and results are :


ffmpeg -y -i "rtsp://192.168.64.112:8554/profile0" -frames:v 1 Ilatest.jpg



Does work OK, but with timeout of 5 seconds as


ffmpeg -timeout 5000000 -y -i "rtsp://192.168.64.112:8554/profile0" -frames:v 1 Ilatest.jpg



doesn't and I got error report as :


ffmpeg version 4.2.4-1ubuntu0.1 Copyright (c) 2000-2020 the FFmpeg developers built with gcc 9 (Ubuntu 9.3.0-10ubuntu2)
...
...
[rtsp @ 0x55d250488740] Unable to open RTSP for listening
rtsp://192.168.64.112:8554/profile0: Cannot assign requested address



-
How to read video frame by frame in C# .NET Framework 4.8 ?
27 septembre 2022, par Brendan HillI need to read a video file (.mkv format, h264, 1280x720) frame by frame for video processing.


I am stuck with .NET Framework 4.8 due to dependencies.


Having tried Accord.net VideoFileReader I am unable to read them due to :


[matroska,webm @ 0000024eb36e5c00] Could not find codec parameters for stream 0 (Video: h264, none(progressive), 1280x720): unspecified pixel format
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Assertion desc failed at src/libswscale/swscale_internal.h:674



Unfortunately Accord.NET does not give me much control over the ffmpeg request and the project seems to have died (and .NET Framework has died (and C# has died)).


What are some alternatives which would allow me to read a .mkv file in h264 format frame by frame ?


NOTE - FFmpeg.NET does not seem to support getting frame bitmaps ; neither does MediaToolkit :(


NOTE - this page has the same problem (last comment 2020) but no resolution :( https://github.com/accord-net/framework/issues/713


-
Subtitle Overlay Isn't Working, how do I fix it ? [closed]
27 octobre 2024, par michael tanI'm trying to make a program to create clips with subtitles, but instead of the overlaid subtitles syncing with the clip, they just start from the beginning of the movie.


import subprocess
from moviepy.editor import VideoFileClip

def parse_srt(srt_file):
 """Parse the SRT file and return a list of subtitles with their timestamps."""
 subtitles = []
 with open(srt_file, 'r') as f:
 content = f.read().strip().split('\n\n')
 for entry in content:
 lines = entry.split('\n')
 if len(lines) >= 3:
 index = lines[0]
 timestamps = lines[1]
 text = '\n'.join(lines[2:])
 start, end = timestamps.split(' --> ')
 subtitles.append((start.strip(), end.strip(), text.strip()))
 return subtitles

def print_subtitles_in_range(subtitles, start_time, end_time):
 """Print subtitles that fall within the given start and end times."""
 for start, end, text in subtitles:
 start_seconds = convert_srt_time_to_seconds(start)
 end_seconds = convert_srt_time_to_seconds(end)
 if start_seconds >= start_time and end_seconds <= end_time:
 print(f"{start} --> {end}: {text}")


def convert_srt_time_to_seconds(time_str):
 """Convert SRT time format to total seconds."""
 hours, minutes, seconds = map(float, time_str.replace(',', '.').split(':'))
 return hours * 3600 + minutes * 60 + seconds

def create_captioned_clip(input_file, start_time, end_time, srt_file, output_file):
 # Step 1: Extract the clip from the main video
 clip = VideoFileClip(input_file).subclip(start_time, end_time)
 print("Clip duration:", clip.duration)
 temp_clip_path = "temp_clip.mp4"
 clip.write_videofile(temp_clip_path, codec="libx264")

 # Step 2: Parse the SRT file to get subtitles
 subtitles = parse_srt(srt_file)

 # Step 3: Print subtitles that fall within the start and end times
 print("\nSubtitles for the selected clip:")
 print_subtitles_in_range(subtitles, start_time, end_time)

 # Step 2: Add subtitles using FFmpeg
 ffmpeg_command = [
 "ffmpeg",
 "-ss", str(start_time), # Seek to the start time of the clip
 "-i", input_file, # Use the original input file for subtitles
 "-vf", f"subtitles='{srt_file}:force_style=Alignment=10,TimeOffset={start_time}'", # Overlay subtitles
 "-t", str(end_time - start_time), # Set duration for the output
 output_file
 ]

 print("Running command:", ' '.join(ffmpeg_command))
 subprocess.run(ffmpeg_command, capture_output=True, text=True)

# Define input video and srt file
input_video = "Soul.2020.720p.BluRay.x264.AAC-[YTS.MX].mp4"
subtitle_file = "Soul.2020.720p.BluRay.x264.AAC-[YTS.MX].srt"

# Define multiple clips with start and end times
clips = [
 {"start": (5 * 60), "end": (5 * 60 + 30), "output": "output_folder/captioned_clip1.mp4"},
 {"start": (7 * 60), "end": (7 * 60 + 25), "output": "output_folder/captioned_clip2.mp4"},
]

# Process each clip
for clip_info in clips:
 create_captioned_clip(input_video, clip_info["start"], clip_info["end"], subtitle_file, clip_info["output"])



I thought the subtitles would sync with the clip automatically ; after that didn't work I tried to manually sync them by putting the start time, duration, and an offset, but it still didn't work. The subtitles still start from 0:00 of the movie. There's nothing wrong with the .srt file, it's formatted correctly.