From marco.gulino at gmail.com Tue Oct 1 11:25:58 2013 From: marco.gulino at gmail.com (Marco Gulino) Date: Tue, 1 Oct 2013 11:25:58 +0200 Subject: [Libav-user] decoding speed on large files Message-ID: Hello I'm noticing a huge difference in decoding speed with my own code, and with ffmpeg command line tool, especially with large (> 2GB) files. This is my current test code: http://pastebin.com/WbJwAKFx Just looping over the packets, without even reading them, takes 120 seconds. When I run "ffmpeg -i mylargefile.mp4 /tmp/extractedSubtitle.srt", it takes no more than 10 seconds. Of course, I dropped linux kernel caches first, to force the same file reading speed. I tried looking at ffmpeg.c, but I didn't notice anything in particular. Thanks Marco -------------- next part -------------- An HTML attachment was scrubbed... URL: From soho123.2012 at gmail.com Tue Oct 1 14:38:54 2013 From: soho123.2012 at gmail.com (Huang Soho) Date: Tue, 1 Oct 2013 20:38:54 +0800 Subject: [Libav-user] ffserver+ffmpeg how to inform VLC player the frame rate is decrease? Message-ID: Hi All, I got a big problem when I use VLC 2.1.0-rc2 to play live H.264 stream that is output by ffserver. the stream format is rtp. it includes Audio+ video. One rtp stream is for Audio and another is for Video. The payload type is 96 for Video, and 97 for Audio. Video format: H.264, 1280x720, 30fps. Audio format: PCM_S16_LE, 2 channel, 48000 sample rate. I see the error when VLC debug message is enabled. "avcodec error: more than 5 seconds of late video -> dropping frame (computer too slow ?)" then the video stream is freeze. Because the frame rate is decrease if the light is dark when ffmpeg capture video data . Then the frame gap is larger than the first 10 minutes. VLC does not know frame rate is decrease. VLC just know rtp timestamp has larger gap in the afterward packets. Is there any method to inform VLC the timestamp will get more larger gap? -------------- next part -------------- An HTML attachment was scrubbed... URL: From nhanndt_87 at yahoo.com Wed Oct 2 05:07:21 2013 From: nhanndt_87 at yahoo.com (thanh nhan thanh nhan) Date: Tue, 1 Oct 2013 20:07:21 -0700 (PDT) Subject: [Libav-user] Runtime error with ffmpeg libs in win64 release mode In-Reply-To: <300731380521338@web16m.yandex.ru> References: <1380514575.44618.YahooMailNeo@web121701.mail.ne1.yahoo.com> <300731380521338@web16m.yandex.ru> Message-ID: <1380683241.79989.YahooMailNeo@web121705.mail.ne1.yahoo.com> It has been solved. Thank you very much ????????? ! >________________________________ > From: ????????? >To: "This list is about using libavcodec, libavformat, libavutil, libavdevice and libavfilter." >Sent: Monday, September 30, 2013 3:08 PM >Subject: Re: [Libav-user] Runtime error with ffmpeg libs in win64 release mode > > > >Try: >your application-> Properties->Linker->Optimization->References >?and then select OPT/NOREF > > >? > >_______________________________________________ >Libav-user mailing list >Libav-user at ffmpeg.org >http://ffmpeg.org/mailman/listinfo/libav-user > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From p3070011 at dias.aueb.gr Thu Oct 3 13:34:55 2013 From: p3070011 at dias.aueb.gr (Vitsas Nikolaos) Date: Thu, 03 Oct 2013 14:34:55 +0300 Subject: [Libav-user] SDP RTP using Custom I/O Message-ID: Hi guys. I'm currently encoding a H264 stream into RTP packets using libavformat and storing them in memory using avio_open_dyn and avio_close_dyn. The thing is that those packets are going to reach a destination going through some intermediate peers using a custom P2P structure. Everything reaches the destination correctly and as expected, but I can' t get the custom I/O setup on the destination to work correctly so that the packets can be decoded. Here' s what I am doing right now. sdp_desc holds the SDP description and custom_queue is a queue full of RTP Packets as encoded by the source. // C O D E fmt_ctx = avformat_alloc_context(); if(!fmt_ctx) { return false; } io_buffer = (BYTE*)av_malloc((IO_BUFFER_SIZE+FF_INPUT_BUFFER_PADDING_SIZE)*sizeof(BYTE)); BYTE* sdp_buffer = (BYTE*)av_malloc((strlen(sdp_desc)+FF_INPUT_BUFFER_PADDING_SIZE)*sizeof(BYTE)); sdp_io_context = avio_alloc_context(sdp_buffer, strlen(sdp_desc), 0, nfo, &ReadFunc, NULL, NULL); avio_open2(&sdp_io_context, "", AVIO_FLAG_READ, NULL, NULL); if(!sdp_io_context) return false; sdp_io_context->seekable = 0; sdp_io_context->write_flag = 0; strcpy((char*)sdp_buffer, sdp_desc); AVProbeData probeData; probeData.buf = sdp_buffer; probeData.buf_size = strlen(sdp_desc); probeData.filename = ""; fmt_ctx->pb = sdp_io_context; fmt_ctx->flags = AVFMT_FLAG_CUSTOM_IO; fmt_ctx->iformat = av_probe_input_format(&probeData, 1); AVDictionary *options = NULL; av_dict_set(&options, "sdpflags", "custom_io", 0); int err = avformat_open_input(&fmt_ctx, "", NULL, &options); //int err = avformat_open_input(&fmt_ctx, "", fmt_ctx->iformat, &options); io_context = avio_alloc_context(io_buffer, IO_BUFFER_SIZE, 1, custom_queue, &ReadRTPFunc, &WriteRTPFunc, NULL); avio_open2(&io_context, "", AVIO_FLAG_READ_WRITE, NULL, NULL); if(!io_context) return false; io_context->seekable = 0; AVInputFormat* fr = av_find_input_format("rtp"); fmt_ctx->pb = io_context; fmt_ctx->iformat = fr; video_dec_ctx = fmt_ctx->streams[0]->codec; video_dec = avcodec_find_decoder(video_dec_ctx->codec_id); if (!video_dec) { printf("Failed to find %s codec\n", "H264"); return false; } if ((ret = avcodec_open2(video_dec_ctx, video_dec, NULL)) < 0) { printf("Failed to open %s codec\n", "H264"); return false; } thre ReadFunc looks like this static int ReadFunc(void *opaque, uint8_t *buf, int buf_size) { char* sdp = (char*)opaque; strcpy((char*)buf, sdp); return strlen(sdp); } ReadFunc is called and the AVInputFormat in the AvFormatContext correctly gets initialized to SDP and the codec is correctly set to H264. However, ReadFunc is called again requesting more data and the only thing I can do, is return 0 or the same sdp data. Despite the above, av_open_input returns with no error but when I make the switch to the RTP AVIOContext, av_read_frame does not do anything and just returns after a while not calling any of my other callbacks. Any help would be appreciated. Thank you. From safiuddinkhan at gmail.com Thu Oct 3 21:07:03 2013 From: safiuddinkhan at gmail.com (Safi) Date: Fri, 04 Oct 2013 00:07:03 +0500 Subject: [Libav-user] High consumption while seeking Message-ID: <524DC057.9020106@gmail.com> hello i am building a media player for my project . almost everything is working fine and i am able to read and sync files correctly for playblack . the problem i am having is that after i do seeking "avcodec_decode_video2" consumes allot of cpu time after it process initial packets received after seeking ..... the problem was much worse before but i wrote a small code which dumps all frames after seeking until keyframe is reached even though the problem has some what gone better but i am still experiencing high cpu consumption by "avcodec_decode_video2" .................... what i could understand from all of this is that it has something to do with GOP and intra frames but i don't have much knowledge since i am a beginner . if someone is able to guide me what should i do i will be very much thankful here is my code for seeking if(sc->seek == 1){ sc->status = MP_SEEKING; sc->pausetoggle = 1; /// Pausing both video playback and audio playback threads ... when video and audio playback threads go to pause , demux thread also automatically goes to pause while(true){ // waiting for both video and audio playback threads to pause usleep(300); if(sc->videostream == -1){ if(sc->audiopause == 1) break; }else if(sc->audiostream == -1){ if(sc->videopause == 1) break; }else{ if(sc->audiopause == 1 && sc->videopause == 1) break; } } vtimestamp = (sc->videopts + sc->seektime) * AV_TIME_BASE; int flag; //if(sc->seektime > 0){ // flag = 0; //}else{ flag = AVSEEK_FLAG_BACKWARD; //} ret = av_seek_frame(sc->pFormatCtx, -1, vtimestamp , flag); if(ret < 0){ sc->status = MP_ERROR; } if(sc->videostream != -1) avcodec_flush_buffers(sc->videoctx); if(sc->audiostream != -1) avcodec_flush_buffers(sc->audioctx); empty_buffers(sc); // Empty Video and Audio Buffers //// Flushing all packets until we reach keyframe after seek point /////////////////////////////////////////////////////////////////// cout <<"----------------------------------"<seektime<pFormatCtx, &packet)<0) break; if(packet.stream_index==sc->videostream){ //////////// if(packet.pts == AV_NOPTS_VALUE){ videopts = videopts + (double)(packet.duration * sc->videobasetime); }else{ videopts = (double)(packet.pts * sc->videobasetime); } //////////// videokeyframe = packet.flags; cout <<"-- video pts:"<videobasetime)<<" - Size:"<videolock); sc->videobuffer.push(packet); pthread_mutex_unlock(&sc->videolock); }else{ av_free_packet(&packet); } }else if(packet.stream_index==sc->audiostream){ //////////// if(packet.pts == AV_NOPTS_VALUE) audiopts = audiopts + (double)(packet.duration * sc->audiobasetime); else audiopts = (double)(packet.pts * sc->audiobasetime); //////////// audiokeyframe = packet.flags; cout <<"-- audio pts:"<audiobasetime)<videostream == -1){ if(audiokeyframe == AV_PKT_FLAG_KEY){ ak = 1; firstpts = audiopts; } }else{ if(audiokeyframe == AV_PKT_FLAG_KEY && vk == 1){ ak = 1; firstpts = audiopts; } } if(ak == 1){ pthread_mutex_lock(&sc->audiolock); sc->audiobuffer.push(packet); pthread_mutex_unlock(&sc->audiolock); }else{ av_free_packet(&packet); } }else{ av_free_packet(&packet); } if(sc->videostream == -1){ if(ak == 1) break; }else if(sc->audiostream == -1){ if(vk == 1) break; }else{ if(vk == 1 && ak == 1) break; } } vk = 0; ak = 0; /////////////////////////////////////////////////////////////////// sc->masterclock->settime(firstpts); sc->masterclock->reset(); sc->seek = 0; sc->pausetoggle = 0; pthread_mutex_lock(&sc->pauselock); pthread_cond_broadcast(&sc->pausecond); pthread_mutex_unlock(&sc->pauselock); here is the video decoding function nt mediaplayer::getdecodedvideoframe(stream_context *sc,AVFrame *vidframe){ int vidframefinished; AVPacket packet; while(true){ if(sc->videobuffer.size() == 0) while(sc->videobuffer.size() < 20){ if(sc->pausetoggle == 1) return -2; if(sc->endthread == 1){ cout <<" Video Decoding Ended..."<demuxlock); pthread_cond_broadcast(&sc->demuxcond); pthread_mutex_unlock(&sc->demuxlock); } pthread_mutex_lock(&sc->videolock); packet = sc->videobuffer.front(); sc->videobuffer.pop(); pthread_mutex_unlock(&sc->videolock); if(avcodec_decode_video2(sc->videoctx, vidframe, &vidframefinished,&packet) < 0) break; av_free_packet(&packet); if(vidframefinished){ return 0; } } av_free_packet(&packet); return -3; } From bakhtiyarov.dima at gmail.com Thu Oct 3 22:16:31 2013 From: bakhtiyarov.dima at gmail.com (=?UTF-8?B?0JTQvNC40YLRgNC40Lkg0JHQsNGF0YLQuNGP0YDQvtCy?=) Date: Fri, 4 Oct 2013 00:16:31 +0400 Subject: [Libav-user] Very slow H264 stream decoding Message-ID: Hi, all! I'm developing network application, which can play H264 video from RTSP stream. I use live555 for RTSP/RTP processing, libx264 for encoding and ffmpeg for decoding. My problem is in the decoder working - I have video stream with 12-15 fps, but avcodec_decode_video2 set got_image into not-null value very rarely - average 1 time per second or less. In a GUI its looks like very long freezes of interface, when one frame drawing on widgets few seconds. When I connect to server using vlc all work correct - I have video with 12-15 fps. I have a such code for decoding: AVCodec* m_decoder; AVCodecContext* m_decoderContext; AVFrame* m_picture; AVPacket m_packet; //initialisation of decoder { avcodec_register_all(); av_init_packet(&m_packet); m_decoder = avcodec_find_decoder(CODEC_ID_H264); if (!m_decoder) { QString str = QString("Can't find H264 decoder!"); emit criticalError(str); } m_decoderContext = avcodec_alloc_context3(m_decoder); m_decoderContext->flags |= CODEC_FLAG_TRUNCATED; m_decoderContext->flags |= CODEC_FLAG_LOW_DELAY; //we can receive truncated frames m_decoderContext->flags2 |= CODEC_FLAG2_CHUNKS; AVDictionary* dictionary = nullptr; if (avcodec_open2(m_decoderContext, m_decoder, &dictionary) < 0) { QString str = QString("Failed to open decoder!"); emit criticalError(str); } qDebug() << "H264 Decoder successfully opened"; m_picture = avcodec_alloc_frame(); } //decoding frame; Frame_t is equal to vector { Frame_t enc_frame; orig_frame >> enc_frame; m_packet.size = enc_frame.size(); m_packet.data = enc_frame.data(); qDebug() << "H264Decoder: received encoded frame with framesize " << enc_frame.size(); while(m_packet.size > 0) { int got_picture; int len = avcodec_decode_video2(m_decoderContext, m_picture, &got_picture, &m_packet); if (len < 0) { QString err("Decoding error"); qDebug() << err; return false; } if (got_picture) { qDebug() << "H264Decoder: frame decoded!"; //....... } } } On the server side I have this encoder settings: { m_params = new x264_param_t; if (x264_param_default_preset(m_params, "ultrafast", "zerolatency") != 0) qDebug() << "presetting default values for x264 parameters failed!"; m_params->i_width = m_out_width; m_params->i_height = m_out_height; m_params->i_threads = 2; m_params->i_fps_num = m_fps; //avg 12-15 m_params->i_fps_den = 1; m_params->i_keyint_max = 24; m_params->b_intra_refresh = 1; m_params->rc.i_rc_method = X264_RC_CRF; m_params->rc.f_rf_constant = 25; m_params->rc.f_rf_constant_max = 35; m_params->b_repeat_headers = 1; m_params->b_annexb = 1; x264_param_apply_profile(m_params, "baseline"); m_encoder = x264_encoder_open(m_params); if (m_encoder == nullptr) { qDebug() << "x264: encoder opening failed!"; abort(); } m_in_pic = new x264_picture_t; if (x264_picture_alloc( m_in_pic, X264_CSP_I420, 640, 480 ) != 0) qDebug() << "x264: Picture allocating failed!"; x264_encoder_parameters(m_encoder, m_params); m_out_pic = new x264_picture_t; x264_nal_t* headers; int pi_nal; if (x264_encoder_headers(m_encoder, &headers, &pi_nal) < 0) qDebug() << "Error creating NAL headers!"; } What is the reason of this delay and how I can fix it? -------------- next part -------------- An HTML attachment was scrubbed... URL: From safiuddinkhan at gmail.com Fri Oct 4 08:19:59 2013 From: safiuddinkhan at gmail.com (Safi) Date: Fri, 04 Oct 2013 11:19:59 +0500 Subject: [Libav-user] High cpu usage while seeking In-Reply-To: <524DC057.9020106@gmail.com> References: <524DC057.9020106@gmail.com> Message-ID: <524E5E0F.4080806@gmail.com> hello i am building a media player for my project . almost everything is working fine and i am able to read and sync files correctly for playback . the problem i am having is that after i do seeking "avcodec_decode_video2" consumes allot of cpu time after it process initial packets received after seeking ..... the problem was much worse before but i wrote a small code which dumps all frames after seeking until keyframe is reached even though the problem has some what gone better but i am still experiencing high cpu consumption by "avcodec_decode_video2" .................... what i could understand from all of this is that it has something to do with GOP and intra frames but i don't have much knowledge since i am a beginner . if someone is able to guide me what should i do i will be very much thankful here is my code for seeking if(sc->seek == 1){ sc->status = MP_SEEKING; sc->pausetoggle = 1; /// Pausing both video playback and audio playback threads ... when video and audio playback threads go to pause , demux thread also automatically goes to pause while(true){ // waiting for both video and audio playback threads to pause usleep(300); if(sc->videostream == -1){ if(sc->audiopause == 1) break; }else if(sc->audiostream == -1){ if(sc->videopause == 1) break; }else{ if(sc->audiopause == 1 && sc->videopause == 1) break; } } vtimestamp = (sc->videopts + sc->seektime) * AV_TIME_BASE; int flag; //if(sc->seektime > 0){ // flag = 0; //}else{ flag = AVSEEK_FLAG_BACKWARD; //} ret = av_seek_frame(sc->pFormatCtx, -1, vtimestamp , flag); if(ret < 0){ sc->status = MP_ERROR; } if(sc->videostream != -1) avcodec_flush_buffers(sc->videoctx); if(sc->audiostream != -1) avcodec_flush_buffers(sc->audioctx); empty_buffers(sc); // Empty Video and Audio Buffers //// Flushing all packets until we reach keyframe after seek point /////////////////////////////////////////////////////////////////// cout <<"----------------------------------"<seektime<pFormatCtx, &packet)<0) break; if(packet.stream_index==sc->videostream){ //////////// if(packet.pts == AV_NOPTS_VALUE){ videopts = videopts + (double)(packet.duration * sc->videobasetime); }else{ videopts = (double)(packet.pts * sc->videobasetime); } //////////// videokeyframe = packet.flags; cout <<"-- video pts:"<videobasetime)<<" - Size:"<videolock); sc->videobuffer.push(packet); pthread_mutex_unlock(&sc->videolock); }else{ av_free_packet(&packet); } }else if(packet.stream_index==sc->audiostream){ //////////// if(packet.pts == AV_NOPTS_VALUE) audiopts = audiopts + (double)(packet.duration * sc->audiobasetime); else audiopts = (double)(packet.pts * sc->audiobasetime); //////////// audiokeyframe = packet.flags; cout <<"-- audio pts:"<audiobasetime)<videostream == -1){ if(audiokeyframe == AV_PKT_FLAG_KEY){ ak = 1; firstpts = audiopts; } }else{ if(audiokeyframe == AV_PKT_FLAG_KEY && vk == 1){ ak = 1; firstpts = audiopts; } } if(ak == 1){ pthread_mutex_lock(&sc->audiolock); sc->audiobuffer.push(packet); pthread_mutex_unlock(&sc->audiolock); }else{ av_free_packet(&packet); } }else{ av_free_packet(&packet); } if(sc->videostream == -1){ if(ak == 1) break; }else if(sc->audiostream == -1){ if(vk == 1) break; }else{ if(vk == 1 && ak == 1) break; } } vk = 0; ak = 0; /////////////////////////////////////////////////////////////////// sc->masterclock->settime(firstpts); sc->masterclock->reset(); sc->seek = 0; sc->pausetoggle = 0; pthread_mutex_lock(&sc->pauselock); pthread_cond_broadcast(&sc->pausecond); pthread_mutex_unlock(&sc->pauselock); here is the video decoding function nt mediaplayer::getdecodedvideoframe(stream_context *sc,AVFrame *vidframe){ int vidframefinished; AVPacket packet; while(true){ if(sc->videobuffer.size() == 0) while(sc->videobuffer.size() < 20){ if(sc->pausetoggle == 1) return -2; if(sc->endthread == 1){ cout <<" Video Decoding Ended..."<demuxlock); pthread_cond_broadcast(&sc->demuxcond); pthread_mutex_unlock(&sc->demuxlock); } pthread_mutex_lock(&sc->videolock); packet = sc->videobuffer.front(); sc->videobuffer.pop(); pthread_mutex_unlock(&sc->videolock); if(avcodec_decode_video2(sc->videoctx, vidframe, &vidframefinished,&packet) < 0) break; av_free_packet(&packet); if(vidframefinished){ return 0; } } av_free_packet(&packet); return -3; } From ffmpeg at mxwendler.net Fri Oct 4 20:43:39 2013 From: ffmpeg at mxwendler.net (MXWendler LibAV) Date: Fri, 04 Oct 2013 20:43:39 +0200 Subject: [Libav-user] linesizes Message-ID: <524F0C5B.4030000@mxwendler.net> Hi All, i had a look at AVPicture, and it is a tiny structure typedef struct AVPicture { uint8_t *data[4]; int linesize[4]; ///< number of bytes per line } AVPicture; For further image processing i need the linesize, but passing the full struct is unhandy, since it will be passed through various api layers ( opengl .. opencl .. ). It would help very much in my case since a short calculation takes less resources than passing multiple parameters around. Is there a reliable way to derive the line size from eg. resolution and / or pixel format? Like eg. PIX_FMT_YUV420P has three line entries (ycbcr), and the Y stride is XX and the cb/cr stride is half of that? Thank you, Horst From bruce at spearmorgan.com Fri Oct 4 21:17:53 2013 From: bruce at spearmorgan.com (Bruce Wheaton) Date: Fri, 4 Oct 2013 12:17:53 -0700 Subject: [Libav-user] linesizes In-Reply-To: <524F0C5B.4030000@mxwendler.net> References: <524F0C5B.4030000@mxwendler.net> Message-ID: <979D61B4-A70B-412E-9B58-1935529C206E@spearmorgan.com> On Oct 4, 2013, at 11:43 AM, MXWendler LibAV wrote: > Is there a reliable way to derive the line size from eg. resolution and / or pixel format? Like eg. PIX_FMT_YUV420P has three line entries (ycbcr), and the Y stride is XX and the cb/cr stride is half of that? No, there isn't. You can reliably work out the minimum number of bytes for a given format, but you won't know how many padding bytes are on each line. There's commonly padding to make alignment to 32 or 64 bits, for instance. I tend to do copies line by line, then I get to a known linesize - I can predict my own line sizes. Bruce From stefasab at gmail.com Sat Oct 5 01:06:35 2013 From: stefasab at gmail.com (Stefano Sabatini) Date: Sat, 5 Oct 2013 01:06:35 +0200 Subject: [Libav-user] linesizes In-Reply-To: <524F0C5B.4030000@mxwendler.net> References: <524F0C5B.4030000@mxwendler.net> Message-ID: <20131004230635.GM14539@barisone> On date Friday 2013-10-04 20:43:39 +0200, MXWendler LibAV encoded: > > Hi All, > > i had a look at AVPicture, and it is a tiny structure > > typedef struct AVPicture { > uint8_t *data[4]; > int linesize[4]; ///< number of bytes per line > } AVPicture; > > For further image processing i need the linesize, but passing the > full struct is unhandy, since it will be passed through various api > layers ( opengl .. opencl .. ). It would help very much in my case > since a short calculation takes less resources than passing multiple > parameters around. > > Is there a reliable way to derive the line size from eg. resolution > and / or pixel format? Like eg. PIX_FMT_YUV420P has three line > entries (ycbcr), and the Y stride is XX and the cb/cr stride is half > of that? Of course there is, check av_image_fill_linesizes() in libavutil/imgutils.h for example. [...] From bakhtiyarov.dima at gmail.com Sat Oct 5 15:16:42 2013 From: bakhtiyarov.dima at gmail.com (Bakhtiyarov Dmitriy) Date: Sat, 5 Oct 2013 17:16:42 +0400 Subject: [Libav-user] Very slow H264 stream decoding In-Reply-To: References: Message-ID: Ok, I fix this delay. I change settings of encoder and set: m_params->i_keyint_max = 5; //At this interval of frames force setted IDR frame m_params->b_intra_refresh = 0; //use IDR frames instead periodic intra refresh Now it work correctly. Thanks for all. 2013/10/4 ??????? ????????? > Hi, all! > > I'm developing network application, which can play H264 video from RTSP > stream. I use live555 for RTSP/RTP processing, libx264 for encoding and > ffmpeg for decoding. > My problem is in the decoder working - I have video stream with 12-15 fps, > but avcodec_decode_video2 set got_image into not-null value very rarely - > average 1 time per second or less. In a GUI its looks like very long > freezes of interface, when one frame drawing on widgets few seconds. > When I connect to server using vlc all work correct - I have video with > 12-15 fps. > > I have a such code for decoding: > > AVCodec* m_decoder; > AVCodecContext* m_decoderContext; > AVFrame* m_picture; > AVPacket m_packet; > > //initialisation of decoder > { > avcodec_register_all(); > av_init_packet(&m_packet); > m_decoder = avcodec_find_decoder(CODEC_ID_H264); > if (!m_decoder) > { > QString str = QString("Can't find H264 decoder!"); > emit criticalError(str); > } > m_decoderContext = avcodec_alloc_context3(m_decoder); > > m_decoderContext->flags |= CODEC_FLAG_TRUNCATED; > > m_decoderContext->flags |= CODEC_FLAG_LOW_DELAY; > //we can receive truncated frames > m_decoderContext->flags2 |= CODEC_FLAG2_CHUNKS; > > AVDictionary* dictionary = nullptr; > if (avcodec_open2(m_decoderContext, m_decoder, &dictionary) < 0) > { > QString str = QString("Failed to open decoder!"); > emit criticalError(str); > } > qDebug() << "H264 Decoder successfully opened"; > m_picture = avcodec_alloc_frame(); > } > > > > //decoding frame; Frame_t is equal to vector > { > Frame_t enc_frame; > orig_frame >> enc_frame; > m_packet.size = enc_frame.size(); > m_packet.data = enc_frame.data(); > > qDebug() << "H264Decoder: received encoded frame with framesize " << > enc_frame.size(); > > while(m_packet.size > 0) > { > int got_picture; > int len = avcodec_decode_video2(m_decoderContext, m_picture, > &got_picture, &m_packet); > if (len < 0) > { > QString err("Decoding error"); > qDebug() << err; > return false; > } > if (got_picture) > { > qDebug() << "H264Decoder: frame decoded!"; > //....... > } > } > } > > On the server side I have this encoder settings: > { > m_params = new x264_param_t; > if (x264_param_default_preset(m_params, "ultrafast", "zerolatency") != > 0) > qDebug() << "presetting default values for x264 parameters > failed!"; > > m_params->i_width = m_out_width; > m_params->i_height = m_out_height; > m_params->i_threads = 2; > m_params->i_fps_num = m_fps; //avg 12-15 > m_params->i_fps_den = 1; > > m_params->i_keyint_max = 24; > m_params->b_intra_refresh = 1; > > m_params->rc.i_rc_method = X264_RC_CRF; > m_params->rc.f_rf_constant = 25; > m_params->rc.f_rf_constant_max = 35; > > m_params->b_repeat_headers = 1; > m_params->b_annexb = 1; > x264_param_apply_profile(m_params, "baseline"); > > m_encoder = x264_encoder_open(m_params); > if (m_encoder == nullptr) > { > qDebug() << "x264: encoder opening failed!"; > abort(); > } > m_in_pic = new x264_picture_t; > > if (x264_picture_alloc( m_in_pic, X264_CSP_I420, 640, 480 ) != 0) > qDebug() << "x264: Picture allocating failed!"; > > x264_encoder_parameters(m_encoder, m_params); > > m_out_pic = new x264_picture_t; > > x264_nal_t* headers; > int pi_nal; > if (x264_encoder_headers(m_encoder, &headers, &pi_nal) < 0) > qDebug() << "Error creating NAL headers!"; > } > > > What is the reason of this delay and how I can fix it? > -------------- next part -------------- An HTML attachment was scrubbed... URL: From p.tushar99 at gmail.com Sun Oct 6 06:52:46 2013 From: p.tushar99 at gmail.com (Tushar) Date: Sun, 6 Oct 2013 10:22:46 +0530 Subject: [Libav-user] Vp9 update Message-ID: <5250ecc4.230f430a.26dc.7a5d@mx.google.com> Hi, is there any update of vp9, in ffmpeg. Regards Tushar Paithankar -------------- next part -------------- An HTML attachment was scrubbed... URL: From onemda at gmail.com Sun Oct 6 14:08:58 2013 From: onemda at gmail.com (Paul B Mahol) Date: Sun, 6 Oct 2013 12:08:58 +0000 Subject: [Libav-user] Vp9 update In-Reply-To: <5250ecc4.230f430a.26dc.7a5d@mx.google.com> References: <5250ecc4.230f430a.26dc.7a5d@mx.google.com> Message-ID: On 10/6/13, Tushar wrote: > Hi, > > is there any update of vp9, in ffmpeg. What kind of update? From p.tushar99 at gmail.com Sun Oct 6 16:43:53 2013 From: p.tushar99 at gmail.com (Tushar) Date: Sun, 6 Oct 2013 20:13:53 +0530 Subject: [Libav-user] Vp9 update Message-ID: <52517755.a804440a.4468.ffffae17@mx.google.com> Ffmpeg has included vp9 codecs....? Regards Tushar Paithankar -----Original Message----- From: "Paul B Mahol" Sent: ?06-?10-?2013 17:39 To: "This list is about using libavcodec, libavformat, libavutil, libavdevice and libavfilter." Subject: Re: [Libav-user] Vp9 update On 10/6/13, Tushar wrote: > Hi, > > is there any update of vp9, in ffmpeg. What kind of update? _______________________________________________ Libav-user mailing list Libav-user at ffmpeg.org http://ffmpeg.org/mailman/listinfo/libav-user -------------- next part -------------- An HTML attachment was scrubbed... URL: From onemda at gmail.com Sun Oct 6 16:54:27 2013 From: onemda at gmail.com (Paul B Mahol) Date: Sun, 6 Oct 2013 14:54:27 +0000 Subject: [Libav-user] Vp9 update In-Reply-To: <52517755.a804440a.4468.ffffae17@mx.google.com> References: <52517755.a804440a.4468.ffffae17@mx.google.com> Message-ID: On 10/6/13, Tushar wrote: > Ffmpeg has included vp9 codecs....? Since long ago it is available via libvpx. Recently vp9 native decoder got into master. All this is mentioned in Changelog. From p3070011 at dias.aueb.gr Sun Oct 6 18:42:32 2013 From: p3070011 at dias.aueb.gr (Vitsas Nikolaos) Date: Sun, 06 Oct 2013 19:42:32 +0300 Subject: [Libav-user] SDP RTP using Custom I/O In-Reply-To: References: Message-ID: On Thu, 03 Oct 2013 14:34:55 +0300 "Vitsas Nikolaos" wrote: > Hi guys. > > I'm currently encoding a H264 stream into RTP packets using >libavformat and storing them in memory using avio_open_dyn and >avio_close_dyn. The thing is that those packets are going to reach a >destination going through some intermediate peers using a custom P2P >structure. Everything reaches the destination correctly and as >expected, but I can' t get the custom I/O setup on the destination to >work correctly so that the packets can be decoded. > > Here' s what I am doing right now. sdp_desc holds the SDP >description and custom_queue is a queue full of RTP Packets as >encoded by the source. > > // C O D E > fmt_ctx = avformat_alloc_context(); > if(!fmt_ctx) { > return false; > } > > io_buffer = >(BYTE*)av_malloc((IO_BUFFER_SIZE+FF_INPUT_BUFFER_PADDING_SIZE)*sizeof(BYTE)); > BYTE* sdp_buffer = >(BYTE*)av_malloc((strlen(sdp_desc)+FF_INPUT_BUFFER_PADDING_SIZE)*sizeof(BYTE)); > > sdp_io_context = avio_alloc_context(sdp_buffer, strlen(sdp_desc), 0, >nfo, &ReadFunc, NULL, NULL); > avio_open2(&sdp_io_context, "", AVIO_FLAG_READ, NULL, NULL); > > if(!sdp_io_context) > return false; > > sdp_io_context->seekable = 0; > sdp_io_context->write_flag = 0; > > strcpy((char*)sdp_buffer, sdp_desc); > AVProbeData probeData; > probeData.buf = sdp_buffer; > probeData.buf_size = strlen(sdp_desc); > probeData.filename = ""; > > fmt_ctx->pb = sdp_io_context; > fmt_ctx->flags = AVFMT_FLAG_CUSTOM_IO; > fmt_ctx->iformat = av_probe_input_format(&probeData, 1); > > AVDictionary *options = NULL; > av_dict_set(&options, "sdpflags", "custom_io", 0); > int err = avformat_open_input(&fmt_ctx, "", NULL, &options); > //int err = avformat_open_input(&fmt_ctx, "", fmt_ctx->iformat, >&options); > > io_context = avio_alloc_context(io_buffer, IO_BUFFER_SIZE, 1, >custom_queue, &ReadRTPFunc, &WriteRTPFunc, NULL); > avio_open2(&io_context, "", AVIO_FLAG_READ_WRITE, NULL, NULL); > if(!io_context) > return false; > io_context->seekable = 0; > > AVInputFormat* fr = av_find_input_format("rtp"); > > fmt_ctx->pb = io_context; > fmt_ctx->iformat = fr; > video_dec_ctx = fmt_ctx->streams[0]->codec; > video_dec = avcodec_find_decoder(video_dec_ctx->codec_id); > if (!video_dec) { > printf("Failed to find %s codec\n", > "H264"); > return false; > } > > if ((ret = avcodec_open2(video_dec_ctx, video_dec, NULL)) < 0) { > printf("Failed to open %s codec\n", > "H264"); > return false; > } > > thre ReadFunc looks like this > static int ReadFunc(void *opaque, uint8_t *buf, int buf_size) { > char* sdp = (char*)opaque; > > strcpy((char*)buf, sdp); > > return strlen(sdp); > } > > ReadFunc is called and the AVInputFormat in the AvFormatContext >correctly gets initialized to SDP and the codec is correctly set to >H264. However, ReadFunc is called again requesting more data and the >only thing I can do, is return 0 or the same sdp data. Despite the >above, av_open_input returns with no error but when I make the switch >to the RTP AVIOContext, av_read_frame does not do anything and just >returns after a while not calling any of my other callbacks. > > Any help would be appreciated. Thank you. > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user To make things simpler, can someone at least verify that setting sdpflags=customio is enough for Custom RTP handling? Is there something else I need to do? From satyagowtham.k at gmail.com Mon Oct 7 10:17:30 2013 From: satyagowtham.k at gmail.com (satya gowtham kudupudi) Date: Mon, 7 Oct 2013 13:47:30 +0530 Subject: [Libav-user] Using libav library how to open a video device(webcam) and read data? Message-ID: Can we do it using the ffmpeg library or we have to use opencv? There are examples at opencv.org to open a AV device and read data. Please point me to examples that do the same with libavformat, libavcodec, libavutil and libavdevice. Thank you *Gowtham* -------------- next part -------------- An HTML attachment was scrubbed... URL: From satyagowtham.k at gmail.com Mon Oct 7 11:56:41 2013 From: satyagowtham.k at gmail.com (satya gowtham kudupudi) Date: Mon, 7 Oct 2013 15:26:41 +0530 Subject: [Libav-user] How to record webcam input video Message-ID: I've installed ffmpeg as show at https://trac.ffmpeg.org/wiki/UbuntuCompilationGuide using the ffmpeg libraries, how to open /dev/video0, set the webcam to operate in MJPEG mode and read the data stream. are there any example codes? Thank you *Gowtham* -------------- next part -------------- An HTML attachment was scrubbed... URL: From julian.herrera at tvgenius.net Mon Oct 7 15:18:35 2013 From: julian.herrera at tvgenius.net (Julian Herrera (TVGenius)) Date: Mon, 7 Oct 2013 14:18:35 +0100 Subject: [Libav-user] Direct rendering or avoiding copying locally a decoded AVFrame before rendering Message-ID: Hello all, I have developed a video player based on ffmpeg for iOS, which is intended to play MPEG-2 (SD) and H264 (HD) streams from a DVB-S source. The rendering of the decoded video frames is performed by an OpenGL component also responsible for converting YUV frames to RGB. I used the code in ffplay.c as a reference for the steps necessary to decode and display the video frames, but I was wondering whether I can improve the process by eliminating the need of copying locally each decoded frame before enqueuing them for rendering. Basically I would like to implement the fix proposed in line 1612 of ffplay.c (ffmpeg v. 2.0) to bypass the local copy of the decoded frame. So the idea is to allocate a brand new AVFrame every time before calling avcodec_decode_video2() and then send the frame to the renderer, instead of passing a single reusable AVFrame to the decoder and copying locally the result frame (this single copying step consumes around 10% of the processor time on an iPad 4 whilst decoding h264-based 1080i streams). I tried such idea unsuccessfully. The resulted frames were rendered out of order, so the video was played as if the images were going back and forth in time. If I call av_frame_clone(videoFrame) before sending the frame to the renderer, the video is played correctly but the same high processor usage occurs, which is what I am trying to prevent. Could you shed some light on how to solve this issue if it is possible? Regards, Julian Herrera From onemda at gmail.com Mon Oct 7 15:28:56 2013 From: onemda at gmail.com (Paul B Mahol) Date: Mon, 7 Oct 2013 13:28:56 +0000 Subject: [Libav-user] Direct rendering or avoiding copying locally a decoded AVFrame before rendering In-Reply-To: References: Message-ID: On 10/7/13, Julian Herrera (TVGenius) wrote: > Hello all, > > I have developed a video player based on ffmpeg for iOS, which is intended > to play MPEG-2 (SD) and H264 (HD) streams from a DVB-S source. The rendering > of the decoded video frames is performed by an OpenGL component also > responsible for converting YUV frames to RGB. > > I used the code in ffplay.c as a reference for the steps necessary to decode > and display the video frames, but I was wondering whether I can improve the > process by eliminating the need of copying locally each decoded frame before > enqueuing them for rendering. > > Basically I would like to implement the fix proposed in line 1612 of > ffplay.c (ffmpeg v. 2.0) to bypass the local copy of the decoded frame. So > the idea is to allocate a brand new AVFrame every time before calling > avcodec_decode_video2() and then send the frame to the renderer, instead of > passing a single reusable AVFrame to the decoder and copying locally the > result frame (this single copying step consumes around 10% of the processor > time on an iPad 4 whilst decoding h264-based 1080i streams). > > I tried such idea unsuccessfully. The resulted frames were rendered out of > order, so the video was played as if the images were going back and forth in > time. If I call av_frame_clone(videoFrame) before sending the frame to the I guess your code does not use reference counting and thus that call copies all data. > renderer, the video is played correctly but the same high processor usage > occurs, which is what I am trying to prevent. > > Could you shed some light on how to solve this issue if it is possible? > > Regards, > Julian Herrera > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > From julian.herrera at tvgenius.net Mon Oct 7 17:14:13 2013 From: julian.herrera at tvgenius.net (Julian Herrera (TVGenius)) Date: Mon, 7 Oct 2013 16:14:13 +0100 Subject: [Libav-user] Direct rendering or avoiding copying locally a decoded AVFrame before rendering In-Reply-To: References: Message-ID: <5DEA261B-6C7E-4579-A278-C5F599C2ABB6@tvgenius.net> On 7 Oct 2013, at 14:28, Paul B Mahol wrote: > On 10/7/13, Julian Herrera (TVGenius) wrote: >> Hello all, >> >> I have developed a video player based on ffmpeg for iOS, which is intended >> to play MPEG-2 (SD) and H264 (HD) streams from a DVB-S source. The rendering >> of the decoded video frames is performed by an OpenGL component also >> responsible for converting YUV frames to RGB. >> >> I used the code in ffplay.c as a reference for the steps necessary to decode >> and display the video frames, but I was wondering whether I can improve the >> process by eliminating the need of copying locally each decoded frame before >> enqueuing them for rendering. >> >> Basically I would like to implement the fix proposed in line 1612 of >> ffplay.c (ffmpeg v. 2.0) to bypass the local copy of the decoded frame. So >> the idea is to allocate a brand new AVFrame every time before calling >> avcodec_decode_video2() and then send the frame to the renderer, instead of >> passing a single reusable AVFrame to the decoder and copying locally the >> result frame (this single copying step consumes around 10% of the processor >> time on an iPad 4 whilst decoding h264-based 1080i streams). >> >> I tried such idea unsuccessfully. The resulted frames were rendered out of >> order, so the video was played as if the images were going back and forth in >> time. If I call av_frame_clone(videoFrame) before sending the frame to the > > I guess your code does not use reference counting and thus that call > copies all data. I do not use reference counting indeed. I could not find an example on the Internet on how to use it. What I basically need is to allocate a the AVFrame buffer locally, pass it to the decoder and release it only after rendering. It seems though the decoder writes either incomplete data for some frames or rewrites the buffer within subsequent calls. I haven't been able to understand yet how the decoder handles the decoded data in AVFrame.data[] so the lifecycle of this buffer is not clear to me. > >> renderer, the video is played correctly but the same high processor usage >> occurs, which is what I am trying to prevent. >> >> Could you shed some light on how to solve this issue if it is possible? >> >> Regards, >> Julian Herrera >> _______________________________________________ >> Libav-user mailing list >> Libav-user at ffmpeg.org >> http://ffmpeg.org/mailman/listinfo/libav-user >> > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user From onemda at gmail.com Mon Oct 7 17:22:19 2013 From: onemda at gmail.com (Paul B Mahol) Date: Mon, 7 Oct 2013 15:22:19 +0000 Subject: [Libav-user] Direct rendering or avoiding copying locally a decoded AVFrame before rendering In-Reply-To: <5DEA261B-6C7E-4579-A278-C5F599C2ABB6@tvgenius.net> References: <5DEA261B-6C7E-4579-A278-C5F599C2ABB6@tvgenius.net> Message-ID: On 10/7/13, Julian Herrera (TVGenius) wrote: > I do not use reference counting indeed. I could not find an example on the > Internet on how to use it. https://github.com/mpv-player/mpv/blob/master/video/decode/vd_lavc.c doc/examples/filtering_audio.c From nfxjfg at googlemail.com Mon Oct 7 17:55:54 2013 From: nfxjfg at googlemail.com (wm4) Date: Mon, 7 Oct 2013 17:55:54 +0200 Subject: [Libav-user] Direct rendering or avoiding copying locally a decoded AVFrame before rendering In-Reply-To: References: <5DEA261B-6C7E-4579-A278-C5F599C2ABB6@tvgenius.net> Message-ID: <20131007175554.7053c4fa@debian> On Mon, 7 Oct 2013 15:22:19 +0000 Paul B Mahol wrote: > On 10/7/13, Julian Herrera (TVGenius) wrote: > > I do not use reference counting indeed. I could not find an example on the > > Internet on how to use it. > > https://github.com/mpv-player/mpv/blob/master/video/decode/vd_lavc.c I think he wants to software-decode into a user-provided AVFrame, which this code does _not_ do. (It does only for hardware decoding - and for old libavcodec versions which didn't have native reference counting yet. I guess the hw decoding case could actually be applied to software decoding too, but it still doesn't make an ideal example.) Anyway, he want to override get_frame2. I'm not sure if that strictly _requires_ reference counting, but maybe it's a good idea to use and enable it. > doc/examples/filtering_audio.c > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user From julian.herrera at tvgenius.net Mon Oct 7 18:34:12 2013 From: julian.herrera at tvgenius.net (Julian Herrera (TVGenius)) Date: Mon, 7 Oct 2013 17:34:12 +0100 Subject: [Libav-user] Direct rendering or avoiding copying locally a decoded AVFrame before rendering In-Reply-To: <20131007175554.7053c4fa@debian> References: <5DEA261B-6C7E-4579-A278-C5F599C2ABB6@tvgenius.net> <20131007175554.7053c4fa@debian> Message-ID: Hi Paul and wm4, Thank you for your support. I realised I just needed to activate reference counting, so I set AVCodecContext->refcounted_frames = 1; before avcodec_open2() and then it worked! I do not have to copy the decoded frames locally any more so the process is more efficient now. Thank you again! Regards, Julian Herrera On 7 Oct 2013, at 16:55, wm4 wrote: > On Mon, 7 Oct 2013 15:22:19 +0000 > Paul B Mahol wrote: > >> On 10/7/13, Julian Herrera (TVGenius) wrote: >>> I do not use reference counting indeed. I could not find an example on the >>> Internet on how to use it. >> >> https://github.com/mpv-player/mpv/blob/master/video/decode/vd_lavc.c > > I think he wants to software-decode into a user-provided AVFrame, which > this code does _not_ do. (It does only for hardware decoding - and for > old libavcodec versions which didn't have native reference counting > yet. I guess the hw decoding case could actually be applied to > software decoding too, but it still doesn't make an ideal example.) > > Anyway, he want to override get_frame2. I'm not sure if that strictly > _requires_ reference counting, but maybe it's a good idea to use and > enable it. > >> doc/examples/filtering_audio.c >> _______________________________________________ >> Libav-user mailing list >> Libav-user at ffmpeg.org >> http://ffmpeg.org/mailman/listinfo/libav-user > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user From jpboard2 at yahoo.com Mon Oct 7 23:31:33 2013 From: jpboard2 at yahoo.com (James Board) Date: Mon, 7 Oct 2013 14:31:33 -0700 (PDT) Subject: [Libav-user] Compile with g++ Message-ID: <1381181493.68633.YahooMailNeo@web164704.mail.gq1.yahoo.com> I'm trying to incorporate the libav subroutines into a C++ program.? Has this been done?? When I try to compile, I get lots of errors like UINT64_c undefined and many others.? How difficult would it be to compile the examples in the doc/examples directory with a C++ compiler? -------------- next part -------------- An HTML attachment was scrubbed... URL: From chisholm at mitre.org Mon Oct 7 23:38:47 2013 From: chisholm at mitre.org (Michael Chisholm) Date: Mon, 7 Oct 2013 17:38:47 -0400 Subject: [Libav-user] Compile with g++ In-Reply-To: <1381181493.68633.YahooMailNeo@web164704.mail.gq1.yahoo.com> References: <1381181493.68633.YahooMailNeo@web164704.mail.gq1.yahoo.com> Message-ID: <525329E7.2020907@mitre.org> On 10/7/2013 5:31 PM, James Board wrote: > I'm trying to incorporate the libav subroutines into a C++ program. Has this been > done? When I try to compile, I get lots of errors like UINT64_c undefined and > many others. How difficult would it be to compile the examples in the doc/examples > directory with a C++ compiler? > I use libav from a C++ program. I worked around that error about type macros by adding: CXXFLAGS += -D__STDC_CONSTANT_MACROS But if you're compiling pure C code, why not use a C compiler? Andy From jpboard2 at yahoo.com Tue Oct 8 00:56:43 2013 From: jpboard2 at yahoo.com (James Board) Date: Mon, 7 Oct 2013 15:56:43 -0700 (PDT) Subject: [Libav-user] Compile with g++ In-Reply-To: <525329E7.2020907@mitre.org> References: <1381181493.68633.YahooMailNeo@web164704.mail.gq1.yahoo.com> <525329E7.2020907@mitre.org> Message-ID: <1381186603.13585.YahooMailNeo@web164703.mail.gq1.yahoo.com> >But if you're compiling pure C code, why not use a C compiler? I'm not compiling pure C code.? I'm compiling C++ code and I want to call the libav surboutines from C++ code.? How do I do this? -------------- next part -------------- An HTML attachment was scrubbed... URL: From mcygogo at gmail.com Tue Oct 8 07:28:45 2013 From: mcygogo at gmail.com (Michael) Date: Tue, 8 Oct 2013 13:28:45 +0800 Subject: [Libav-user] Fwd: About implement the recorder In-Reply-To: References: Message-ID: Hi All Nobody know this ??!! come on...... ---------- Forwarded message ---------- From: Michael Date: Sun, Sep 29, 2013 at 9:24 AM Subject: About implement the recorder To: libav-user at ffmpeg.org Hi all I know there is a tutorial about how to implement a player using the FFmpeg lib, Is there some code about how to implement a recorder? tks -------------- next part -------------- An HTML attachment was scrubbed... URL: From er.anshul.maheshwari at gmail.com Tue Oct 8 07:57:55 2013 From: er.anshul.maheshwari at gmail.com (Anshul Maheshwari) Date: Tue, 8 Oct 2013 11:27:55 +0530 Subject: [Libav-user] Vp9 update In-Reply-To: <52517755.a804440a.4468.ffffae17@mx.google.com> References: <52517755.a804440a.4468.ffffae17@mx.google.com> Message-ID: On Oct 6, 2013 8:14 PM, "Tushar" wrote: > > Ffmpeg has included vp9 codecs....? > > Regards > Tushar Paithankar > ________________________________ > From: Paul B Mahol > Sent: 06-10-2013 17:39 > To: This list is about using libavcodec, libavformat, libavutil, libavdevice and libavfilter. > Subject: Re: [Libav-user] Vp9 update > > On 10/6/13, Tushar wrote: > > Hi, > > > > is there any update of vp9, in ffmpeg. > > What kind of update? > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > You have to look in git not release, to have the latest update -------------- next part -------------- An HTML attachment was scrubbed... URL: From p.tushar99 at gmail.com Tue Oct 8 10:31:22 2013 From: p.tushar99 at gmail.com (Tushar) Date: Tue, 8 Oct 2013 14:01:22 +0530 Subject: [Libav-user] Vp9 update Message-ID: <5253c2fd.669c420a.6b0d.6a58@mx.google.com> Thanks anshul. Regards Tushar Paithankar -----Original Message----- From: "Anshul Maheshwari" Sent: ?08-?10-?2013 11:28 To: "This list is about using libavcodec, libavformat, libavutil libavdevice and libavfilter." Subject: Re: [Libav-user] Vp9 update On Oct 6, 2013 8:14 PM, "Tushar" wrote: > > Ffmpeg has included vp9 codecs....? > > Regards > Tushar Paithankar > ________________________________ > From: Paul B Mahol > Sent: 06-10-2013 17:39 > To: This list is about using libavcodec, libavformat, libavutil, libavdevice and libavfilter. > Subject: Re: [Libav-user] Vp9 update > > On 10/6/13, Tushar wrote: > > Hi, > > > > is there any update of vp9, in ffmpeg. > > What kind of update? > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > You have to look in git not release, to have the latest update -------------- next part -------------- An HTML attachment was scrubbed... URL: From novak.attila at itvprojekt.hu Tue Oct 8 13:01:01 2013 From: novak.attila at itvprojekt.hu (=?ISO-8859-1?Q?Nov=E1k=2C_Attila?=) Date: Tue, 8 Oct 2013 13:01:01 +0200 Subject: [Libav-user] directshow resolution Message-ID: Hi, I have a Leadtek capture card that provides DirectShow output. I managed to record video in multiple resolutions using the command line ffmpeg tool by providing the "-s widthXheight" option. Unfortunately I could not replicate the results from code: it always captures with the default 320x200 resolution. I tried calling av_opt_set_image_size() & av_opt_set() with the "image_size" option on the input format context struct before & after opening the codec, but it didn't work. I couldn't find any documentation whatsoever on this feature. Does anyone know how this supposed to work? (I'm on WinXP with Visual Studio 2010, the card is a Leadtek WinFast VC100) Thank you in advance, -Attila -------------- next part -------------- An HTML attachment was scrubbed... URL: From novak.attila at itvprojekt.hu Tue Oct 8 13:51:20 2013 From: novak.attila at itvprojekt.hu (=?ISO-8859-1?Q?Nov=E1k=2C_Attila?=) Date: Tue, 8 Oct 2013 13:51:20 +0200 Subject: [Libav-user] directshow resolution Message-ID: On 8 October 2013 13:01, Nov?k, Attila wrote: > > Hi, > > I have a Leadtek capture card that provides DirectShow output. I managed to record video in multiple resolutions using the command line ffmpeg tool by providing the "-s widthXheight" option. Unfortunately I could not replicate the results from code: it always captures with the default 320x200 resolution. I tried calling av_opt_set_image_size() & av_opt_set() with the "image_size" option on the input format context struct before & after opening the codec, but it didn't work. > I couldn't find any documentation whatsoever on this feature. Does anyone know how this supposed to work? > > (I'm on WinXP with Visual Studio 2010, the card is a Leadtek WinFast VC100) > > Thank you in advance, > -Attila And of course in the meantime I found a similar question in the archives. D'oh. If anyone else is interested: http://ffmpeg.org/pipermail/libav-user/2012-November/003041.html -Attila From jpboard2 at yahoo.com Tue Oct 8 17:20:37 2013 From: jpboard2 at yahoo.com (James Board) Date: Tue, 8 Oct 2013 08:20:37 -0700 (PDT) Subject: [Libav-user] Compile with g++ In-Reply-To: <525329E7.2020907@mitre.org> References: <1381181493.68633.YahooMailNeo@web164704.mail.gq1.yahoo.com> <525329E7.2020907@mitre.org> Message-ID: <1381245637.58838.YahooMailNeo@web164702.mail.gq1.yahoo.com> On Monday, October 7, 2013 5:39 PM, Michael Chisholm wrote: On 10/7/2013 5:31 PM, James Board wrote: > I'm trying to incorporate the libav subroutines into a C++ program.? Has this been > done?? When I try to compile, I get lots of errors like UINT64_c undefined and > many others.? How difficult would it be to compile the examples in the doc/examples > directory with a C++ compiler? > I use libav from a C++ program.? I worked around that error about type macros by adding: CXXFLAGS += -D__STDC_CONSTANT_MACROS But if you're compiling pure C code, why not use a C compiler? Andy _______________________________________________ Libav-user mailing list Libav-user at ffmpeg.org http://ffmpeg.org/mailman/listinfo/libav-user -------------- next part -------------- An HTML attachment was scrubbed... URL: From jpboard2 at yahoo.com Tue Oct 8 17:22:20 2013 From: jpboard2 at yahoo.com (James Board) Date: Tue, 8 Oct 2013 08:22:20 -0700 (PDT) Subject: [Libav-user] Compile with g++ In-Reply-To: <525329E7.2020907@mitre.org> References: <1381181493.68633.YahooMailNeo@web164704.mail.gq1.yahoo.com> <525329E7.2020907@mitre.org> Message-ID: <1381245740.66368.YahooMailNeo@web164702.mail.gq1.yahoo.com> >But if you're compiling pure C code, why not use a C compiler? I'm trying to build a video editor with QT, which is implemented in C++, on Linux.? I guess I could code my interface functions in C, then compile that into a static library, then link that into the C++/QT program which implements the video editor.? Is there any easier way?? Can I call the libav routines directly from the C++ program?? I have plenty of experience with C, but I'm a novice at C++, so there might be a real easy answer to this question. Thanks. On Monday, October 7, 2013 5:39 PM, Michael Chisholm wrote: On 10/7/2013 5:31 PM, James Board wrote: > I'm trying to incorporate the libav subroutines into a C++ program.? Has this been > done?? When I try to compile, I get lots of errors like UINT64_c undefined and > many others.? How difficult would it be to compile the examples in the doc/examples > directory with a C++ compiler? > I use libav from a C++ program.? I worked around that error about type macros by adding: CXXFLAGS += -D__STDC_CONSTANT_MACROS But if you're compiling pure C code, why not use a C compiler? Andy _______________________________________________ Libav-user mailing list Libav-user at ffmpeg.org http://ffmpeg.org/mailman/listinfo/libav-user -------------- next part -------------- An HTML attachment was scrubbed... URL: From chisholm at mitre.org Tue Oct 8 19:48:41 2013 From: chisholm at mitre.org (Michael Chisholm) Date: Tue, 8 Oct 2013 13:48:41 -0400 Subject: [Libav-user] Compile with g++ In-Reply-To: <1381186603.13585.YahooMailNeo@web164703.mail.gq1.yahoo.com> References: <1381181493.68633.YahooMailNeo@web164704.mail.gq1.yahoo.com> <525329E7.2020907@mitre.org> <1381186603.13585.YahooMailNeo@web164703.mail.gq1.yahoo.com> Message-ID: <52544579.9060105@mitre.org> On 10/7/2013 6:56 PM, James Board wrote: >> But if you're compiling pure C code, why not use a C compiler? > > > I'm not compiling pure C code. I'm compiling C++ code and I want > to call the libav surboutines from C++ code. How do I do this? > One of your questions was: "How difficult would it be to compile the examples in the doc/examples directory with a C++ compiler?" Those are C programs, so just use a C compiler for them. That's all I meant. Yes, you can call C functions from a C++ program. I think many C header files have a guard like: #ifdef __cplusplus extern "C" { #endif ... #ifdef __cplusplus } #endif to make sure C++ compilers don't mangle the symbols, but the headers I use don't have that. So I just added it myself, around my C includes: extern "C" { #include "libavformat/avformat.h" etc... } and then you can call them normally from your C++ apps. Andy From jpboard2 at yahoo.com Tue Oct 8 20:12:28 2013 From: jpboard2 at yahoo.com (James Board) Date: Tue, 8 Oct 2013 11:12:28 -0700 (PDT) Subject: [Libav-user] Compile with g++ In-Reply-To: <52544579.9060105@mitre.org> References: <1381181493.68633.YahooMailNeo@web164704.mail.gq1.yahoo.com> <525329E7.2020907@mitre.org> <1381186603.13585.YahooMailNeo@web164703.mail.gq1.yahoo.com> <52544579.9060105@mitre.org> Message-ID: <1381255948.14517.YahooMailNeo@web164703.mail.gq1.yahoo.com> >"How difficult would it be to compile the examples in the doc/examples >directory with a C++ compiler?" > >Those are C programs, so just use a C compiler for them.? That's all I >meant. Okay, I understand.? Yes they are just C programs, so I can compile with the C compiler.? But my C++ programs with libav subroutine calls won't compile and the error messages I receive are the same as when I try to compile the doc/examples with C++.? So, rather then posting my C++ code, it's easier to debug the problems by merely trying to compile the doc/examples with the C++ compiler ? >So I just added it myself, around my C includes: > >extern "C" { >#include "libavformat/avformat.h" >etc... >} I tried exactly that with the demuxing.c example.? When I try to compile it with the C++ compiler, I get errors.? When I compile with the C compiler, no errors.? What do I need to do to get demuxing.c to compile with the C++ compiler in Linux? -------------- next part -------------- An HTML attachment was scrubbed... URL: From sa.moosavy at gmail.com Tue Oct 8 08:25:33 2013 From: sa.moosavy at gmail.com (abolfazl moosavi) Date: Tue, 8 Oct 2013 09:55:33 +0330 Subject: [Libav-user] Help Message-ID: Dear Sir/Madam I wan to know How I can use latm_parse_packet in libavformat. How can I set PayloadContext and other argument from a file and a stream Thanks in advance Seyed Abolfazl Mousavi -------------- next part -------------- An HTML attachment was scrubbed... URL: From dannykim at veryalpha.com Mon Oct 7 22:09:54 2013 From: dannykim at veryalpha.com (Danny Kim) Date: Mon, 7 Oct 2013 13:09:54 -0700 Subject: [Libav-user] FFMPEG Library Message-ID: Hi, I am trying to use this library for a commercial Android application, but I would like to know if the compression of a video and cropping of the video length (cropping dimensions of video frame) libraries of FFMPEG is under GPL or LGPL. Thanks, Danny -------------- next part -------------- An HTML attachment was scrubbed... URL: From jpboard2 at yahoo.com Tue Oct 8 21:05:37 2013 From: jpboard2 at yahoo.com (James Board) Date: Tue, 8 Oct 2013 12:05:37 -0700 (PDT) Subject: [Libav-user] Is libav thread-safe? Message-ID: <1381259137.76606.YahooMailNeo@web164705.mail.gq1.yahoo.com> I want to create several pthreads in a C++ program (assuming you can call libav routines from a C++ program) that each call libav subroutines.? Are the libav subroutines? thread-safe?? Specifically, can several pthreads open the same AVI file and decode different video frames concurrently? I'm doing this so I can write a real-time video that can play the video forward and backwards, and the multiple threads will help decode and process each frame quickly so there will be no delay when I step through the video. -------------- next part -------------- An HTML attachment was scrubbed... URL: From chisholm at mitre.org Tue Oct 8 21:55:34 2013 From: chisholm at mitre.org (Michael Chisholm) Date: Tue, 8 Oct 2013 15:55:34 -0400 Subject: [Libav-user] Compile with g++ In-Reply-To: <1381255948.14517.YahooMailNeo@web164703.mail.gq1.yahoo.com> References: <1381181493.68633.YahooMailNeo@web164704.mail.gq1.yahoo.com> <525329E7.2020907@mitre.org> <1381186603.13585.YahooMailNeo@web164703.mail.gq1.yahoo.com> <52544579.9060105@mitre.org> <1381255948.14517.YahooMailNeo@web164703.mail.gq1.yahoo.com> Message-ID: <52546336.6050505@mitre.org> On 10/8/2013 2:12 PM, James Board wrote: >> "How difficult would it be to compile the examples in the doc/examples >> directory with a C++ compiler?" >> >> Those are C programs, so just use a C compiler for them. That's all I >> meant. > > Okay, I understand. Yes they are just C programs, so I can compile with > the C compiler. But my C++ programs with libav subroutine calls won't > compile and the error messages I receive are the same as when I try to compile > the doc/examples with C++. So, rather then posting my C++ code, it's easier > to debug the problems by merely trying to compile the doc/examples with the > C++ compiler > >> So I just added it myself, around my C includes: >> >> extern "C" { >> #include "libavformat/avformat.h" >> etc... >> } > > I tried exactly that with the demuxing.c example. When I try to compile > it with the C++ compiler, I get errors. When I compile with the C compiler, > no errors. What do I need to do to get demuxing.c to compile with the C++ > compiler in Linux? > You didn't describe the error messages, but I gave it a shot with mingw32 4.8.1, and now I see error messages as well. E.g. demuxing.c: In function 'int main(int, char**)': demuxing.c:261:66: error: invalid conversion from 'void*' to 'uint8_t** {aka unsigned char**}' [-fpermissive] audio_dst_data = av_mallocz(sizeof(uint8_t *) * nb_planes); ^ Is that the kind of error you are seeing (this is from ffmpeg 2.0.1)? I am admittedly using an older version of libav (0.8.6), not the latest ffmpeg, and that works fine with C++ compilers. I hadn't realized it, but it seems things have changed... which is good for me to know. I don't know of an easy fix for this :( Andy From onemda at gmail.com Tue Oct 8 22:05:09 2013 From: onemda at gmail.com (Paul B Mahol) Date: Tue, 8 Oct 2013 20:05:09 +0000 Subject: [Libav-user] FFMPEG Library In-Reply-To: References: Message-ID: On 10/7/13, Danny Kim wrote: > Hi, > > I am trying to use this library for a commercial Android application, but I > would like to know if the compression of a video and cropping of the video > length (cropping dimensions of video frame) libraries of FFMPEG is under > GPL or LGPL. vf_crop is LGPL. Encoder license depends on what encoder you actually use. > Thanks, > > Danny > From cehoyos at ag.or.at Wed Oct 9 00:19:00 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Tue, 8 Oct 2013 22:19:00 +0000 (UTC) Subject: [Libav-user] Compile with g++ References: <1381181493.68633.YahooMailNeo@web164704.mail.gq1.yahoo.com> <525329E7.2020907@mitre.org> <1381186603.13585.YahooMailNeo@web164703.mail.gq1.yahoo.com> <52544579.9060105@mitre.org> <1381255948.14517.YahooMailNeo@web164703.mail.gq1.yahoo.com> <52546336.6050505@mitre.org> Message-ID: Michael Chisholm writes: > demuxing.c: In function 'int main(int, char**)': > demuxing.c:261:66: error: invalid conversion from 'void*' to 'uint8_t** > {aka unsigned char**}' [-fpermissive] > audio_dst_data = av_mallocz(sizeof(uint8_t *) * nb_planes); > ^ demuxing.c is a C program, if you want to compile it with C++ (why?) you will have to convert it to C++, just as with any other C program. (Nothing about this is FFmpeg specific.) > Is that the kind of error you are seeing (this is from ffmpeg 2.0.1)? > I am admittedly using an older version of libav (0.8.6) Just to make sure: This is known to broken (and said to be exploitable) so please understand that we cannot support it here. Carl Eugen From chisholm at mitre.org Wed Oct 9 01:00:30 2013 From: chisholm at mitre.org (Michael Chisholm) Date: Tue, 8 Oct 2013 19:00:30 -0400 Subject: [Libav-user] Compile with g++ In-Reply-To: References: <1381181493.68633.YahooMailNeo@web164704.mail.gq1.yahoo.com> <525329E7.2020907@mitre.org> <1381186603.13585.YahooMailNeo@web164703.mail.gq1.yahoo.com> <52544579.9060105@mitre.org> <1381255948.14517.YahooMailNeo@web164703.mail.gq1.yahoo.com> <52546336.6050505@mitre.org> Message-ID: <52548E8E.5090601@mitre.org> On 10/8/2013 6:19 PM, Carl Eugen Hoyos wrote: > Michael Chisholm writes: > >> demuxing.c: In function 'int main(int, char**)': >> demuxing.c:261:66: error: invalid conversion from 'void*' to 'uint8_t** >> {aka unsigned char**}' [-fpermissive] >> audio_dst_data = av_mallocz(sizeof(uint8_t *) * nb_planes); >> ^ > > demuxing.c is a C program, if you want to compile it > with C++ (why?) you will have to convert it to C++, > just as with any other C program. > (Nothing about this is FFmpeg specific.) > Of course I wouldn't normally compile a C application with other than a C compiler. There is overlap between C and C++, and the above was just an experiment which basically shows that ffmpeg strays outside the overlapping region. And I know as a C project, you have no obligation to make the code "C++-friendly". >> Is that the kind of error you are seeing (this is from ffmpeg 2.0.1)? > >> I am admittedly using an older version of libav (0.8.6) > > Just to make sure: This is known to broken (and said to > be exploitable) so please understand that we cannot > support it here. > Yeah, I wouldn't ask for support for that here. But if James is willing to use it, perhaps that will better fit his need. Or maybe there is an earlier version of ffmpeg which is more C++-friendly. And of course he can always use his API-indirection idea to wrap C++-unfriendly APIs with C++-friendly ones. Andy From donmoir at comcast.net Wed Oct 9 02:53:37 2013 From: donmoir at comcast.net (Don Moir) Date: Tue, 8 Oct 2013 20:53:37 -0400 Subject: [Libav-user] directshow resolution References: Message-ID: ----- Original Message ----- From: "Nov?k, Attila" To: Sent: Tuesday, October 08, 2013 7:51 AM Subject: Re: [Libav-user] directshow resolution On 8 October 2013 13:01, Nov?k, Attila wrote: > > Hi, > > I have a Leadtek capture card that provides DirectShow output. I managed to record video in multiple resolutions using the command > line ffmpeg tool by providing the "-s widthXheight" option. Unfortunately I could not replicate the results from code: it always > captures with the default 320x200 resolution. I tried calling av_opt_set_image_size() & av_opt_set() with the "image_size" option > on the input format context struct before & after opening the codec, but it didn't work. > I couldn't find any documentation whatsoever on this feature. Does anyone know how this supposed to work? > > (I'm on WinXP with Visual Studio 2010, the card is a Leadtek WinFast VC100) > > Thank you in advance, > -Attila AVDictionary* pOptions = NULL; char videoSize [] = "640x480"; // whatever size or sizes your camera supports av_dict_set (&pOptions,"video_size",videoSize,0); Getting the resolutions for a camera is not well supported in ffmpeg. You can do something like parsing the av_log callback but this is silly. I think there are structures in place for better camera feedback but I don't think it's implemented. I currently do this internal to my own app. From bruce at spearmorgan.com Wed Oct 9 02:55:31 2013 From: bruce at spearmorgan.com (Bruce Wheaton) Date: Tue, 8 Oct 2013 17:55:31 -0700 Subject: [Libav-user] Is libav thread-safe? In-Reply-To: <1381259137.76606.YahooMailNeo@web164705.mail.gq1.yahoo.com> References: <1381259137.76606.YahooMailNeo@web164705.mail.gq1.yahoo.com> Message-ID: <10585546-D342-45E3-AC05-1D24AC11F1EE@spearmorgan.com> On Oct 8, 2013, at 12:05 PM, James Board wrote: > I want to create several pthreads in a C++ program (assuming you can call > libav routines from a C++ program) that each call libav subroutines. Well, yes, you can call C from a C++ app. You need to mark the headers as C when you include them, but that's about it. > Are the libav subroutines thread-safe? Specifically, > can several pthreads open the same AVI file and decode different video > frames concurrently? No, not really. At least, you'd have to lock the access entirely, which would make it sequential. You can use each context in one thread, and there are a few overall functions that need locking, such as choosing the right codecs for a file. > > I'm doing this so I can write a real-time video that > can play the video forward and backwards, and the multiple threads will > help decode and process each frame quickly so there will be no delay when > I step through the video. Most codecs are multi-threaded by now - so there already are threads running to decode frames. You can set the number of threads you want a codec to use when you open it. There's a number of other things you could do... multiple codecs open etc. But with codecs that need B and P frames, you pretty much have to decode in order anyway, and file access is always going to be one at a time. It sounds like you're trying to solve a problem that you don't have yet. Start with the basics - just getting going from a cold start in ffmpeg is enough trouble for most people, without trying to get clever. Bruce -------------- next part -------------- An HTML attachment was scrubbed... URL: From bruce at spearmorgan.com Wed Oct 9 02:58:53 2013 From: bruce at spearmorgan.com (Bruce Wheaton) Date: Tue, 8 Oct 2013 17:58:53 -0700 Subject: [Libav-user] Compile with g++ In-Reply-To: <1381255948.14517.YahooMailNeo@web164703.mail.gq1.yahoo.com> References: <1381181493.68633.YahooMailNeo@web164704.mail.gq1.yahoo.com> <525329E7.2020907@mitre.org> <1381186603.13585.YahooMailNeo@web164703.mail.gq1.yahoo.com> <52544579.9060105@mitre.org> <1381255948.14517.YahooMailNeo@web164703.mail.gq1.yahoo.com> Message-ID: <2916F205-707A-42B5-A879-8A0A916173C9@spearmorgan.com> On Oct 8, 2013, at 11:12 AM, James Board wrote: > > I tried exactly that with the demuxing.c example. When I try to compile > it with the C++ compiler, I get errors. When I compile with the C compiler, > no errors. What do I need to do to get demuxing.c to compile with the C++ > compiler in Linux? > That's an example program written in C. There's nothing in the actual codebase (as opposed to the examples) that doesn't work in C++. Compile a C example as C. Bruce -------------- next part -------------- An HTML attachment was scrubbed... URL: From zuwei at imrsv.com Wed Oct 9 03:27:56 2013 From: zuwei at imrsv.com (Zuwei Li) Date: Wed, 9 Oct 2013 09:27:56 +0800 Subject: [Libav-user] Fwd: Problems with RTMP streams on FFMpeg In-Reply-To: References: Message-ID: I am using FFMpeg to receive RTMP streams. It decodes and plays the RTMP stream correctly but I have problems playing the video for long periods of time. It seems that av_read_frame(format_context, &packet); returns an AVERROR_EOF after playing for a period in time say 7 or 8 mins, this occurs randomly, when that happens I presume that the stream has ended so my playback stops. However, the playback hasn't reached the actual video duration. My question is if this behaviour is characteristic of RTMP streams, if so is there a way to properly stream RTMP reliably so the playback can continue for long periods using FFMpeg -- Li Zuwei -------------- next part -------------- An HTML attachment was scrubbed... URL: From jpboard2 at yahoo.com Wed Oct 9 15:28:01 2013 From: jpboard2 at yahoo.com (James Board) Date: Wed, 9 Oct 2013 06:28:01 -0700 (PDT) Subject: [Libav-user] Is libav thread-safe? In-Reply-To: <10585546-D342-45E3-AC05-1D24AC11F1EE@spearmorgan.com> References: <1381259137.76606.YahooMailNeo@web164705.mail.gq1.yahoo.com> <10585546-D342-45E3-AC05-1D24AC11F1EE@spearmorgan.com> Message-ID: <1381325281.62800.YahooMailNeo@web164704.mail.gq1.yahoo.com> >Well, yes, you can call C from a C++ app. You need to mark the headers as C when you include >them, but that's about it. Well, thanks for the help, but actually this isn't true.? I tried this with the demuxing.c example and that didn't work. >It sounds like you're trying to solve a problem that you don't have yet. Start with the basics - just >getting going from a cold start in ffmpeg is enough trouble for most people, without trying to get >clever. Actually I have already wasted several weeks or months of coding time doing what you suggested: assume ffmpeg/libav works the way you want it, then start coding.? I think it's better to ask up front if libav is threadsafe before I spend a week implementing a multi-threaded app and then find out it can't possibly work because ffmpeg and libav are not thread-safe. I want to have multiple threads decoding different parts of the AVI file concurrently.? No encoding will occur.? Seems like it should be thread-safe.? But I'd like to know for sure before I start coding.? That's all.? Ask questions first, code later.? That stops me from complaining when libav doesn't do what I want.? I'll just choose another route. On , Bruce Wheaton wrote: On Oct 8, 2013, at 12:05 PM, James Board wrote: I want to create several pthreads in a C++ program (assuming you can call >libav routines from a C++ program) that each call libav subroutines.? > Well, yes, you can call C from a C++ app. You need to mark the headers as C when you include them, but that's about it. Are the libav subroutines? thread-safe?? Specifically, >can several pthreads open the same AVI file and decode different video >frames concurrently? No, not really. At least, you'd have to lock the access entirely, which would make it sequential. You can use each context in one thread, and there are a few overall functions that need locking, such as choosing the right codecs for a file. > >I'm doing this so I can write a real-time video that >can play the video forward and backwards, and the multiple threads will >help decode and process each frame quickly so there will be no delay when >I step through the video. Most codecs are multi-threaded by now - so there already are threads running to decode frames. You can set the number of threads you want a codec to use when you open it. There's a number of other things you could do... multiple codecs open etc. But with codecs that need B and P frames, you pretty much have to decode in order anyway, and file access is always going to be one at a time. It sounds like you're trying to solve a problem that you don't have yet. Start with the basics - just getting going from a cold start in ffmpeg is enough trouble for most people, without trying to get clever. Bruce _______________________________________________ Libav-user mailing list Libav-user at ffmpeg.org http://ffmpeg.org/mailman/listinfo/libav-user -------------- next part -------------- An HTML attachment was scrubbed... URL: From jpboard2 at yahoo.com Wed Oct 9 15:32:09 2013 From: jpboard2 at yahoo.com (James Board) Date: Wed, 9 Oct 2013 06:32:09 -0700 (PDT) Subject: [Libav-user] Compile with g++ In-Reply-To: <2916F205-707A-42B5-A879-8A0A916173C9@spearmorgan.com> References: <1381181493.68633.YahooMailNeo@web164704.mail.gq1.yahoo.com> <525329E7.2020907@mitre.org> <1381186603.13585.YahooMailNeo@web164703.mail.gq1.yahoo.com> <52544579.9060105@mitre.org> <1381255948.14517.YahooMailNeo@web164703.mail.gq1.yahoo.com> <2916F205-707A-42B5-A879-8A0A916173C9@spearmorgan.com> Message-ID: <1381325529.26985.YahooMailNeo@web164702.mail.gq1.yahoo.com> >That's an example program written in C. There's nothing in the actual codebase (as opposed to the >examples) that doesn't work in C++. Yes, I know it's a program written in C.? As I stated before, I only used that example because everyone here already has a copy of it.? The alternative would be for me to post my lengthy C++ code, which uses lots of thrid-part libraries, which nobody will be able to compile anyway). When I compile demuxing.c with g++ it gives me the same errors as when I add libav calls to my C++ app and then try to compile that with g++.? So, if we can figure out why demuxing.c won't compile with g++, then we will probably figure out why my C++ app won't compile with g++.? On Tuesday, October 8, 2013 9:25 PM, Bruce Wheaton wrote: On Oct 8, 2013, at 11:12 AM, James Board wrote: > >I tried exactly that with the demuxing.c example.? When I try to compile >it with the C++ compiler, I get errors.? When I compile with the C compiler, >no errors.? What do I need to do to get demuxing.c to compile with the C++ >compiler in Linux? >? That's an example program written in C. There's nothing in the actual codebase (as opposed to the examples) that doesn't work in C++. Compile a C example as C.? Bruce _______________________________________________ Libav-user mailing list Libav-user at ffmpeg.org http://ffmpeg.org/mailman/listinfo/libav-user -------------- next part -------------- An HTML attachment was scrubbed... URL: From jpboard2 at yahoo.com Wed Oct 9 15:37:10 2013 From: jpboard2 at yahoo.com (James Board) Date: Wed, 9 Oct 2013 06:37:10 -0700 (PDT) Subject: [Libav-user] Compile with g++ In-Reply-To: <1381325529.26985.YahooMailNeo@web164702.mail.gq1.yahoo.com> References: <1381181493.68633.YahooMailNeo@web164704.mail.gq1.yahoo.com> <525329E7.2020907@mitre.org> <1381186603.13585.YahooMailNeo@web164703.mail.gq1.yahoo.com> <52544579.9060105@mitre.org> <1381255948.14517.YahooMailNeo@web164703.mail.gq1.yahoo.com> <2916F205-707A-42B5-A879-8A0A916173C9@spearmorgan.com> <1381325529.26985.YahooMailNeo@web164702.mail.gq1.yahoo.com> Message-ID: <1381325830.69538.YahooMailNeo@web164704.mail.gq1.yahoo.com> >demuxing.c is a C program, if you want to compile it >with C++ (why?) you will have to convert it to C++, >just as with any other C program. Yes, I know it's a program written in C.? As I stated before, I only used that example because everyone here already has a copy of it.? The alternative would be for me to post my lengthy C++ code, which uses lots of third-party libraries, which nobody will be able to compile anyway). When I compile demuxing.c with g++ it gives me the same errors as when I add libav calls to my C++ app and then try to compile that with g++.? So, if we can figure out why demuxing.c won't compile with g++, then we will probably figure out why my C++ app won't compile with g++.? >(Nothing about this is FFmpeg specific.) This is the libav mailing list, not the fmpeg mailing list? The issue is how to add libav calls to a c++ program. >Carl Eugen On , James Board wrote: >That's an example program written in C. There's nothing in the actual codebase (as opposed to the >examples) that doesn't work in C++. Yes, I know it's a program written in C.? As I stated before, I only used that example because everyone here already has a copy of it.? The alternative would be for me to post my lengthy C++ code, which uses lots of thrid-part libraries, which nobody will be able to compile anyway). When I compile demuxing.c with g++ it gives me the same errors as when I add libav calls to my C++ app and then try to compile that with g++.? So, if we can figure out why demuxing.c won't compile with g++, then we will probably figure out why my C++ app won't compile with g++.? On Tuesday, October 8, 2013 9:25 PM, Bruce Wheaton wrote: On Oct 8, 2013, at 11:12 AM, James Board wrote: > >I tried exactly that with the demuxing.c example.? When I try to compile >it with the C++ compiler, I get errors.? When I compile with the C compiler, >no errors.? What do I need to do to get demuxing.c to compile with the C++ >compiler in Linux? >? That's an example program written in C. There's nothing in the actual codebase (as opposed to the examples) that doesn't work in C++. Compile a C example as C.? Bruce _______________________________________________ Libav-user mailing list Libav-user at ffmpeg.org http://ffmpeg.org/mailman/listinfo/libav-user -------------- next part -------------- An HTML attachment was scrubbed... URL: From onemda at gmail.com Wed Oct 9 15:52:14 2013 From: onemda at gmail.com (Paul B Mahol) Date: Wed, 9 Oct 2013 13:52:14 +0000 Subject: [Libav-user] Is libav thread-safe? In-Reply-To: <1381325281.62800.YahooMailNeo@web164704.mail.gq1.yahoo.com> References: <1381259137.76606.YahooMailNeo@web164705.mail.gq1.yahoo.com> <10585546-D342-45E3-AC05-1D24AC11F1EE@spearmorgan.com> <1381325281.62800.YahooMailNeo@web164704.mail.gq1.yahoo.com> Message-ID: On 10/9/13, James Board wrote: >>Well, yes, you can call C from a C++ app. You need to mark the headers as C >> when you include >them, but that's about it. > > > Well, thanks for the help, but actually this isn't true. I tried this with > the demuxing.c example and that didn't work. > > >>It sounds like you're trying to solve a problem that you don't have yet. > Start with the basics - just >getting going from a cold start in ffmpeg > is enough trouble for most people, without trying to get >clever. > > Actually I have already wasted several weeks or months of coding time doing > what you suggested: assume ffmpeg/libav works the way you want it, then > start coding. I think it's better to ask up front if libav is threadsafe > before I spend a week implementing a multi-threaded app and then find out it > can't possibly work because ffmpeg and libav are not thread-safe. > > I want to have multiple threads decoding different parts of the AVI file > concurrently. No encoding will occur. Seems like it should be > thread-safe. But I'd like to know for sure before I start coding. That's > all. Ask questions first, code later. That stops me from complaining when > libav doesn't do what I want. I'll just choose another route. > If you use different AVCodecContext it should be fine, otherwise it will crash. From cehoyos at ag.or.at Wed Oct 9 16:20:28 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Wed, 9 Oct 2013 14:20:28 +0000 (UTC) Subject: [Libav-user] Compile with g++ References: <1381181493.68633.YahooMailNeo@web164704.mail.gq1.yahoo.com> <525329E7.2020907@mitre.org> <1381186603.13585.YahooMailNeo@web164703.mail.gq1.yahoo.com> <52544579.9060105@mitre.org> <1381255948.14517.YahooMailNeo@web164703.mail.gq1.yahoo.com> <2916F205-707A-42B5-A879-8A0A916173C9@spearmorgan.com> <1381325529.26985.YahooMailNeo@web164702.mail.gq1.yahoo.com> <1381325830.69538.YahooMailNeo@web164704.mail.gq1.yahoo.com> Message-ID: James Board writes: > >(Nothing about this is FFmpeg specific.) > > This is the libav mailing list, not the fmpeg > mailing list This is a mailing list about FFmpeg (that is why it is hosted on the FFmpeg server). Questions about how to convert a C program (that allows implicit type conversions which is why FFmpeg - and demuxing.c - does not contain explicit type conversions) into a C++ program (which needs explicit conversions) is not completely appropriate here afaict. Carl Eugen From mihai.chindea at uti.eu.com Wed Oct 9 16:25:25 2013 From: mihai.chindea at uti.eu.com (Mihai Chindea) Date: Wed, 9 Oct 2013 14:25:25 +0000 Subject: [Libav-user] Compile with g++ In-Reply-To: <1381325830.69538.YahooMailNeo@web164704.mail.gq1.yahoo.com> References: <1381181493.68633.YahooMailNeo@web164704.mail.gq1.yahoo.com> <525329E7.2020907@mitre.org> <1381186603.13585.YahooMailNeo@web164703.mail.gq1.yahoo.com> <52544579.9060105@mitre.org> <1381255948.14517.YahooMailNeo@web164703.mail.gq1.yahoo.com> <2916F205-707A-42B5-A879-8A0A916173C9@spearmorgan.com> <1381325529.26985.YahooMailNeo@web164702.mail.gq1.yahoo.com>, <1381325830.69538.YahooMailNeo@web164704.mail.gq1.yahoo.com> Message-ID: this is actually a FFmpeg e-mail list .. for multithreaded implementations you should have a look at av_lockmgr_register() Mihai, >demuxing.c is a C program, if you want to compile it >with C++ (why?) you will have to convert it to C++, >just as with any other C program. Yes, I know it's a program written in C. As I stated before, I only used that example because everyone here already has a copy of it. The alternative would be for me to post my lengthy C++ code, which uses lots of third-party libraries, which nobody will be able to compile anyway). When I compile demuxing.c with g++ it gives me the same errors as when I add libav calls to my C++ app and then try to compile that with g++. So, if we can figure out why demuxing.c won't compile with g++, then we will probably figure out why my C++ app won't compile with g++. >(Nothing about this is FFmpeg specific.) This is the libav mailing list, not the fmpeg mailing list The issue is how to add libav calls to a c++ program. >Carl Eugen On , James Board wrote: >That's an example program written in C. There's nothing in the actual codebase (as opposed to the >examples) that doesn't work in C++. Yes, I know it's a program written in C. As I stated before, I only used that example because everyone here already has a copy of it. The alternative would be for me to post my lengthy C++ code, which uses lots of thrid-part libraries, which nobody will be able to compile anyway). When I compile demuxing.c with g++ it gives me the same errors as when I add libav calls to my C++ app and then try to compile that with g++. So, if we can figure out why demuxing.c won't compile with g++, then we will probably figure out why my C++ app won't compile with g++. On Tuesday, October 8, 2013 9:25 PM, Bruce Wheaton wrote: On Oct 8, 2013, at 11:12 AM, James Board wrote: I tried exactly that with the demuxing.c example. When I try to compile it with the C++ compiler, I get errors. When I compile with the C compiler, no errors. What do I need to do to get demuxing.c to compile with the C++ compiler in Linux? That's an example program written in C. There's nothing in the actual codebase (as opposed to the examples) that doesn't work in C++. Compile a C example as C. Bruce _______________________________________________ Libav-user mailing list Libav-user at ffmpeg.org http://ffmpeg.org/mailman/listinfo/libav-user From jpboard2 at yahoo.com Wed Oct 9 16:29:52 2013 From: jpboard2 at yahoo.com (James Board) Date: Wed, 9 Oct 2013 07:29:52 -0700 (PDT) Subject: [Libav-user] Compile with g++ In-Reply-To: References: <1381181493.68633.YahooMailNeo@web164704.mail.gq1.yahoo.com> <525329E7.2020907@mitre.org> <1381186603.13585.YahooMailNeo@web164703.mail.gq1.yahoo.com> <52544579.9060105@mitre.org> <1381255948.14517.YahooMailNeo@web164703.mail.gq1.yahoo.com> <2916F205-707A-42B5-A879-8A0A916173C9@spearmorgan.com> <1381325529.26985.YahooMailNeo@web164702.mail.gq1.yahoo.com> <1381325830.69538.YahooMailNeo@web164704.mail.gq1.yahoo.com> Message-ID: <1381328992.87316.YahooMailNeo@web164703.mail.gq1.yahoo.com> >This is a mailing list about FFmpeg (that is why >it is hosted on the FFmpeg server). Questions >about how to convert a C program (that allows >implicit type conversions which is why FFmpeg >- and demuxing.c - does not contain explicit >type conversions) into a C++ program (which >needs explicit conversions) is not completely >appropriate here afaict. Really?? The title of the mailing list is Libav-user at ffmpeg.org. I'm asking whether libav can be used in C++ programs, if anyone uses libav in C++ programs, and what I need to do in order to use libav in C++ programs.? How can that be inappropriate? Anyway, don't bother.? I give up.? You win. -------------- next part -------------- An HTML attachment was scrubbed... URL: From p3070011 at dias.aueb.gr Wed Oct 9 16:59:18 2013 From: p3070011 at dias.aueb.gr (Vitsas Nikolaos) Date: Wed, 09 Oct 2013 17:59:18 +0300 Subject: [Libav-user] Compile with g++ In-Reply-To: <1381328992.87316.YahooMailNeo@web164703.mail.gq1.yahoo.com> References: <1381181493.68633.YahooMailNeo@web164704.mail.gq1.yahoo.com> <525329E7.2020907@mitre.org> <1381186603.13585.YahooMailNeo@web164703.mail.gq1.yahoo.com> <52544579.9060105@mitre.org> <1381255948.14517.YahooMailNeo@web164703.mail.gq1.yahoo.com> <2916F205-707A-42B5-A879-8A0A916173C9@spearmorgan.com> <1381325529.26985.YahooMailNeo@web164702.mail.gq1.yahoo.com> <1381325830.69538.YahooMailNeo@web164704.mail.gq1.yahoo.com> <1381328992.87316.YahooMailNeo@web164703.mail.gq1.yahoo.com> Message-ID: On Wed, 9 Oct 2013 07:29:52 -0700 (PDT) James Board wrote: > >>This is a mailing list about FFmpeg (that is why >>it is hosted on the FFmpeg server). Questions >>about how to convert a C program (that allows >>implicit type conversions which is why FFmpeg >>- and demuxing.c - does not contain explicit >>type conversions) into a C++ program (which >>needs explicit conversions) is not completely >>appropriate here afaict. > > Really?? The title of the mailing list is Libav-user at ffmpeg.org. > I'm asking whether libav can be used in C++ programs, if anyone > uses libav in C++ programs, and what I need to do in order to > use libav in C++ programs.? How can that be inappropriate? > > Anyway, don't bother.? I give up.? You win. You just need to wrap all you libav includes in extern "C" { }, like this #ifdef __cplusplus extern "C" { #include #include #include #include #include #include #include #include } #endif // __cplusplus As for UINT64_C you can do this #ifndef INT64_C #define INT64_C(c) (c ## LL) #define UINT64_C(c) (c ## ULL) #endif // INT64_C I' m using libav in many of my projects which include other third party libraries. The above are the only things required. From chisholm at mitre.org Wed Oct 9 21:02:37 2013 From: chisholm at mitre.org (Michael Chisholm) Date: Wed, 9 Oct 2013 15:02:37 -0400 Subject: [Libav-user] Compile with g++ In-Reply-To: References: <1381181493.68633.YahooMailNeo@web164704.mail.gq1.yahoo.com> <525329E7.2020907@mitre.org> <1381186603.13585.YahooMailNeo@web164703.mail.gq1.yahoo.com> <52544579.9060105@mitre.org> <1381255948.14517.YahooMailNeo@web164703.mail.gq1.yahoo.com> <52546336.6050505@mitre.org> Message-ID: <5255A84D.70505@mitre.org> On 10/8/2013 7:00 PM, Michael Chisholm wrote: > On 10/8/2013 6:19 PM, Carl Eugen Hoyos wrote: >> Michael Chisholm writes: >> >>> demuxing.c: In function 'int main(int, char**)': >>> demuxing.c:261:66: error: invalid conversion from 'void*' to 'uint8_t** >>> {aka unsigned char**}' [-fpermissive] >>> audio_dst_data = av_mallocz(sizeof(uint8_t *) * nb_planes); >>> ^ >> >> demuxing.c is a C program, if you want to compile it >> with C++ (why?) you will have to convert it to C++, >> just as with any other C program. >> (Nothing about this is FFmpeg specific.) >> > > Of course I wouldn't normally compile a C application with other than a > C compiler. There is overlap between C and C++, and the above was just > an experiment which basically shows that ffmpeg strays outside the > overlapping region. And I know as a C project, you have no obligation > to make the code "C++-friendly". > >>> Is that the kind of error you are seeing (this is from ffmpeg 2.0.1)? >> >>> I am admittedly using an older version of libav (0.8.6) >> >> Just to make sure: This is known to broken (and said to >> be exploitable) so please understand that we cannot >> support it here. >> > > Yeah, I wouldn't ask for support for that here. But if James is willing > to use it, perhaps that will better fit his need. Or maybe there is an > earlier version of ffmpeg which is more C++-friendly. And of course he > can always use his API-indirection idea to wrap C++-unfriendly APIs with > C++-friendly ones. > Having a fresher head today, I realize this still wasn't a good test; you really need a C++ app which uses libav APIs to test this, not a C app. Or, you could try to see if you can get the C app working by changing only the .c file, not any headers. That's easier, it means I don't have to start a new app from scratch. So that's what I did, and I was able to get demuxing.c to compile with a C++ compiler, without modifying headers. I just did the following: - added casts to "frame->format" in a few places - removed use of the "av_ts2timestr" macro, since it expanded to code that produced a compile error [1] - Compiled with -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS - Added extern "C" {...} around the includes - Added cast to the return value of av_mallocz(). So my point to all this is, the ffmpeg-2.0.1 headers aren't completely C++-friendly, but it's not as bad as I thought. I was able to work around the problems easily, with this simple test app. fyi, Andy 1. c:/.../ffmpeg-2.0.1/include/libavutil/timestamp.h:72:94: error: taking address of temporary array #define av_ts2timestr(ts, tb) av_ts_make_time_string((char[AV_TS_MAX_STRING_SIZE]){0}, ts, tb) ^ demuxing.c:87:20: note: in expansion of macro 'av_ts2timestr' av_ts2timestr(frame->pts, &video_dec_ctx->time_base)); ^ From cehoyos at ag.or.at Thu Oct 10 02:33:14 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Thu, 10 Oct 2013 00:33:14 +0000 (UTC) Subject: [Libav-user] Compile with g++ References: <1381181493.68633.YahooMailNeo@web164704.mail.gq1.yahoo.com> <525329E7.2020907@mitre.org> <1381186603.13585.YahooMailNeo@web164703.mail.gq1.yahoo.com> <52544579.9060105@mitre.org> <1381255948.14517.YahooMailNeo@web164703.mail.gq1.yahoo.com> <52546336.6050505@mitre.org> <5255A84D.70505@mitre.org> Message-ID: Michael Chisholm writes: > So my point to all this is, the ffmpeg-2.0.1 headers > aren't completely C++-friendly I don't think this is correct as such: The headers are neither C++-friendly nor C++-unfriendly, they are simply C headers and exactly the same limitations apply than when using any other (non-trivial) C headers from a C++ program. The fact that some explicit casting is necessary in C++ is completely orthogonal to the C++- "friendliness" of the FFmpeg headers afaict. Do I understand correctly that you cannot use the av_ts2timestr() macro from C++ but that it is not used inside of FFmpeg in a way that makes using one of the libraries or one of the headers impossible? (If you know how to fix it, consider sending a patch, assuming it does not slow down the macro for C, such a change is useful imo.) Carl Eugen From amir.rouhi at rmit.edu.au Thu Oct 10 07:35:21 2013 From: amir.rouhi at rmit.edu.au (Amir Hossein Rouhi) Date: Thu, 10 Oct 2013 16:35:21 +1100 Subject: [Libav-user] Extract frames in raw RGB formats Message-ID: Hi I am wondering if anyone can help me how can i use ffmpeg to extract frames in raw RGB image forma. The following code does not work: ffmpeg -i foo.mp4 -r 1 -s 320x240 -f image2 foo-%03d.rgb -------------- next part -------------- An HTML attachment was scrubbed... URL: From cehoyos at ag.or.at Thu Oct 10 08:48:22 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Thu, 10 Oct 2013 06:48:22 +0000 (UTC) Subject: [Libav-user] Extract frames in raw RGB formats References: Message-ID: Amir Hossein Rouhi writes: > I am wondering if anyone can help me how can i use > ffmpeg to extract frames in raw RGB image format. > The following code does not work: > ffmpeg -i foo.mp4 -r 1 -s 320x240 -f image2 foo-%03d.rgb This is at least missing -vcodec rawvideo Please add the complete, uncut console output when asking for help here. Carl Eugen From leshadorofeev at gmail.com Thu Oct 10 09:13:31 2013 From: leshadorofeev at gmail.com (=?KOI8-R?B?4czFy9PFyiDkz9LPxsXF1w==?=) Date: Thu, 10 Oct 2013 10:13:31 +0300 Subject: [Libav-user] memory leak when I-frame is delayed Message-ID: Hello! I'm using function avcodec_decode_video2() to decode streaming h.264 video in WOIP-application. My application is receiving the video packets by network over RTP. I'm seeing memory leak in case when the first INTRA-frame is delayed. The more times avcodec_decode_video2() is called before the arrival of the first I-frame, the more memory is allocated in heap and isn't released after the destruction of the AVContext and AVFrame. Thank for help. -------------- next part -------------- An HTML attachment was scrubbed... URL: From cehoyos at ag.or.at Thu Oct 10 09:55:01 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Thu, 10 Oct 2013 07:55:01 +0000 (UTC) Subject: [Libav-user] memory leak when I-frame is delayed References: Message-ID: ??????? ???????? writes: > I'm seeing memory leak in case when the first > INTRA-frame is delayed. Did you try to reproduce with ffmpeg (the application) and valgrind? Carl Eugen From leshadorofeev at gmail.com Thu Oct 10 17:36:48 2013 From: leshadorofeev at gmail.com (=?KOI8-R?B?4czFy9PFyiDkz9LPxsXF1w==?=) Date: Thu, 10 Oct 2013 18:36:48 +0300 Subject: [Libav-user] memory leak when I-frame is delayed Message-ID: I have my own simple h.264 test. Test reads YUV frames from file, encodes to h.264 frames and after decodes. Test is leaking too. I've used valgring and massif to get memory snapshots in runtime. There are two points where memory is leaking: ->30.61% (13,777,514B) 0x1019308: av_mallocz (mem.c:93) | ->21.78% (9,804,266B) 0xEAF177: av_fast_padded_malloc (utils.c:87) | | ->21.78% (9,804,266B) 0xBA9845: ff_h264_decode_nal (h264.c:500) | | ->21.78% (9,804,266B) 0xBC2780: decode_nal_units (h264.c:4463) | | ->21.78% (9,804,266B) 0xBC3E22: decode_frame (h264.c:4811) | | ->21.78% (9,804,266B) 0xE1415A: frame_worker_thread (pthread.c:390) | | ->21.78% (9,804,266B) 0x86158C8: start_thread (pthread_create.c:300) | | ->21.78% (9,804,266B) 0x90A686B: clone (clone.S:112) | | | ->03.71% (1,668,992B) in 29 places, all below massif's threshold (01.00%) | | | ->03.62% (1,631,488B) 0xBAB842: ff_h264_frame_start (h264.c:291) | | ->03.62% (1,631,488B) 0xBC1026: decode_slice_header (h264.c:3494) | | ->03.62% (1,631,488B) 0xBC2CDE: decode_nal_units (h264.c:4563) | | ->03.62% (1,631,488B) 0xBC3E22: decode_frame (h264.c:4811) | | ->03.62% (1,631,488B) 0xE1415A: frame_worker_thread (pthread.c:390) | | ->03.62% (1,631,488B) 0x86158C8: start_thread (pthread_create.c:300) | | ->03.62% (1,631,488B) 0x90A686B: clone (clone.S:112) Alexey Dorofeev -------------- next part -------------- An HTML attachment was scrubbed... URL: From sylviojalves at gmail.com Thu Oct 10 16:11:01 2013 From: sylviojalves at gmail.com (sirvo) Date: Thu, 10 Oct 2013 07:11:01 -0700 (PDT) Subject: [Libav-user] HW decoding on Android In-Reply-To: References: <51C4D7BB.5090904@gmail.com> <201307112034.32601.cehoyos@ag.or.at> Message-ID: <1381414261739-4658632.post@n4.nabble.com> Hi. We develop an android player using ffmpeg lib. It plays .ts files but when it comes to 1080p files, it runs really slow (like 10~15 fps). The problem is that sws_scale() and avcodec_video_decoder2() takes to much time to get it done (> 30ms). Then, I've compiled ffmpeg with libstagefright_h264 support for android. It still plays .ts files and also in slow mode with 1080p. How do I check if hw accel is being used? I've tried changing the avcodec_find_decoder like bellow but not success: codec = avcodec_find_decoder(codecCtx->codec_id); OR codec = avcodec_find_decoder_by_name("h264"); OR codec = avcodec_find_decoder_by_name("libstagefright_h264"); Is it necessary to init() something or use that AVHWACCEL from ffmpeg? Thanks! Sylvio -- View this message in context: http://libav-users.943685.n4.nabble.com/Libav-user-HW-decoding-on-Android-tp4657968p4658632.html Sent from the libav-users mailing list archive at Nabble.com. From chisholm at mitre.org Fri Oct 11 00:03:58 2013 From: chisholm at mitre.org (Michael Chisholm) Date: Thu, 10 Oct 2013 18:03:58 -0400 Subject: [Libav-user] Compile with g++ In-Reply-To: References: <1381181493.68633.YahooMailNeo@web164704.mail.gq1.yahoo.com> <525329E7.2020907@mitre.org> <1381186603.13585.YahooMailNeo@web164703.mail.gq1.yahoo.com> <52544579.9060105@mitre.org> <1381255948.14517.YahooMailNeo@web164703.mail.gq1.yahoo.com> <52546336.6050505@mitre.org> <5255A84D.70505@mitre.org> Message-ID: <5257244E.701@mitre.org> On 10/9/2013 8:33 PM, Carl Eugen Hoyos wrote: > Michael Chisholm writes: > >> So my point to all this is, the ffmpeg-2.0.1 headers >> aren't completely C++-friendly > > I don't think this is correct as such: > The headers are neither C++-friendly nor C++-unfriendly, > they are simply C headers and exactly the same > limitations apply than when using any other (non-trivial) > C headers from a C++ program. > I wasn't trying to make "C++-friendliness" an ffmpeg-specific metric. So yes, the same limitations apply when using ffmpeg as any other C library, from a C++ application. I think you can talk about C++-friendliness of a C header in general though. I think it's legitimate to think about the overlap between the C and C++ languages and to what extent a given piece of C code (even in a header) stays within the overlap or goes outside. I think C structs and function prototypes are usually not going to be problematic (I'm not an expert though). Areas I can see where you can tilt into C++-unfriendliness include inline functions and macros. Issues with inline code should be obvious: inline function definitions are given in headers, which exposes them to the C++ compiler. Macros in a C header could also expand to C code which could cause compile errors with a C++ compiler. How much of a problem the latter is depends on whether or not you really need to use the macro. You have the luxury of opting not to use a macro so the C++ compiler never sees the problematic C code and errors out. Not so with inline functions afaik. > The fact that some explicit casting is necessary > in C++ is completely orthogonal to the C++- > "friendliness" of the FFmpeg headers afaict. > The compile error I originally quoted is a poor example of the C++-friendliness of the headers. But I also had intended it as part of the question to James regarding which errors he was seeing. As you note, that casting error with av_mallocz() is not actually a header issue at all. That's one reason I decided to post a followup note. I realized that original "test" didn't do what I had intended. The followup addressed C++-friendliness better. > Do I understand correctly that you cannot use the > av_ts2timestr() macro from C++ but that it is not > used inside of FFmpeg in a way that makes using > one of the libraries or one of the headers > impossible? > (If you know how to fix it, consider sending a > patch, assuming it does not slow down the macro > for C, such a change is useful imo.) > Yes, that is correct. I don't know of an easy way to fix it; C++ just doesn't let you take addresses of temporaries. It seems like C++ treats it analogously to: void f(const int *i){...} f(&1); i.e. trying to take the address of 1. Andy From bruce at spearmorgan.com Fri Oct 11 01:20:33 2013 From: bruce at spearmorgan.com (Bruce Wheaton) Date: Thu, 10 Oct 2013 16:20:33 -0700 Subject: [Libav-user] Is libav thread-safe? In-Reply-To: <1381325281.62800.YahooMailNeo@web164704.mail.gq1.yahoo.com> References: <1381259137.76606.YahooMailNeo@web164705.mail.gq1.yahoo.com> <10585546-D342-45E3-AC05-1D24AC11F1EE@spearmorgan.com> <1381325281.62800.YahooMailNeo@web164704.mail.gq1.yahoo.com> Message-ID: <39BA6F4F-D77A-4D5A-83AB-E57F16FBDA1B@spearmorgan.com> On Oct 9, 2013, at 6:28 AM, James Board wrote: Actually I have already wasted several weeks or months of coding time doing what you suggested: assume ffmpeg/libav works the way you want it, then start coding. I didn't say that at all. Based on my experience, it's highly unlikely ffmpeg works the way you want. It works the way it works. Rather, I suggested building an app that does playback, then see if it will do what you want it to. > > I want to have multiple threads decoding different parts of the AVI file concurrently. No encoding will occur. Seems like it should be thread-safe. But I'd like to know for sure before I start coding. That's all. Ask questions first, code later. That stops me from complaining when libav doesn't do what I want. I'll just choose another route. Not sure anything would do that. There's too many assumptions about the file. File access doesn't even really work that way. Codecs that aren't i-frame only don't work that way. Even disk heads don't work that way. If you're deadset on it, in order to solve the problem you think you might have, then use multiple instances of a whole ffmpeg pipeline - file context, audio and video codec contexts. That's multi-threaded safe. Use the lockmanager functions to protect access to specific calls (getting codec instances etc.). My rule of thumb these days - is to assume that the collective intelligence of the people (not me, I'm just a 'user' of ffmpeg) who made the API I'm choosing is better than my singular, less specific experience. Every time I feel compelled to re-invent the wheel because I know better (coff, coff), it turns out the existing API decsions were better. Bruce > > > > > On , Bruce Wheaton wrote: > On Oct 8, 2013, at 12:05 PM, James Board wrote: > >> I want to create several pthreads in a C++ program (assuming you can call >> libav routines from a C++ program) that each call libav subroutines. > > Well, yes, you can call C from a C++ app. You need to mark the headers as C when you include them, but that's about it. > >> Are the libav subroutines thread-safe? Specifically, >> can several pthreads open the same AVI file and decode different video >> frames concurrently? > > No, not really. At least, you'd have to lock the access entirely, which would make it sequential. You can use each context in one thread, and there are a few overall functions that need locking, such as choosing the right codecs for a file. > >> >> I'm doing this so I can write a real-time video that >> can play the video forward and backwards, and the multiple threads will >> help decode and process each frame quickly so there will be no delay when >> I step through the video. > > Most codecs are multi-threaded by now - so there already are threads running to decode frames. You can set the number of threads you want a codec to use when you open it. > > There's a number of other things you could do... multiple codecs open etc. But with codecs that need B and P frames, you pretty much have to decode in order anyway, and file access is always going to be one at a time. > > It sounds like you're trying to solve a problem that you don't have yet. Start with the basics - just getting going from a cold start in ffmpeg is enough trouble for most people, without trying to get clever. > > Bruce > > > > > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > > > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user -------------- next part -------------- An HTML attachment was scrubbed... URL: From bruce at spearmorgan.com Fri Oct 11 01:34:32 2013 From: bruce at spearmorgan.com (Bruce Wheaton) Date: Thu, 10 Oct 2013 16:34:32 -0700 Subject: [Libav-user] Compile with g++ In-Reply-To: <1381328992.87316.YahooMailNeo@web164703.mail.gq1.yahoo.com> References: <1381181493.68633.YahooMailNeo@web164704.mail.gq1.yahoo.com> <525329E7.2020907@mitre.org> <1381186603.13585.YahooMailNeo@web164703.mail.gq1.yahoo.com> <52544579.9060105@mitre.org> <1381255948.14517.YahooMailNeo@web164703.mail.gq1.yahoo.com> <2916F205-707A-42B5-A879-8A0A916173C9@spearmorgan.com> <1381325529.26985.YahooMailNeo@web164702.mail.gq1.yahoo.com> <1381325830.69538.YahooMailNeo@web164704.mail.gq1.yahoo.com> <1381328992.87316.YahooMailNeo@web164703.mail.gq1.yahoo.com> Message-ID: On Oct 9, 2013, at 7:29 AM, James Board wrote: > > Really? The title of the mailing list is Libav-user at ffmpeg.org. > I'm asking whether libav can be used in C++ programs, if anyone > uses libav in C++ programs, and what I need to do in order to > use libav in C++ programs. How can that be inappropriate? That is confusing. The libraries that make up ffmpeg include libavcodec, libavformat etc. Hence the list - it's for users of the libraries, not the ffmpeg binary. To confuse matters, there was a fork, and they called that project LibAV. So - you're using libavformat, libavcodec etc. But - are you using source code obtained from the ffmpeg project, or the libav project? This list is specific to the ffmpeg project. > > Anyway, don't bother. I give up. You win. > LOL. I feel your pain. Sadly, a certain amount of chaff comes with using FOSS systems (nothing personal to the chaff providers on this thread). Lots of personalities. The upside outweighs the cost in humility that is required. Anyway... LibAV, I have no idea. FFmpeg, yes, you can compile and use it from C++ with very little problems - just the packaging around the headers so the compiler knows they are C, not C++. > When I compile demuxing.c with g++ it gives me the same errors as when I add libav calls to my C++ app and then try to compile that with g++. So, if we can figure out why demuxing.c won't compile with g++, then we will probably figure out why my C++ app won't compile with g++. This: just wrong. The fact that one C based example does or does not compile offers no evidence as to what your actual problem is. Bruce -------------- next part -------------- An HTML attachment was scrubbed... URL: From bowljoman at gmail.com Fri Oct 11 02:00:55 2013 From: bowljoman at gmail.com (Andy Shaules) Date: Thu, 10 Oct 2013 17:00:55 -0700 Subject: [Libav-user] Compile with g++ In-Reply-To: References: <1381181493.68633.YahooMailNeo@web164704.mail.gq1.yahoo.com> <525329E7.2020907@mitre.org> <1381186603.13585.YahooMailNeo@web164703.mail.gq1.yahoo.com> <52544579.9060105@mitre.org> <1381255948.14517.YahooMailNeo@web164703.mail.gq1.yahoo.com> <2916F205-707A-42B5-A879-8A0A916173C9@spearmorgan.com> <1381325529.26985.YahooMailNeo@web164702.mail.gq1.yahoo.com> <1381325830.69538.YahooMailNeo@web164704.mail.gq1.yahoo.com> <1381328992.87316.YahooMailNeo@web164703.mail.gq1.yahoo.com> Message-ID: <52573FB7.8080709@gmail.com> On 10/10/2013 4:34 PM, Bruce Wheaton wrote: > On Oct 9, 2013, at 7:29 AM, James Board > wrote: >> >> Really? The title of the mailing list is Libav-user at ffmpeg.org >> . >> I'm asking whether libav can be used in C++ programs, if anyone >> uses libav in C++ programs, and what I need to do in order to >> use libav in C++ programs. How can that be inappropriate? > > That is confusing. The libraries that make up ffmpeg include > libavcodec, libavformat etc. Hence the list - it's for users of the > libraries, not the ffmpeg binary. To confuse matters, there was a > fork, and they called that project LibAV. > > So - you're using libavformat, libavcodec etc. But - are you using > source code obtained from the ffmpeg project, or the libav project? > This list is specific to the ffmpeg project. > >> >> Anyway, don't bother. I give up. You win. >> > > LOL. I feel your pain. Sadly, a certain amount of chaff comes with > using FOSS systems (nothing personal to the chaff providers on this > thread). Lots of personalities. The upside outweighs the cost in > humility that is required. > > Anyway... LibAV, I have no idea. FFmpeg, yes, you can compile and use > it from C++ with very little problems - just the packaging around the > headers so the compiler knows they are C, not C++. > >> When I compile demuxing.c with g++ it gives me the same errors as >> when I add libav calls to my C++ app and then try to compile that >> with g++. So, if we can figure out why demuxing.c won't compile with >> g++, then we will probably figure out why my C++ app won't compile >> with g++. > > This: just wrong. The fact that one C based example does or does not > compile offers no evidence as to what your actual problem is. > > Bruce > > > > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user Hello, I did just fine with my c++ app and even with a c++ dll that exposed a simplified set of av_codec compression functions. As someone mentioned earlier, it was as easy as: extern "C" { #include #include #include #include } Have Fun! -------------- next part -------------- An HTML attachment was scrubbed... URL: From amir.rouhi at rmit.edu.au Fri Oct 11 04:43:00 2013 From: amir.rouhi at rmit.edu.au (Amir Hossein Rouhi) Date: Fri, 11 Oct 2013 13:43:00 +1100 Subject: [Libav-user] Extract frames in raw RGB formats In-Reply-To: References: Message-ID: Hi Carl What the bellow command line generate is a raw image but in YUV 4:2:0 format. what i want is RGB raw image. I know there is a formula to convert YUV to RGB but i need pure RGB in the file. even i tried to use -pix_fmt but could not find any parameter for RGB. Would you please give advice? ffmpeg -i c:\foo.mp4 -r 1 -s 320x240 -vcodec rawvideo -pix_fmt uyvy422 -f image2 c:\foo-%03d.rgb On 10 October 2013 17:48, Carl Eugen Hoyos wrote: > Amir Hossein Rouhi writes: > > > I am wondering if anyone can help me how can i use > > ffmpeg to extract frames in raw RGB image format. > > The following code does not work: > > ffmpeg -i foo.mp4 -r 1 -s 320x240 -f image2 foo-%03d.rgb > > This is at least missing -vcodec rawvideo > > Please add the complete, uncut console output > when asking for help here. > > Carl Eugen > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > -- Amir H. Rouhi Advisor, Statistics & Reporting Unit Policy and Planning Group RMIT University GPO Box 2476V Melbourne VIC 3001 Australia Phone: +61 3 9925 4244 Fax: +61 3 9925 4200 Email: amir.rouhi at rmit.edu.au -------------- next part -------------- An HTML attachment was scrubbed... URL: From alexcohn at netvision.net.il Fri Oct 11 08:42:36 2013 From: alexcohn at netvision.net.il (Alex Cohn) Date: Fri, 11 Oct 2013 08:42:36 +0200 Subject: [Libav-user] HW decoding on Android In-Reply-To: References: <51C4D7BB.5090904@gmail.com> <201307112034.32601.cehoyos@ag.or.at> <1381414261739-4658632.post@n4.nabble.com> Message-ID: On Oct 11, 2013 12:40 AM, "sirvo" wrote: > > Hi. > > We develop an android player using ffmpeg lib. It plays .ts files but when > it comes to 1080p files, it runs really slow (like 10~15 fps). The problem > is that sws_scale() and avcodec_video_decoder2() takes to much time to get > it done (> 30ms). > > Then, I've compiled ffmpeg with libstagefright_h264 support for android. > > It still plays .ts files and also in slow mode with 1080p. Which device did you try? Older devices may have no hardware capable of 1080p, main profile. > How do I check if hw accel is being used? The easiest check would be to look at the logcat for OMX related messages. > I've tried changing the avcodec_find_decoder like bellow but not success: > > codec = avcodec_find_decoder(codecCtx->codec_id); > OR > codec = avcodec_find_decoder_by_name("h264"); > OR > codec = avcodec_find_decoder_by_name("libstagefright_h264"); > > Is it necessary to init() something or use that AVHWACCEL from ffmpeg? > > Thanks! > > Sylvio BR, Alex Cohn -------------- next part -------------- An HTML attachment was scrubbed... URL: From rafaware at gmail.com Fri Oct 11 08:43:48 2013 From: rafaware at gmail.com (Rafa Lopez) Date: Fri, 11 Oct 2013 08:43:48 +0200 Subject: [Libav-user] [h264] RTP: missed X packets: corrupted images Message-ID: Hi all I'm using the latest version of libav (2.0.2). I'm writing a simple code test (attached with .pro file) for camera streaming. My libav is compiled by me in debian squeeze amd64 (./configure --prefix=/opt/ffmpeg/ --enable-shared && make && make install) If my simple code test is compiled against ffmpeg 0.8.15, I have no problem. If my simple code test is compiled againts ffmpeg 2.0.2 I have always the same problem: [h264 @ 0xbe40a0] RTP: missed 12 packets this message is repetead hundreds of times with other messages like this: [h264 @ 0x1d102c0] mb_type 27 in P slice too large at 23 23 [h264 @ 0x1d102c0] error while decoding MB 23 23 [h264 @ 0x1d102c0] Cannot use next picture in error concealment [h264 @ 0x1d102c0] concealing 2986 DC, 2986 AC, 2986 MV errors in P frame and sws_scale give me a corrupted image (attached). I attach the ouput of my program with AV_LOG_DEBUG Anyone can help me? Best Regards Rafael L. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- [rtsp @ 0x1070000] SDP: v=0 o=- 0 0 IN IP4 192.168.0.95 s=rtsp://192.168.0.95/profile1 c=IN IP4 0.0.0.0 t=0 0 m=application 0 RTP/AVP 122 a=rtpmap:122 vnd.onvif.metadata/90000 a=control:rtsp://192.168.0.95/profile1/METAEnc m=audio 0 RTP/AVP 0 a=rtpmap:0 PCMU/8000/1 a=control:rtsp://192.168.0.95/profile1/G711Enc m=video 0 RTP/AVP 99 a=rtpmap:99 H264/90000 a=fmtp:99 sprop-parameter-sets=Z0LgKdoBQB5puAgIMBAAAA==,aM48gA==;packetization-mode=1;profile-level-id=42e029 a=control:rtsp://192.168.0.95/profile1/AVCESEnc a=framerate:30.0 [rtsp @ 0x1070000] audio codec set to: pcm_mulaw [rtsp @ 0x1070000] audio samplerate set to: 8000 [rtsp @ 0x1070000] audio channels set to: 1 [rtsp @ 0x1070000] video codec set to: h264 [NULL @ 0x10740c0] Extradata set to 0x105d840 (size: 28)! [NULL @ 0x10740c0] RTP Packetization Mode: 1 [NULL @ 0x10740c0] RTP Profile IDC: 42 Profile IOP: e0 Level: 29 [rtsp @ 0x1070000] hello state=0 [h264 @ 0x10740c0] Current profile doesn't provide more RBSP data in PPS, skipping [rtsp @ 0x1070000] All info found rfps: 29,333333 0,019482 rfps: 29,416667 0,016022 rfps: 29,500000 0,013077 rfps: 29,583333 0,010647 rfps: 29,666667 0,008732 rfps: 29,666667 0,008732 rfps: 29,750000 0,007333 rfps: 29,750000 0,007333 rfps: 29,833333 0,006448 rfps: 29,916667 0,006080 rfps: 30,000000 0,006226 rfps: 30,083333 0,006888 rfps: 30,166667 0,008065 rfps: 30,250000 0,009757 rfps: 30,250000 0,009757 rfps: 30,333333 0,011964 rfps: 30,333333 0,011964 rfps: 30,416667 0,014687 rfps: 30,500000 0,017925 rfps: 29,970030 0,006114 detected 4 logical cores 0 true 1 true 2 true 3 true 4 true 5 true 6 true 7 true 8 true 9 true 10 true 11 true 12 true 13 true 14 true 15 true 16 true 17 true 18 true 19 true 20 true 21 true 22 true 23 true 24 true 25 true [h264 @ 0x10740c0] RTP: missed 143 packets [h264 @ 0x10740c0] RTP: missed 662 packets [h264 @ 0x10740c0] RTP: missed 231 packets [h264 @ 0x12a2880] out of range intra chroma pred mode at 24 34 [h264 @ 0x12a2880] error while decoding MB 24 34 [h264 @ 0x12a2880] concealing 2105 DC, 2105 AC, 2105 MV errors in I frame 26 true [h264 @ 0x10740c0] RTP: missed 16 packets [h264 @ 0x10d62c0] Frame num gap 9 7 27 true [h264 @ 0x10740c0] RTP: missed 15 packets [h264 @ 0x11a0b20] Frame num gap 11 9 28 true [h264 @ 0x11a0f80] Frame num gap 13 11 29 true 30 true [h264 @ 0x10740c0] RTP: missed 39 packets [h264 @ 0x12a2880] out of range intra chroma pred mode at 5 31 [h264 @ 0x12a2880] error while decoding MB 5 31 [h264 @ 0x12a2880] concealing 2364 DC, 2364 AC, 2364 MV errors in I frame 31 true [h264 @ 0x10740c0] RTP: missed 32 packets [h264 @ 0x10d62c0] Frame num gap 2 0 [h264 @ 0x10d62c0] Cannot use next picture in error concealment [h264 @ 0x10d62c0] concealing 4188 DC, 4188 AC, 4188 MV errors in P frame 32 true [h264 @ 0x10740c0] RTP: missed 26 packets [h264 @ 0x11a0b20] Frame num gap 4 2 [h264 @ 0x11a0b20] Cannot use next picture in error concealment [h264 @ 0x11a0b20] concealing 2726 DC, 2726 AC, 2726 MV errors in P frame 33 true [h264 @ 0x11a0f80] Frame num gap 6 4 34 true [h264 @ 0x10740c0] RTP: missed 15 packets [h264 @ 0x11a1840] Cannot use next picture in error concealment [h264 @ 0x11a1840] concealing 4457 DC, 4457 AC, 4457 MV errors in P frame 35 true 36 true 37 true 38 true 39 true [h264 @ 0x10740c0] RTP: missed 29 packets [h264 @ 0x11a1840] Cannot use next picture in error concealment [h264 @ 0x11a1840] concealing 4038 DC, 4038 AC, 4038 MV errors in P frame 40 true [h264 @ 0x10740c0] RTP: missed 25 packets [h264 @ 0x10740c0] RTP: missed 81 packets [h264 @ 0x12a2880] Frame num gap 14 12 [h264 @ 0x12a2880] out of range intra chroma pred mode at 9 28 [h264 @ 0x12a2880] error while decoding MB 9 28 [h264 @ 0x12a2880] Cannot use next picture in error concealment [h264 @ 0x12a2880] concealing 2600 DC, 2600 AC, 2600 MV errors in P frame 41 true [h264 @ 0x10740c0] RTP: missed 9 packets [h264 @ 0x10d62c0] Frame num gap 3 1 [h264 @ 0x10d62c0] no picture ooo [h264 @ 0x10d62c0] Cannot use next picture in error concealment [h264 @ 0x10d62c0] concealing 2314 DC, 2314 AC, 2314 MV errors in P frame 42 true [h264 @ 0x10740c0] RTP: missed 17 packets [h264 @ 0x11a0b20] no picture ooo [h264 @ 0x11a0b20] Cannot use next picture in error concealment [h264 @ 0x11a0b20] concealing 234 DC, 234 AC, 234 MV errors in P frame 43 true [h264 @ 0x11a0f80] Frame num gap 6 4 [h264 @ 0x11a0f80] no picture ooo 44 true [h264 @ 0x11a1840] no picture ooo 45 true [h264 @ 0x10740c0] RTP: missed 19 packets [h264 @ 0x12a2880] no picture ooo [h264 @ 0x10d62c0] Frame num gap 10 8 [h264 @ 0x10740c0] RTP: missed 15 packets [h264 @ 0x10d62c0] no picture ooo [h264 @ 0x10740c0] RTP: missed 23 packets [h264 @ 0x11a0b20] no picture ooo [h264 @ 0x10740c0] RTP: missed 1 packets [h264 @ 0x11a0f80] no picture ooo [h264 @ 0x11a1840] Frame num gap 14 12 [h264 @ 0x12a2880] Cannot use next picture in error concealment [h264 @ 0x12a2880] concealing 952 DC, 952 AC, 952 MV errors in P frame [h264 @ 0x11a0b20] Cannot use next picture in error concealment [h264 @ 0x11a0b20] concealing 4465 DC, 4465 AC, 4465 MV errors in P frame [h264 @ 0x11a0f80] cbp too large (1781) at 48 33 [h264 @ 0x11a0f80] error while decoding MB 48 33 [h264 @ 0x11a0f80] Cannot use next picture in error concealment [h264 @ 0x11a0f80] concealing 2161 DC, 2161 AC, 2161 MV errors in P frame [h264 @ 0x11a1840] Cannot use next picture in error concealment [h264 @ 0x11a1840] concealing 258 DC, 258 AC, 258 MV errors in P frame [h264 @ 0x10740c0] RTP: missed 82 packets [h264 @ 0x10740c0] RTP: missed 18 packets [h264 @ 0x10d62c0] Frame num gap 2 0 [h264 @ 0x12a2880] concealing 4069 DC, 4069 AC, 4069 MV errors in I frame [h264 @ 0x10d62c0] Cannot use next picture in error concealment [h264 @ 0x10d62c0] concealing 458 DC, 458 AC, 458 MV errors in P frame [h264 @ 0x11a0b20] Frame num gap 4 2 46 true 47 true 48 true 49 true 50 true 51 true 52 true 53 true 54 true [h264 @ 0x10740c0] RTP: missed 5 packets [h264 @ 0x11a0b20] Cannot use next picture in error concealment [h264 @ 0x11a0b20] concealing 1277 DC, 1277 AC, 1277 MV errors in P frame 55 true [h264 @ 0x10740c0] RTP: missed 53 packets [h264 @ 0x10740c0] RTP: missed 19 packets [h264 @ 0x11a0f80] out of range intra chroma pred mode at 78 17 [h264 @ 0x11a0f80] error while decoding MB 78 17 [h264 @ 0x11a0f80] concealing 3411 DC, 3411 AC, 3411 MV errors in I frame 56 true [h264 @ 0x10740c0] RTP: missed 18 packets [h264 @ 0x11a1840] Frame num gap 2 0 [h264 @ 0x11a1840] out of range intra chroma pred mode at 53 55 [h264 @ 0x11a1840] error while decoding MB 53 55 [h264 @ 0x11a1840] Cannot use next picture in error concealment [h264 @ 0x11a1840] concealing 396 DC, 396 AC, 396 MV errors in P frame 57 true [h264 @ 0x10740c0] RTP: missed 17 packets [h264 @ 0x12a2880] Frame num gap 4 2 [h264 @ 0x12a2880] Cannot use next picture in error concealment [h264 @ 0x12a2880] concealing 203 DC, 203 AC, 203 MV errors in P frame 58 true [h264 @ 0x10740c0] RTP: missed 16 packets [h264 @ 0x10d62c0] Frame num gap 6 4 59 true [h264 @ 0x11a0b20] Frame num gap 8 6 60 true [h264 @ 0x10740c0] RTP: missed 11 packets [h264 @ 0x11a0f80] Cannot use next picture in error concealment [h264 @ 0x11a0f80] concealing 3147 DC, 3147 AC, 3147 MV errors in P frame 61 true [h264 @ 0x10740c0] RTP: missed 16 packets 62 true [h264 @ 0x12a2880] Frame num gap 12 10 63 true [h264 @ 0x10740c0] RTP: missed 14 packets [h264 @ 0x10d62c0] Cannot use next picture in error concealment [h264 @ 0x10d62c0] concealing 4499 DC, 4499 AC, 4499 MV errors in P frame 64 true [h264 @ 0x10740c0] RTP: missed 17 packets [h264 @ 0x10740c0] RTP: missed 75 packets [h264 @ 0x11a0b20] out of range intra chroma pred mode at 46 58 [h264 @ 0x11a0b20] error while decoding MB 46 58 [h264 @ 0x11a0b20] Cannot use next picture in error concealment [h264 @ 0x11a0b20] concealing 163 DC, 163 AC, 163 MV errors in P frame 65 true [h264 @ 0x10740c0] RTP: missed 25 packets [h264 @ 0x11a0f80] Frame num gap 3 1 [h264 @ 0x11a0f80] no picture ooo [h264 @ 0x11a0f80] Cannot use next picture in error concealment [h264 @ 0x11a0f80] concealing 2289 DC, 2289 AC, 2289 MV errors in P frame 66 true [h264 @ 0x10740c0] RTP: missed 3 packets [h264 @ 0x10740c0] RTP: missed 5 packets [h264 @ 0x11a1840] Frame num gap 5 3 [h264 @ 0x11a1840] no picture ooo [h264 @ 0x11a1840] Cannot use next picture in error concealment [h264 @ 0x11a1840] concealing 732 DC, 732 AC, 732 MV errors in P frame 67 true [h264 @ 0x10740c0] RTP: missed 11 packets [h264 @ 0x12a2880] Frame num gap 7 5 [h264 @ 0x12a2880] no picture ooo [h264 @ 0x12a2880] Cannot use next picture in error concealment [h264 @ 0x12a2880] concealing 3008 DC, 3008 AC, 3008 MV errors in P frame 68 true [h264 @ 0x10740c0] RTP: missed 25 packets [h264 @ 0x10d62c0] no picture ooo [h264 @ 0x10d62c0] Cannot use next picture in error concealment [h264 @ 0x10d62c0] concealing 2631 DC, 2631 AC, 2631 MV errors in P frame 69 true [h264 @ 0x10740c0] RTP: missed 21 packets [h264 @ 0x11a0b20] Frame num gap 10 8 [h264 @ 0x11a0b20] no picture ooo [h264 @ 0x11a0f80] Frame num gap 12 10 [h264 @ 0x10740c0] RTP: missed 1 packets [h264 @ 0x11a0f80] no picture ooo [h264 @ 0x10740c0] RTP: missed 9 packets [h264 @ 0x11a0b20] Cannot use next picture in error concealment [h264 @ 0x11a0b20] concealing 1495 DC, 1495 AC, 1495 MV errors in P frame [h264 @ 0x11a1840] no picture ooo [h264 @ 0x10740c0] RTP: missed 92 packets [h264 @ 0x10d62c0] concealing 3494 DC, 3494 AC, 3494 MV errors in I frame [h264 @ 0x12a2880] Cannot use next picture in error concealment [h264 @ 0x12a2880] concealing 2360 DC, 2360 AC, 2360 MV errors in P frame [h264 @ 0x11a1840] Cannot use next picture in error concealment [h264 @ 0x11a1840] concealing 120 DC, 120 AC, 120 MV errors in P frame [h264 @ 0x10740c0] RTP: missed 2 packets [h264 @ 0x11a0b20] Frame num gap 3 1 [h264 @ 0x10740c0] RTP: missed 27 packets [h264 @ 0x11a0f80] Cannot use next picture in error concealment [h264 @ 0x11a0f80] concealing 2727 DC, 2727 AC, 2727 MV errors in P frame [h264 @ 0x11a0b20] Cannot use next picture in error concealment [h264 @ 0x11a0b20] concealing 508 DC, 508 AC, 508 MV errors in P frame [h264 @ 0x11a1840] Frame num gap 6 4 70 true 71 true 72 true 73 true 74 true 75 true 76 true 77 true 78 true [h264 @ 0x10740c0] RTP: missed 9 packets [h264 @ 0x10740c0] RTP: missed 71 packets [h264 @ 0x11a0f80] out of range intra chroma pred mode at 43 13 [h264 @ 0x11a0f80] error while decoding MB 43 13 [h264 @ 0x11a0f80] concealing 3766 DC, 3766 AC, 3766 MV errors in I frame 79 true [h264 @ 0x10740c0] RTP: missed 17 packets [h264 @ 0x11a1840] Frame num gap 3 1 [h264 @ 0x11a1840] Cannot use next picture in error concealment [h264 @ 0x11a1840] concealing 155 DC, 155 AC, 155 MV errors in P frame 80 true [h264 @ 0x10740c0] RTP: missed 16 packets [h264 @ 0x12a2880] Frame num gap 5 3 [h264 @ 0x12a2880] Cannot use next picture in error concealment [h264 @ 0x12a2880] concealing 253 DC, 253 AC, 253 MV errors in P frame 81 true [h264 @ 0x10d62c0] Frame num gap 7 5 82 true [h264 @ 0x10740c0] RTP: missed 15 packets [h264 @ 0x11a0b20] Cannot use next picture in error concealment [h264 @ 0x11a0b20] concealing 4451 DC, 4451 AC, 4451 MV errors in P frame 83 true 84 true 85 true 86 true 87 true [h264 @ 0x10740c0] RTP: missed 11 packets [h264 @ 0x11a0b20] Cannot use next picture in error concealment [h264 @ 0x11a0b20] concealing 3366 DC, 3366 AC, 3366 MV errors in P frame 88 true [h264 @ 0x10740c0] RTP: missed 33 packets [h264 @ 0x10740c0] RTP: missed 63 packets [h264 @ 0x10740c0] RTP: missed 20 packets [h264 @ 0x11a0f80] P sub_mb_type 32 out of range at 39 32 [h264 @ 0x11a0f80] error while decoding MB 39 32 [h264 @ 0x11a0f80] Cannot use next picture in error concealment [h264 @ 0x11a0f80] concealing 2250 DC, 2250 AC, 2250 MV errors in P frame 89 true [h264 @ 0x10740c0] RTP: missed 17 packets [h264 @ 0x11a1840] Frame num gap 4 2 [h264 @ 0x11a1840] no picture ooo [h264 @ 0x11a1840] mb_type 42 in P slice too large at 68 58 [h264 @ 0x11a1840] error while decoding MB 68 58 [h264 @ 0x11a1840] Cannot use next picture in error concealment [h264 @ 0x11a1840] concealing 141 DC, 141 AC, 141 MV errors in P frame 90 true [h264 @ 0x12a2880] Frame num gap 6 4 [h264 @ 0x12a2880] no picture ooo 91 true [h264 @ 0x10740c0] RTP: missed 14 packets [h264 @ 0x10d62c0] no picture ooo [h264 @ 0x10d62c0] out of range intra chroma pred mode at 24 4 [h264 @ 0x10d62c0] error while decoding MB 24 4 [h264 @ 0x10d62c0] Cannot use next picture in error concealment [h264 @ 0x10d62c0] concealing 4505 DC, 4505 AC, 4505 MV errors in P frame 92 true [h264 @ 0x10740c0] RTP: missed 1 packets [h264 @ 0x11a0b20] no picture ooo [h264 @ 0x11a0b20] Cannot use next picture in error concealment [h264 @ 0x11a0b20] concealing 260 DC, 260 AC, 260 MV errors in P frame 93 true [h264 @ 0x10740c0] RTP: missed 18 packets [h264 @ 0x11a0f80] no picture ooo [h264 @ 0x11a1840] Frame num gap 11 9 [h264 @ 0x11a1840] no picture ooo [h264 @ 0x12a2880] no picture ooo [h264 @ 0x10740c0] RTP: missed 10 packets [h264 @ 0x10740c0] RTP: missed 29 packets [h264 @ 0x10740c0] RTP: missed 77 packets [h264 @ 0x10d62c0] no picture ooo [h264 @ 0x11a0f80] Cannot use next picture in error concealment [h264 @ 0x11a0f80] concealing 545 DC, 545 AC, 545 MV errors in P frame [h264 @ 0x10d62c0] Cannot use next picture in error concealment [h264 @ 0x10d62c0] concealing 2961 DC, 2961 AC, 2961 MV errors in P frame [h264 @ 0x11a0b20] mb_type 92 in P slice too large at 53 31 [h264 @ 0x11a0b20] error while decoding MB 53 31 [h264 @ 0x11a0b20] Cannot use next picture in error concealment [h264 @ 0x11a0b20] concealing 2316 DC, 2316 AC, 2316 MV errors in P frame [h264 @ 0x10740c0] RTP: missed 16 packets [h264 @ 0x11a0f80] Frame num gap 3 1 [h264 @ 0x11a0f80] no picture ooo [h264 @ 0x11a1840] Frame num gap 5 3 [h264 @ 0x11a1840] no picture ooo [h264 @ 0x12a2880] no picture ooo [h264 @ 0x10d62c0] no picture ooo 94 true [h264 @ 0x11a0b20] no picture ooo [h264 @ 0x11a0f80] no picture ooo [h264 @ 0x11a1840] no picture ooo [h264 @ 0x12a2880] no picture ooo [h264 @ 0x10d62c0] no picture ooo [h264 @ 0x11a0b20] no picture ooo 95 true 96 true 97 true 98 true 99 true -------------- next part -------------- A non-text attachment was scrubbed... Name: ffmpegTest.pro Type: application/octet-stream Size: 757 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: main.cpp Type: text/x-c++src Size: 5275 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 37.jpg Type: image/jpeg Size: 11884 bytes Desc: not available URL: From cehoyos at ag.or.at Fri Oct 11 10:14:24 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Fri, 11 Oct 2013 08:14:24 +0000 (UTC) Subject: [Libav-user] Extract frames in raw RGB formats References: Message-ID: Amir Hossein Rouhi writes: > What the bellow command line generate is a raw image > but in YUV 4:2:0 format. what i want is RGB raw image. > I know there is a formula to convert YUV to RGB but i > need pure RGB in the file. even i tried to use > -pix_fmt but could not find any parameter for RGB. Try "ffmpeg -pix_fmts", there are several rgb formats, among them rgb24. Please understand that top-posting is not welcome here and that you are expected to always post your failing command line together with the complete, uncut console output. Carl Eugen From marikaner at gmail.com Fri Oct 11 21:29:52 2013 From: marikaner at gmail.com (Marika Marszalkowski) Date: Fri, 11 Oct 2013 21:29:52 +0200 Subject: [Libav-user] [libav-user] avcodec_open2 cannot open h264 codec Message-ID: Hello everyone, I am trying to encode an .mkv file from jpeg images. Opening the codec with avcodec_open2 fails with the following error: [libx264 @ 0x7fffb8003200] broken ffmpeg default settings detected [libx264 @ 0x7fffb8003200] use an encoding preset (e.g. -vpre medium) [libx264 @ 0x7fffb8003200] preset usage: -vpre -vpre [libx264 @ 0x7fffb8003200] speed presets are listed in x264 --help [libx264 @ 0x7fffb8003200] profile is optional; x264 defaults to high Those are the settings I am using: pCodecCtx = pVideoStream->codec; pCodecCtx->codec_id = pOutputFormat->video_codec; pCodecCtx->codec_type = AVMEDIA_TYPE_VIDEO; pCodecCtx->bit_rate = Bitrate; pCodecCtx->width = getWidth(); pCodecCtx->height = getHeight(); pCodecCtx->time_base.den = fps; pCodecCtx->time_base.num = 1; pCodecCtx->gop_size = Gop; pCodecCtx->pix_fmt = PIX_FMT_YUV420P; pCodecCtx->thread_count = 10; And this is what av_dump_format gives me: Output #0, matroska, to '/home/marika/test.mkv': Stream #0:0: Video: h264, yuv420p, 1920x1080, q=2-31, 50 kb/s, 90k tbn, 30 tbc Any ideas? Thanks Marika -------------- next part -------------- An HTML attachment was scrubbed... URL: From bakhtiyarov.dima at gmail.com Fri Oct 11 21:42:53 2013 From: bakhtiyarov.dima at gmail.com (Bakhtiyarov Dmitriy) Date: Fri, 11 Oct 2013 23:42:53 +0400 Subject: [Libav-user] [libav-user] avcodec_open2 cannot open h264 codec In-Reply-To: References: Message-ID: Hello, Marika. I think you should set some additional parameters. For example, you should select profile of h264(High, Baseline or any another). And you can use some preset options and modify it. I use libx264 for encoding and I use this code for set options: m_params = new x264_param_t; x264_param_default_preset(m_params, "ultrafast", "fastdecode,zerolatency"); //you should select options neededfor you m_params->i_width = m_out_width; m_params->i_height = m_out_height; m_params->i_threads = 2; m_params->i_fps_num = m_fps; m_params->i_fps_den = 1; m_params->i_keyint_max = 45; m_params->b_intra_refresh = 0; m_params->rc.i_rc_method = X264_RC_CRF; m_params->rc.f_rf_constant = 25; m_params->rc.f_rf_constant_max = 35;//?? m_params->b_repeat_headers = 1; m_params->b_annexb = 1; x264_param_apply_profile(m_params, "baseline"); //I think you MUST select profile m_encoder = x264_encoder_open(m_params); With best regards, Bakhtiyarov Dmitriy 2013/10/11 Marika Marszalkowski > Hello everyone, > > I am trying to encode an .mkv file from jpeg images. Opening the codec > with avcodec_open2 fails with the following error: > > [libx264 @ 0x7fffb8003200] broken ffmpeg default settings detected > > [libx264 @ 0x7fffb8003200] use an encoding preset (e.g. -vpre medium) > > [libx264 @ 0x7fffb8003200] preset usage: -vpre -vpre > > [libx264 @ 0x7fffb8003200] speed presets are listed in x264 --help > > [libx264 @ 0x7fffb8003200] profile is optional; x264 defaults to high > > > Those are the settings I am using: > > > pCodecCtx = pVideoStream->codec; > > pCodecCtx->codec_id = pOutputFormat->video_codec; > > pCodecCtx->codec_type = AVMEDIA_TYPE_VIDEO; > > > pCodecCtx->bit_rate = Bitrate; > > pCodecCtx->width = getWidth(); > > pCodecCtx->height = getHeight(); > > pCodecCtx->time_base.den = fps; > > pCodecCtx->time_base.num = 1; > > pCodecCtx->gop_size = Gop; > > pCodecCtx->pix_fmt = PIX_FMT_YUV420P; > > pCodecCtx->thread_count = 10; > > > And this is what av_dump_format gives me: > > > Output #0, matroska, to '/home/marika/test.mkv': > > Stream #0:0: Video: h264, yuv420p, 1920x1080, q=2-31, 50 kb/s, 90k tbn, 30 tbc > > > Any ideas? > > > Thanks > > Marika > > > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From fkwatson at aol.com Fri Oct 11 23:57:23 2013 From: fkwatson at aol.com (fkwatson at aol.com) Date: Fri, 11 Oct 2013 17:57:23 -0400 (EDT) Subject: [Libav-user] Fwd: Problems with RTMP streams on FFMpeg In-Reply-To: References: Message-ID: <8D094E3FFDF0B22-1464-1A41E@webmail-m202.sysops.aol.com> Li, This is typical for any streaming application. The server is sending packets at rate Rs ffmpeg is playing at Rf. For streaming content these rates will only be equal if the sender and receiver are using the same clock source. Apparently Rf > Rs, so you keep running out of packets. I don't know of any simple solution for this. -Felix -----Original Message----- From: Zuwei Li To: libav-user Sent: Tue, Oct 8, 2013 9:28 pm Subject: [Libav-user] Fwd: Problems with RTMP streams on FFMpeg I am using FFMpeg to receive RTMP streams. It decodes and plays the RTMP stream correctly but I have problems playing the video for long periods of time. It seems that av_read_frame(format_context, &packet); returns an AVERROR_EOF after playing for a period in time say 7 or 8 mins, this occurs randomly, when that happens I presume that the stream has ended so my playback stops. However, the playback hasn't reached the actual video duration. My question is if this behaviour is characteristic of RTMP streams, if so is there a way to properly stream RTMP reliably so the playback can continue for long periods using FFMpeg -- Li Zuwei _______________________________________________ Libav-user mailing list Libav-user at ffmpeg.org http://ffmpeg.org/mailman/listinfo/libav-user -------------- next part -------------- An HTML attachment was scrubbed... URL: From er.anshul.maheshwari at gmail.com Sat Oct 12 14:28:09 2013 From: er.anshul.maheshwari at gmail.com (Anshul Maheshwari) Date: Sat, 12 Oct 2013 17:58:09 +0530 Subject: [Libav-user] need tp play rtsp stream Message-ID: Hi guys I need to play an rtsp stream, whose url is something like this rtsp:// 10.110.1.158:554/StreamingSetting?version=1.0&ChannelID=1&ChannelName=Channel1&action=getRTSPStream&sessionID=7936398 The above url is playable in vlc as it is, but using ffmpeg or fflay , i am not able to get stream, does any change is required in above url. I think ffplay or ffmpeg does not take the parameter passed using & -- with regards Anshul :) -------------- next part -------------- An HTML attachment was scrubbed... URL: From jpboard2 at yahoo.com Sat Oct 12 21:51:04 2013 From: jpboard2 at yahoo.com (James Board) Date: Sat, 12 Oct 2013 12:51:04 -0700 (PDT) Subject: [Libav-user] Decode every 24-th frame. Cached decoded frames? Message-ID: <1381607464.92034.YahooMailNeo@web164704.mail.gq1.yahoo.com> I have a C program that is using libav in a video editor.? I want to decode every 24th frame of the video (and nothing else).? I wrote a loop which uses avformat_seek_file() to seek to frame 0, then frame24, then frame 48, then frame 72, etc.? My input file is AVI container with the ffvhuff codec. The problem is that whenever I seek to frame N, it also decodes the next 12 frames after N (which I don't want).? This is slowing things down by a factor of 12 since I don't need those extra frames.? What is the name of this 'feature'?? (so I can search for it in the documentation)?? How can I tell libAV to only decode frame N when I seek to frame N? The high-level psuedo-code looks like this ??? for (int f = 0 ; f < LargeNumber; f+= 24) { ? ? ? ? avformat_seek_file(ctx, 0, f, f, f, AVSEEK_FLAG_FRAME, AVSEEK_FLAG_ANY); ??????? av_read_frame(....) ??????? avcodec_decode_video2(....) ??? } In the above code, when I look at best_effort_timestamp for the decoded frame, it will equal the seek position 'f' only for the first iteration of the loop, then the next decoded frame has best_effort_timestamp of 1, then the next is 2, etc.? How can I tell libAV to turn off this feature? Thank you all. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jpboard2 at yahoo.com Sat Oct 12 21:52:51 2013 From: jpboard2 at yahoo.com (James Board) Date: Sat, 12 Oct 2013 12:52:51 -0700 (PDT) Subject: [Libav-user] How to determine the largest best_effort_timestamp? Message-ID: <1381607571.67218.YahooMailNeo@web164705.mail.gq1.yahoo.com> In a C program with libav, how can I determine what is the largest best_effort_timestamp for my input video file, which is AVI container and compressed with ffvhuff? -------------- next part -------------- An HTML attachment was scrubbed... URL: From mail at change.org Sun Oct 13 15:32:23 2013 From: mail at change.org (Gerard Castillo) Date: Sun, 13 Oct 2013 13:32:23 +0000 Subject: [Libav-user] =?utf-8?q?Acabo_de_firmar_=22=40GoettingerEU_=3A_?= =?utf-8?q?=C2=A1Paremos_la_MAT_=28l=C3=ADnea_de_400=2E000_voltios=29!_=22?= Message-ID: <525aa0e769487_679d54e87c1921cc@production-change-main-resque-00.mail> Hey, I just signed the petition "@GoettingerEU : ?Paremos la MAT (l?nea de 400.000 voltios)! " and wanted to see if you could help by adding your name. Our goal is to reach 30,000 signatures and we need more support. You can read more and sign the petition here: https://www.change.org/petitions/goettingereu-paremos-la-mat-l%C3%ADnea-de-400-000-voltios?share_id=HWUwhTCSIK&utm_source=share_petition&utm_medium=email&utm_campaign=petition_invitation Thanks! Gerard Est?s recibiendo este mensaje porque Gerard Castillo te ha enviado un correo electr?nico a trav?s de la herramienta de compartir peticiones en Change.org. Change.org no ha guardado tu direcci?n de correo. Si crees que has recibido este correo por error puedes responder a Gerard Castillo en gerardcl at gmail.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: From bowljoman at gmail.com Sun Oct 13 20:20:52 2013 From: bowljoman at gmail.com (Andy Shaules) Date: Sun, 13 Oct 2013 11:20:52 -0700 Subject: [Libav-user] How to determine the largest best_effort_timestamp? In-Reply-To: <1381607571.67218.YahooMailNeo@web164705.mail.gq1.yahoo.com> References: <1381607571.67218.YahooMailNeo@web164705.mail.gq1.yahoo.com> Message-ID: <525AE484.5050006@gmail.com> On 10/12/2013 12:52 PM, James Board wrote: > In a C program with libav, how can I determine what is the largest > best_effort_timestamp > for my input video file, which is AVI container and compressed with > ffvhuff? > > > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user An AVI container should specify a frame rate, and the time stamp is always 1/framerate * total_frames_read there abouts... If the length of the video payload is zero, then count that as a dropped encoder frame, and increment the total_frames_read for it, continue. Andy -------------- next part -------------- An HTML attachment was scrubbed... URL: From cehoyos at ag.or.at Sun Oct 13 23:45:52 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Sun, 13 Oct 2013 21:45:52 +0000 (UTC) Subject: [Libav-user] Compile with g++ References: <1381181493.68633.YahooMailNeo@web164704.mail.gq1.yahoo.com> <525329E7.2020907@mitre.org> <1381186603.13585.YahooMailNeo@web164703.mail.gq1.yahoo.com> <52544579.9060105@mitre.org> <1381255948.14517.YahooMailNeo@web164703.mail.gq1.yahoo.com> <2916F205-707A-42B5-A879-8A0A916173C9@spearmorgan.com> <1381325529.26985.YahooMailNeo@web164702.mail.gq1.yahoo.com> <1381325830.69538.YahooMailNeo@web164704.mail.gq1.yahoo.com> <1381328992.87316.YahooMailNeo@web164703.mail.gq1.yahoo.com> <52573FB7.8080709@gmail.com> Message-ID: Andy Shaules writes: > extern "C" { > ??????? #include > ??????? #include > ??????? #include > ??? ??? #include > } Please note that this is a wrong (or bad) example, there is no guarantee that headers in different directories do not have identical names (and at least one header shares its name with a common system header). The example should be: extern "C" { #include #include #include #include } Carl Eugen From zuwei at imrsv.com Mon Oct 14 03:08:55 2013 From: zuwei at imrsv.com (Zuwei Li) Date: Mon, 14 Oct 2013 09:08:55 +0800 Subject: [Libav-user] Fwd: Problems with RTMP streams on FFMpeg In-Reply-To: <8D094E3FFDF0B22-1464-1A41E@webmail-m202.sysops.aol.com> References: <8D094E3FFDF0B22-1464-1A41E@webmail-m202.sysops.aol.com> Message-ID: If the Rf > Rs, does the playback back go into buffering mode or drop the frames to the latest frame received? Once new packets are received, continue the playback? Why does the stream break requiring the client to reestablish the connection? On Sat, Oct 12, 2013 at 5:57 AM, wrote: > Li, > > This is typical for any streaming application. The server is sending > packets at rate Rs ffmpeg is playing at Rf. For streaming content these > rates will only be equal if the sender and receiver are using the same > clock source. Apparently Rf > Rs, so you keep running out of packets. I > don't know of any simple solution for this. > > -Felix > > > -----Original Message----- > From: Zuwei Li > To: libav-user > Sent: Tue, Oct 8, 2013 9:28 pm > Subject: [Libav-user] Fwd: Problems with RTMP streams on FFMpeg > > I am using FFMpeg to receive RTMP streams. It decodes and plays the RTMP > stream correctly but I have problems playing the video for long periods of > time. > > It seems that > > av_read_frame(format_context, &packet); > > returns an AVERROR_EOF after playing for a period in time say 7 or 8 > mins, this occurs randomly, when that happens I presume that the stream has > ended so my playback stops. > However, the playback hasn't reached the actual video duration. > > My question is if this behaviour is characteristic of RTMP streams, if > so is there a way to properly stream RTMP reliably so the playback can > continue for long periods using FFMpeg > > -- > Li Zuwei > > > _______________________________________________ > Libav-user mailing listLibav-user at ffmpeg.orghttp://ffmpeg.org/mailman/listinfo/libav-user > > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > > -- Li Zuwei Software Engineer Immersive SG Pte Ltd 3 Science Park Drive #02-12/25 (suite 14) The Franklin, Singapore Science Park 1, Singapore 118223 -------------- next part -------------- An HTML attachment was scrubbed... URL: From er.anshul.maheshwari at gmail.com Mon Oct 14 06:54:55 2013 From: er.anshul.maheshwari at gmail.com (Anshul Maheshwari) Date: Mon, 14 Oct 2013 10:24:55 +0530 Subject: [Libav-user] Fwd: need tp play rtsp stream In-Reply-To: References: Message-ID: Hi guys I need to play an rtsp stream, whose url is something like this rtsp://10.110.1.158:554/StreamingSetting?version=1.0&ChannelID=1&ChannelName=Channel1&action=getRTSPStream&sessionID=7936398 The above url is playable in vlc as it is, but using ffmpeg or fflay , i am not able to get stream, does any change is required in above url. I think ffplay or ffmpeg does not take the parameter passed using & Any One if interested in logs of ffplay [1] 6284 [2] 6285 [3] 6286 [4] 6287 [5] 6288 [2] Done action=getRTSPStream [3] Done ChannelID=1 [4]- Done ChannelName=Channel1 [5]+ Done EncoderPort=0 ffplay version 2.0.1 Copyright (c) 2003-2013 the FFmpeg developers built on Oct 12 2013 18:55:47 with gcc 4.7 (SUSE Linux) configuration: --enable-gpl --enable-nonfree --enable-libx264 --enable-libmp3lame --enable-libfaac --enable-static --enable-shared --enable-pthreads --enable-x11grab libavutil 52. 38.100 / 52. 38.100 libavcodec 55. 18.102 / 55. 18.102 libavformat 55. 12.100 / 55. 12.100 libavdevice 55. 3.100 / 55. 3.100 libavfilter 3. 79.101 / 3. 79.101 libswscale 2. 3.100 / 2. 3.100 libswresample 0. 17.102 / 0. 17.102 libpostproc 52. 3.100 / 52. 3.100 just an log tcp://10.110.1.158:554?timeout=0 failed:::::::::115/0 (this print is added by me, if some one need error number) [rtsp @ 0xafd025c0] method DESCRIBE failed: 404 Stream Not Found rtsp://10.110.1.158:554/StreamingSetting?version=1.0: Invalid data found when processing input From er.anshul.maheshwari at gmail.com Mon Oct 14 07:00:26 2013 From: er.anshul.maheshwari at gmail.com (Anshul Maheshwari) Date: Mon, 14 Oct 2013 10:30:26 +0530 Subject: [Libav-user] Fwd: need tp play rtsp stream In-Reply-To: References: Message-ID: Hi guys I need to play an rtsp stream, whose url is something like this rtsp://10.110.1.158:554/StreamingSetting?version=1.0&ChannelID=1&ChannelName=Channel1&action=getRTSPStream&sessionID=7936398 The above url is playable in vlc as it is, but using ffmpeg or fflay , i am not able to get stream, does any change is required in above url. I think ffplay or ffmpeg does not take the parameter passed using & Any One if interested in logs of ffplay [1] 6284 [2] 6285 [3] 6286 [4] 6287 [5] 6288 [2] Done action=getRTSPStream [3] Done ChannelID=1 [4]- Done ChannelName=Channel1 [5]+ Done EncoderPort=0 ffplay version 2.0.1 Copyright (c) 2003-2013 the FFmpeg developers built on Oct 12 2013 18:55:47 with gcc 4.7 (SUSE Linux) configuration: --enable-gpl --enable-nonfree --enable-libx264 --enable-libmp3lame --enable-libfaac --enable-static --enable-shared --enable-pthreads --enable-x11grab libavutil 52. 38.100 / 52. 38.100 libavcodec 55. 18.102 / 55. 18.102 libavformat 55. 12.100 / 55. 12.100 libavdevice 55. 3.100 / 55. 3.100 libavfilter 3. 79.101 / 3. 79.101 libswscale 2. 3.100 / 2. 3.100 libswresample 0. 17.102 / 0. 17.102 libpostproc 52. 3.100 / 52. 3.100 just an log tcp://10.110.1.158:554?timeout=0 failed:::::::::115/0 (this print is added by me, if some one need error number) [rtsp @ 0xafd025c0] method DESCRIBE failed: 404 Stream Not Found rtsp://10.110.1.158:554/StreamingSetting?version=1.0: Invalid data found when processing input the above case was very bad of me, that problem was of bash not ffplay any thing after & were considered as different process(program), that was the only reason that my stream was not playing in ffplay, but in vlc (because there was an gui for opening a network stream) and bash does not come in picture in case of vlc, Cheers Anshul From zuwei at imrsv.com Mon Oct 14 08:32:55 2013 From: zuwei at imrsv.com (Zuwei Li) Date: Mon, 14 Oct 2013 14:32:55 +0800 Subject: [Libav-user] Does FFMpeg support Dynamic Streaming for RTMP Message-ID: I would like to know if FFMpeg is supporting dynamic streaming for RTMP streams similar to JW player. In addition to loading a single RTMP stream, JW Player 6 supports loading * dynamic* streams. A dynamic stream consists of multiple single streams of the same content, all in a different quality. The JW Player allows automated or manual switching between the different qualities in such a stream. Dynamic streams have to be set up using so-called SMIL manifests. These are simple XML files that contain the location of the RTMP application, plus the path to (one or more) streams stored on the RTMP server. The player always presume a file with the extension *.smil* is an RTMP SMIL manifest: -- Li Zuwei -------------- next part -------------- An HTML attachment was scrubbed... URL: From i.like.privacy.too at gmail.com Mon Oct 14 10:36:50 2013 From: i.like.privacy.too at gmail.com (Camera Man) Date: Mon, 14 Oct 2013 11:36:50 +0300 Subject: [Libav-user] Fwd: need tp play rtsp stream In-Reply-To: References: Message-ID: <525BAD22.7000202@gmail.com> On 10/14/2013 08:00 AM, Anshul Maheshwari wrote: > Hi guys > > I need to play an rtsp stream, whose url is something like this > rtsp://10.110.1.158:554/StreamingSetting?version=1.0&ChannelID=1&ChannelName=Channel1&action=getRTSPStream&sessionID=7936398 This is a shell issue, not an ffmpeg issue. Add quotes (either single or double) around the URL, e.g. ffmpeg "rtsp://10.110.1.158:554/StreamingSetting?version=1.0&ChannelID=1&ChannelName=Channel1&action=getRTSPStream&sessionID=7936398" Please make sure you understand how the shell interprets the special characters "&", "?", "*", "!", "<", ">", "$", "\" and others - and also how single quoting, double quoting, and escaping (e.g. "\*") differ. From cmst at live.com Mon Oct 14 13:46:57 2013 From: cmst at live.com (Dolevo Jay) Date: Mon, 14 Oct 2013 11:46:57 +0000 Subject: [Libav-user] Applied pad on the decoded frame Message-ID: Hi all, I have encoder and decoder application in separate projects. I use x264 to encode the incoming frames and use libav to decode them. If the frame has a specific resolution like 1366 x 768, the decode frame contains extra black border at the right side of the frame. I have debugged it and realized that the av_pic.linesize[0] is 50 more than the linesize during the encoding. Here is the code: lengthDec = avcodec_decode_video2(c1, av_pic, &pic, &pkt); if (pic) { avpicture_fill((AVPicture *)rgbFrame, RGBimg, PIX_FMT_RGB32, w, h); sws_scale(ctx, av_pic->data, av_pic->linesize, 0, h, rgbFrame->data, rgbFrame->linesize); } So, in this code, I decode the packet and convert the decoded data into the rgb. Why does the avcodec_decode_video2 returns a padded linesize? Could anyone tell me how I can eliminate the black border? Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: From bruce at spearmorgan.com Tue Oct 15 00:47:05 2013 From: bruce at spearmorgan.com (Bruce Wheaton) Date: Mon, 14 Oct 2013 15:47:05 -0700 Subject: [Libav-user] Applied pad on the decoded frame In-Reply-To: References: Message-ID: On Oct 14, 2013, at 4:46 AM, Dolevo Jay wrote: > I have encoder and decoder application in separate projects. I use x264 to encode the incoming frames and use libav to decode them. If the frame has a specific resolution like 1366 x 768, the decode frame contains extra black border at the right side of the frame. I have debugged it and realized that the av_pic.linesize[0] is 50 more than the linesize during the encoding. > Here is the code: > > lengthDec = avcodec_decode_video2(c1, av_pic, &pic, &pkt); > if (pic) > { > avpicture_fill((AVPicture *)rgbFrame, RGBimg, PIX_FMT_RGB32, w, h); > sws_scale(ctx, av_pic->data, av_pic->linesize, 0, h, rgbFrame->data, rgbFrame->linesize); > } > > So, in this code, I decode the packet and convert the decoded data into the rgb. > Why does the avcodec_decode_video2 returns a padded linesize? > Could anyone tell me how I can eliminate the black border? The actual encoded data has padding, added to make encoding and decoding more efficient. The returned frame has the padding still, since it's more efficient again - just decoding into a buffer without having to copy all the lines. That's very standard. Expect to see that in almost all codecs and frame sizes. You need to use the viewable width, not the linesize when scaling. Bruce From francesco.damato7 at gmail.com Tue Oct 15 00:49:14 2013 From: francesco.damato7 at gmail.com (Francesco Damato) Date: Tue, 15 Oct 2013 00:49:14 +0200 Subject: [Libav-user] Applied pad on the decoded frame In-Reply-To: References: Message-ID: Hi Dolevo Jay, i have a quastion for you: also i am writing a C program that use h264 to encode video read from file. I saw the example decoding_encoding.c that generates a video from dummy pictures... but how do I replace this part and read and encode my video? Can you help me, there are other examples or books available? Thanks!!! 2013/10/14 Dolevo Jay > Hi all, > > I have encoder and decoder application in separate projects. I use x264 to > encode the incoming frames and use libav to decode them. If the frame has a > specific resolution like 1366 x 768, the decode frame contains extra black > border at the right side of the frame. I have debugged it and realized that > the av_pic.linesize[0] is 50 more than the linesize during the encoding. > Here is the code: > > lengthDec = avcodec_decode_video2(c1, av_pic, &pic, &pkt); > > if (pic) > { > avpicture_fill((AVPicture *)rgbFrame, RGBimg, PIX_FMT_RGB32, w, h); > > sws_scale(ctx, av_pic->data, av_pic->linesize, 0, h, rgbFrame->data, rgbFrame->linesize); > } > > So, in this code, I decode the packet and convert the decoded data into the rgb. > Why does the avcodec_decode_video2 returns a padded linesize? > Could anyone tell me how I can eliminate the black border? > > Thanks. > > > > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > > -- Francesco Damato -------------- next part -------------- An HTML attachment was scrubbed... URL: From rafaware at gmail.com Tue Oct 15 13:21:25 2013 From: rafaware at gmail.com (Rafa Lopez) Date: Tue, 15 Oct 2013 13:21:25 +0200 Subject: [Libav-user] Problema with RTP stream (h264) Message-ID: Hi all I am using lattest ffmpeg (2.0.2) with a rtsp stream in h264. I want to save decoded images from stream: ./ffmpeg -i "rtsp://192.168.0.95:554/profile1" -y %6d.jpg -log-level debug The problem is that I always get corrupt images (example attached). I think the problem is [h264 @ 0x1c28d60] RTP: missed 146 packets [AVIOContext @ 0x7f3190016d20] Statistics: 0 seeks, 3 writeouts [h264 @ 0x1f82300] concealing 2237 DC, 2237 AC, 2237 MV errors in I frame [h264 @ 0x1fc7160] Frame num gap 8 6 RTP missed packets. I attach the full log. Anyone can help me? Thanks in advance Best Regards Rafa L. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- ./ffmpeg -i "rtsp://root:camera at 192.168.0.95:554/profile1" -y %6d.jpg -loglevel debug ffmpeg version 2.0.2 Copyright (c) 2000-2013 the FFmpeg developers built on Oct 15 2013 12:00:31 with gcc 4.4.5 (Debian 4.4.5-8) configuration: --prefix=/opt/ffmpeg-2.0.2 --arch=x86_64 --target-os=linux --enable-pic --enable-shared libavutil 52. 38.100 / 52. 38.100 libavcodec 55. 18.102 / 55. 18.102 libavformat 55. 12.100 / 55. 12.100 libavdevice 55. 3.100 / 55. 3.100 libavfilter 3. 79.101 / 3. 79.101 libswscale 2. 3.100 / 2. 3.100 libswresample 0. 17.102 / 0. 17.102 Splitting the commandline. Reading option '-i' ... matched as input file with argument 'rtsp://root:camera at 192.168.0.95:554/profile1'. Reading option '-y' ... matched as option 'y' (overwrite output files) with argument '1'. Reading option '%6d.jpg' ... matched as output file. Reading option '-loglevel' ... matched as option 'loglevel' (set logging level) with argument 'debug'. Finished splitting the commandline. Parsing a group of options: global . Applying option y (overwrite output files) with argument 1. Applying option loglevel (set logging level) with argument debug. Successfully parsed a group of options. Parsing a group of options: input file rtsp://root:camera at 192.168.0.95:554/profile1. Successfully parsed a group of options. Opening an input file: rtsp://root:camera at 192.168.0.95:554/profile1. [rtsp @ 0x1c24880] SDP: v=0 o=- 0 0 IN IP4 192.168.0.95 s=rtsp://192.168.0.95/profile1 c=IN IP4 0.0.0.0 t=0 0 m=application 0 RTP/AVP 122 a=rtpmap:122 vnd.onvif.metadata/90000 a=control:rtsp://192.168.0.95/profile1/METAEnc m=audio 0 RTP/AVP 0 a=rtpmap:0 PCMU/8000/1 a=control:rtsp://192.168.0.95/profile1/G711Enc m=video 0 RTP/AVP 99 a=rtpmap:99 H264/90000 a=fmtp:99 sprop-parameter-sets=Z0LgKdoBQB5puAgIMBAAAA==,aM48gA==;packetization-mode=1;profile-level-id=42e029 a=control:rtsp://192.168.0.95/profile1/AVCESEnc a=framerate:30.0 [rtsp @ 0x1c24880] audio codec set to: pcm_mulaw [rtsp @ 0x1c24880] audio samplerate set to: 8000 [rtsp @ 0x1c24880] audio channels set to: 1 [rtsp @ 0x1c24880] video codec set to: h264 [NULL @ 0x1c28d60] Extradata set to 0x1c26a60 (size: 28)! [NULL @ 0x1c28d60] RTP Packetization Mode: 1 [NULL @ 0x1c28d60] RTP Profile IDC: 42 Profile IOP: e0 Level: 29 [rtsp @ 0x1c24880] hello state=0 [h264 @ 0x1c28d60] Current profile doesn't provide more RBSP data in PPS, skipping [rtsp @ 0x1c24880] All info found rfps: 29.416667 0.019897 rfps: 29.500000 0.016543 rfps: 29.583333 0.013703 rfps: 29.666667 0.011375 rfps: 29.750000 0.009560 Last message repeated 1 times rfps: 29.833333 0.008258 Last message repeated 1 times rfps: 29.916667 0.007469 Last message repeated 1 times rfps: 30.000000 0.007193 Last message repeated 1 times rfps: 30.083333 0.007429 rfps: 30.166667 0.008179 rfps: 30.250000 0.009441 rfps: 30.333333 0.011217 rfps: 30.416667 0.013505 rfps: 30.500000 0.016306 rfps: 30.583333 0.019620 rfps: 44.833333 0.019723 rfps: 44.916667 0.019509 Last message repeated 1 times rfps: 45.000000 0.019809 Last message repeated 1 times rfps: 29.970030 0.007233 Last message repeated 1 times Guessed Channel Layout for Input Stream #0.1 : mono Input #0, rtsp, from 'rtsp://root:camera at 192.168.0.95:554/profile1': Metadata: title : rtsp://192.168.0.95/profile1 Duration: N/A, start: 0.177000, bitrate: 64 kb/s Stream #0:0, 0, 1/90000: Data: none, 0/1 Stream #0:1, 18, 1/8000: Audio: pcm_mulaw, 8000 Hz, mono, s16, 64 kb/s Stream #0:2, 28, 1/90000: Video: h264 (Constrained Baseline), yuvj420p, 1280x960, 1/180000, 30 tbr, 90k tbn, 180k tbc Successfully opened the file. Parsing a group of options: output file %6d.jpg. Successfully parsed a group of options. Opening an output file: %6d.jpg. Successfully opened the file. detected 4 logical cores [graph 0 input from stream 0:2 @ 0x1dbc000] Setting 'video_size' to value '1280x960' [graph 0 input from stream 0:2 @ 0x1dbc000] Setting 'pix_fmt' to value '12' [graph 0 input from stream 0:2 @ 0x1dbc000] Setting 'time_base' to value '1/90000' [graph 0 input from stream 0:2 @ 0x1dbc000] Setting 'pixel_aspect' to value '0/1' [graph 0 input from stream 0:2 @ 0x1dbc000] Setting 'sws_param' to value 'flags=2' [graph 0 input from stream 0:2 @ 0x1dbc000] Setting 'frame_rate' to value '30/1' [graph 0 input from stream 0:2 @ 0x1dbc000] w:1280 h:960 pixfmt:yuvj420p tb:1/90000 fr:30/1 sar:0/1 sws_param:flags=2 [format @ 0x1d5c6e0] compat: called with args=[yuvj420p|yuvj422p|yuvj444p] [format @ 0x1d5c6e0] Setting 'pix_fmts' to value 'yuvj420p|yuvj422p|yuvj444p' [AVFilterGraph @ 0x1dbbf60] query_formats: 4 queried, 3 merged, 0 already done, 0 delayed [mjpeg @ 0x1dbaea0] intra_quant_bias = 96 inter_quant_bias = 0 [mjpeg @ 0x1c151c0] intra_quant_bias = 96 inter_quant_bias = 0 [mjpeg @ 0x1c24200] intra_quant_bias = 96 inter_quant_bias = 0 [mjpeg @ 0x1d57060] intra_quant_bias = 96 inter_quant_bias = 0 [mjpeg @ 0x1c8b7e0] intra_quant_bias = 96 inter_quant_bias = 0 Output #0, image2, to '%6d.jpg': Metadata: title : rtsp://192.168.0.95/profile1 encoder : Lavf55.12.100 Stream #0:0, 0, 1/90000: Video: mjpeg, yuvj420p, 1280x960, 1/30, q=2-31, 200 kb/s, 90k tbn, 30 tbc Stream mapping: Stream #0:2 -> #0:0 (h264 -> mjpeg) Press [q] to stop, [?] for help [AVIOContext @ 0x7f3198266ae0] Statistics: 0 seeks, 3 writeouts [AVIOContext @ 0x7f31986a1f00] Statistics: 0 seeks, 3 writeouts [AVIOContext @ 0x7f319869a460] Statistics: 0 seeks, 3 writeouts [AVIOContext @ 0x7f31986a3ec0] Statistics: 0 seeks, 3 writeouts [AVIOContext @ 0x3cf1c00] Statistics: 0 seeks, 4 writeouts [AVIOContext @ 0x40967a0] Statistics: 0 seeks, 4 writeouts [AVIOContext @ 0x457a3c0] Statistics: 0 seeks, 4 writeouts [AVIOContext @ 0x3016340] Statistics: 0 seeks, 5 writeouts [AVIOContext @ 0x32e51c0] Statistics: 0 seeks, 4 writeouts [AVIOContext @ 0x32e51c0] Statistics: 0 seeks, 5 writeouts [AVIOContext @ 0x1dbc760] Statistics: 0 seeks, 4 writeouts [AVIOContext @ 0x2bc2ec0] Statistics: 0 seeks, 5 writeouts [AVIOContext @ 0x32e51c0] Statistics: 0 seeks, 5 writeouts [AVIOContext @ 0x1dd7440] Statistics: 0 seeks, 4 writeouts [AVIOContext @ 0x1dc8000] Statistics: 0 seeks, 4 writeouts [AVIOContext @ 0x7f3190017660] Statistics: 0 seeks, 4 writeouts [AVIOContext @ 0x7f31900169c0] Statistics: 0 seeks, 4 writeouts [AVIOContext @ 0x7f31900166c0] Statistics: 0 seeks, 3 writeouts [AVIOContext @ 0x7f3190016840] Statistics: 0 seeks, 4 writeouts [AVIOContext @ 0x7f3190016860] Statistics: 0 seeks, 4 writeouts [AVIOContext @ 0x7f3190016ac0] Statistics: 0 seeks, 4 writeouts [AVIOContext @ 0x7f3190266f00] Statistics: 0 seeks, 3 writeouts [h264 @ 0x1c28d60] RTP: missed 146 packets [AVIOContext @ 0x7f3190016d20] Statistics: 0 seeks, 3 writeouts [h264 @ 0x1f82300] concealing 2237 DC, 2237 AC, 2237 MV errors in I frame [h264 @ 0x1fc7160] Frame num gap 8 6 [AVIOContext @ 0x7f3190018680] Statistics: 0 seeks, 3 writeouts [AVIOContext @ 0x7f3190016d20] Statistics: 0 seeks, 3 writeouts [AVIOContext @ 0x7f319025c740] Statistics: 0 seeks, 3 writeouts [AVIOContext @ 0x7f3190016ac0] Statistics: 0 seeks, 3 writeouts *** 6 dup! [AVIOContext @ 0x7f3190016ac0] Statistics: 0 seeks, 3 writeouts [AVIOContext @ 0x7f3190033960] Statistics: 0 seeks, 3 writeouts -------------- next part -------------- A non-text attachment was scrubbed... Name: corrupted.jpg Type: image/jpeg Size: 24884 bytes Desc: not available URL: From jpboard2 at yahoo.com Tue Oct 15 16:33:06 2013 From: jpboard2 at yahoo.com (James Board) Date: Tue, 15 Oct 2013 07:33:06 -0700 (PDT) Subject: [Libav-user] Problems with ffvhuff and huvvyuv Message-ID: <1381847586.95305.YahooMailNeo@web164703.mail.gq1.yahoo.com> I have an libAV program that decodes every 24-th frame.? This is for a video editor so I can easily seek forward in the video, rather than play all frames. The high-level psuedo-code looks like this ??? for (int f = 0 ; f < LargeNumber; f+= 24) { ??????? avformat_seek_file(ctx, 0, f, f, f, AVSEEK_FLAG_FRAME, AVSEEK_FLAG_ANY); ??????? av_read_frame(....) ??????? avcodec_decode_video2(....) ??? } If the input file is uncompressed AVI, then this works well. However, if I compress the video with ffvhuff or huffvuy, then whenever I seek forward 24 frames, the previous 12 frames are first decoded.? For example, If I seek from frame 0 to 24 to 72 to 96, when I try to decode frame 96, I first get frame 73, 74, 75, 76, 77, .... frame 83, then it decodes frame 96. This problem only occurs with ffvhuff, or huffyuv.? Lossless jpeg doesn't have the problem or any of the other lossless codecs I tried.? Is this a known problem with the ffvhuff?? Is it something I can turn off? Can I modify this behavior through the API? If not, is there a place in the source code where I can easily change this?? Maybe change the 12 pre-decoded frames to 2, or 1? If not, is this a fundamental limitation in the way ffvhuff is implmented?? Does it have to decode 12 frames at a time? Or, if this a problem with the AVI file container?? If I use a different container, can I avoid this problem? -------------- next part -------------- An HTML attachment was scrubbed... URL: From jpboard2 at yahoo.com Tue Oct 15 16:34:44 2013 From: jpboard2 at yahoo.com (James Board) Date: Tue, 15 Oct 2013 07:34:44 -0700 (PDT) Subject: [Libav-user] How to determine the largest best_effort_timestamp? In-Reply-To: <525AE484.5050006@gmail.com> References: <1381607571.67218.YahooMailNeo@web164705.mail.gq1.yahoo.com> <525AE484.5050006@gmail.com> Message-ID: <1381847684.44351.YahooMailNeo@web164704.mail.gq1.yahoo.com> >An AVI container should specify a frame rate, and the time stamp is always 1/framerate * >total_frames_read? there abouts... That doesn't tell me the exact largest best_effort_timestamp.? Can I determine the largest best_effort_timestamp exactly?? Would this be easier with a file container other than AVI? On Sunday, October 13, 2013 2:20 PM, Andy Shaules wrote: On 10/12/2013 12:52 PM, James Board wrote: In a C program with libav, how can I determine what is the largest best_effort_timestamp >for my input video file, which is AVI container and compressed with ffvhuff? > > > > >_______________________________________________ Libav-user mailing list Libav-user at ffmpeg.org http://ffmpeg.org/mailman/listinfo/libav-user An AVI container should specify a frame rate, and the time stamp is always 1/framerate * total_frames_read? there abouts... If the length of the video payload is zero, then count that as a dropped encoder frame, and increment the total_frames_read for it, continue. Andy _______________________________________________ Libav-user mailing list Libav-user at ffmpeg.org http://ffmpeg.org/mailman/listinfo/libav-user -------------- next part -------------- An HTML attachment was scrubbed... URL: From bowljoman at gmail.com Tue Oct 15 17:56:41 2013 From: bowljoman at gmail.com (Andy Shaules) Date: Tue, 15 Oct 2013 08:56:41 -0700 Subject: [Libav-user] How to determine the largest best_effort_timestamp? In-Reply-To: <1381847684.44351.YahooMailNeo@web164704.mail.gq1.yahoo.com> References: <1381607571.67218.YahooMailNeo@web164705.mail.gq1.yahoo.com> <525AE484.5050006@gmail.com> <1381847684.44351.YahooMailNeo@web164704.mail.gq1.yahoo.com> Message-ID: <525D65B9.8020907@gmail.com> On 10/15/2013 7:34 AM, James Board wrote: > > >An AVI container should specify a frame rate, and the time stamp is > always 1/framerate * >total_frames_read there abouts... > > That doesn't tell me the exact largest best_effort_timestamp. Can I > determine the > largest best_effort_timestamp exactly? Would this be easier with a > file container other > than AVI? > > best_effort implies a guess. There is no guessing for an avi file. its uses a static frame rate whether or not there is actual video for that frame. The largest timestamp in the file would be total number of vid frames times the frame duration. > > On Sunday, October 13, 2013 2:20 PM, Andy Shaules > wrote: > On 10/12/2013 12:52 PM, James Board wrote: >> In a C program with libav, how can I determine what is the largest >> best_effort_timestamp >> for my input video file, which is AVI container and compressed with >> ffvhuff? >> >> >> >> _______________________________________________ >> Libav-user mailing list >> Libav-user at ffmpeg.org >> http://ffmpeg.org/mailman/listinfo/libav-user > An AVI container should specify a frame rate, and the time stamp is > always 1/framerate * total_frames_read there abouts... > > If the length of the video payload is zero, then count that as a > dropped encoder frame, and increment the total_frames_read for it, > continue. > > Andy > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > > > > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user -------------- next part -------------- An HTML attachment was scrubbed... URL: From cmst at live.com Tue Oct 15 09:49:06 2013 From: cmst at live.com (Dolevo Jay) Date: Tue, 15 Oct 2013 07:49:06 +0000 Subject: [Libav-user] Applied pad on the decoded frame In-Reply-To: References: , Message-ID: Hi, What kind of file you are going to read? Regards, Date: Tue, 15 Oct 2013 00:49:14 +0200 From: francesco.damato7 at gmail.com To: libav-user at ffmpeg.org Subject: Re: [Libav-user] Applied pad on the decoded frame Hi Dolevo Jay, i have a quastion for you: also i am writing a C program that use h264 to encode video read from file. I saw the example decoding_encoding.c that generates a video from dummy pictures... but how do I replace this part and read and encode my video? Can you help me, there are other examples or books available? Thanks!!! 2013/10/14 Dolevo Jay Hi all, I have encoder and decoder application in separate projects. I use x264 to encode the incoming frames and use libav to decode them. If the frame has a specific resolution like 1366 x 768, the decode frame contains extra black border at the right side of the frame. I have debugged it and realized that the av_pic.linesize[0] is 50 more than the linesize during the encoding. Here is the code: lengthDec = avcodec_decode_video2(c1, av_pic, &pic, &pkt); if (pic) { avpicture_fill((AVPicture *)rgbFrame, RGBimg, PIX_FMT_RGB32, w, h); sws_scale(ctx, av_pic->data, av_pic->linesize, 0, h, rgbFrame->data, rgbFrame->linesize); } So, in this code, I decode the packet and convert the decoded data into the rgb. Why does the avcodec_decode_video2 returns a padded linesize? Could anyone tell me how I can eliminate the black border? Thanks. _______________________________________________ Libav-user mailing list Libav-user at ffmpeg.org http://ffmpeg.org/mailman/listinfo/libav-user -- Francesco Damato _______________________________________________ Libav-user mailing list Libav-user at ffmpeg.org http://ffmpeg.org/mailman/listinfo/libav-user -------------- next part -------------- An HTML attachment was scrubbed... URL: From cmst at live.com Tue Oct 15 16:07:20 2013 From: cmst at live.com (Dolevo Jay) Date: Tue, 15 Oct 2013 14:07:20 +0000 Subject: [Libav-user] Applied pad on the decoded frame In-Reply-To: References: , Message-ID: > From: bruce at spearmorgan.com > Date: Mon, 14 Oct 2013 15:47:05 -0700 > To: libav-user at ffmpeg.org > Subject: Re: [Libav-user] Applied pad on the decoded frame > > On Oct 14, 2013, at 4:46 AM, Dolevo Jay wrote: > > > I have encoder and decoder application in separate projects. I use x264 to encode the incoming frames and use libav to decode them. If the frame has a specific resolution like 1366 x 768, the decode frame contains extra black border at the right side of the frame. I have debugged it and realized that the av_pic.linesize[0] is 50 more than the linesize during the encoding. > > Here is the code: > > > > lengthDec = avcodec_decode_video2(c1, av_pic, &pic, &pkt); > > if (pic) > > { > > avpicture_fill((AVPicture *)rgbFrame, RGBimg, PIX_FMT_RGB32, w, h); > > sws_scale(ctx, av_pic->data, av_pic->linesize, 0, h, rgbFrame->data, rgbFrame->linesize); > > } > > > > So, in this code, I decode the packet and convert the decoded data into the rgb. > > Why does the avcodec_decode_video2 returns a padded linesize? > > Could anyone tell me how I can eliminate the black border? > > The actual encoded data has padding, added to make encoding and decoding more efficient. The returned frame has the padding still, since it's more efficient again - just decoding into a buffer without having to copy all the lines. > > That's very standard. Expect to see that in almost all codecs and frame sizes. > > You need to use the viewable width, not the linesize when scaling. > > Bruce > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user Thanks for your reply. I have described the problem in detail with some pictures here: http://forum.doom9.org/showthread.php?t=169036 It is really strange that it produces no black part (bar) when I set the width = width+1 when calling sws_getContext. Could it be a bug in swscale since I do no scaling? Thanks a lot. -------------- next part -------------- An HTML attachment was scrubbed... URL: From tutu.yu at hulu.com Tue Oct 15 01:01:12 2013 From: tutu.yu at hulu.com (TuTu Yu) Date: Mon, 14 Oct 2013 18:01:12 -0500 Subject: [Libav-user] Race condition during executing x264_encoder_reconfig with multithreading Message-ID: Hi, I found out a bug in x264 when running ffmpeg with x264 module. When ffmpeg tried to execute x264_encoder_reconfig during run time, x264 will first initialize values in structure x264_param_t back to default. And later, x264 will properly set variable in structure x264_param_t based on user configuration in function x264_validate_parameters. However, if this happens during running multithreading, un-expected encoding process will be produced. Here is my patch towards this change. Please let me know if you need me to explain more on this issue. Thanks TuTu -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- diff --git a/encoder/encoder.c b/encoder/encoder.c index 78ad56a..e7b0238 100644 --- a/encoder/encoder.c +++ b/encoder/encoder.c @@ -416,6 +416,8 @@ static void x264_encoder_thread_init( x264_t *h ) static int x264_validate_parameters( x264_t *h, int b_open ) { + unsigned int analyse_inter = h->param.analyse.inter; + unsigned int analyse_intra = h->param.analyse.intra; #if HAVE_MMX if( b_open ) { @@ -1003,16 +1005,18 @@ static int x264_validate_parameters( x264_t *h, int b_open ) (h->mb.b_lossless || h->param.analyse.i_subpel_refine <= 1) ) h->param.analyse.i_me_method = X264_ME_ESA; h->param.analyse.b_mixed_references = h->param.analyse.b_mixed_references && h->param.i_frame_reference > 1; - h->param.analyse.inter &= X264_ANALYSE_PSUB16x16|X264_ANALYSE_PSUB8x8|X264_ANALYSE_BSUB16x16| + analyse_inter &= X264_ANALYSE_PSUB16x16|X264_ANALYSE_PSUB8x8|X264_ANALYSE_BSUB16x16| X264_ANALYSE_I4x4|X264_ANALYSE_I8x8; - h->param.analyse.intra &= X264_ANALYSE_I4x4|X264_ANALYSE_I8x8; - if( !(h->param.analyse.inter & X264_ANALYSE_PSUB16x16) ) - h->param.analyse.inter &= ~X264_ANALYSE_PSUB8x8; + analyse_intra &= X264_ANALYSE_I4x4|X264_ANALYSE_I8x8; + if( !(analyse_inter & X264_ANALYSE_PSUB16x16) ) + analyse_intra &= ~X264_ANALYSE_PSUB8x8; if( !h->param.analyse.b_transform_8x8 ) { - h->param.analyse.inter &= ~X264_ANALYSE_I8x8; - h->param.analyse.intra &= ~X264_ANALYSE_I8x8; + analyse_inter &= ~X264_ANALYSE_I8x8; + analyse_intra &= ~X264_ANALYSE_I8x8; } + h->param.analyse.intra = analyse_intra; + h->param.analyse.inter = analyse_inter; h->param.analyse.i_trellis = x264_clip3( h->param.analyse.i_trellis, 0, 2 ); h->param.rc.i_aq_mode = x264_clip3( h->param.rc.i_aq_mode, 0, 2 ); h->param.rc.f_aq_strength = x264_clip3f( h->param.rc.f_aq_strength, 0, 3 ); @@ -1689,8 +1693,6 @@ int x264_encoder_reconfig( x264_t *h, x264_param_t *param ) COPY( i_deblocking_filter_alphac0 ); COPY( i_deblocking_filter_beta ); COPY( i_frame_packing ); - COPY( analyse.inter ); - COPY( analyse.intra ); COPY( analyse.i_direct_mv_pred ); /* Scratch buffer prevents me_range from being increased for esa/tesa */ if( h->param.analyse.i_me_method < X264_ME_ESA || param->analyse.i_me_range < h->param.analyse.i_me_range ) From jpboard2 at yahoo.com Wed Oct 16 15:52:18 2013 From: jpboard2 at yahoo.com (James Board) Date: Wed, 16 Oct 2013 06:52:18 -0700 (PDT) Subject: [Libav-user] Problems with ffvhuff and huvvyuv In-Reply-To: <1381847586.95305.YahooMailNeo@web164703.mail.gq1.yahoo.com> References: <1381847586.95305.YahooMailNeo@web164703.mail.gq1.yahoo.com> Message-ID: <1381931538.25973.YahooMailNeo@web164704.mail.gq1.yahoo.com> >I have an libAV program that decodes every 24-th frame.? This is for >a video editor so I can easily seek forward in the video, rather than >play all frames. >If the input file is uncompressed AVI, then this works well. >However, if I compress the video with ffvhuff or huffvuy, then whenever I >seek forward 24 frames, the previous 12 frames are first decoded.? For example, >If I seek from frame 0 to 24 to 72 to 96, when I try to decode frame 96, >I first get frame 73, 74, 75, 76, 77, .... frame 83, then it decodes frame >96. >This problem only occurs with ffvhuff, or huffyuv.? Lossless jpeg doesn't have the >problem or any of the other lossless codecs I tried.? Does my question make sense to anyone?? Or am I doing something very wrong with libav and seeking?? Has anyone seen this behavior before when you seek to position N in a file, but the first few frames that get decoded are lower than N? Is there a better way? Does this have anything to do with cached frames, or is that another issue? -------------- next part -------------- An HTML attachment was scrubbed... URL: From francesco.damato7 at gmail.com Wed Oct 16 16:28:29 2013 From: francesco.damato7 at gmail.com (Francesco Damato) Date: Wed, 16 Oct 2013 16:28:29 +0200 Subject: [Libav-user] Applied pad on the decoded frame In-Reply-To: References: Message-ID: Hi Dolevo Jay, i have a avi and mp4 file. The avcodec_encode_video2 function takes input raw video data from frame, so i demux my file and i obtain a raw video file; now i want encode it, so how i can open the raw file, read the raw frames and encode them into h264?? Thanks for your help!! Regards 2013/10/15 Dolevo Jay > > > > From: bruce at spearmorgan.com > > Date: Mon, 14 Oct 2013 15:47:05 -0700 > > > To: libav-user at ffmpeg.org > > Subject: Re: [Libav-user] Applied pad on the decoded frame > > > > On Oct 14, 2013, at 4:46 AM, Dolevo Jay wrote: > > > > > I have encoder and decoder application in separate projects. I use > x264 to encode the incoming frames and use libav to decode them. If the > frame has a specific resolution like 1366 x 768, the decode frame contains > extra black border at the right side of the frame. I have debugged it and > realized that the av_pic.linesize[0] is 50 more than the linesize during > the encoding. > > > Here is the code: > > > > > > lengthDec = avcodec_decode_video2(c1, av_pic, &pic, &pkt); > > > if (pic) > > > { > > > avpicture_fill((AVPicture *)rgbFrame, RGBimg, PIX_FMT_RGB32, w, h); > > > sws_scale(ctx, av_pic->data, av_pic->linesize, 0, h, rgbFrame->data, > rgbFrame->linesize); > > > } > > > > > > So, in this code, I decode the packet and convert the decoded data > into the rgb. > > > Why does the avcodec_decode_video2 returns a padded linesize? > > > Could anyone tell me how I can eliminate the black border? > > > > The actual encoded data has padding, added to make encoding and decoding > more efficient. The returned frame has the padding still, since it's more > efficient again - just decoding into a buffer without having to copy all > the lines. > > > > That's very standard. Expect to see that in almost all codecs and frame > sizes. > > > > You need to use the viewable width, not the linesize when scaling. > > > > Bruce > > _______________________________________________ > > Libav-user mailing list > > Libav-user at ffmpeg.org > > http://ffmpeg.org/mailman/listinfo/libav-user > > > Thanks for your reply. I have described the problem in detail with some > pictures here: http://forum.doom9.org/showthread.php?t=169036 > It is really strange that it produces no black part (bar) when I set the > width = width+1 when calling sws_getContext. Could it be a bug in swscale > since I do no scaling? > > Thanks a lot. > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > > -- Francesco Damato -------------- next part -------------- An HTML attachment was scrubbed... URL: From francesco.damato7 at gmail.com Wed Oct 16 16:34:35 2013 From: francesco.damato7 at gmail.com (Francesco Damato) Date: Wed, 16 Oct 2013 16:34:35 +0200 Subject: [Libav-user] encoder h264 Message-ID: Hi, i am writing a C program (encoder) that use h264 to encode video read from avi or mp4 file; the avcodec_encode_video2 function takes input raw video data from frame, so i demux my files and i obtain a raw video file; now i want encode it, so how can i open the raw file, read the frames and encode them into h264?? I saw the example decoding_encoding.c that generates a video from dummy pictures... but how do I replace this part and read and encode my rawvideo file? Can you help me, there are other examples or books available? Thanks!!! -- Francesco Damato -------------- next part -------------- An HTML attachment was scrubbed... URL: From bruce at spearmorgan.com Wed Oct 16 17:40:26 2013 From: bruce at spearmorgan.com (Bruce Wheaton) Date: Wed, 16 Oct 2013 08:40:26 -0700 Subject: [Libav-user] Problems with ffvhuff and huvvyuv In-Reply-To: <1381931538.25973.YahooMailNeo@web164704.mail.gq1.yahoo.com> References: <1381847586.95305.YahooMailNeo@web164703.mail.gq1.yahoo.com> <1381931538.25973.YahooMailNeo@web164704.mail.gq1.yahoo.com> Message-ID: <6DF21523-2B27-4107-8CB0-25FD6B564A5E@spearmorgan.com> Bruce > On Oct 16, 2013, at 6:52, James Board Does my question make sense to anyone? Or am I doing something very wrong > with libav and seeking? Has anyone seen this behavior before when you seek to > position N in a file, but the first few frames that get decoded are lower than N? > Is there a better way? Yes, this is known and basically unavoidable with most codecs. Each frame is dependent on one or more frames that came before. Even if a system made this seem to not happen, from your point of view, it still would be happening in the background. I mentioned this problem when discussing multi threading. The only workaround is to use intra-frame only compression, so all frames are independent. Some codecs you listed always work that way. Bruce > Does this have anything to do with cached frames, or is that another issue? > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user -------------- next part -------------- An HTML attachment was scrubbed... URL: From onemda at gmail.com Wed Oct 16 17:46:30 2013 From: onemda at gmail.com (Paul B Mahol) Date: Wed, 16 Oct 2013 15:46:30 +0000 Subject: [Libav-user] Problems with ffvhuff and huvvyuv In-Reply-To: <6DF21523-2B27-4107-8CB0-25FD6B564A5E@spearmorgan.com> References: <1381847586.95305.YahooMailNeo@web164703.mail.gq1.yahoo.com> <1381931538.25973.YahooMailNeo@web164704.mail.gq1.yahoo.com> <6DF21523-2B27-4107-8CB0-25FD6B564A5E@spearmorgan.com> Message-ID: On 10/16/13, Bruce Wheaton wrote: > > > > Bruce > > >> On Oct 16, 2013, at 6:52, James Board > Does my question make sense to anyone? Or am I doing something very >> wrong >> with libav and seeking? Has anyone seen this behavior before when you >> seek to >> position N in a file, but the first few frames that get decoded are lower >> than N? >> Is there a better way? > > Yes, this is known and basically unavoidable with most codecs. Each frame is > dependent on one or more frames that came before. Even if a system made this > seem to not happen, from your point of view, it still would be happening in > the background. > > I mentioned this problem when discussing multi threading. > > The only workaround is to use intra-frame only compression, so all frames > are independent. Some codecs you listed always work that way. ffvhuff is intra only. > > Bruce > > >> Does this have anything to do with cached frames, or is that another >> issue? >> >> _______________________________________________ >> Libav-user mailing list >> Libav-user at ffmpeg.org >> http://ffmpeg.org/mailman/listinfo/libav-user > From bruce at spearmorgan.com Wed Oct 16 17:56:07 2013 From: bruce at spearmorgan.com (Bruce Wheaton) Date: Wed, 16 Oct 2013 08:56:07 -0700 Subject: [Libav-user] Problems with ffvhuff and huvvyuv In-Reply-To: References: <1381847586.95305.YahooMailNeo@web164703.mail.gq1.yahoo.com> <1381931538.25973.YahooMailNeo@web164704.mail.gq1.yahoo.com> <6DF21523-2B27-4107-8CB0-25FD6B564A5E@spearmorgan.com> Message-ID: > On Oct 16, 2013, at 8:46, Paul B Mahol wrote: >> The only workaround is to use intra-frame only compression, so all frames >> are independent. Some codecs you listed always work that way. > > ffvhuff is intra only. I don't know that codec. I just knew it was lossless. So I guess (unless there's a bug) the rule has an exception. Maybe the 'adaptive tables' that google says it has adapt every 24 or so frames. Don't have the source in front of me right now. But it's an FOSS project - anyone look at the code and see what's going on. Bruce >>> Does this have anything to do with cached frames, or is that another >>> issue? >>> >>> _______________________________________________ >>> Libav-user mailing list >>> Libav-user at ffmpeg.org >>> http://ffmpeg.org/mailman/listinfo/libav-user > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user From bruce at spearmorgan.com Wed Oct 16 18:16:41 2013 From: bruce at spearmorgan.com (Bruce Wheaton) Date: Wed, 16 Oct 2013 09:16:41 -0700 Subject: [Libav-user] Problems with ffvhuff and huvvyuv In-Reply-To: References: <1381847586.95305.YahooMailNeo@web164703.mail.gq1.yahoo.com> <1381931538.25973.YahooMailNeo@web164704.mail.gq1.yahoo.com> <6DF21523-2B27-4107-8CB0-25FD6B564A5E@spearmorgan.com> Message-ID: <36611D8D-62CF-4C55-984F-432E3812D209@spearmorgan.com> On Oct 16, 2013, at 8:56 AM, Bruce Wheaton wrote: > >> On Oct 16, 2013, at 8:46, Paul B Mahol wrote: >>> The only workaround is to use intra-frame only compression, so all frames >>> are independent. Some codecs you listed always work that way. >> >> ffvhuff is intra only. > > I don't know that codec. I just knew it was lossless. So I guess (unless there's a bug) the rule has an exception. Maybe the 'adaptive tables' that google says it has adapt every 24 or so frames. Don't have the source in front of me right now. > > But it's an FOSS project - anyone look at the code and see what's going on. I can't pick it out of the code, and the codec info says it is intra-frame only... but this paper seems to indicate that ffvhuff isn't always intra-frame only: "FFv1 [16] was also developed by the FFmpeg project and is derived from HuffYUV. The main difference is that the intra-frame coding model is limited to the median model as described above" From COMPARISON OF LOSSLESS VIDEO CODECS FOR CROWD-BASED QUALITY ASSESSMENT ON TABLETS Christian Keimel, Christopher Pangerl and Klaus Diepold https://mediatum.ub.tum.de/doc/1128908/1128908.pdf So - as I mentioned - videos that aren't encoded as intra-frame often have to decode a number of frames in order to get to your desired frame. As far as I know, the only way ffmpeg deals with that is by decoding all the frames from a known safe search point up until your desired frame. Bruce > >>>> Does this have anything to do with cached frames, or is that another >>>> issue? >>>> >>>> _______________________________________________ >>>> Libav-user mailing list >>>> Libav-user at ffmpeg.org >>>> http://ffmpeg.org/mailman/listinfo/libav-user >> _______________________________________________ >> Libav-user mailing list >> Libav-user at ffmpeg.org >> http://ffmpeg.org/mailman/listinfo/libav-user > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user From jpboard2 at yahoo.com Wed Oct 16 18:29:56 2013 From: jpboard2 at yahoo.com (James Board) Date: Wed, 16 Oct 2013 09:29:56 -0700 (PDT) Subject: [Libav-user] Problems with ffvhuff and huvvyuv In-Reply-To: <36611D8D-62CF-4C55-984F-432E3812D209@spearmorgan.com> References: <1381847586.95305.YahooMailNeo@web164703.mail.gq1.yahoo.com> <1381931538.25973.YahooMailNeo@web164704.mail.gq1.yahoo.com> <6DF21523-2B27-4107-8CB0-25FD6B564A5E@spearmorgan.com> <36611D8D-62CF-4C55-984F-432E3812D209@spearmorgan.com> Message-ID: <1381940996.17371.YahooMailNeo@web164705.mail.gq1.yahoo.com> >> I don't know that codec. I just knew it was lossless. So I guess (unless there's a bug) the rule has an exception. Maybe the 'adaptive tables' that google says it has adapt every 24 or so frames. Don't have the source in front of me right now. >> >> But it's an FOSS project - anyone look at the code and see what's going on. >I can't pick it out of the code, and the codec info says it is intra-frame only... but this paper seems to indicate that >ffvhuff isn't always intra-frame only: >"FFv1 [16] was also developed by the FFmpeg project and is derived from HuffYUV. The main difference is that the intra->frame coding model is limited to the median model as described above" Okay, but that's ffv1.? It's true that ffv1 uses inter-frame compression.? But ffv1 is different from ffvhuff.? I'm using ffvhuff, not ffv1.??As far as I know, ffvhuff is intra-frame only. ? Yes,?libAV is FOSS and I'm looking at the source now.? But there's a huge learning curve. It would be nice if someone told me beforehand whether or not this is a problem that can be fixed.? If I want to decode a single isolated frame with ffvhuff, does the ffvhuff algorithm require me to decode multiple frames after N?? Or is that merely a fixable problem with the way libav implements ffvhuff.? If this is fixable, where in the source would I look? ? Is there any documentation on how codecs are implemented in libav? ? Also, how can I build the doxygen HTML pages for the source code? -------------- next part -------------- An HTML attachment was scrubbed... URL: From cehoyos at ag.or.at Wed Oct 16 18:55:55 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Wed, 16 Oct 2013 16:55:55 +0000 (UTC) Subject: [Libav-user] Problems with ffvhuff and huvvyuv References: <1381847586.95305.YahooMailNeo@web164703.mail.gq1.yahoo.com> <1381931538.25973.YahooMailNeo@web164704.mail.gq1.yahoo.com> <6DF21523-2B27-4107-8CB0-25FD6B564A5E@spearmorgan.com> <36611D8D-62CF-4C55-984F-432E3812D209@spearmorgan.com> <1381940996.17371.YahooMailNeo@web164705.mail.gq1.yahoo.com> Message-ID: James Board writes: > It would be nice if someone told me beforehand whether > or not this is a problem that can be fixed. Ok, so far this is understandable. > If I want to decode a single isolated frame with > ffvhuff, does the ffvhuff algorithm require me to > decode multiple frames after N? Why don't you simply test this yourself? It cannot take more time to test than to write your mail, let alone write (and read!) the answers. Carl Eugen From jpboard2 at yahoo.com Wed Oct 16 20:27:11 2013 From: jpboard2 at yahoo.com (James Board) Date: Wed, 16 Oct 2013 11:27:11 -0700 (PDT) Subject: [Libav-user] Problems with ffvhuff and huvvyuv In-Reply-To: References: <1381847586.95305.YahooMailNeo@web164703.mail.gq1.yahoo.com> <1381931538.25973.YahooMailNeo@web164704.mail.gq1.yahoo.com> <6DF21523-2B27-4107-8CB0-25FD6B564A5E@spearmorgan.com> <36611D8D-62CF-4C55-984F-432E3812D209@spearmorgan.com> <1381940996.17371.YahooMailNeo@web164705.mail.gq1.yahoo.com> Message-ID: <1381948031.11083.YahooMailNeo@web164703.mail.gq1.yahoo.com> >Why don't you simply test this yourself? >It cannot take more time to test than to write your >mail, let alone write (and read!) the answers. I did.? It generated the extra frames.? So the libav implementation works this way.? Or at least my code works that way, and my code might be screwed.? The question I mean to ask (maybe I wasn't clear) is whether there is anything fundamental to the huffyuv algorithm which prevents me from decoding a single frame.? If the answer is 'yes', then I know not to dig through the source code (big learning curve) because that effort can't possibly work.? If the answer is 'no, then I'll press on. On Wednesday, October 16, 2013 12:56 PM, Carl Eugen Hoyos wrote: James Board writes: > It would be nice if someone told me beforehand whether > or not this is a problem that can be fixed. Ok, so far this is understandable. > If I want to decode a single isolated frame with > ffvhuff, does the ffvhuff algorithm require me to > decode multiple frames after N? Why don't you simply test this yourself? It cannot take more time to test than to write your mail, let alone write (and read!) the answers. Carl Eugen _______________________________________________ Libav-user mailing list Libav-user at ffmpeg.org http://ffmpeg.org/mailman/listinfo/libav-user -------------- next part -------------- An HTML attachment was scrubbed... URL: From cmst at live.com Wed Oct 16 17:03:35 2013 From: cmst at live.com (Dolevo Jay) Date: Wed, 16 Oct 2013 15:03:35 +0000 Subject: [Libav-user] Applied pad on the decoded frame In-Reply-To: References: , , , Message-ID: Hi, If your raw file is in yuv 420 format, you can simply read from the file as if you are reading from a text file and push it into the encoder. The important thing here is going to be how many bytes to read but you can calculate it by looking at the resolution information. If your raw file contains RGB frames, you need to convert them first to yuv420 before pushing into encoder. If you need further help, you may send a private email. Date: Wed, 16 Oct 2013 16:28:29 +0200 From: francesco.damato7 at gmail.com To: libav-user at ffmpeg.org Subject: Re: [Libav-user] Applied pad on the decoded frame Hi Dolevo Jay, i have a avi and mp4 file. The avcodec_encode_video2 function takes input raw video data from frame, so i demux my file and i obtain a raw video file; now i want encode it, so how i can open the raw file, read the raw frames and encode them into h264?? Thanks for your help!! Regards 2013/10/15 Dolevo Jay > From: bruce at spearmorgan.com > Date: Mon, 14 Oct 2013 15:47:05 -0700 > To: libav-user at ffmpeg.org > Subject: Re: [Libav-user] Applied pad on the decoded frame > > On Oct 14, 2013, at 4:46 AM, Dolevo Jay wrote: > > > I have encoder and decoder application in separate projects. I use x264 to encode the incoming frames and use libav to decode them. If the frame has a specific resolution like 1366 x 768, the decode frame contains extra black border at the right side of the frame. I have debugged it and realized that the av_pic.linesize[0] is 50 more than the linesize during the encoding. > > Here is the code: > > > > lengthDec = avcodec_decode_video2(c1, av_pic, &pic, &pkt); > > if (pic) > > { > > avpicture_fill((AVPicture *)rgbFrame, RGBimg, PIX_FMT_RGB32, w, h); > > sws_scale(ctx, av_pic->data, av_pic->linesize, 0, h, rgbFrame->data, rgbFrame->linesize); > > } > > > > So, in this code, I decode the packet and convert the decoded data into the rgb. > > Why does the avcodec_decode_video2 returns a padded linesize? > > Could anyone tell me how I can eliminate the black border? > > The actual encoded data has padding, added to make encoding and decoding more efficient. The returned frame has the padding still, since it's more efficient again - just decoding into a buffer without having to copy all the lines. > > That's very standard. Expect to see that in almost all codecs and frame sizes. > > You need to use the viewable width, not the linesize when scaling. > > Bruce > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user Thanks for your reply. I have described the problem in detail with some pictures here: http://forum.doom9.org/showthread.php?t=169036 It is really strange that it produces no black part (bar) when I set the width = width+1 when calling sws_getContext. Could it be a bug in swscale since I do no scaling? Thanks a lot. _______________________________________________ Libav-user mailing list Libav-user at ffmpeg.org http://ffmpeg.org/mailman/listinfo/libav-user -- Francesco Damato _______________________________________________ Libav-user mailing list Libav-user at ffmpeg.org http://ffmpeg.org/mailman/listinfo/libav-user -------------- next part -------------- An HTML attachment was scrubbed... URL: From alexcohn at netvision.net.il Wed Oct 16 21:19:25 2013 From: alexcohn at netvision.net.il (Alex Cohn) Date: Wed, 16 Oct 2013 22:19:25 +0300 Subject: [Libav-user] Problems with ffvhuff and huvvyuv In-Reply-To: <1381948031.11083.YahooMailNeo@web164703.mail.gq1.yahoo.com> References: <1381847586.95305.YahooMailNeo@web164703.mail.gq1.yahoo.com> <1381931538.25973.YahooMailNeo@web164704.mail.gq1.yahoo.com> <6DF21523-2B27-4107-8CB0-25FD6B564A5E@spearmorgan.com> <36611D8D-62CF-4C55-984F-432E3812D209@spearmorgan.com> <1381940996.17371.YahooMailNeo@web164705.mail.gq1.yahoo.com> <1381948031.11083.YahooMailNeo@web164703.mail.gq1.yahoo.com> Message-ID: On Wed, Oct 16, 2013 at 9:27 PM, James Board wrote: > The question I mean to ask (maybe I wasn't clear) > is whether there is anything fundamental to the huffyuv algorithm > which prevents me from decoding a single frame. I believe that there may be some variations of the original huffyuv purely intra-frame encoder algorithm. So the question is how you generated the source file. If you can prove that the frames are independent, and/or if there is a tool that allows decoding any frame in the file independently, this may be an indication that ffmpeg decoder is not doing its job correctly. This could be the case, taking into account that it was definitely developed with the FFv1 in mind, which does have inter-fame correlations. But until proven guilty, the ffmpeg decoder should be presumed innocent. BR, Alex Cohn From onemda at gmail.com Wed Oct 16 21:44:30 2013 From: onemda at gmail.com (Paul B Mahol) Date: Wed, 16 Oct 2013 19:44:30 +0000 Subject: [Libav-user] Problems with ffvhuff and huvvyuv In-Reply-To: <1381948031.11083.YahooMailNeo@web164703.mail.gq1.yahoo.com> References: <1381847586.95305.YahooMailNeo@web164703.mail.gq1.yahoo.com> <1381931538.25973.YahooMailNeo@web164704.mail.gq1.yahoo.com> <6DF21523-2B27-4107-8CB0-25FD6B564A5E@spearmorgan.com> <36611D8D-62CF-4C55-984F-432E3812D209@spearmorgan.com> <1381940996.17371.YahooMailNeo@web164705.mail.gq1.yahoo.com> <1381948031.11083.YahooMailNeo@web164703.mail.gq1.yahoo.com> Message-ID: On 10/16/13, James Board wrote: >>Why don't you simply test this yourself? >>It cannot take more time to test than to write your >>mail, let alone write (and read!) the answers. > > I did. It generated the extra frames. So the libav implementation > works this way. Or at least my code works that way, and my code > might be screwed. The question I mean to ask (maybe I wasn't clear) > is whether there is anything fundamental to the huffyuv algorithm > which prevents me from decoding a single frame. If the answer > is 'yes', then I know not to dig through the source code (big > learning curve) because that effort can't possibly work. If > the answer is 'no, then I'll press on. There is nothing in huffyuv algorithm and ffvhuff which could cause this. From onemda at gmail.com Wed Oct 16 21:47:50 2013 From: onemda at gmail.com (Paul B Mahol) Date: Wed, 16 Oct 2013 19:47:50 +0000 Subject: [Libav-user] Problems with ffvhuff and huvvyuv In-Reply-To: References: <1381847586.95305.YahooMailNeo@web164703.mail.gq1.yahoo.com> <1381931538.25973.YahooMailNeo@web164704.mail.gq1.yahoo.com> <6DF21523-2B27-4107-8CB0-25FD6B564A5E@spearmorgan.com> <36611D8D-62CF-4C55-984F-432E3812D209@spearmorgan.com> <1381940996.17371.YahooMailNeo@web164705.mail.gq1.yahoo.com> <1381948031.11083.YahooMailNeo@web164703.mail.gq1.yahoo.com> Message-ID: On 10/16/13, Paul B Mahol wrote: > On 10/16/13, James Board wrote: >>>Why don't you simply test this yourself? >>>It cannot take more time to test than to write your >>>mail, let alone write (and read!) the answers. >> >> I did. It generated the extra frames. So the libav implementation >> works this way. Or at least my code works that way, and my code >> might be screwed. The question I mean to ask (maybe I wasn't clear) >> is whether there is anything fundamental to the huffyuv algorithm >> which prevents me from decoding a single frame. If the answer >> is 'yes', then I know not to dig through the source code (big >> learning curve) because that effort can't possibly work. If >> the answer is 'no, then I'll press on. > > There is nothing in huffyuv algorithm and ffvhuff which could cause this. > And issue is probably withing avi container as it may not add every frame into index table. And when seeking you never check if returned packet actually is right one that you need. Or it could be bug in your code how you seek in file, etc... From jpboard2 at yahoo.com Wed Oct 16 22:31:45 2013 From: jpboard2 at yahoo.com (James Board) Date: Wed, 16 Oct 2013 13:31:45 -0700 (PDT) Subject: [Libav-user] Problems with ffvhuff and huvvyuv In-Reply-To: References: <1381847586.95305.YahooMailNeo@web164703.mail.gq1.yahoo.com> <1381931538.25973.YahooMailNeo@web164704.mail.gq1.yahoo.com> <6DF21523-2B27-4107-8CB0-25FD6B564A5E@spearmorgan.com> <36611D8D-62CF-4C55-984F-432E3812D209@spearmorgan.com> <1381940996.17371.YahooMailNeo@web164705.mail.gq1.yahoo.com> <1381948031.11083.YahooMailNeo@web164703.mail.gq1.yahoo.com> Message-ID: <1381955505.40913.YahooMailNeo@web164704.mail.gq1.yahoo.com> >And issue is probably withing avi container as it >may not add every frame into index table. >And when seeking you never check if returned packet actually is right >one that you need. > >Or it could be bug in your code how you seek in file, etc... I do check the results of the seek and I do check the best_effort_timestamp, but yes, it could be a bug in my code.? Or it could be a problem with AVI files.? I'll look into it and let you know what happens. I also noticed that the huffyuv code is all pure C with no MMX or SSE instructions.? Is the reason for that because huffyuv wouldn't benefit from MMX or SSE?? Or is it because nobody had time to optimize it yet? -------------- next part -------------- An HTML attachment was scrubbed... URL: From onemda at gmail.com Wed Oct 16 22:45:44 2013 From: onemda at gmail.com (Paul B Mahol) Date: Wed, 16 Oct 2013 20:45:44 +0000 Subject: [Libav-user] Problems with ffvhuff and huvvyuv In-Reply-To: <1381955505.40913.YahooMailNeo@web164704.mail.gq1.yahoo.com> References: <1381847586.95305.YahooMailNeo@web164703.mail.gq1.yahoo.com> <1381931538.25973.YahooMailNeo@web164704.mail.gq1.yahoo.com> <6DF21523-2B27-4107-8CB0-25FD6B564A5E@spearmorgan.com> <36611D8D-62CF-4C55-984F-432E3812D209@spearmorgan.com> <1381940996.17371.YahooMailNeo@web164705.mail.gq1.yahoo.com> <1381948031.11083.YahooMailNeo@web164703.mail.gq1.yahoo.com> <1381955505.40913.YahooMailNeo@web164704.mail.gq1.yahoo.com> Message-ID: On 10/16/13, James Board wrote: >>And issue is probably withing avi container as it >>may not add every frame into index table. >>And when seeking you never check if returned packet actually is right >>one that you need. >> >>Or it could be bug in your code how you seek in file, etc... > > I do check the results of the seek and I do check the best_effort_timestamp, > but yes, it could be a bug in my code. Or it could be a problem > with AVI files. I'll look into it and let you know what happens. > > > I also noticed that the huffyuv code is all pure C with no MMX or SSE > instructions. Is the reason for that because huffyuv wouldn't benefit from > MMX or SSE? Or is it because nobody had time to optimize it yet? You noted it wrong. Huffyuv does use SIMD. From aravind.madineni at lge.com Thu Oct 17 06:28:50 2013 From: aravind.madineni at lge.com (Aravind Madineni) Date: Thu, 17 Oct 2013 13:28:50 +0900 Subject: [Libav-user] encoder h264 In-Reply-To: References: Message-ID: <31B0BB793C136842844728D22D74831144455BD7BE@LGEVEXMBAPSVC1.LGE.NET> Pseudo Code static size_t fill_yuv_image_from_file(AVPicture *pict, int frame_index,int width, int height,FILE *video_dst_filename) { uint8_t *video_buf=NULL; int x,y; size_t bytesRead; video_buf =(uint8_t *)malloc((3*width*height)>>1); //Initialize to zero memset(video_buf,0,sizeof(uint8_t)* ((3*width*height)>>1)); bytesRead =fread((uint8_t *)video_buf,sizeof(uint8_t),((3*width*height)>>1),video_dst_filename); if(feof(video_dst_filename)) { fprintf(stdout,"\n End of File. BytesRead is :%ld",bytesRead); free(video_buf); return END_OF_FILE; } if(bytesRead) { fprintf(stdout,"\n No Of Video Bytes Read :%ld",bytesRead); /* Y */ for(y =0;y < height ;y++){ for(x = 0; x < width; x++){ pict->data[0][y * pict->linesize[0] + x]=*video_buf++; } } /* Cb */ for (y = 0; y < height / 2; y++) { for (x = 0; x < width / 2; x++) { pict->data[1][y * pict->linesize[1] + x] = *video_buf++; //[y*height+x]; } } /* Cr */ for (y = 0; y < height / 2; y++) { for (x = 0; x < width / 2; x++) { pict->data[2][y * pict->linesize[2] + x] = *video_buf++; //[y*height+(x+1)]; } } video_buf-=((3*width*height)>>1); } else{ fprintf(stdout,"\n Video Bytes Read:%ld",bytesRead); } free(video_buf); return bytesRead; } From: libav-user-bounces at ffmpeg.org [mailto:libav-user-bounces at ffmpeg.org] On Behalf Of Francesco Damato Sent: Wednesday, October 16, 2013 8:05 PM To: This list is about using libavcodec, libavformat, libavutil, libavdevice and libavfilter. Subject: [Libav-user] encoder h264 Hi, i am writing a C program (encoder) that use h264 to encode video read from avi or mp4 file; the avcodec_encode_video2 function takes input raw video data from frame, so i demux my files and i obtain a raw video file; now i want encode it, so how can i open the raw file, read the frames and encode them into h264?? I saw the example decoding_encoding.c that generates a video from dummy pictures... but how do I replace this part and read and encode my rawvideo file? Can you help me, there are other examples or books available? Thanks!!! -- Francesco Damato -------------- next part -------------- An HTML attachment was scrubbed... URL: From marcin_ffmpeg at interia.pl Thu Oct 17 10:42:58 2013 From: marcin_ffmpeg at interia.pl (marcin_ffmpeg) Date: Thu, 17 Oct 2013 10:42:58 +0200 Subject: [Libav-user] mpeg4 encoding with no b-frames Message-ID: Dear All In my application I'm trying to re-encode video from h264 to mpeg4. It is important to have no b-frames in the output file so I set encoder context to max_b_frames=0, gop_size is fixed to 25. With this setting I get loads of following warnings [mpeg4 @ 0xa53f3620] warning, too many b frames in a row Problem does not exists when encoder gop_size is set to decoder gop_size and max_b_frames is set to 10. Is there something what can be done about that? Does frame after decoding from h264 have to be somehow converted? Thanks for any help Marcin From i.like.privacy.too at gmail.com Thu Oct 17 14:31:26 2013 From: i.like.privacy.too at gmail.com (Camera Man) Date: Thu, 17 Oct 2013 15:31:26 +0300 Subject: [Libav-user] Problema with RTP stream (h264) In-Reply-To: References: Message-ID: <525FD89E.8030004@gmail.com> On 10/15/2013 02:21 PM, Rafa Lopez wrote: > ./ffmpeg -i "rtsp://192.168.0.95:554/profile1 > " -y %6d.jpg -log-level debug > > The problem is that I always get corrupt images (example attached). I > think the problem is > > [h264 @ 0x1c28d60] RTP: missed 146 packets > [AVIOContext @ 0x7f3190016d20] Statistics: 0 seeks, 3 writeouts > [h264 @ 0x1f82300] concealing 2237 DC, 2237 AC, 2237 MV errors in I frame > [h264 @ 0x1fc7160] Frame num gap 8 6 > > RTP missed packets. I attach the full log. Anyone can help me? No way to properly solve with ffmpeg configuration at this point, although adding "-rtsp_transport tcp" before "-y" will reduce the pain for you. Unfortunately, the udp layer will set it's SO_RCVBUF kernel buffer to at most 64K, (which e.g. Linux will translate to a 128K buffer). That practically guarantees that any single frame larger than 128K (e.g., an average I-frame in an 1280x720 stream) will not fit within the kernel socket buffers, resulting in at least one packet (and part of the frame) dropped, thus the corruption you see. I do not know of a way to ask FFMPEG to properly increase the UDP kernel buffer size. I had patched my own ffmpeg to set SO_RCVBUF to 1024K, and it worked for me. But then I switched to TCP and stopped worrying (Using TCP instead DOES introduce latency and waste bandwidth, because packets are getting lost and retransmitted, but I don't care about another 10ms or 10% higher bandwidth as I'm on a local network). The udp layer does have a "buffer_size" parameter, but there's no way that I'm aware of to pass it to the udp layer through the rtsp layer. From cehoyos at ag.or.at Thu Oct 17 14:52:22 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Thu, 17 Oct 2013 12:52:22 +0000 (UTC) Subject: [Libav-user] Problema with RTP stream (h264) References: <525FD89E.8030004@gmail.com> Message-ID: Camera Man writes: > Unfortunately, the udp layer will set it's SO_RCVBUF kernel buffer to at > most 64K, (which e.g. Linux will translate to a 128K buffer). That > practically guarantees that any single frame larger than 128K (e.g., an > average I-frame in an 1280x720 stream) will not fit within the kernel > socket buffers, resulting in at least one packet (and part of the frame) > dropped, thus the corruption you see. Thank you for this analysis! Is this documented anywhere else (afayk)? > The udp layer does have a "buffer_size" parameter, but there's no way > that I'm aware of to pass it to the udp layer through the rtsp layer. Do you know of a public stream that I could use to test if I wanted to fix this? Carl Eugen From i.like.privacy.too at gmail.com Thu Oct 17 15:44:16 2013 From: i.like.privacy.too at gmail.com (Camera Man) Date: Thu, 17 Oct 2013 16:44:16 +0300 Subject: [Libav-user] Problema with RTP stream (h264) In-Reply-To: References: <525FD89E.8030004@gmail.com> Message-ID: <525FE9B0.5070008@gmail.com> An HTML attachment was scrubbed... URL: From i.like.privacy.too at gmail.com Thu Oct 17 15:53:18 2013 From: i.like.privacy.too at gmail.com (Camera Man) Date: Thu, 17 Oct 2013 16:53:18 +0300 Subject: [Libav-user] Problema with RTP stream (h264) In-Reply-To: References: <525FD89E.8030004@gmail.com> Message-ID: <525FEBCE.6060507@gmail.com> [resending, because Thunderbird insisted on sending this in HTML for some reason; hopefully now it will be plaintext] On 10/17/2013 03:52 PM, Carl Eugen Hoyos wrote: > Thank you for this analysis! > Is this documented anywhere else (afayk)? Not that I know of. I have been replying on this list several times to people describing this problem with solution (switch to tcp) and analysis over the last two years, but I'm guilty of not actually opening a ticket. At some point in time, it actually WAS possible to append "?udp&buffer_size=1048576" to the RTSP url and have that be passed down to the underlying layer, but with the (excellent and welcome!) revision of moving these to AVOptions, the ability was lost. >> The udp layer does have a "buffer_size" parameter, but there's no way >> that I'm aware of to pass it to the udp layer through the rtsp layer. > Do you know of a public stream that I could use to test if > I wanted to fix this? Unfortunately not. I can reproduce this on my linux desktop with a large pre-recorded h264 file (2560x1920) which has ~400k I-Frames, by running client first: ffplay -x 320 -y 240 -rtsp_flags listen rtsp://localhost:8888 and server second: ffmpeg -i huge2560x1920file.h264 -f rtsp rtsp://localhost:8888/live.sdp And of course by connecting directly to the udp feed from the 2560x1920 camera this was recorded from. (Unfortunately, this camera is property of my employer and I am not allowed to share the movies generated from it). Note, I do not trust the localhost interface to perfectly reproduce these issues (localhost does things differently), but qualitatively it does: the kernel buffers are too small, and a complete I-frame cannot be sent. From i.like.privacy.too at gmail.com Thu Oct 17 15:54:37 2013 From: i.like.privacy.too at gmail.com (Camera Man) Date: Thu, 17 Oct 2013 16:54:37 +0300 Subject: [Libav-user] Problema with RTP stream (h264) In-Reply-To: References: <525FD89E.8030004@gmail.com> Message-ID: <525FEC1D.7020409@gmail.com> [thunderbird is insisting on html output; trying again as forced plaintext] On 10/17/2013 03:52 PM, Carl Eugen Hoyos wrote: > Thank you for this analysis! > Is this documented anywhere else (afayk)? Not that I know of. I have been replying on this list several times to people describing this problem with solution (switch to tcp) and analysis over the last two years, but I'm guilty of not actually opening a ticket. At some point in time, it actually WAS possible to append "?udp&buffer_size=1048576" to the RTSP url and have that be passed down to the underlying layer, but with the (excellent and welcome!) revision of moving these to AVOptions, the ability was lost. >> The udp layer does have a "buffer_size" parameter, but there's no way >> that I'm aware of to pass it to the udp layer through the rtsp layer. > Do you know of a public stream that I could use to test if > I wanted to fix this? Unfortunately not. I can reproduce this on my linux desktop with a large pre-recorded h264 file (2560x1920) which has ~400k I-Frames, by running client first: ffplay -x 320 -y 240 -rtsp_flags listen rtsp://localhost:8888 and server second: ffmpeg -i huge2560x1920file.h264 -f rtsp rtsp://localhost:8888/live.sdp And of course by connecting directly to the udp feed from the 2560x1920 camera this was recorded from. (Unfortunately, this camera is property of my employer and I am not allowed to share the movies generated from it). Note, I do not trust the localhost interface to perfectly reproduce these issues (localhost does things differently), but qualitatively it does: the kernel buffers are too small, and a complete I-frame cannot be sent. From leanneattard at gmail.com Thu Oct 17 16:04:25 2013 From: leanneattard at gmail.com (leanne attard) Date: Thu, 17 Oct 2013 16:04:25 +0200 Subject: [Libav-user] missing mandatory atoms, broken header Message-ID: Hi, this is my first post to the mailing list. I am using opencv to read from a video file output from a Vivotek ipcamera model(IP 3872). When I am trying to open the file it is giving me a warning below. From some research I have done online I found out that this is an output from ffmpeg. Can you please guide me as what might be going wrong? Also I have a problem with skipping a number of frames to start the video from a particular frame rather than from frame 0, however I am not getting the correct frame. Does this a consequence of the warning below? stream 1, missing mandatory atoms, broken header Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: From jpboard2 at yahoo.com Thu Oct 17 17:00:25 2013 From: jpboard2 at yahoo.com (James Board) Date: Thu, 17 Oct 2013 08:00:25 -0700 (PDT) Subject: [Libav-user] Problems with ffvhuff and huvvyuv In-Reply-To: References: <1381847586.95305.YahooMailNeo@web164703.mail.gq1.yahoo.com> <1381931538.25973.YahooMailNeo@web164704.mail.gq1.yahoo.com> <6DF21523-2B27-4107-8CB0-25FD6B564A5E@spearmorgan.com> <36611D8D-62CF-4C55-984F-432E3812D209@spearmorgan.com> <1381940996.17371.YahooMailNeo@web164705.mail.gq1.yahoo.com> <1381948031.11083.YahooMailNeo@web164703.mail.gq1.yahoo.com> <1381955505.40913.YahooMailNeo@web164704.mail.gq1.yahoo.com> Message-ID: <1382022025.77359.YahooMailNeo@web164705.mail.gq1.yahoo.com> >You noted it wrong. Huffyuv does use SIMD. Where?? I didn't see any SIMD instructions in huffyuvenc.c or huffyuvdec.c. Am I looking in the wrong place? On Wednesday, October 16, 2013 4:45 PM, Paul B Mahol wrote: On 10/16/13, James Board wrote: >>And issue is probably withing avi container as it >>may not add every frame into index table. >>And when seeking you never check if returned packet actually is right >>one that you need. >> >>Or it could be bug in your code how you seek in file, etc... > > I do check the results of the seek and I do check the best_effort_timestamp, > but yes, it could be a bug in my code.? Or it could be a problem > with AVI files.? I'll look into it and let you know what happens. > > > I also noticed that the huffyuv code is all pure C with no MMX or SSE > instructions.? Is the reason for that because huffyuv wouldn't benefit from > MMX or SSE?? Or is it because nobody had time to optimize it yet? You noted it wrong. Huffyuv does use SIMD. _______________________________________________ Libav-user mailing list Libav-user at ffmpeg.org http://ffmpeg.org/mailman/listinfo/libav-user -------------- next part -------------- An HTML attachment was scrubbed... URL: From cehoyos at ag.or.at Thu Oct 17 17:17:47 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Thu, 17 Oct 2013 15:17:47 +0000 (UTC) Subject: [Libav-user] missing mandatory atoms, broken header References: Message-ID: leanne attard writes: > I am using opencv to read from a video file output > from a Vivotek ipcamera model(IP 3872). What does ffmpeg -i video_file show for the file that you want to read from? Carl Eugen From onemda at gmail.com Thu Oct 17 17:27:19 2013 From: onemda at gmail.com (Paul B Mahol) Date: Thu, 17 Oct 2013 15:27:19 +0000 Subject: [Libav-user] Problems with ffvhuff and huvvyuv In-Reply-To: <1382022025.77359.YahooMailNeo@web164705.mail.gq1.yahoo.com> References: <1381847586.95305.YahooMailNeo@web164703.mail.gq1.yahoo.com> <1381931538.25973.YahooMailNeo@web164704.mail.gq1.yahoo.com> <6DF21523-2B27-4107-8CB0-25FD6B564A5E@spearmorgan.com> <36611D8D-62CF-4C55-984F-432E3812D209@spearmorgan.com> <1381940996.17371.YahooMailNeo@web164705.mail.gq1.yahoo.com> <1381948031.11083.YahooMailNeo@web164703.mail.gq1.yahoo.com> <1381955505.40913.YahooMailNeo@web164704.mail.gq1.yahoo.com> <1382022025.77359.YahooMailNeo@web164705.mail.gq1.yahoo.com> Message-ID: On 10/17/13, James Board wrote: >>You noted it wrong. Huffyuv does use SIMD. > > Where? I didn't see any SIMD instructions in huffyuvenc.c or > huffyuvdec.c. Am I looking in the wrong place? It is not in huffyuvdec.c I will give more info once you stop top posting. > > > > > > On Wednesday, October 16, 2013 4:45 PM, Paul B Mahol > wrote: > > On 10/16/13, James Board wrote: >>>And issue is probably withing avi container as it >>>may not add every frame into index table. >>>And when seeking you never check if returned packet actually is right >>>one that you need. >>> >>>Or it could be bug in your code how you seek in file, etc... >> >> I do check the results of the seek and I do check the >> best_effort_timestamp, >> but yes, it could be a bug in my code. Or it could be a problem >> with AVI files. I'll look into it and let you know what happens. >> >> >> I also noticed that the huffyuv code is all pure C with no MMX or SSE >> instructions. Is the reason for that because huffyuv wouldn't benefit >> from >> MMX or SSE? Or is it because nobody had time to optimize it yet? > > You noted it wrong. Huffyuv does use SIMD. > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user From marco.gulino at gmail.com Thu Oct 17 17:48:17 2013 From: marco.gulino at gmail.com (Marco Gulino) Date: Thu, 17 Oct 2013 17:48:17 +0200 Subject: [Libav-user] decoding speed on large files In-Reply-To: References: Message-ID: bump. To be more clear: I need to extract text subtitles from large files, saving them on a database. I am currently able to reencode the subtitle itself, but the decoding part ( http://pastebin.com/WbJwAKFx ) is really damn slow, while "ffmpeg" command line takes just a few seconds. Is there anything I'm missing? Custom IO? Frames skipping? Thanks On Tue, Oct 1, 2013 at 11:25 AM, Marco Gulino wrote: > Hello > I'm noticing a huge difference in decoding speed with my own code, and > with ffmpeg command line tool, especially with large (> 2GB) files. > This is my current test code: http://pastebin.com/WbJwAKFx > Just looping over the packets, without even reading them, takes 120 > seconds. > > When I run "ffmpeg -i mylargefile.mp4 /tmp/extractedSubtitle.srt", it > takes no more than 10 seconds. Of course, I dropped linux kernel caches > first, to force the same file reading speed. > > I tried looking at ffmpeg.c, but I didn't notice anything in particular. > Thanks > Marco > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jpboard2 at yahoo.com Thu Oct 17 17:55:07 2013 From: jpboard2 at yahoo.com (James Board) Date: Thu, 17 Oct 2013 08:55:07 -0700 (PDT) Subject: [Libav-user] Problems with ffvhuff and huvvyuv In-Reply-To: References: <1381847586.95305.YahooMailNeo@web164703.mail.gq1.yahoo.com> <1381931538.25973.YahooMailNeo@web164704.mail.gq1.yahoo.com> <6DF21523-2B27-4107-8CB0-25FD6B564A5E@spearmorgan.com> <36611D8D-62CF-4C55-984F-432E3812D209@spearmorgan.com> <1381940996.17371.YahooMailNeo@web164705.mail.gq1.yahoo.com> <1381948031.11083.YahooMailNeo@web164703.mail.gq1.yahoo.com> <1381955505.40913.YahooMailNeo@web164704.mail.gq1.yahoo.com> <1382022025.77359.YahooMailNeo@web164705.mail.gq1.yahoo.com> Message-ID: <1382025307.51112.YahooMailNeo@web164704.mail.gq1.yahoo.com> >On 10/17/13, James Board wrote: >>>You noted it wrong. Huffyuv does use SIMD. >> >> Where?? I didn't see any SIMD instructions in huffyuvenc.c or >> huffyuvdec.c. Am I looking in the wrong place? > >It is not in huffyuvdec.c > >I will give more info once you stop top posting. I'm sorry about that.? I wasn't aware I was top-posting.? Yahoo changed its email interface and I think it automatically does this.? But the new interface is only when?I access Yahoo from firefox, not IE, so this message should be okay. -------------- next part -------------- An HTML attachment was scrubbed... URL: From onemda at gmail.com Thu Oct 17 18:05:53 2013 From: onemda at gmail.com (Paul B Mahol) Date: Thu, 17 Oct 2013 16:05:53 +0000 Subject: [Libav-user] Problems with ffvhuff and huvvyuv In-Reply-To: <1382025307.51112.YahooMailNeo@web164704.mail.gq1.yahoo.com> References: <1381847586.95305.YahooMailNeo@web164703.mail.gq1.yahoo.com> <1381931538.25973.YahooMailNeo@web164704.mail.gq1.yahoo.com> <6DF21523-2B27-4107-8CB0-25FD6B564A5E@spearmorgan.com> <36611D8D-62CF-4C55-984F-432E3812D209@spearmorgan.com> <1381940996.17371.YahooMailNeo@web164705.mail.gq1.yahoo.com> <1381948031.11083.YahooMailNeo@web164703.mail.gq1.yahoo.com> <1381955505.40913.YahooMailNeo@web164704.mail.gq1.yahoo.com> <1382022025.77359.YahooMailNeo@web164705.mail.gq1.yahoo.com> <1382025307.51112.YahooMailNeo@web164704.mail.gq1.yahoo.com> Message-ID: On 10/17/13, James Board wrote: >>On 10/17/13, James Board wrote: >>>>You noted it wrong. Huffyuv does use SIMD. >>> >>> Where? I didn't see any SIMD instructions in huffyuvenc.c or >>> huffyuvdec.c. Am I looking in the wrong place? >> >>It is not in huffyuvdec.c >> >>I will give more info once you stop top posting. > > I'm sorry about that. I wasn't aware I was top-posting. Yahoo changed its > email interface > and I think it automatically does this. But the new interface is only > when I access Yahoo from > firefox, not IE, so this message should be okay. libavcodec/x86/dsputil.asm From bowljoman at gmail.com Thu Oct 17 18:28:46 2013 From: bowljoman at gmail.com (Andy Shaules) Date: Thu, 17 Oct 2013 09:28:46 -0700 Subject: [Libav-user] Problema with RTP stream (h264) In-Reply-To: <525FEC1D.7020409@gmail.com> References: <525FD89E.8030004@gmail.com> <525FEC1D.7020409@gmail.com> Message-ID: <5260103E.5040702@gmail.com> On 10/17/2013 6:54 AM, Camera Man wrote: > [thunderbird is insisting on html output; trying again as forced > plaintext] > > On 10/17/2013 03:52 PM, Carl Eugen Hoyos wrote: > >> Thank you for this analysis! >> Is this documented anywhere else (afayk)? > > Not that I know of. I have been replying on this list several times to > people describing this problem with solution (switch to tcp) and > analysis over the last two years, but I'm guilty of not actually > opening a ticket. At some point in time, it actually WAS possible to > append "?udp&buffer_size=1048576" to the RTSP url and have that be > passed down to the underlying layer, but with the (excellent and > welcome!) revision of moving these to AVOptions, the ability was lost. > >>> The udp layer does have a "buffer_size" parameter, but there's no way >>> that I'm aware of to pass it to the udp layer through the rtsp layer. >> Do you know of a public stream that I could use to test if >> I wanted to fix this? > > Unfortunately not. I can reproduce this on my linux desktop with a > large pre-recorded h264 file (2560x1920) which has ~400k I-Frames, by > running client first: > > ffplay -x 320 -y 240 -rtsp_flags listen rtsp://localhost:8888 > > and server second: > > ffmpeg -i huge2560x1920file.h264 -f rtsp > rtsp://localhost:8888/live.sdp > > And of course by connecting directly to the udp feed from the > 2560x1920 camera this was recorded from. (Unfortunately, this camera > is property of my employer and I am not allowed to share the movies > generated from it). > Ive never personally used these commands directly, but I use h264 over rtp often, and you should be using packetization-mode that allows fragmented nals. 1920x1080 typically splits the IDR into 4 or 5 packets. > Note, I do not trust the localhost interface to perfectly reproduce > these issues (localhost does things differently), but qualitatively it > does: the kernel buffers are too small, and a complete I-frame cannot > be sent. > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user From jpboard2 at yahoo.com Thu Oct 17 19:31:45 2013 From: jpboard2 at yahoo.com (James Board) Date: Thu, 17 Oct 2013 10:31:45 -0700 (PDT) Subject: [Libav-user] Problems with ffvhuff and huvvyuv In-Reply-To: References: <1381847586.95305.YahooMailNeo@web164703.mail.gq1.yahoo.com> <1381931538.25973.YahooMailNeo@web164704.mail.gq1.yahoo.com> <6DF21523-2B27-4107-8CB0-25FD6B564A5E@spearmorgan.com> <36611D8D-62CF-4C55-984F-432E3812D209@spearmorgan.com> <1381940996.17371.YahooMailNeo@web164705.mail.gq1.yahoo.com> <1381948031.11083.YahooMailNeo@web164703.mail.gq1.yahoo.com> Message-ID: <1382031105.81824.YahooMailNeo@web164702.mail.gq1.yahoo.com> >And issue is probably withing avi container as it >may not add every frame into index table. >And when seeking you never check if returned packet actually is right >one that you need. > >Or it could be bug in your code how you seek in file, etc... I did a rewrite of my code and it now works.? But I don't know why. I modified the demuxing.c example so that it seeks to frame 0, calls decode_packet, seeks to frame 10, calls decode_packet, etc.? I seek to every 10th frame and call decode_packet().? I also modified decode_packet() so that it writes an output file whenever 'got_frame' is non-zero.? For the first four seeks (frame 0, 10, 20, 30), 'got_frame' is NULL and no output image files are written.? Then, when I seek to frame 40, the output file for frame 0 is written.? When I seek to 60, the output for frame 10 is written.? When I seek to frame 60, the output for frame 20 is written, etc.? Eventually, the 'flush cached frames' loop is entered and the final files are written. Does this make sense or sound familiar to anyone?? What is happening here? Does this have anything to do with cached frames?? I've before what 'cached frames' are but nobody answered.? Does anyone understand this? Also, none of the above oddness happens if I use AVI files encoded with no codec or with lossless JPEG, or a few other codecs. On Wednesday, October 16, 2013 3:48 PM, Paul B Mahol wrote: On 10/16/13, Paul B Mahol wrote: > On 10/16/13, James Board wrote: >>>Why don't you simply test this yourself? >>>It cannot take more time to test than to write your >>>mail, let alone write (and read!) the answers. >> >> I did.? It generated the extra frames.? So the libav implementation >> works this way.? Or at least my code works that way, and my code >> might be screwed.? The question I mean to ask (maybe I wasn't clear) >> is whether there is anything fundamental to the huffyuv algorithm >> which prevents me from decoding a single frame.? If the answer >> is 'yes', then I know not to dig through the source code (big >> learning curve) because that effort can't possibly work.? If >> the answer is 'no, then I'll press on. > > There is nothing in huffyuv algorithm and ffvhuff which could cause this. > And issue is probably withing avi container as it may not add every frame into index table. And when seeking you never check if returned packet actually is right one that you need. Or it could be bug in your code how you seek in file, etc... _______________________________________________ Libav-user mailing list Libav-user at ffmpeg.org http://ffmpeg.org/mailman/listinfo/libav-user -------------- next part -------------- An HTML attachment was scrubbed... URL: From jpboard2 at yahoo.com Thu Oct 17 20:55:06 2013 From: jpboard2 at yahoo.com (James Board) Date: Thu, 17 Oct 2013 11:55:06 -0700 (PDT) Subject: [Libav-user] Problems with ffvhuff and huvvyuv In-Reply-To: <1382031105.81824.YahooMailNeo@web164702.mail.gq1.yahoo.com> References: <1381847586.95305.YahooMailNeo@web164703.mail.gq1.yahoo.com> <1381931538.25973.YahooMailNeo@web164704.mail.gq1.yahoo.com> <6DF21523-2B27-4107-8CB0-25FD6B564A5E@spearmorgan.com> <36611D8D-62CF-4C55-984F-432E3812D209@spearmorgan.com> <1381940996.17371.YahooMailNeo@web164705.mail.gq1.yahoo.com> <1381948031.11083.YahooMailNeo@web164703.mail.gq1.yahoo.com> <1382031105.81824.YahooMailNeo@web164702.mail.gq1.yahoo.com> Message-ID: <1382036106.63590.YahooMailNeo@web164702.mail.gq1.yahoo.com> >And issue is probably withing avi container as it >may not add every frame into index table. >And when seeking you never check if returned packet actually is right >one that you need. > >Or it could be bug in your code how you seek in file, etc... Sorry for the top post (again).? The problem is Yahoo email.? Anyway here is the same last message. I did a rewrite of my code and it now works.? But I don't know why. I modified the demuxing.c example so that it seeks to frame 0, calls decode_packet, seeks to frame 10, calls decode_packet, etc.? I seek to every 10th frame and call decode_packet().? I also modified decode_packet() so that it writes an output file whenever 'got_frame' is non-zero.? For the first four seeks (frame 0, 10, 20, 30), 'got_frame' is NULL and no output image files are written.? Then, when I seek to frame 40, the output file for frame 0 is written.? When I seek to 60, the output for frame 10 is written.? When I seek to frame 60, the output for frame 20 is written, etc.? Eventually, the 'flush cached frames' loop is entered and the final files are written. Does this make sense or sound familiar to anyone?? What is happening here? Does this have anything to do with cached frames?? I've asked before what 'cached frames' are but nobody answered.? Does anyone understand this? Also, none of the above oddness happens if I use AVI files encoded with no codec or with lossless JPEG, or a few other codecs. -------------- next part -------------- An HTML attachment was scrubbed... URL: From bruce at spearmorgan.com Thu Oct 17 20:57:42 2013 From: bruce at spearmorgan.com (Bruce Wheaton) Date: Thu, 17 Oct 2013 11:57:42 -0700 Subject: [Libav-user] Problems with ffvhuff and huvvyuv In-Reply-To: <1382031105.81824.YahooMailNeo@web164702.mail.gq1.yahoo.com> References: <1381847586.95305.YahooMailNeo@web164703.mail.gq1.yahoo.com> <1381931538.25973.YahooMailNeo@web164704.mail.gq1.yahoo.com> <6DF21523-2B27-4107-8CB0-25FD6B564A5E@spearmorgan.com> <36611D8D-62CF-4C55-984F-432E3812D209@spearmorgan.com> <1381940996.17371.YahooMailNeo@web164705.mail.gq1.yahoo.com> <1381948031.11083.YahooMailNeo@web164703.mail.gq1.yahoo.com> <1382031105.81824.YahooMailNeo@web164702.mail.gq1.yahoo.com> Message-ID: On Oct 17, 2013, at 10:31 AM, James Board wrote: > >And issue is probably withing avi container as it > >may not add every frame into index table. > >And when seeking you never check if returned packet actually is right > >one that you need. > > > >Or it could be bug in your code how you seek in file, etc... > > I did a rewrite of my code and it now works. But I don't know why. > I modified the demuxing.c example so that it seeks to frame 0, calls > decode_packet, seeks to frame 10, calls decode_packet, etc. I > seek to every 10th frame and call decode_packet(). I also > modified decode_packet() so that it writes an output file whenever > 'got_frame' is non-zero. For the first four seeks (frame 0, 10, 20, 30), > 'got_frame' is NULL and no output image files are written. Then, > when I seek to frame 40, the output file for frame 0 is written. When I seek to > 60, the output for frame 10 is written. When I seek to frame 60, the output > for frame 20 is written, etc. Eventually, the 'flush cached frames' loop is > entered and the final files are written. > > Does this make sense or sound familiar to anyone? What is happening here? > Does this have anything to do with cached frames? I've before what 'cached > frames' are but nobody answered. Does anyone understand this? What you're describing sounds like the multithreading approach that ffmpeg uses. My understanding: The first decode call starts a decode action which spawns a thread to decode that frame. Each subsequent decode call starts a new action/thread, until you run out of threads, at which point the next decode action will return the frame that you started decoding in the first call. That's why you have to look at the frame number of the decoded frame, not of the packet you passed in. Maybe you also get a frame back if it's 'ready' - not sure. Note - this means you always have to run decode a few extra times with a null packet to get the frames flushed out. > > Also, none of the above oddness happens if I use AVI files encoded with > no codec or with lossless JPEG, or a few other codecs. Possibly those codecs don't support multithreading? Certainly 'none' wouldn't do anything, so that would be expected. Id' hope that lossless JPEG would use threads though, so I may be off track. Bruce > > > > > On Wednesday, October 16, 2013 3:48 PM, Paul B Mahol wrote: > On 10/16/13, Paul B Mahol wrote: > > On 10/16/13, James Board wrote: > >>>Why don't you simply test this yourself? > >>>It cannot take more time to test than to write your > >>>mail, let alone write (and read!) the answers. > >> > >> I did. It generated the extra frames. So the libav implementation > >> works this way. Or at least my code works that way, and my code > >> might be screwed. The question I mean to ask (maybe I wasn't clear) > >> is whether there is anything fundamental to the huffyuv algorithm > >> which prevents me from decoding a single frame. If the answer > >> is 'yes', then I know not to dig through the source code (big > >> learning curve) because that effort can't possibly work. If > >> the answer is 'no, then I'll press on. > > > > There is nothing in huffyuv algorithm and ffvhuff which could cause this. > > > > And issue is probably withing avi container as it > may not add every frame into index table. > And when seeking you never check if returned packet actually is right > one that you need. > > Or it could be bug in your code how you seek in file, etc... > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user -------------- next part -------------- An HTML attachment was scrubbed... URL: From jpboard2 at yahoo.com Thu Oct 17 21:31:21 2013 From: jpboard2 at yahoo.com (James Board) Date: Thu, 17 Oct 2013 12:31:21 -0700 (PDT) Subject: [Libav-user] Problems with ffvhuff and huvvyuv In-Reply-To: References: <1381847586.95305.YahooMailNeo@web164703.mail.gq1.yahoo.com> <1381931538.25973.YahooMailNeo@web164704.mail.gq1.yahoo.com> <6DF21523-2B27-4107-8CB0-25FD6B564A5E@spearmorgan.com> <36611D8D-62CF-4C55-984F-432E3812D209@spearmorgan.com> <1381940996.17371.YahooMailNeo@web164705.mail.gq1.yahoo.com> <1381948031.11083.YahooMailNeo@web164703.mail.gq1.yahoo.com> <1382031105.81824.YahooMailNeo@web164702.mail.gq1.yahoo.com> Message-ID: <1382038281.4013.YahooMailNeo@web164705.mail.gq1.yahoo.com> >What you're describing sounds like the multithreading approach that ffmpeg uses. My >understanding: The first decode call starts a decode action which spawns a thread to >decode that frame. Each subsequent decode call starts a new action/thread, until you run >out of threads, at which point the next decode action will return the frame that you started >decoding in the first call. That's why you have to look at the frame number of the decoded >frame, not of the packet you passed in. Maybe you also get a frame back if it's 'ready' - >not sure. > >Note - this means you always have to run decode a few extra times with a null packet to >get the frames flushed out. That explains it 100 percent.? When I ran this code on a 6-core machine (12 virtual cores), it seemed to generate an extra 12 frames.? When I ran on a 2-core machine, it generated 4 extra frames.? When I recoded things so I didn't compare the frame I asked for and the frame that was returned, then the problem went away. So the question becomes: How can I turn off this behavior?? I want to run multiple instances of my program so I don't want it using all the available cores anyway. If I can't turn it off through the API, can I hack something in the code to turn this off, or maybe limit it? -------------- next part -------------- An HTML attachment was scrubbed... URL: From onemda at gmail.com Thu Oct 17 21:37:34 2013 From: onemda at gmail.com (Paul B Mahol) Date: Thu, 17 Oct 2013 19:37:34 +0000 Subject: [Libav-user] Problems with ffvhuff and huvvyuv In-Reply-To: <1382038281.4013.YahooMailNeo@web164705.mail.gq1.yahoo.com> References: <1381847586.95305.YahooMailNeo@web164703.mail.gq1.yahoo.com> <1381931538.25973.YahooMailNeo@web164704.mail.gq1.yahoo.com> <6DF21523-2B27-4107-8CB0-25FD6B564A5E@spearmorgan.com> <36611D8D-62CF-4C55-984F-432E3812D209@spearmorgan.com> <1381940996.17371.YahooMailNeo@web164705.mail.gq1.yahoo.com> <1381948031.11083.YahooMailNeo@web164703.mail.gq1.yahoo.com> <1382031105.81824.YahooMailNeo@web164702.mail.gq1.yahoo.com> <1382038281.4013.YahooMailNeo@web164705.mail.gq1.yahoo.com> Message-ID: On 10/17/13, James Board wrote: >>What you're describing > sounds like the multithreading approach that ffmpeg uses. My >>understanding: The first decode call starts a decode action which spawns a >> thread to >decode that frame. Each subsequent decode call starts a new >> action/thread, until you run >out of threads, at which point the next > decode action will return the frame that you started >decoding in the > first call. That's why you have to look at the frame number of the > decoded >frame, not of the packet you passed in. Maybe you also get a > frame back if it's 'ready' - >not sure. >> > >>Note - this means you always have to run decode a few extra times with a >> null packet to >get the frames flushed out. > > That explains it 100 percent. When I ran this code on a 6-core machine (12 > virtual cores), it seemed to generate an extra 12 frames. When I ran on a > 2-core > machine, it generated 4 extra frames. When I recoded things so I didn't > compare > the frame I asked for and the frame that was returned, then the problem went > away. > > So the question becomes: How can I turn off this behavior? I want to run > multiple > instances of my program so I don't want it using all the available cores > anyway. > If I can't turn it off through the API, can I hack something in the code to > turn this > off, or maybe limit it? IIRC: av_opt_set_int(YourAVCodecContext, "threads", 1, 0); From alexcohn at netvision.net.il Fri Oct 18 00:15:17 2013 From: alexcohn at netvision.net.il (Alex Cohn) Date: Fri, 18 Oct 2013 00:15:17 +0200 Subject: [Libav-user] mpeg4 encoding with no b-frames In-Reply-To: References: Message-ID: The ffmpeg mpeg4 encoder was designed to preserve b-frames as in input. It warns you that these frames will be rearranged. It's just a warning. BR, Alex Cohn On Thu, Oct 17, 2013 at 11:42 AM, marcin_ffmpeg wrote: > > Dear All > > In my application I'm trying to re-encode video from h264 to mpeg4. It is important to have no b-frames in the output file so I set > encoder context to max_b_frames=0, gop_size is fixed to 25. > With this setting I get loads of following warnings > [mpeg4 @ 0xa53f3620] warning, too many b frames in a row > > Problem does not exists when encoder gop_size is set to decoder gop_size and max_b_frames is set to 10. > > Is there something what can be done about that? Does frame after decoding from h264 have to be somehow converted? > > Thanks for any help > Marcin > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user From leanneattard at gmail.com Fri Oct 18 09:02:12 2013 From: leanneattard at gmail.com (leanne attard) Date: Fri, 18 Oct 2013 09:02:12 +0200 Subject: [Libav-user] missing mandatory atoms, broken header In-Reply-To: References: Message-ID: thanks for the reply, I am getting the same error and some other information: attached a screenshot - ffmpeg output.png On Thu, Oct 17, 2013 at 5:17 PM, Carl Eugen Hoyos wrote: > leanne attard writes: > > > I am using opencv to read from a video file output > > from a Vivotek ipcamera model(IP 3872). > > What does ffmpeg -i video_file show for the file that > you want to read from? > > Carl Eugen > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ffmpeg output.png Type: image/png Size: 39454 bytes Desc: not available URL: From cehoyos at ag.or.at Fri Oct 18 10:21:14 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Fri, 18 Oct 2013 08:21:14 +0000 (UTC) Subject: [Libav-user] missing mandatory atoms, broken header References: Message-ID: leanne attard writes: > thanks for the reply, I am getting the same error and > some other information: It appears the file can be read, does any operation fail? > attached a screenshot - ffmpeg output.png Please do not attache screenshots, simply paste the console output. And please do not top-post here, Carl Eugen From marcin_ffmpeg at interia.pl Fri Oct 18 12:41:04 2013 From: marcin_ffmpeg at interia.pl (marcin_ffmpeg) Date: Fri, 18 Oct 2013 12:41:04 +0200 Subject: [Libav-user] mpeg4 encoding with no b-frames In-Reply-To: References: Message-ID: I understand that if re-encoding with no b-frames is correct for mpeg4 than there should be no warning at all. When I get a few gigabytes log per hour than it's no just warning. Is there a possibility to suppress these warnings other than library code modification? Can I access somechow pict_type field in AVCodecParserContext and modify it so that warning is not triggered? Marcin Od: "Alex Cohn" Do: "This list is about using libavcodec, libavformat, libavutil, libavdevice and libavfilter." ; Wys?ane: 0:15 Pi?tek 2013-10-18 Temat: Re: [Libav-user] mpeg4 encoding with no b-frames > The ffmpeg mpeg4 encoder was designed to preserve b-frames as in > input. It warns you that these frames will be rearranged. It's just a > warning. > > BR, > Alex Cohn > > On Thu, Oct 17, 2013 at 11:42 AM, marcin_ffmpeg > wrote: > > > > Dear All > > > > In my application I'm trying to re-encode video from h264 to mpeg4. It is important to have no b-frames in the output file so I set > > encoder context to max_b_frames=0, gop_size is fixed to 25. > > With this setting I get loads of following warnings > > [mpeg4 @ 0xa53f3620] warning, too many b frames in a row > > > > Problem does not exists when encoder gop_size is set to decoder gop_size and max_b_frames is set to 10. > > > > Is there something what can be done about that? Does frame after decoding from h264 have to be somehow converted? > > > > Thanks for any help > > Marcin > > _______________________________________________ > > Libav-user mailing list > > Libav-user at ffmpeg.org > > http://ffmpeg.org/mailman/listinfo/libav-user > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > From leanneattard at gmail.com Fri Oct 18 14:26:34 2013 From: leanneattard at gmail.com (leanne attard) Date: Fri, 18 Oct 2013 14:26:34 +0200 Subject: [Libav-user] missing mandatory atoms, broken header In-Reply-To: References: Message-ID: Thanks for the reply the output is Seems stream 0 codec frame rate differs from container frame rate: 30000.00 (30000/1) -> 50.17 (301/6) the problem is that when I am trying to skip some frames in Opencv in order to start the video from a particular frame other than 0, the set position is incorrect therefore i guess that the timebase of the video is not set properly. Had to re-encode the video, although I would prefer to solve it without have to do so, for every video I am getting from the camera. On Fri, Oct 18, 2013 at 10:21 AM, Carl Eugen Hoyos wrote: > leanne attard writes: > > > thanks for the reply, I am getting the same error and > > some other information: > > It appears the file can be read, does any operation fail? > > > attached a screenshot - ffmpeg output.png > > Please do not attache screenshots, simply > paste the console output. > > And please do not top-post here, Carl Eugen > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jaspreet_sachdev at yahoo.com Fri Oct 18 19:24:09 2013 From: jaspreet_sachdev at yahoo.com (Jaspreet Singh) Date: Fri, 18 Oct 2013 10:24:09 -0700 (PDT) Subject: [Libav-user] mpegts and id3 metadata Message-ID: <1382117049.68808.YahooMailNeo@web141003.mail.bf1.yahoo.com> Hi, I would like to use ffmpeg to create a mpegts with custom metadata information. The following urls show how these tags can be added: https://developer.apple.com/library/ios/documentation/AudioVideo/Conceptual/HTTP_Live_Streaming_Metadata_Spec/2/2.html#//apple_ref/doc/uid/TP40010435-CH2-DontLinkElementID_9 I would like to know if ffmpeg supports adding metadata to mpegts ? Regards, Jaspreet -------------- next part -------------- An HTML attachment was scrubbed... URL: From jaspreet_sachdev at yahoo.com Thu Oct 17 20:43:32 2013 From: jaspreet_sachdev at yahoo.com (Jaspreet Singh) Date: Thu, 17 Oct 2013 11:43:32 -0700 (PDT) Subject: [Libav-user] ID3 Tag write Message-ID: <1382035412.86108.YahooMailNeo@web141001.mail.bf1.yahoo.com> Hi, Is there a way to access ff_id3v2_write() method from a user application? I do not see a top level api which accesses this function. I want to write an application which create a mpegts with a ID3 pid which carries custom information. Regards, Jaspreet -------------- next part -------------- An HTML attachment was scrubbed... URL: From sylviojalves at gmail.com Fri Oct 18 13:35:40 2013 From: sylviojalves at gmail.com (sirvo) Date: Fri, 18 Oct 2013 04:35:40 -0700 (PDT) Subject: [Libav-user] HW decoding on Android In-Reply-To: References: <51C4D7BB.5090904@gmail.com> <201307112034.32601.cehoyos@ag.or.at> <1381414261739-4658632.post@n4.nabble.com> Message-ID: <1382096140291-4658706.post@n4.nabble.com> Hi, Ok, got libstagefright of ffmpeg working and playing full HD videos on android! However, the new problem is the color conversion. Did a lot of search on web and I got that this is a problem. My sample file is YUV420P. Does libstagefright decode de video and keep this format? By reading the code, it seems so. However, if a try a I420toRGBA or sws_scale conversion to display on a WINDOW_RGB_8888, I got b/w screen. Is there anything to do to fix it? Thanks! -- View this message in context: http://libav-users.943685.n4.nabble.com/Libav-user-HW-decoding-on-Android-tp4657968p4658706.html Sent from the libav-users mailing list archive at Nabble.com. From onemda at gmail.com Fri Oct 18 21:22:43 2013 From: onemda at gmail.com (Paul B Mahol) Date: Fri, 18 Oct 2013 19:22:43 +0000 Subject: [Libav-user] ID3 Tag write In-Reply-To: <1382035412.86108.YahooMailNeo@web141001.mail.bf1.yahoo.com> References: <1382035412.86108.YahooMailNeo@web141001.mail.bf1.yahoo.com> Message-ID: On 10/17/13, Jaspreet Singh wrote: > Hi, > Is there a way to access ff_id3v2_write() method from a user application? No. From cehoyos at ag.or.at Fri Oct 18 21:51:46 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Fri, 18 Oct 2013 19:51:46 +0000 (UTC) Subject: [Libav-user] mpegts and id3 metadata References: <1382117049.68808.YahooMailNeo@web141003.mail.bf1.yahoo.com> Message-ID: Jaspreet Singh writes: > Hi,I would like to use ffmpeg to create a mpegts > with custom metadata information. Please consider opening an enhancement request on trac if you do not intend to send a patch. Carl Eugen From cehoyos at ag.or.at Fri Oct 18 21:54:57 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Fri, 18 Oct 2013 19:54:57 +0000 (UTC) Subject: [Libav-user] HW decoding on Android References: <51C4D7BB.5090904@gmail.com> <201307112034.32601.cehoyos@ag.or.at> <1381414261739-4658632.post@n4.nabble.com> <1382096140291-4658706.post@n4.nabble.com> Message-ID: sirvo writes: > Ok, got libstagefright of ffmpeg working and > playing full HD videos on android! Could you elaborate a little on what you had to do? I remember some users had problems... Thank you, Carl Eugen From krueger at lesspain.de Sun Oct 20 14:03:49 2013 From: krueger at lesspain.de (=?UTF-8?Q?Robert_Kr=C3=BCger?=) Date: Sun, 20 Oct 2013 14:03:49 +0200 Subject: [Libav-user] Criteria for h.264 key-frame detection Message-ID: Hi, I have AVCHD files from a camera (Panasonic Lumix GH1) that demux and decode with libavformat/libavcodec detecting no other keyframe but the first (both, the first video packet and video frame are marked as keyframe), which is not what I would have expected for those clips as the GOP structure of files produced by this camera is known to be different. My question is now, what libavcodec/libavformat uses as criteria to decide whether a packet is a keyframe packet or a frame is a keyframe in this case. Does it only trigger in the case of IDRs or are recovery point SEIs also detected? Should I open a trac issue for this with a sample? My requirement is, I want to find points in the stream suitable for random access using libavformat/libavcodec. What are my options for this kind of files? Thanks, Robert From cehoyos at ag.or.at Sun Oct 20 14:16:44 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Sun, 20 Oct 2013 12:16:44 +0000 (UTC) Subject: [Libav-user] Criteria for h.264 key-frame detection References: Message-ID: Robert Kr?ger writes: > I have AVCHD files from a camera (Panasonic Lumix GH1) that demux and > decode with libavformat/libavcodec detecting no other keyframe but the > first (both, the first video packet and video frame are marked as > keyframe), which is not what I would have expected for those clips as > the GOP structure of files produced by this camera is known to be > different. Afaiu, the files are field-encoded and I suspect it is not easy to decide if a "frame" (as output by libavcodec) is a keyframe or not if it consists of one field that can be decoded by itself and a second field that depends on earlier data, possibly older than the other (key-) field. > My question is now, what libavcodec/libavformat uses as criteria to > decide whether a packet is a keyframe packet or a frame is a keyframe > in this case. I wonder how the criteria could look like (to make you happy)... > Does it only trigger in the case of IDRs or are recovery > point SEIs also detected? The recovery points are definitely detected, see also below. > Should I open a trac issue for this with a sample? Didn't you already open a ticket? > My requirement is, I want to find points in the stream suitable for > random access using libavformat/libavcodec. What are my options for > this kind of files? I was under the impression that lavf/lavc support recovery points very well (even in slightly broken streams), ie that you (as a user) can choose if you only want to seek to a recovery point (slower, done by ffplay) or to some frame no matter if it is a recovery point or not (faster, this is what MPlayer does). Do I miss something? Or to try it differently: If FFmpeg would report an output frame consisting of an I-field and a non-I field as a keyframe, I believe that you would have no guarantee that the frame can be decoded by itself (because the second field may depend on something very old). Carl Eugen (Disclaimer: My knowledge of H264 is quite limited, so maybe I completely misunderstand.) From krueger at lesspain.de Sun Oct 20 14:32:48 2013 From: krueger at lesspain.de (=?UTF-8?Q?Robert_Kr=C3=BCger?=) Date: Sun, 20 Oct 2013 14:32:48 +0200 Subject: [Libav-user] Criteria for h.264 key-frame detection In-Reply-To: References: Message-ID: On Sun, Oct 20, 2013 at 2:16 PM, Carl Eugen Hoyos wrote: > Robert Kr?ger writes: > >> I have AVCHD files from a camera (Panasonic Lumix GH1) that demux and >> decode with libavformat/libavcodec detecting no other keyframe but the >> first (both, the first video packet and video frame are marked as >> keyframe), which is not what I would have expected for those clips as >> the GOP structure of files produced by this camera is known to be >> different. > > Afaiu, the files are field-encoded and I suspect it is not easy > to decide if a "frame" (as output by libavcodec) is a keyframe > or not if it consists of one field that can be decoded by itself > and a second field that depends on earlier data, possibly older > than the other (key-) field. You are implying things here. This is not about ticket #3063 but a different camera. There the behaviour is different from the one described in #3063 and the same also for progressive files. > >> My question is now, what libavcodec/libavformat uses as criteria to >> decide whether a packet is a keyframe packet or a frame is a keyframe >> in this case. > > I wonder how the criteria could look like (to make you happy)... I am asking what the criteria are, not requesting something or reporting a defect (yet), just to be able to decide whether I should open a ticket. > >> Does it only trigger in the case of IDRs or are recovery >> point SEIs also detected? > > The recovery points are definitely detected, see also below. > >> Should I open a trac issue for this with a sample? > > Didn't you already open a ticket? Not for this (explained above). > >> My requirement is, I want to find points in the stream suitable for >> random access using libavformat/libavcodec. What are my options for >> this kind of files? > > I was under the impression that lavf/lavc support recovery > points very well (even in slightly broken streams), ie > that you (as a user) can choose if you only want to seek to > a recovery point (slower, done by ffplay) or to some frame > no matter if it is a recovery point or not (faster, this > is what MPlayer does). > Do I miss something? I don't know if you miss something. I am simply asking for help/information. So are you saying that AVPacket.key_frame should be set to 1 for recovery points in H.264? > > Or to try it differently: If FFmpeg would report an output frame > consisting of an I-field and a non-I field as a keyframe, I believe > that you would have no guarantee that the frame can be decoded > by itself (because the second field may depend on something > very old). I agree but you are again implying things. I have not requested that but merely asked a question and I am still not really sure if you have answered it. Robert From cehoyos at ag.or.at Sun Oct 20 14:44:01 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Sun, 20 Oct 2013 12:44:01 +0000 (UTC) Subject: [Libav-user] Criteria for h.264 key-frame detection References: Message-ID: Robert Kr?ger writes: > So are you saying that AVPacket.key_frame should be > set to 1 for recovery points in H.264? No, on the contrary, I don't think this would "work" (depending on the definition of work) in the sense that the frame marked as key_frame cannot be independently decoded if all recovery points were marked as key_frames. What I was trying to say is that the combination of libavformat and libavcodec supports recovery points, ie the user can choose if he wants to seek to a recovery point or to some frame (no matter if it can be independently decoded). I don't think I understand the other use case of recovery frames that you apparently have in mind. (The disclaimer still applies but I wonder if you know that a valid H264 stream does not necessarily contain keyframes but still allows to seek without corruption afaiu.) Carl Eugen From krueger at lesspain.de Mon Oct 21 09:50:20 2013 From: krueger at lesspain.de (=?UTF-8?Q?Robert_Kr=C3=BCger?=) Date: Mon, 21 Oct 2013 09:50:20 +0200 Subject: [Libav-user] Criteria for h.264 key-frame detection In-Reply-To: References: Message-ID: On Sun, Oct 20, 2013 at 2:44 PM, Carl Eugen Hoyos wrote: > Robert Kr?ger writes: > >> So are you saying that AVPacket.key_frame should be >> set to 1 for recovery points in H.264? > > No, on the contrary, I don't think this would "work" > (depending on the definition of work) in the sense > that the frame marked as key_frame cannot be > independently decoded if all recovery points were > marked as key_frames. > What I was trying to say is that the combination > of libavformat and libavcodec supports recovery > points, ie the user can choose if he wants to seek > to a recovery point or to some frame (no matter if > it can be independently decoded). > I don't think I understand the other use case of > recovery frames that you apparently have in mind. Suppose I just wanted to find out which valid recovery points are for a transport stream file by reading the output of the demuxer (e.g. to display this in an analysis report) or any other means if you have another suggestion. Looking at the API documentation, h264 code and debugging a bit this is what I have found so far. Maybe it helps someone else. The h.264 parser sets key_frame = 1 (AVCodecParserContext) for packets following a recovery point SEI (even if recovery_frame_cnt is > 1 and regardless of the value of the exact_match_flag, which is not parsed) and that triggers the AVPacket's AV_PKT_FLAG_KEY being set. After checking docs for a second time, I would say this is consistent with the documentation of AVPacket.convergence_duration. This is the behavior I can see with the files described in ticket #3063, but that is not the issue here. For those files AFAICS, the demuxer side works as documented. In case of the files I am talking about here, there are no recovery point SEIs after the first frame so libavformat/avcodec is probably doing everything correctly, too. Since I think I know that these streams in fact do have random access points, I will probably have to parse the h264 metadata myself and apply some heuristics in my application but filing a ticket does not seem to make sense as it does not appear to be a defect and I don't think anyone would have an interest to work on such heuristics or further investigation, how random access points can be found in such a stream (if they exist, which I have yet to prove). > > (The disclaimer still applies but I wonder if you > know that a valid H264 stream does not necessarily > contain keyframes but still allows to seek without > corruption afaiu.) I do. From cehoyos at ag.or.at Mon Oct 21 12:13:14 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Mon, 21 Oct 2013 10:13:14 +0000 (UTC) Subject: [Libav-user] Criteria for h.264 key-frame detection References: Message-ID: Robert Kr?ger writes: > In case of the files I am talking about here, there are no recovery > point SEIs after the first frame so libavformat/avcodec is probably > doing everything correctly, too. Since I think I know that these > streams in fact do have random access points, I will probably have to > parse the h264 metadata myself and apply some heuristics in my > application but filing a ticket does not seem to make sense as it does > not appear to be a defect and I don't think anyone would have an > interest to work on such heuristics or further investigation, how > random access points can be found in such a stream (if they exist, > which I have yet to prove). I don't know how you come to the conclusion that (both library and application) users wouldn't want the heuristic (last week something probably related was committed). Please provide the sample, Carl Eugen From francesco.damato7 at gmail.com Mon Oct 21 12:38:49 2013 From: francesco.damato7 at gmail.com (Francesco Damato) Date: Mon, 21 Oct 2013 12:38:49 +0200 Subject: [Libav-user] encoder h264 In-Reply-To: <31B0BB793C136842844728D22D74831144455BD7BE@LGEVEXMBAPSVC1.LGE.NET> References: <31B0BB793C136842844728D22D74831144455BD7BE@LGEVEXMBAPSVC1.LGE.NET> Message-ID: Hi, thanks for your help. Your function above, if i understood correctly, read from raw file, put data into video_buf and at the end returned the number of bytes read. Now i want to encode, so i must to pass raw data to avcodec_encode_video2 function, that takes input raw video data from frame. So how can i pass data to this function?? Have i to put the data in data field of AVFrame Structure?? I hope to be clear. Regards 2013/10/17 Aravind Madineni > Pseudo Code**** > > ** ** > > static size_t fill_yuv_image_from_file(AVPicture *pict, int > frame_index,int width, int height,FILE *video_dst_filename)**** > > {**** > > ** ** > > uint8_t *video_buf=NULL;**** > > int x,y;**** > > size_t bytesRead;**** > > ** ** > > video_buf =(uint8_t *)malloc((3*width*height)>>1);**** > > //Initialize to zero**** > > memset(video_buf,0,sizeof(uint8_t)* ((3*width*height)>>1));**** > > bytesRead =fread((uint8_t > *)video_buf,sizeof(uint8_t),((3*width*height)>>1),video_dst_filename);**** > > if(feof(video_dst_filename))**** > > {**** > > fprintf(stdout,"\n End of File. BytesRead is :%ld",bytesRead);**** > > free(video_buf);**** > > return END_OF_FILE;**** > > }**** > > if(bytesRead)**** > > {**** > > ** ** > > fprintf(stdout,"\n No Of Video Bytes Read :%ld",bytesRead);**** > > /* Y */**** > > for(y =0;y < height ;y++){**** > > for(x = 0; x < width; x++){**** > > pict->data[0][y * pict->linesize[0] + x]=*video_buf++;**** > > }**** > > }**** > > ** ** > > /* Cb */**** > > for (y = 0; y < height / 2; y++) {**** > > for (x = 0; x < width / 2; x++) {**** > > pict->data[1][y * pict->linesize[1] + x] = *video_buf++; > //[y*height+x];**** > > ** ** > > }**** > > }**** > > /* Cr */**** > > for (y = 0; y < height / 2; y++) {**** > > for (x = 0; x < width / 2; x++) {**** > > pict->data[2][y * pict->linesize[2] + x] = *video_buf++; > //[y*height+(x+1)];**** > > }**** > > }**** > > video_buf-=((3*width*height)>>1);**** > > }**** > > else{**** > > fprintf(stdout,"\n Video Bytes Read:%ld",bytesRead);**** > > }**** > > free(video_buf);**** > > return bytesRead;**** > > }**** > > ** ** > > *From:* libav-user-bounces at ffmpeg.org [mailto: > libav-user-bounces at ffmpeg.org] *On Behalf Of *Francesco Damato > *Sent:* Wednesday, October 16, 2013 8:05 PM > *To:* This list is about using libavcodec, libavformat, libavutil, > libavdevice and libavfilter. > *Subject:* [Libav-user] encoder h264**** > > ** ** > > Hi,**** > > ** ** > > i am writing a C program (encoder) that use h264 to encode video read from > avi or mp4 file; the avcodec_encode_video2 function takes input raw video > data from frame, so i demux my files and i obtain a raw video file; now i > want encode it, so how can i open the raw file, read the frames and encode > them into h264??**** > > ** ** > > > I saw the example decoding_encoding.c that generates a video from dummy > pictures... but how do I replace this part and read and encode my rawvideo > file? > > Can you help me, there are other examples or books available? > > Thanks!!!**** > > ** ** > > -- > Francesco Damato **** > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > > -- Francesco Damato -------------- next part -------------- An HTML attachment was scrubbed... URL: From krueger at lesspain.de Mon Oct 21 12:53:49 2013 From: krueger at lesspain.de (=?UTF-8?Q?Robert_Kr=C3=BCger?=) Date: Mon, 21 Oct 2013 12:53:49 +0200 Subject: [Libav-user] Criteria for h.264 key-frame detection In-Reply-To: References: Message-ID: On Mon, Oct 21, 2013 at 12:13 PM, Carl Eugen Hoyos wrote: > Robert Kr?ger writes: > >> In case of the files I am talking about here, there are no recovery >> point SEIs after the first frame so libavformat/avcodec is probably >> doing everything correctly, too. Since I think I know that these >> streams in fact do have random access points, I will probably have to >> parse the h264 metadata myself and apply some heuristics in my >> application but filing a ticket does not seem to make sense as it does >> not appear to be a defect and I don't think anyone would have an >> interest to work on such heuristics or further investigation, how >> random access points can be found in such a stream (if they exist, >> which I have yet to prove). > > I don't know how you come to the conclusion that (both > library and application) users wouldn't want the > heuristic (last week something probably related was > committed). Even better. Which commit are you talking about? > Please provide the sample, Carl Eugen I'll be more than happy to do that. How do you want me to do it? Open a ticket (if so, what would be an appropriate topic/title in your opinion?) or by some other means? > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user From cehoyos at ag.or.at Mon Oct 21 13:04:40 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Mon, 21 Oct 2013 11:04:40 +0000 (UTC) Subject: [Libav-user] Criteria for h.264 key-frame detection References: Message-ID: Robert Kr?ger writes: > I'll be more than happy to do that. How do you want > me to do it? Open a ticket (if so, what would be an > appropriate topic/title in your opinion?) or by > some other means? Whatever seems appropriate and simple to you, as you know there is a ftp/http upload site, you can use http://www.datafilehost.com/ and judging from links other people use, there is a possibility to use Google docs to provide files. Carl Eugen From krueger at lesspain.de Mon Oct 21 15:33:19 2013 From: krueger at lesspain.de (=?UTF-8?Q?Robert_Kr=C3=BCger?=) Date: Mon, 21 Oct 2013 15:33:19 +0200 Subject: [Libav-user] Criteria for h.264 key-frame detection In-Reply-To: References: Message-ID: On Mon, Oct 21, 2013 at 1:04 PM, Carl Eugen Hoyos wrote: > Robert Kr?ger writes: > >> I'll be more than happy to do that. How do you want >> me to do it? Open a ticket (if so, what would be an >> appropriate topic/title in your opinion?) or by >> some other means? > > Whatever seems appropriate and simple to you, as you > know there is a ftp/http upload site, you can use > http://www.datafilehost.com/ and judging from links > other people use, there is a possibility to use > Google docs to provide files. I uploaded two shortened samples from the same camera to /incoming/avchd_samples_with_no_keyframes_after_first. If my debug output is correct, both contain no B-slices/frames (I just noticed that) but they do contain I-slices/frames. If I am not missing something, those I-Frames should be valid random access points then. Neither demuxer nor decoder report a keyframe after the first frame. I guess a ticket could be justified. You decide. >> heuristic (last week something probably related was >> committed). > Even better. Which commit are you talking about? Could you please answer that? Thank you. Robert From cehoyos at ag.or.at Mon Oct 21 16:21:42 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Mon, 21 Oct 2013 14:21:42 +0000 (UTC) Subject: [Libav-user] Criteria for h.264 key-frame detection References: Message-ID: Robert Kr?ger writes: > If my debug output is correct, both contain no > B-slices/frames (I just noticed that) but they > do contain I-slices/frames. If I am not missing > something, those I-Frames should be valid random > access points then. Do you mean you debugged the sample (with a stream analyzer) and you know that every I-frame is a random access point or would you just expect every I-frame in the sample being a random access point? Testing the 720p sample, it appears to me that FFmpeg thinks the first random access point after the initial IDR frame is the 28th frame, a P-frame. If FFmpeg is right (and the 27th frame is no random access point), how should the random access point be signaled? [...] > > Even better. Which commit are you talking about? Iirc, fixed ticket with keyword "h264". Carl Eugen From krueger at lesspain.de Mon Oct 21 17:06:59 2013 From: krueger at lesspain.de (=?UTF-8?Q?Robert_Kr=C3=BCger?=) Date: Mon, 21 Oct 2013 17:06:59 +0200 Subject: [Libav-user] Criteria for h.264 key-frame detection In-Reply-To: References: Message-ID: On Mon, Oct 21, 2013 at 4:21 PM, Carl Eugen Hoyos wrote: > Robert Kr?ger writes: > >> If my debug output is correct, both contain no >> B-slices/frames (I just noticed that) but they >> do contain I-slices/frames. If I am not missing >> something, those I-Frames should be valid random >> access points then. > > Do you mean you debugged the sample (with a stream > analyzer) and you know that every I-frame is a > random access point or would you just expect every > I-frame in the sample being a random access point? Not with a stream analyzer but by adding code to ffmpeg's h264 parser and reading the spec. Since only P- and I-slices are parsed (I can see that in the debug output), I would indeed expect every I-frame (meaning any frame only consisting of one I-slice in the stream) to be a valid access point or I am missing something (which may very well be the case). > > Testing the 720p sample, it appears to me that > FFmpeg thinks the first random access point after > the initial IDR frame is the 28th frame, a P-frame. What do you mean "thinks". Are you looking at the seeking code? Judging by the debug output of the h.264 parser I see that the packet with pts 79304 (it's the 27th packet from the start) contains an I-slice and is the only slice parsed from that packet, so I would say that this is indeed a self-contained I-frame (also the size/bitrate of that packet is an indication for it being an I slice). There is also an SPS at 79304. > If FFmpeg is right (and the 27th frame is no random > access point), how should the random access point > be signaled? You mean what criterion to use to decide it's a random access point? I naively thought, when only encountering P- and I-slices in the entire stream any picture that only consists of one I-slice could be considered a valid random access point especially with the coincidence that there seems to be an SPS directly before every I-slice in the stream but I am far from being an h264 expert and may be wrong. > > [...] > >> > Even better. Which commit are you talking about? > > Iirc, fixed ticket with keyword "h264". You mean 2738? Robert From cehoyos at ag.or.at Mon Oct 21 17:46:55 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Mon, 21 Oct 2013 15:46:55 +0000 (UTC) Subject: [Libav-user] Criteria for h.264 key-frame detection References: Message-ID: Robert Kr?ger writes: > Since only P- and I-slices are parsed (I can see that > in the debug output), I would indeed expect every > I-frame (meaning any frame only consisting of one > I-slice in the stream) to be a valid access point So you mean a P-frame after an I-frame is not allowed to reference an earlier I-frame? I don't think this is correct. Carl Eugen From krueger at lesspain.de Mon Oct 21 18:26:27 2013 From: krueger at lesspain.de (=?UTF-8?Q?Robert_Kr=C3=BCger?=) Date: Mon, 21 Oct 2013 18:26:27 +0200 Subject: [Libav-user] Criteria for h.264 key-frame detection In-Reply-To: References: Message-ID: On Mon, Oct 21, 2013 at 5:46 PM, Carl Eugen Hoyos wrote: > Robert Kr?ger writes: > >> Since only P- and I-slices are parsed (I can see that >> in the debug output), I would indeed expect every >> I-frame (meaning any frame only consisting of one >> I-slice in the stream) to be a valid access point > > So you mean a P-frame after an I-frame is not allowed to > reference an earlier I-frame? > I don't think this is correct. You are probably correct here. I have to check the spec. Would be a very weird stream, though. Have you seen such a beast in the wild? Anyway, my theory is that it is not the case here and, since this is an AVCHD file which is usually accompanied by other auxiliary files, I guess that explicit marking of random access points in the stream is usually not necessary for hard/software that relies on the AVCHD spec being followed, because they are stored in a separate file (my assumption, for which I have no proof). The bad thing is that I haven't found a version of the spec online and it costs a lot of money, so I cannot check this immediately. Anyway, it does not help much in deciding how ffmpeg is supposed to decide it is a random access point. Btw, is it intentional that you don't answer questions I ask in my emails? It feels a bit impolite to be honest. I don't remember not answering a question you have asked. From cehoyos at ag.or.at Mon Oct 21 18:38:34 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Mon, 21 Oct 2013 16:38:34 +0000 (UTC) Subject: [Libav-user] Criteria for h.264 key-frame detection References: Message-ID: Robert Kr?ger writes: > Btw, is it intentional that you don't answer questions > I ask in my emails? Please understand that you know much more than I do about H.264 so I simply cannot answer most of your questions. http://wiki.multimedia.cx/index.php?title=Mirror contains a copy of an old H.264 draft, I would expect it to cover recovery points. Carl Eugen From cehoyos at ag.or.at Mon Oct 21 18:45:15 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Mon, 21 Oct 2013 16:45:15 +0000 (UTC) Subject: [Libav-user] Criteria for h.264 key-frame detection References: Message-ID: Robert Kr?ger writes: > >> > Even better. Which commit are you talking about? > > > > Iirc, fixed ticket with keyword "h264". > > You mean 2738? I believe this is the one I meant. Carl Eugen From krueger at lesspain.de Mon Oct 21 18:52:38 2013 From: krueger at lesspain.de (=?UTF-8?Q?Robert_Kr=C3=BCger?=) Date: Mon, 21 Oct 2013 18:52:38 +0200 Subject: [Libav-user] Criteria for h.264 key-frame detection In-Reply-To: References: Message-ID: On Mon, Oct 21, 2013 at 6:38 PM, Carl Eugen Hoyos wrote: > Robert Kr?ger writes: > >> Btw, is it intentional that you don't answer questions >> I ask in my emails? > > Please understand that you know much more than I do about > H.264 so I simply cannot answer most of your questions. No, I don't mean that type of question. I was interested to know how you found out that ffmpeg "thinks" the 28th frame is a random access point and I asked you about it just to learn more about ffmpeg myself, because it does help in making better bug reports and a lot of the code is not exactly self-explanatory so, any chance to learn in a a situation like this helps. > > http://wiki.multimedia.cx/index.php?title=Mirror contains > a copy of an old H.264 draft, I would expect it to cover > recovery points. Thanks but I have the spec text here (probably from the same source) and have read the part about recovery points. Robert From rob.schmidt86 at outlook.com Mon Oct 21 15:31:42 2013 From: rob.schmidt86 at outlook.com (Robert Schmidt) Date: Mon, 21 Oct 2013 13:31:42 +0000 Subject: [Libav-user] Problem Generating B-Frames Using libavcodec/libx264 Message-ID: Hello all, I am writing a an application that encodes incoming video in H.264 using libavcodec and libx264.? However, I noticed that the output data was much larger than I expected.? When I examined the output, I discovered that the encoder was only producing I- and P-frames and never producing B-frames. I created a standalone utility in an attempt to isolate my encoding logic and determine what I am doing wrong.? The utility reads in H.264 video from a file stored using the ITU H.264 Annex B format, decodes it, re-encodes it, and writes the resulting packets to another file in the Annex B format.? Like my application, the test utility fails to generate any B-frames. I ran the input file through ffmpeg using the same settings that I was providing in my utility and found that ffmpeg does produce B-frames.? I have been trying to determine what I am doing differently than ffmpeg, but I have not been able to figure it out yet.? I'm hoping that perhaps someone on this list can spot my oversight. I use the following command line with ffmpeg: ??? $ ffmpeg -v debug -i ~/annexb.264 -codec:v libx264 -preset superfast -g 30 -f h264 ./out.264 As far as I can tell, ffmpeg should simply be using the "superfast" libx264 preset and a group of pictures setting of 30 frames.? Beyond that, it should be using the defaults. My code to set up the encoder looks like the following: static AVStream *add_video_stream(AVFormatContext *output_ctx, AVCodec **output_codec, enum AVCodecID codec_id) { ??? *output_codec = avcodec_find_encoder(codec_id); ??? if (*output_codec == NULL) { ??????? printf("Could not find encoder for '%s' (%d)\n", avcodec_get_name(codec_id), codec_id); ??????? return NULL; ??? } ??? AVStream *output_stream = avformat_new_stream(output_ctx, *output_codec); ??? if (output_stream == NULL) { ??????? printf("Could not create video stream.\n"); ??????? return NULL; ??? } ??? output_stream->id = output_ctx->nb_streams - 1; ??? AVCodecContext *codec_ctx = output_stream->codec; ??? avcodec_get_context_defaults3(codec_ctx, *output_codec); ??? codec_ctx->width = 1280; ??? codec_ctx->height = 720; ??? codec_ctx->time_base.den = 15000; ??? codec_ctx->time_base.num = 1001; /*??? codec_ctx->gop_size = 30;*/ ??? codec_ctx->pix_fmt = AV_PIX_FMT_YUVJ420P; ??? // try to force B-frame output /*??? codec_ctx->max_b_frames = 3;*/ /*??? codec_ctx->b_frame_strategy = 2;*/ ??? output_stream->sample_aspect_ratio.num = 1; ??? output_stream->sample_aspect_ratio.den = 1; ??? codec_ctx->sample_aspect_ratio.num = 1; ??? codec_ctx->sample_aspect_ratio.den = 1; ??? codec_ctx->chroma_sample_location = AVCHROMA_LOC_LEFT; ??? codec_ctx->bits_per_raw_sample = 8; ??? if ((output_ctx->oformat->flags & AVFMT_GLOBALHEADER) != 0) { ??????? codec_ctx->flags |= CODEC_FLAG_GLOBAL_HEADER; ??? } ??? return output_stream; } int main(int argc, char **argv) { ??? // ... open input file ??? avformat_alloc_output_context2(&output_ctx, NULL, "h264", output_path); ??? if (output_ctx == NULL) { ??????? fprintf(stderr, "Unable to allocate output context.\n"); ??????? return 1; ??? } ??? AVCodec *output_codec = NULL; ??? output_stream = add_video_stream(output_ctx, &output_codec, output_ctx->oformat->video_codec); ??? if (output_stream == NULL) { ??????? fprintf(stderr, "Error adding video stream to output context.\n"); ??????? return 1; ??? } ??? encode_ctx = output_stream->codec; ??? // seems to have no effect #if 0 ??? if (decode_ctx->extradata_size != 0) { ??????? size_t extradata_size = decode_ctx->extradata_size; ??????? printf("extradata_size: %zu\n", extradata_size); ??????? encode_ctx->extradata = av_mallocz(extradata_size + FF_INPUT_BUFFER_PADDING_SIZE); ??????? memcpy(encode_ctx->extradata, decode_ctx->extradata, extradata_size); ??????? encode_ctx->extradata_size = extradata_size; ??? } #endif // 0 ??? AVDictionary *opts = NULL; ??? av_dict_set(&opts, "preset", "superfast", 0); ??? // av_dict_set(&opts, "threads", "auto", 0); // seems to have no effect ??? ret = avcodec_open2(encode_ctx, output_codec, &opts); ??? if (ret < 0) { ??????? fprintf(stderr, "Unable to open output video cocec: %s\n", av_err2str(ret)); ??????? return 1; ??? } ??? // ... decoding/encoding loop, clean up, etc. ??? return 0; } I have tried manually specifying the B-frame parameters in the AVCodecContext structure to no avail. I've also tried debugging both my utility and ffmpeg under gdb so that I can compare the values of the AVCodecContext, X264Context, and AVStream structures. ? I have tried to make sure they are identical, but I still am not getting any B-frames. For a while I thought perhaps the issue was that I was mishandling timestamps, so I replicated ffmpeg's processing chain and output timestamp debugging information similar to what ffmpeg produces.? My debugging output appears identical to ffmpeg's. Does anyone have any ideas as to what I may be doing wrong?? I asked the same question on StackOverflow last week (http://stackoverflow.com/q/19456745/2895838) where I also included some of the logging output from both ffmpeg and my test utility.? I've omitted that here in the interest of brevity.? I also thought that the entire source code for the test utility would be too long for an e-mail, but I'm happy to provide more if that is helpful. For what it's worth, I'm currently using ffmpeg 1.2 and its libraries. Any assistance is greatly appreciated.? I've been banging my head against this one for a while now. Thanks in advance. Rob From cehoyos at ag.or.at Mon Oct 21 20:26:52 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Mon, 21 Oct 2013 18:26:52 +0000 (UTC) Subject: [Libav-user] Criteria for h.264 key-frame detection References: Message-ID: Robert Kr?ger writes: > I was interested to know how you found out that > ffmpeg "thinks" the 28th frame is a random access > point I concatenated the second until the 29th frame of the input sample and tested decoding with current FFmpeg. I also wanted to test with the reference decoder (that may have answered all our questions) but it crashes. I used the reference decoder but ffmpeg -vf showinfo allows you to see the type of frames. (I had the suspicion you patched the source to find out.) Carl Eugen From andre.dos.anjos at gmail.com Tue Oct 22 08:17:39 2013 From: andre.dos.anjos at gmail.com (=?UTF-8?B?QW5kcsOpIEFuam9z?=) Date: Tue, 22 Oct 2013 08:17:39 +0200 Subject: [Libav-user] ffmpeg @ 2.0.X has a bogus FFV1 codec? Message-ID: Hello, I'm using a MacPorts build of ffmpeg 2.0.2. It passes most of our tests, except the one using the FFV1 codec. This seems independent of the file format chosen. How to reproduce the problem: 1) Download the muxing example from the ffmpeg doxygen documentation ( http://ffmpeg.org/doxygen/2.0/doc_2examples_2muxing_8c-example.html) 2) By the end of the application, replace the code: if (fmt->video_codec != AV_CODEC_ID_NONE) { video_st = add_stream(oc, &video_codec, fmt->video_codec); } With: video_st = add_stream(oc, &video_codec, AV_CODEC_ID_FFV1) So, that the FFV1 codec is forced. 3) Compile the program (on OSX, that would be): clang -I/opt/local/include test.c -L/opt/local/lib -lavutil -lavcodec -lavformat -lswscale -lswresample -o ffmpeg_test 4) Run the program: ./ffmpeg_test foo.avi to get: [libmp3lame @ 0x7fa7d201f200] Channel layout not specified Output #0, avi, to 'test.avi': Stream #0:0: Video: ffv1, yuv420p, 352x288, q=2-31, 400 kb/s, 90k tbn, 25 tbc Stream #0:1: Audio: mp3 (libmp3lame), 44100 Hz, 2 channels, fltp, 64 kb/s Error encoding video frame: Invalid argument Result: Bogus file, with error Expected result: clean file with no errors. Can anyone confirm this or provide some light on what I could possibly be doing wrong? A developer from MacPorts has confirmed the problem - it does not happen on 1.2.x. It does happen with 2.0.1 and 2.0.2 ( https://trac.macports.org/ticket/40829). Thanks in advance, A -- Andr? Anjos http://andreanjos.org -------------- next part -------------- An HTML attachment was scrubbed... URL: From cehoyos at ag.or.at Tue Oct 22 08:52:49 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Tue, 22 Oct 2013 06:52:49 +0000 (UTC) Subject: [Libav-user] ffmpeg 2.0.X has a bogus FFV1 codec? References: Message-ID: Andr? Anjos writes: > [libmp3lame 0x7fa7d201f200] Channel layout not specified >?Output #0, avi, to 'test.avi':? > ? ?Stream #0:0: Video: ffv1, yuv420p, 352x288, q=2-31, > 400 kb/s, 90k tbn,?25 tbc? > ? ?Stream #0:1: Audio: mp3 (libmp3lame), 44100 Hz, > 2 channels, fltp, 64?kb/s >?Error encoding video frame: Invalid argument Is this the whole output? Or is there anything above? Carl Eugen From andre.dos.anjos at gmail.com Tue Oct 22 09:07:54 2013 From: andre.dos.anjos at gmail.com (=?UTF-8?B?QW5kcsOpIEFuam9z?=) Date: Tue, 22 Oct 2013 09:07:54 +0200 Subject: [Libav-user] ffmpeg 2.0.X has a bogus FFV1 codec? In-Reply-To: References: Message-ID: This is the whole output. Andr? On Tue, Oct 22, 2013 at 8:52 AM, Carl Eugen Hoyos wrote: > Andr? Anjos writes: > > > [libmp3lame 0x7fa7d201f200] Channel layout not specified > > Output #0, avi, to 'test.avi': > > Stream #0:0: Video: ffv1, yuv420p, 352x288, q=2-31, > > 400 kb/s, 90k tbn, 25 tbc > > Stream #0:1: Audio: mp3 (libmp3lame), 44100 Hz, > > 2 channels, fltp, 64 kb/s > > Error encoding video frame: Invalid argument > > Is this the whole output? > Or is there anything above? > > Carl Eugen > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > -- Andr? Anjos http://andreanjos.org -------------- next part -------------- An HTML attachment was scrubbed... URL: From onemda at gmail.com Tue Oct 22 10:29:17 2013 From: onemda at gmail.com (Paul B Mahol) Date: Tue, 22 Oct 2013 08:29:17 +0000 Subject: [Libav-user] ffmpeg @ 2.0.X has a bogus FFV1 codec? In-Reply-To: References: Message-ID: On 10/22/13, Andre Anjos wrote: > Hello, > > I'm using a MacPorts build of ffmpeg 2.0.2. It passes most of our tests, > except the one using the FFV1 codec. This seems independent of the file > format chosen. > > How to reproduce the problem: > > 1) Download the muxing example from the ffmpeg doxygen documentation ( > http://ffmpeg.org/doxygen/2.0/doc_2examples_2muxing_8c-example.html) > > 2) By the end of the application, replace the code: > > if (fmt->video_codec != AV_CODEC_ID_NONE) { > video_st = add_stream(oc, &video_codec, fmt->video_codec); > } > > With: > > video_st = add_stream(oc, &video_codec, AV_CODEC_ID_FFV1) > > So, that the FFV1 codec is forced. > > 3) Compile the program (on OSX, that would be): > > clang -I/opt/local/include test.c -L/opt/local/lib -lavutil > -lavcodec -lavformat -lswscale -lswresample -o ffmpeg_test > > 4) Run the program: > > ./ffmpeg_test foo.avi > > to get: > > [libmp3lame @ 0x7fa7d201f200] Channel layout not specified > Output #0, avi, to 'test.avi': > Stream #0:0: Video: ffv1, yuv420p, 352x288, q=2-31, 400 kb/s, 90k tbn, > 25 tbc > Stream #0:1: Audio: mp3 (libmp3lame), 44100 Hz, 2 channels, fltp, 64 > kb/s > Error encoding video frame: Invalid argument > > Result: Bogus file, with error > > Expected result: clean file with no errors. > > Can anyone confirm this or provide some light on what I could possibly be > doing wrong? A developer from MacPorts has confirmed the problem - it does > not happen on 1.2.x. It does happen with 2.0.1 and 2.0.2 ( > https://trac.macports.org/ticket/40829). > > Thanks in advance, A FFmpeg 2.0.X does not have bogus FFV1 codec. The examples code is of very low quality. FFV1 encoder have been changed in its initialization to abort when width/height is not set. From krueger at lesspain.de Tue Oct 22 12:43:14 2013 From: krueger at lesspain.de (=?UTF-8?Q?Robert_Kr=C3=BCger?=) Date: Tue, 22 Oct 2013 12:43:14 +0200 Subject: [Libav-user] Criteria for h.264 key-frame detection In-Reply-To: References: Message-ID: On Mon, Oct 21, 2013 at 8:26 PM, Carl Eugen Hoyos wrote: > Robert Kr?ger writes: > >> I was interested to know how you found out that >> ffmpeg "thinks" the 28th frame is a random access >> point > > I concatenated the second until the 29th frame of the > input sample and tested decoding with current FFmpeg. > I also wanted to test with the reference decoder > (that may have answered all our questions) but it > crashes. Thanks for the info. I just cut away everything from the file until the start of the packet containing the 27th frame (tail -c4329532 gh1_720p.mts > gh1_720p_cat.mts) and the resulting file decodes without artifacts using ffmpeg. The number of decoded frames is also as expected. So I think this is at least an indication that the 27th frame is indeed a valid random access point. > > I used the reference decoder but ffmpeg -vf showinfo > allows you to see the type of frames. > (I had the suspicion you patched the source to find > out.) I have but I am outputting the info on the parser/slice level. At least for interlaced material I have cases where the information in the frame is incorrect but it is still correct at the slice level. Robert From cehoyos at ag.or.at Tue Oct 22 12:57:17 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Tue, 22 Oct 2013 10:57:17 +0000 (UTC) Subject: [Libav-user] Criteria for h.264 key-frame detection References: Message-ID: Robert Kr?ger writes: > I just cut away everything from the file until the start > of the packet containing the 27th frame > (tail -c4329532 gh1_720p.mts > gh1_720p_cat.mts) and the > resulting file decodes without artifacts using ffmpeg. (With or without -flags2 showall?) > The number of decoded frames is also as expected. So I > think this is at least an indication that the 27th > frame is indeed a valid random access point. I don't think the fact that a frame can be decoded (correctly) implies that it is a random access point. Carl Eugen From cehoyos at ag.or.at Tue Oct 22 13:03:15 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Tue, 22 Oct 2013 11:03:15 +0000 (UTC) Subject: [Libav-user] Criteria for h.264 key-frame detection References: Message-ID: Carl Eugen Hoyos writes: > Robert Kr?ger ...> writes: > > > I just cut away everything from the file until the start > > of the packet containing the 27th frame > > (tail -c4329532 gh1_720p.mts > gh1_720p_cat.mts) and the > > resulting file decodes without artifacts using ffmpeg. > > (With or without -flags2 showall?) Afaict, the 27th frame is not shown, ffmpeg "thinks" that it is no random access point. Carl Eugen From krueger at lesspain.de Tue Oct 22 13:46:56 2013 From: krueger at lesspain.de (=?UTF-8?Q?Robert_Kr=C3=BCger?=) Date: Tue, 22 Oct 2013 13:46:56 +0200 Subject: [Libav-user] Criteria for h.264 key-frame detection In-Reply-To: References: Message-ID: On Tue, Oct 22, 2013 at 12:57 PM, Carl Eugen Hoyos wrote: > Robert Kr?ger writes: > >> I just cut away everything from the file until the start >> of the packet containing the 27th frame >> (tail -c4329532 gh1_720p.mts > gh1_720p_cat.mts) and the >> resulting file decodes without artifacts using ffmpeg. > > (With or without -flags2 showall?) > >> The number of decoded frames is also as expected. So I >> think this is at least an indication that the 27th >> frame is indeed a valid random access point. > > I don't think the fact that a frame can be decoded > (correctly) implies that it is a random access point. I thought that was the definition of it but more importantly for all practical purposes (being able to create subclips, seeking) that's what is typically the important thing but I agree that it takes more knowledge than that to change ffmpeg code in a way that reliably detects that (if possible at all). As I wrote earlier in this thread, if this is not done in ffmpeg (I am not qualified to do that in the h264 code), I will probably do that outside (parse h264 structures to build an index of random access points, if necessary applying heuristics that work for the files I am interested in). From krueger at lesspain.de Tue Oct 22 13:50:35 2013 From: krueger at lesspain.de (=?UTF-8?Q?Robert_Kr=C3=BCger?=) Date: Tue, 22 Oct 2013 13:50:35 +0200 Subject: [Libav-user] Criteria for h.264 key-frame detection In-Reply-To: References: Message-ID: On Tue, Oct 22, 2013 at 1:03 PM, Carl Eugen Hoyos wrote: > Carl Eugen Hoyos writes: > >> Robert Kr?ger ...> writes: >> >> > I just cut away everything from the file until the start >> > of the packet containing the 27th frame >> > (tail -c4329532 gh1_720p.mts > gh1_720p_cat.mts) and the >> > resulting file decodes without artifacts using ffmpeg. >> >> (With or without -flags2 showall?) It is displayed correctly in an application using libavformat/codec. That's what I used for testing if it and the following frames could be decoded correctly. > > Afaict, the 27th frame is not shown, ffmpeg "thinks" that > it is no random access point. > What do you mean by "not shown"? From cehoyos at ag.or.at Tue Oct 22 14:00:02 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Tue, 22 Oct 2013 12:00:02 +0000 (UTC) Subject: [Libav-user] Criteria for h.264 key-frame detection References: Message-ID: Robert Kr?ger writes: > > Afaict, the 27th frame is not shown, ffmpeg "thinks" > > that it is no random access point. > > What do you mean by "not shown"? It is not decoded unless flags2 showall is used because FFmpeg thinks the 27th frame is not a random access point. Carl Eugen From andre.dos.anjos at gmail.com Tue Oct 22 14:49:04 2013 From: andre.dos.anjos at gmail.com (=?UTF-8?B?QW5kcsOpIEFuam9z?=) Date: Tue, 22 Oct 2013 14:49:04 +0200 Subject: [Libav-user] ffmpeg @ 2.0.X has a bogus FFV1 codec? In-Reply-To: References: Message-ID: Thanks for this reply. Could you please share a fix for the program that makes it work? Andr? On Tue, Oct 22, 2013 at 10:29 AM, Paul B Mahol wrote: > On 10/22/13, Andre Anjos wrote: > > Hello, > > > > I'm using a MacPorts build of ffmpeg 2.0.2. It passes most of our tests, > > except the one using the FFV1 codec. This seems independent of the file > > format chosen. > > > > How to reproduce the problem: > > > > 1) Download the muxing example from the ffmpeg doxygen documentation ( > > http://ffmpeg.org/doxygen/2.0/doc_2examples_2muxing_8c-example.html) > > > > 2) By the end of the application, replace the code: > > > > if (fmt->video_codec != AV_CODEC_ID_NONE) { > > video_st = add_stream(oc, &video_codec, fmt->video_codec); > > } > > > > With: > > > > video_st = add_stream(oc, &video_codec, AV_CODEC_ID_FFV1) > > > > So, that the FFV1 codec is forced. > > > > 3) Compile the program (on OSX, that would be): > > > > clang -I/opt/local/include test.c -L/opt/local/lib -lavutil > > -lavcodec -lavformat -lswscale -lswresample -o ffmpeg_test > > > > 4) Run the program: > > > > ./ffmpeg_test foo.avi > > > > to get: > > > > [libmp3lame @ 0x7fa7d201f200] Channel layout not specified > > Output #0, avi, to 'test.avi': > > Stream #0:0: Video: ffv1, yuv420p, 352x288, q=2-31, 400 kb/s, 90k > tbn, > > 25 tbc > > Stream #0:1: Audio: mp3 (libmp3lame), 44100 Hz, 2 channels, fltp, 64 > > kb/s > > Error encoding video frame: Invalid argument > > > > Result: Bogus file, with error > > > > Expected result: clean file with no errors. > > > > Can anyone confirm this or provide some light on what I could possibly be > > doing wrong? A developer from MacPorts has confirmed the problem - it > does > > not happen on 1.2.x. It does happen with 2.0.1 and 2.0.2 ( > > https://trac.macports.org/ticket/40829). > > > > Thanks in advance, A > > FFmpeg 2.0.X does not have bogus FFV1 codec. > > The examples code is of very low quality. > > FFV1 encoder have been changed in its initialization to abort when > width/height is not set. > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > -- Andr? Anjos http://andreanjos.org -------------- next part -------------- An HTML attachment was scrubbed... URL: From krueger at lesspain.de Tue Oct 22 14:50:42 2013 From: krueger at lesspain.de (=?UTF-8?Q?Robert_Kr=C3=BCger?=) Date: Tue, 22 Oct 2013 14:50:42 +0200 Subject: [Libav-user] Criteria for h.264 key-frame detection In-Reply-To: References: Message-ID: On Tue, Oct 22, 2013 at 2:00 PM, Carl Eugen Hoyos wrote: > Robert Kr?ger writes: > >> > Afaict, the 27th frame is not shown, ffmpeg "thinks" >> > that it is no random access point. >> >> What do you mean by "not shown"? > > It is not decoded unless flags2 showall is used because > FFmpeg thinks the 27th frame is not a random access > point. This must be a misunderstanding. You are probably not saying ffmpeg only decodes frames at random access points. Again, I checked the frame and the number of frames that were decoded in my application and that frame is decoded just fine using the file produced by cutting off anything before the 27th frame's packet. You are probably talking about an ffmpeg command line you used for testing. I am only guessing you made ffmpeg seek or something like that? What is your suggestion how I should proceed? Make a ticket and reference this thread? I guess it would be interesting to have Michael's opinion as h264 maintainer, if he thinks this stream is handled correctly or the handling could be improved as far as key frame detection/seeking is concerned. Again, if there is no interest in looking at this, I will probably hack something in our application. In any case, I will share anything I find out with regard to the handling of that specific stream. From cehoyos at ag.or.at Tue Oct 22 15:06:11 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Tue, 22 Oct 2013 13:06:11 +0000 (UTC) Subject: [Libav-user] Criteria for h.264 key-frame detection References: Message-ID: Robert Kr?ger writes: > >> > Afaict, the 27th frame is not shown, ffmpeg "thinks" > >> > that it is no random access point. > >> > >> What do you mean by "not shown"? > > > > It is not decoded unless flags2 showall is used because > > FFmpeg thinks the 27th frame is not a random access > > point. > You are probably talking about an ffmpeg command line you > used for testing. I am only guessing you made ffmpeg seek > or something like that? No. Which command does decode the 27th frame for you? It is not decoded here unless I use -flags2 showall. Carl Eugen From krueger at lesspain.de Tue Oct 22 15:36:30 2013 From: krueger at lesspain.de (=?UTF-8?Q?Robert_Kr=C3=BCger?=) Date: Tue, 22 Oct 2013 15:36:30 +0200 Subject: [Libav-user] Criteria for h.264 key-frame detection In-Reply-To: References: Message-ID: On Tue, Oct 22, 2013 at 3:06 PM, Carl Eugen Hoyos wrote: > Robert Kr?ger writes: > >> >> > Afaict, the 27th frame is not shown, ffmpeg "thinks" >> >> > that it is no random access point. >> >> >> >> What do you mean by "not shown"? >> > >> > It is not decoded unless flags2 showall is used because >> > FFmpeg thinks the 27th frame is not a random access >> > point. > >> You are probably talking about an ffmpeg command line you >> used for testing. I am only guessing you made ffmpeg seek >> or something like that? > > No. > Which command does decode the 27th frame for you? > It is not decoded here unless I use -flags2 showall. I have an application built on libavformat/libavcodec that demuxes/decodes the frame fine. I am not using ffmpeg to test because there is so much more stuff going on like rate control that just decoding the sequence of pictures appears to be the easiest way to check if the stream can be decoded from that frame without any other thing interfering. I tested the command line and it indeed seems to duplicate the second frame of the truncated file. Anyway, let me know what is supposed to happen with this issue. From andre.dos.anjos at gmail.com Tue Oct 22 15:42:30 2013 From: andre.dos.anjos at gmail.com (=?UTF-8?B?QW5kcsOpIEFuam9z?=) Date: Tue, 22 Oct 2013 15:42:30 +0200 Subject: [Libav-user] ffmpeg @ 2.0.X has a bogus FFV1 codec? In-Reply-To: References: Message-ID: Another question: >From my investigations, the program aborts at a failed attempt to encode a new frame (using avcodec_encode_video2()). If the problem is on the initialisation, how can I check the codec is ready before attempting an encode? Thanks, Andr? On Tue, Oct 22, 2013 at 2:49 PM, Andr? Anjos wrote: > Thanks for this reply. Could you please share a fix for the program that > makes it work? > > Andr? > > > On Tue, Oct 22, 2013 at 10:29 AM, Paul B Mahol wrote: > >> On 10/22/13, Andre Anjos wrote: >> > Hello, >> > >> > I'm using a MacPorts build of ffmpeg 2.0.2. It passes most of our tests, >> > except the one using the FFV1 codec. This seems independent of the file >> > format chosen. >> > >> > How to reproduce the problem: >> > >> > 1) Download the muxing example from the ffmpeg doxygen documentation ( >> > http://ffmpeg.org/doxygen/2.0/doc_2examples_2muxing_8c-example.html) >> > >> > 2) By the end of the application, replace the code: >> > >> > if (fmt->video_codec != AV_CODEC_ID_NONE) { >> > video_st = add_stream(oc, &video_codec, fmt->video_codec); >> > } >> > >> > With: >> > >> > video_st = add_stream(oc, &video_codec, AV_CODEC_ID_FFV1) >> > >> > So, that the FFV1 codec is forced. >> > >> > 3) Compile the program (on OSX, that would be): >> > >> > clang -I/opt/local/include test.c -L/opt/local/lib -lavutil >> > -lavcodec -lavformat -lswscale -lswresample -o ffmpeg_test >> > >> > 4) Run the program: >> > >> > ./ffmpeg_test foo.avi >> > >> > to get: >> > >> > [libmp3lame @ 0x7fa7d201f200] Channel layout not specified >> > Output #0, avi, to 'test.avi': >> > Stream #0:0: Video: ffv1, yuv420p, 352x288, q=2-31, 400 kb/s, 90k >> tbn, >> > 25 tbc >> > Stream #0:1: Audio: mp3 (libmp3lame), 44100 Hz, 2 channels, fltp, >> 64 >> > kb/s >> > Error encoding video frame: Invalid argument >> > >> > Result: Bogus file, with error >> > >> > Expected result: clean file with no errors. >> > >> > Can anyone confirm this or provide some light on what I could possibly >> be >> > doing wrong? A developer from MacPorts has confirmed the problem - it >> does >> > not happen on 1.2.x. It does happen with 2.0.1 and 2.0.2 ( >> > https://trac.macports.org/ticket/40829). >> > >> > Thanks in advance, A >> >> FFmpeg 2.0.X does not have bogus FFV1 codec. >> >> The examples code is of very low quality. >> >> FFV1 encoder have been changed in its initialization to abort when >> width/height is not set. >> _______________________________________________ >> Libav-user mailing list >> Libav-user at ffmpeg.org >> http://ffmpeg.org/mailman/listinfo/libav-user >> > > > > -- > Andr? Anjos > http://andreanjos.org > -- Andr? Anjos http://andreanjos.org -------------- next part -------------- An HTML attachment was scrubbed... URL: From rafaware at gmail.com Tue Oct 22 16:37:30 2013 From: rafaware at gmail.com (Rafa Lopez) Date: Tue, 22 Oct 2013 16:37:30 +0200 Subject: [Libav-user] Problema with RTP stream (h264) In-Reply-To: <525FD89E.8030004@gmail.com> References: <525FD89E.8030004@gmail.com> Message-ID: Hi Camera Man Thanks for the reply. I have also patched my own ffmpeg (2.0.2) with the following lines in udp.c (avformat directory): // #define UDP_TX_BUF_SIZE 32768 old value #define UDP_TX_BUF_SIZE 65536 // #define UDP_MAX_PKT_SIZE 65536 old value #define UDP_MAX_PKT_SIZE 131072 and still fails. I have algo patch with UDP_MAX_PKT_SIZE 524288 (and UDP_MAX_PKT_SIZE 1048576) and still fails. Testing and testing I have found that that with version 0.8.15 (with UDP_MAX_PKT_SIZE 65536) it happens less. Are you sure it depends on that parameter? Any other ideas I can try? If I reduce the resolution of the camera, it work properly. The original resolucion (1280x960) always fails Thanks in advance 2013/10/17 Camera Man > On 10/15/2013 02:21 PM, Rafa Lopez wrote: > >> ./ffmpeg -i "rtsp://192.168.0.95:554/**profile1< >> http://192.168.0.95:554/**profile1 >" >> -y %6d.jpg -log-level debug >> >> >> The problem is that I always get corrupt images (example attached). I >> think the problem is >> >> [h264 @ 0x1c28d60] RTP: missed 146 packets >> [AVIOContext @ 0x7f3190016d20] Statistics: 0 seeks, 3 writeouts >> [h264 @ 0x1f82300] concealing 2237 DC, 2237 AC, 2237 MV errors in I frame >> [h264 @ 0x1fc7160] Frame num gap 8 6 >> >> RTP missed packets. I attach the full log. Anyone can help me? >> > > No way to properly solve with ffmpeg configuration at this point, although > adding "-rtsp_transport tcp" before "-y" will reduce the pain for you. > > > Unfortunately, the udp layer will set it's SO_RCVBUF kernel buffer to at > most 64K, (which e.g. Linux will translate to a 128K buffer). That > practically guarantees that any single frame larger than 128K (e.g., an > average I-frame in an 1280x720 stream) will not fit within the kernel > socket buffers, resulting in at least one packet (and part of the frame) > dropped, thus the corruption you see. > > > I do not know of a way to ask FFMPEG to properly increase the UDP kernel > buffer size. I had patched my own ffmpeg to set SO_RCVBUF to 1024K, and it > worked for me. But then I switched to TCP and stopped worrying (Using TCP > instead DOES introduce latency and waste bandwidth, because packets are > getting lost and retransmitted, but I don't care about another 10ms or 10% > higher bandwidth as I'm on a local network). > > The udp layer does have a "buffer_size" parameter, but there's no way that > I'm aware of to pass it to the udp layer through the rtsp layer. > ______________________________**_________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/**listinfo/libav-user > -------------- next part -------------- An HTML attachment was scrubbed... URL: From andre.anjos at idiap.ch Tue Oct 22 09:01:08 2013 From: andre.anjos at idiap.ch (=?UTF-8?B?QW5kcsOpIEFuam9z?=) Date: Tue, 22 Oct 2013 09:01:08 +0200 Subject: [Libav-user] ffmpeg 2.0.X has a bogus FFV1 codec? In-Reply-To: References: Message-ID: This is the whole output. Andr? On Tue, Oct 22, 2013 at 8:52 AM, Carl Eugen Hoyos wrote: > Andr? Anjos writes: > > > [libmp3lame 0x7fa7d201f200] Channel layout not specified > > Output #0, avi, to 'test.avi': > > Stream #0:0: Video: ffv1, yuv420p, 352x288, q=2-31, > > 400 kb/s, 90k tbn, 25 tbc > > Stream #0:1: Audio: mp3 (libmp3lame), 44100 Hz, > > 2 channels, fltp, 64 kb/s > > Error encoding video frame: Invalid argument > > Is this the whole output? > Or is there anything above? > > Carl Eugen > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > -- Dr. Andr? Anjos Idiap Research Institute Centre du Parc - rue Marconi 19 CH-1920 Martigny, Suisse Phone: +41 27 721 7763 Fax: +41 27 721 7712 http://andreanjos.org -------------- next part -------------- An HTML attachment was scrubbed... URL: From salsaman at gmail.com Wed Oct 23 01:17:56 2013 From: salsaman at gmail.com (salsaman) Date: Tue, 22 Oct 2013 21:17:56 -0200 Subject: [Libav-user] Criteria for h.264 key-frame detection In-Reply-To: References: Message-ID: Carl, sorry to butt in, but you mentioned earlier: "I was under the impression that lavf/lavc support recovery points very well (even in slightly broken streams), ie that you (as a user) can choose if you only want to seek to a recovery point (slower, done by ffplay) or to some frame no matter if it is a recovery point or not (faster, this is what MPlayer does)." Just out interest how does one force seeking only to recovery points in lavf/lavc programmatically ? I have never been able to achieve this, in fact I have had to implement my own demuxers just for this purpose. Regards, Salsaman. http://lives.sourceforge.net https://www.ohloh.net/accounts/salsaman On Tue, Oct 22, 2013 at 10:36 AM, Robert Kr?ger wrote: > On Tue, Oct 22, 2013 at 3:06 PM, Carl Eugen Hoyos > wrote: > > Robert Kr?ger writes: > > > >> >> > Afaict, the 27th frame is not shown, ffmpeg "thinks" > >> >> > that it is no random access point. > >> >> > >> >> What do you mean by "not shown"? > >> > > >> > It is not decoded unless flags2 showall is used because > >> > FFmpeg thinks the 27th frame is not a random access > >> > point. > > > >> You are probably talking about an ffmpeg command line you > >> used for testing. I am only guessing you made ffmpeg seek > >> or something like that? > > > > No. > > Which command does decode the 27th frame for you? > > It is not decoded here unless I use -flags2 showall. > > I have an application built on libavformat/libavcodec that > demuxes/decodes the frame fine. I am not using ffmpeg to test because > there is so much more stuff going on like rate control that just > decoding the sequence of pictures appears to be the easiest way to > check if the stream can be decoded from that frame without any other > thing interfering. I tested the command line and it indeed seems to > duplicate the second frame of the truncated file. Anyway, let me know > what is supposed to happen with this issue. > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mrfun.china at gmail.com Wed Oct 23 03:43:34 2013 From: mrfun.china at gmail.com (YIRAN LI) Date: Wed, 23 Oct 2013 12:43:34 +1100 Subject: [Libav-user] Is it possible that same decoding code generate different result on different machines Message-ID: Hi guys, I'm testing a small piece of code which just read packet using av_read_frame and send packet to avcodec_decode_video2 to get a decoded frame. What surprised me was, when running this same program on different machines, avcodec_decode_video2 (AVCodecContext *avctx, AVFrame *picture, int *got_picture_ptr, const AVPacket *avpkt) return first true value at different packets. On both machines, I can read packets with packet.pts with 0, 200, 400, 600, 800, 1000. But on one machine, packet with 600 dts can get the first decoded frame, and on another one, the first frame is decoded until packet with 1000 dts is passed into avcodec_decode_video2. Since same binary and libs are running on 2 machines, so I assume that I should get same result. But seems that's not true. Has anyone else met a similar problem? Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: From cehoyos at ag.or.at Wed Oct 23 09:57:22 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Wed, 23 Oct 2013 07:57:22 +0000 (UTC) Subject: [Libav-user] Criteria for h.264 key-frame detection References: Message-ID: salsaman writes: > Just out interest how does one force seeking only to > recovery points in lavf/lavc programmatically ? It is the default, if it does not work for your, please report it (here). Note that ffmpeg (the application) supports seeking, so it should be possible to use it for testing. Please do not top-post, Carl Eugen From francesco.damato7 at gmail.com Wed Oct 23 12:23:05 2013 From: francesco.damato7 at gmail.com (Francesco Damato) Date: Wed, 23 Oct 2013 12:23:05 +0200 Subject: [Libav-user] Problem Generating B-Frames Using libavcodec/libx264 In-Reply-To: References: Message-ID: Hi Robert, i have your same goal, also I am writing a an application that encodes incoming video in H.264 using libavcodec and libx264. I don't know the solution for yuor problem, because i do not know how to encode. i have a avi or mp4 file as input. The *avcodec_encode_video2* function takes input raw video data from frame, so i demux my file and i obtain a raw video file; now i want encode it, so how i can open the raw file, read the raw frames and encode them into h264?? Is this the right wat yo encode in H.264? There are other solutions?? How do you encode?? Can you help me, please?? Thanks in advance. Regards 2013/10/21 Robert Schmidt > Hello all, > > I am writing a an application that encodes incoming video in H.264 using > libavcodec and libx264. However, I noticed that the output data was much > larger than I expected. When I examined the output, I discovered that the > encoder was only producing I- and P-frames and never producing B-frames. > > I created a standalone utility in an attempt to isolate my encoding logic > and determine what I am doing wrong. The utility reads in H.264 video from > a file stored using the ITU H.264 Annex B format, decodes it, re-encodes > it, and writes the resulting packets to another file in the Annex B > format. Like my application, the test utility fails to generate any > B-frames. > > I ran the input file through ffmpeg using the same settings that I was > providing in my utility and found that ffmpeg does produce B-frames. I > have been trying to determine what I am doing differently than ffmpeg, but > I have not been able to figure it out yet. I'm hoping that perhaps someone > on this list can spot my oversight. > > I use the following command line with ffmpeg: > > $ ffmpeg -v debug -i ~/annexb.264 -codec:v libx264 -preset superfast > -g 30 -f h264 ./out.264 > > As far as I can tell, ffmpeg should simply be using the "superfast" > libx264 preset and a group of pictures setting of 30 frames. Beyond that, > it should be using the defaults. > > My code to set up the encoder looks like the following: > > static AVStream *add_video_stream(AVFormatContext *output_ctx, AVCodec > **output_codec, enum AVCodecID codec_id) > { > *output_codec = avcodec_find_encoder(codec_id); > if (*output_codec == NULL) { > printf("Could not find encoder for '%s' (%d)\n", > avcodec_get_name(codec_id), codec_id); > return NULL; > } > > AVStream *output_stream = avformat_new_stream(output_ctx, > *output_codec); > if (output_stream == NULL) { > printf("Could not create video stream.\n"); > return NULL; > } > output_stream->id = output_ctx->nb_streams - 1; > AVCodecContext *codec_ctx = output_stream->codec; > > avcodec_get_context_defaults3(codec_ctx, *output_codec); > > codec_ctx->width = 1280; > codec_ctx->height = 720; > > codec_ctx->time_base.den = 15000; > codec_ctx->time_base.num = 1001; > > /* codec_ctx->gop_size = 30;*/ > codec_ctx->pix_fmt = AV_PIX_FMT_YUVJ420P; > > // try to force B-frame output > /* codec_ctx->max_b_frames = 3;*/ > /* codec_ctx->b_frame_strategy = 2;*/ > > output_stream->sample_aspect_ratio.num = 1; > output_stream->sample_aspect_ratio.den = 1; > > codec_ctx->sample_aspect_ratio.num = 1; > codec_ctx->sample_aspect_ratio.den = 1; > > codec_ctx->chroma_sample_location = AVCHROMA_LOC_LEFT; > > codec_ctx->bits_per_raw_sample = 8; > > if ((output_ctx->oformat->flags & AVFMT_GLOBALHEADER) != 0) { > codec_ctx->flags |= CODEC_FLAG_GLOBAL_HEADER; > } > > return output_stream; > } > > > int main(int argc, char **argv) > { > // ... open input file > > avformat_alloc_output_context2(&output_ctx, NULL, "h264", output_path); > if (output_ctx == NULL) { > fprintf(stderr, "Unable to allocate output context.\n"); > return 1; > } > > AVCodec *output_codec = NULL; > output_stream = add_video_stream(output_ctx, &output_codec, > output_ctx->oformat->video_codec); > if (output_stream == NULL) { > fprintf(stderr, "Error adding video stream to output context.\n"); > return 1; > } > encode_ctx = output_stream->codec; > > // seems to have no effect > #if 0 > if (decode_ctx->extradata_size != 0) { > size_t extradata_size = decode_ctx->extradata_size; > printf("extradata_size: %zu\n", extradata_size); > encode_ctx->extradata = av_mallocz(extradata_size + > FF_INPUT_BUFFER_PADDING_SIZE); > memcpy(encode_ctx->extradata, decode_ctx->extradata, > extradata_size); > encode_ctx->extradata_size = extradata_size; > } > #endif // 0 > > AVDictionary *opts = NULL; > av_dict_set(&opts, "preset", "superfast", 0); > // av_dict_set(&opts, "threads", "auto", 0); // seems to have no effect > > ret = avcodec_open2(encode_ctx, output_codec, &opts); > if (ret < 0) { > fprintf(stderr, "Unable to open output video cocec: %s\n", > av_err2str(ret)); > return 1; > } > > // ... decoding/encoding loop, clean up, etc. > > return 0; > } > > I have tried manually specifying the B-frame parameters in the > AVCodecContext structure to no avail. > > I've also tried debugging both my utility and ffmpeg under gdb so that I > can compare the values of the AVCodecContext, X264Context, and AVStream > structures. I have tried to make sure they are identical, but I still am > not getting any B-frames. > > For a while I thought perhaps the issue was that I was mishandling > timestamps, so I replicated ffmpeg's processing chain and output timestamp > debugging information similar to what ffmpeg produces. My debugging output > appears identical to ffmpeg's. > > Does anyone have any ideas as to what I may be doing wrong? I asked the > same question on StackOverflow last week ( > http://stackoverflow.com/q/19456745/2895838) where I also included some > of the logging output from both ffmpeg and my test utility. I've omitted > that here in the interest of brevity. I also thought that the entire > source code for the test utility would be too long for an e-mail, but I'm > happy to provide more if that is helpful. > > For what it's worth, I'm currently using ffmpeg 1.2 and its libraries. > > Any assistance is greatly appreciated. I've been banging my head against > this one for a while now. > > Thanks in advance. > > Rob > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > -- Francesco Damato -------------- next part -------------- An HTML attachment was scrubbed... URL: From rafaware at gmail.com Wed Oct 23 17:44:15 2013 From: rafaware at gmail.com (Rafa Lopez) Date: Wed, 23 Oct 2013 17:44:15 +0200 Subject: [Libav-user] MxPEG camera (Mobotix) avformat_open_input fail Message-ID: Hi all I'm tryng to retrieve a MxPEG stream from a mobotix camera. I'm using ffmpeg 2.0.2. If i try: ./ffmpeg -f mxg -i "http://192.168.0.78/control/faststream.jpg?stream=MxPEG" -y pipas.avi i have no problem. If i write my own sample code AVFormatContext formatContext; avformat_open_input( &formatContext, "http://192.168.0.78/control/faststream.jpg?stream=MxPEG&fps=6", NULL, NULL ) !=0 ) always return 0 without message. How can I force the value of format to "mxg"? I try: AVFormatContext *formatContext = avformat_alloc_context(); formatContext->video_codec_id = AV_CODEC_ID_MXPEG; but it doesn't work Thanks in advance -------------- next part -------------- An HTML attachment was scrubbed... URL: From alexcohn at netvision.net.il Wed Oct 23 17:59:56 2013 From: alexcohn at netvision.net.il (Alex Cohn) Date: Wed, 23 Oct 2013 18:59:56 +0300 Subject: [Libav-user] Is it possible that same decoding code generate different result on different machines In-Reply-To: References: Message-ID: On Oct 23, 2013 4:43 AM, "YIRAN LI" wrote: > > Hi guys, > > I'm testing a small piece of code which just read packet using av_read_frame and send packet to > avcodec_decode_video2 to get a decoded frame. > > What surprised me was, when running this same program on different machines, avcodec_decode_video2 (AVCodecContext *avctx, AVFrame *picture, int *got_picture_ptr, const AVPacket *avpkt) return first true value at different packets. > > On both machines, I can read packets with packet.pts with 0, 200, 400, 600, 800, 1000. > But on one machine, packet with 600 dts can get the first decoded frame, and on another one, > the first frame is decoded until packet with 1000 dts is passed into avcodec_decode_video2. > > Since same binary and libs are running on 2 machines, so I assume that I should get same result. > But seems that's not true. Has anyone else met a similar problem? > > Thanks One possible difference could be due to automatic multithreading. You could try to configure the codec to use single CPU or disable threading during build, to prove this is the case. BR, Alex -------------- next part -------------- An HTML attachment was scrubbed... URL: From cehoyos at ag.or.at Thu Oct 24 09:43:51 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Thu, 24 Oct 2013 07:43:51 +0000 (UTC) Subject: [Libav-user] =?utf-8?q?MxPEG_camera_=28Mobotix=29_avformat=5Fopen?= =?utf-8?q?=5Finput_fail?= References: Message-ID: Rafa Lopez writes: > ./ffmpeg -f mxg -i "http://192.168.0.78/control/faststream.jpg?stream=MxPEG" -y pipas.avi > AVFormatContext *formatContext = avformat_alloc_context(); > formatContext->video_codec_id = AV_CODEC_ID_MXPEG;but it doesn't work I don't know if this is the issue, but I would expect "-f mxg" to correspond to setting formatContext->iformat->name to "mxg". Carl Eugen From rafaware at gmail.com Thu Oct 24 11:19:41 2013 From: rafaware at gmail.com (Rafa Lopez) Date: Thu, 24 Oct 2013 11:19:41 +0200 Subject: [Libav-user] MxPEG camera (Mobotix) avformat_open_input fail In-Reply-To: References: Message-ID: Thanks Carl It works: formatContext = avformat_alloc_context(); //formatContext->video_codec_id = AV_CODEC_ID_MXPEG; formatContext->iformat = av_find_input_format ("mxg"); Best Regards 2013/10/24 Carl Eugen Hoyos > Rafa Lopez writes: > > > ./ffmpeg -f mxg -i > "http://192.168.0.78/control/faststream.jpg?stream=MxPEG" -y pipas.avi > > > AVFormatContext *formatContext = avformat_alloc_context(); > > formatContext->video_codec_id = AV_CODEC_ID_MXPEG;but it doesn't work > > I don't know if this is the issue, but I would > expect "-f mxg" to correspond to setting > formatContext->iformat->name to "mxg". > > Carl Eugen > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > -------------- next part -------------- An HTML attachment was scrubbed... URL: From andre.dos.anjos at gmail.com Fri Oct 25 09:35:27 2013 From: andre.dos.anjos at gmail.com (=?UTF-8?B?QW5kcsOpIEFuam9z?=) Date: Fri, 25 Oct 2013 09:35:27 +0200 Subject: [Libav-user] ffmpeg @ 2.0.X has a bogus FFV1 codec? In-Reply-To: References: Message-ID: After some more investigation and a good debugging session, it seems the problem comes from the initialisation of the AVFrame rather than the AVCodecContext (as one may misunderstand from the thread). To fix the example code, one has to insert 3 lines of code *just after* the "frame = avcodec_alloc_frame()" call inside "open_video()": /* new code to make FFV1 codec work well - does not disturb other codecs, so you can leave it there */ frame->format = c->pix_fmt; frame->width = c->width; frame->height = c->height; If you do this, then the example muxing application will work again. Could anyone fix the example code in ffmpeg so it reflects these modifications? Best, Andr? On Tue, Oct 22, 2013 at 3:42 PM, Andr? Anjos wrote: > Another question: > > From my investigations, the program aborts at a failed attempt to encode a > new frame (using avcodec_encode_video2()). If the problem is on the > initialisation, how can I check the codec is ready before attempting an > encode? > > Thanks, Andr? > > > On Tue, Oct 22, 2013 at 2:49 PM, Andr? Anjos wrote: > >> Thanks for this reply. Could you please share a fix for the program that >> makes it work? >> >> Andr? >> >> >> On Tue, Oct 22, 2013 at 10:29 AM, Paul B Mahol wrote: >> >>> On 10/22/13, Andre Anjos wrote: >>> > Hello, >>> > >>> > I'm using a MacPorts build of ffmpeg 2.0.2. It passes most of our >>> tests, >>> > except the one using the FFV1 codec. This seems independent of the file >>> > format chosen. >>> > >>> > How to reproduce the problem: >>> > >>> > 1) Download the muxing example from the ffmpeg doxygen documentation ( >>> > http://ffmpeg.org/doxygen/2.0/doc_2examples_2muxing_8c-example.html) >>> > >>> > 2) By the end of the application, replace the code: >>> > >>> > if (fmt->video_codec != AV_CODEC_ID_NONE) { >>> > video_st = add_stream(oc, &video_codec, fmt->video_codec); >>> > } >>> > >>> > With: >>> > >>> > video_st = add_stream(oc, &video_codec, AV_CODEC_ID_FFV1) >>> > >>> > So, that the FFV1 codec is forced. >>> > >>> > 3) Compile the program (on OSX, that would be): >>> > >>> > clang -I/opt/local/include test.c -L/opt/local/lib -lavutil >>> > -lavcodec -lavformat -lswscale -lswresample -o ffmpeg_test >>> > >>> > 4) Run the program: >>> > >>> > ./ffmpeg_test foo.avi >>> > >>> > to get: >>> > >>> > [libmp3lame @ 0x7fa7d201f200] Channel layout not specified >>> > Output #0, avi, to 'test.avi': >>> > Stream #0:0: Video: ffv1, yuv420p, 352x288, q=2-31, 400 kb/s, 90k >>> tbn, >>> > 25 tbc >>> > Stream #0:1: Audio: mp3 (libmp3lame), 44100 Hz, 2 channels, fltp, >>> 64 >>> > kb/s >>> > Error encoding video frame: Invalid argument >>> > >>> > Result: Bogus file, with error >>> > >>> > Expected result: clean file with no errors. >>> > >>> > Can anyone confirm this or provide some light on what I could possibly >>> be >>> > doing wrong? A developer from MacPorts has confirmed the problem - it >>> does >>> > not happen on 1.2.x. It does happen with 2.0.1 and 2.0.2 ( >>> > https://trac.macports.org/ticket/40829). >>> > >>> > Thanks in advance, A >>> >>> FFmpeg 2.0.X does not have bogus FFV1 codec. >>> >>> The examples code is of very low quality. >>> >>> FFV1 encoder have been changed in its initialization to abort when >>> width/height is not set. >>> _______________________________________________ >>> Libav-user mailing list >>> Libav-user at ffmpeg.org >>> http://ffmpeg.org/mailman/listinfo/libav-user >>> >> >> >> >> -- >> Andr? Anjos >> http://andreanjos.org >> > > > > -- > Andr? Anjos > http://andreanjos.org > -- Andr? Anjos http://andreanjos.org -------------- next part -------------- An HTML attachment was scrubbed... URL: From cehoyos at ag.or.at Fri Oct 25 13:08:36 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Fri, 25 Oct 2013 11:08:36 +0000 (UTC) Subject: [Libav-user] ffmpeg 2.0.X has a bogus FFV1 codec? References: Message-ID: Andr? Anjos writes: > Could anyone fix the example code in ffmpeg so > it reflects these modifications? Please send a patch (made with git format-patch) to the ffmpeg-devel mailing list. Please do not top (neither here not there), it is considered rude. Carl Eugen From andre.dos.anjos at gmail.com Fri Oct 25 13:28:26 2013 From: andre.dos.anjos at gmail.com (=?UTF-8?B?QW5kcsOpIEFuam9z?=) Date: Fri, 25 Oct 2013 13:28:26 +0200 Subject: [Libav-user] ffmpeg 2.0.X has a bogus FFV1 codec? In-Reply-To: References: Message-ID: Thanks, I will. Please do not top (neither here not there), it is > considered rude. I'm not sure I understand this recommendation. In no sense I meant to top anyone with my comments. Andr? -------------- next part -------------- An HTML attachment was scrubbed... URL: From cehoyos at ag.or.at Fri Oct 25 13:44:12 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Fri, 25 Oct 2013 11:44:12 +0000 (UTC) Subject: [Libav-user] ffmpeg 2.0.X has a bogus FFV1 codec? References: Message-ID: Andr? Anjos writes: > Please do not top (neither here not there), it is > considered rude. Please do not top-post on all ffmpeg mailing lists. Sorry, Carl Eugen From ahqzy at 163.com Fri Oct 25 16:07:47 2013 From: ahqzy at 163.com (ahqzy) Date: Fri, 25 Oct 2013 22:07:47 +0800 (CST) Subject: [Libav-user] what's the extradata should be when using ffmpeg+libstagefright? Message-ID: <33425639.c6f9.141eff13f9d.Coremail.ahqzy@163.com> Hi all, To using hardware decoding, I compiled ffmpeg(0.10) with andorid libstagefright successfully. When I call it, in the Stagefright_init(AVCodecContext *avctx), the extradata must be specified as below in the source: static av_cold int Stagefright_init(AVCodecContext *avctx) { ?? ?? if (!avctx->extradata || !avctx->extradata_size || avctx->extradata[0] != 1) return -1; ?? } I dont't konw how to fill the avctx->extradata, anyone can help me? -------------- next part -------------- An HTML attachment was scrubbed... URL: From rob.f.schmidt86 at gmail.com Fri Oct 25 17:50:38 2013 From: rob.f.schmidt86 at gmail.com (Robert Schmidt) Date: Fri, 25 Oct 2013 15:50:38 +0000 Subject: [Libav-user] Problem Generating B-Frames Using libavcodec/libx264 Message-ID: > i have your same goal, also I am writing a an application that encodes > incoming video in H.264 using libavcodec and libx264. I don't know the > solution for yuor problem, because i do not know how to encode. > i have a avi or mp4 file as input. The *avcodec_encode_video2* function > takes input raw video data from frame, so i demux my file and i obtain a > raw video file; now i want encode it, so how i can open the raw file, read > the raw frames and encode them into h264?? Is this the right wat yo encode > in H.264? There are other solutions?? How do you encode?? Can you help me, > please?? Hi Francesco, I'm not entirely certain what you are looking for, but for I basically do the following for my transcoding test utility: * Read a raw packet from the input file using av_read_frame (demux) * Decode the packet into a frame using avcodec_decode_video2 (decode) * Encode the frame using avcodec_encode_video2 (encode) * Write the resulting packets using av_interleaved_write_frame (mux) I found the examples at http://ffmpeg.org/doxygen/trunk/examples.html helpful for understanding how to properly use the API calls. Also, if you look up the relevant API calls in the FFmpeg Doxygen documenation (http://ffmpeg.org/doxygen/trunk/index.html), there are cross-references to where they are used in the examples that help provide context and show how they're used. If you want to use H.264 for encoding, you can specify "h264" as the format if you call avformat_alloc_output_context2 to set up your output muxer or use AV_CODEC_ID_H264 when a setting up your encoder. My application receives its video data from a separate source, so I have to manually set up the AVFrame structures to pass to the encoder rather than rely on av_read_frame/avcodec_decode_video2, but otherwise the process is basically the same. I hope this helps. Rob From onemda at gmail.com Fri Oct 25 17:59:34 2013 From: onemda at gmail.com (Paul B Mahol) Date: Fri, 25 Oct 2013 15:59:34 +0000 Subject: [Libav-user] Criteria for h.264 key-frame detection In-Reply-To: References: Message-ID: On 10/20/13, Robert Krueger wrote: > Hi, > > I have AVCHD files from a camera (Panasonic Lumix GH1) that demux and > decode with libavformat/libavcodec detecting no other keyframe but the > first (both, the first video packet and video frame are marked as > keyframe), which is not what I would have expected for those clips as > the GOP structure of files produced by this camera is known to be > different. > > My question is now, what libavcodec/libavformat uses as criteria to > decide whether a packet is a keyframe packet or a frame is a keyframe > in this case. Does it only trigger in the case of IDRs or are recovery > point SEIs also detected? Should I open a trac issue for this with a > sample? AFAIK h264 key frame detection is in parser. And only in two places in code is key_frame set to 1. If key frame detection is wrong for certain file that it could be bug. Without sample it is impossible to find out. I would recommend to open trac issue. > > My requirement is, I want to find points in the stream suitable for > random access using libavformat/libavcodec. What are my options for > this kind of files? > > Thanks, > > Robert > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > From krueger at lesspain.de Fri Oct 25 18:40:03 2013 From: krueger at lesspain.de (=?UTF-8?Q?Robert_Kr=C3=BCger?=) Date: Fri, 25 Oct 2013 18:40:03 +0200 Subject: [Libav-user] Criteria for h.264 key-frame detection In-Reply-To: References: Message-ID: On Fri, Oct 25, 2013 at 5:59 PM, Paul B Mahol wrote: > On 10/20/13, Robert Krueger wrote: >> Hi, >> >> I have AVCHD files from a camera (Panasonic Lumix GH1) that demux and >> decode with libavformat/libavcodec detecting no other keyframe but the >> first (both, the first video packet and video frame are marked as >> keyframe), which is not what I would have expected for those clips as >> the GOP structure of files produced by this camera is known to be >> different. >> >> My question is now, what libavcodec/libavformat uses as criteria to >> decide whether a packet is a keyframe packet or a frame is a keyframe >> in this case. Does it only trigger in the case of IDRs or are recovery >> point SEIs also detected? Should I open a trac issue for this with a >> sample? > > AFAIK h264 key frame detection is in parser. And only in two places in > code is key_frame set to 1. > > If key frame detection is wrong for certain file that it could be bug. > Without sample it is impossible to find out. > > I would recommend to open trac issue. http://trac.ffmpeg.org/ticket/3083 Carl, could you attach the samples I uploaded? From ulfalizer at gmail.com Sat Oct 26 07:39:04 2013 From: ulfalizer at gmail.com (Ulf Magnusson) Date: Sat, 26 Oct 2013 07:39:04 +0200 Subject: [Libav-user] A/V synchronization for an emulator movie recording feature Message-ID: Hello, I'm adding a movie recording feature to an emulator I'm working on. I have the video part working, but since I'm new to movie encoding I'm unsure what the best practices are when it comes to audio/video synchronization. I'm aware of these two approaches: (1) Set PTS values on video and/or audio packets before writing them with av_interleaved_write_frame(). (2) Stretch/shrink audio to maintain A/V synchronization. Perhaps (1) should be done even if (2) is done, but I'm not sure how these two approaches would interact. I've also heard that some formats/players don't support PTS values for audio frames. Any recommendations? Latency would not be an issue since you wouldn't view the movie while playing. I'd prefer for the video to be as smooth as possible, without jerky motion when scrolling. The current WIP without audio is at https://github.com/ulfalizer/nesalizer/blob/movie-wip/movie.cpp (I based it on libavformat/output-example.c). I'd probably have an add_audio_frame() function to go with add_video_frame(). Thanks, Ulf From sachinrajput1989 at outlook.com Wed Oct 23 10:52:06 2013 From: sachinrajput1989 at outlook.com (Netcoder1989) Date: Wed, 23 Oct 2013 01:52:06 -0700 (PDT) Subject: [Libav-user] RTP server for audio stream Message-ID: <1382518326454-4658752.post@n4.nabble.com> I'm in the mid of my project where I'm trying to send the audio data over RTP using ffmpeg in VC++. but I'm unable to do that.: setRTPOutputAddr("192.168.100.48"); setRTPOutputPort(9985); av_register_all(); avformat_network_init(); formatCtx= avformat_alloc_context(); //av_dump_format(formatCtx,0,"rtp",1); avio_open_dyn_buf(&ioctx); avio_open(&formatCtx->pb, "rtp", AVIO_FLAG_WRITE); //av_dump_format(formatCtx,0,"rtp",1); formatCtx->pb = ioctx; rtpCtx = avformat_alloc_context(); rtpCtx->oformat = av_guess_format("rtp",0,0); AVStream *fakeVideo = 0; fakeVideo = avformat_new_stream(rtpCtx,0); avcodec_get_context_defaults3(fakeVideo->codec, NULL); fakeVideo->codec->codec_id = AV_CODEC_ID_MPEG2TS; rtpCtx->audio_codec_id = AV_CODEC_ID_NONE; rtpCtx->video_codec_id = AV_CODEC_ID_MPEG2TS; // avformat_write_header(rtpCtx,0); char *url = new char[1024]; sprintf(url,"rtp://%s:%d",rtpOutputAddr,rtpOutputPort); printf("will output to url:%s\n",url); avio_open(&rtpCtx->pb,url,AVIO_FLAG_WRITE); avformat_write_header(rtpCtx, NULL); delete url; if (avio_open(&formatCtx->pb, "rtp", AVIO_FLAG_WRITE) < 0) { fprintf(stderr, "Could not open '%s'\n", formatCtx->filename); return -1; } else { printf("succeed \n"); } avformat_write_header(formatCtx, NULL); Getting error here Do any one having any idea why my program crashes here. Thanks! -- View this message in context: http://libav-users.943685.n4.nabble.com/RTP-server-for-audio-stream-tp4658752.html Sent from the libav-users mailing list archive at Nabble.com. From pasanen.tuukka at gmail.com Sun Oct 27 18:24:37 2013 From: pasanen.tuukka at gmail.com (Tuukka Pasanen) Date: Sun, 27 Oct 2013 19:24:37 +0200 Subject: [Libav-user] Seeking in VBR MP3 file Message-ID: Hello, I'm trying to make Mixxx (http://mixxx.org) input FFmpeg plugin to function again. Now it works with Libav 0.8/9 (they work perfectly) and FFmpeg 0.11 but version above that (like 1.0-2.0/Git) doesn't work as they should with MP3 (Ogg/Vorbis, MP4 works like a charm). Problem is that Mixxx reading should be Byte exact so one should know PCM point of time. Problem appears in two ways: If one jumps in some X PTS in VBR (mostly VBR 4) MP3 file and then position tries to find PTS/DTS it ain't same as reading with ffprobe -show_frames (All PTS dividable with 4608 like they should?). Biggest problem is reading backwards in some X PTS then PTS around jumps without any system (I think Xing headers points). I have made small application/project in Github that shows the problem: https://github.com/illuusio/ffmpeg-example.git (Sorry for debug output). As I said this one source code works seamlessly with FFmpeg 0.11 and Libav 0.8/9/Git so I thought I'm doing something really wrong with FFmpeg 1.0 and above. For testing any VBR MP3 will do fine. I have used for testing random Jamendo files like: http://www.jamendo.com/en/track/1039111/wait-a-little-longer One should import created pcm files (out-for.pcm is Forward played file and out-rev.pcm is same played backwards order) in Audacity and try to listen them to notice what is wrong. I someone have more knowledge about because I have been struggling with this many months.. Thanks, Tuukka -------------- next part -------------- An HTML attachment was scrubbed... URL: From cehoyos at ag.or.at Sun Oct 27 19:55:56 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Sun, 27 Oct 2013 18:55:56 +0000 (UTC) Subject: [Libav-user] Seeking in VBR MP3 file References: Message-ID: Tuukka Pasanen writes: > Now it works with [...] FFmpeg 0.11 but version > above that (like 1.0-2.0/Git) doesn't work as > they should with MP3 Which commit introduced the regression? Carl Eugen From fzanelli at tecnosens.it Mon Oct 28 11:31:28 2013 From: fzanelli at tecnosens.it (Zanelli Franco) Date: Mon, 28 Oct 2013 11:31:28 +0100 Subject: [Libav-user] compiling ffmpeg with -fPIC In-Reply-To: <518129AC.7010205@cenatav.co.cu> References: <518129AC.7010205@cenatav.co.cu> Message-ID: Hi, did you solve the problem? I experienced it when I was trying to include static ffmpeg libraries (libavcodec.a, libavformat.a ...) in my shared lib (mylib.so) on a 64 bit linux platform, but I don't know how to solve, can you help me please? Il 01/05/2013 16:41, Dayana ha scritto: Hi!!! Im developing an aplication using libavcodec, libavformat and libavutil. Im trying to make a shared library and for that I have to get libavs compiled with -fPIC ... I was trying to do it by setting --enable-pic in the configure file, however Im still have the same error: /usr/local/lib/libavcodec.a(lpc_mmx.o): relocation R_X86_64_PC32 against symbol `ff_pd_1' can not be used when making a shared object; recompile with -fPIC could somebody give me a hint please?? :) dayana _______________________________________________ Libav-user mailing list Libav-user at ffmpeg.org http://ffmpeg.org/mailman/listinfo/libav-user -------------- next part -------------- An HTML attachment was scrubbed... URL: From cehoyos at ag.or.at Mon Oct 28 12:37:24 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Mon, 28 Oct 2013 11:37:24 +0000 (UTC) Subject: [Libav-user] compiling ffmpeg with -fPIC References: <518129AC.7010205@cenatav.co.cu> Message-ID: Zanelli Franco writes: > I experienced it when I was trying to include static ffmpeg > libraries (libavcodec.a, libavformat.a ...) in my shared lib > (mylib.so) on a 64 bit linux platform, but I don't know how to > solve, can you help me please? Could you explain (FFmpeg version, configure line, etc.) how to reproduce your problem? That may allow us to help. Carl Eugen From fzanelli at tecnosens.it Mon Oct 28 14:20:52 2013 From: fzanelli at tecnosens.it (Zanelli Franco) Date: Mon, 28 Oct 2013 14:20:52 +0100 Subject: [Libav-user] compiling ffmpeg with -fPIC In-Reply-To: References: Message-ID: Ok, I'd like to make a shared library called mylib.so that include static ffmpeg libraries libavcodec.a libavformat.a ..etc. in order to have just one shared library I'm working on a linux machine 64 bit (ubuntu 12.04). I've built ffmpeg libraries from ffmpeg 2.0.1 sources with this configuration: --prefix="$HOME/ffmpeg_build" --extra-cflags="-m64 -I$HOME/ffmpeg_build/include" --extra-ldflags="-L$HOME/ffmpeg_build/lib" --bindir="$HOME/bin" --extra-libs="-ldl" --enable-gpl --enable-libmp3lame --enable-libx264 --enable-pic When I link the avlibs in mine, with this command: gcc -m64 -o mylib.so -L../ffmpeg_build/lib /home/uts/ffmpeg_build/lib/libavcodec.a -Wl,-R. -shared -s -fPIC I always get this error: /usr/bin/ld: /home/uts/ffmpeg_build/lib/libavcodec.a(deinterlace.o): relocation R_X86_64_PC32 against symbol `ff_pw_4' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: final link failed: Bad value The same procedure on a x86 linux platform succeded. This is the same problem experienced from Dayana in this mailing list the 1st may 2013, I read the answers but they were not helpful Can you help me please? thank you Il 28/10/2013 12:37, Carl Eugen Hoyos ha scritto: Zanelli Franco writes: > I experienced it when I was trying to include static ffmpeg > libraries (libavcodec.a, libavformat.a ...) in my shared lib > (mylib.so) on a 64 bit linux platform, but I don't know how to > solve, can you help me please? Could you explain (FFmpeg version, configure line, etc.) how to reproduce your problem? That may allow us to help. Carl Eugen _______________________________________________ Libav-user mailing list Libav-user at ffmpeg.org http://ffmpeg.org/mailman/listinfo/libav-user -- Ing. Franco Zanelli Sviluppo Software - Divisione Sistemi Videosorveglianza Software Engineer - Videosecurity System Division TECNOSENS S.P.A. Via Vergnano, n.16, 25125 BRESCIA - ITALIA Tel: +39 030.3534144 Fax: +39 030.3530815 Email: fzanelli at tecnosens.it Web: http://www.tecnosens.it -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: immagini1 Type: image/png Size: 8557 bytes Desc: immagini1 URL: From pasanen.tuukka at gmail.com Mon Oct 28 15:07:12 2013 From: pasanen.tuukka at gmail.com (Tuukka Pasanen) Date: Mon, 28 Oct 2013 16:07:12 +0200 Subject: [Libav-user] Seeking in VBR MP3 file In-Reply-To: References: Message-ID: <526E6F90.5010402@gmail.com> Hello, Okay I suck in GIT but at last I managed to find commit is: '5864ce13d188260998bbf49a2a774fa9bd445c10'. Everything before that works and if you apply that patch it appears. Sincerly, Tuukka On 27.10.2013 20:55, Carl Eugen Hoyos wrote: > Tuukka Pasanen writes: > >> Now it works with [...] FFmpeg 0.11 but version >> above that (like 1.0-2.0/Git) doesn't work as >> they should with MP3 > Which commit introduced the regression? > > Carl Eugen > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > From cehoyos at ag.or.at Mon Oct 28 15:39:36 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Mon, 28 Oct 2013 14:39:36 +0000 (UTC) Subject: [Libav-user] Seeking in VBR MP3 file References: <526E6F90.5010402@gmail.com> Message-ID: Tuukka Pasanen writes: > Okay I suck in GIT but at last I managed to find commit is: > '5864ce13d188260998bbf49a2a774fa9bd445c10'. > Everything before that works and if you apply that patch it appears. Wasn't this fixed in e096283 ? Please avoid top-posting here. Carl Eugen From alexcohn at netvision.net.il Mon Oct 28 16:58:50 2013 From: alexcohn at netvision.net.il (Alex Cohn) Date: Mon, 28 Oct 2013 17:58:50 +0200 Subject: [Libav-user] compiling ffmpeg with -fPIC In-Reply-To: References: Message-ID: On Oct 28, 2013 3:21 PM, "Zanelli Franco" wrote: > > Ok, > I'd like to make a shared library called mylib.so that include static ffmpeg libraries libavcodec.a libavformat.a ..etc. in order to have just one shared library > I'm working on a linux machine 64 bit (ubuntu 12.04). > I've built ffmpeg libraries from ffmpeg 2.0.1 sources with this configuration: > --prefix="$HOME/ffmpeg_build" --extra-cflags="-m64 -I$HOME/ffmpeg_build/include" --extra-ldflags="-L$HOME/ffmpeg_build/lib" --bindir="$HOME/bin" --extra-libs="-ldl" --enable-gpl --enable-libmp3lame --enable-libx264 --enable-pic Have you tried ? --extra-cflags="-fPIC -m64 -I$HOME/ffmpeg_build/include" > When I link the avlibs in mine, with this command: > gcc -m64 -o mylib.so -L../ffmpeg_build/lib /home/uts/ffmpeg_build/lib/libavcodec.a -Wl,-R. -shared -s -fPIC > > I always get this error: > /usr/bin/ld: /home/uts/ffmpeg_build/lib/libavcodec.a(deinterlace.o): relocation R_X86_64_PC32 against symbol `ff_pw_4' can not be used when making a shared object; recompile with -fPIC > /usr/bin/ld: final link failed: Bad value > > The same procedure on a x86 linux platform succeded. > This is the same problem experienced from Dayana in this mailing list the 1st may 2013, I read the answers but they were not helpful > Can you help me please? > > thank you Alex Cohn -------------- next part -------------- An HTML attachment was scrubbed... URL: From fzanelli at tecnosens.it Mon Oct 28 17:14:04 2013 From: fzanelli at tecnosens.it (Zanelli Franco) Date: Mon, 28 Oct 2013 17:14:04 +0100 Subject: [Libav-user] compiling ffmpeg with -fPIC In-Reply-To: References: Message-ID: Il 28/10/2013 16:58, Alex Cohn ha scritto: On Oct 28, 2013 3:21 PM, "Zanelli Franco" wrote: > > Ok, > I'd like to make a shared library called mylib.so that include static ffmpeg libraries libavcodec.a libavformat.a ..etc. in order to have just one shared library > I'm working on a linux machine 64 bit (ubuntu 12.04). > I've built ffmpeg libraries from ffmpeg 2.0.1 sources with this configuration: > --prefix="$HOME/ffmpeg_build" --extra-cflags="-m64 -I$HOME/ffmpeg_build/include" --extra-ldflags="-L$HOME/ffmpeg_build/lib" --bindir="$HOME/bin" --extra-libs="-ldl" --enable-gpl --enable-libmp3lame --enable-libx264 --enable-pic Have you tried ... --extra-cflags="-fPIC -m64 -I$HOME/ffmpeg_build/include" Yes I did. I got the same response that using --enable-pic. I tried also to use -mcmodel=large, but in that case ffmpeg compilation didn't success > When I link the avlibs in mine, with this command: > gcc -m64 -o mylib.so -L../ffmpeg_build/lib /home/uts/ffmpeg_build/lib/libavcodec.a -Wl,-R. -shared -s -fPIC > > I always get this error: > /usr/bin/ld: /home/uts/ffmpeg_build/lib/libavcodec.a(deinterlace.o): relocation R_X86_64_PC32 against symbol `ff_pw_4' can not be used when making a shared object; recompile with -fPIC > /usr/bin/ld: final link failed: Bad value > > The same procedure on a x86 linux platform succeded. > This is the same problem experienced from Dayana in this mailing list the 1st may 2013, I read the answers but they were not helpful > Can you help me please? > > thank you Alex Cohn _______________________________________________ Libav-user mailing list Libav-user at ffmpeg.org http://ffmpeg.org/mailman/listinfo/libav-user -- Ing. Franco Zanelli Sviluppo Software - Divisione Sistemi Videosorveglianza Software Engineer - Videosecurity System Division TECNOSENS S.P.A. Via Vergnano, n.16, 25125 BRESCIA - ITALIA Tel: +39 030.3534144 Fax: +39 030.3530815 Email: fzanelli at tecnosens.it Web: http://www.tecnosens.it -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: immagini1 Type: image/png Size: 8557 bytes Desc: immagini1 URL: From dhenry at movenetworks.com Mon Oct 28 17:31:34 2013 From: dhenry at movenetworks.com (David Henry) Date: Mon, 28 Oct 2013 10:31:34 -0600 Subject: [Libav-user] errors decoding h264 transport stream Message-ID: Hello ? I have been using ffmpeg 0.9-2 to decode h264 source-specific multicast udp transport streams on Ubuntu 12.04. I don't have any problem with that version. I recently upgraded to 2.0.1 and now I am getting errors. Here is an example command-line. I'm sending to /dev/null so I don't fill the small hard drive: $ ffmpeg -i udp://232.X.X.X:PORT?sources=172.31.2.22 -vcodec yuv4 -acodec pcm_s16le -f mpegts -y /dev/null After about 6 hours of decoding, I start getting errors (I don't know if the stream frame rate really changed or not): [h264 @ 0x16c5700] Missing reference picture, default is 0 [h264 @ 0x16c5700] decode_slice_header error [h264 @ 0x16cbfc0] Missing reference picture, default is 65556 [h264 @ 0x1cfc220] reference picture missing during reorder Last message repeated 1 times [h264 @ 0x1cfc220] Missing reference picture, default is 65556 Last message repeated 1 times [h264 @ 0x1cfc680] mmco: unref short failure [h264 @ 0x172ef60] reference picture missing during reorder [h264 @ 0x172ef60] Missing reference picture, default is 65564 [h264 @ 0x172f7e0] mmco: unref short failure Input stream #0:1 frame changed from rate:48000 fmt:fltp ch:6 chl:5.1(side) to rate:48000 fmt:fltp ch:2 chl:stereo Input stream #0:1 frame changed from rate:48000 fmt:fltp ch:2 chl:stereo to rate:48000 fmt:fltp ch:6 chl:5.1(side) Input stream #0:1 frame changed from rate:48000 fmt:fltp ch:6 chl:5.1(side) to rate:48000 fmt:fltp ch:2 chl:stereo Input stream #0:1 frame changed from rate:48000 fmt:fltp ch:2 chl:stereo to rate:48000 fmt:fltp ch:6 chl:5.1(side) PES packet size mismatch.0 size=1807996058kB time=06:46:03.03 bitrate=607933.3kbits/s dup=77714 drop=0 [ac3 @ 0x16d47a0] frame CRC mismatch [ac3 @ 0x16d47a0] frame sync error Error while decoding stream #0:1: Operation not permitted [h264 @ 0x1730080] cabac decode of qscale diff failed at 81 39 [h264 @ 0x1730080] error while decoding MB 81 39, bytestream (34312) [h264 @ 0x1730080] concealing 2578 DC, 2578 AC, 2578 MV errors in B frame [h264 @ 0x17311c0] Reference 2 >= 2 [h264 @ 0x17311c0] error while decoding MB 0 19, bytestream (32490) [h264 @ 0x17311c0] concealing 4459 DC, 4459 AC, 4459 MV errors in B frame [ac3 @ 0x16d47a0] frame CRC mismatch [ac3 @ 0x16d47a0] frame sync error Error while decoding stream #0:1: Operation not permitted [ac3 @ 0x16d47a0] frame CRC mismatch [h264 @ 0x1730920] concealing 1989 DC, 1989 AC, 1989 MV errors in B frame [h264 @ 0x1731a60] concealing 5111 DC, 5111 AC, 5111 MV errors in B frame [h264 @ 0x1732300] Reference 3 >= 2 [h264 @ 0x1732300] error while decoding MB 88 1, bytestream (72952) [h264 @ 0x1732300] concealing 5991 DC, 5991 AC, 5991 MV errors in P frame [ac3 @ 0x16d47a0] frame sync error Error while decoding stream #0:1: Operation not permitted illegal short term buffer state detected28kB ? -------------- next part -------------- An HTML attachment was scrubbed... URL: From pasanen.tuukka at gmail.com Mon Oct 28 17:45:26 2013 From: pasanen.tuukka at gmail.com (Tuukka Pasanen) Date: Mon, 28 Oct 2013 18:45:26 +0200 Subject: [Libav-user] Seeking in VBR MP3 file In-Reply-To: References: <526E6F90.5010402@gmail.com> Message-ID: <526E94A6.6090505@gmail.com> On 28.10.2013 16:39, Carl Eugen Hoyos wrote: > Tuukka Pasanen writes: > >> Okay I suck in GIT but at last I managed to find commit is: >> '5864ce13d188260998bbf49a2a774fa9bd445c10'. >> Everything before that works and if you apply that patch it appears. > Wasn't this fixed in e096283 ? > Please avoid top-posting here. > > Carl Eugen > Sorry GMAIL is baddest top-posting app ever. I pulled down version 2.1 from git version and there is no change. Commit 'e096283' seems to fix MP3 CBR like it says. Some VBR level 1 files works also sounds pretty good. One starts to hear more errors from VBR level 2 and above. I made some test files with lame 3.99.5 and get same results from VBR level 1-4 (Lame now defaults to level 4). Is there some debugs that I can put my fingers in? Tuukka From cehoyos at ag.or.at Mon Oct 28 18:40:17 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Mon, 28 Oct 2013 17:40:17 +0000 (UTC) Subject: [Libav-user] Seeking in VBR MP3 file References: <526E6F90.5010402@gmail.com> <526E94A6.6090505@gmail.com> Message-ID: Tuukka Pasanen writes: > I pulled down version 2.1 from git version and there is no > change. Commit 'e096283' seems to fix MP3 CBR like it says. > Some VBR level 1 files works also sounds pretty good. One > starts to hear more errors from VBR level 2 and above. I > made some test files with lame 3.99.5 and get same results > from VBR level 1-4 (Lame now defaults to level 4). Is there > some debugs that I can put my fingers in? Is the problem also reproducible with ffmpeg (the application)? Look at ticket #2590 for another example that was reproducible with ffmpeg. If it is reproducible, please provide a test case. Carl Eugen From ahqzy at 163.com Tue Oct 29 04:56:43 2013 From: ahqzy at 163.com (ahqzy) Date: Tue, 29 Oct 2013 11:56:43 +0800 (CST) Subject: [Libav-user] what's the extradata should be when using ffmpeg+libstagefright? In-Reply-To: <33425639.c6f9.141eff13f9d.Coremail.ahqzy@163.com> References: <33425639.c6f9.141eff13f9d.Coremail.ahqzy@163.com> Message-ID: <3dbdb4af.690d.142025b3d2c.Coremail.ahqzy@163.com> Is anyone can help? At 2013-10-25 22:07:47,ahqzy wrote: Hi all, To using hardware decoding, I compiled ffmpeg(0.10) with andorid libstagefright successfully. When I call it, in the Stagefright_init(AVCodecContext *avctx), the extradata must be specified as below in the source: static av_cold int Stagefright_init(AVCodecContext *avctx) { ?? ?? if (!avctx->extradata || !avctx->extradata_size || avctx->extradata[0] != 1) return -1; ?? } I dont't konw how to fill the avctx->extradata, anyone can help me? -------------- next part -------------- An HTML attachment was scrubbed... URL: From pasanen.tuukka at gmail.com Tue Oct 29 08:25:23 2013 From: pasanen.tuukka at gmail.com (Tuukka Pasanen) Date: Tue, 29 Oct 2013 09:25:23 +0200 Subject: [Libav-user] Seeking in VBR MP3 file In-Reply-To: References: <526E6F90.5010402@gmail.com> <526E94A6.6090505@gmail.com> Message-ID: <526F62E3.50705@gmail.com> On 28.10.2013 19:40, Carl Eugen Hoyos wrote: > Tuukka Pasanen writes: > >> I pulled down version 2.1 from git version and there is no >> change. Commit 'e096283' seems to fix MP3 CBR like it says. >> Some VBR level 1 files works also sounds pretty good. One >> starts to hear more errors from VBR level 2 and above. I >> made some test files with lame 3.99.5 and get same results >> from VBR level 1-4 (Lame now defaults to level 4). Is there >> some debugs that I can put my fingers in? > Is the problem also reproducible with ffmpeg (the application)? > Look at ticket #2590 for another example that was reproducible > with ffmpeg. If it is reproducible, please provide a test case. > > Hello, First I ask should I file a ticket? Probably because I'm asking. It could be reproducible with ffmpeg but you can't see how? I try to explain why. In my test VBR 4 mp3 file. I jump random jump point '99901440' (which should be at byte: 624384 B) if we read with ffprobe -show_frames it exist (see end of message). If we ut this in avformat_seek_file and never read first frame with flag AVSEEK_FLAG_BACKWARD we jump to probably in Xing jump point PTS '80802202' Byte offset '505014 B'. Xing VBR jump point is alright (all though Libav and FFMPEG 0.11 doesn't do it like this) because you can just travel near right PTS which in this time is '99602842' so PTS diffrence is 298598 (Bytes: -1866 B). Things get interesting if we travell backwards in time to PTS 80802202 and jump couple 2304 bytes backward like 80363520 (Byte offset 502272) then we get to PTS 0 so everything goes right first point what we tried to jump PTS 99901440. Problem comes in existence if like to get these two points together so we start reading first jump point and read couple frames and then user wants to jump another point in file (second PTS) and then we try to solve how to make them in cache (which works in milli seconds and point of PCM) because these two points are not in same PTS space because if just tune -(1186 * 2) B backwards time PTS still ain't same! Like I same Libav 9 does this correct and this PTS incorrectness causes also 'Header missing error' even if we try to jump precalculated jump points (2304 * wanted point) which again works with Libav 9. More problematic this comes if we go forward and PTS jump like crazy. I could do this like every time start reading from beginning until I get correct point but then whole idea using FFMPEG is just waste of time. So if you want to reproduce this with ffmpeg have VBR 4 lame encoded mp3 and then first jump with -ss 00:00:07.079 and read translate 10s to wav. then rerun ffmpeg with -ss 00:00:05.694. After that launch for examle audacity import both wav and but them manually in correct place then try to make them look same or just launch ffplay with -ss 00:01:35 and start jumping forward and backward and if you can get it show PTS you notice diffrence. or you can use my small example app to debug this.. it would be nice to ffprobe to have -ss also you could debug stuff like this! Sorry this wasn't very clean and now frames from ffprobe: This First frame is where we tried to jump printed with ffprobe -show_frames [FRAME] media_type=audio key_frame=1 pkt_pts=99901440 pkt_pts_time=7.079184 pkt_dts=99901440 pkt_dts_time=7.079184 pkt_duration=368640 pkt_duration_time=0.026122 pkt_pos=125757 pkt_size=417 sample_fmt=s16p nb_samples=1152 channels=2 channel_layout=stereo [/FRAME] This is second frame with ffprobe -show_frames [FRAME] media_type=audio key_frame=1 pkt_pts=80363520 pkt_pts_time=5.694694 pkt_dts=80363520 pkt_dts_time=5.694694 pkt_duration=368640 pkt_duration_time=0.026122 pkt_pos=101556 pkt_size=417 sample_fmt=s16p nb_samples=1152 channels=2 channel_layout=stereo [/FRAME] Tuukka From u at pkh.me Tue Oct 29 09:58:38 2013 From: u at pkh.me (=?utf-8?B?Q2zDqW1lbnQgQsWTc2No?=) Date: Tue, 29 Oct 2013 09:58:38 +0100 Subject: [Libav-user] Seeking in VBR MP3 file In-Reply-To: <526F62E3.50705@gmail.com> References: <526E6F90.5010402@gmail.com> <526E94A6.6090505@gmail.com> <526F62E3.50705@gmail.com> Message-ID: <20131029085838.GE16978@leki.pkh.me> On Tue, Oct 29, 2013 at 09:25:23AM +0200, Tuukka Pasanen wrote: [...] > or you can use my small example app to debug this.. it would be nice to > ffprobe to have -ss also you could debug stuff like this! > Can you look at -read_intervals option in ffprobe (recently added)? It performs a seek. If you can reproduce the issue with ffprobe, could you open a ticket? [...] -- Cl?ment B. -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 490 bytes Desc: not available URL: From safiuddinkhan at gmail.com Tue Oct 29 12:39:53 2013 From: safiuddinkhan at gmail.com (Safi ud Din Khan) Date: Tue, 29 Oct 2013 16:39:53 +0500 Subject: [Libav-user] How to display embedded images inside mp3 file In-Reply-To: References: Message-ID: <526F9E89.8080902@gmail.com> Hello plz could any one tell me and share some code on how to display embedded images inside the mp3 file using libav* libraries From rob.f.schmidt86 at gmail.com Tue Oct 29 14:19:30 2013 From: rob.f.schmidt86 at gmail.com (Robert Schmidt) Date: Tue, 29 Oct 2013 13:19:30 +0000 Subject: [Libav-user] RTP server for audio stream In-Reply-To: <1382518326454-4658752.post@n4.nabble.com> References: <1382518326454-4658752.post@n4.nabble.com> Message-ID: On Wed, Oct 23, 2013 at 8:52 AM, Netcoder1989 wrote: > I'm in the mid of my project where I'm trying to send the audio data over RTP > using ffmpeg in VC++. > but I'm unable to do that.: > setRTPOutputAddr("192.168.100.48"); > setRTPOutputPort(9985); > av_register_all(); > avformat_network_init(); > formatCtx= avformat_alloc_context(); > > //av_dump_format(formatCtx,0,"rtp",1); > avio_open_dyn_buf(&ioctx); > avio_open(&formatCtx->pb, "rtp", AVIO_FLAG_WRITE); > //av_dump_format(formatCtx,0,"rtp",1); > formatCtx->pb = ioctx; > > rtpCtx = avformat_alloc_context(); > rtpCtx->oformat = av_guess_format("rtp",0,0); > AVStream *fakeVideo = 0; > fakeVideo = avformat_new_stream(rtpCtx,0); > avcodec_get_context_defaults3(fakeVideo->codec, NULL); > fakeVideo->codec->codec_id = AV_CODEC_ID_MPEG2TS; > rtpCtx->audio_codec_id = AV_CODEC_ID_NONE; > rtpCtx->video_codec_id = AV_CODEC_ID_MPEG2TS; > // avformat_write_header(rtpCtx,0); > > char *url = new char[1024]; > sprintf(url,"rtp://%s:%d",rtpOutputAddr,rtpOutputPort); > printf("will output to url:%s\n",url); > avio_open(&rtpCtx->pb,url,AVIO_FLAG_WRITE); > avformat_write_header(rtpCtx, NULL); > delete url; > > > if (avio_open(&formatCtx->pb, "rtp", AVIO_FLAG_WRITE) < 0) > { > fprintf(stderr, "Could not open '%s'\n", formatCtx->filename); > return -1; > } > else > { > > printf("succeed \n"); > } > > > avformat_write_header(formatCtx, NULL); > Getting error here > > > Do any one having any idea why my program crashes here. Without more information on the type of crash, it's hard to say. I suspect the issue may be that you don't associate any output format, streams, etc. with formatCtx, only with rtpCtx. I'm guessing that avformat_write_header() is attempting to access some part of the formatCtx structure and encountering an unexpected NULL pointer. If you run the code under a debugger, you should be able to determine exactly what field is being accessed and the cause of your crash. Rob From pasanen.tuukka at gmail.com Tue Oct 29 14:34:46 2013 From: pasanen.tuukka at gmail.com (Tuukka Pasanen) Date: Tue, 29 Oct 2013 15:34:46 +0200 Subject: [Libav-user] Seeking in VBR MP3 file In-Reply-To: <20131029085838.GE16978@leki.pkh.me> References: <526E6F90.5010402@gmail.com> <526E94A6.6090505@gmail.com> <526F62E3.50705@gmail.com> <20131029085838.GE16978@leki.pkh.me> Message-ID: <526FB976.7030501@gmail.com> On 29.10.2013 10:58, Cl?ment B?sch wrote: > On Tue, Oct 29, 2013 at 09:25:23AM +0200, Tuukka Pasanen wrote: > [...] >> or you can use my small example app to debug this.. it would be nice to >> ffprobe to have -ss also you could debug stuff like this! >> > Can you look at -read_intervals option in ffprobe (recently added)? It > performs a seek. If you can reproduce the issue with ffprobe, could you > open a ticket? > > [...] > Hello, I files a bug report with ffprobe example how to get this problem. Ticket number is 3095. Should I upload sample or can you just use lame for creating one? Tuukka From u at pkh.me Tue Oct 29 14:39:49 2013 From: u at pkh.me (=?utf-8?B?Q2zDqW1lbnQgQsWTc2No?=) Date: Tue, 29 Oct 2013 14:39:49 +0100 Subject: [Libav-user] Seeking in VBR MP3 file In-Reply-To: <526FB976.7030501@gmail.com> References: <526E6F90.5010402@gmail.com> <526E94A6.6090505@gmail.com> <526F62E3.50705@gmail.com> <20131029085838.GE16978@leki.pkh.me> <526FB976.7030501@gmail.com> Message-ID: <20131029133949.GG16978@leki.pkh.me> On Tue, Oct 29, 2013 at 03:34:46PM +0200, Tuukka Pasanen wrote: > On 29.10.2013 10:58, Cl?ment B?sch wrote: > >On Tue, Oct 29, 2013 at 09:25:23AM +0200, Tuukka Pasanen wrote: > >[...] > >>or you can use my small example app to debug this.. it would be nice to > >>ffprobe to have -ss also you could debug stuff like this! > >> > >Can you look at -read_intervals option in ffprobe (recently added)? It > >performs a seek. If you can reproduce the issue with ffprobe, could you > >open a ticket? > > > >[...] > > > Hello, > I files a bug report with ffprobe example how to get this problem. Ticket > number is 3095. Thank you, > Should I upload sample or can you just use lame for creating one? > A sample would be perfect. Also, it's important you paste the complete uncut output of the console in the ffprobe command (we need it to see your options, the versions, the problem in the output, etc) -- Cl?ment B. -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 490 bytes Desc: not available URL: From pasanen.tuukka at gmail.com Tue Oct 29 15:18:50 2013 From: pasanen.tuukka at gmail.com (Tuukka Pasanen) Date: Tue, 29 Oct 2013 16:18:50 +0200 Subject: [Libav-user] Seeking in VBR MP3 file In-Reply-To: <20131029133949.GG16978@leki.pkh.me> References: <526E6F90.5010402@gmail.com> <526E94A6.6090505@gmail.com> <526F62E3.50705@gmail.com> <20131029085838.GE16978@leki.pkh.me> <526FB976.7030501@gmail.com> <20131029133949.GG16978@leki.pkh.me> Message-ID: <526FC3CA.40601@gmail.com> On 29.10.2013 15:39, Cl?ment B?sch wrote: > On Tue, Oct 29, 2013 at 03:34:46PM +0200, Tuukka Pasanen wrote: >> On 29.10.2013 10:58, Cl?ment B?sch wrote: >>> On Tue, Oct 29, 2013 at 09:25:23AM +0200, Tuukka Pasanen wrote: >>> [...] >>>> or you can use my small example app to debug this.. it would be nice to >>>> ffprobe to have -ss also you could debug stuff like this! >>>> >>> Can you look at -read_intervals option in ffprobe (recently added)? It >>> performs a seek. If you can reproduce the issue with ffprobe, could you >>> open a ticket? >>> >>> [...] >>> >> Hello, >> I files a bug report with ffprobe example how to get this problem. Ticket >> number is 3095. > Thank you, > >> Should I upload sample or can you just use lame for creating one? >> > A sample would be perfect. Also, it's important you paste the complete > uncut output of the console in the ffprobe command (we need it to see your > options, the versions, the problem in the output, etc) > > I uploaded sample MP3 (Creative Commons stuff) that I was using and added ffprobe command output (just filtered some personal data). It not openSUSE normal ffmpeg it's GIT build but same options that is used by opensuse.. example is not very good but shows the problem. Tuukka From fzanelli at tecnosens.it Tue Oct 29 17:22:03 2013 From: fzanelli at tecnosens.it (Zanelli Franco) Date: Tue, 29 Oct 2013 17:22:03 +0100 Subject: [Libav-user] make shared lib including libav*.a on linux x64 platform In-Reply-To: References: Message-ID: Hello again, Did someone experienced the same problem and can help me to understand what is wrong please? Thank you Franco Il 28/10/2013 14:20, Zanelli Franco ha scritto: Ok, I'd like to make a shared library called mylib.so that include static ffmpeg libraries libavcodec.a libavformat.a ..etc. in order to have just one shared library I'm working on a linux machine 64 bit (ubuntu 12.04). I've built ffmpeg libraries from ffmpeg 2.0.1 sources with this configuration: --prefix="$HOME/ffmpeg_build" --extra-cflags="-m64 -I$HOME/ffmpeg_build/include" --extra-ldflags="-L$HOME/ffmpeg_build/lib" --bindir="$HOME/bin" --extra-libs="-ldl" --enable-gpl --enable-libmp3lame --enable-libx264 --enable-pic When I link the avlibs in mine, with this command: gcc -m64 -o mylib.so -L../ffmpeg_build/lib /home/uts/ffmpeg_build/lib/libavcodec.a -Wl,-R. -shared -s -fPIC I always get this error: /usr/bin/ld: /home/uts/ffmpeg_build/lib/libavcodec.a(deinterlace.o): relocation R_X86_64_PC32 against symbol `ff_pw_4' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: final link failed: Bad value The same procedure on a x86 linux platform succeded. This is the same problem experienced from Dayana in this mailing list the 1st may 2013, I read the answers but they were not helpful Can you help me please? thank you Il 28/10/2013 12:37, Carl Eugen Hoyos ha scritto: Zanelli Franco writes: > I experienced it when I was trying to include static ffmpeg > libraries (libavcodec.a, libavformat.a ...) in my shared lib > (mylib.so) on a 64 bit linux platform, but I don't know how to > solve, can you help me please? Could you explain (FFmpeg version, configure line, etc.) how to reproduce your problem? That may allow us to help. Carl Eugen _______________________________________________ Libav-user mailing list Libav-user at ffmpeg.org http://ffmpeg.org/mailman/listinfo/libav-user -------------- next part -------------- An HTML attachment was scrubbed... URL: From mrfun.china at gmail.com Wed Oct 30 04:51:30 2013 From: mrfun.china at gmail.com (YIRAN LI) Date: Wed, 30 Oct 2013 14:51:30 +1100 Subject: [Libav-user] How to get precise frame timestamp Message-ID: Hi friends, Here I have a question about AVFrame pts needs your help. My application uses av_read_frame to get packets and then calls avcodec_decode_video2 to get video frames. But recently I found one specific video file generates strange pts/dts. Below is a part of the log: 00:00:17.301 MAIN timestamp_debug: pkt.pts = -9223372036854775808, dts = 0 00:00:17.301 MAIN timestamp_debug: frame.pkt_pts = -9223372036854775808, frame.pkt_dts = -9223372036854775808, frame.pts = -9223372036854775808 00:00:17.301 1108 FFMPEG: looks like this file was encoded with (divx4/(old)xvid/opendivx) -> forcing low_delay flag 00:00:17.301 MAIN timestamp_debug: pkt.pts = -9223372036854775808, dts = 1 00:00:17.301 MAIN timestamp_debug: frame.pkt_pts = -9223372036854775808, frame.pkt_dts = -9223372036854775808, frame.pts = -9223372036854775808 00:00:17.301 MAIN timestamp_debug: pkt.pts = -9223372036854775808, dts = 2 00:00:17.301 MAIN timestamp_debug: frame.pkt_pts = -9223372036854775808, frame.pkt_dts = -9223372036854775808, frame.pts = -9223372036854775808 00:00:17.301 MAIN timestamp_debug: pkt.pts = -9223372036854775808, dts = 3 00:00:17.301 MAIN timestamp_debug: frame.pkt_pts = -9223372036854775808, frame.pkt_dts = -9223372036854775808, frame.pts = -9223372036854775808 00:00:17.301 MAIN timestamp_debug: pkt.pts = -9223372036854775808, dts = 4 00:00:17.301 MAIN timestamp_debug: [a full frame : frame.pkt_pts = -9223372036854775808, frame.pkt_dts = 0], frame.pts = 0 00:00:18.393 LVid236 timestamp_debug: pkt.pts = -9223372036854775808, dts = 5 00:00:18.408 LVid236 timestamp_debug: [a full frame : frame.pkt_pts = -9223372036854775808, frame.pkt_dts = 1], frame.pts = 0 00:00:18.439 LVid236 timestamp_debug: pkt.pts = -9223372036854775808, dts = 6 00:00:18.439 LVid236 timestamp_debug: [a full frame : frame.pkt_pts = -9223372036854775808, frame.pkt_dts = 2], frame.pts = 0 00:00:18.439 LSou259 FFMPEG: first_dts 0 not matching first dts 113424 in the queue 00:00:18.486 LVid236 timestamp_debug: pkt.pts = -9223372036854775808, dts = 7 00:00:18.486 LVid236 timestamp_debug: [a full frame : frame.pkt_pts = -9223372036854775808, frame.pkt_dts = 3], frame.pts = 0 00:00:18.517 LVid236 timestamp_debug: pkt.pts = -9223372036854775808, dts = 8 00:00:18.517 LVid236 timestamp_debug: [a full frame : frame.pkt_pts = -9223372036854775808, frame.pkt_dts = 4], frame.pts = 0 00:00:18.549 LSou259 FFMPEG: first_dts 0 not matching first dts 114675 in the queue We can see that, it was until 4th packet is sent to decode function that we got the first full frame. and all frames had pts = 0 So here I want to know, frame.pts, frame.pkt_dts, packet,dts. which is best to represent the time stamp of a video frame (I mean pts, but in this case, no pts is valid). For example, in this case, for the 1st frame, should I use frame.pkt_dts (that's 0), or pkt.pts (the last packet that generates this frame, in this case 4) as the time position of the frame? The file I used to test is here https://dl.dropboxusercontent.com/u/89678527/av_divx_24_yuv420p_mp3_44100_2_1.avi Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: From alexcohn at netvision.net.il Wed Oct 30 06:25:11 2013 From: alexcohn at netvision.net.il (Alex Cohn) Date: Wed, 30 Oct 2013 07:25:11 +0200 Subject: [Libav-user] How to get precise frame timestamp In-Reply-To: References: Message-ID: On Wed, Oct 30, 2013 at 5:51 AM, YIRAN LI wrote: > > Hi friends, > > Here I have a question about AVFrame pts needs your help. > > My application uses av_read_frame to get packets and then calls avcodec_decode_video2 to get video frames. But recently I found one specific video file generates strange pts/dts. > > Below is a part of the log: > > 00:00:17.301 MAIN timestamp_debug: pkt.pts = -9223372036854775808, dts = 0 > 00:00:17.301 MAIN timestamp_debug: frame.pkt_pts = -9223372036854775808, frame.pkt_dts = -9223372036854775808, frame.pts = -9223372036854775808 > 00:00:17.301 1108 FFMPEG: looks like this file was encoded with (divx4/(old)xvid/opendivx) -> forcing low_delay flag > > 00:00:17.301 MAIN timestamp_debug: pkt.pts = -9223372036854775808, dts = 1 > 00:00:17.301 MAIN timestamp_debug: frame.pkt_pts = -9223372036854775808, frame.pkt_dts = -9223372036854775808, frame.pts = -9223372036854775808 > 00:00:17.301 MAIN timestamp_debug: pkt.pts = -9223372036854775808, dts = 2 > 00:00:17.301 MAIN timestamp_debug: frame.pkt_pts = -9223372036854775808, frame.pkt_dts = -9223372036854775808, frame.pts = -9223372036854775808 > 00:00:17.301 MAIN timestamp_debug: pkt.pts = -9223372036854775808, dts = 3 > 00:00:17.301 MAIN timestamp_debug: frame.pkt_pts = -9223372036854775808, frame.pkt_dts = -9223372036854775808, frame.pts = -9223372036854775808 > 00:00:17.301 MAIN timestamp_debug: pkt.pts = -9223372036854775808, dts = 4 > 00:00:17.301 MAIN timestamp_debug: [a full frame : frame.pkt_pts = -9223372036854775808, frame.pkt_dts = 0], frame.pts = 0 > 00:00:18.393 LVid236 timestamp_debug: pkt.pts = -9223372036854775808, dts = 5 > 00:00:18.408 LVid236 timestamp_debug: [a full frame : frame.pkt_pts = -9223372036854775808, frame.pkt_dts = 1], frame.pts = 0 > 00:00:18.439 LVid236 timestamp_debug: pkt.pts = -9223372036854775808, dts = 6 > 00:00:18.439 LVid236 timestamp_debug: [a full frame : frame.pkt_pts = -9223372036854775808, frame.pkt_dts = 2], frame.pts = 0 > 00:00:18.439 LSou259 FFMPEG: first_dts 0 not matching first dts 113424 in the queue > 00:00:18.486 LVid236 timestamp_debug: pkt.pts = -9223372036854775808, dts = 7 > 00:00:18.486 LVid236 timestamp_debug: [a full frame : frame.pkt_pts = -9223372036854775808, frame.pkt_dts = 3], frame.pts = 0 > 00:00:18.517 LVid236 timestamp_debug: pkt.pts = -9223372036854775808, dts = 8 > 00:00:18.517 LVid236 timestamp_debug: [a full frame : frame.pkt_pts = -9223372036854775808, frame.pkt_dts = 4], frame.pts = 0 > 00:00:18.549 LSou259 FFMPEG: first_dts 0 not matching first dts 114675 in the queue > > We can see that, it was until 4th packet is sent to decode function that we got the first full frame. and all frames had pts = 0 > > So here I want to know, frame.pts, frame.pkt_dts, packet,dts. which is best to represent the time stamp of a video frame (I mean pts, but in this case, no pts is valid). > > For example, in this case, for the 1st frame, should I use frame.pkt_dts (that's 0), or pkt.pts (the last packet that generates this frame, in this case 4) as the time position > of the frame? > > The file I used to test is here https://dl.dropboxusercontent.com/u/89678527/av_divx_24_yuv420p_mp3_44100_2_1.avi > > Thanks That's what best_effort_timestamp is for. See http://dranger.com/ffmpeg/tutorial05.html about different values of pts/dts. BR, Alex Cohn From mrfun.china at gmail.com Wed Oct 30 07:01:26 2013 From: mrfun.china at gmail.com (YIRAN LI) Date: Wed, 30 Oct 2013 17:01:26 +1100 Subject: [Libav-user] How to get precise frame timestamp In-Reply-To: References: Message-ID: Thanks Alex, I just had a quick check, called av_frame_get_best_effort_timestamp(pFrame); and seems pFrame->best_effort_timestamp was filled with desired values (1st frame having 0, 2nd having 1 and so on). I'll read through the link you gave me later on. Great Thanks! 2013/10/30 Alex Cohn > On Wed, Oct 30, 2013 at 5:51 AM, YIRAN LI wrote: > > > > Hi friends, > > > > Here I have a question about AVFrame pts needs your help. > > > > My application uses av_read_frame to get packets and then calls > avcodec_decode_video2 to get video frames. But recently I found one > specific video file generates strange pts/dts. > > > > Below is a part of the log: > > > > 00:00:17.301 MAIN timestamp_debug: pkt.pts = -9223372036854775808, > dts = 0 > > 00:00:17.301 MAIN timestamp_debug: frame.pkt_pts = > -9223372036854775808, frame.pkt_dts = -9223372036854775808, frame.pts = > -9223372036854775808 > > 00:00:17.301 1108 FFMPEG: looks like this file was encoded with > (divx4/(old)xvid/opendivx) -> forcing low_delay flag > > > > 00:00:17.301 MAIN timestamp_debug: pkt.pts = -9223372036854775808, > dts = 1 > > 00:00:17.301 MAIN timestamp_debug: frame.pkt_pts = > -9223372036854775808, frame.pkt_dts = -9223372036854775808, frame.pts = > -9223372036854775808 > > 00:00:17.301 MAIN timestamp_debug: pkt.pts = -9223372036854775808, > dts = 2 > > 00:00:17.301 MAIN timestamp_debug: frame.pkt_pts = > -9223372036854775808, frame.pkt_dts = -9223372036854775808, frame.pts = > -9223372036854775808 > > 00:00:17.301 MAIN timestamp_debug: pkt.pts = -9223372036854775808, > dts = 3 > > 00:00:17.301 MAIN timestamp_debug: frame.pkt_pts = > -9223372036854775808, frame.pkt_dts = -9223372036854775808, frame.pts = > -9223372036854775808 > > 00:00:17.301 MAIN timestamp_debug: pkt.pts = -9223372036854775808, > dts = 4 > > 00:00:17.301 MAIN timestamp_debug: [a full frame : frame.pkt_pts = > -9223372036854775808, frame.pkt_dts = 0], frame.pts = 0 > > 00:00:18.393 LVid236 timestamp_debug: pkt.pts = -9223372036854775808, > dts = 5 > > 00:00:18.408 LVid236 timestamp_debug: [a full frame : frame.pkt_pts = > -9223372036854775808, frame.pkt_dts = 1], frame.pts = 0 > > 00:00:18.439 LVid236 timestamp_debug: pkt.pts = -9223372036854775808, > dts = 6 > > 00:00:18.439 LVid236 timestamp_debug: [a full frame : frame.pkt_pts = > -9223372036854775808, frame.pkt_dts = 2], frame.pts = 0 > > 00:00:18.439 LSou259 FFMPEG: first_dts 0 not matching first dts 113424 > in the queue > > 00:00:18.486 LVid236 timestamp_debug: pkt.pts = -9223372036854775808, > dts = 7 > > 00:00:18.486 LVid236 timestamp_debug: [a full frame : frame.pkt_pts = > -9223372036854775808, frame.pkt_dts = 3], frame.pts = 0 > > 00:00:18.517 LVid236 timestamp_debug: pkt.pts = -9223372036854775808, > dts = 8 > > 00:00:18.517 LVid236 timestamp_debug: [a full frame : frame.pkt_pts = > -9223372036854775808, frame.pkt_dts = 4], frame.pts = 0 > > 00:00:18.549 LSou259 FFMPEG: first_dts 0 not matching first dts 114675 > in the queue > > > > We can see that, it was until 4th packet is sent to decode function that > we got the first full frame. and all frames had pts = 0 > > > > So here I want to know, frame.pts, frame.pkt_dts, packet,dts. which is > best to represent the time stamp of a video frame (I mean pts, but in this > case, no pts is valid). > > > > For example, in this case, for the 1st frame, should I use frame.pkt_dts > (that's 0), or pkt.pts (the last packet that generates this frame, in this > case 4) as the time position > > of the frame? > > > > The file I used to test is here > https://dl.dropboxusercontent.com/u/89678527/av_divx_24_yuv420p_mp3_44100_2_1.avi > > > > Thanks > > > That's what best_effort_timestamp is for. See > http://dranger.com/ffmpeg/tutorial05.html about different values of > pts/dts. > > BR, > Alex Cohn > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > -------------- next part -------------- An HTML attachment was scrubbed... URL: From krueger at lesspain.de Wed Oct 30 12:19:28 2013 From: krueger at lesspain.de (=?UTF-8?Q?Robert_Kr=C3=BCger?=) Date: Wed, 30 Oct 2013 12:19:28 +0100 Subject: [Libav-user] Questions regarding change in lib behaviour for mpeg2 fourCCs in mov Message-ID: Hi, a recent update of our application showed that setting the codec_tag for muxing no longer worked for mpeg2. AFAICS the reason is commit 713dcdbfcbaa305050ae6362e5131e0e2e705135. If I see this correctly, this means if I disagree for whatever reason with the fourcc that ffmpeg decodes on, my application has no way to override it. Is this intentional? Couldn't one imagine a case where I wanted or have to make that decision outside, be it to fulfill some proprietary requirements? Is the behaviour regarding muxer and codec_tag defined somewhere? Thanks for any insights on this. Robert From onemda at gmail.com Wed Oct 30 12:32:23 2013 From: onemda at gmail.com (Paul B Mahol) Date: Wed, 30 Oct 2013 11:32:23 +0000 Subject: [Libav-user] Questions regarding change in lib behaviour for mpeg2 fourCCs in mov In-Reply-To: References: Message-ID: On 10/30/13, Robert Krueger wrote: > Hi, > > a recent update of our application showed that setting the codec_tag > for muxing no longer worked for mpeg2. AFAICS the reason is commit > 713dcdbfcbaa305050ae6362e5131e0e2e705135. > > If I see this correctly, this means if I disagree for whatever reason > with the fourcc that ffmpeg decodes on, my application has no way to > override it. Is this intentional? Couldn't one imagine a case where I > wanted or have to make that decision outside, be it to fulfill some > proprietary requirements? Such as? > > Is the behaviour regarding muxer and codec_tag defined somewhere? > > Thanks for any insights on this. IIRC that commit is there for some reason. If that commit disabled something which was possible before than that may be bad/good. > > Robert > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > From krueger at lesspain.de Wed Oct 30 12:52:42 2013 From: krueger at lesspain.de (=?UTF-8?Q?Robert_Kr=C3=BCger?=) Date: Wed, 30 Oct 2013 12:52:42 +0100 Subject: [Libav-user] Questions regarding change in lib behaviour for mpeg2 fourCCs in mov In-Reply-To: References: Message-ID: On Wed, Oct 30, 2013 at 12:32 PM, Paul B Mahol wrote: > On 10/30/13, Robert Krueger wrote: >> Hi, >> >> a recent update of our application showed that setting the codec_tag >> for muxing no longer worked for mpeg2. AFAICS the reason is commit >> 713dcdbfcbaa305050ae6362e5131e0e2e705135. >> >> If I see this correctly, this means if I disagree for whatever reason >> with the fourcc that ffmpeg decodes on, my application has no way to >> override it. Is this intentional? Couldn't one imagine a case where I >> wanted or have to make that decision outside, be it to fulfill some >> proprietary requirements? > > Such as? For example, both xdcam codecs XDCAM HD 1080p25 VBR fourCC: xdv7 and XDCAM EX 1080p25 VBR fourCC: xdve Have the same frame rate, pixel format and resolution. If I write an application that reads XDCAM HD material and is supposed to e.g. create a subclip of that and store it in a new file with the same properties as the original quicktime file, I would no longer be able to do that after that change. > >> >> Is the behaviour regarding muxer and codec_tag defined somewhere? >> >> Thanks for any insights on this. > > IIRC that commit is there for some reason. Yes, to add heuristics for a common broadcast case, which are a nice convenience, which I think is good for a lot of users. > > If that commit disabled something which was possible before than > that may be bad/good. So it would be good to know. That's why I am asking because from an API user point of view, I do like autocalculation but also see the advantage/need to have an override option for people who know what they are doing. If the maintainer disagrees, that is of course fine. Then I will simply live with a patched version. A patch that lets the codec_tag set in the AVCodecContext override the calculated defaults (either by default or, if that is a problem in certain cases, by a muxer option like override_fourCC or something like that) is trivial. From ahqzy at 163.com Thu Oct 31 02:07:48 2013 From: ahqzy at 163.com (ahqzy) Date: Thu, 31 Oct 2013 09:07:48 +0800 (CST) Subject: [Libav-user] what's the extradata should be when using ffmpeg+libstagefright? Message-ID: <7c95788c.17ed.1420c0d4fdf.Coremail.ahqzy@163.com> Hi all, To using hardware decoding, I compiled ffmpeg(0.10) with andorid libstagefright successfully. When I call it, in the Stagefright_init(AVCodecContext *avctx), the extradata must be specified as below in the source: static av_cold int Stagefright_init(AVCodecContext *avctx) { ?? ?? if (!avctx->extradata || !avctx->extradata_size || avctx->extradata[0] != 1) return -1; ?? } I dont't konw how to fill the avctx->extradata, anyone can help me? -------------- next part -------------- An HTML attachment was scrubbed... URL: From mrfun.china at gmail.com Thu Oct 31 03:27:47 2013 From: mrfun.china at gmail.com (YIRAN LI) Date: Thu, 31 Oct 2013 13:27:47 +1100 Subject: [Libav-user] How to get precise frame timestamp In-Reply-To: References: Message-ID: Hi Alex, Seems I couldn't find the source code of av_frame_get_best_effort_timestamp, so I have to ask here, because I found that ffmpeg 1.1.3 return -1 for every frame of same file. So definitely int64_t position = av_frame_get_best_effort_timestamp(pFrame); if ((position != AV_NOPTS_VALUE) && (position >=0)) is needed to check if best effort timestamp is valid, but I'd like to know if it's enough. As you can see in ffmpeg2.0.1 (with which av_frame_get_best_effort_timestamp returns correct value) the best effort time stamp returned equals to frame.pkt_dts, that's ok. But if it's possible, for exmpale, av_frame_get_best_effort_timestamp returns all 0 for every frame? So in summary I'd like to know on what condition can I totally trust time stamp returned by this function (so I can forget about those packet.dts, packet.pts, frame.pkt_dts) Thanks! 2013/10/30 YIRAN LI > Thanks Alex, > > I just had a quick check, called > av_frame_get_best_effort_timestamp(pFrame); and seems > pFrame->best_effort_timestamp was filled with desired values (1st frame > having 0, 2nd having 1 and so on). > > I'll read through the link you gave me later on. > > Great Thanks! > > > 2013/10/30 Alex Cohn > >> On Wed, Oct 30, 2013 at 5:51 AM, YIRAN LI wrote: >> > >> > Hi friends, >> > >> > Here I have a question about AVFrame pts needs your help. >> > >> > My application uses av_read_frame to get packets and then calls >> avcodec_decode_video2 to get video frames. But recently I found one >> specific video file generates strange pts/dts. >> > >> > Below is a part of the log: >> > >> > 00:00:17.301 MAIN timestamp_debug: pkt.pts = -9223372036854775808, >> dts = 0 >> > 00:00:17.301 MAIN timestamp_debug: frame.pkt_pts = >> -9223372036854775808, frame.pkt_dts = -9223372036854775808, frame.pts = >> -9223372036854775808 >> > 00:00:17.301 1108 FFMPEG: looks like this file was encoded with >> (divx4/(old)xvid/opendivx) -> forcing low_delay flag >> > >> > 00:00:17.301 MAIN timestamp_debug: pkt.pts = -9223372036854775808, >> dts = 1 >> > 00:00:17.301 MAIN timestamp_debug: frame.pkt_pts = >> -9223372036854775808, frame.pkt_dts = -9223372036854775808, frame.pts = >> -9223372036854775808 >> > 00:00:17.301 MAIN timestamp_debug: pkt.pts = -9223372036854775808, >> dts = 2 >> > 00:00:17.301 MAIN timestamp_debug: frame.pkt_pts = >> -9223372036854775808, frame.pkt_dts = -9223372036854775808, frame.pts = >> -9223372036854775808 >> > 00:00:17.301 MAIN timestamp_debug: pkt.pts = -9223372036854775808, >> dts = 3 >> > 00:00:17.301 MAIN timestamp_debug: frame.pkt_pts = >> -9223372036854775808, frame.pkt_dts = -9223372036854775808, frame.pts = >> -9223372036854775808 >> > 00:00:17.301 MAIN timestamp_debug: pkt.pts = -9223372036854775808, >> dts = 4 >> > 00:00:17.301 MAIN timestamp_debug: [a full frame : frame.pkt_pts = >> -9223372036854775808, frame.pkt_dts = 0], frame.pts = 0 >> > 00:00:18.393 LVid236 timestamp_debug: pkt.pts = >> -9223372036854775808, dts = 5 >> > 00:00:18.408 LVid236 timestamp_debug: [a full frame : frame.pkt_pts >> = -9223372036854775808, frame.pkt_dts = 1], frame.pts = 0 >> > 00:00:18.439 LVid236 timestamp_debug: pkt.pts = >> -9223372036854775808, dts = 6 >> > 00:00:18.439 LVid236 timestamp_debug: [a full frame : frame.pkt_pts >> = -9223372036854775808, frame.pkt_dts = 2], frame.pts = 0 >> > 00:00:18.439 LSou259 FFMPEG: first_dts 0 not matching first dts >> 113424 in the queue >> > 00:00:18.486 LVid236 timestamp_debug: pkt.pts = >> -9223372036854775808, dts = 7 >> > 00:00:18.486 LVid236 timestamp_debug: [a full frame : frame.pkt_pts >> = -9223372036854775808, frame.pkt_dts = 3], frame.pts = 0 >> > 00:00:18.517 LVid236 timestamp_debug: pkt.pts = >> -9223372036854775808, dts = 8 >> > 00:00:18.517 LVid236 timestamp_debug: [a full frame : frame.pkt_pts >> = -9223372036854775808, frame.pkt_dts = 4], frame.pts = 0 >> > 00:00:18.549 LSou259 FFMPEG: first_dts 0 not matching first dts >> 114675 in the queue >> > >> > We can see that, it was until 4th packet is sent to decode function >> that we got the first full frame. and all frames had pts = 0 >> > >> > So here I want to know, frame.pts, frame.pkt_dts, packet,dts. which is >> best to represent the time stamp of a video frame (I mean pts, but in this >> case, no pts is valid). >> > >> > For example, in this case, for the 1st frame, should I use >> frame.pkt_dts (that's 0), or pkt.pts (the last packet that generates this >> frame, in this case 4) as the time position >> > of the frame? >> > >> > The file I used to test is here >> https://dl.dropboxusercontent.com/u/89678527/av_divx_24_yuv420p_mp3_44100_2_1.avi >> > >> > Thanks >> >> >> That's what best_effort_timestamp is for. See >> http://dranger.com/ffmpeg/tutorial05.html about different values of >> pts/dts. >> >> BR, >> Alex Cohn >> _______________________________________________ >> Libav-user mailing list >> Libav-user at ffmpeg.org >> http://ffmpeg.org/mailman/listinfo/libav-user >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mrfun.china at gmail.com Thu Oct 31 05:39:57 2013 From: mrfun.china at gmail.com (YIRAN LI) Date: Thu, 31 Oct 2013 15:39:57 +1100 Subject: [Libav-user] How to get precise frame timestamp In-Reply-To: References: Message-ID: Sorry Alex, Seems it's my fault, av_frame_get_best_effort_timestamp was moved from libavcode to libavutil. I'll run test again. Thanks 2013/10/31 YIRAN LI > Hi Alex, > > Seems I couldn't find the source code of av_frame_get_best_effort_timestamp, > so I have to ask here, because I found that ffmpeg 1.1.3 return -1 for > every frame of same file. > > So definitely > int64_t position = av_frame_get_best_effort_timestamp(pFrame); > if ((position != AV_NOPTS_VALUE) && (position >=0)) > > is needed to check if best effort timestamp is valid, but I'd like to know > if it's enough. > > As you can see in ffmpeg2.0.1 (with which av_frame_get_best_effort_timestamp > returns correct value) the best effort time stamp returned equals to frame.pkt_dts, > that's ok. > > But if it's possible, for exmpale, av_frame_get_best_effort_timestamp > returns all 0 for every frame? > > So in summary I'd like to know on what condition can I totally trust time > stamp returned by this function (so I can forget about those packet.dts, > packet.pts, frame.pkt_dts) > > Thanks! > > > 2013/10/30 YIRAN LI > >> Thanks Alex, >> >> I just had a quick check, called >> av_frame_get_best_effort_timestamp(pFrame); and seems >> pFrame->best_effort_timestamp was filled with desired values (1st frame >> having 0, 2nd having 1 and so on). >> >> I'll read through the link you gave me later on. >> >> Great Thanks! >> >> >> 2013/10/30 Alex Cohn >> >>> On Wed, Oct 30, 2013 at 5:51 AM, YIRAN LI wrote: >>> > >>> > Hi friends, >>> > >>> > Here I have a question about AVFrame pts needs your help. >>> > >>> > My application uses av_read_frame to get packets and then calls >>> avcodec_decode_video2 to get video frames. But recently I found one >>> specific video file generates strange pts/dts. >>> > >>> > Below is a part of the log: >>> > >>> > 00:00:17.301 MAIN timestamp_debug: pkt.pts = -9223372036854775808, >>> dts = 0 >>> > 00:00:17.301 MAIN timestamp_debug: frame.pkt_pts = >>> -9223372036854775808, frame.pkt_dts = -9223372036854775808, frame.pts = >>> -9223372036854775808 >>> > 00:00:17.301 1108 FFMPEG: looks like this file was encoded with >>> (divx4/(old)xvid/opendivx) -> forcing low_delay flag >>> > >>> > 00:00:17.301 MAIN timestamp_debug: pkt.pts = -9223372036854775808, >>> dts = 1 >>> > 00:00:17.301 MAIN timestamp_debug: frame.pkt_pts = >>> -9223372036854775808, frame.pkt_dts = -9223372036854775808, frame.pts = >>> -9223372036854775808 >>> > 00:00:17.301 MAIN timestamp_debug: pkt.pts = -9223372036854775808, >>> dts = 2 >>> > 00:00:17.301 MAIN timestamp_debug: frame.pkt_pts = >>> -9223372036854775808, frame.pkt_dts = -9223372036854775808, frame.pts = >>> -9223372036854775808 >>> > 00:00:17.301 MAIN timestamp_debug: pkt.pts = -9223372036854775808, >>> dts = 3 >>> > 00:00:17.301 MAIN timestamp_debug: frame.pkt_pts = >>> -9223372036854775808, frame.pkt_dts = -9223372036854775808, frame.pts = >>> -9223372036854775808 >>> > 00:00:17.301 MAIN timestamp_debug: pkt.pts = -9223372036854775808, >>> dts = 4 >>> > 00:00:17.301 MAIN timestamp_debug: [a full frame : frame.pkt_pts = >>> -9223372036854775808, frame.pkt_dts = 0], frame.pts = 0 >>> > 00:00:18.393 LVid236 timestamp_debug: pkt.pts = >>> -9223372036854775808, dts = 5 >>> > 00:00:18.408 LVid236 timestamp_debug: [a full frame : frame.pkt_pts >>> = -9223372036854775808, frame.pkt_dts = 1], frame.pts = 0 >>> > 00:00:18.439 LVid236 timestamp_debug: pkt.pts = >>> -9223372036854775808, dts = 6 >>> > 00:00:18.439 LVid236 timestamp_debug: [a full frame : frame.pkt_pts >>> = -9223372036854775808, frame.pkt_dts = 2], frame.pts = 0 >>> > 00:00:18.439 LSou259 FFMPEG: first_dts 0 not matching first dts >>> 113424 in the queue >>> > 00:00:18.486 LVid236 timestamp_debug: pkt.pts = >>> -9223372036854775808, dts = 7 >>> > 00:00:18.486 LVid236 timestamp_debug: [a full frame : frame.pkt_pts >>> = -9223372036854775808, frame.pkt_dts = 3], frame.pts = 0 >>> > 00:00:18.517 LVid236 timestamp_debug: pkt.pts = >>> -9223372036854775808, dts = 8 >>> > 00:00:18.517 LVid236 timestamp_debug: [a full frame : frame.pkt_pts >>> = -9223372036854775808, frame.pkt_dts = 4], frame.pts = 0 >>> > 00:00:18.549 LSou259 FFMPEG: first_dts 0 not matching first dts >>> 114675 in the queue >>> > >>> > We can see that, it was until 4th packet is sent to decode function >>> that we got the first full frame. and all frames had pts = 0 >>> > >>> > So here I want to know, frame.pts, frame.pkt_dts, packet,dts. which is >>> best to represent the time stamp of a video frame (I mean pts, but in this >>> case, no pts is valid). >>> > >>> > For example, in this case, for the 1st frame, should I use >>> frame.pkt_dts (that's 0), or pkt.pts (the last packet that generates this >>> frame, in this case 4) as the time position >>> > of the frame? >>> > >>> > The file I used to test is here >>> https://dl.dropboxusercontent.com/u/89678527/av_divx_24_yuv420p_mp3_44100_2_1.avi >>> > >>> > Thanks >>> >>> >>> That's what best_effort_timestamp is for. See >>> http://dranger.com/ffmpeg/tutorial05.html about different values of >>> pts/dts. >>> >>> BR, >>> Alex Cohn >>> _______________________________________________ >>> Libav-user mailing list >>> Libav-user at ffmpeg.org >>> http://ffmpeg.org/mailman/listinfo/libav-user >>> >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From yamusanivinay at gmail.com Thu Oct 31 10:46:38 2013 From: yamusanivinay at gmail.com (Yamusani Vinay) Date: Thu, 31 Oct 2013 15:16:38 +0530 Subject: [Libav-user] Mp3 play using ffmpeg Message-ID: Hi All, Please help me in playing mp3 song.By using ffmpeg I am able to play wav file.The same code I used to play mp3 file then I am getting following error which is mentioned in log.txt. Here I'm attaching the following files: 1.Code I used to play mp3 song.(i.e music.c) 2.The error I got while playing mp3.(i.e log.txt) the error is while decoding the length obtained is negative. Thanks & Regards, Vinay Yamusani. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- 10-31 16:36:54.370: D/tag(23670): RAH28 Starting 10-31 16:36:54.512: D/tag(23670): RAH getting stream info 10-31 16:36:55.057: D/tag(23670): RAH getting audio stream 10-31 16:36:55.057: D/tag(23670): RAH audio stream found with result: [0] 10-31 16:36:55.057: D/tag(23670): RAH audio codec info loaded 10-31 16:36:55.057: D/tag(23670): RAH audio codec info [86017] 10-31 16:36:55.057: D/tag(23670): RAH audio codec info found 10-31 16:36:55.057: D/tag(23670): RAH audio codec loaded [6] [0] 10-31 16:36:55.057: D/tag(23670): RAH channels [2] sample rate [44100] sample format [6] 10-31 16:36:55.057: D/tag(23670): RAH frame read: [0] [0] 10-31 16:36:55.057: D/tag(23670): RAH audio ready 10-31 16:36:55.057: D/tag(23670): RAH packet size: [90828] 10-31 16:36:55.057: D/tag(23670): RAH decoding: [1] [0] 10-31 16:36:55.057: D/tag(23670): RAH 1 size [90828] len [-1094995529] data_size [0] out_size [0] 10-31 16:36:55.062: A/libc(23670): Fatal signal 11 (SIGSEGV) at 0x5c0b5000 (code=1), thread 23700 (Thread-3695) -------------- next part -------------- A non-text attachment was scrubbed... Name: music.c Type: text/x-csrc Size: 3981 bytes Desc: not available URL: From rob.f.schmidt86 at gmail.com Thu Oct 31 13:51:41 2013 From: rob.f.schmidt86 at gmail.com (Robert Schmidt) Date: Thu, 31 Oct 2013 12:51:41 +0000 Subject: [Libav-user] Mp3 play using ffmpeg In-Reply-To: References: Message-ID: On Thu, Oct 31, 2013 at 9:46 AM, Yamusani Vinay wrote: > > the error is while decoding the length obtained is negative. > One possibility is that you might be trying to decode a non-audio packet. On line 110, after you've read a packet from the file, you check if your decoding context is for audio, which will always be true. What I think you want to do is instead check that the packet you retrieved is associated with your audio stream and not some other stream in the file. Something like if (packet.stream_index == audioStream) It's possible this code worked for a .wav file if the file only had a single stream containing audio data. Hope this helps. Rob From yamusanivinay at gmail.com Thu Oct 31 14:24:56 2013 From: yamusanivinay at gmail.com (Yamusani Vinay) Date: Thu, 31 Oct 2013 18:54:56 +0530 Subject: [Libav-user] Mp3 play using ffmpeg In-Reply-To: References: Message-ID: I tried playing another mp3 file then at the below line. int res = av_find_stream_info(pFormatCtx); I got res as -1 so this is unable to find stream info..so please help in solving this issue.. On Thu, Oct 31, 2013 at 6:21 PM, Robert Schmidt wrote: > On Thu, Oct 31, 2013 at 9:46 AM, Yamusani Vinay > wrote: > > > > the error is while decoding the length obtained is negative. > > > > One possibility is that you might be trying to decode a non-audio > packet. On line 110, after you've read a packet from the file, you > check if your decoding context is for audio, which will always be > true. What I think you want to do is instead check that the packet > you retrieved is associated with your audio stream and not some other > stream in the file. > > Something like > > if (packet.stream_index == audioStream) > > It's possible this code worked for a .wav file if the file only had a > single stream containing audio data. > > Hope this helps. > > Rob > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > -------------- next part -------------- An HTML attachment was scrubbed... URL: From michaelarice at gmail.com Thu Oct 31 20:35:07 2013 From: michaelarice at gmail.com (video_decoder) Date: Thu, 31 Oct 2013 12:35:07 -0700 (PDT) Subject: [Libav-user] H.264 Decoder and Royalties Message-ID: <1383248107128-4658802.post@n4.nabble.com> I know this question has been asked in different forms before on this and other forums, but I can't seem to find a definitive answer. I am writing a proprietary in-house application that's using libav built in LGPL mode. It is using libav to receive and decode an incoming RTSP network stream with an H.264 payload. It doesn't do any encoding or retransmitting of the video. It will probably only be distributed to < 10 users. My question is regarding the need to pay the MPEG-LA royalties for using H.264. I've read lots of information about when you do and don't need to pay, and I've read that if you only distribute a small number of copies then you don't have to pay the royalties, etc. So, what I'm looking for is the definitive IANL answer? Thanks. -- View this message in context: http://libav-users.943685.n4.nabble.com/H-264-Decoder-and-Royalties-tp4658802.html Sent from the libav-users mailing list archive at Nabble.com.