
Recherche avancée
Autres articles (61)
-
Emballe Médias : Mettre en ligne simplement des documents
29 octobre 2010, parLe plugin emballe médias a été développé principalement pour la distribution mediaSPIP mais est également utilisé dans d’autres projets proches comme géodiversité par exemple. Plugins nécessaires et compatibles
Pour fonctionner ce plugin nécessite que d’autres plugins soient installés : CFG Saisies SPIP Bonux Diogène swfupload jqueryui
D’autres plugins peuvent être utilisés en complément afin d’améliorer ses capacités : Ancres douces Légendes photo_infos spipmotion (...) -
Submit bugs and patches
13 avril 2011Unfortunately a software is never perfect.
If you think you have found a bug, report it using our ticket system. Please to help us to fix it by providing the following information : the browser you are using, including the exact version as precise an explanation as possible of the problem if possible, the steps taken resulting in the problem a link to the site / page in question
If you think you have solved the bug, fill in a ticket and attach to it a corrective patch.
You may also (...) -
Creating farms of unique websites
13 avril 2011, parMediaSPIP platforms can be installed as a farm, with a single "core" hosted on a dedicated server and used by multiple websites.
This allows (among other things) : implementation costs to be shared between several different projects / individuals rapid deployment of multiple unique sites creation of groups of like-minded sites, making it possible to browse media in a more controlled and selective environment than the major "open" (...)
Sur d’autres sites (6674)
-
FFMPG crop video, add overlay image and change sound in one command
8 mai 2015, par laurentiughI am developing an (android) app witch records a video then needs to crop video, add overlay image and change sound. The problem is that i am doing them sequentially and this takes very long time (like 5min for a 20s video).
I need help to combine them into one command or optimize to be as fast as possible. The commands i am using :
-
Crop video to 480x480 :
ffmpeg -i videoPath -vf scale=480:ih*480/iw -vf crop=480:480:0:0 -c:a copy -strict experimental outPath -
Add the image overlay :
ffmpeg -i videoPath -i imagePath -c:a copy -filter_complex overlay=0:0 -strict experimental -
change the sound (merge video with another sound file) :
ffmpeg -i videoPath) -i audioPath) -vf transpose=2 -c:a aac -strict experimental -map 0:v:0 -map 1:a:0
Thanks.
-
-
Revision 91518 : Notice PHP en moins : lock et unlock n’ont pas de $value ou $ttl.
28 août 2015, par marcimat@… — LogNotice PHP en moins : lock et unlock n’ont pas de $value ou $ttl.
-
Can't lock std::mutex again
16 juillet 2017, par user3567631Sorry for poor English.
I referenced this FFMPEG to make ffmpeg decoder.
Theopen
will block, I make it run in detach thread.
I added std::unique_lock to lock mutex in beginning ofopen
.bool FFmpegWrapper::open(std::string strFileName)
{
std::unique_lock lock(g_Mutex, std::try_to_lock);
m_pFormatContext = avformat_alloc_context();
m_pFormatContext->probesize = 4 * 1024 *100;
m_pFormatContext->max_analyze_duration = 0 * AV_TIME_BASE;
if (avformat_open_input(&m_pFormatContext, strFileName.c_str(), nullptr, nullptr) != 0)
return false;
if (avformat_find_stream_info(m_pFormatContext, NULL) < 0)
return false;
m_iVideoStream = m_iAudioStream = -1;
for (unsigned int i = 0; i < m_pFormatContext->nb_streams; i++)
{
if ((m_iVideoStream < 0) && (m_pFormatContext->streams[i]->codec->codec_type == AVMEDIA_TYPE_VIDEO))
{
m_iVideoStream = i;
}
else if ((m_iAudioStream < 0) && (m_pFormatContext->streams[i]->codec->codec_type == AVMEDIA_TYPE_AUDIO))
{
m_iAudioStream = i;
}
}
if (!(hasVideo() || hasAudio()))
return false; // Didn't find video or audio stream
if (hasVideo())
{
if (!openVideoStream())
return false;
}
if (hasAudio())
{
if (!openAudioStream())
return false;
}
retrieveFileInfo();
m_bIsFileOpen = true;
m_strFileName = strFileName;
if (isImage())
{
m_dDurationInMs = 0;
m_dFps = 0;
m_lCurrentFrameNumber = 1;
decodeImage();
}
m_bIsThreadRunning = false;
if (m_bIsFileOpen)
CCLOG("FFmpeg open stream succeed");
else
CCLOG("FFmpeg open stream failed");
m_iState = eOpened;
return m_bIsFileOpen;
}and added unique_lock in
close
beginning like this.void FFmpegWrapper::close()
{
std::unique_lock lock(g_Mutex, std::try_to_lock);
while (!lock.owns_lock())
{
lock.try_lock()
}
stop();
if (m_pVideoBuffer != nullptr)
{
delete m_pVideoBuffer;
m_pVideoBuffer = nullptr;
}
if (m_pVideoFrameRGB != nullptr)
{
av_free(m_pVideoFrameRGB);
m_pVideoFrameRGB = nullptr;
}
if (m_pVideoFrame != nullptr)
{
av_free(m_pVideoFrame);
m_pVideoFrame = nullptr;
}
if (m_pAudioFrame != nullptr)
{
av_free(m_pAudioFrame);
m_pAudioFrame = nullptr;
}
if (m_pSwScalingContext != nullptr)
{
sws_freeContext(m_pSwScalingContext);
m_pSwScalingContext = nullptr;
}
if (m_pVideoCodecContext != nullptr)
{
avcodec_close(m_pVideoCodecContext);
m_pVideoCodecContext = nullptr;
}
if (m_pAudioCodecContext != nullptr)
{
avcodec_close(m_pAudioCodecContext);
m_pAudioCodecContext = nullptr;
}
if (m_pFormatContext != nullptr)
{
avformat_free_context(m_pFormatContext);
m_pFormatContext = nullptr;
}
if(m_pSwr != nullptr)
swr_free(&m_pSwr);
CCLOG("CLOSE DONE");
}When
open
is still running ,I want lock mutex again inclose
in main thread.
it failed to get mutex ownership it is no problem. But even while loop waited the open() done, try_lock still can’t get the mutex ownership.I thought unique_lock out of scope will unlock mutex ,but it didn’t. I want to know how can I lock the mutex correctly.Thank you !