
Recherche avancée
Autres articles (86)
-
Personnaliser en ajoutant son logo, sa bannière ou son image de fond
5 septembre 2013, parCertains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;
-
Organiser par catégorie
17 mai 2013, parDans MédiaSPIP, une rubrique a 2 noms : catégorie et rubrique.
Les différents documents stockés dans MédiaSPIP peuvent être rangés dans différentes catégories. On peut créer une catégorie en cliquant sur "publier une catégorie" dans le menu publier en haut à droite ( après authentification ). Une catégorie peut être rangée dans une autre catégorie aussi ce qui fait qu’on peut construire une arborescence de catégories.
Lors de la publication prochaine d’un document, la nouvelle catégorie créée sera proposée (...) -
Récupération d’informations sur le site maître à l’installation d’une instance
26 novembre 2010, parUtilité
Sur le site principal, une instance de mutualisation est définie par plusieurs choses : Les données dans la table spip_mutus ; Son logo ; Son auteur principal (id_admin dans la table spip_mutus correspondant à un id_auteur de la table spip_auteurs)qui sera le seul à pouvoir créer définitivement l’instance de mutualisation ;
Il peut donc être tout à fait judicieux de vouloir récupérer certaines de ces informations afin de compléter l’installation d’une instance pour, par exemple : récupérer le (...)
Sur d’autres sites (5745)
-
Upload video and convert to MPEG-DASH [on hold]
26 juin 2018, par Justin RecUpload video and convert to MPEG-DASH I’m doing ...
Upload file
1. move_uploaded_file($_FILES['video']['tmp_name'], video.mp4);
Converting video
2. ffmpeg -i video.mp4 -ac 2 -ab 128k -c:v libx264 -preset veryfast -x264opts keyint=24:min-keyint=24:no-scenecut -b:v 3000k -maxrate 3000k -bufsize 1500k -vf "scale=-1:1080" video_1080.mp4
ffmpeg -i video.mp4 -ac 2 -ab 128k -c:v libx264 -preset veryfast -x264opts keyint=24:min-keyint=24:no-scenecut -b:v 1500k -maxrate 1500k -bufsize 1000k -vf "scale=-1:720" video_720.mp4
ffmpeg -i video.mp4 -ac 2 -ab 128k -c:v libx264 -preset veryfast -x264opts keyint=24:min-keyint=24:no-scenecut -b:v 500k -maxrate 500k -bufsize 500k -vf "scale=-1:480" video_480.mp4
From mp4 to MPEG-DASH
3. MP4Box -dash 4000 -frag 4000 -rap -segment-name %s/segment_ -url-template -out manifest.mpd video_1080.mp4 video_720.mp4 video_480.mp4
Delete mp4 videos
4. unlink('video_1080.mp4');
unlink('video_720.mp4');
unlink('video_480.mp4');Everything is working. But I’m not sure that this is the right decision. Is there a better solution ? Do I do everything right ?
-
Developers and vendors : Want a Matomo Hoodie ? Add a tag to the Matomo Open Source Tag Manager and this could be yours !
7 juin 2018, par Matomo Core Team — Community, DevelopmentThe Free Open Source Tag Manager is now available as a public beta on the Matomo Marketplace. Don’t know what a Tag Manager is ? Learn more here. In Short : It lets you easily manage all your third party JavaScript and HTML snippets (analytics, ads, social media, remarketing, affiliates, etc) through a single interface.
Over the last few months we have worked on building the core for the Matomo Tag Manager which comes with a great set of features and a large set of pre-configured triggers and variables. However, we currently lack tags.
This is where we need your help ! Together we can build a complete and industry leading open source tag manager.
Tag examples include Google AdWords Conversion Tracking, Facebook Buttons, Facebook Pixels, Twitter Universal Website Tags, LinkedIn Insights.
Are you a developer who is familiar with JavaScript and keen on adding a tag ? Or are you a vendor ? Don’t be shy, we appreciate any tags, even analytics related :) We have documented how to develop a new tag here, which is quite easy and straightforward. You may also need to understand a tiny bit of PHP but you’ll likely be fine even if you don’t (here is an example PHP file and the related JS file).
As we want to ship the Matomo Tag Manager with as many tags as possible out of the box, we appreciate any new tag additions as a pull request on https://github.com/matomo-org/tag-manager.
We will send out “Matomo Contributor” stickers that cannot be purchased anywhere for every contributor who contributes a tag within the next 3 months. As for the top 3 contributors… you’ll receive a Matomo hoodie ! Simply send us an email at hello@matomo.org after your tag has been merged. If needed, a draw will decide who gets the hoodies.
FYI : The Matomo Tag Manager is already prepared to be handled in different contexts and we may possibly generate containers for Android and iOS. If you are keen on building the official Matomo SDKs for any of these mobile platforms, please get in touch.
-
C++ ffmpeg video missing frames and won't play in Quicktime
5 décembre 2019, par Oliver DainI wrote some C++ code that uses ffmpeg to encode a video. I’m having two strange issues :
- The final video is always missing 1 frame. That is, if I have it encode 10 frames the final video only has 9 (at least that’s what
ffprobe -show_frames -pretty $VIDEO | grep -F '[FRAME]' | wc -l
tells me. - The final video plays fine in some players (mpv and vlc) but not in Quicktime. Quicktime just shows a completely black screen.
My code is roughly this (modified a bit to remove types that are unique to our code base) :
First, I open the video file, write the headers and initialize things :
template <class ptrt="ptrt">
using UniquePtrWithDeleteFunction = std::unique_ptr>;
std::unique_ptr<ffmpegencodingframesink> FfmpegEncodingFrameSink::Create(
const std::string& dest_url) {
AVFormatContext* tmp_format_ctxt;
auto alloc_format_res = avformat_alloc_output_context2(&tmp_format_ctxt, nullptr, "mp4", dest_url.c_str());
if (alloc_format_res < 0) {
throw FfmpegException("Error opening output file.");
}
auto format_ctxt = UniquePtrWithDeleteFunction<avformatcontext>(
tmp_format_ctxt, CloseAvFormatContext);
AVStream* out_stream_video = avformat_new_stream(format_ctxt.get(), nullptr);
if (out_stream_video == nullptr) {
throw FfmpegException("Could not create outputstream");
}
auto codec_context = GetCodecContext(options);
out_stream_video->time_base = codec_context->time_base;
auto ret = avcodec_parameters_from_context(out_stream_video->codecpar, codec_context.get());
if (ret < 0) {
throw FfmpegException("Failed to copy encoder parameters to outputstream");
}
if (!(format_ctxt->oformat->flags & AVFMT_NOFILE)) {
ret = avio_open(&format_ctxt->pb, dest_url.c_str(), AVIO_FLAG_WRITE);
if (ret < 0) {
throw VideoDecodeException("Could not open output file: " + dest_url);
}
}
ret = avformat_init_output(format_ctxt.get(), nullptr);
if (ret < 0) {
throw FfmpegException("Unable to initialize the codec.");
}
ret = avformat_write_header(format_ctxt.get(), nullptr);
if (ret < 0) {
throw FfmpegException("Error occurred writing format header");
}
return std::unique_ptr<ffmpegencodingframesink>(
new FfmpegEncodingFrameSink(std::move(format_ctxt), std::move(codec_context)));
}
</ffmpegencodingframesink></avformatcontext></ffmpegencodingframesink></class>Then, every time I get a new frame to encode I pass it to this function (the frames are being decoded via ffmpeg from another mp4 file which Quicktime plays just fine) :
// If frame == nullptr then we're done and we're just flushing the encoder
// otherwise encode an actual frame
void FfmpegEncodingFrameSink::EncodeAndWriteFrame(
const AVFrame* frame) {
auto ret = avcodec_send_frame(codec_ctxt_.get(), frame);
if (ret < 0) {
throw FfmpegException("Error encoding the frame.");
}
AVPacket enc_packet;
enc_packet.data = nullptr;
enc_packet.size = 0;
av_init_packet(&enc_packet);
do {
ret = avcodec_receive_packet(codec_ctxt_.get(), &enc_packet);
if (ret == AVERROR(EAGAIN)) {
CHECK(frame != nullptr);
break;
} else if (ret == AVERROR_EOF) {
CHECK(frame == nullptr);
break;
} else if (ret < 0) {
throw FfmpegException("Error putting the encoded frame into the packet.");
}
assert(ret == 0);
enc_packet.stream_index = 0;
LOG(INFO) << "Writing packet to stream.";
av_interleaved_write_frame(format_ctxt_.get(), &enc_packet);
av_packet_unref(&enc_packet);
} while (ret == 0);
}Finally, in my destructor I close everything up like so :
FfmpegEncodingFrameSink::~FfmpegEncodingFrameSink() {
// Pass a nullptr to EncodeAndWriteFrame so it flushes the encoder
EncodeAndWriteFrame(nullptr);
// write mp4 trailer
av_write_trailer(format_ctxt_.get());
}If I run this passing
n
frames toEncodeAndWriteFrame
lineLOG(INFO) << "Writing packet to stream.";
gets runn
times indicating then
packets were written to the stream. Butffprobe
always shows onlyn - 1
frames int he video. And the final video doesn’t play on quicktime.What am I doing wrong ??
- The final video is always missing 1 frame. That is, if I have it encode 10 frames the final video only has 9 (at least that’s what