
Recherche avancée
Médias (1)
-
Rennes Emotion Map 2010-11
19 octobre 2011, par
Mis à jour : Juillet 2013
Langue : français
Type : Texte
Autres articles (52)
-
La sauvegarde automatique de canaux SPIP
1er avril 2010, parDans le cadre de la mise en place d’une plateforme ouverte, il est important pour les hébergeurs de pouvoir disposer de sauvegardes assez régulières pour parer à tout problème éventuel.
Pour réaliser cette tâche on se base sur deux plugins SPIP : Saveauto qui permet une sauvegarde régulière de la base de donnée sous la forme d’un dump mysql (utilisable dans phpmyadmin) mes_fichiers_2 qui permet de réaliser une archive au format zip des données importantes du site (les documents, les éléments (...) -
Submit bugs and patches
13 avril 2011Unfortunately a software is never perfect.
If you think you have found a bug, report it using our ticket system. Please to help us to fix it by providing the following information : the browser you are using, including the exact version as precise an explanation as possible of the problem if possible, the steps taken resulting in the problem a link to the site / page in question
If you think you have solved the bug, fill in a ticket and attach to it a corrective patch.
You may also (...) -
MediaSPIP v0.2
21 juin 2013, parMediaSPIP 0.2 is the first MediaSPIP stable release.
Its official release date is June 21, 2013 and is announced here.
The zip file provided here only contains the sources of MediaSPIP in its standalone version.
To get a working installation, you must manually install all-software dependencies on the server.
If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...)
Sur d’autres sites (6474)
-
ffmpeg file conversion AWS Lamda
10 avril 2021, par eartoolboxI want a .webm file to be converted to a .wav file after it hits my S3 bucket. I followed this tutorial and tried to adapt it from my use case using the .webm -> .wav ffmpeg command described here.


My AWS Lambda function generally works, in that when my .webm file hits the source bucket, it is converted to .wav and ends up in the destination bucket. However, the resulting file .wav is always 0 bytes (though the .webm not, including the appropriate audio). Did I adapt the code wrong ? I only changed the ffmpeg_cmd line from the first link.


import json
import os
import subprocess
import shlex
import boto3

S3_DESTINATION_BUCKET = "hmtm-out"
SIGNED_URL_TIMEOUT = 60

def lambda_handler(event, context):

 s3_source_bucket = event['Records'][0]['s3']['bucket']['name']
 s3_source_key = event['Records'][0]['s3']['object']['key']

 s3_source_basename = os.path.splitext(os.path.basename(s3_source_key))[0]
 s3_destination_filename = s3_source_basename + ".wav"

 s3_client = boto3.client('s3')
 s3_source_signed_url = s3_client.generate_presigned_url('get_object',
 Params={'Bucket': s3_source_bucket, 'Key': s3_source_key},
 ExpiresIn=SIGNED_URL_TIMEOUT)
 
 ffmpeg_cmd = "/opt/bin/ffmpeg -i \"" + s3_source_signed_url + "\" -c:a pcm_f32le " + s3_destination_filename + " -"
 
 
 command1 = shlex.split(ffmpeg_cmd)
 p1 = subprocess.run(command1, stdout=subprocess.PIPE, stderr=subprocess.PIPE)

 resp = s3_client.put_object(Body=p1.stdout, Bucket=S3_DESTINATION_BUCKET, Key=s3_destination_filename)

 return {
 'statusCode': 200,
 'body': json.dumps('Processing complete successfully')
 }
 



-
ffmpeg file conversion AWS Lambda
10 avril 2021, par eartoolboxI want a .webm file to be converted to a .wav file after it hits my S3 bucket. I followed this tutorial and tried to adapt it from my use case using the .webm -> .wav ffmpeg command described here.


My AWS Lambda function generally works, in that when my .webm file hits the source bucket, it is converted to .wav and ends up in the destination bucket. However, the resulting file .wav is always 0 bytes (though the .webm not, including the appropriate audio). Did I adapt the code wrong ? I only changed the ffmpeg_cmd line from the first link.


import json
import os
import subprocess
import shlex
import boto3

S3_DESTINATION_BUCKET = "hmtm-out"
SIGNED_URL_TIMEOUT = 60

def lambda_handler(event, context):

 s3_source_bucket = event['Records'][0]['s3']['bucket']['name']
 s3_source_key = event['Records'][0]['s3']['object']['key']

 s3_source_basename = os.path.splitext(os.path.basename(s3_source_key))[0]
 s3_destination_filename = s3_source_basename + ".wav"

 s3_client = boto3.client('s3')
 s3_source_signed_url = s3_client.generate_presigned_url('get_object',
 Params={'Bucket': s3_source_bucket, 'Key': s3_source_key},
 ExpiresIn=SIGNED_URL_TIMEOUT)
 
 ffmpeg_cmd = "/opt/bin/ffmpeg -i \"" + s3_source_signed_url + "\" -c:a pcm_f32le " + s3_destination_filename + " -"
 
 
 command1 = shlex.split(ffmpeg_cmd)
 p1 = subprocess.run(command1, stdout=subprocess.PIPE, stderr=subprocess.PIPE)

 resp = s3_client.put_object(Body=p1.stdout, Bucket=S3_DESTINATION_BUCKET, Key=s3_destination_filename)

 return {
 'statusCode': 200,
 'body': json.dumps('Processing complete successfully')
 }
 



-
Encoding audio_common messages to OPUS
14 juin 2023, par djangbahevans

I am trying to stream microphone and camera data to Amazon KVS WebRTC. I'm able to make video work using this package (adapted for noetic) however I am struggling to make audio work. I'm using the audio_capture package to get mp3 frames. I'm trying to convert this to OPUS frames before streaming to KVS, but I'm unsure how to do this. I wrote this bit of code based on the small resources I can find on using ffmpeg, but it's not working.
avcodec_fill_audio_frame
is returning -22.

#include "opus_encoder.h"

OPUSEncoder::OPUSEncoder() {
 av_register_all();
 codecContext == nullptr;
}

OPUSEncoder::~OPUSEncoder() {
 if (codecContext != nullptr) {
 avcodec_free_context(&codecContext);
 }
}

int OPUSEncoder::Initialize(int Fs, int channels) {
 AVCodec *codec = avcodec_find_encoder(AV_CODEC_ID_OPUS);
 if (!codec) {
 printf("Codec not found\n");
 return -1;
 }

 codecContext = avcodec_alloc_context3(codec);
 if (!codecContext) {
 printf("Could not allocate audio codec context\n");
 return -1;
 }

 codecContext->sample_fmt = AV_SAMPLE_FMT_S16;
 codecContext->bit_rate = 128000;
 codecContext->sample_rate = Fs;
 codecContext->channel_layout = av_get_default_channel_layout(channels);
 codecContext->channels = channels;

 if (avcodec_open2(codecContext, codec, nullptr) < 0) {
 printf("Could not open codec\n");
 return -1;
 }

 return 0;
}

int OPUSEncoder::Encode(const uint8_t *audio_data, int frameSize,
 uint8_t *out) {
 AVPacket pkt;
 av_init_packet(&pkt);
 pkt.data = nullptr;
 pkt.size = 0;

 AVFrame *frame = av_frame_alloc();
 frame->nb_samples = frameSize;
 frame->format = codecContext->sample_fmt;
 frame->channel_layout = codecContext->channel_layout;

 int ret = avcodec_fill_audio_frame(frame, codecContext->channels,
 codecContext->sample_fmt, audio_data,
 frameSize * 2, 0);
 if (ret < 0) {
 printf("Error filling audio frame: %d\n", ret);
 return -1;
 }

 ret = avcodec_send_frame(codecContext, frame);
 if (ret < 0) {
 printf("Error sending the frame to the encoder\n");
 return -1;
 }

 while (ret >= 0) {
 ret = avcodec_receive_packet(codecContext, &pkt);
 if (ret == AVERROR(EAGAIN) || ret == AVERROR_EOF) {
 return 0;
 } else if (ret < 0) {
 printf("Error encoding audio frame\n");
 return -1;
 }

 memcpy(out, pkt.data, pkt.size);
 out += pkt.size;
 av_packet_unref(&pkt);
 }

 av_frame_free(&frame);

 return 0;
}