
Recherche avancée
Médias (2)
-
Valkaama DVD Label
4 octobre 2011, par
Mis à jour : Février 2013
Langue : English
Type : Image
-
Podcasting Legal guide
16 mai 2011, par
Mis à jour : Mai 2011
Langue : English
Type : Texte
Autres articles (69)
-
Mise à jour de la version 0.1 vers 0.2
24 juin 2013, parExplications des différents changements notables lors du passage de la version 0.1 de MediaSPIP à la version 0.3. Quelles sont les nouveautés
Au niveau des dépendances logicielles Utilisation des dernières versions de FFMpeg (>= v1.2.1) ; Installation des dépendances pour Smush ; Installation de MediaInfo et FFprobe pour la récupération des métadonnées ; On n’utilise plus ffmpeg2theora ; On n’installe plus flvtool2 au profit de flvtool++ ; On n’installe plus ffmpeg-php qui n’est plus maintenu au (...) -
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 ;
-
Les autorisations surchargées par les plugins
27 avril 2010, parMediaspip core
autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs
Sur d’autres sites (11763)
-
avcodec/bsf : Don't set defaults for AVClass without options
17 mars 2020, par Andreas Rheinhardt -
avcodec/avcodec, avpacket : Return blank packet on av_packet_ref() failure
27 mars 2020, par Andreas Rheinhardtavcodec/avcodec, avpacket : Return blank packet on av_packet_ref() failure
Up until now, it was completely unspecified what the content of the
destination packet dst was on error. Depending upon where the error
happened calling av_packet_unref() on dst might be dangerous.This commit changes this by making sure that dst is blank on error, so
unreferencing it again is safe (and still pointless). This behaviour is
documented.Signed-off-by : Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
-
Muxing raw h264 + aac into mp4 file with av_interleaved_write_frame() returning 0 but the video is not playable
3 avril 2020, par Jaw109I have a program [1] that muxing audio and video into mp4 file(in idividual worker thread, retrieving audio/video frame from a streaming daemon). The audio is perfectly played in VLC, but the video is not playable, VLC debug logs show the start-code of video frame is not found.



I have another demuxing program [2] to retrieve all the frame to see what had happened. I found the video frame is modified



00000001 674D0029... was modified into 00000019 674D0029... (framesize is 29)
00000001 68EE3C80... was modified into 00000004 68EE3C80... (framesize is 8)
00000001 65888010... was modified into 0002D56F 65888010... (framesize is 185715)
00000001 619A0101... was modified into 00003E1E 619A0101... (framesize is 15906)
00000001 619A0202... was modified into 00003E3C 619A0202... (framesize is 15936)
00000001 619A0303... was modified into 00003E1E 619A0303... (framesize is 15581)




It seems like the h264 start-code was replaced with something like... frame-size. but why ? Is there anything I did wrongly ? (Any idea ? something flags ? AVPacket initialization ? AVPacket's data copy wrongly ?)



[1] muxing program



int go_on = 1;
std::mutex g_mutex;
AVStream* g_AudioStream = NULL;
AVStream* g_VideoStream = NULL;

int polling_ringbuffer(int stream_type);

int main(int argc, char** argv)
{

 AVFormatContext* pFmtCntx = avformat_alloc_context();
 avio_open(&pFmtCntx->pb, argv[1], AVIO_FLAG_WRITE);
 pFmtCntx->oformat = av_guess_format(NULL, argv[1], NULL);
 g_AudioStream = avformat_new_stream( pFmtCntx, NULL );
 g_VideoStream = avformat_new_stream( pFmtCntx, NULL );
 initAudioStream(g_AudioStream->codecpar);
 initVideoStream(g_VideoStream->codecpar);
 avformat_write_header(pFmtCntx, NULL);

 std::thread audio(polling_ringbuffer, AUDIO_RINGBUFFER);
 std::thread video(polling_ringbuffer, VIDEO_RINGBUFFER);

 audio.join();
 video.join();

 av_write_trailer(pFmtCntx);
 if ( pFmtCntx->oformat && !( pFmtCntx->oformat->flags & AVFMT_NOFILE ) && pFmtCntx->pb )
 avio_close( pFmtCntx->pb );
 avformat_free_context( g_FmtCntx );

 return 0;
}

int polling_ringbuffer(int stream_type)
{
 uint8_t* data = new uint8_t[1024*1024];
 int64_t timestamp = 0;
 int data_len = 0;
 while(go_on)
 {
 const std::lock_guard lock(g_mutex);
 data_len = ReadRingbuffer(stream_type, data, 1024*1024, &timestamp);

 AVPacket pkt = {0};
 av_init_packet(&pkt);
 pkt.data = data;
 pkt.size = data_len;

 static AVRational r = {1,1000};
 switch(stream_type)
 {
 case STREAMTYPE_AUDIO:
 pkt.stream_index = g_AudioStream->index;
 pkt.flags = 0;
 pkt.pts = av_rescale_q(timestamp, r, g_AudioStream->time_base);
 break;
 case STREAMTYPE_VIDEO:
 pkt.stream_index = g_VIDEOStream->index;
 pkt.flags = isKeyFrame(data, data_len)?AV_PKT_FLAG_KEY:0;
 pkt.pts = av_rescale_q(timestamp, r, g_VideoStream->time_base);
 break;
 }
 static int64_t lastPTS = 0;
 pkt.dts = pkt.pts;
 pkt.duration = (lastPTS==0)? 0 : (pkt.pts-lastPTS);
 lastPTS = pkt.pts;

 int ret = av_interleaved_write_frame(g_FmtCntx, &pkt);
 if(0!=ret)
 printf("[%s:%d] av_interleaved_write_frame():%d\n", __FILE__, __LINE__, ret);
 }

 return 0;
}




[2] demuxing program



int main(int argc, char** argv)
{
 AVFormatContext* pFormatCtx = avformat_alloc_context();
 AVPacket pkt;
 av_init_packet(&pkt);
 avformat_open_input(&pFormatCtx, argv[1], NULL, NULL);
 for(;;)
 {
 if (av_read_frame(pFormatCtx, &pkt) >= 0)
 {
 printf("[%d] %s (len:%d)\n", pkt.stream_index, BinToHex(pkt.data, MIN(64, pkt.size)), pkt.size );
 }
 else
 break;
 }

 avformat_close_input(&pFormatCtx);
 return 0;
}




[3] Here are my environment



Linux MY-RASP-4 4.14.98 #1 SMP Mon Jun 24 12:34:42 UTC 2019 armv7l GNU/Linux
ffmpeg version 4.1 Copyright (c) 2000-2018 the FFmpeg developers
built with gcc 8.2.0 (GCC)

libavutil 56. 22.100 / 56. 22.100
libavcodec 58. 35.100 / 58. 35.100
libavformat 58. 20.100 / 58. 20.100
libavdevice 58. 5.100 / 58. 5.100
libavfilter 7. 40.101 / 7. 40.101
libswscale 5. 3.100 / 5. 3.100
libswresample 3. 3.100 / 3. 3.100
libpostproc 55. 3.100 / 55. 3.100