
Recherche avancée
Médias (91)
-
Head down (wav version)
26 septembre 2011, par
Mis à jour : Avril 2013
Langue : English
Type : Audio
-
Echoplex (wav version)
26 septembre 2011, par
Mis à jour : Avril 2013
Langue : English
Type : Audio
-
Discipline (wav version)
26 septembre 2011, par
Mis à jour : Avril 2013
Langue : English
Type : Audio
-
Letting you (wav version)
26 septembre 2011, par
Mis à jour : Avril 2013
Langue : English
Type : Audio
-
1 000 000 (wav version)
26 septembre 2011, par
Mis à jour : Avril 2013
Langue : English
Type : Audio
-
999 999 (wav version)
26 septembre 2011, par
Mis à jour : Avril 2013
Langue : English
Type : Audio
Autres articles (101)
-
Multilang : améliorer l’interface pour les blocs multilingues
18 février 2011, parMultilang est un plugin supplémentaire qui n’est pas activé par défaut lors de l’initialisation de MediaSPIP.
Après son activation, une préconfiguration est mise en place automatiquement par MediaSPIP init permettant à la nouvelle fonctionnalité d’être automatiquement opérationnelle. Il n’est donc pas obligatoire de passer par une étape de configuration pour cela. -
ANNEXE : Les plugins utilisés spécifiquement pour la ferme
5 mars 2010, parLe site central/maître de la ferme a besoin d’utiliser plusieurs plugins supplémentaires vis à vis des canaux pour son bon fonctionnement. le plugin Gestion de la mutualisation ; le plugin inscription3 pour gérer les inscriptions et les demandes de création d’instance de mutualisation dès l’inscription des utilisateurs ; le plugin verifier qui fournit une API de vérification des champs (utilisé par inscription3) ; le plugin champs extras v2 nécessité par inscription3 (...)
-
Installation en mode standalone
4 février 2011, parL’installation de la distribution MediaSPIP se fait en plusieurs étapes : la récupération des fichiers nécessaires. À ce moment là deux méthodes sont possibles : en installant l’archive ZIP contenant l’ensemble de la distribution ; via SVN en récupérant les sources de chaque modules séparément ; la préconfiguration ; l’installation définitive ;
[mediaspip_zip]Installation de l’archive ZIP de MediaSPIP
Ce mode d’installation est la méthode la plus simple afin d’installer l’ensemble de la distribution (...)
Sur d’autres sites (13022)
-
avformat/matroskaenc : Don't use size of inexistent Cluster
22 janvier 2020, par Andreas Rheinhardtavformat/matroskaenc : Don't use size of inexistent Cluster
In order to determine whether the current Cluster needs to be closed
because of the limits on clustersize and clustertime,
mkv_write_packet() would first get the size of the current Cluster by
applying avio_tell() on the dynamic buffer holding the current Cluster.
It did this without checking whether there is a dynamic buffer for
writing Clusters open right now.In this case (which happens when writing the first packet)
avio_tell() returned AVERROR(EINVAL) ; yet it is not good to rely on
avio_tell() (or actually, avio_seek()) to handle the situation
gracefully.Fixing this is easy : Only check whether a Cluster needs to be closed
if a Cluster is in fact open.Signed-off-by : Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
-
How do I use FFMPEG/libav to access the data in individual audio samples ?
15 octobre 2022, par BreadsnshredsThe end result is I'm trying to visualise the audio waveform to use in a DAW-like software. So I want to get each sample's value and draw it. With that in mind, I'm currently stumped by trying to gain access to the values stored in each sample. For the time being, I'm just trying to access the value in the first sample - I'll build it into a loop once I have some working code.


I started off by following the code in this example. However, LibAV/FFMPEG has been updated since then, so a lot of the code is deprecated or straight up doesn't work the same anymore.


Based on the example above, I believe the logic is as follows :


- 

- get the formatting info of the audio file
- get audio stream info from the format
- check that the codec required for the stream is an audio codec
- get the codec context (I think this is info about the codec) - This is where it gets kinda confusing for me
- create an empty packet and frame to use - packets are for holding compressed data and frames are for holding uncompressed data
- the format reads the first frame from the audio file into our packet
- pass that packet into the codec context to be decoded
- pass our frame to the codec context to receive the uncompressed audio data of the first frame
- create a buffer to hold the values and try allocating samples to it from our frame




















From debugging my code, I can see that step 7 succeeds and the packet that was empty receives some data. In step 8, the frame doesn't receive any data. This is what I need help with. I get that if I get the frame, assuming a stereo audio file, I should have two samples per frame, so really I just need your help to get uncompressed data into the frame.


I've scoured through the documentation for loads of different classes and I'm pretty sure I'm using the right classes and functions to achieve my goal, but evidently not (I'm also using Qt, so I'm using qDebug throughout, and QString to hold the URL for the audio file as path). So without further ado, here's my code :


// Step 1 - get the formatting info of the audio file
 AVFormatContext* format = avformat_alloc_context();
 if (avformat_open_input(&format, path.toStdString().c_str(), NULL, NULL) != 0) {
 qDebug() << "Could not open file " << path;
 return -1;
 }

// Step 2 - get audio stream info from the format
 if (avformat_find_stream_info(format, NULL) < 0) {
 qDebug() << "Could not retrieve stream info from file " << path;
 return -1;
 }

// Step 3 - check that the codec required for the stream is an audio codec
 int stream_index =- 1;
 for (unsigned int i=0; inb_streams; i++) {
 if (format->streams[i]->codecpar->codec_type == AVMEDIA_TYPE_AUDIO) {
 stream_index = i;
 break;
 }
 }

 if (stream_index == -1) {
 qDebug() << "Could not retrieve audio stream from file " << path;
 return -1;
 }

// Step 4 -get the codec context
 const AVCodec *codec = avcodec_find_decoder(format->streams[stream_index]->codecpar->codec_id);
 AVCodecContext *codecContext = avcodec_alloc_context3(codec);
 avcodec_open2(codecContext, codec, NULL);

// Step 5 - create an empty packet and frame to use
 AVPacket *packet = av_packet_alloc();
 AVFrame *frame = av_frame_alloc();

// Step 6 - the format reads the first frame from the audio file into our packet
 av_read_frame(format, packet);
// Step 7 - pass that packet into the codec context to be decoded
 avcodec_send_packet(codecContext, packet);
//Step 8 - pass our frame to the codec context to receive the uncompressed audio data of the first frame
 avcodec_receive_frame(codecContext, frame);

// Step 9 - create a buffer to hold the values and try allocating samples to it from our frame
 double *buffer;
 av_samples_alloc((uint8_t**) &buffer, NULL, 1, frame->nb_samples, AV_SAMPLE_FMT_DBL, 0);
 qDebug () << "packet: " << &packet;
 qDebug() << "frame: " << frame;
 qDebug () << "buffer: " << buffer;



For the time being, step 9 is incomplete as you can probably tell. But for now, I need help with step 8. Am I missing a step, using the wrong function, wrong class ? Cheers.


-
Python Lambda function and ffmpeg command with stdout from jpg to ts file
28 juillet 2021, par SflaggI have a AWS Lambda Python function setup to process jpg and convert it to a ts file.


I followed these instructions https://aws.amazon.com/blogs/media/processing-user-generated-content-using-aws-lambda-and-ffmpeg/ but changed the command from vfr to cfr conversion to a jpg to ts conversion.


This is the command I am using


ffmpeg_cmd = "/opt/bin/ffmpeg -r 30000/1001 -loop 1 -i \"" + s3_source_signed_url + "\" -f lavfi -i anullsrc=channel_layout=stereo:sample_rate=48000 -t 30 -vcodec libx264 -crf 23 -s 1920x1080 -r 30000/1001 -g 150 -pix_fmt yuv420p -acodec aac -b:a 96k -ar 48000 -"


Everything else is basically the same from the AWS article besides having s3 triggers in my Lambda look for jpeg and jpg suffixes.


But this results in 0 byte ts file.


I have a hunch that I need to modify the command that has a seekable output format (e.g. mpegts) when writing to stdout ; currently my command is likely not working for stdout and that is why I get an empty ts file. But I am having trouble formatting the command correctly. Any help with this would be greatly appreciated !