Recherche avancée

Médias (21)

Mot : - Tags -/Nine Inch Nails

Autres articles (71)

  • Publier sur MédiaSpip

    13 juin 2013

    Puis-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

  • Le profil des utilisateurs

    12 avril 2011, par

    Chaque utilisateur dispose d’une page de profil lui permettant de modifier ses informations personnelle. Dans le menu de haut de page par défaut, un élément de menu est automatiquement créé à l’initialisation de MediaSPIP, visible uniquement si le visiteur est identifié sur le site.
    L’utilisateur a accès à la modification de profil depuis sa page auteur, un lien dans la navigation "Modifier votre profil" est (...)

  • Configurer la prise en compte des langues

    15 novembre 2010, par

    Accé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 (...)

Sur d’autres sites (7065)

  • Building FFmpeg with NVIDIA GPU Hardware Acceleration in docker image, cannot load libnvcuvid.so.1 and libnvidia-encode.so.1

    22 mars 2023, par konovification

    I'm trying to build FFmpeg with NVIDIA GPU Hardware Acceleration following these instructions : https://docs.nvidia.com/video-technologies/video-codec-sdk/ffmpeg-with-nvidia-gpu/index.html#compiling-for-linux. The Docker image I'm using is nvidia/cuda:12.0.1-devel-ubuntu20.04

    


    Running the test command ffmpeg -y -vsync 0 -hwaccel cuda -hwaccel_output_format cuda -i bbb.mp4 -c:a copy -c:v h264_nvenc -b:v 5M output.mp4, I get the following output :

    


    ffmpeg version N-109965-ge50a02b0f6 Copyright (c) 2000-2023 the FFmpeg developers                                                                                                                                                                                               
  built with gcc 9 (Ubuntu 9.4.0-1ubuntu1~20.04.1)                                                                                                                                                                                                                              
  configuration: --enable-nonfree --enable-cuda-nvcc --enable-libnpp --extra-cflags=-I/usr/local/cuda/include --extra-ldflags=-L/usr/local/cuda/lib64 --disable-static --enable-shared                                                                                          
  libavutil      58.  3.100 / 58.  3.100                                                                                                                                                                                                                                        
  libavcodec     60.  6.100 / 60.  6.100                                                                                                                                                                                                                                        
  libavformat    60.  4.100 / 60.  4.100                                                                                                                                                                                                                                        
  libavdevice    60.  2.100 / 60.  2.100                                                                                                                                                                                                                                        
  libavfilter     9.  4.100 /  9.  4.100                                                                                                                                                                                                                                        
  libswscale      7.  2.100 /  7.  2.100                                                                                                                                                                                                                                        
  libswresample   4. 11.100 /  4. 11.100                                                                                                                                                                                                                                        
-vsync is deprecated. Use -fps_mode                                                                                                                                                                                                                                             
Passing a number to -vsync is deprecated, use a string argument as described in the manual.                                                                                                                                                                                     
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'bbb.mp4':                                                                                                                                                                                                                              
  Metadata:                                                                                                                                                                                                                                                                     
    major_brand     : isom                                                                                                                                                                                                                                                      
    minor_version   : 1                                                                                                                                                                                                                                                         
    compatible_brands: isomavc1                                                                                                                                                                                                                                                 
    creation_time   : 2013-12-16T17:44:39.000000Z                                                                                                                                                                                                                               
    title           : Big Buck Bunny, Sunflower version                                                                                                                                                                                                                         
    artist          : Blender Foundation 2008, Janus Bager Kristensen 2013                                                                                                                                                                                                      
    comment         : Creative Commons Attribution 3.0 - http://bbb3d.renderfarming.net                                                                                                                                                                                         
    genre           : Animation                                                                                                                                                                                                                                                 
    composer        : Sacha Goedegebure                                                                                                                                                                                                                                         
  Duration: 00:10:34.60, start: 0.000000, bitrate: 3481 kb/s                                                                                                                                                                                                                    
  Stream #0:0[0x1](und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(progressive), 1920x1080 [SAR 1:1 DAR 16:9], 2998 kb/s, 30 fps, 30 tbr, 30k tbn (default)
    Metadata:                                                                                                                           
      creation_time   : 2013-12-16T17:44:39.000000Z                                                                                     
      handler_name    : GPAC ISO Video Handler                                                                                          
      vendor_id       : [0][0][0][0]                                                                                                    
  Stream #0:1[0x2](und): Audio: mp3 (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 160 kb/s (default)                                     
    Metadata:                                                                                                                           
      creation_time   : 2013-12-16T17:44:42.000000Z                                                                                     
      handler_name    : GPAC ISO Audio Handler                                                                                          
      vendor_id       : [0][0][0][0]                                                                                                                                                                                                                                            
  Stream #0:2[0x3](und): Audio: ac3 (ac-3 / 0x332D6361), 48000 Hz, 5.1(side), fltp, 320 kb/s (default)                                                                                                                                                                          
    Metadata:                                                                                                                                                                                                                                                                   
      creation_time   : 2013-12-16T17:44:42.000000Z                                                                                                                                                                                                                             
      handler_name    : GPAC ISO Audio Handler                                                                                                                                                                                                                                  
      vendor_id       : [0][0][0][0]                                                                                                                                                                                                                                            
    Side data:                                                                                                                                                                                                                                                                  
      audio service type: main                                                                                                                                                                                                                                                  
Stream mapping:                                                                                                                                                                                                                                                                 
  Stream #0:0 -> #0:0 (h264 (native) -> h264 (h264_nvenc))                                                                                                                                                                                                                      
  Stream #0:2 -> #0:1 (copy)                                                                                                                                                                                                                                                    
Press [q] to stop, [?] for help                                                                                                                                                                                                                                                 
[h264 @ 0x55bd878c2d80] Cannot load libnvcuvid.so.1                                                                                                                                                                                                                             
[h264 @ 0x55bd878c2d80] Failed loading nvcuvid.                                                                                                                                                                                                                                 
[h264 @ 0x55bd878c2d80] Failed setup for format cuda: hwaccel initialisation returned error.                                                                                                                                                                                    
[h264_nvenc @ 0x55bd86f5e680] Cannot load libnvidia-encode.so.1                                                                                                                                                                                                                 
[h264_nvenc @ 0x55bd86f5e680] The minimum required Nvidia driver for nvenc is 520.56.06 or newer                                                                                                                                                                                
[vost#0:0/h264_nvenc @ 0x55bd86f5e1c0] Error initializing output stream: Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
Conversion failed! 


    


    Output from nvidia-smi :

    


    +-----------------------------------------------------------------------------+
| NVIDIA-SMI 525.85.05    Driver Version: 525.85.05    CUDA Version: 12.0     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  NVIDIA GeForce ...  Off  | 00000000:01:00.0  On |                  N/A |
| 27%   43C    P8    12W / 250W |    500MiB / 11264MiB |      1%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
+-----------------------------------------------------------------------------+


    


    The shared libraries are not part of the docker image. What are my options to add them ?

    


  • 12 ffmpeg xfade transitions : "option not found"

    17 juillet 2023, par nimda

    I'm running into a strange error where each of these following 12 of the 56 xfade transitions are throwing errors :

    


      

    • hlwind
    • 


    • hrwind
    • 


    • vuwind
    • 


    • vdwind
    • 


    • coverleft
    • 


    • coverright
    • 


    • coverup
    • 


    • coverdown
    • 


    • revealleft
    • 


    • revealright
    • 


    • revealup
    • 


    • revealdown
    • 


    


    I've tested all filter transitions with the following command, which is being generated by a nodeJS app with the fluent-ffmpeg library, and only the twelve listed above fail with the same error "option not found" :

    


    ffmpeg -f lavfi -t 169
  -i color=c=000000:s=960x540:r=30:duration=169
  -i file:///Users/johnbandy/Work/Projects/Active/CNCT/XFade/_assets/crosstrekvx-1.jpg
  -i file:///Users/johnbandy/Work/Projects/Active/CNCT/XFade/_assets/crosstrekvx-2.jpg 
  -filter_complex
    [1:v]format=pix_fmts=yuva420p,scale=w=4608:h=-1,zoompan=z='1.2+(0*(ot/4))':x='(on/(30*4))*(iw-iw/1.2)':y='(ih-ih/zoom)/2':d=120:s=960x540[1_up];
    [1_up]scale=w=960:h=-1[1_down];
    [2:v]format=pix_fmts=yuva420p,scale=w=4608:h=-1,zoompan=z='1.2+(0*(ot/4))':x='(on/(30*4))*(iw-iw/1.2)':y='(ih-ih/zoom)/2':d=120:s=960x540[2_up];
    [2_up]scale=w=960:h=-1[2_down];
    [1_down][2_down]xfade=transition=revealdown:duration=1:offset=3[2_out];
    [0:v][2_out]overlay=x=0:y=0:enable='lte(t,7)'[all_out]
  -vcodec libx264 -r 30 -f mp4 -map [all_out] -preset veryfast -crf 18 -movflags frag_keyframe+empty_moov -pix_fmt yuv420p all.mp4


    


    fflog output :

    


    ffmpeg version 6.0 Copyright (c) 2000-2023 the FFmpeg developers
  built with Apple clang version 14.0.3 (clang-1403.0.22.14.1)
  configuration: --prefix=/opt/homebrew/Cellar/ffmpeg/6.0 --enable-shared --enable-pthreads --enable-version3 --cc=clang --host-cflags= --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libaribb24 --enable-libbluray --enable-libdav1d --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librist --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libsvtav1 --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libspeex --enable-libsoxr --enable-libzmq --enable-libzimg --disable-libjack --disable-indev=jack --enable-videotoolbox --enable-audiotoolbox --enable-neon
  libavutil      58.  2.100 / 58.  2.100
  libavcodec     60.  3.100 / 60.  3.100
  libavformat    60.  3.100 / 60.  3.100
  libavdevice    60.  1.100 / 60.  1.100
  libavfilter     9.  3.100 /  9.  3.100
  libswscale      7.  1.100 /  7.  1.100
  libswresample   4. 10.100 /  4. 10.100
  libpostproc    57.  1.100 / 57.  1.100
Input #0, lavfi, from 'color=c=000000:s=960x540:r=30:duration=169':
  Duration: N/A, start: 0.000000, bitrate: N/A
  Stream #0:0: Video: wrapped_avframe, yuv420p, 960x540 [SAR 1:1 DAR 16:9], 30 fps, 30 tbr, 30 tbn
Input #1, image2, from 'file:///Users/johnbandy/Work/Projects/Active/CNCT/XFade/_assets/crosstrekvx-1.jpg':
  Duration: 00:00:00.04, start: 0.000000, bitrate: 36486 kb/s
  Stream #1:0: Video: mjpeg (Baseline), yuvj444p(pc, bt470bg/unknown/unknown), 960x540, 25 fps, 25 tbr, 25 tbn
Input #2, image2, from 'file:///Users/johnbandy/Work/Projects/Active/CNCT/XFade/_assets/crosstrekvx-2.jpg':
  Duration: 00:00:00.04, start: 0.000000, bitrate: 35680 kb/s
  Stream #2:0: Video: mjpeg (Baseline), yuvj444p(pc, bt470bg/unknown/unknown), 960x540, 25 fps, 25 tbr, 25 tbn
[Parsed_xfade_8 @ 0x60000137cb00] [Eval @ 0x16f9b5348] Undefined constant or missing '(' in 'revealdown'
[Parsed_xfade_8 @ 0x60000137cb00] Unable to parse option value "revealdown"
Error applying option 'transition' to filter 'xfade': Option not found
Error initializing complex filters.
Option not found


    


    The fflog for a successful video generation follows (for comparison to the erroneous log above) :

    


    ffmpeg version 6.0 Copyright (c) 2000-2023 the FFmpeg developers
  built with Apple clang version 14.0.3 (clang-1403.0.22.14.1)
  configuration: --prefix=/opt/homebrew/Cellar/ffmpeg/6.0 --enable-shared --enable-pthreads --enable-version3 --cc=clang --host-cflags= --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libaribb24 --enable-libbluray --enable-libdav1d --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librist --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libsvtav1 --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libspeex --enable-libsoxr --enable-libzmq --enable-libzimg --disable-libjack --disable-indev=jack --enable-videotoolbox --enable-audiotoolbox --enable-neon
  libavutil      58.  2.100 / 58.  2.100
  libavcodec     60.  3.100 / 60.  3.100
  libavformat    60.  3.100 / 60.  3.100
  libavdevice    60.  1.100 / 60.  1.100
  libavfilter     9.  3.100 /  9.  3.100
  libswscale      7.  1.100 /  7.  1.100
  libswresample   4. 10.100 /  4. 10.100
  libpostproc    57.  1.100 / 57.  1.100
Input #0, lavfi, from 'color=c=000000:s=960x540:r=30:duration=169':
  Duration: N/A, start: 0.000000, bitrate: N/A
  Stream #0:0: Video: wrapped_avframe, yuv420p, 960x540 [SAR 1:1 DAR 16:9], 30 fps, 30 tbr, 30 tbn
Input #1, image2, from 'file:///Users/johnbandy/Work/Projects/Active/CNCT/XFade/_assets/crosstrekvx-1.jpg':
  Duration: 00:00:00.04, start: 0.000000, bitrate: 36486 kb/s
  Stream #1:0: Video: mjpeg (Baseline), yuvj444p(pc, bt470bg/unknown/unknown), 960x540, 25 fps, 25 tbr, 25 tbn
Input #2, image2, from 'file:///Users/johnbandy/Work/Projects/Active/CNCT/XFade/_assets/crosstrekvx-2.jpg':
  Duration: 00:00:00.04, start: 0.000000, bitrate: 35680 kb/s
  Stream #2:0: Video: mjpeg (Baseline), yuvj444p(pc, bt470bg/unknown/unknown), 960x540, 25 fps, 25 tbr, 25 tbn
Stream mapping:
  Stream #0:0 (wrapped_avframe) -> overlay
  Stream #1:0 (mjpeg) -> format:default
  Stream #2:0 (mjpeg) -> format:default
  overlay:default -> Stream #0:0 (libx264)
Press [q] to stop, [?] for help
[swscaler @ 0x140158000] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x120098000] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x130078000] deprecated pixel format used, make sure you did set range correctly
    Last message repeated 2 times
[swscaler @ 0x140598000] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x1302d8000] deprecated pixel format used, make sure you did set range correctly
    Last message repeated 1 times
[libx264 @ 0x138e09080] using SAR=1/1
[libx264 @ 0x138e09080] using cpu capabilities: ARMv8 NEON
[libx264 @ 0x138e09080] profile High, level 3.1, 4:2:0, 8-bit
[libx264 @ 0x138e09080] 264 - core 164 r3095 baee400 - H.264/MPEG-4 AVC codec - Copyleft 2003-2022 - http://www.videolan.org/x264.html - options: cabac=1 ref=1 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=2 psy=1 psy_rd=1.00:0.00 mixed_ref=0 me_range=16 chroma_me=1 trellis=0 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=0 threads=12 lookahead_threads=4 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=1 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=10 rc=crf mbtree=1 crf=18.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to 'all.mp4':
  Metadata:
    encoder         : Lavf60.3.100
  Stream #0:0: Video: h264 (avc1 / 0x31637661), yuv420p(progressive), 960x540 [SAR 1:1 DAR 16:9], q=2-31, 30 fps, 15360 tbn
    Metadata:
      encoder         : Lavc60.3.100 libx264
    Side data:
      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A
frame=    0 fps=0.0 q=0.0 size=       0kB time=-577014:32:22.77 bitrate=  -0.0kbits/s speed=N/A    
frame=   32 fps=0.0 q=24.0 size=       0kB time=00:00:01.00 bitrate=   0.3kbits/s speed=1.94x    
frame=   87 fps= 84 q=24.0 size=       0kB time=00:00:02.83 bitrate=   0.1kbits/s speed=2.75x    
frame=  164 fps=107 q=24.0 size=       0kB time=00:00:05.40 bitrate=   0.1kbits/s speed=3.52x    
frame=  812 fps=399 q=24.0 size=     512kB time=00:00:26.96 bitrate= 155.5kbits/s speed=13.3x    
frame= 1821 fps=718 q=24.0 size=     512kB time=00:01:00.60 bitrate=  69.2kbits/s speed=23.9x    
frame= 2469 fps=813 q=24.0 size=     512kB time=00:01:22.23 bitrate=  51.0kbits/s speed=27.1x    
frame= 3421 fps=967 q=24.0 size=     512kB time=00:01:53.96 bitrate=  36.8kbits/s speed=32.2x    
frame= 4522 fps=1120 q=24.0 size=     768kB time=00:02:30.63 bitrate=  41.8kbits/s speed=37.3x    
frame= 5070 fps=1184 q=-1.0 Lsize=     812kB time=00:02:48.90 bitrate=  39.4kbits/s speed=39.5x    
video:769kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 5.626653%
[libx264 @ 0x138e09080] frame I:21    Avg QP: 2.73  size:  3710
[libx264 @ 0x138e09080] frame P:1305  Avg QP: 6.83  size:   449
[libx264 @ 0x138e09080] frame B:3744  Avg QP: 9.07  size:    33
[libx264 @ 0x138e09080] consecutive B-frames:  1.1%  1.4%  0.0% 97.5%
[libx264 @ 0x138e09080] mb I  I16..4: 95.4%  0.7%  3.8%
[libx264 @ 0x138e09080] mb P  I16..4:  0.1%  0.3%  0.1%  P16..4:  2.3%  0.2%  0.1%  0.0%  0.0%    skip:97.0%
[libx264 @ 0x138e09080] mb B  I16..4:  0.0%  0.0%  0.0%  B16..8:  0.1%  0.0%  0.0%  direct: 0.1%  skip:99.8%  L0:70.9% L1:27.3% BI: 1.8%
[libx264 @ 0x138e09080] 8x8 transform intra:13.8% inter:71.9%
[libx264 @ 0x138e09080] coded y,uvDC,uvAC intra: 19.1% 12.6% 5.2% inter: 0.3% 0.5% 0.0%
[libx264 @ 0x138e09080] i16 v,h,dc,p: 94%  2%  4%  1%
[libx264 @ 0x138e09080] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu:  7% 41% 22%  2%  6%  2%  9%  3%  8%
[libx264 @ 0x138e09080] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 11% 32% 16%  2% 11%  4% 12%  3%  8%
[libx264 @ 0x138e09080] i8c dc,h,v,p: 88%  9%  2%  1%
[libx264 @ 0x138e09080] Weighted P-Frames: Y:1.6% UV:1.6%
[libx264 @ 0x138e09080] kb/s:37.25


    


  • Youtube automatic creating and starting live stream with ffmpeg Python

    20 août 2023, par MrKolia1_1

    I'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 ?

    


    enter image description here

    


    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