
Recherche avancée
Médias (6)
-
Richard Stallman et le logiciel libre
19 octobre 2011, par
Mis à jour : Mai 2013
Langue : français
Type : Texte
-
ED-ME-5 1-DVD
11 octobre 2011, par
Mis à jour : Octobre 2011
Langue : English
Type : Audio
-
Revolution of Open-source and film making towards open film making
6 octobre 2011, par
Mis à jour : Juillet 2013
Langue : English
Type : Texte
-
Valkaama DVD Cover Outside
4 octobre 2011, par
Mis à jour : Octobre 2011
Langue : English
Type : Image
-
Valkaama DVD Label
4 octobre 2011, par
Mis à jour : Février 2013
Langue : English
Type : Image
-
Valkaama DVD Cover Inside
4 octobre 2011, par
Mis à jour : Octobre 2011
Langue : English
Type : Image
Autres articles (104)
-
Mise à jour de la version 0.1 vers 0.2
24 juin 2013, parExplications des différents changements notables lors du passage de la version 0.1 de MediaSPIP à la version 0.3. Quelles sont les nouveautés
Au niveau des dépendances logicielles Utilisation des dernières versions de FFMpeg (>= v1.2.1) ; Installation des dépendances pour Smush ; Installation de MediaInfo et FFprobe pour la récupération des métadonnées ; On n’utilise plus ffmpeg2theora ; On n’installe plus flvtool2 au profit de flvtool++ ; On n’installe plus ffmpeg-php qui n’est plus maintenu au (...) -
Personnaliser en ajoutant son logo, sa bannière ou son image de fond
5 septembre 2013, parCertains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;
-
Ecrire une actualité
21 juin 2013, parPrésentez les changements dans votre MédiaSPIP ou les actualités de vos projets sur votre MédiaSPIP grâce à la rubrique actualités.
Dans le thème par défaut spipeo de MédiaSPIP, les actualités sont affichées en bas de la page principale sous les éditoriaux.
Vous pouvez personnaliser le formulaire de création d’une actualité.
Formulaire de création d’une actualité Dans le cas d’un document de type actualité, les champs proposés par défaut sont : Date de publication ( personnaliser la date de publication ) (...)
Sur d’autres sites (6937)
-
Is there a way to use youtube-dl in async
8 octobre 2024, par Stam KalyI have an application where I use
zmq
withasyncio
to communicate with the clients who have the ability to download a video withyoutube-dl
to the server. I tried addingawait
toyoutube_dl
's download function but it gave me an error since it was not a coroutine. My code right now is simply looking like this :


import asyncio
import youtube_dl


async def networking_stuff():
 download = True
 while True:
 if download:
 print("Received a request for download")
 await youtube_to_mp3("https://www.youtube.com/watch?v=u9WgtlgGAgs")
 download = False
 print("Working..")
 await asyncio.sleep(2)


async def youtube_to_mp3(url):
 ydl_opts = {
 'format': 'bestaudio/best',
 'postprocessors': [{
 'key': 'FFmpegExtractAudio',
 'preferredcodec': 'mp3',
 'preferredquality': '192',
 }]
 }

 with youtube_dl.YoutubeDL(ydl_opts) as ydl:
 ydl.download([url])


loop = asyncio.get_event_loop()
loop.create_task(networking_stuff())
loop.run_forever()




which gives the following output :



Received a request for download
[youtube] u9WgtlgGAgs: Downloading webpage
[youtube] u9WgtlgGAgs: Downloading video info webpage
[youtube] u9WgtlgGAgs: Extracting video information
[youtube] u9WgtlgGAgs: Downloading MPD manifest
[download] Destination: The Cardigans - My Favourite Game “Stone Version”-u9WgtlgGAgs.webm
[download] 100% of 4.20MiB in 00:03
[ffmpeg] Destination: The Cardigans - My Favourite Game “Stone Version”-u9WgtlgGAgs.mp3
Deleting original file The Cardigans - My Favourite Game “Stone Version”-u9WgtlgGAgs.webm (pass -k to keep)
Working..
Working..
....
Working..
Working..




whereas I would expect the
Working..
message to be printed in betweenyoutube-dl
's messages as well. Am I missing something here or is this impossible withasync
/await
? Isffmpeg
blocking ? If so, can I run the download inasync
without converting tomp3
or is using threads the only way ?

-
Revision 15660 : [15562] avait remplace a tort addcslashes(..,"’\\") par addslashes avant ...
30 avril 2010, par cedric@… — Log[15562] avait remplace a tort addcslashes(..,"’\") par addslashes avant de le generaliser Resultat, impossible d’avoir un " dans un mot de passe sql (thomas)
-
Transcoding hevc to h264 using GPU and scale_npp
19 mai 2022, par JanZgI am trying to transcode hevc to h264 using GPU. Default input is 10 bit hevc but I also try it on 8 bit hevc. I use hevc_cuvid decoder and h264_nvenc encoder. While scaling using CPU its correct. I was also using scale_npp=w=1280:h=720:format=yuv420p and scale_cuda - > no result.


Working command without using GPU to scale :


/usr/local/bin/ffmpeg -y -v warning -c:v hevc_cuvid -an -sn -dn -reconnect_at_eof 1 -reconnect_streamed 1 -reconnect_on_network_error 1 -i http://1.2.3.4:8794 -c:v h264_nvenc -pix_fmt yuv420p -vf scale=1280:720 test_hevc.mp4



But when I try to scale using GPU for example scale_cuda or scale_npp I get this error :


Command :


/usr/local/bin/ffmpeg -y -v warning -c:v hevc_cuvid -an -sn -dn -reconnect_at_eof 1 -reconnect_streamed 1 -reconnect_on_network_error 1 -i http://1.2.3.4:8794 -c:v h264_nvenc -pix_fmt yuv420p -vf scale_npp=1280:720 test_hevc.mp4



Outputs :


Error output with trace log level


[graph 0 input from stream 0:0 @ 0x56164efb6b40] w:3840 h:2160 pixfmt:p010le tb:1/90000 fr:50/1 sar:1/1
[format @ 0x56164efb7940] Setting ‘pix_fmts’ to value ‘yuv420p’
[auto_scale_0 @ 0x56164efb9940] w:iw h:ih flags:’’ interl:0
[Parsed_scale_npp_0 @ 0x56164efb58c0] auto-inserting filter ‘auto_scale_0’ between the filter ‘graph 0 input from stream 0:0’ and the filter ‘Parsed_scale_npp_0’
Impossible to convert between the formats supported by the filter ‘graph 0 input from stream 0:0’ and the filter ‘auto_scale_0’
Error reinitializing filters!
Failed to inject frame into filter network: Function not implemented
Error while processing the decoded data for stream #0:0
[AVIOContext @ 0x56164ea41300] Statistics: 0 seeks, 0 writeouts
[AVIOContext @ 0x56164ea39c80] Statistics: 15357720 bytes read, 0 seeks
[AVHWDeviceContext @ 0x56164ea68480] Calling cu->cuCtxDestroy(hwctx->cuda_ctx)
Conversion failed!



Full output with warning log level


[hevc @ 0x555bd6e9f0c0] PPS id out of range: 0
Last message repeated 1 times
[hevc @ 0x555bd6e9f0c0] Error parsing NAL unit #2.
[hevc @ 0x555bd6e9f0c0] PPS id out of range: 0
Last message repeated 1 times
[hevc @ 0x555bd6e9f0c0] Error parsing NAL unit #2.
[hevc @ 0x555bd6e9f0c0] PPS id out of range: 0
Last message repeated 1 times
[hevc @ 0x555bd6e9f0c0] Error parsing NAL unit #2.
[hevc @ 0x555bd6e9f0c0] PPS id out of range: 0
Last message repeated 1 times
[hevc @ 0x555bd6e9f0c0] Error parsing NAL unit #2.
[hevc @ 0x555bd6e9f0c0] PPS id out of range: 0
Last message repeated 1 times
[hevc @ 0x555bd6e9f0c0] Error parsing NAL unit #2.
[hevc @ 0x555bd6e9f0c0] PPS id out of range: 0
Last message repeated 1 times
[hevc @ 0x555bd6e9f0c0] Error parsing NAL unit #2.
[hevc @ 0x555bd6e9f0c0] PPS id out of range: 0
Last message repeated 1 times
[hevc @ 0x555bd6e9f0c0] Error parsing NAL unit #2.
[hevc @ 0x555bd6e9f0c0] PPS id out of range: 0
Last message repeated 1 times
[hevc @ 0x555bd6e9f0c0] Error parsing NAL unit #2.
[hevc @ 0x555bd6e9f0c0] PPS id out of range: 0
Last message repeated 1 times
[hevc @ 0x555bd6e9f0c0] Error parsing NAL unit #2.
[hevc @ 0x555bd6e9f0c0] PPS id out of range: 0
Last message repeated 1 times
[hevc @ 0x555bd6e9f0c0] Error parsing NAL unit #2.
[hevc @ 0x555bd6e9f0c0] PPS id out of range: 0
Last message repeated 1 times
[hevc @ 0x555bd6e9f0c0] Error parsing NAL unit #2.
[hevc @ 0x555bd6e9f0c0] PPS id out of range: 0
Last message repeated 1 times
[hevc @ 0x555bd6e9f0c0] Error parsing NAL unit #2.
[hevc @ 0x555bd6e9f0c0] PPS id out of range: 0
Last message repeated 1 times
[hevc @ 0x555bd6e9f0c0] Error parsing NAL unit #2.
[hevc @ 0x555bd6e9f0c0] PPS id out of range: 0
Last message repeated 1 times
[hevc @ 0x555bd6e9f0c0] Error parsing NAL unit #2.
[hevc @ 0x555bd6e9f0c0] PPS id out of range: 0
Last message repeated 1 times
[hevc @ 0x555bd6e9f0c0] Error parsing NAL unit #2.
[hevc @ 0x555bd6e9f0c0] PPS id out of range: 0
Last message repeated 1 times
[hevc @ 0x555bd6e9f0c0] Error parsing NAL unit #2.
[hevc @ 0x555bd6e9f0c0] PPS id out of range: 0
Last message repeated 1 times
[hevc @ 0x555bd6e9f0c0] Error parsing NAL unit #2.
[hevc @ 0x555bd6e9f0c0] PPS id out of range: 0
Last message repeated 1 times
[hevc @ 0x555bd6e9f0c0] Error parsing NAL unit #2.
[hevc @ 0x555bd6e9f0c0] PPS id out of range: 0
Last message repeated 1 times
[hevc @ 0x555bd6e9f0c0] Error parsing NAL unit #2.
[hevc @ 0x555bd6e9f0c0] PPS id out of range: 0
Last message repeated 1 times
[hevc @ 0x555bd6e9f0c0] Error parsing NAL unit #2.
[hevc @ 0x555bd6e9f0c0] PPS id out of range: 0
Last message repeated 1 times
[hevc @ 0x555bd6e9f0c0] Error parsing NAL unit #2.
[hevc @ 0x555bd6e9f0c0] PPS id out of range: 0
Last message repeated 1 times
[hevc @ 0x555bd6e9f0c0] Error parsing NAL unit #2.
[hevc @ 0x555bd6e9f0c0] PPS id out of range: 0
Last message repeated 1 times
[hevc @ 0x555bd6e9f0c0] Error parsing NAL unit #2.
[hevc @ 0x555bd6e9f0c0] PPS id out of range: 0
Last message repeated 1 times
[hevc @ 0x555bd6e9f0c0] Error parsing NAL unit #2.
[hevc @ 0x555bd6e9f0c0] PPS id out of range: 0
Last message repeated 1 times
[hevc @ 0x555bd6e9f0c0] Error parsing NAL unit #2.
[hevc @ 0x555bd6e9f0c0] PPS id out of range: 0
Last message repeated 1 times
[hevc @ 0x555bd6e9f0c0] Error parsing NAL unit #2.
[hevc @ 0x555bd6e9f0c0] PPS id out of range: 0
Last message repeated 1 times
[hevc @ 0x555bd6e9f0c0] Error parsing NAL unit #2.
[hevc @ 0x555bd6e9f0c0] PPS id out of range: 0
Last message repeated 1 times
[hevc @ 0x555bd6e9f0c0] Error parsing NAL unit #2.
[hevc @ 0x555bd6e9f0c0] PPS id out of range: 0
Last message repeated 1 times
[hevc @ 0x555bd6e9f0c0] Error parsing NAL unit #2.
[hevc @ 0x555bd6e9f0c0] PPS id out of range: 0
Last message repeated 1 times
[hevc @ 0x555bd6e9f0c0] Error parsing NAL unit #2.
[hevc @ 0x555bd6e9f0c0] PPS id out of range: 0
Last message repeated 1 times
[hevc @ 0x555bd6e9f0c0] Error parsing NAL unit #2.
[hevc @ 0x555bd6e9f0c0] PPS id out of range: 0
Last message repeated 1 times
[hevc @ 0x555bd6e9f0c0] Error parsing NAL unit #2.
[hevc @ 0x555bd6e9f0c0] PPS id out of range: 0
Last message repeated 1 times
[hevc @ 0x555bd6e9f0c0] Error parsing NAL unit #2.
[hevc @ 0x555bd6e9f0c0] PPS id out of range: 0
Last message repeated 1 times
[hevc @ 0x555bd6e9f0c0] Error parsing NAL unit #2.
[hevc @ 0x555bd6e9f0c0] PPS id out of range: 0
Last message repeated 1 times
[hevc @ 0x555bd6e9f0c0] Error parsing NAL unit #2.
[hevc @ 0x555bd6e9f0c0] PPS id out of range: 0
Last message repeated 1 times
[hevc @ 0x555bd6e9f0c0] Error parsing NAL unit #2.
[hevc @ 0x555bd6e9f0c0] PPS id out of range: 0
Last message repeated 1 times
[hevc @ 0x555bd6e9f0c0] Error parsing NAL unit #2.
[hevc @ 0x555bd6e9f0c0] PPS id out of range: 0
Last message repeated 1 times
[hevc @ 0x555bd6e9f0c0] Error parsing NAL unit #2.
[hevc @ 0x555bd6e9f0c0] PPS id out of range: 0
Last message repeated 1 times
[hevc @ 0x555bd6e9f0c0] Error parsing NAL unit #2.
[hevc @ 0x555bd6e9f0c0] PPS id out of range: 0
Last message repeated 1 times
[hevc @ 0x555bd6e9f0c0] Error parsing NAL unit #2.
[hevc @ 0x555bd6e9f0c0] PPS id out of range: 0
Last message repeated 1 times
[hevc @ 0x555bd6e9f0c0] Error parsing NAL unit #2.
[hevc @ 0x555bd6e9f0c0] PPS id out of range: 0
Last message repeated 1 times
[hevc @ 0x555bd6e9f0c0] Error parsing NAL unit #2.
[hevc @ 0x555bd6e9f0c0] PPS id out of range: 0
Last message repeated 1 times
[hevc @ 0x555bd6e9f0c0] Error parsing NAL unit #2.
[hevc @ 0x555bd6e9f0c0] PPS id out of range: 0
Last message repeated 1 times
[hevc @ 0x555bd6e9f0c0] Error parsing NAL unit #2.
[hevc @ 0x555bd6e9f0c0] PPS id out of range: 0
Last message repeated 1 times
[hevc @ 0x555bd6e9f0c0] Error parsing NAL unit #2.
[hevc @ 0x555bd6e9f0c0] PPS id out of range: 0
Last message repeated 1 times
[hevc @ 0x555bd6e9f0c0] Error parsing NAL unit #2.
[hevc @ 0x555bd6e9f0c0] PPS id out of range: 0
Last message repeated 1 times
[hevc @ 0x555bd6e9f0c0] Error parsing NAL unit #2.
[hevc @ 0x555bd6e9f0c0] PPS id out of range: 0
Last message repeated 1 times
[hevc @ 0x555bd6e9f0c0] Error parsing NAL unit #2.
[hevc @ 0x555bd6e9f0c0] PPS id out of range: 0
Last message repeated 1 times
[hevc @ 0x555bd6e9f0c0] Error parsing NAL unit #2.
[hevc @ 0x555bd6e9f0c0] PPS id out of range: 0
Last message repeated 1 times
[hevc @ 0x555bd6e9f0c0] Error parsing NAL unit #2.
[hevc @ 0x555bd6e9f0c0] PPS id out of range: 0
Last message repeated 1 times
[hevc @ 0x555bd6e9f0c0] Error parsing NAL unit #2.
[hevc @ 0x555bd6e9f0c0] PPS id out of range: 0
Last message repeated 1 times
[hevc @ 0x555bd6e9f0c0] Error parsing NAL unit #2.
[hevc @ 0x555bd6e9f0c0] PPS id out of range: 0
Last message repeated 1 times
[hevc @ 0x555bd6e9f0c0] Error parsing NAL unit #2.
[hevc @ 0x555bd6e9f0c0] PPS id out of range: 0
Last message repeated 1 times
[hevc @ 0x555bd6e9f0c0] Error parsing NAL unit #2.
[hevc @ 0x555bd6e9f0c0] PPS id out of range: 0
Last message repeated 1 times
[hevc @ 0x555bd6e9f0c0] Error parsing NAL unit #2.
[hevc @ 0x555bd6e9f0c0] PPS id out of range: 0
Last message repeated 1 times
[hevc @ 0x555bd6e9f0c0] Error parsing NAL unit #2.
[hevc @ 0x555bd6e9f0c0] PPS id out of range: 0
Last message repeated 1 times
[hevc @ 0x555bd6e9f0c0] Error parsing NAL unit #2.
[hevc @ 0x555bd6e9f0c0] PPS id out of range: 0
Last message repeated 1 times
[hevc @ 0x555bd6e9f0c0] Error parsing NAL unit #2.
[hevc @ 0x555bd6e9f0c0] PPS id out of range: 0
Last message repeated 1 times
[hevc @ 0x555bd6e9f0c0] Error parsing NAL unit #2.
[hevc @ 0x555bd6e9f0c0] PPS id out of range: 0
Last message repeated 1 times
[hevc @ 0x555bd6e9f0c0] Error parsing NAL unit #2.
[mpegts @ 0x555bd6e85dc0] Could not find codec parameters for stream 0 (Video: hevc (HEVC / 0x43564548), none): unspecified size
Consider increasing the value for the ‘analyzeduration’ (0) and ‘probesize’ (5000000) options
[NULL @ 0x555bd6e9f0c0] PPS id out of range: 0
Last message repeated 66 times
Impossible to convert between the formats supported by the filter ‘graph 0 input from stream 0:0’ and the filter ‘auto_scale_0’
Error reinitializing filters!
Failed to inject frame into filter network: Function not implemented
Error while processing the decoded data for stream #0:0

Additional informations:

My FFmpeg Version below:

ffmpeg version N-103630-g06de593303 Copyright (c) 2000-2021 the FFmpeg developers
built with gcc 8 (Debian 8.3.0-6)
configuration: --prefix=/usr/local --enable-libtwolame --enable-libzvbi --enable-nonfree --enable-cuda-nvcc --nvccflags=’-gencode arch=compute_75,code=sm_75 -O2’ --enable-libnpp --extra-cflags=-I/usr/local/cuda/include --extra-ldflags=-L/usr/local/cuda/lib64
libavutil 57. 5.100 / 57. 5.100
libavcodec 59. 7.103 / 59. 7.103
libavformat 59. 5.100 / 59. 5.100
libavdevice 59. 0.101 / 59. 0.101
libavfilter 8. 9.100 / 8. 9.100
libswscale 6. 1.100 / 6. 1.100
libswresample 4. 0.100 / 4. 0.100



GPU : Tesla T4


System : Linux tgpu 4.19.0-17-amd64 #1 SMP Debian 4.19.194-3 (2021-07-18) x86_64 GNU/Linux


Nvcc version : nvcc : NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2020 NVIDIA Corporation
Built on Mon_Oct_12_20:09:46_PDT_2020
Cuda compilation tools, release 11.1, V11.1.105
Build cuda_11.1.TC455_06.29190527_0


Is it possible to scale hevc using GPU and how to fix this ?
Thank You in advance.