
Recherche avancée
Médias (3)
-
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
-
Collections - Formulaire de création rapide
19 février 2013, par
Mis à jour : Février 2013
Langue : français
Type : Image
Autres articles (21)
-
La file d’attente de SPIPmotion
28 novembre 2010, parUne file d’attente stockée dans la base de donnée
Lors de son installation, SPIPmotion crée une nouvelle table dans la base de donnée intitulée spip_spipmotion_attentes.
Cette nouvelle table est constituée des champs suivants : id_spipmotion_attente, l’identifiant numérique unique de la tâche à traiter ; id_document, l’identifiant numérique du document original à encoder ; id_objet l’identifiant unique de l’objet auquel le document encodé devra être attaché automatiquement ; objet, le type d’objet auquel (...) -
D’autres logiciels intéressants
12 avril 2011, parOn ne revendique pas d’être les seuls à faire ce que l’on fait ... et on ne revendique surtout pas d’être les meilleurs non plus ... Ce que l’on fait, on essaie juste de le faire bien, et de mieux en mieux...
La liste suivante correspond à des logiciels qui tendent peu ou prou à faire comme MediaSPIP ou que MediaSPIP tente peu ou prou à faire pareil, peu importe ...
On ne les connais pas, on ne les a pas essayé, mais vous pouvez peut être y jeter un coup d’oeil.
Videopress
Site Internet : (...) -
Changer son thème graphique
22 février 2011, parLe thème graphique ne touche pas à la disposition à proprement dite des éléments dans la page. Il ne fait que modifier l’apparence des éléments.
Le placement peut être modifié effectivement, mais cette modification n’est que visuelle et non pas au niveau de la représentation sémantique de la page.
Modifier le thème graphique utilisé
Pour modifier le thème graphique utilisé, il est nécessaire que le plugin zen-garden soit activé sur le site.
Il suffit ensuite de se rendre dans l’espace de configuration du (...)
Sur d’autres sites (4162)
-
Downloading youtube mp3 - metadata encoding issue (python, youtube-dl, ffmpeg)
21 mai 2015, par mopsiokI’m trying to download audio from youtube with youtube-dl.exe and ffmpeg.exe (Windows 7), but I am having some troubles with encoding. I have to parse metadata manually, because when I try to use
--metadata-from-title "%(artist) - %(title)" --extract-audio --audio-format mp3 https://www.youtube.com/watch?v=DaU94Ld3fuM
I get ERROR : Could not interpret title of video as "%(artist) - %(title)"
Anyway, I wrote some code to save metadata with ffmpeg :
def download(url, title_first=False):
if (0 == subprocess.call('youtube-dl --extract-audio --audio-format mp3 %s' % url)):
#saves file in current directory in format: VID_TITLE-VID_ID.mp3
video_id = url[url.find('=')+1:] #video id from URL (after ?v=)
for f in os.listdir('.'):
if video_id in f:
filename = f
break
os.rename(filename, video_id+'.mp3') #name without non-ascii chars (for tests)
video_title = filename[: filename.find(video_id)-1]
output = video_title + '.mp3'
title, artist = '', ''
try: #parsing the title
x = video_title.find('-')
artist = video_title[:x].strip()
title = video_title[x+1:].strip()
if (title_first): output = '%s - %s.mp3' % (title, artist)
except:
pass
x = 'ffmpeg -i "%s" -metadata title="%s" -metadata artist="%s" -acodec copy -id3v2_version 3 -write_id3v1 1 "%s"' \
% (video_id+'.mp3', title, artist, output)
print x
subprocess.call(x)The file is downloaded and then cropped to given start and duration times (the code above is a simplified version). Filename is fine, but when I open the file with AIMP3, it shows rubbish instead of non-ascii characters :
I’ve tried to re-encode the final command with iso-8859-2, utf-8 and mbcs :
x = x.decode('cp1250').encode('iso-8859-2')
But non-ascii chars are still not readable. Passing an unicode command returns UnicodeEncodeError...
Any idea how to solve this problem ?
-
Why i'm failing to download mp4 file using youtube-dl in python
9 décembre 2019, par JoaoPython noob :(
I created a script that downloads any youtube video.
Then the script inserts a subtitle into the video and that works fine.
However, I have a problem, I can’t make the script always download the video in mp4. Most of the time it is downloaded in mkv and i can’t understand why that happens and how can I change the code in order to always download the video in the format I prefer.
The function in charge to download the video is this one :
def video_download():
#global resolution
try:
print(linkvideo)
ydl_opts = {
'format': 'bestvideo[ext=mp4]+bestaudio/best',
'outtmpl': video_id+"."+'%(ext)s'
#'bestvideo': 'mp4',
#'bestaudio': 'm4a',
#'ext': 'mp4'
}
with youtube_dl.YoutubeDL(ydl_opts) as ydl:
ydl.download([linkvideo])
result = ydl.extract_info("{}".format(linkvideo))
title = result.get("id", None)
videoext = result.get("ext", None)
resolution = result.get("resolution", None)
except:
print("falhou")
pass
global ficheiro
ficheiro2 = str(title)+"."+"mkv"
ficheiro =""
for i in ficheiro2:
if (i == '"' or i =="'" or i =="/"):
pass
else:
ficheiro += iCan any one help me ? Thanks in advance.
I got it, thanks to everyone who tried to help me.
The problem is this : when we try to download any video with the opts i’ve selected, youtube-dl will download the best video/audio combination in the same file, so I’ve added the following in my code :
ytdl = YoutubeDL()
result = ytdl.extract_info(linkvideo, download=False)
formats = result['formats']
formato = ""
formatoaudio = ""
extaudio = ""
for format in formats:
if format['format_note'] == "1080p" and format['ext'] == "mp4":
print(format)
formato = (format['format_id'])
break
else:
print("no 1080p mp4?!")
if formato == "":
for format in formats:
if format['format_note'] == "720p" and format['ext'] == "mp4":
print(format)
formato = (format['format_id'])
break
else:
print("no 720p mp4")Then I did the same to the sound file, checking if there is any m4a or webm sound file. To finish I’m joining both files using FFmpeg.
Maybe this is not the best solution, but I’m still learning. :)
Thank you all
-
How to apply dynamic watermarking for users watching video in real-time ? [closed]
3 janvier, par Barun BhattacharjeeI am working on a video streaming project where I need to apply a dynamic watermarking (e.g., username and email) in real-time for security purposes. The video is being streamed in DASH format, and the segment files are in .m4s format generated via FFmpeg.


Challenges :
Is it possible to directly apply dynamic watermarking to .m4s segment files ?


Video segments are generated using FFmpeg with the following command :


ffmpeg
 .input(video_path)
 .output(mpd_path,
 format='dash',
 map='0',
 video_bitrate='2400k',
 video_size='1920x1080',
 vcodec='libx264',
 seg_duration='4', # Sets segment duration to 4 seconds
 acodec='copy')
 .run()




What I tried :
I attempted to use FFmpeg to apply a watermark dynamically to the .m4s files using the drawtext filter, but .m4s files are not always recognized as valid input for FFmpeg operations.


# FFmpeg command to add watermark to m4s file
try:
 # FFmpeg processing
 out, err = (
 ffmpeg
 .input(m4s_file_path) # Input the segment file
 .filter(
 "drawtext",
 text=user_info,
 fontfile="font/dejavu-sans/DejaVuSans-Bold.ttf",
 fontsize=24,
 fontcolor="white",
 x=10,
 y=10
 )
 .output(
 "pipe:", # Stream output as a byte stream
 format="mp4", # Output format as MP4 (compatible with MPEG-DASH)
 vcodec="libx264",
 acodec="copy",
 movflags="frag_keyframe+empty_moov"
 )
 .run(capture_stdout=True, capture_stderr=True)
 )

 logger.info(f"FFmpeg process completed. stdout length: {len(out)}, stderr: {err.decode('utf-8')}")
 logger.error(f"FFmpeg stderr: {err.decode('utf-8')}")
 return out # Return the processed video stream data


except ffmpeg.Error as e:
 stderr_output = e.stderr.decode('utf-8') if e.stderr else "No stderr available"
 logger.error(f"FFmpeg error: {stderr_output}")

 raise RuntimeError(f"Error processing video: {stderr_output}")




Error I faced :


video-streaming-backend | [mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f1bf99cc640] Could not find codec parameters for stream 0 (Video: h264 (avc1 / 0x31637661), none(tv, bt709), 1920x1012): unspecified pixel format
video-streaming-backend | Consider increasing the value for the 'analyzeduration' (10000000) and 'probesize' (5000000) options
video-streaming-backend | Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'http://web:8000/media/stream_video/chunks/ec1db006-b488-47ad-8220-79a05bcaae39/segments/init-stream0.m4s':
video-streaming-backend | Metadata:
video-streaming-backend | major_brand : iso5
video-streaming-backend | minor_version : 512
video-streaming-backend | compatible_brands: iso5iso6mp41
video-streaming-backend | encoder : Lavf60.16.100
video-streaming-backend | Duration: N/A, bitrate: N/A
video-streaming-backend | Stream #0:0[0x1](und): Video: h264 (avc1 / 0x31637661), none(tv, bt709), 1920x1012, SAR 1:1 DAR 480:253, 12288 tbr, 12288 tbn (default)
video-streaming-backend | Metadata:
video-streaming-backend | handler_name : VideoHandler
video-streaming-backend | vendor_id : [0][0][0][0]
video-streaming-backend | Stream mapping:
video-streaming-backend | Stream #0:0 (h264) -> drawtext:default
video-streaming-backend | drawtext:default -> Stream #0:0 (libx264)
video-streaming-backend | Press [q] to stop, [?] for help
video-streaming-backend | Cannot determine format of input stream 0:0 after EOF
video-streaming-backend | Error marking filters as finished
video-streaming-backend | Error while filtering: Invalid data found when processing input
video-streaming-backend | [out#0/mp4 @ 0x7f1bf8e73100] Nothing was written into output file, because at least one of its streams received no packets.
video-streaming-backend | frame= 0 fps=0.0 q=0.0 Lsize= 0kB time=N/A bitrate=N/A speed=N/A 
video-streaming-backend | Conversion failed!




These errors have left me wondering if .m4s is a viable format for dynamic watermarking. If it's not, what would be the correct approach ?