
Recherche avancée
Autres articles (43)
-
Personnaliser les catégories
21 juin 2013, parFormulaire de création d’une catégorie
Pour ceux qui connaissent bien SPIP, une catégorie peut être assimilée à une rubrique.
Dans le cas d’un document de type catégorie, les champs proposés par défaut sont : Texte
On peut modifier ce formulaire dans la partie :
Administration > Configuration des masques de formulaire.
Dans le cas d’un document de type média, les champs non affichés par défaut sont : Descriptif rapide
Par ailleurs, c’est dans cette partie configuration qu’on peut indiquer le (...) -
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 -
HTML5 audio and video support
13 avril 2011, parMediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
For older browsers the Flowplayer flash fallback is used.
MediaSPIP allows for media playback on major mobile platforms with the above (...)
Sur d’autres sites (8177)
-
lame mp3 change bitrate cpp
23 mai 2019, par user2018761I need to change mp3 bitrate, I’m using lame for cpp project under Windows and Linux. I think I need to convert mp3 to wav and then wav to mp3 with desired bitrate.
For wav to mp3 I already have the code (using lame) it works.
For mp3 to wav there is problem with app crashing on hip_decode.
Probably due to ID3 tags at the beginning of the file.
How to skip the ID3 tags or is this a different problem ?This is code I’m using
bool Helper::convert2Wav(QString fromFile, QString toFile) {
int read, write;
int ctn = 0;
FILE *mp3_in =fopen(fromFile.toLocal8Bit().data(),"rb");
//this should be WAV
FILE *pcm_out =fopen(toFile.toLocal8Bit().data(),"wb");
const int PCM_SIZE = 4096;
const int MP3_SIZE = 4096;
short int pcm_buffer[PCM_SIZE*2];
short int pcm_buffer1[PCM_SIZE];
short int pcm_buffer2[PCM_SIZE];
unsigned char mp3_buffer[MP3_SIZE];
memset(pcm_buffer, 0, sizeof(pcm_buffer));
memset(pcm_buffer1, 0, sizeof(pcm_buffer1));
memset(pcm_buffer2, 0, sizeof(pcm_buffer2));
memset(mp3_buffer, 0, sizeof(mp3_buffer));
lame_t lame = lame_init();
hip_t l = hip_decode_init();
lame_set_in_samplerate(lame, 44100);
//lame_set_VBR(lame, vbr_default);
//lame_set_mode(lame, MONO);
lame_init_params(lame);
qDebug()<<"start decoding";
do {
ctn += 4096;
qDebug()<<"a message:"</read = hip_decode(l, mp3_buffer, MP3_SIZE, pcm_buffer1,pcm_buffer2);
//memcpy(pcm_buffer, pcm_buffer1, sizeof(pcm_buffer1));
//memcpy(&pcm_buffer[PCM_SIZE], pcm_buffer2, sizeof(pcm_buffer2));
//write = lame_encode_buffer_interleaved(lame, pcm_buffer, read,mp3_buffer, MP3_SIZE);
//fwrite(pcm_buffer, 1, sizeof(pcm_buffer), pcm_out);
} while (read != 0);
hip_decode_exit(l);
lame_close(lame);
fclose(pcm_out);
fclose(mp3_in);
return true;
}It is crashing with an output :
start decoding
a message: 4096
a message: 8192
a message: 12288
1 ?? 0x7ffff7b8f0b5
2 hip_decode1_headers 0x7ffff7b8f34b
3 hip_decode1_headers 0x7ffff7b8f385
4 hip_decode_headers 0x7ffff7b8f42d
5 hip_decode 0x7ffff7b8f47c
6 Helper::convert2Wav helper.cpp 498 0x5555555b0fe7
7 ?? 0x4490551063006a0
MP3_SIZE 258346945 int
PCM_SIZE 234884892 int
ctn 189860957 int
l 1050198802094820962 hip_t
lame 1165886731226582744 lame_t
mp3_buffer "\005\0029lM^J\035�xo�R����(����Rj\172175r�V�����ԡCb٥���0a�ע�r�4�A��7Xj�Q0u�\033Os��L5�S$D2\002\016� UxCp\014s��08\004+7��@"�r"... (4096) unsigned char[4096]
mp3_in 0xe0b0e1e0e060d4a FILE*
pcm_buffer @0x7fffffff89a0 short[8192]
pcm_buffer1 @0x7fffffff69a0 short[4096]
pcm_buffer2 @0x7fffffff49a0 short[4096]
pcm_out 0xc460bb00bb40c82 FILE*
read 229772669 int
write <optimized out="out">
</optimized>it seems this is not ID3 issue, I have used this code https://searchcode.com/file/31230698/ID3.cpp to read ID3 and it shows there is no ID3 tags
But still crashing at the same point :Has ID3v2 Tag: No
Tag size: 0
start decoding skip tag_size: 0
a message: 4096
a message: 8192
a message: 12288 -
How to compute the number of extra samples added by LAME or FFMPEG
24 janvier 2018, par actuallyaswinI am attempting to build a MP3 decoder / parser in Python which supports files encoded by LAME or FFMPEG.
My encoding shell script is shown here :
#!/bin/bash
for i in wav/*.wav; do
i=${i##*/};
lame --nores --strictly-enforce-ISO -t --cbr -b 64 -h "wav/${i}" "mpeg/lame/${i%.wav}.mp3";
ffmpeg -i "wav/${i}" -codec:a libmp3lame -qscale:a 2 "mpeg/ffmpeg/${i%.wav}.mp3";
doneThis scripts reads WAVE files located in
./wav/
and produces a controlled-bitrate MP3 of 64kbps in my./mp3/lame/
directory, and a variable-bitrate MP3 of quality 2 in my./mp3/ffmpeg/
.I have written a Python script that iterates through both resultant MP3s, counting the number of frames and samples. Both the LAME and FFMPEG results are equivalent (in terms of frames and samples), but their binary files are different.
The LAME/FFMPEG sample count was done by iterating through the binary MP3 files, locating and parsing the frame header, then using the MP3 spec to determine the number of samples per frame.
- Number of MP3 data-frames : 112 (ignoring the Xing/Info first frame)
- Number of output frames : 112*576 = 64512
Here is a comparison of the sample count for a single 4-second input file :
- Input WAV # of samples = 62996
- Output LAME/FFMPEG # of samples = 64512
- Difference = 1516
I understand that according to the LAME FAQ file, resultant MP3 files are zero padded in the front and back to make sure the inverse MDCT is performed properly, but also because the windows overlap.
What I can’t ascertain from the above FAQ, or from any previous StackOverflow post, is how to compute the number of artificially added samples. If I can be sure that all 1516 of these samples are zeros, and I can be sure of their position in the bytestream, I’d like to be able to confidently toss them out. Since there are 1516 "extra" samples and there are 576 samples per frame for a V2LIII encoding, then there must be more than two (but less than three) erroneous MPEG frames here.
Is anyone here savvy enough with MPEG encoding/decoding to know how many samples are added, and in which frames those samples will be in ? In other words, will the first frame and last frame always contain blank data, or are there more frames ?
-
lame mp3 to wav crashing (need to skip ID3 tag ?)
18 janvier 2018, par user2018761I need to change mp3 bitrate, I’m using lame for cpp project under Windows and Linux. I think I need to convert mp3 to wav and then wav to mp3 with desired bitrate.
For wav to mp3 I already have the code (using lame) it works.
For mp3 to wav there is problem with app crashing on hip_decode.
Probably due to ID3 tags at the beginning of the file.
How to skip the ID3 tags or is this a different problem ?This is code I’m using
bool Helper::convert2Wav(QString fromFile, QString toFile) {
int read, write;
int ctn = 0;
FILE *mp3_in =fopen(fromFile.toLocal8Bit().data(),"rb");
//this should be WAV
FILE *pcm_out =fopen(toFile.toLocal8Bit().data(),"wb");
const int PCM_SIZE = 4096;
const int MP3_SIZE = 4096;
short int pcm_buffer[PCM_SIZE*2];
short int pcm_buffer1[PCM_SIZE];
short int pcm_buffer2[PCM_SIZE];
unsigned char mp3_buffer[MP3_SIZE];
memset(pcm_buffer, 0, sizeof(pcm_buffer));
memset(pcm_buffer1, 0, sizeof(pcm_buffer1));
memset(pcm_buffer2, 0, sizeof(pcm_buffer2));
memset(mp3_buffer, 0, sizeof(mp3_buffer));
lame_t lame = lame_init();
hip_t l = hip_decode_init();
lame_set_in_samplerate(lame, 44100);
//lame_set_VBR(lame, vbr_default);
//lame_set_mode(lame, MONO);
lame_init_params(lame);
qDebug()<<"start decoding";
do {
ctn += 4096;
qDebug()<<"a message:"</read = hip_decode(l, mp3_buffer, MP3_SIZE, pcm_buffer1,pcm_buffer2);
//memcpy(pcm_buffer, pcm_buffer1, sizeof(pcm_buffer1));
//memcpy(&pcm_buffer[PCM_SIZE], pcm_buffer2, sizeof(pcm_buffer2));
//write = lame_encode_buffer_interleaved(lame, pcm_buffer, read,mp3_buffer, MP3_SIZE);
//fwrite(pcm_buffer, 1, sizeof(pcm_buffer), pcm_out);
} while (read != 0);
hip_decode_exit(l);
lame_close(lame);
fclose(pcm_out);
fclose(mp3_in);
return true;
}It is crashing with an output :
start decoding
a message: 4096
a message: 8192
a message: 12288
1 ?? 0x7ffff7b8f0b5
2 hip_decode1_headers 0x7ffff7b8f34b
3 hip_decode1_headers 0x7ffff7b8f385
4 hip_decode_headers 0x7ffff7b8f42d
5 hip_decode 0x7ffff7b8f47c
6 Helper::convert2Wav helper.cpp 498 0x5555555b0fe7
7 ?? 0x4490551063006a0
MP3_SIZE 258346945 int
PCM_SIZE 234884892 int
ctn 189860957 int
l 1050198802094820962 hip_t
lame 1165886731226582744 lame_t
mp3_buffer "\005\0029lM^J\035�xo�R����(����Rj\172175r�V�����ԡCb٥���0a�ע�r�4�A��7Xj�Q0u�\033Os��L5�S$D2\002\016� UxCp\014s��08\004+7��@"�r"... (4096) unsigned char[4096]
mp3_in 0xe0b0e1e0e060d4a FILE*
pcm_buffer @0x7fffffff89a0 short[8192]
pcm_buffer1 @0x7fffffff69a0 short[4096]
pcm_buffer2 @0x7fffffff49a0 short[4096]
pcm_out 0xc460bb00bb40c82 FILE*
read 229772669 int
write <optimized out="out">
</optimized>it seems this is not ID3 issue, I have used this code https://searchcode.com/file/31230698/ID3.cpp to read ID3 and it shows there is no ID3 tags
But still crashing at the same point :Has ID3v2 Tag: No
Tag size: 0
start decoding skip tag_size: 0
a message: 4096
a message: 8192
a message: 12288Best Regards
Marek