
Recherche avancée
Autres articles (68)
-
MediaSPIP v0.2
21 juin 2013, parMediaSPIP 0.2 est la première version de MediaSPIP stable.
Sa date de sortie officielle est le 21 juin 2013 et est annoncée ici.
Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
Comme pour la version précédente, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...) -
MediaSPIP version 0.1 Beta
16 avril 2011, parMediaSPIP 0.1 beta est la première version de MediaSPIP décrétée comme "utilisable".
Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
Pour avoir une installation fonctionnelle, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...) -
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
Sur d’autres sites (7399)
-
How do I combine PyTube audio and video streams in a Flask app and let the user download as one file without storing on the web server ?
10 avril 2022, par AJB9384I'm building a YouTube downloader as a side project in Flask. It allows users to input a url and download the video without storing anything on the server I'm hosting on


Lower quality videos can be sent to the user easily as they from PyTube as one file. I use the code below :


import os
import flask
from flask import redirect, url_for, session, send_file
import requests

import pytube
from pytube import YouTube
from io import BytesIO

@app.route('/pull_videos', methods = ['GET', 'POST'])
def pull_videos(): 
 buffer=BytesIO()
 yt_test=YouTube('https://www.youtube.com/watch?v=NNNPgIfK2YE')
 video = yt_test.streams.get_by_itag(251)

 video.stream_to_buffer(buffer)
 buffer.seek(0)

 return send_file(buffer, as_attachment=True, download_name="Test video")



However, I struggle when trying to pull in higher quality videos as they come in as separate audio and videos streams (see documentation here : https://pytube.io/en/latest/user/streams.html#)


I am trying to use ffmpeg to combine the two and then send to the user, but the code below isn't working as expected and throws an error :


Code :


import os
import flask
from flask import redirect, url_for, session, send_file
import requests
import ffmpeg

import pytube
from pytube import YouTube
from io import BytesIO

@app.route('/pull_videos', methods = ['GET', 'POST'])
def pull_videos(): 
 buffer=BytesIO()
 
 video = yt_test.streams.get_by_itag(137)
 input_video = ffmpeg.input(video)
 
 audio = yt_test.streams.get_by_itag(137)
 input_audio = ffmpeg.input(audio)
 
 combined = ffmpeg.concat(input_video, input_audio, v=1, a=1)
 combined.stream_to_buffer(buffer)
 buffer.seek(0)

 return send_file(buffer, as_attachment=True, download_name="Test video")



Error : AttributeError : 'FilterableStream' object has no attribute 'stream_to_buffer'


How could I combine these audio and video streams from PyTube into one file for the user to download without storing on the server ?


-
How do I use gpg to verify an ffmpeg source snapshot download ? [closed]
2 novembre 2024, par NeddieI downloaded two files :


ffmpeg-snapshot.tar.bz2
ffmpeg-devel.asc



The
.asc
file looks like this :

-----BEGIN PGP PUBLIC KEY BLOCK-----


mQENBE22rV0BCAC3DzRmA2XlhrqYv9HKoEvNHHf+PzosmCTHmYhWHDqvBxPkSvCl
...
+x8ETJgPoNK3kQoDagApj4qAt83Ayac3HzNIuEJ7LdvfINIOprujnJ9vH4n04XLg
I4EZ
=Rjbw
-----END PGP PUBLIC KEY BLOCK-----


The command


gpg --show-keys ffmpeg-devel.asc



gives


pub rsa2048 2011-04-26 [SC]
 FCF986EA15E6E293A5644F10B4322F04D67658D8
uid FFmpeg release signing key <ffmpeg-devel@ffmpeg.org>
sub rsa2048 2011-04-26 [E]



The command


gpg --verify ffmpeg-devel.asc ffmpeg-snapshot.tar.bz2



gives output


gpg: verify signatures failed: Unexpected error



I tried decompressing the bz2 file and then


gpg --verify ffmpeg-devel.asc ffmpeg-snapshot.tar



and got the same error.


What am I missing ?


-
How do I download the image with metadata in Python ? [closed]
19 octobre 2024, par Temp AccountI am downloading some images in Python from the Airtable API and am trying to make a slideshow with them using ffmpeg. I download the images :


urllib2.urlretrieve(img['url'], "output/images/image_"+str(i)+".jpeg")



However, when I run the following ffmpeg command


ffmpeg -framerate 4/60 -i output/images/image_%d.jpeg output/out.mp4



I get the following error :


ffmpeg version 6.1.1-3ubuntu5 Copyright (c) 2000-2023 the FFmpeg developers
 built with gcc 13 (Ubuntu 13.2.0-23ubuntu3)
 configuration: --prefix=/usr --extra-version=3ubuntu5 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-l
inux-gnu --arch=amd64 --enable-gpl --disable-stripping --disable-omx --enable-gnutls --enable-libaom --enable-libass --enable-libbs2b --enable
-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribi
di --enable-libglslang --enable-libgme --enable-libgsm --enable-libharfbuzz --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enab
le-libopenmpt --enable-libopus --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheo
ra --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libx
vid --enable-libzimg --enable-openal --enable-opencl --enable-opengl --disable-sndio --enable-libvpl --disable-libmfx --enable-libdc1394 --ena
ble-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-ladspa --enable-libbluray --enable-libjack --enable-libpulse --enable-librabbitmq --enable-librist --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libx264 --enable-libzmq --enable-libzvbi --enab
le-lv2 --enable-sdl2 --enable-libplacebo --enable-librav1e --enable-pocketsphinx --enable-librsvg --enable-libjxl --enable-shared
 libavutil 58. 29.100 / 58. 29.100
 libavcodec 60. 31.102 / 60. 31.102
 libavformat 60. 16.100 / 60. 16.100
 libavdevice 60. 3.100 / 60. 3.100
 libavfilter 9. 12.100 / 9. 12.100
 libswscale 7. 5.100 / 7. 5.100
 libswresample 4. 12.100 / 4. 12.100
 libpostproc 57. 3.100 / 57. 3.100
[mjpeg @ 0x593283e5e3c0] bits 150 is invalid
[mjpeg @ 0x593283e5e3c0] bits 28 is invalid
[image2 @ 0x593283e5d380] Could not find codec parameters for stream 0 (Video: mjpeg (Lossless), none(bt470bg/unknown/unknown), lossless): uns
pecified size
Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options
Input #0, image2, from 'output/images/image_%d.jpeg':
 Duration: 00:01:00.00, start: 0.000000, bitrate: N/A
 Stream #0:0: Video: mjpeg (Lossless), none(bt470bg/unknown/unknown), lossless, 0.07 fps, 0.07 tbr, 0.07 tbn
File 'output/out.mp4' already exists. Overwrite? [y/N] y
Stream mapping:
 Stream #0:0 -> #0:0 (mjpeg (native) -> h264 (libx264))
Press [q] to stop, [?] for help
[mjpeg @ 0x593283e5f180] mjpeg: unsupported coding type (cf)
[mjpeg @ 0x593283e5f180] mjpeg: unsupported coding type (c8)
[mjpeg @ 0x593283e5f180] bits 150 is invalid
[vist#0:0/mjpeg @ 0x593283e5f000] Error submitting packet to decoder: Invalid data found when processing input
[mjpeg @ 0x593283e5f180] bits 28 is invalid
[vist#0:0/mjpeg @ 0x593283e5f000] Error submitting packet to decoder: Invalid data found when processing input
[mjpeg @ 0x593283e5f180] mjpeg: unsupported coding type (ce)
[mjpeg @ 0x593283e5f180] mjpeg: unsupported coding type (c6)
[mjpeg @ 0x593283e5f180] unable to decode APP fields: Invalid data found when processing input
 Last message repeated 1 times
[vist#0:0/mjpeg @ 0x593283e5f000] Error submitting packet to decoder: Invalid data found when processing input
[mjpeg @ 0x593283e5f180] unable to decode APP fields: Invalid data found when processing input
[mjpeg @ 0x593283e5f180] invalid id 255
[vist#0:0/mjpeg @ 0x593283e5f000] Error submitting packet to decoder: Invalid data found when processing input
Cannot determine format of input stream 0:0 after EOF
Error marking filters as finished
Error while filtering: Invalid data found when processing input
[vist#0:0/mjpeg @ 0x593283e5f000] Decode error rate 1 exceeds maximum 0.666667
[out#0/mp4 @ 0x593283e603c0] Nothing was written into output file, because at least one of its streams received no packets.
frame= 0 fps=0.0 q=0.0 Lsize= 0kB time=N/A bitrate=N/A speed=N/A 
Conversion failed!




However, downloading the images in Chrome then creating the slideshow is successful. The images from Chrome have metadata of the filetype (JPEG), width and height. The images downloaded with Python have no metadata. How do I download that information so that my ffmpeg command will succeed ?


Thanks !