
Recherche avancée
Autres articles (30)
-
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 (...) -
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 (...) -
Contribute to a better visual interface
13 avril 2011MediaSPIP is based on a system of themes and templates. Templates define the placement of information on the page, and can be adapted to a wide range of uses. Themes define the overall graphic appearance of the site.
Anyone can submit a new graphic theme or template and make it available to the MediaSPIP community.
Sur d’autres sites (6016)
-
"Critical error detected c0000374" when running av_packet_unref or av_frame_unref
15 mai 2021, par Shivang SharmaI am trying to read and decode frames which is happening nicely but when its reaching part of un-referencing frame or packet using
av_packet_unref
andav_frame_unref
it is giving error during second frame or third frame sometimes .

Error (Copied from visual studio output window) :


Critical error detected c0000374
Libav.exe has triggered a breakpoint



Here is some code of reading and decoding which is giving error :


void Decoder::streamNextFrame(int type = 0)
{
 while (av_read_frame(this->fileFormatCtx, this->latestpacket) >= 0) {
 if (this->audioDecoder->activeAudioStream != nullptr) {
 if (this->latestpacket->stream_index == this->audioDecoder->activeAudioStream->index) {
 avcodec_send_packet(this->audioDecoder->activeStreamDecoder, this->latestpacket);
 err = avcodec_receive_frame(this->audioDecoder->activeStreamDecoder, this->decodedFrame);
 if (err == AVERROR(EAGAIN)) {
 av_frame_unref(this->decodedFrame);
 av_packet_unref(this->latestpacket);
 continue;
 }

 {
 int currentIndex = (int)this->audioFrames->size();
 this->audioFrames->resize((int)this->audioFrames->size() + 1);
 int nb = 0;
 this->audioFrames->at(currentIndex).pts = (int)this->decodedFrame->pts;
 if (this->audioDecoder->activeStreamDecoder->sample_fmt != AV_SAMPLE_FMT_S16) {
 nb = 2048 * this->audioDecoder->activeStreamDecoder->channels;
 printf("%i\n", nb);
 this->audioFrames->at(currentIndex).data.resize(nb);
 if (!swr_is_initialized(swr)) {

 swr_alloc_set_opts(swr, this->audioDecoder->activeStreamDecoder->channel_layout, AV_SAMPLE_FMT_S16, this->audioDecoder->activeStreamDecoder->sample_rate, this->audioDecoder->activeStreamDecoder->channel_layout, this->audioDecoder->activeStreamDecoder->sample_fmt, this->audioDecoder->activeStreamDecoder->sample_rate, 0, nullptr);
 swr_init(swr);
 }

 uint8_t* buffer = this->audioFrames->at(currentIndex).data.data();
 swr_convert(swr, &buffer, nb, (const uint8_t**)this->decodedFrame->extended_data, this->decodedFrame->nb_samples);
 }
 else {
 nb = this->decodedFrame->nb_samples * this->audioDecoder->activeStreamDecoder->channels;
 this->audioFrames->at(currentIndex).data = std::vector(*this->decodedFrame->extended_data, *this->decodedFrame->extended_data + (uint8_t)nb);
 }

 this->audioFrames->at(currentIndex).buffersize = nb;
 }

 if (err == AVERROR_EOF) {
 this->audioDecoder->streamEnded = true;
 av_frame_unref(this->decodedFrame);
 av_packet_unref(this->latestpacket);
 break;
 }
 else if (err >= 0) {
 this->audioDecoder->streamEnded = false;
 }

 if (type != 0) {
 av_packet_unref(this->latestpacket);
 av_frame_unref(this->decodedFrame);
 break;
 }
 av_packet_unref(this->latestpacket);
 av_frame_unref(this->decodedFrame);
 }
 }
 else {
 printf("No active audio stream is set\n");
 if(type!=0)
 break;
 }
 }

}



I have removed some of code which was concerning the video and was not giving problem I think.


Some Information about above code :


this->audioFrames is a pointer to vector with following type.
std::vector<audioframeformat>* "AudioFrameFormat" is struct defined as following

struct AudioFrameFormat {
 std::vector data = {};
 int pts = 0;
 int buffersize = 0;
 };


swr is a private class member allocated in constructor
</audioframeformat>


Call Stack looks like :




I am getting from call stack is that I am not taking care of my heap memory.


Can someone please explain where problem is and, why some times it run till third frame and some time till second frame of the audio stream ?


And please tell how can I improve this code.


-
FFmpeg giving a wierd "Permission denied" error (Digitalocean VPS Ubuntu 18.04)
10 mai 2021, par DJ DannyI've set up a VPS server on Digitalocean. Installed Ubuntu 18.04, LAMP, etc.
Finally, I installed ffmpeg. It is working fine from terminal but when I try to execute it through php it gives a weird "Permission denied" error :


Here is some information :

root@vl :/# whereis ffmpeg

ffmpeg : /usr/local/bin/ffmpeg

root@vl :/# whereis ffprobe

ffprobe : /usr/local/bin/ffprobe

root@vl :/# ffmpeg -version

ffmpeg version N-102461-g8649f5dca6 Copyright (c) 2000-2021 the FFmpeg developers
built with gcc 7 (Ubuntu 7.5.0-3ubuntu1 18.04)
configuration : —prefix=/usr/local/ffmpeg_build —pkg-config-flags=—static —extra-cflags=-I/usr/local/ffmpeg_build/include —extra-ldflags=-L/usr/local/ffmpeg_build/lib —extra-libs='-lpthread -lm' —ld=g++ —bindir=/usr/local/bin —enable-gpl —enable-gnutls —enable-libaom —enable-libass —enable-libfdk-aac —enable-libfreetype —enable-libmp3lame —enable-libopus —enable-libsvtav1 —enable-libvorbis —enable-libvpx —enable-libx264 —enable-libx265 —enable-nonfree
libavutil 57. 0.100 / 57. 0.100
libavcodec 59. 1.100 / 59. 1.100
libavformat 59. 0.101 / 59. 0.101
libavdevice 59. 0.100 / 59. 0.100
libavfilter 8. 0.101 / 8. 0.101
libswscale 6. 0.100 / 6. 0.100
libswresample 4. 0.100 / 4. 0.100
libpostproc 56. 0.100 / 56. 0.100


My php file :


echo shell_exec("ffmpeg -i mj.gif -profile:v baseline -pix_fmt yuv420p -vf scale=600 :-2 output.mp4 2>&1")

 ?>

The ERROR ! :

ffmpeg version N-102461-g8649f5dca6 Copyright (c) 2000-2021 the FFmpeg developers built with gcc 7 (Ubuntu 7.5.0-3ubuntu1 18.04) configuration : —prefix=/usr/local/ffmpeg_build —pkg-config-flags=—static —extra-cflags=-I/usr/local/ffmpeg_build/include —extra-ldflags=-L/usr/local/ffmpeg_build/lib —extra-libs='-lpthread -lm' —ld=g++ —bindir=/usr/local/bin —enable-gpl —enable-gnutls —enable-libaom —enable-libass —enable-libfdk-aac —enable-libfreetype —enable-libmp3lame —enable-libopus —enable-libsvtav1 —enable-libvorbis —enable-libvpx —enable-libx264 —enable-libx265 —enable-nonfree libavutil 57. 0.100 / 57. 0.100 libavcodec 59. 1.100 / 59. 1.100 libavformat 59. 0.101 / 59. 0.101 libavdevice 59. 0.100 / 59. 0.100 libavfilter 8. 0.101 / 8. 0.101 libswscale 6. 0.100 / 6. 0.100 libswresample 4. 0.100 / 4. 0.100 libpostproc 56. 0.100 / 56. 0.100 Input #0, gif, from 'mj.gif' : Duration : 00:00:01.60, start : 0.000000, bitrate : 22863 kb/s Stream #0:0 : Video : gif, bgra, 1400x1050, 10 fps, 10 tbr, 100 tbn output.mp4 : Permission denied

From the past 24 hours I've tried installing ffmpeg in different ways (compiling & apt install), I've also tried changing the permission but still I'm stuck with this error.

Any help would be highly appreciated !

Thanks

-
Getting error "WebAssembly.Memory() : could not allocate memory" when running ffmpeg.wasm on android chrome browser
27 juin 2022, par Ravi KunduError in detail :


WebAssembly.Memory(): could not allocate memory
at https://*******/ffmpeg-core.js:22:82
at https://*******/ffmpeg.min.js:1:6506
at f (https://*******/ffmpeg.min.js:1:11322)
at Generator._invoke (https://*******/ffmpeg.min.js:1:11110)
at Generator.next (https://*******/ffmpeg.min.js:1:11747)
at i (https://*******/ffmpeg.min.js:1:4295)
at c (https://*******/ffmpeg.min.js:1:4498)



Code for ffmpeg :


const downloadWithFFMPEG = async () =>{
 const sourceBuffer = await fetch(recordingURL).then(r => r.arrayBuffer());
 await ffmpeg.load();
 await ffmpeg.FS(
 "writeFile",
 "input.webm",
 new Uint8Array(sourceBuffer, 0, sourceBuffer.byteLength)
 );
 await ffmpeg.run("-i", "input.webm", "-c", "copy", "output.mp4")
 const output = ffmpeg.FS("readFile", "output.mp4");
 var link = document.createElement('a')
 link.href = URL.createObjectURL(new Blob([output.buffer], { type: 'video/mp4;codecs=H264' }));
 link.download = this.data;
 link.click();
 recording = false;
}



Brief about problem :
The error only comes for android chrome browser. The same code works fine on pc/laptop chrome.
Have also enabled Webassembly-thread on chrome ://flags for android browser as someone suggested me to do it but still same error. Can someone help me ?