
Recherche avancée
Autres articles (108)
-
MediaSPIP 0.1 Beta version
25 avril 2011, parMediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
The zip file provided here only contains the sources of MediaSPIP in its standalone version.
To get a working installation, you must manually install all-software dependencies on the server.
If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...) -
MediaSPIP version 0.1 Beta
16 avril 2011, parMediaSPIP 0.1 beta est la première version de MediaSPIP décrétée comme "utilisable".
Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
Pour avoir une installation fonctionnelle, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...) -
HTML5 audio and video support
13 avril 2011, parMediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
For older browsers the Flowplayer flash fallback is used.
MediaSPIP allows for media playback on major mobile platforms with the above (...)
Sur d’autres sites (15780)
-
Youtube automatic creating and starting live stream with ffmpeg Python
20 août 2023, par MrKolia1_1I'm trying to create a new broadcast on the channel and then start the stream so that the video is broadcast, the problem is that I can't start the broadcast after it is created, it is in the scheduled, how can I start the broadcast ?




import datetime
import json
import os
import threading
import time

import cv2
import subprocess
from google.auth.transport.requests import Request
from google.oauth2.credentials import Credentials
from google_auth_oauthlib.flow import InstalledAppFlow
from googleapiclient.discovery import build

APP_TOKEN_FILE = "client_secret.json"
USER_TOKEN_FILE = "user_token.json"

SCOPES = [
 'https://www.googleapis.com/auth/youtube.force-ssl',
 'https://www.googleapis.com/auth/userinfo.profile',
]


def get_stream_info(stream_id):
 creds = get_creds_saved()
 service = build('youtube', 'v3', credentials=creds)

 request = service.liveBroadcasts().list(
 part='snippet,contentDetails,status',
 id=stream_id
 )

 response = request.execute()

 if 'items' in response and len(response['items']) > 0:
 return response['items'][0]
 else:
 return None


def get_creds_cons():
 # Create credentials via console flow
 flow = InstalledAppFlow.from_client_secrets_file(APP_TOKEN_FILE, SCOPES)
 return flow.run_console()


def get_creds_saved():
 creds = None

 if os.path.exists(USER_TOKEN_FILE):
 # Load user credentials from a saved file
 creds = Credentials.from_authorized_user_file(USER_TOKEN_FILE, SCOPES)

 if not creds or not creds.valid:
 if creds and creds.expired and creds.refresh_token:
 creds.refresh(Request())
 else:
 # Create new credentials via local server flow
 flow = InstalledAppFlow.from_client_secrets_file(APP_TOKEN_FILE, SCOPES)
 creds = flow.run_local_server(port=0)

 with open(USER_TOKEN_FILE, 'w') as token:
 token.write(creds.to_json())

 return creds


def get_service():
 # Get YouTube API service using credentials
 creds = get_creds_saved()
 service = build('youtube', 'v3', credentials=creds)
 return service


def create_live_stream(title, description):
 service = get_service()
 scheduled_start_time = datetime.datetime.utcnow().isoformat()

 request = service.liveBroadcasts().insert(
 part="snippet,status,contentDetails",
 body={
 "snippet": {
 "title": title,
 "description": description,
 "scheduledStartTime": scheduled_start_time,
 },
 "status": {
 "privacyStatus": "private",
 "lifeCycleStatus": "ready",
 "recordingStatus": "notRecording",
 "selfDeclaredMadeForKids": False
 },
 "contentDetails": {
 "enableAutoStart": False
 }
 }
 )
 response = request.execute()
 return response['id']


def stream_video(video_path, stream_key):
 args = [
 '-re',
 '-i', video_path,
 '-c:v', 'libx264',
 '-preset', 'veryfast',
 '-c:a', 'aac',
 '-f', 'flv',
 f'rtmp://a.rtmp.youtube.com/live2/{stream_key}'
 ]

 subprocess.run(['ffmpeg'] + args)


def get_scheduled_stream_info(stream_id):
 creds = get_creds_saved()
 service = build('youtube', 'v3', credentials=creds)

 request = service.liveBroadcasts().list(
 part='snippet,status',
 id=stream_id
 )

 response = request.execute()

 if 'items' in response and len(response['items']) > 0:
 return response['items'][0]
 else:
 return None



if __name__ == '__main__':
 print("** Hello, Azzrael_YT subscribers!!!\n")

 strId = create_live_stream("tittle", "description")
 pretty_json = json.dumps(get_scheduled_stream_info(strId), indent=4)

 print(pretty_json)

 # Stream video
 video_path = "C:/Users/admin/PycharmProjects/pythonProject/video.mp4" # Update this with your video file path
 stream_key = 'dh9z-jtkx-wbq3-6wvp-2tac' # Replace with your YouTube stream key
 video_thread = threading.Thread(target=stream_video, args=(video_path, stream_key))
 #video_thread.start()




json responce info from created stream :
,
"scheduledStartTime" : "2023-08-20T10:51:22Z",
"isDefaultBroadcast" : false,
"liveChatId" : "KicKGFVDZ01UNS1CLVNfV0FJencxVXY4cC1ZQRILSG9QU0RJZ2hQMkE"
,
"status" : 
"lifeCycleStatus" : "created",
"privacyStatus" : "private",
"recordingStatus" : "notRecording",
"madeForKids" : false,
"selfDeclaredMadeForKids" : false




-
Extract image frames from live non-youtube video streams
20 mars 2021, par feed_me_piI am trying to extract https videos which are live streaming on earthcam.net, skyline.net, etc. I have been,


FFmpeg -i "https://<>" -vf fps=1/5 out%d.png



but it gives
Invalid data found when processing input


-
Encode HEVC/H.265/HDR Video for YouTube from 10bit Pro-Res using FFmpeg
30 janvier 2018, par Rodrigo PoloI want to have an HDR YouTube video published, my source file is either an Apple ProRes or DNxHR using a chroma subsamplig 4:4:4 or full RGB, both 10bit, so the original source file has all what is needed in order to be encoded into a 10bit 4:2:0 H.265/HEVC (HDR).
I have followed some answers listed here, reviewed lots of different approaches, tried out many different commands without success, colors aren’t right when using only FFmpeg, to much red, when using only Adobe to encode into H.264 with the recommended settings on their support page, the results is darker, here are the commands I’ve using :
I have tried this :
ffmpeg \
-i input.mov \
-c:v libx265 \
-tag:v hvc1 \
-crf 21 \
-preset fast \
-pix_fmt yuv420p10le \
-x265-params "colorprim=bt2020:transfer=smpte2084:colormatrix=bt2020nc:master-display=G(13250,34500)B(7500,3000)R(34000,16000)WP(15635,16450)L(10000000,10):max-cll=1000,400" \
-c:a libfdk_aac \
-b:a 128k \
-ac 2 \
-ar 44100 \
-movflags +faststart \
output.mp4And this :
ffmpeg \
-y \
-hide_banner \
-i input.mov \
-pix_fmt yuv420p10le \
-vf "scale=out_color_matrix=bt2020:out_h_chr_pos=0:out_v_chr_pos=0,format=yuv420p10" \
-c:v libx265 \
-tag:v hvc1 \
-crf 21 \
-preset fast \
-x265-params 'crf=12:colorprim=bt2020:transfer=smpte-st-2084:colormatrix=bt2020nc:master-display="G(13250,34500)B(7500,3000)R(34000,16000)WP(15635,16450)L(10000000,1)":max-cll="1000,400"' \
-c:a libfdk_aac \
-b:a 128k \
-ac 2 \
-ar 44100 \
-movflags +faststart \
output.mp4I have also tried using MKVToolNix in order to insert the metadata into the encoded HEVC/H.265 file with the following command :
/Applications/MKVToolNix-9.7.1.app/Contents/MacOS/mkvmerge \
-o output.mkv \
--colour-matrix 0:9 \
--colour-range 0:1 \
--colour-transfer-characteristics 0:16 \
--colour-primaries 0:9 \
--max-content-light 0:1000 \
--max-frame-light 0:300 \
--max-luminance 0:1000 \
--min-luminance 0:0.01 \
--chromaticity-coordinates 0:0.68,0.32,0.265,0.690,0.15,0.06 \
--white-colour-coordinates 0:0.3127,0.3290 \
input.mp4But the result is the same and YouTube don’t recognize the file as an HDR file, it does only with the first FFmpeg command and with the file encoded with Adobe Premiere, but the colors don’t look well, so, maybe I’m getting some concept wrong, thanks for your help.