
Recherche avancée
Autres articles (46)
-
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 -
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 (...) -
Librairies et logiciels spécifiques aux médias
10 décembre 2010, parPour un fonctionnement correct et optimal, plusieurs choses sont à prendre en considération.
Il est important, après avoir installé apache2, mysql et php5, d’installer d’autres logiciels nécessaires dont les installations sont décrites dans les liens afférants. Un ensemble de librairies multimedias (x264, libtheora, libvpx) utilisées pour l’encodage et le décodage des vidéos et sons afin de supporter le plus grand nombre de fichiers possibles. Cf. : ce tutoriel ; FFMpeg avec le maximum de décodeurs et (...)
Sur d’autres sites (3868)
-
FFmpeg C demo generates "Could not update timestamps for skipped samples" warning
14 juillet 2024, par aabijiWhen I run my demo code I get these warnings when testing it on a webm video :


[opus @ 0x5ec0fc1b4580] Could not update timestamps for skipped samples.
[opus @ 0x5ec0fc1b4580] Could not update timestamps for discarded samples.



But it's not limited to webm, I also get this warning when running with a mp4 :


[aac @ 0x61326fb83700] Could not update timestamps for skipped samples.



I know I'm getting warnings because ffmpeg must be skipping packets, but I have no idea why. Why are we skipping packets (and if that's not the problem, what is) and how can we fix the problem ?


Here's my code for context :


#include <libavcodec></libavcodec>avcodec.h>
#include <libavformat></libavformat>avformat.h>

int main()
{
 int ret = 0;

 const AVCodec* codec;
 AVFormatContext* fmt_ctx = avformat_alloc_context();

 const char* file2 = "/home/aabiji/Videos/sync-test.webm";
 if ((ret = avformat_open_input(&fmt_ctx, file2, NULL, NULL)) < 0) {
 av_log(NULL, AV_LOG_ERROR, "Couldn't open input file\n");
 return -1;
 }

 ret = av_find_best_stream(fmt_ctx, AVMEDIA_TYPE_AUDIO, -1, -1, &codec, 0);
 if (ret < 0) {
 av_log(NULL, AV_LOG_ERROR, "Couldn't find a media stream\n");
 return -1;
 }

 int stream_index = ret;
 AVStream* media = fmt_ctx->streams[stream_index];

 AVCodecContext* codec_context = avcodec_alloc_context3(codec);
 if (avcodec_parameters_to_context(codec_context, media->codecpar) < 0) {
 return -1;
 }

 if ((ret = avcodec_open2(codec_context, codec, NULL)) < 0) {
 av_log(NULL, AV_LOG_ERROR, "Couldn't open media decoder\n");
 return -1;
 }

 AVPacket* packet = av_packet_alloc();
 AVFrame* frame = av_frame_alloc();

 while ((ret = av_read_frame(fmt_ctx, packet)) >= 0) {
 if (packet->stream_index != stream_index) {
 continue;
 }

 ret = avcodec_send_packet(codec_context, packet);
 if (ret < 0) {
 break; // Error
 }

 while (ret >= 0) {
 ret = avcodec_receive_frame(codec_context, frame);
 if (ret == AVERROR_EOF || ret == AVERROR(EAGAIN)) {
 break;
 } else if (ret < 0) {
 fprintf(stderr, "Error during decoding\n");
 break;
 }
 av_frame_unref(frame);
 }

 av_packet_unref(packet);
 }

 avcodec_flush_buffers(codec_context);

 av_packet_unref(packet);
 av_frame_free(&frame);
 av_packet_free(&packet);
 avcodec_free_context(&codec_context);
 avformat_close_input(&fmt_ctx);
 return 0;
}



-
Class "FFMpeg\FFMpeg" not found
16 août 2024, par Saeed EisakhaniI installed ffmpeg on xampp by COMPOSER. I installed FFMPEG on windows before.



Then with the command
composer require php-ffmpeg/php-ffmpeg
installed php-ffmpeg


I use code below (from php-ffmpeg github) for a test but this does not work


<?php

require '../../phpMyAdmin/vendor/autoload.php';

$ffmpeg = FFMpeg\FFMpeg::create(); // line 5 that error referees to 
$video = $ffmpeg->open('video.mpg');
$video
 ->filters()
 ->resize(new FFMpeg\Coordinate\Dimension(320, 240))
 ->synchronize();
$video
 ->frame(FFMpeg\Coordinate\TimeCode::fromSeconds(10))
 ->save('frame.jpg');
$video
 ->save(new FFMpeg\Format\Video\X264(), 'export-x264.mp4')
 ->save(new FFMpeg\Format\Video\WMV(), 'export-wmv.wmv')
 ->save(new FFMpeg\Format\Video\WebM(), 'export-webm.webm');

?>



This is the error I encounter.



I read many and many similar questions but almost all of them suggest
require '../../phpMyAdmin/vendor/autoload.php';
that I have it in my code.

-
Why does OpenAI Whisper return "None" ?
29 septembre 2024, par SHDDSFFDSDSAFI'm trying to transcribe an MP3 file using OpenAI’s Whisper model, but the
transcriptions.create()
method consistently returnsNone
. I’ve tried different MP3 files, converted them to WAV, updated the OpenAI library, and added error handling, but I still can’t figure out the issue.

Here’s my code :


from openai import OpenAI

client = OpenAI(
 api_key="MYAPIKEY"
)

audio_file = open("speech.mp3", "rb")
transcript = client.audio.transcriptions.create(
 file=audio_file,
 model="whisper-1",
 response_format="verbose_json",
 timestamp_granularities=["segment"]
)

print(transcript)



I’ve confirmed that :


- 

- The API key is valid.
- I’m using OpenAI Python library version
X.X.X
. - I’ve tested both MP3 and WAV formats.
- The MP3 file is valid (checked using
ffmpeg
).










The response always returns
None
without any exceptions. Any ideas on what could be going wrong ?