
Recherche avancée
Médias (1)
-
Rennes Emotion Map 2010-11
19 octobre 2011, par
Mis à jour : Juillet 2013
Langue : français
Type : Texte
Autres articles (32)
-
Qu’est ce qu’un éditorial
21 juin 2013, parEcrivez votre de point de vue dans un article. Celui-ci sera rangé dans une rubrique prévue à cet effet.
Un éditorial est un article de type texte uniquement. Il a pour objectif de ranger les points de vue dans une rubrique dédiée. Un seul éditorial est placé à la une en page d’accueil. Pour consulter les précédents, consultez la rubrique dédiée.
Vous pouvez personnaliser le formulaire de création d’un éditorial.
Formulaire de création d’un éditorial Dans le cas d’un document de type éditorial, les (...) -
List of compatible distributions
26 avril 2011, parThe table below is the list of Linux distributions compatible with the automated installation script of MediaSPIP. Distribution nameVersion nameVersion number Debian Squeeze 6.x.x Debian Weezy 7.x.x Debian Jessie 8.x.x Ubuntu The Precise Pangolin 12.04 LTS Ubuntu The Trusty Tahr 14.04
If you want to help us improve this list, you can provide us access to a machine whose distribution is not mentioned above or send the necessary fixes to add (...) -
Personnaliser les catégories
21 juin 2013, parFormulaire de création d’une catégorie
Pour ceux qui connaissent bien SPIP, une catégorie peut être assimilée à une rubrique.
Dans le cas d’un document de type catégorie, les champs proposés par défaut sont : Texte
On peut modifier ce formulaire dans la partie :
Administration > Configuration des masques de formulaire.
Dans le cas d’un document de type média, les champs non affichés par défaut sont : Descriptif rapide
Par ailleurs, c’est dans cette partie configuration qu’on peut indiquer le (...)
Sur d’autres sites (6116)
-
Connecting IP Camera with YouTube using FFMPEG
19 novembre 2022, par vcimaI´m trying to connect my ip camera with Youtube using ffmpeg to convert the stream from RTSP to RTMP.


rtsp_url="rtsp://xxxxxx"
rtmp_url="rtmp://xxxxxx"

ffmpeg -rtsp_transport tcp -i $rtsp_url -tune zerolatency -vcodec libx264 -pix_fmt + -c:v copy -c:a aac -strict experimental -f flv $rtmp_url



This works fine, but I have several problems that I don't know how to solve.


- 

-
Sometimes, for different reasons, I lose the connection with the camera : stoppage during the night, coverage problems... and I don't want the process disconnect from Youtube. How could I do it ? Could I put a default image while there is no connection to the camera ?


-
The last question would be. How can I guarantee that the Youtube player id associated with the process is always the same. It is quite inconvenient to have to update the player every time there is a connection problem.








Regards


-
-
Getting Error while trying to download youtube video by using python
23 octobre 2024, par Aditya KumarCode


I'm working on a script that allows users to manually select and download separate video and audio streams from YouTube using yt-dlp. The script lists the available video and audio formats, lets the user choose their desired formats, and then merges them using FFmpeg.


Here’s the complete code :


import yt_dlp
import os
import subprocess

# Function to list and allow manual selection of video and audio formats
def download_and_merge_video_audio_with_selection(url, download_path):
 try:
 # Ensure the download path exists
 if not os.path.exists(download_path):
 os.makedirs(download_path)

 # Get available formats from yt-dlp
 ydl_opts = {'listformats': True}

 with yt_dlp.YoutubeDL(ydl_opts) as ydl:
 info_dict = ydl.extract_info(url, download=False)
 formats = info_dict.get('formats', [])

 # List available video formats (video only)
 print("\nAvailable video formats:")
 video_formats = [f for f in formats if f.get('vcodec') != 'none' and f.get('acodec') == 'none']
 for idx, f in enumerate(video_formats):
 resolution = f.get('height', 'unknown')
 filesize = f.get('filesize', 'unknown')
 print(f"{idx}: Format code: {f['format_id']}, Resolution: {resolution}p, Size: {filesize} bytes")

 # Let user select the desired video format
 video_idx = int(input("\nEnter the number corresponding to the video format you want to download: "))
 video_format_code = video_formats[video_idx]['format_id']

 # List available audio formats (audio only)
 print("\nAvailable audio formats:")
 audio_formats = [f for f in formats if f.get('acodec') != 'none' and f.get('vcodec') == 'none']
 for idx, f in enumerate(audio_formats):
 abr = f.get('abr', 'unknown') # Audio bitrate
 filesize = f.get('filesize', 'unknown')
 print(f"{idx}: Format code: {f['format_id']}, Audio Bitrate: {abr} kbps, Size: {filesize} bytes")

 # Let user select the desired audio format
 audio_idx = int(input("\nEnter the number corresponding to the audio format you want to download: "))
 audio_format_code = audio_formats[audio_idx]['format_id']

 # Video download options (based on user choice)
 video_opts = {
 'format': video_format_code, # Download user-selected video format
 'outtmpl': os.path.join(download_path, 'video.%(ext)s'), # Save video as video.mp4
 }

 # Audio download options (based on user choice)
 audio_opts = {
 'format': audio_format_code, # Download user-selected audio format
 'outtmpl': os.path.join(download_path, 'audio.%(ext)s'), # Save audio as audio.m4a
 }

 # Download the selected video format
 print("\nDownloading selected video format...")
 with yt_dlp.YoutubeDL(video_opts) as ydl_video:
 ydl_video.download([url])

 # Download the selected audio format
 print("\nDownloading selected audio format...")
 with yt_dlp.YoutubeDL(audio_opts) as ydl_audio:
 ydl_audio.download([url])

 # Paths to the downloaded video and audio files
 video_file = os.path.join(download_path, 'video.webm') # Assuming best video will be .mp4
 audio_file = os.path.join(download_path, 'audio.m4a') # Assuming best audio will be .m4a
 output_file = os.path.join(download_path, 'final_output.mp4') # Final merged file

 # FFmpeg command to merge audio and video
 ffmpeg_cmd = [
 'ffmpeg', '-i', video_file, '-i', audio_file, '-c', 'copy', output_file
 ]

 # Run FFmpeg to merge audio and video
 print("\nMerging video and audio...")
 subprocess.run(ffmpeg_cmd, check=True)

 print(f"\nDownload and merging complete! Output file: {output_file}")

 except Exception as e:
 print(f"An error occurred: {e}")

# Example usage
video_url = "https://www.youtube.com/watch?v=SOwk8FhfEZY" # Replace with your desired video URL
download_path = 'C:/Users/vinod/Downloads/VideoDownload' # Replace with your desired download path
download_and_merge_video_audio_with_selection(video_url, download_path)




Explanation :


The script first lists all available video formats (video-only) and audio formats (audio-only) from a given YouTube URL.


It allows the user to manually select their preferred video and audio formats.


After downloading the selected formats, it merges the video and audio streams into a single file using FFmpeg.


Error


while trying to run above mentioned code , I am getting this error :


Merging video and audio...
An error occurred: [WinError 2] The system cannot find the file specified



Requirements :




yt-dlp :
pip install yt-dlp






FFmpeg : Make sure you have FFmpeg installed and added to your system's PATH.




-
How do I merge multiple video files with youtube-dl ? [on hold]
11 octobre 2016, par Jeremy MI am trying to download from a site called tudou with youtube-dl and it downloads the videos into multiple f4v parts. Is there any way I can stitch them together ?