
Recherche avancée
Médias (2)
-
Rennes Emotion Map 2010-11
19 octobre 2011, par
Mis à jour : Juillet 2013
Langue : français
Type : Texte
-
Carte de Schillerkiez
13 mai 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Texte
Autres articles (57)
-
Amélioration de la version de base
13 septembre 2013Jolie sélection multiple
Le plugin Chosen permet d’améliorer l’ergonomie des champs de sélection multiple. Voir les deux images suivantes pour comparer.
Il suffit pour cela d’activer le plugin Chosen (Configuration générale du site > Gestion des plugins), puis de configurer le plugin (Les squelettes > Chosen) en activant l’utilisation de Chosen dans le site public et en spécifiant les éléments de formulaires à améliorer, par exemple select[multiple] pour les listes à sélection multiple (...) -
Déploiements possibles
31 janvier 2010, parDeux types de déploiements sont envisageable dépendant de deux aspects : La méthode d’installation envisagée (en standalone ou en ferme) ; Le nombre d’encodages journaliers et la fréquentation envisagés ;
L’encodage de vidéos est un processus lourd consommant énormément de ressources système (CPU et RAM), il est nécessaire de prendre tout cela en considération. Ce système n’est donc possible que sur un ou plusieurs serveurs dédiés.
Version mono serveur
La version mono serveur consiste à n’utiliser qu’une (...) -
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 (...)
Sur d’autres sites (8257)
-
ffmpeg unable to get duration/bitrate of remote gif
17 février, par Peter XiaI'm trying to get the duration of a gif.


The command
ffmpeg -i https://cdn.7tv.app/emote/01F6MZGCNG000255K4X1K7NTHR/4x.gif


gives

Duration: N/A, start: 0.000000, bitrate: N/A


However if i download the file and pass it in

ffmpeg -i 4x.gif


it gives :

Duration: 00:00:07.92, start: 0.000000, bitrate: 1225 kb/s


The issue seems limited only to gifs on 7tv site.


- 

- It works for other sites. (example :
ffmpeg -i https://c.tenor.com/ULCY5B996-oAAAAd/tenor.gif
). - It also works for other encodings of that image (exmaple
ffmpeg -i https://cdn.7tv.app/emote/01F6MZGCNG000255K4X1K7NTHR/4x.avif
)






Here is the HTTP response header from 7tv site of that gif :


HTTP/2 200 
content-type: image/gif
content-length: 1213725
x-7tv-cache-hits: 37527
x-7tv-cache: hit
age: 228365
cache-control: public, max-age=604800, s-maxage=86400, immutable
alt-svc: h3=":443"; ma=2592000
x-7tv-cdn-pod: cdn-ssprq
x-7tv-cdn-node: cdn-1
server: SevenTV
vary: origin, access-control-request-method, access-control-request-headers
access-control-allow-origin: *
access-control-expose-headers: *
date: Sun, 16 Feb 2025 20:47:28 GMT



Can someone help me understand ? Something spcecific to this site is causing ffmpeg to behave differently ?


- It works for other sites. (example :
-
[Aug-Sept 2013] Piwik 2.0 Development Update !
3 octobre 2013, par Fabian Becker — DevelopmentThis Development Update is the first in a new series of posts we’ll be writing to keep you, our loyal users, informed of our efforts. We hope these updates keep you excited about Piwik’s future, and if you’re a developer, we hope they inspire and challenge you to accomplish more yourself !
Despite this being our first update, it will probably be one of our biggest. We’ve gotten a lot done as we race towards the Piwik 2.0 release ! Just see for yourself :
What we’ve accomplished
Theming
Piwik now supports theming, a feature that was requested often in the past. Because of our switch to the Twig template engine and other major code changes it is now possible to change the way Piwik looks. Additionally, developers can use the dynamic stylesheet language LESS, instead of CSS. Piwik will automatically transform the LESS code into CSS.
Piwik 2.0 will ship with a new dark theme called PleineLune (french for Full Moon) that makes use of the new theming feature. Another theme with a left-aligned menu was created during the Piwik Meetup in Paris. Both of these themes were created by Thomas Zilliox, a very talented designer and CSS expert.
PHP 5.3 Namespaces
For Piwik 2.0 we decided to make use of namespaces, a feature introduced in PHP 5.3. The usage of namespaces makes our code more readable and allows us to better modularize the platform. This is in part why we are raising the required minimum PHP version to 5.3 for Piwik 2.0. (Remember to update your server !)
Translations in JSON
All translations are now stored in JSON files which makes storing translations in Piwik a lot cleaner that the giant PHP array we previously used.
Side note : if you’d like to make Piwik available to more languages, please sign up at translations.piwik.org. We’d love to have your help !
UI Tests
We now use UI tests to make sure that changes to the code don’t break the UI. UI tests use PhantomJS and CutyCapt and are automatically executed on Travis CI. Whenever an integration test fails the script produces a screenshot diff that shows the difference. Learn more.
AnonymizeIP supports IPv6
The AnonymizeIP plugin now masks IPv6 addresses. The concept of the config option ‘ip_address_mask_length’ has now changed to reflect the level of masking that should be applied to the IP. With a masking level of 1 Piwik will mask the last octet of an IPv4 address and the last 80 bits of an IPv6 address.
All Websites Dashboard usable with 20,000+ Websites
The All Websites Dashboard is now usable even if you track many thousands of websites in your Piwik instance. We rewrote parts of the archiving process in order to make this possible. Making Piwik fast and memory efficient is a constant concern for core developers.
Plugins can now add new Visualizations
Piwik Plugins and Themes can now create new visualizations for your report data. They can also specify their own ViewDataTable footer icons or modify existing ones. This will allow plugin developers to create new ways for you to view your data, customize existing reports so they look great in new visualizations and provide extra analytics functionality accessible in each of your reports.
The new TreemapVisualization plugin makes use of this feature to let you view your reports as treemaps. It serves as an example of this new functionality.
Piwik Marketplace
The Piwik Marketplace is a new platform developers can use to publish their plugins and themes so all Piwik users can easily access them. The marketplace is hosted at plugins.piwik.org and is currently in an early development state, but we’re already able to host plugins !
Developers can easily publish their plugins by adding a commit hook to their Github repositories. Every time you push a new tag, the marketplace will make a new version of your plugin available. The marketplace will provide a centralized platform to search for plugins and also provide statistics on plugin usage.
Install Plugins and Themes in one click from within Piwik
Piwik has offered since the beginning the much-loved “one click update” feature. We are bringing the same functionnality to the Marketplace : you will be able to install Plugins and Themes in one click directly within the Piwik interface ! Similarly to WordPress or Firefox, Piwik will let you extend the functionnality of your analytics platform.
Conclusion
In Piwik 2.0 you will be able to install plugins and themes from the marketplace. And, if you’re so inclined, you will be able to create and host your own plugins/themes on the marketplace so everyone can use them. This is by far the accomplishment we are most excited by… the possibilities it opens up for Piwik’s future are truly unlimited. We hope you share our excitement !
Au revoir, until next time !
PS : our mission is to liberate web analytics ; thank you for sharing the word about Piwik 2.0 !
-
C++ ffmpeg lib version 7.0 - runtime error
1er septembre 2024, par Chris PI want to make a C++ lib named cppdub which will mimic the python module pydub.


One main function is to export the AudioSegment to a file with a specific format (example : mp3).


The code is :


void check_av_error(int error_code, const std::string& msg) {
 if (error_code < 0) {
 char errbuf[AV_ERROR_MAX_STRING_SIZE];
 av_strerror(error_code, errbuf, sizeof(errbuf));
 throw std::runtime_error(msg + ": " + errbuf);
 }
}

std::string av_err2str_(int errnum) {
 char buf[AV_ERROR_MAX_STRING_SIZE];
 av_strerror(errnum, buf, sizeof(buf));
 return std::string(buf);
}

void log_error(const std::string& msg) {
 std::cerr << "Error: " << msg << std::endl;
}

std::ofstream cppdub::AudioSegment::export_segment(
 std::string& out_f,
 const std::string& format,
 const std::string& codec,
 const std::string& bitrate,
 const std::vector& parameters,
 const std::map& tags,
 const std::string& id3v2_version,
 const std::string& cover) {

 av_log_set_level(AV_LOG_DEBUG);
 avformat_network_init();

 AVFormatContext* format_ctx = nullptr;
 int ret = avformat_alloc_output_context2(&format_ctx, nullptr, format.c_str(), out_f.c_str());
 check_av_error(ret, "Could not allocate format context");

 if (!(format_ctx->oformat->flags & AVFMT_NOFILE)) {
 ret = avio_open(&format_ctx->pb, out_f.c_str(), AVIO_FLAG_WRITE);
 check_av_error(ret, "Could not open output file");
 }

 AVStream* stream = avformat_new_stream(format_ctx, nullptr);
 if (!stream) {
 avformat_free_context(format_ctx);
 throw std::runtime_error("Could not allocate stream");
 }

 const AVCodec* codec_obj = avcodec_find_encoder_by_name(codec.c_str());
 if (!codec_obj) {
 avformat_free_context(format_ctx);
 throw std::runtime_error("Codec not found");
 }

 AVCodecContext* codec_ctx = avcodec_alloc_context3(codec_obj);
 if (!codec_ctx) {
 avformat_free_context(format_ctx);
 throw std::runtime_error("Could not allocate codec context");
 }

 codec_ctx->sample_rate = this->get_frame_rate();
 AVChannelLayout ch_layout_1;
 av_channel_layout_uninit(&ch_layout_1);
 av_channel_layout_default(&ch_layout_1, 2);
 codec_ctx->ch_layout = ch_layout_1; // Adjust based on your needs
 codec_ctx->bit_rate = std::stoi(bitrate);
 codec_ctx->sample_fmt = codec_obj->sample_fmts[0];

 if (format_ctx->oformat->flags & AVFMT_GLOBALHEADER) {
 codec_ctx->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;
 }

 ret = avcodec_open2(codec_ctx, codec_obj, nullptr);
 check_av_error(ret, "Could not open codec");

 stream->time_base = { 1, codec_ctx->sample_rate };
 ret = avcodec_parameters_from_context(stream->codecpar, codec_ctx);
 check_av_error(ret, "Could not set codec parameters");

 ret = avformat_write_header(format_ctx, nullptr);
 check_av_error(ret, "Error occurred when writing header");

 AVPacket pkt;
 av_init_packet(&pkt);
 pkt.data = nullptr;
 pkt.size = 0;

 int frame_size = av_samples_get_buffer_size(nullptr, codec_ctx->ch_layout.nb_channels,
 codec_ctx->frame_size, codec_ctx->sample_fmt, 0);
 check_av_error(frame_size, "Could not calculate frame size");

 AVFrame* frame = av_frame_alloc();
 if (!frame) {
 avcodec_free_context(&codec_ctx);
 avformat_free_context(format_ctx);
 throw std::runtime_error("Error allocating frame");
 }

 frame->format = codec_ctx->sample_fmt;
 frame->ch_layout = codec_ctx->ch_layout;
 frame->sample_rate = codec_ctx->sample_rate;
 frame->nb_samples = codec_ctx->frame_size;

 ret = av_frame_get_buffer(frame, 0);
 if (ret < 0) {
 av_frame_free(&frame);
 avcodec_free_context(&codec_ctx);
 avformat_free_context(format_ctx);
 throw std::runtime_error("Error allocating frame buffer: " + av_err2str_(ret));
 }

 size_t data_offset = 0;

 while (data_offset < this->raw_data().size()) {
 int samples_to_process = std::min(frame_size, static_cast<int>(this->raw_data().size()) - static_cast<int>(data_offset));

 // Fill the frame with audio data
 ret = avcodec_fill_audio_frame(frame, codec_ctx->ch_layout.nb_channels, codec_ctx->sample_fmt,
 reinterpret_cast<const>(this->raw_data().data()) + data_offset,
 samples_to_process, 0);
 if (ret < 0) {
 log_error("Error filling audio frame: " + av_err2str_(ret));
 av_frame_free(&frame);
 avcodec_free_context(&codec_ctx);
 avformat_free_context(format_ctx);
 throw std::runtime_error("Error filling audio frame: " + av_err2str_(ret));
 }

 data_offset += samples_to_process;

 ret = avcodec_send_frame(codec_ctx, frame);
 if (ret < 0) {
 log_error("Error sending frame for encoding: " + av_err2str_(ret));
 av_frame_free(&frame);
 avcodec_free_context(&codec_ctx);
 avformat_free_context(format_ctx);
 throw std::runtime_error("Error sending frame for encoding: " + av_err2str_(ret));
 }

 while (ret >= 0) {
 ret = avcodec_receive_packet(codec_ctx, &pkt);
 if (ret == AVERROR(EAGAIN) || ret == AVERROR_EOF) {
 break;
 }
 check_av_error(ret, "Error receiving packet");

 pkt.stream_index = stream->index;

 ret = av_interleaved_write_frame(format_ctx, &pkt);
 check_av_error(ret, "Error writing encoded frame to output file");

 av_packet_unref(&pkt);
 }
 }

 // Flush the encoder
 avcodec_send_frame(codec_ctx, nullptr);
 while (avcodec_receive_packet(codec_ctx, &pkt) == 0) {
 pkt.stream_index = stream->index;
 av_interleaved_write_frame(format_ctx, &pkt);
 av_packet_unref(&pkt);
 }

 av_write_trailer(format_ctx);

 av_frame_free(&frame);
 avcodec_free_context(&codec_ctx);
 avformat_free_context(format_ctx);

 return std::ofstream(out_f, std::ios::binary);
}
</const></int></int>


The runtime error is :


Exception thrown at 0x00007FF945137C9B (avcodec-61.dll) in cppdub_test.exe : 0xC0000005 : Access violation reading location 0x0000024CBCD25080.


for line :


ret = avcodec_send_frame(codec_ctx, frame);



Call stack :


avcodec-61.dll!00007ff945137c9b() Unknown
 avcodec-61.dll!00007ff9451381bb() Unknown
 avcodec-61.dll!00007ff945139679() Unknown
 avcodec-61.dll!00007ff94371521d() Unknown
 avcodec-61.dll!00007ff9434a80c2() Unknown
 avcodec-61.dll!00007ff9434a84a6() Unknown
 avcodec-61.dll!00007ff9434a8749() Unknown
> cppdub_test.exe!cppdub::AudioSegment::export_segment(std::string & out_f, const std::string & format, const std::string & codec, const std::string & bitrate, const std::vector> & parameters, const std::map,std::allocator>> & tags, const std::string & id3v2_version, const std::string & cover) Line 572 C++
 cppdub_test.exe!main() Line 33 C++
 [External Code] 




Autos :


+ this 0x000000d3a08ff690 {data_="\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0... ...} cppdub::AudioSegment *
+ bitrate "128000" const std::string &
+ ch_layout_1 {order=AV_CHANNEL_ORDER_NATIVE (1) nb_channels=2 u={mask=3 map=0x0000000000000003 {id=??? name=... opaque=...} } ...} AVChannelLayout
+ codec "libmp3lame" const std::string &
+ codec_ctx 0x0000024cbc78c240 {av_class=avcodec-61.dll!0x00007ff94789c760 {class_name=0x00007ff94789c740 "AVCodecContext" ...} ...} AVCodecContext *
+ codec_obj avcodec-61.dll!0x00007ff9477fa4c0 (load symbols for additional information) {name=0x00007ff9477fa47c "libmp3lame" ...} const AVCodec *
+ cover "" const std::string &
 data_offset 9216 unsigned __int64
+ format "mp3" const std::string &
+ format_ctx 0x0000024cbc788a40 {av_class=avformat-61.dll!0x00007ff99eb09fe0 {class_name=0x00007ff99eb09fc0 "AVFormatContext" ...} ...} AVFormatContext *
+ frame 0x0000024cbc787380 {data=0x0000024cbc787380 {0x0000024cbcd25080 <error reading="reading" characters="characters" of="of">, ...} ...} AVFrame *
 frame_size 9216 int
+ id3v2_version "4" const std::string &
+ out_f "ha-ha-ha.mp3" std::string &
+ parameters { size=0 } const std::vector> &
+ pkt {buf=0x0000000000000000 <null> pts=-9223372036854775808 dts=-9223372036854775808 ...} AVPacket
 ret 9216 int
 samples_to_process 9216 int
+ stream 0x0000024cbc789bc0 {av_class=avformat-61.dll!0x00007ff99eb09840 {class_name=0x00007ff99eb09820 "AVStream" ...} ...} AVStream *
+ tags { size=0 } const std::map,std::allocator>> &
</null></error>