
Recherche avancée
Médias (3)
-
The Slip - Artworks
26 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Texte
-
Podcasting Legal guide
16 mai 2011, par
Mis à jour : Mai 2011
Langue : English
Type : Texte
-
Creativecommons informational flyer
16 mai 2011, par
Mis à jour : Juillet 2013
Langue : English
Type : Texte
Autres articles (20)
-
Création définitive du canal
12 mars 2010, parLorsque votre demande est validée, vous pouvez alors procéder à la création proprement dite du canal. Chaque canal est un site à part entière placé sous votre responsabilité. Les administrateurs de la plateforme n’y ont aucun accès.
A la validation, vous recevez un email vous invitant donc à créer votre canal.
Pour ce faire il vous suffit de vous rendre à son adresse, dans notre exemple "http://votre_sous_domaine.mediaspip.net".
A ce moment là un mot de passe vous est demandé, il vous suffit d’y (...) -
Les tâches Cron régulières de la ferme
1er décembre 2010, parLa gestion de la ferme passe par l’exécution à intervalle régulier de plusieurs tâches répétitives dites Cron.
Le super Cron (gestion_mutu_super_cron)
Cette tâche, planifiée chaque minute, a pour simple effet d’appeler le Cron de l’ensemble des instances de la mutualisation régulièrement. Couplée avec un Cron système sur le site central de la mutualisation, cela permet de simplement générer des visites régulières sur les différents sites et éviter que les tâches des sites peu visités soient trop (...) -
Taille des images et des logos définissables
9 février 2011, parDans beaucoup d’endroits du site, logos et images sont redimensionnées pour correspondre aux emplacements définis par les thèmes. L’ensemble des ces tailles pouvant changer d’un thème à un autre peuvent être définies directement dans le thème et éviter ainsi à l’utilisateur de devoir les configurer manuellement après avoir changé l’apparence de son site.
Ces tailles d’images sont également disponibles dans la configuration spécifique de MediaSPIP Core. La taille maximale du logo du site en pixels, on permet (...)
Sur d’autres sites (3553)
-
How do you intentionally increase/decrease livestream quality using ffmpeg
25 septembre 2022, par Evan HassanYou know those sport streaming websites ? Well I am trying to watch a game from one of those website... problem is I have awful wifi.


I have access to the livestream video and I am trying to change the bitrate/fps to a higher quality for website embedding using ffmpeg. I understand for a video, this is more than possible, but how do you do this for a live stream ?


-
ffmpeg installation on macOS for MoviePy fails with SSL error
26 juillet 2018, par shmibleI’m trying to write a Python program that uses MoviePy on Mac OS 10.11.16 to convert an MP4 file to GIF. I use :
import moviepy.editor as mp
and I get an error saying I need to call
imageio.plugins.ffmpeg.download()
so I can download ffmpeg. I use :import imageio
imageio.plugins.ffmpeg.download()which gives me the following error :
Imageio: 'ffmpeg.osx' was not found on your computer; downloading it now.
Error while fetching file: <urlopen error="error" certificate="certificate" verify="verify" failed="failed">.
Error while fetching file: <urlopen error="error" certificate="certificate" verify="verify" failed="failed">.
Error while fetching file: <urlopen error="error" certificate="certificate" verify="verify" failed="failed">.
Error while fetching file: <urlopen error="error" certificate="certificate" verify="verify" failed="failed">.
Traceback (most recent call last):
File "", line 1, in <module>
imageio.plugins.ffmpeg.download()
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/imageio/plugins/ffmpeg.py", line 55, in download
get_remote_file('ffmpeg/' + FNAME_PER_PLATFORM[plat])
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/imageio/core/fetching.py", line 121, in get_remote_file
_fetch_file(url, filename)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/imageio/core/fetching.py", line 177, in _fetch_file
os.path.basename(file_name))
OSError: Unable to download 'ffmpeg.osx'. Perhaps there is a no internet connection? If there is, please report this problem.
</module></urlopen></urlopen></urlopen></urlopen>I definitely have an internet connection. I found this link, and tried installing with Homebrew and Static builds, but neither have worked. It seems like compiling it myself would be a little too advanced for me (I’ve only briefly looked into it). I used
imageio.plugins.ffmpeg.download()
on IDLE. I read something about using PyCharm to run the MoviePy code, but I get the same initial error. ffmpeg is currently in my/usr/local/bin
folder. Any suggestions are welcome. Thank for your help.Edit : I’m using Python 3.6.1
-
AVPacket->Data is empty "0/0" but has size
24 juin 2024, par CottonBudsI am using libAV* to encode frames(unsigned char*) from my streaming application. I encoded my initialized frames but when I tried to get the avpacket. it returns an avpacket with a size but without data inside it "0/0"


here is my code


StreamCodec.h



class StreamCodec : public QObject 
{
 Q_OBJECT
public:
 StreamCodec(int height, int width, int fps);

public slots:
 void encodeFrame(std::shared_ptr<uchar> pData);
 void run();

signals:
 void encodeFinish(AVPacket* packet);

private:
 void initializeSWS();
 void initializeCodec();

 AVPacket* allocatepacket(AVFrame* frame);
 AVFrame* allocateFrame(std::shared_ptr<uchar> pData);
 AVFrame* formatFrame(AVFrame* frame);

 const AVCodec* codec;
 AVCodecContext* context;
 SwsContext *swsContext;
 int bytesPerPixel;
 int width;
 int height;
 int fps;
 int pts = 0;
};

</uchar></uchar>


StreamCodec.cpp


StreamCodec::StreamCodec(int height, int width, int fps)
{
 this->height = height;
 this->width = width;
 this->fps = fps;
}

void StreamCodec::initializeCodec()
{
 codec = avcodec_find_encoder(AV_CODEC_ID_H264);
 if (!codec) {
 qDebug() << "Codec not found";
 exit(1);
 }
 
 context = avcodec_alloc_context3(codec);
 if (!context) {
 qDebug() << "Could not allocate codec context";
 exit(1);
 }

 context->height = height;
 context->width = width;
 context->time_base.num = 1;
 context->time_base.den = fps;
 context->framerate.num = fps;
 context->framerate.den = 1;
 context->pix_fmt = AV_PIX_FMT_YUV420P;

 context->gop_size = 0;

 av_opt_set(context->priv_data, "preset", "ultrafast", 0);
 av_opt_set(context->priv_data, "crf", "35", 0);
 av_opt_set(context->priv_data, "tune", "zerolatency", 0);

 auto desc = av_pix_fmt_desc_get(AV_PIX_FMT_BGRA);
 if (!desc){
 qDebug() << "Can't get descriptor for pixel format";
 exit(1);
 }
 bytesPerPixel = av_get_bits_per_pixel(desc) / 8;
 if(av_get_bits_per_pixel(desc) % 8 != 0){
 qDebug() << "Unhandled bits per pixel, bad in pix fmt";
 exit(1);
 }

 int err = avcodec_open2(context, codec, nullptr);
 if (err < 0) {
 qDebug() << "Could not open codec";
 exit(1);
 }
}
void StreamCodec::initializeSWS()
{
 swsContext = sws_getContext(width, height, AV_PIX_FMT_BGRA, width, height, AV_PIX_FMT_YUV420P, SWS_BILINEAR, NULL, NULL, NULL);
 if (!swsContext) {
 qDebug() << "Could not allocate SWS Context";
 exit(1);
 }
}

void StreamCodec::encodeFrame(std::shared_ptr<uchar> pData)
{
 int err = 0;
 AVFrame* frame1 = allocateFrame(pData);
 AVFrame* frame = formatFrame(frame1);

 err = avcodec_send_frame(context, frame);
 if (err < 0) {
 qDebug() << "Error sending frame to codec";
 char* errStr = new char;
 av_make_error_string(errStr, 255, err);
 qDebug() << errStr;
 av_frame_free(&frame);
 exit(1);
 }

 while (true) {
 AVPacket* packet = allocatepacket(frame);
 err = avcodec_receive_packet(context, packet);
 if (err == AVERROR_EOF || err == AVERROR(EAGAIN) ) {
 av_packet_unref(packet);
 av_packet_free(&packet);
 break;
 }
 if (err < 0) {
 qDebug() << "Error recieving to codec";
 char* errStr = new char;
 av_make_error_string(errStr, 255, err);
 qDebug() << errStr;
 av_frame_free(&frame);
 av_frame_free(&frame1);
 av_packet_free(&packet);
 exit(1);
 }
 emit encodeFinish(packet);
 }

 av_frame_free(&frame);
 av_frame_free(&frame1);
}

void StreamCodec::run()
{
 initializeCodec();
 initializeSWS();
}

AVPacket* StreamCodec::allocatepacket(AVFrame* frame)
{
 AVPacket* packet = av_packet_alloc();
 if (!packet) {
 qDebug() << "Could not allocate memory for packet";
 av_frame_free(&frame);
 exit(1);
 }
 return packet;
}

AVFrame* StreamCodec::allocateFrame(std::shared_ptr<uchar> pData)
{
 AVFrame* frame = av_frame_alloc();
 if (!frame) {
 qDebug() << "Could not allocate memory for frame";
 exit(1);
 }

 frame->format = AV_PIX_FMT_BGRA;
 frame->width = width;
 frame->height = height;
 frame->pts = pts;

 if (av_frame_get_buffer(frame, 0) < 0) {
 qDebug() << "Failed to get frame buffer";
 exit(1);
 }

 if (av_frame_make_writable(frame) < 0) {
 qDebug() << "Failed to make frame writable";
 exit(1);
 }

 frame->data[0] = pData.get();

 return frame;
}

AVFrame* StreamCodec::formatFrame(AVFrame* frame)
{
 AVFrame* yuvFrame = av_frame_alloc();
 if (!yuvFrame) {
 qDebug() << "Unable to allocate memory for yuv frame";
 av_frame_free(&frame);
 exit(1);
 }

 yuvFrame->format = context->pix_fmt;
 yuvFrame->width = width;
 yuvFrame->height = height;
 yuvFrame->pts = pts;
 pts += 1;
 
 if (av_frame_get_buffer(yuvFrame, 0) < 0) {
 qDebug() << "Failed to get frame buffer";
 exit(1);
 }

 if (av_frame_make_writable(yuvFrame) < 0) {
 qDebug() << "Failed to make frame writable";
 exit(1);
 }

 int err = sws_scale(swsContext, (const uint8_t* const*)frame->data, frame->linesize, 0, height, (uint8_t* const*)yuvFrame->data, yuvFrame->linesize);
 if (err < 0) {
 qDebug() << "Could not format frame to yuv420p";
 exit(1);
 }
 return yuvFrame;
}


</uchar></uchar>


I tried checking for the frames and I'm pretty sure the data is there. I just dont know what to do at this point.


edit 1


I tried viewing the data using visual studio code "view" button it showed me this




Thank you so much to all that commented and pointed me to the right direction.