
Recherche avancée
Autres articles (53)
-
Configurer la prise en compte des langues
15 novembre 2010, parAccéder à la configuration et ajouter des langues prises en compte
Afin de configurer la prise en compte de nouvelles langues, il est nécessaire de se rendre dans la partie "Administrer" du site.
De là, dans le menu de navigation, vous pouvez accéder à une partie "Gestion des langues" permettant d’activer la prise en compte de nouvelles langues.
Chaque nouvelle langue ajoutée reste désactivable tant qu’aucun objet n’est créé dans cette langue. Dans ce cas, elle devient grisée dans la configuration et (...) -
Contribute to translation
13 avril 2011You can help us to improve the language used in the software interface to make MediaSPIP more accessible and user-friendly. You can also translate the interface into any language that allows it to spread to new linguistic communities.
To do this, we use the translation interface of SPIP where the all the language modules of MediaSPIP are available. Just subscribe to the mailing list and request further informantion on translation.
MediaSPIP is currently available in French and English (...) -
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
Sur d’autres sites (8459)
-
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




-
How to chose a stream from all stream in ffmpeg
27 février 2016, par combo_ciI try to convert a UDP stream (that genrated from DVB signal) to HLS m3u8 file with this code :
ffmpeg -i udp://239.1.2.1:60001 -acodec aac -strict -2 -vcodec libx264 -hls_wrap 100 -f hls /var/www/html/ts/1.m3u8
UDP stream contain 1 channel (in this case IRIB-TV1).
When i run this code ffmpeg detect all of service and channel that streamed from DVB card with this message :
Input #0, mpegts, from 'udp://239.1.2.1:60001':
Duration: N/A, start: 77906.812644, bitrate: N/A
Program 101
Metadata:
service_name : IRIB-TV1
service_provider: IRIB
Stream #0:0[0x3f2]: Video: h264 (Main) ([27][0][0][0] / 0x001B), yuv420p(tv, bt470bg), 720x576 [SAR 12:11 DAR 15:11], 25 fps, 50 tbr, 90k tbn, 50 tbc
Stream #0:1[0x3f3](per): Audio: aac_latm ([17][0][0][0] / 0x0011), 48000 Hz, stereo, fltp
Program 102
Metadata:
service_name : IRIB-TV2
service_provider: IRIB
Program 103
Metadata:
service_name : IRIB-TV3
service_provider: IRIB
Program 104
Metadata:
service_name : IRIB-TV4
service_provider: IRIBAs you see ffmpeg finf 4 channel in UDP stream, But VLC play only channel 1(IRIB-TV1).
Now i have have 2 question :
1-Can I get all channel and service via this ffmpeg code ?
2-Can i choose a spesial stream from this ffmpeg code ?(i know that ffmpeg can choose a stream with -map otion but i want to choose other service_name that in output log)
-
Your FFProbe version is too old and does not support `-help` option, please upgrade ?
27 juillet 2014, par user3820641Hi I was doing some project in symfony2 for video upoading service and everything works just fine on symfony2 internal server.But when I switched to Lamp and Xampp I started to get this error.Iam using dubture ffmpeg bundle which is based on php-ffmpeg.What should I do ?