
Recherche avancée
Médias (1)
-
Richard Stallman et le logiciel libre
19 octobre 2011, par
Mis à jour : Mai 2013
Langue : français
Type : Texte
Autres articles (71)
-
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 -
Gestion des droits de création et d’édition des objets
8 février 2011, parPar défaut, beaucoup de fonctionnalités sont limitées aux administrateurs mais restent configurables indépendamment pour modifier leur statut minimal d’utilisation notamment : la rédaction de contenus sur le site modifiables dans la gestion des templates de formulaires ; l’ajout de notes aux articles ; l’ajout de légendes et d’annotations sur les images ;
-
Qualité du média après traitement
21 juin 2013, parLe bon réglage du logiciel qui traite les média est important pour un équilibre entre les partis ( bande passante de l’hébergeur, qualité du média pour le rédacteur et le visiteur, accessibilité pour le visiteur ). Comment régler la qualité de son média ?
Plus la qualité du média est importante, plus la bande passante sera utilisée. Le visiteur avec une connexion internet à petit débit devra attendre plus longtemps. Inversement plus, la qualité du média est pauvre et donc le média devient dégradé voire (...)
Sur d’autres sites (7796)
-
Python & OpenCV - VideoCapture.read() always returns false
21 août 2017, par JulenI need to extract frames from a video at a given time, and I’m using OpenCV for it. I’m using Linux Mint 18.1, but it must also run on Ubuntu.
This code example is not working for me :
import cv2
print('making screenshot from {0}'.format('/tmp/big_buck_bunny_720p_5mb.mp4'))
cap = cv2.VideoCapture(video_path)
cap.set(cv2.CAP_PROP_POS_MSEC,1000)
ret,frame = cap.read()
print(ret) # This is false
cv2.imwrite("image.jpg", frame) # Creates an empty file(I’ve checked that the path of the video is correct and that the file is not corrupted).
I have installed the Python OpenCV 3.3.0 version :
>>> import cv2
>>> cv2.__version__
'3.3.0'I’ve compiled and installed the source for OpenCV (with the
WITH_FFMPEG=ON
option) :git clone https://github.com/Itseez/opencv.git /tmp/opencv-3
/tmp/opencv-3
mkdir -p release
cd release
cmake -D WITH_FFMPEG=ON -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local ..
make
sudo make installThe output of
ffmpeg -version
is the following :ffmpeg version 2.8.11-0ubuntu0.16.04.1 Copyright (c) 2000-2017 the FFmpeg developers
built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.4) 20160609
configuration: --prefix=/usr --extra-version=0ubuntu0.16.04.1 --build-suffix=-ffmpeg --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --cc=cc --cxx=g++ --enable-gpl --enable-shared --disable-stripping --disable-decoder=libopenjpeg --disable-decoder=libschroedinger --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librtmp --enable-libschroedinger --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxvid --enable-libzvbi --enable-openal --enable-opengl --enable-x11grab --enable-libdc1394 --enable-libiec61883 --enable-libzmq --enable-frei0r --enable-libx264 --enable-libopencv
libavutil 54. 31.100 / 54. 31.100
libavcodec 56. 60.100 / 56. 60.100
libavformat 56. 40.101 / 56. 40.101
libavdevice 56. 4.100 / 56. 4.100
libavfilter 5. 40.101 / 5. 40.101
libavresample 2. 1. 0 / 2. 1. 0
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 2.101 / 1. 2.101
libpostproc 53. 3.100 / 53. 3.100What am I missing ?
-
YouTube fixed is player problem with old IE, so changing examples back over to the HTML5 player, rather than AS3.
12 juillet 2013, par jackmooreYouTube fixed is player problem with old IE, so changing examples back over to the HTML5 player, rather than AS3. Used latest jQuery lib
-
YouTube-DL Python output file format not mp4
16 septembre 2020, par SushilI have written a small piece of code in python to extract either the audio or the video from a YouTube video. Here is the code :


from __future__ import unicode_literals
import youtube_dl

link = input("Enter the video link:")

while True:
 choice = input("Enter a for audio file, v for video file:")
 if choice == "a" or choice == "v":
 break

ydl_opts = {}

if choice == "a":
 ydl_opts = {
 'format': 'bestaudio/best',
 'postprocessors': [{
 'key': 'FFmpegExtractAudio',
 'preferredcodec': 'mp3',
 'preferredquality': '192',
 }],
 }
 
with youtube_dl.YoutubeDL(ydl_opts) as ydl:
 info_dict = ydl.extract_info(link, download=False)
 video_title = info_dict.get('title', None)

if choice == "a":
 path = f'D:\\DwnldsYT\\{video_title}.mp3'
if choice == "v":
 path = f'D:\\DwnldsYT\\{video_title}.mp4'

ydl_opts.update({'outtmpl':path})

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



The audio extraction works fine, but the problem is with the video extraction. When I extract the video, I am getting the output as an mkv file, not an mp4 file. Any idea about how to save the video file as mp4 ?