
Recherche avancée
Autres articles (37)
-
Les autorisations surchargées par les plugins
27 avril 2010, parMediaspip core
autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs -
Support de tous types de médias
10 avril 2011Contrairement à beaucoup de logiciels et autres plate-formes modernes de partage de documents, MediaSPIP a l’ambition de gérer un maximum de formats de documents différents qu’ils soient de type : images (png, gif, jpg, bmp et autres...) ; audio (MP3, Ogg, Wav et autres...) ; vidéo (Avi, MP4, Ogv, mpg, mov, wmv et autres...) ; contenu textuel, code ou autres (open office, microsoft office (tableur, présentation), web (html, css), LaTeX, Google Earth) (...)
-
L’utiliser, en parler, le critiquer
10 avril 2011La première attitude à adopter est d’en parler, soit directement avec les personnes impliquées dans son développement, soit autour de vous pour convaincre de nouvelles personnes à l’utiliser.
Plus la communauté sera nombreuse et plus les évolutions seront rapides ...
Une liste de discussion est disponible pour tout échange entre utilisateurs.
Sur d’autres sites (6727)
-
'ffmpeg' or 'handbrake cli' for video conversion on server ? [closed]
18 juin 2013, par AaronJiangI want to convert videos on my server using command line, maily mp4 -> flv or flv -> mp4. I googled and found these two products 'ffmpeg' and 'HandBrake cli'.
https://trac.handbrake.fr/wiki/CLIGuide
Which one is better ?
Plus I am running on ubuntu server.
-
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




-
Libav linking error : undefined references
22 février 2017, par FedechHere’s my problem :
- I built ffmpeg from source (version 1.2), the libav* libraries are in /usr/local/lib and they’re static
- I’m compiling a ns3 (www.nsnam.org) module, so my only control over the linker is through the env variable LINKFLAGS
- In the source the headers are in a "extern C" block, so it’s not the usual g++ name mangling
- I set LINKFLAGS="-I/usr/local/include/libavformat -I/usr/local/include/libavcodec -I/usr/local/include/libavutil -L/usr/local/lib -lavformat -lavcodec -lavutil", and the linker can’t seem to find any of the libav* functions I call (I get a lot of "undefined reference" and then "collect2 : error : ld returned status 1"
Can anyone help me ? Thanks...
edit : here are a few of the undefined reference messages :
./libns3.14.1-qoe-monitor-debug.so: undefined reference to `av_guess_format'
./libns3.14.1-qoe-monitor-debug.so: undefined reference to `av_read_frame'
./libns3.14.1-qoe-monitor-debug.so: undefined reference to `avformat_write_header'
./libns3.14.1-qoe-monitor-debug.so: undefined reference to `av_interleaved_write_frame'
./libns3.14.1-qoe-monitor-debug.so: undefined reference to `av_find_stream_info'
./libns3.14.1-qoe-monitor-debug.so: undefined reference to `av_register_all'
./libns3.14.1-qoe-monitor-debug.so: undefined reference to `av_init_packet'
./libns3.14.1-qoe-monitor-debug.so: undefined reference to `avformat_alloc_context'
./libns3.14.1-qoe-monitor-debug.so: undefined reference to `av_dump_format'
./libns3.14.1-qoe-monitor-debug.so: undefined reference to `avio_close'edit2 : here is the message I get after "build failed" :
-> task in 'scratch-simulator' failed (exit status 1):
{task 53952272: cxxprogram scratch-simulator.cc.1.o -> scratch-simulator}
['/usr/bin/g++', '-I/usr/local/include/libavcodec', '-I/usr/local/include/libavformat/',
'-I/usr/local/include/libavutil/', '-L/usr/local/lib', '-I/usr/local
/include/libavcodec', '-I/usr/local/include/libavformat/', '-I/usr/local/include
/libavutil/', '-L/usr/local/lib', '-pthread', '-pthread', '-Wl,-z,relro',
'scratch/scratch-simulator.cc.1.o', '-o', '/home/fede/Thesis/ns-allinone-3.14.1
/ns-3.14.1/build/scratch/scratch-simulator', '-Wl,-Bstatic', '-Wl,-Bdynamic',
'-Wl,--no-as-needed', '-L.', '-L.', '-L.', '-L.', '-L.', '-L.', '-L.', '-L.', '-L.',
'-L.', '-L.', '-L.', '-L.', '-L.', '-L.', '-L.', '-L.', '-L.', '-L.', '-L.', '-L.',
'-L.', '-L.', '-L.', '-L.', '-L.', '-L.', '-L.', '-L.', '-L.', '-L.', '-L.', '-L.',
'-L.', '-L.', '-L.', '-L.', '-L.', '-L/usr/lib', '-lns3.14.1-test-debug', '-lns3.14.1-
csma-layout-debug', '-lns3.14.1-point-to-point-layout-debug', '-lns3.14.1-netanim-
debug', '-lns3.14.1-lte-debug', '-lns3.14.1-spectrum-debug', '-lns3.14.1-antenna-
debug', '-lns3.14.1-aodv-debug', '-lns3.14.1-dsdv-debug', '-lns3.14.1-dsr-debug',
'-lns3.14.1-mesh-debug', '-lns3.14.1-olsr-debug', '-lns3.14.1-csma-debug', '-lns3.14.1-
wimax-debug', '-lns3.14.1-applications-debug', '-lns3.14.1-virtual-net-device-debug',
'-lns3.14.1-uan-debug', '-lns3.14.1-energy-debug', '-lns3.14.1-flow-monitor-debug',
'-lns3.14.1-nix-vector-routing-debug', '-lns3.14.1-tap-bridge-debug', '-lns3.14.1-
visualizer-debug', '-lns3.14.1-internet-debug', '-lns3.14.1-bridge-debug', '-lns3.14.1-
point-to-point-debug', '-lns3.14.1-mpi-debug', '-lns3.14.1-wifi-debug', '-lns3.14.1-
buildings-debug', '-lns3.14.1-propagation-debug', '-lns3.14.1-mobility-debug',
'-lns3.14.1-config-store-debug', '-lns3.14.1-tools-debug', '-lns3.14.1-stats-debug',
'-lns3.14.1-emu-debug', '-lns3.14.1-topology-read-debug', '-lns3.14.1-network-debug',
'-lns3.14.1-qoe-monitor-debug', '-lns3.14.1-core-debug', '-lrt', '-lgsl',
'-lgslcblas', '-lm', '-ldl', '-lgtk-x11-2.0', '-lgdk-x11-2.0', '-latk-1.0',
'-lgio-2.0', '-lpangoft2-1.0', '-lpangocairo-1.0', '-lgdk_pixbuf-2.0', '-lcairo',
'-lpango-1.0', '-lfreetype', '-lfontconfig', '-lgobject-2.0', '-lglib-2.0', '-lxml2',
'-lpython2.7']