
Recherche avancée
Autres articles (13)
-
Mediabox : ouvrir les images dans l’espace maximal pour l’utilisateur
8 février 2011, parLa visualisation des images est restreinte par la largeur accordée par le design du site (dépendant du thème utilisé). Elles sont donc visibles sous un format réduit. Afin de profiter de l’ensemble de la place disponible sur l’écran de l’utilisateur, il est possible d’ajouter une fonctionnalité d’affichage de l’image dans une boite multimedia apparaissant au dessus du reste du contenu.
Pour ce faire il est nécessaire d’installer le plugin "Mediabox".
Configuration de la boite multimédia
Dès (...) -
Installation en mode ferme
4 février 2011, parLe mode ferme permet d’héberger plusieurs sites de type MediaSPIP en n’installant qu’une seule fois son noyau fonctionnel.
C’est la méthode que nous utilisons sur cette même plateforme.
L’utilisation en mode ferme nécessite de connaïtre un peu le mécanisme de SPIP contrairement à la version standalone qui ne nécessite pas réellement de connaissances spécifique puisque l’espace privé habituel de SPIP n’est plus utilisé.
Dans un premier temps, vous devez avoir installé les mêmes fichiers que l’installation (...) -
Emballe médias : à quoi cela sert ?
4 février 2011, parCe plugin vise à gérer des sites de mise en ligne de documents de tous types.
Il crée des "médias", à savoir : un "média" est un article au sens SPIP créé automatiquement lors du téléversement d’un document qu’il soit audio, vidéo, image ou textuel ; un seul document ne peut être lié à un article dit "média" ;
Sur d’autres sites (2389)
-
avformat/hlsenc : refine EXT-X-BYTERANGE support for segments
19 septembre 2016, par Steven Liuavformat/hlsenc : refine EXT-X-BYTERANGE support for segments
refine EXT-X-BYTERANGE tag,
the spec link :
https://tools.ietf.org/html/draft-pantos-http-live-streaming-19#section-4.3.2.2
the apple doc :
https://developer.apple.com/library/ios/technotes/tn2288/_index.html#
//apple_ref/doc/uid/DTS40012238-CH1-BYTE_RANGE_SUPPORT_FOR_SEGMENTScommand line :
./ffmpeg -i /Movies/objectC/a.mp4 -c copy -f hls -hls_time 7
-hls_list_size 0 -hls_segment_size 2500000 -t 40 output-test.m3u8
output :
localhost:ffmpeg liuqi$ ll *.ts ;cat output-test.m3u8
-rw-r—r— 1 liuqi staff 2792176 9 12 14:44 output-test0.ts
-rw-r—r— 1 liuqi staff 3112528 9 12 14:44 output-test3.ts
-rw-r—r— 1 liuqi staff 3377420 9 12 14:44 output-test6.ts
-rw-r—r— 1 liuqi staff 1228016 9 12 14:44 output-test7.ts
#EXTM3U
#EXT-X-VERSION:4
#EXT-X-TARGETDURATION:10
#EXT-X-MEDIA-SEQUENCE:0
#EXTINF:9.021000,
#EXT-X-BYTERANGE:1334988@0
output-test0.ts
#EXTINF:3.000000,
#EXT-X-BYTERANGE:721356@1334988
output-test0.ts
#EXTINF:3.000000,
#EXT-X-BYTERANGE:735832@2056344
output-test0.ts
#EXTINF:6.000000,
#EXT-X-BYTERANGE:1645940@0
output-test3.ts
#EXTINF:3.000000,
#EXT-X-BYTERANGE:715152@1645940
output-test3.ts
#EXTINF:3.000000,
#EXT-X-BYTERANGE:751436@2361092
output-test3.ts
#EXTINF:9.000000,
#EXT-X-BYTERANGE:3377420@0
output-test6.ts
#EXTINF:3.960000,
#EXT-X-BYTERANGE:1228016@0
output-test7.ts
#EXT-X-ENDLIST
localhost:ffmpeg liuqi$ticket-id : #5839
Signed-off-by : Steven Liu <lingjiujianke@gmail.com>
Signed-off-by : Michael Niedermayer <michael@niedermayer.cc> -
Decoding mp4/mkv using FFMPEG fails
14 octobre 2016, par StarShineI’m using a project based on the latest FFmpeg git source tree, and linking to the shared DLL’s published by Zeranoe at https://ffmpeg.zeranoe.com/builds/
The playback code works and loops. It plays back h265 files (raw), mpeg, avi, and mpg files. However as soon as an mp4 or mkv container is specified as input file, regardless of what’s inside,a lot of errors are dumped from the codec. It doesn’t matter if it’s HEVC or h264.
[h264 @ 00000000xyz] No start code is found
[h264 @ 00000000xyz] Error splitting the input into NAL units.To make everything really strange, ffplay.exe plays these files just fine.
I realize that I can probably fix this by converting files into a raw format first, but I would like to be able to read and parse mp4 files a they are. Since I am using the pre-build libs of Zeraneo, my guess would be that something was not enabled during the build, but then I would expect ffplay to fail too. Do I need to set a flag in the format_context or codec_context, or provide some sort of filter identifier ?
Movies that play fine came from http://bbb3d.renderfarming.net/download.html, http://www.w6rz.net/ and http://www.sample-videos.com/
These work :
big_buck_bunny_480p_surround-fix.avi
bigbuckbunny_480x272.h265Being a total noob at ffmpeg, please help me understand what is wrong and how to fix it. If the pre-build libs are the culprit, then the second question is if someone has a convenient cmake setup to build this for windows X64 and x32 debug and release targets.
Here’s the source for initializing ffmpeg for reading
avdevice_register_all();
avfilter_register_all();
av_register_all();
avformat_network_init();The format is parsed as follows :
m_FormatContext = avformat_alloc_context();
if (avformat_open_input(&m_FormatContext, file.GetPath().ToString().c_str(), NULL, NULL) != 0)
{
//std::cout << "failed to open input" << std::endl;
success = false;
}
// find stream info
if (success)
{
if (avformat_find_stream_info(m_FormatContext, NULL) < 0)
{
//std::cout << "failed to get stream info" << std::endl;
success = false;
}
}The stream is opened as follows :
m_VideoStream = avstream;
m_FormatContext = formatContext;
if (m_VideoStream)
{
m_StreamIndex = m_VideoStream->stream_identifier;
AVCodecParameters *codecpar = m_VideoStream->codecpar;
if (codecpar)
{
AVCodecID codec_id = codecpar->codec_id;
m_Decoder = avcodec_find_decoder(codec_id);
if (m_Decoder)
{
m_CodecContext = avcodec_alloc_context3(m_Decoder);
if (m_CodecContext)
{
m_CodecContext->width = codecpar->width;
m_CodecContext->height = codecpar->height;
m_VideoSize = i3(codecpar->width, codecpar->height,1);
success = 0 == avcodec_open2(m_CodecContext, m_Decoder, NULL);
if (success)
{
if(m_CodecContext)
{
int size = av_image_get_buffer_size(format, m_CodecContext->width, m_CodecContext->height, 1);
if (size > 0)
{
av_frame = av_frame_alloc();
gl_frame = av_frame_alloc();
uint8_t *internal_buffer = (uint8_t *)av_malloc(size * sizeof(uint8_t));
av_image_fill_arrays((uint8_t**)((AVPicture *)gl_frame->data), (int*) ((AVPicture *)gl_frame->linesize), internal_buffer, format, m_CodecContext->width, m_CodecContext->height,1);
m_Packet = (AVPacket *)av_malloc(sizeof(AVPacket));
}
}
}
if (!success)
{
avcodec_close(m_CodecContext);
avcodec_free_context(&m_CodecContext);
m_CodecContext = NULL;
m_Decoder = NULL;
m_VideoStream = NULL;
}
}
else
{
m_Decoder = NULL;
m_VideoStream = NULL;
}
}
}
}And dedoding on a single thread :
do
{
if (av_read_frame(m_FormatContext, m_Packet) < 0)
{
av_packet_unref(m_Packet);
m_AllPacketsSent = true;
}
else
{
if (m_Packet->stream_index == m_StreamIndex)
{
avcodec_send_packet(m_CodecContext, m_Packet);
}
}
int frame_finished = avcodec_receive_frame(m_CodecContext, av_frame);
if (frame_finished == 0)
{
if (!conv_ctx)
{
conv_ctx = sws_getContext(m_CodecContext->width,
m_CodecContext->height, m_CodecContext->pix_fmt,
m_CodecContext->width, m_CodecContext->height, format, SWS_BICUBIC, NULL, NULL, NULL);
}
sws_scale(conv_ctx, av_frame->data, av_frame->linesize, 0, m_CodecContext->height, gl_frame->data, gl_frame->linesize);
switch(format)
{
case AV_PIX_FMT_BGR32_1:
case AV_PIX_FMT_RGB32_1:
case AV_PIX_FMT_0BGR32:
case AV_PIX_FMT_0RGB32:
case AV_PIX_FMT_BGR32:
case AV_PIX_FMT_RGB32:
{
m_CodecContext->bits_per_raw_sample = 32; break;
}
default:
{
FWASSERT(format == AV_PIX_FMT_RGB32, "The format changed, update the bits per raw sample!"); break;
}
}
size_t bufferSize = m_CodecContext->width * m_CodecContext->height * m_CodecContext->bits_per_raw_sample / 8;
m_Buffer.Realloc(bufferSize, false, gl_frame->data[0]);
m_VideoSize = i3(m_CodecContext->width, m_CodecContext->height,1);
result = true;
// sends the image buffer straight to the locked texture here..
// glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, codec_ctx->width, codec_ctx->height, GL_RGB, GL_UNSIGNED_BYTE, gl_frame->data[0]);
}
av_packet_unref(m_Packet);
} while (m_Packet->stream_index != m_StreamIndex);
m_FrameDecoded = result;Any insight is appreciated !
-
avformat/hlsenc : support mkdir_p for use_localtime_mkdir
28 septembre 2016, par Steven Liuavformat/hlsenc : support mkdir_p for use_localtime_mkdir
when use use_localtime_mkdir to create multi level dir,
ffmpeg give error message :
ffmpeg -re -i /Movies/objectC/facebook.mp4 -c copy -use_localtime 1
-use_localtime_mkdir 1 -hls_segment_filename ’%Y%m%d/file-%Y%m%d/%s.ts’
out.m3u8
error message :
Could not create directory 20160926/file-20160926 with use_localtime_mkdir
add mkdir_p for support the multi level dirReviewed-by : Michael Niedermayer <michael@niedermayer.cc>
Tested-by : Zuo Genyu <1515161258@qq.com> (Windows)
Signed-off-by : Steven Liu <lingjiujianke@gmail.com>