
Recherche avancée
Autres articles (65)
-
Participer à sa traduction
10 avril 2011Vous pouvez nous aider à améliorer les locutions utilisées dans le logiciel ou à traduire celui-ci dans n’importe qu’elle nouvelle langue permettant sa diffusion à de nouvelles communautés linguistiques.
Pour ce faire, on utilise l’interface de traduction de SPIP où l’ensemble des modules de langue de MediaSPIP sont à disposition. ll vous suffit de vous inscrire sur la liste de discussion des traducteurs pour demander plus d’informations.
Actuellement MediaSPIP n’est disponible qu’en français et (...) -
Encoding and processing into web-friendly formats
13 avril 2011, parMediaSPIP automatically converts uploaded files to internet-compatible formats.
Video files are encoded in MP4, Ogv and WebM (supported by HTML5) and MP4 (supported by Flash).
Audio files are encoded in MP3 and Ogg (supported by HTML5) and MP3 (supported by Flash).
Where possible, text is analyzed in order to retrieve the data needed for search engine detection, and then exported as a series of image files.
All uploaded files are stored online in their original format, so you can (...) -
Les statuts des instances de mutualisation
13 mars 2010, parPour des raisons de compatibilité générale du plugin de gestion de mutualisations avec les fonctions originales de SPIP, les statuts des instances sont les mêmes que pour tout autre objets (articles...), seuls leurs noms dans l’interface change quelque peu.
Les différents statuts possibles sont : prepa (demandé) qui correspond à une instance demandée par un utilisateur. Si le site a déjà été créé par le passé, il est passé en mode désactivé. publie (validé) qui correspond à une instance validée par un (...)
Sur d’autres sites (14217)
-
codecs.ascii_decode(input, self.errors)[0] UnicodeDecodeError : 'ascii' codec can't decode byte 0xc2 in position 318 : ordinal not in range(128)
6 janvier 2017, par dtidyI am trying to open and readlines a .txt file that contains a large amount of text. Below is my code, i dont know how to solve this problem. Any help would be very appreciated.
file = input("Please enter a .txt file: ")
myfile = open(file)
x = myfile.readlines()
print (x)when i enter the .txt file this is the full error message is displayed below :
line 10, in <module> x = myfile.readlines()
line 26, in decode return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 318: ordinal not in range(128)
</module> -
libswresample : swr_convert() returns empty buffer
11 septembre 2019, par Герман ЛиманськийI try to convert audio in format AV_SAMPLE_FMT_S32. I use swr_convert(), but out buffer still empty.
// frame is decoded frame, rframe - is empty frame(out buffer)
if (!main_context->resampler) {
main_context->resampler =
swr_alloc_set_opts(main_context->resampler,
AV_CH_LAYOUT_STEREO, // output
AV_SAMPLE_FMT_S32, // output
44100, // output
audio_codec_context->channel_layout, // input
audio_codec_context->sample_fmt, // input
audio_codec_context->sample_rate, // input
0,
nullptr);
swr_init(main_context->resampler);
}
//int in_samples = frame->nb_samples;
int out_samples = av_rescale_rnd(swr_get_delay(
main_context->resampler, 44100) + 44100,
44100,
44100,
AV_ROUND_UP);
size_t buffSize = av_samples_alloc(rframe->data, NULL,audio_codec_context->channels, out_samples, AV_SAMPLE_FMT_S32, 0);
int len = swr_convert(main_context->resampler, rframe->data, frame->nb_samples, (const uint8_t * *)frame->data, frame->nb_samples);
//here.. rframe->data should have some data, but its empty
while (len > 0)
{
size_t size_ = rframe->nb_samples * av_get_bytes_per_sample(AV_SAMPLE_FMT_S32);
main_context->audio_buf.write(rframe->data[0], size_, 1);
len = swr_convert(main_context->resampler, rframe->data, frame->nb_samples, NULL, NULL);
} -
avcodec_encode_video returns 0 as output size
11 juin 2014, par vacetahannaHello what I am doing wrong ? When I try to encode a Frame, the out_size is 0. and if I use the avcodec_encode_video2 the return value is 0, which indicates, that everything went good, but the avpkt.size is 0 after that. What am I missing or doing wrong ? thank you so much here is my code
int EncodeVideoFFMPEG::enc_main( void *istream, void *outstream, int width, int height )
{
avcodec_register_all();
//choose codec
AVCodec *codec = avcodec_find_encoder(CODEC_ID_H264);
//set parameters
AVCodecContext *c = avcodec_alloc_context3(codec);
c->codec_type = AVMEDIA_TYPE_VIDEO;
c->bit_rate = 50000;
c->pix_fmt = PIX_FMT_YUV420P;
c->width = width;
c->height = height;
c->time_base.num = 1;
c->time_base.den = 25;
c->gop_size = 20;
c->max_b_frames = 0;
//open
avcodec_open2(c, codec, NULL);
int got_packet;
int BYTEPIC = width * height * 3;
//prepare for changing color space
struct SwsContext *img_convert_ctx1 =
sws_getContext(width, height, PIX_FMT_BGR24,
width, height, PIX_FMT_YUV420P,
SWS_BICUBIC, NULL, NULL, NULL);
//allocateframesforcolorspacechange
AVFrame *pictureBGR = alloc_pictureBGR24(width, height);
AVFrame *picture = alloc_picture420P(width, height);
//get frame from OGRE and let pictureBGR point to it
unsigned char *image = new unsigned char[BYTEPIC];
memcpy(image, istream, BYTEPIC);
//change from BGR to 420P
sws_scale(img_convert_ctx1, &image, pictureBGR->linesize, 0, height, picture->data, picture->linesize);
delete image;
AVPacket avpkt;
av_new_packet( &avpkt, BYTEPIC );
//encode withthe codec
int out_size = avcodec_encode_video(c, avpkt.data, avpkt.size, picture);
//int success = avcodec_encode_video2(c, &avpkt, picture, &got_packet);
outstream = avpkt.data;
return out_size;
}