From michael at hinespot.com Tue Jan 1 03:36:05 2013 From: michael at hinespot.com (Michael R. Hines) Date: Mon, 31 Dec 2012 21:36:05 -0500 Subject: [Libav-user] muxer ignoring my PTS audio values Message-ID: <1357007765.26810.11.camel@chopin> Hi, Following a few previous posts on libav-user, I've been trying to get my audio and video synchronized using the dranger tutorial. I'm transcoding (from mpeg2/ac3 to h264/ac3) to make a Blu-ray disc. So, I scrounged up some code from the tutorial and this mailing list and everything seems to be fine, except for the audio sync. In my case, I'm just copying the audio packets (not decoding them). Similar to this post: https://lists.libav.org/pipermail/libav-user/2010-January/004170.html I noticed the the audio packets are always off from the video by a constant factor when I try to play the video. So, naturally, I tried a binary search by "tweaking" the PTS value by fixed offsets. But when I validate the PTS values with "ffprobe -show_packets", the muxer did not use the PTS values that I choose. Instead, the PTS values start from zero and continue up rather than the values I chose. The muxer did not print any errors - it wrote the "copied" audio packets just fine - so I assumed my chosen PTS values would have been written to. Playing the audio on my desktop also works fine - it's just that it has the wrong PTS values. Is there something I need to do to "make" the muxer respect the values I've chosen? Thanks! - Michael From jettoblack at gmail.com Tue Jan 1 05:07:29 2013 From: jettoblack at gmail.com (Jason Livingston) Date: Mon, 31 Dec 2012 23:07:29 -0500 Subject: [Libav-user] MPEG-TS muxrate and bufsize setting in lav* Message-ID: Happy new year everyone! I'm trying to encode a CBR transport stream. It works fine using ffmpeg CLI, but I think I am not setting some parameters correctly when I try to do it using lav*. e.g. to encode a 2.2Mbit CBR TS with 2.0Mbit CBR video and 64k audio: ffmpeg -i source -codec:v libx264 -b:v 2M -minrate 2M -maxrate 2M -bufsize 1M -muxrate 2.2M -codec:a aac -b:a 64k -ac 2 -ar 48000 out.ts This works ok. When I try to replicate the same settings in code: vCC->bit_rate = 2000000; // 2M vCC->rc_min_rate = vCC->bit_rate; vCC->rc_max_rate = vCC->bit_rate; vCC->rc_buffer_size = 1000000; // 1M ... AVDictionary *dict = NULL; av_dict_set(&dict, "muxrate", "2200000", 0); // 2.2M avformat_write_header(out, &dict); ... I think I'm setting the codec bitrate options correctly since I get this debug output from av_dump_format(): Output #0, mpegts, to 'Stream 0': Stream #0:0: Video: h264, yuv420p, 1280x720 [SAR 1:1 DAR 16:9], q=-1--1, 2000 kb/s, 90k tbn, 29.97 tbc Stream #0:1: Audio: aac, 48000 Hz, stereo, fltp, 64 kb/s Also I think muxrate is set as intended because I get the message: [mpegts @ 0x103021800] muxrate 2200000, pcr every 58 pkts, sdt every 1462, pat/pmt every 1462 pkts However, even if I set the muxrate to an absurdly large value like 10x the video+audio bitrate, I get these errors on almost every packet: [mpegts @ 0x103021800] dts < pcr, TS is invalid This error usually indicates that the encoded bitrate spikes higher than will fit into the specified muxrate. I get the same error if I omit the -bufsize parameter to ffmpeg, and in my code I get the errors regardless of what rc_buffer_size is set to (or not setting it at all), so I suspect I am not setting the same variable that bufsize sets, or I'm not using the right value for it. I looked through ffmpeg.c and couldn't easily find how the -bufsize parameter gets applied as a format or codec option, or whether ffmpeg is tweaking my values. However I'm not positive that bufisize is even related to the problem. Do I need to set any other rate control or buffer related options for this to work, such as rc_buffer_aggressivity, rc_initial_buffer_occupancy, etc.? And if so, what are the recommended values? I'm happy to post a self contained example that compiles, if it would help. Any ideas? Thanks! From kalileo at universalx.net Tue Jan 1 17:33:36 2013 From: kalileo at universalx.net (Kalileo) Date: Tue, 1 Jan 2013 23:33:36 +0700 Subject: [Libav-user] AAC decoding problems In-Reply-To: <50DED9FC.8070208@gmx.at> References: <50DED9FC.8070208@gmx.at> Message-ID: On Dec 29, 2012, at 18:54 , Funky Factory Development wrote: > Hi, > > I'm having some issues with AAC decoding with recent version of ffmpeg: > > I'm using this code to decode AAC Frames (from a stream). > I had some troubles with the decoding - everything runs fine but the after a few seconds playing > the decoded buffer (m_avAACFrame->data) only contains zeros. > ... > memcpy(outbuffer,*(byte**)&m_avAACFrame->data,*outputsize); > > So i switched to the latest version of ffmpeg (Zeranoe FFmpeg for Windows) and now i have the problem that the output sample format is always AV_SAMPLE_FMT_FLT instead of AV_SAMPLE_FMT_S16 ? > > ... > > Is AAC not properly supported on ffmpeg ? > > Thanks for your help > The output sample format for aac has indeed changed (on November 26, 2012). If you need the old format, then you need to integrate resampling after decoding to convert it to the old format. From phamsyquybk at gmail.com Wed Jan 2 07:30:39 2013 From: phamsyquybk at gmail.com (Quy Pham Sy) Date: Wed, 2 Jan 2013 15:30:39 +0900 Subject: [Libav-user] How to control ffmpeg's key-frame generation? Message-ID: I'm making a segmenter that intervene ffmpeg's write_frame function and write output data to separate files. Each segmented file contains segment of about 3 seconds video. The code does following: 1 - Get transcoded packet 2 - Check if it contains key frame data, if yes goto 3. 3 - Check the duration of current segment, if it exceed 3 seconds, goto 4 4 - Close file, and create new segment, write packet to segment file, goto-1 General speaking, every segment contains at least 3 seconds video data, and it starts with a key frame. The problem is that the output video's duration are very different, some contain 3 seconds, some contain 5 or 6. I suspect that the problem due to how ffmpeg generate key frames during transcoding. If the "distance" between two adjacent keyframes are 6s, i got 6 seconds segment. Here is my questions: 1. is that true that ffmpeg generate keyframes at irregular intervals (and interval time can be up to few second (eg. 6)? 2. How can we control the ffmpeg key frame generation? (i guess there should be a ffmpeg command's argument for this, -force_key_frames maybe, but I'm not sure) -------------- next part -------------- An HTML attachment was scrubbed... URL: From alexcohn at netvision.net.il Wed Jan 2 12:28:32 2013 From: alexcohn at netvision.net.il (Alex Cohn) Date: Wed, 2 Jan 2013 13:28:32 +0200 Subject: [Libav-user] How to control ffmpeg's key-frame generation? In-Reply-To: References: Message-ID: On Wed, Jan 2, 2013 at 8:30 AM, Quy Pham Sy wrote: > I'm making a segmenter that intervene ffmpeg's write_frame function and > write output data to separate files. Each segmented file contains segment of > about 3 seconds video. > > The code does following: > > 1 - Get transcoded packet > 2 - Check if it contains key frame data, if yes goto 3. > 3 - Check the duration of current segment, if it exceed 3 seconds, goto 4 > 4 - Close file, and create new segment, write packet to segment file, goto-1 > > General speaking, every segment contains at least 3 seconds video data, and > it starts with a key frame. Note that your step 4 does something you don't intend: it should never write the packet to the new segment file. Or maybe your description is wrong. > The problem is that the output video's duration are very different, some > contain 3 seconds, some contain 5 or 6. > > I suspect that the problem due to how ffmpeg generate key frames during > transcoding. If the "distance" between two adjacent keyframes are 6s, i got > 6 seconds segment. > > Here is my questions: > > is that true that ffmpeg generate keyframes at irregular intervals (and > interval time can be up to few second (eg. 6)? This depends on the codec. > How can we control the ffmpeg key frame generation? (i guess there should be > a ffmpeg command's argument for this, -force_key_frames maybe, but I'm not > sure) This depends on the codec, too. BR, Alex From cehoyos at ag.or.at Wed Jan 2 12:40:27 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Wed, 2 Jan 2013 11:40:27 +0000 (UTC) Subject: [Libav-user] How to control ffmpeg's key-frame generation? References: Message-ID: Quy Pham Sy writes: > How can we control the ffmpeg key frame generation? > (i guess there should be a ffmpeg command's argument > for this, -force_key_frames maybe, but I'm not sure) You mean you searched for -force_key_frames on http://ffmpeg.org/ffmpeg.html but you are not sure if you found it? Carl Eugen From cehoyos at ag.or.at Wed Jan 2 12:44:01 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Wed, 2 Jan 2013 11:44:01 +0000 (UTC) Subject: [Libav-user] How to control ffmpeg's key-frame generation? References: Message-ID: Quy Pham Sy writes: > I'm making a segmenter that intervene ffmpeg's write_frame > function and write output data to separate files. Each > segmented file contains segment of about 3 seconds video. It is possible that your questions are answered in the fine documentation: http://ffmpeg.org/ffmpeg-formats.html#segment_002c-stream_005fsegment_002c-ssegment Carl Eugen From stefasab at gmail.com Wed Jan 2 17:53:25 2013 From: stefasab at gmail.com (Stefano Sabatini) Date: Wed, 2 Jan 2013 17:53:25 +0100 Subject: [Libav-user] How to control ffmpeg's key-frame generation? In-Reply-To: References: Message-ID: <20130102165325.GE3486@arborea> In data Wednesday 2013-01-02 15:30:39 +0900, Quy Pham Sy ha scritto: > I'm making a segmenter that intervene ffmpeg's write_frame function and [...] > Here is my questions: > > 1. > > is that true that ffmpeg generate keyframes at irregular intervals (and > interval time can be up to few second (eg. 6)? Yes, look for GOP size. > 2. > > How can we control the ffmpeg key frame generation? (i guess there > should be a ffmpeg command's argument for this, -force_key_frames maybe, > but I'm not sure) -force_key_frames, and check the ffmpeg-devel archive for: ffmpeg: implement -force_key_frames expression evalution From michael at hinespot.com Wed Jan 2 19:40:10 2013 From: michael at hinespot.com (Michael R. Hines) Date: Wed, 02 Jan 2013 13:40:10 -0500 Subject: [Libav-user] muxer ignoring my PTS audio values In-Reply-To: <1357007765.26810.11.camel@chopin> References: <1357007765.26810.11.camel@chopin> Message-ID: <1357152010.22135.7.camel@salieri> So, for the uneducated (like myself), the problem was that I was not using a *actual* container to encapsulate my audio/video streams. For example, if you make a call like this, for example: avformat_alloc_output_context2(&ctx->outAudioFormatCtx, NULL, "ac3", NULL) or avformat_alloc_output_context2(&ctx->outAudioFormatCtx, NULL, "h264", NULL) .... the libraries happily go ahead and succeed with the understanding that: "Oh, you don't want to use a container? No problem - we'll just dump your packets to a file without any timestamps". This is easily fixed by using a TS container like this: avformat_alloc_output_context2(&ctx->outAudioFormatCtx, NULL, "mpegts", NULL) Followed by the approriate libav functions to open the *exact* codecs that you wanted. Ideally, the libraries should at least print a message that says: "Warning! Your AVFormatContext does not use a container. Be warned!" Or something threatening like that........ Is that an accurate observation? - Michael On Mon, 2012-12-31 at 21:36 -0500, Michael R. Hines wrote: > Hi, > > Following a few previous posts on libav-user, I've been trying to get > my audio and video synchronized using the dranger tutorial. > > I'm transcoding (from mpeg2/ac3 to h264/ac3) to make a Blu-ray disc. > > So, I scrounged up some code from the tutorial and this mailing list > and everything seems to be fine, except for the audio sync. > > In my case, I'm just copying the audio packets (not decoding them). > Similar to this post: > https://lists.libav.org/pipermail/libav-user/2010-January/004170.html > > I noticed the the audio packets are always off from the video by a > constant factor when I try to play the video. > > So, naturally, I tried a binary search by "tweaking" the PTS value > by fixed offsets. > > But when I validate the PTS values with "ffprobe -show_packets", the > muxer did not use the PTS values that I choose. > Instead, the PTS values start from zero and continue up rather than > the values I chose. > > The muxer did not print any errors - it wrote the "copied" > audio packets just fine - so I assumed my chosen PTS values would > have been written to. > > Playing the audio on my desktop also works fine - it's just that > it has the wrong PTS values. > > Is there something I need to do to "make" the muxer respect the > values I've chosen? > > Thanks! > > - Michael > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nair.sre at gmail.com Thu Jan 3 05:02:27 2013 From: nair.sre at gmail.com (sree nair) Date: Thu, 3 Jan 2013 09:32:27 +0530 Subject: [Libav-user] facing an issue with avcodec_decode_subtitle2 Message-ID: Hello, I am working on an assignment (using C/C++) to decode all the subtitle streams present in a m2ts file using libav. I have a m2ts file with one video stream (video stream index = 0), one audio stream (audio stream index = 1) and 5 subtitle streams ( stream indices = 2, 3, 4, 5). I first noticed the problem when I compared the position (x, y, w, h) I got from the decoded subtitle against the actual subtitle position from its control file. *The details of the actual events* SUBTITLE_STREAM_INDEX_2 Event1 (X="607" Y="780" START_FRAME="764") SUBTITLE_STREAM_INDEX_3 Event1 (X="575" Y="780" START_FRAME="764") SUBTITLE_STREAM_INDEX_4 Event1 (X="701" Y="780" START_FRAME="764") SUBTITLE_STREAM_INDEX_5 Event1 (X="483" Y="777" START_FRAME="765") * Quote: Please note Event1 of SUBTITLE_STREAM_INDEX_2, SUBTITLE_STREAM_INDEX_3, SUBTITLE_STREAM_INDEX_4 start at frame no 764. * When I ran the application, it first decoded Event1 of SUBTITLE_STREAM_INDEX_4 and I got the position values from the decoded subtitle as (701, 780, 507, 133). Next it decoded Event1 of SUBTITLE_STREAM_INDEX_2 and the position values decoded were as follows (701, 780, 507, 133). Please note the mismatch in values. The values were same for decoded subtitle of SUBTITLE_STREAM_INDEX_3. AS the next step I am decoding the subtitle and generating a png file. This is when I noticed the issue. For example I am decoding SUBTITLE_STREAM_INDEX_4 at frame no = 764. I generated the image using the subtitle->rects[0]->pict.data. This is correct subtitle. (Assume the dialog to be "hi there"). Now I have another subtitle stream (index = 2) which also starts from the same frame number (frame no = 764). Now when I generate a png using this decoded subtitle it has the same subtitle text as the one decoded from previous index. (the actual dialog is "hola", but the png generated had the dialog as "hi there"). It is basically giving me the position and data of the subtitle decoded from the first SUBTITLE_STREAM encountered for a particular frame number. I am posting the part of code: *Code:* AVPacket packet; //looping till end of file { av_init_packet(&packet); av_read_frame(pFormatContext, &packet); if((packet.stream_index == m_subtitleStreamIndex[0]) || (packet.stream_index == m_subtitleStreamIndex[1]) || (packet.stream_index == m_subtitleStreamIndex[2]) || (packet.stream_index == m_subtitleStreamIndex[3])) { int has_subtitle = 0; AVSubtitle* subtitle = new AVSubtitle; avcodec_decode_subtitle2(pSubtitleCodecContext, subtitle, &has_subtitle, &packet); if (has_subtitle != 0) { if (subtitle->rects) { struct SwsContext *mSwsContext = sws_getContext(subtitle->rects[0]->w, subtitle->rects[0]->h, pSubtitleCodecContext->pix_fmt, subtitle->rects[0]->w, subtitle->rects[0]->h, PIX_FMT_RGBA, SWS_BICUBIC, NULL, NULL, NULL); AVFrame *pPicture = AllocatePicture(PIX_FMT_RGBA, subtitle->rects[0]->w, subtitle->rects[0]->h); /* convert to RGB */ sws_scale(mSwsContext, (const uint8_t **) subtitle->rects[0]->pict.data, subtitle->rects[0]->pict.linesize, 0, subtitle->rects[0]->h, pPicture->data, pPicture->linesize); //code to generate png av_free(pPicture); sws_freeContext(mSwsContext); } } } avsubtitle_free(subtitle); } } Could anyone please advice if I am doing something wrong here or suggest a solution to this problem? I am expecting your priceless guidance and help. Thanks, Sree -------------- next part -------------- An HTML attachment was scrubbed... URL: From cehoyos at ag.or.at Thu Jan 3 17:16:19 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Thu, 3 Jan 2013 16:16:19 +0000 (UTC) Subject: [Libav-user] muxer ignoring my PTS audio values References: <1357007765.26810.11.camel@chopin> <1357152010.22135.7.camel@salieri> Message-ID: Michael R. Hines writes: > the problem was that I was not using a *actual* > container to encapsulate my audio/video streams. > For example, if you make a call like this, for example: > avformat_alloc_output_context2(&ctx->outAudioFormatCtx, NULL, "ac3", NULL) > or? avformat_alloc_output_context2(&ctx->outAudioFormatCtx, NULL, "h264", NULL) Please understand that both "ac3" and "h264" are "actual" containers in the sense that they are defined by public standards. You can test those containers with ffmpeg (the application): $ ffmpeg -i input -f ac3 out1 $ ffmpeg -i input -f h264 out2 (The second example needs a ffmpeg executable with x264 support.) Both output files should decode fine with FFmpeg (and out2 for example with the H264 reference decoder). Both "ac3" and "h264" are of course raw containers, but that does not make them less "actual" imo (especially given that both are defined in "actual" codec standards). Please note that I suspect the h264 format does support timestamps, FFmpeg support for these timestamps is unfortunately limited, several tickets are open. I am not sure how timestamps for encoded audio would help, afaik when decoding ac3 streams the decoding speed is defined. Carl Eugen From michael at hinespot.com Thu Jan 3 17:24:11 2013 From: michael at hinespot.com (Michael R. Hines) Date: Thu, 03 Jan 2013 11:24:11 -0500 Subject: [Libav-user] muxer ignoring my PTS audio values In-Reply-To: References: <1357007765.26810.11.camel@chopin> <1357152010.22135.7.camel@salieri> Message-ID: <1357230251.12390.3.camel@salieri> Thanks for the reply. So, then a more accurate observation is that it is not advised to split or merge multimedia content using "raw" containers - as they may or may not support timestamps properly when the media is multiplexed...... - Michael On Thu, 2013-01-03 at 16:16 +0000, Carl Eugen Hoyos wrote: > Michael R. Hines writes: > > > the problem was that I was not using a *actual* > > container to encapsulate my audio/video streams. > > For example, if you make a call like this, for example: > > avformat_alloc_output_context2(&ctx->outAudioFormatCtx, NULL, "ac3", NULL) > > or avformat_alloc_output_context2(&ctx->outAudioFormatCtx, NULL, "h264", NULL) > > Please understand that both "ac3" and "h264" are "actual" > containers in the sense that they are defined by public > standards. > You can test those containers with ffmpeg (the application): > $ ffmpeg -i input -f ac3 out1 > $ ffmpeg -i input -f h264 out2 > (The second example needs a ffmpeg executable with x264 support.) > > Both output files should decode fine with FFmpeg (and out2 for > example with the H264 reference decoder). > > Both "ac3" and "h264" are of course raw containers, but that > does not make them less "actual" imo (especially given that > both are defined in "actual" codec standards). > > Please note that I suspect the h264 format does support > timestamps, FFmpeg support for these timestamps is > unfortunately limited, several tickets are open. > > I am not sure how timestamps for encoded audio would help, > afaik when decoding ac3 streams the decoding speed is > defined. > > 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 cehoyos at ag.or.at Thu Jan 3 17:19:51 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Thu, 3 Jan 2013 16:19:51 +0000 (UTC) Subject: [Libav-user] Encoding and writing to a file with libavformat and libavcodec References: Message-ID: Shawn Van Every writes: > (gdb) bt > #0 ?0x00007fff83cab212 in __pthread_kill () > #1 ?0x00007fff8332bb34 in pthread_kill () > #2 ?0x00007fff8336fdfa in abort () > #3 ?0x00007fff83343989 in free () > #4 ?0x000000010000f6dc in av_freep (arg=0x101111628) at mem.c:185 > > #5 ?0x00007fff855ba7e1 in start () This will be easier to debug for you if you convince your compiler to also produce debug information for this source file. Carl Eugen From beyond702 at gmail.com Sat Jan 5 10:31:50 2013 From: beyond702 at gmail.com (Brian Chi) Date: Sat, 5 Jan 2013 17:31:50 +0800 Subject: [Libav-user] There is no picture in the output file while encoding with libx264 as codec. In-Reply-To: References: Message-ID: Hi, I found some informations on internet, some said that if replace the first 4 bytes as "0x00000001", it will be the Annex-B format NALU. And i tried in that way, the output mp4 file has video data, but all pictures are green, so it still not solve the problem. Do you have any hint about this? Thanks. 2012/12/27 Brian Chi > ction > "av_write_frame->mov_write_packet->ff_mov_write_packet->ff_avc_parse_nal_units->ff_avc_find_startcode" > find the start code 0x000001, how can i resolve this problem to make it > works? > The first 4 bytes in the AVPacket is the size of this NALU, should i > replace the first 4 bytes with 0x000001 or 0x000 > -- Best Regards, Chi -------------- next part -------------- An HTML attachment was scrubbed... URL: From jmorgie at yahoo.com Sat Jan 5 16:06:37 2013 From: jmorgie at yahoo.com (jim morgenstern) Date: Sat, 5 Jan 2013 10:06:37 -0500 Subject: [Libav-user] change pixel format without scaling data ? Message-ID: <030601cdeb56$42848bb0$c78da310$@yahoo.com> I am using sws_scale to change the pixel formatting but this routine is also changing the scale of the data graylevel values themselves and I do not want it to. Several questions: * is there a better routine to call to just change pixel format? * is there a way to turn off data scaling within sws_scale so that it only changes format? * which file / what module or subroutine contains the code that actually measures and rescales the gray values of an image so that i can see exactly how this is being done ? thanks Jim Morgenstern Image Mining LLC 248-252-2626 -------------- next part -------------- An HTML attachment was scrubbed... URL: From cehoyos at ag.or.at Sat Jan 5 16:26:30 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Sat, 5 Jan 2013 15:26:30 +0000 (UTC) Subject: [Libav-user] change pixel format without scaling data ? References: <030601cdeb56$42848bb0$c78da310$@yahoo.com> Message-ID: jim morgenstern writes: > I am using sws_scale to change the pixel formatting but > this routine is also changing the scale of the data > graylevel values themselves and I do not want it to. I am not sure I understand: Are you converting from GRAY8 to GRAY8A without changing the resolution but the values are changed? Generally, swscale should be used both if you want to change a frame's resolution and if you only want to change the pix_fmt. Carl Eugen From jmorgie at yahoo.com Sat Jan 5 16:55:24 2013 From: jmorgie at yahoo.com (jim morgenstern) Date: Sat, 5 Jan 2013 10:55:24 -0500 Subject: [Libav-user] change pixel format without scaling data ? // more 1 Message-ID: <032601cdeb5d$1309aee0$391d0ca0$@yahoo.com> I have 10 bit data; I am converting from say YUV422 to YUV444 or RGB etc.; swscale is useful for changing the pixel format. But I find that my 10bit data is getting scaled to 16 bit such that when I output only 10bits I have, well, wrap around etc. I am not asking ffmpeg to rescale the data automatically, I want the scale left alone. So a) is there a better way to change pixel format? B) a way to turn off gray-level scaling ?? -----Original Message----- From: libav-user-bounces at ffmpeg.org [mailto:libav-user-bounces at ffmpeg.org] On Behalf Of Carl Eugen Hoyos Sent: Saturday, January 05, 2013 10:27 AM To: libav-user at ffmpeg.org Subject: Re: [Libav-user] change pixel format without scaling data ? jim morgenstern writes: > I am using sws_scale to change the pixel formatting but this routine > is also changing the scale of the data graylevel values themselves and > I do not want it to. I am not sure I understand: Are you converting from GRAY8 to GRAY8A without changing the resolution but the values are changed? Generally, swscale should be used both if you want to change a frame's resolution and if you only want to change the pix_fmt. Carl Eugen _______________________________________________ Libav-user mailing list Libav-user at ffmpeg.org http://ffmpeg.org/mailman/listinfo/libav-user From ryltsov at gmail.com Sat Jan 5 16:59:43 2013 From: ryltsov at gmail.com (Roman Ryltsov) Date: Sat, 5 Jan 2013 17:59:43 +0200 Subject: [Libav-user] change pixel format without scaling data ? // more 1 In-Reply-To: <032601cdeb5d$1309aee0$391d0ca0$@yahoo.com> References: <032601cdeb5d$1309aee0$391d0ca0$@yahoo.com> Message-ID: It is not quite clear how it scales if you don't request it. Perhaps you could post some code, esp. your SWS context initialization arguments? Roman On Sat, Jan 5, 2013 at 5:55 PM, jim morgenstern wrote: > I have 10 bit data; I am converting from say YUV422 to YUV444 or RGB etc.; > swscale is useful for changing the pixel format. But I find that my 10bit > data is getting scaled to 16 bit such that when I output only 10bits I > have, > well, wrap around etc. I am not asking ffmpeg to rescale the data > automatically, I want the scale left alone. > > So a) is there a better way to change pixel format? B) a way to turn off > gray-level scaling ?? > > -----Original Message----- > From: libav-user-bounces at ffmpeg.org [mailto:libav-user-bounces at ffmpeg.org] > On Behalf Of Carl Eugen Hoyos > Sent: Saturday, January 05, 2013 10:27 AM > To: libav-user at ffmpeg.org > Subject: Re: [Libav-user] change pixel format without scaling data ? > > jim morgenstern writes: > > > I am using sws_scale to change the pixel formatting but this routine > > is also changing the scale of the data graylevel values themselves and > > I do not want it to. > > I am not sure I understand: > Are you converting from GRAY8 to GRAY8A without changing the resolution but > the values are changed? > > Generally, swscale should be used both if you want to change a frame's > resolution and if you only want to change the pix_fmt. > > Carl Eugen > > _______________________________________________ > 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 jmorgie at yahoo.com Sat Jan 5 17:09:42 2013 From: jmorgie at yahoo.com (jim morgenstern) Date: Sat, 5 Jan 2013 11:09:42 -0500 Subject: [Libav-user] change pixel format without scaling data ? // more 2 Message-ID: <032d01cdeb5f$12ce41a0$386ac4e0$@yahoo.com> Well, that is my problem - it is not clear how it scales or why if I don't request it!! What we used to call an 'undocumented feature' The input to the context is the input format, the input sizes, the output format and the output sizes. Gray levels, scaling, expected means etc. have no part of the context or the input. I would post my code but I am away from the workstation at the moment. But if you look at the function calls for sws_getcontext and sws_scale you will no mention of modifying gray levels. Thanks guys Jim From: libav-user-bounces at ffmpeg.org [mailto:libav-user-bounces at ffmpeg.org] On Behalf Of Roman Ryltsov Sent: Saturday, January 05, 2013 11:00 AM To: This list is about using libavcodec, libavformat, libavutil, libavdevice and libavfilter. Subject: Re: [Libav-user] change pixel format without scaling data ? // more 1 It is not quite clear how it scales if you don't request it. Perhaps you could post some code, esp. your SWS context initialization arguments? Roman On Sat, Jan 5, 2013 at 5:55 PM, jim morgenstern wrote: I have 10 bit data; I am converting from say YUV422 to YUV444 or RGB etc.; swscale is useful for changing the pixel format. But I find that my 10bit data is getting scaled to 16 bit such that when I output only 10bits I have, well, wrap around etc. I am not asking ffmpeg to rescale the data automatically, I want the scale left alone. So a) is there a better way to change pixel format? B) a way to turn off gray-level scaling ?? -----Original Message----- From: libav-user-bounces at ffmpeg.org [mailto:libav-user-bounces at ffmpeg.org] On Behalf Of Carl Eugen Hoyos Sent: Saturday, January 05, 2013 10:27 AM To: libav-user at ffmpeg.org Subject: Re: [Libav-user] change pixel format without scaling data ? jim morgenstern writes: > I am using sws_scale to change the pixel formatting but this routine > is also changing the scale of the data graylevel values themselves and > I do not want it to. I am not sure I understand: Are you converting from GRAY8 to GRAY8A without changing the resolution but the values are changed? Generally, swscale should be used both if you want to change a frame's resolution and if you only want to change the pix_fmt. Carl Eugen _______________________________________________ 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 ryltsov at gmail.com Sat Jan 5 17:14:57 2013 From: ryltsov at gmail.com (Roman Ryltsov) Date: Sat, 5 Jan 2013 18:14:57 +0200 Subject: [Libav-user] change pixel format without scaling data ? // more 2 In-Reply-To: <032d01cdeb5f$12ce41a0$386ac4e0$@yahoo.com> References: <032d01cdeb5f$12ce41a0$386ac4e0$@yahoo.com> Message-ID: Jim, Well, that is my problem ? it is not clear how it scales or why if I don?t > request it!! What we used to call an ?undocumented feature?**** > > ** ** > > The input to the context is the input format, the input sizes, the output > format and the output sizes. Gray levels, scaling, expected means etc. > have no part of the context or the input. I would post my code but I am > away from the workstation at the moment. But if you look at the function > calls for sws_getcontext and sws_scale you will no mention of modifying > gray levels.**** > > > A code snippet with your sws_* calls + values of arguments are worth many words. Post this information here and we will see what is going on. Roman -------------- next part -------------- An HTML attachment was scrubbed... URL: From jmorgie at yahoo.com Sat Jan 5 18:04:07 2013 From: jmorgie at yahoo.com (jim morgenstern) Date: Sat, 5 Jan 2013 12:04:07 -0500 Subject: [Libav-user] change pixel format without scaling data ? // more3 Message-ID: <034701cdeb66$acb8b4b0$062a1e10$@yahoo.com> Code snippet: #define RGB16 PIX_FMT_RGB48LE // little endian #define RGB PIX_FMT_BGR24 #define YUV422 PIX_FMT_YUV422P10LE #define YUV444 PIX_FMT_YUV444P16LE void Rescaler ( uint8_t* input_data, AVPicture* outp, int in_width, int in_height, PixelFormat in_pix_fmt, int out_width, int out_height, PixelFormat out_pix_fmt) { //initialize context and buffers swsContext = sws_getContext(in_width, in_height, in_pix_fmt, out_width, out_height, out_pix_fmt, SWS_BICUBIC, NULL, NULL, NULL); inp = new AVPicture; memset(inp,0,sizeof(AVPicture)); avpicture_fill(inp, input_data, in_pix_fmt, in_width, in_height); memset(outp,0,sizeof(AVPicture)); avpicture_alloc(outp, out_pix_fmt, out_width, out_height); // int rc_ht = sws_scale ( swsContext, inp->data, inp->linesize, in_width, in_height, outp->data, outp->linesize); } From: libav-user-bounces at ffmpeg.org [mailto:libav-user-bounces at ffmpeg.org] On Behalf Of Roman Ryltsov Sent: Saturday, January 05, 2013 11:15 AM To: This list is about using libavcodec, libavformat, libavutil, libavdevice and libavfilter. Subject: Re: [Libav-user] change pixel format without scaling data ? // more 2 Jim, Well, that is my problem - it is not clear how it scales or why if I don't request it!! What we used to call an 'undocumented feature' The input to the context is the input format, the input sizes, the output format and the output sizes. Gray levels, scaling, expected means etc. have no part of the context or the input. I would post my code but I am away from the workstation at the moment. But if you look at the function calls for sws_getcontext and sws_scale you will no mention of modifying gray levels. A code snippet with your sws_* calls + values of arguments are worth many words. Post this information here and we will see what is going on. Roman -------------- next part -------------- An HTML attachment was scrubbed... URL: From cehoyos at ag.or.at Sat Jan 5 18:22:58 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Sat, 5 Jan 2013 17:22:58 +0000 (UTC) Subject: [Libav-user] change pixel format without scaling data ? // more3 References: <034701cdeb66$acb8b4b0$062a1e10$@yahoo.com> Message-ID: jim morgenstern writes: > Code snippet: > #define RGB16? PIX_FMT_RGB48LE? // little endian > #define RGB??? PIX_FMT_BGR24 > #define YUV422 PIX_FMT_YUV422P10LE > #define YUV444 PIX_FMT_YUV444P16LE (That must of course make the code much more readable and significantly ease the search for a problem as the one you seem to be having...) > void Rescaler ( uint8_t* input_data, ?AVPicture* outp, > int in_width, int in_height, PixelFormat in_pix_fmt, > int out_width, int out_height, PixelFormat out_pix_fmt) So what did you pass as in_pix_fmt and out_pix_fmt ? Please do not top-post on this mailing list, it is considered rude. And please force your mailer to "text-only". Carl Eugen From jmorgie at yahoo.com Sat Jan 5 19:23:09 2013 From: jmorgie at yahoo.com (jim morgenstern) Date: Sat, 5 Jan 2013 13:23:09 -0500 Subject: [Libav-user] change pixel format without scaling data ? // more3 In-Reply-To: References: <034701cdeb66$acb8b4b0$062a1e10$@yahoo.com> Message-ID: <000001cdeb71$b777b580$26672080$@yahoo.com> Sorry -- top-posting is anew concept for me; email says plain text. I use this many ways. For one instance: Input is YUV422 Output Is RGB16 -----Original Message----- From: libav-user-bounces at ffmpeg.org [mailto:libav-user-bounces at ffmpeg.org] On Behalf Of Carl Eugen Hoyos Sent: Saturday, January 05, 2013 12:23 PM To: libav-user at ffmpeg.org Subject: Re: [Libav-user] change pixel format without scaling data ? // more3 jim morgenstern writes: > Code snippet: > #define RGB16 PIX_FMT_RGB48LE // little endian #define RGB PIX_FMT_BGR24 #define YUV422 PIX_FMT_YUV422P10LE #define YUV444 PIX_FMT_YUV444P16LE (That must of course make the code much more readable and significantly ease the search for a problem as the one you seem to be having...) > void Rescaler ( uint8_t* input_data, AVPicture* outp, int in_width, > int in_height, PixelFormat in_pix_fmt, int out_width, int out_height, > PixelFormat out_pix_fmt) So what did you pass as in_pix_fmt and out_pix_fmt ? Please do not top-post on this mailing list, it is considered rude. And please force your mailer to "text-only". Carl Eugen _______________________________________________ Libav-user mailing list Libav-user at ffmpeg.org http://ffmpeg.org/mailman/listinfo/libav-user From ryltsov at gmail.com Sat Jan 5 19:58:42 2013 From: ryltsov at gmail.com (Roman Ryltsov) Date: Sat, 5 Jan 2013 20:58:42 +0200 Subject: [Libav-user] change pixel format without scaling data ? // more3 In-Reply-To: <000001cdeb71$b777b580$26672080$@yahoo.com> References: <034701cdeb66$acb8b4b0$062a1e10$@yahoo.com> <000001cdeb71$b777b580$26672080$@yahoo.com> Message-ID: Jim, > I use this many ways. For one instance: > Input is YUV422 > Output Is RGB16 What kind of grayscale alteration do you see? YUV color space has explicit brightness component, while in RGB it is distributed between all three components. That is, converting between these you inevitably apply math to grayscale levels, though you should not get any significant difference going beyond rounding to nearest integer. Roman From jmorgie at yahoo.com Sat Jan 5 21:36:06 2013 From: jmorgie at yahoo.com (jim morgenstern) Date: Sat, 5 Jan 2013 15:36:06 -0500 Subject: [Libav-user] change pixel format without scaling data ? // more3 In-Reply-To: References: <034701cdeb66$acb8b4b0$062a1e10$@yahoo.com> <000001cdeb71$b777b580$26672080$@yahoo.com> Message-ID: <001001cdeb84$4a020830$de061890$@yahoo.com> I go YUV-RGB -YUV'. On output I see YUV' is messed up 8 bits in YUV gives 8 bits in RGB according to all the equations. I find I have to right shift 8 bits of the RGB to get proper looking images back out at YUV'. Hence sws_scale is actually doing some scaling. Even though I did not request. So how do I transform formats without invoking some scaling? Are you familiar with the modules that can point me to lines of C code in a specific file where the scaling is happening ? -----Original Message----- From: libav-user-bounces at ffmpeg.org [mailto:libav-user-bounces at ffmpeg.org] On Behalf Of Roman Ryltsov Sent: Saturday, January 05, 2013 1:59 PM To: This list is about using libavcodec, libavformat, libavutil, libavdevice and libavfilter. Subject: Re: [Libav-user] change pixel format without scaling data ? // more3 Jim, > I use this many ways. For one instance: > Input is YUV422 > Output Is RGB16 What kind of grayscale alteration do you see? YUV color space has explicit brightness component, while in RGB it is distributed between all three components. That is, converting between these you inevitably apply math to grayscale levels, though you should not get any significant difference going beyond rounding to nearest integer. Roman _______________________________________________ Libav-user mailing list Libav-user at ffmpeg.org http://ffmpeg.org/mailman/listinfo/libav-user From ryltsov at gmail.com Sat Jan 5 22:06:24 2013 From: ryltsov at gmail.com (Roman Ryltsov) Date: Sat, 5 Jan 2013 23:06:24 +0200 Subject: [Libav-user] change pixel format without scaling data ? // more3 In-Reply-To: <001001cdeb84$4a020830$de061890$@yahoo.com> References: <034701cdeb66$acb8b4b0$062a1e10$@yahoo.com> <000001cdeb71$b777b580$26672080$@yahoo.com> <001001cdeb84$4a020830$de061890$@yahoo.com> Message-ID: Jim, > I find I have to right shift 8 bits of the RGB to get proper looking images > back out at YUV'. Hence sws_scale is actually doing some scaling. Scaling is typically the term to describe transformation in resolution domain. Your "scaling" seem to be of a different kind though. If you have to scale data to make it form proper images, I would say your sws_ calls have wrong arguments. Improper calls gets you bad data, which you managed to recover by bit shifting instead of fixing the API inputs. Roman From jmorgie at yahoo.com Sat Jan 5 06:10:17 2013 From: jmorgie at yahoo.com (jim morgenstern) Date: Sat, 5 Jan 2013 00:10:17 -0500 Subject: [Libav-user] change pixel format without scaling data ? Message-ID: <02c501cdeb02$f4108e00$dc31aa00$@yahoo.com> I am using sws_scale to change the pixel formatting but this routine is also changing the scale of the data graylevel values themselves and I do not want it to. Several questions: * is there a better routine to call to just change pixel format? * is there a way to turn off data scaling within sws_scale so that it only changes format? * which file / what module or subroutine contains the code that actually measures and rescales the gray values of an image so that i can see exactly how this is being done ? thanks Jim Morgenstern Image Mining LLC 248-252-2626 -------------- next part -------------- An HTML attachment was scrubbed... URL: From i.like.privacy.too at gmail.com Sun Jan 6 10:24:03 2013 From: i.like.privacy.too at gmail.com (Camera Man) Date: Sun, 06 Jan 2013 04:24:03 -0500 Subject: [Libav-user] change pixel format without scaling data ? // more3 In-Reply-To: <034701cdeb66$acb8b4b0$062a1e10$@yahoo.com> References: <034701cdeb66$acb8b4b0$062a1e10$@yahoo.com> Message-ID: <50E942B3.2070209@gmail.com> An HTML attachment was scrubbed... URL: From 34973832 at qq.com Sun Jan 6 14:27:09 2013 From: 34973832 at qq.com (=?utf-8?B?TXIuIFhpYW8=?=) Date: Sun, 6 Jan 2013 21:27:09 +0800 Subject: [Libav-user] how does av_frame_get_best_effort_timestamp works Message-ID: An HTML attachment was scrubbed... URL: From ndato at 3way.com.ar Tue Jan 8 22:24:55 2013 From: ndato at 3way.com.ar (=?ISO-8859-1?Q?Nicol=E1s_Dato?=) Date: Tue, 8 Jan 2013 18:24:55 -0300 Subject: [Libav-user] Decoding an AAC-LATM 5.1 audio returns errors and only 1 channel with data Message-ID: Hello there, I am trying to decode an AAC-LATM file (the one that is attached) that is being transmitted inside a Transport Stream (Digital Television ISDB-T) The source that is transmitting was sending some months ago a 2 channels audio, and everything was OK. But then they changed to a 5.1 channels audio, I was using FFMPEG 0.10.5, and the decoding was OK but with some frames (like once per second) the decoder couldn't decode and returned error logging "channel element 0.2 is not allocated", I thought it was a problem with the frames, and not with the decoder Then, I tested it by upgrading to FFMPEG 1.0, everything looks the same as with 0.10.5 untill the error "channel element 0.2.." appears, after this happens the data is different, the channel 1, 2, 4, 5 and 6 are always in 0 (silence), and the channel 3 has the information (and it looks OK). Using FFMPEG 1.1 or the git repository code generates the same result as with FFMPEG 1.0 Is anyone having the same problem? Any idea? is it a problem with the .aac file or with the decoder? Can you try decoding the file attached? do you get the same problem? The file is small but doing something like: $ ffmpeg -i only_decode_3rd_channel.aac out.wav $ hexdum -C out.wav | less you can see that at first it is full of data, but after a while, a lot of zeros appear (they represents the channels 1, 2, 4, 5 and 6) Thanks for your help. -------------- next part -------------- A non-text attachment was scrubbed... Name: only_decode_3rd_channel.aac Type: application/octet-stream Size: 28000 bytes Desc: not available URL: From cehoyos at ag.or.at Tue Jan 8 23:16:51 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Tue, 8 Jan 2013 22:16:51 +0000 (UTC) Subject: [Libav-user] Decoding an AAC-LATM 5.1 audio returns errors and only 1 channel with data References: Message-ID: Nicol?s Dato writes: > Then, I tested it by upgrading to FFMPEG 1.0, everything > looks the same as with 0.10.5 untill the error "channel element > 0.2.." appears, after this happens the data is different, the > channel 1, 2, 4, 5 and 6 are always in 0 (silence), and the > channel 3 has the information (and it looks OK). Does this mean with a longer sample the beginning plays (correctly?) 5.1, after a problem it starts to be channel-3-only? Carl Eugen From ndato at 3way.com.ar Tue Jan 8 23:37:46 2013 From: ndato at 3way.com.ar (=?ISO-8859-1?Q?Nicol=E1s_Dato?=) Date: Tue, 8 Jan 2013 19:37:46 -0300 Subject: [Libav-user] Decoding an AAC-LATM 5.1 audio returns errors and only 1 channel with data In-Reply-To: References: Message-ID: > > Does this mean with a longer sample the beginning > plays (correctly?) 5.1, after a problem it starts > to be channel-3-only? > > Carl Eugen > With a longer sample the result is the same as with the attachment, it only takes less than 1 second to start decoding only the 3rd channel. I don't know if it is only decoding the 3rd channel or if the decoder is merging all the channels into the 3rd one. Reopening the avcodec context solves the problem until the 'channel 0.2....' error happens. And that error keeps logging forever 1 or 2 times per second (and avcodec_decode_audio returns error each time) I opened the output with audacity, at the very beginning there is audio in all the channels, after the ffmpeg throws that error, all the channels are in silence but one, being the PC in stereo I don't hear anything, but using audacity I can and what I listen to seems OK I also tried opening the file with vlc and it doesn't complain. -------------- next part -------------- An HTML attachment was scrubbed... URL: From cehoyos at ag.or.at Tue Jan 8 23:53:27 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Tue, 8 Jan 2013 22:53:27 +0000 (UTC) Subject: [Libav-user] Decoding an AAC-LATM 5.1 audio returns errors and only 1 channel with data References: Message-ID: Nicol?s Dato writes: > I opened the output with audacity, at the very beginning > there is audio in all the channels, after the ffmpeg throws > that error, all the channels are in silence but one I understand. Please provide a longer sample (a few seconds 5.1 if possible and at least additional 10 seconds). Thank you, Carl Eugen From ndato at 3way.com.ar Wed Jan 9 01:05:21 2013 From: ndato at 3way.com.ar (=?ISO-8859-1?Q?Nicol=E1s_Dato?=) Date: Tue, 8 Jan 2013 21:05:21 -0300 Subject: [Libav-user] Decoding an AAC-LATM 5.1 audio returns errors and only 1 channel with data In-Reply-To: References: Message-ID: > I understand. > Please provide a longer sample (a few seconds 5.1 if possible > and at least additional 10 seconds). > I tried to attach a bigger file but the list doesn't allow more than 40k, so here is a 400k (17 seconds) file: http://www.mediafire.com/?32xm5y6vo25hg2b The first 11 frames are ok, and you can hear something I have more info: Using ffmpeg 0.10 and ffprobe -show_frames I could find out that the 'channel element 0.2 is not allocated' appears every 11 frames all the time (so I cannot generate a file with more than 11 frames in 5.1) (but as I said, with 0.10 the output keeps in 5.1 after all and seems fine) Using ffmpeg 1.1, and playing with ffplay the error appears only once, and after that the channels are 'muted', but using my own implementation the error repeats forever. I downloaded FAAD and tried decoding the file, but it says: Error: Channel coupling not yet implemented I think I should also report this as a bug. The audio is from an Argentinian Digital TV transmission, which is not fully implemented here and the transmissions are changing every time, so there is a chance that the audio itself is corrupted. Thanks. From rpavle at gmail.com Wed Jan 9 15:43:10 2013 From: rpavle at gmail.com (Pavle Rackovic) Date: Wed, 9 Jan 2013 15:43:10 +0100 Subject: [Libav-user] cant find Message-ID: Hi, I need to find out codec profile of some AAC media file. (I want to know if that file iz HE-ACC or some other codec profile). I tried with source like this: AVFormatContext* pFormatCtx; avformat_open_input(pFormatCtx, input_path, NULL, NULL); .. avformat_find_stream_info((*pFormatCtx), NULL); .. /* I hope i'll get FF_PROFILE_AAC_MAIN or FF_PROFILE_AAC_LOW or FF_PROFILE_AAC_HE ... */ int wanted_profile = pFormatCtx->streams[audio_stream_index]->codec->profile; /* but I always get FF_PROFILE_UNKNOWN :( */ Can anyone help me to find out how to do it, please. -- Pozdrav, Pavle -------------- next part -------------- An HTML attachment was scrubbed... URL: From max_schmerz at gmx.net Thu Jan 10 04:44:20 2013 From: max_schmerz at gmx.net (Ronny Wegener) Date: Thu, 10 Jan 2013 04:44:20 +0100 Subject: [Libav-user] avformat_find_stream_info() causes problems in packet decoding Message-ID: Hi, i have a simple program that reads all video packets from a file, decodes them into a frame and prints the corresponding timestamps. This works fine. Output (test.avi): packet.pts=0 => frame.pts=0 packet.pts=1 => frame.pts=1 packet.pts=2 => frame.pts=2 packet.pts=3 => frame.pts=3 packet.pts=4 => frame.pts=4 packet.pts=5 => frame.pts=5 packet.pts=6 => frame.pts=6 when i use the avformat_find_stream_info() function in advance, which is reading some packets to determine information about the streams, the first packets are not decoded successfully and the following decoded frames got a "shifted" timestamp. Output (test.avi): packet.pts=0 => FRAME NOT FINISHED packet.pts=1 => FRAME NOT FINISHED packet.pts=2 => FRAME NOT FINISHED packet.pts=3 => FRAME NOT FINISHED packet.pts=4 => frame.pts=0 packet.pts=5 => frame.pts=1 packet.pts=6 => frame.pts=2 i guess the internal packet buffer is not flushed correctly after avformat_find_stream_info(). I already tried to free the packet_buffer and raw_packet_buffer in AVFormatContext, but this didn't worked. So any suggestions how to fix this without closing and re-opening the file? Code to reproduce the problem: http://pastebin.com/UzTuZBL6 Project to reproduce the problem: http://rghost.net/42877696 From xiaobo_yc at 163.com Thu Jan 10 07:12:16 2013 From: xiaobo_yc at 163.com (=?GBK?B?0KSyqA==?=) Date: Thu, 10 Jan 2013 14:12:16 +0800 (CST) Subject: [Libav-user] How to get audio stream loudness Message-ID: <3cca938f.1f50b.13c2316697b.Coremail.xiaobo_yc@163.com> hi everyone, I found the ffmpeg 1.1 recently add a loudness analysis filter. Could I get my audio stream's loudness value of the given sample data(e.g, 1 video frame time of 25ms),just use the ffmpeg's api? -------------- next part -------------- An HTML attachment was scrubbed... URL: From Christophe.LeBars at thomson-networks.com Thu Jan 10 10:56:54 2013 From: Christophe.LeBars at thomson-networks.com (Le Bars Christophe (Thales Services)) Date: Thu, 10 Jan 2013 09:56:54 +0000 Subject: [Libav-user] Issue using libavformat/libavcodec for AAC encapsulation in MP4 file Message-ID: <9CF8DF419DE55C48B1B81CE2626D37743FA3F9C6@srv0024.corp.thvnet.com> Hi, I am working on an MP4 file encapsulation module which use libavformat and libavcodec. I have some issues with AAC audio, which leads to some segfault into ffmpeg code, in some cases. I am not comfortable with AAC and MPEG specifications so I am not sure which aspects I am misunderstanding. Basicly, segfault happens because ffmpeg is trying to withdraw ADTS header of my AAC packet in ff_rtp_send_aac, before making the memcpy. I do not understand why withdraw the ADTS header here, as it seems to be done in aac_adtstoasc_bsf function that I have to call earlier in my code. Then in the case of an AAC packet size of 6 bytes (without ADTS header), it crashes because of a memcpy of size -1. This happens only in rare cases, in other cases the file is well generated and the audio track is ok. Thanks for your help. Chris. -------------- next part -------------- An HTML attachment was scrubbed... URL: From cehoyos at ag.or.at Thu Jan 10 12:07:33 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Thu, 10 Jan 2013 11:07:33 +0000 (UTC) Subject: [Libav-user] Decoding an AAC-LATM 5.1 audio returns errors and only 1 channel with data References: Message-ID: Nicol?s Dato writes: > here is a 400k (17 seconds) file: > http://www.mediafire.com/?32xm5y6vo25hg2b Thank you for the longer sample, this makes testing simpler imo. This is another sample for a regression in the aac decoder, described in ticket #1694, I attached your sample there. I had originally missed that this is a regression, thank you for pointing that out! Note that 0.10 is not working correctly because the channel is wrong, this was fixed at some point between 0.10 and 0.11. Thank you, Carl Eugen From A.Rukhlov at gmail.com Thu Jan 10 13:49:25 2013 From: A.Rukhlov at gmail.com (=?KOI8-R?B?4czFy9PBzsTSIPLVyMzP1w==?=) Date: Thu, 10 Jan 2013 16:49:25 +0400 Subject: [Libav-user] libavcodec vorbis encoding Message-ID: Hello!!! I try to deal with audio coding by means of FFmpeg made the test appendix on a basis http://ffmpeg.org/doxygen/trunk/decoding__encoding_8c_source.html Signal of 440 Hz it is coded and written to the container. AAC, MP2, AC3 works without problems. BUT categorically Vorbis doesn't want to work function avcodec_encode_audio2() works without mistakes and even something returns, but these data are damaged how it is correct to adjust AVCodecContext for Vorbis? ? ? whether there are any specific parameters of this codec static void audio_encode_example(const char *filename) { AVCodec *codec; AVCodecContext *c= NULL; AVFrame *frame; AVPacket pkt; int i, j, k, ret, got_output; int buffer_size; FILE *f; uint16_t *samples; float t, tincr; printf("Encode audio file %s\n", filename); //codec = avcodec_find_encoder(AV_CODEC_ID_MP2); codec = avcodec_find_encoder(AV_CODEC_ID_VORBIS); //codec = avcodec_find_encoder(AV_CODEC_ID_AAC); //codec = avcodec_find_encoder(AV_CODEC_ID_AC3); if (!codec) { fprintf(stderr, "Codec not found\n"); exit(1); } c = avcodec_alloc_context3(codec); c->bit_rate = 64000; c->sample_fmt = AV_SAMPLE_FMT_FLTP; c->sample_rate = 44100; //select_sample_rate(codec); c->channel_layout = select_channel_layout(codec); c->channels = av_get_channel_layout_nb_channels(c->channel_layout); /* open it */ if (avcodec_open2(c, codec, NULL) < 0) { fprintf(stderr, "Could not open codec\n"); exit(1); } f = fopen(filename, "wb"); if (!f) { fprintf(stderr, "Could not open %s\n", filename); exit(1); } frame = avcodec_alloc_frame(); if (!frame) { fprintf(stderr, "Could not allocate audio frame\n"); exit(1); } frame->nb_samples = c->frame_size; frame->format = c->sample_fmt; frame->channel_layout = c->channel_layout; buffer_size = av_samples_get_buffer_size(NULL, c->channels, c->frame_size, c->sample_fmt, 0); samples = (uint16_t*)av_malloc(buffer_size); if (!samples) { fprintf(stderr, "Could not allocate %d bytes for samples buffer\n", buffer_size); exit(1); } ret = avcodec_fill_audio_frame(frame, c->channels, c->sample_fmt, (const uint8_t*)samples, buffer_size, 0); if (ret < 0) { fprintf(stderr, "Could not setup audio frame\n"); exit(1); } t = 0; tincr = 2 * M_PI * 440.0 / c->sample_rate; for(i=0;i<200;i++) { av_init_packet(&pkt); pkt.data = NULL; pkt.size = 0; for (j = 0; j < c->frame_size; j++) { samples[2*j] = (int)(sin(t) * 10000); for (k = 1; k < c->channels; k++) samples[2*j + k] = samples[2*j]; t += tincr; } ret = avcodec_encode_audio2(c, &pkt, frame, &got_output); if (ret < 0) { fprintf(stderr, "Error encoding audio frame\n"); exit(1); } if (got_output) { fwrite(pkt.data, 1, pkt.size, f); av_free_packet(&pkt); } } for (got_output = 1; got_output; i++) { ret = avcodec_encode_audio2(c, &pkt, NULL, &got_output); if (ret < 0) { fprintf(stderr, "Error encoding frame\n"); exit(1); } if (got_output) { fwrite(pkt.data, 1, pkt.size, f); av_free_packet(&pkt); } } fclose(f); av_freep(&samples); av_freep(&frame); avcodec_close(c); av_free(c); } int main(int argc, char **argv) { avcodec_register_all(); audio_encode_example("test.ogg"); printf("Encoding is completed...\n"); getch(); return 0; } -------------- next part -------------- An HTML attachment was scrubbed... URL: From cehoyos at ag.or.at Thu Jan 10 13:57:27 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Thu, 10 Jan 2013 12:57:27 +0000 (UTC) Subject: [Libav-user] libavcodec vorbis encoding References: Message-ID: ????????? ?????? writes: > Signal of 440 Hz it is coded and written to the container. > AAC, MP2, AC3 works without problems.BUT categorically > Vorbis doesn't want to workfunction avcodec_encode_audio2() > works without mistakes and even something returns, but > these data are damaged Is it possible that you are trying to write a raw vorbis file (as opposed to muxing vorbis in a container format)? I don't think raw vorbis is defined. (And generally, you should never "fwrite()" what the encoder returns, but feed a muxer, this can be the adts, mp2 or ac3 muxer if you want raw files.) Carl Eugen From ndato at 3way.com.ar Thu Jan 10 15:09:23 2013 From: ndato at 3way.com.ar (=?ISO-8859-1?Q?Nicol=E1s_Dato?=) Date: Thu, 10 Jan 2013 11:09:23 -0300 Subject: [Libav-user] Decoding an AAC-LATM 5.1 audio returns errors and only 1 channel with data In-Reply-To: References: Message-ID: Thank you for your help :) I'll follow the bug From gohar_h at instigatemobile.com Thu Jan 10 16:04:07 2013 From: gohar_h at instigatemobile.com (Gohar Hovhannisyan) Date: Thu, 10 Jan 2013 19:04:07 +0400 Subject: [Libav-user] Convert mkv to mp4 programmatically Message-ID: <50EED867.1000705@instigatemobile.com> Hi Dear Team, I've high definition mkv file and would like to convert it to smaller resolution mp4 file. I know how to do it in command line (ffmpeg -i hd-movie.mkv -c:v libx264 -s:v 854x480 -c:a copy out.mp4) and would like to do it programmatically within iOS app. Could you please assist me how I can do it (which headers I need, the functions, etc.)? |Regards, Gohar| || -------------- next part -------------- An HTML attachment was scrubbed... URL: From A.Rukhlov at gmail.com Thu Jan 10 16:37:05 2013 From: A.Rukhlov at gmail.com (=?KOI8-R?B?4czFy9PBzsTSIPLVyMzP1w==?=) Date: Thu, 10 Jan 2013 19:37:05 +0400 Subject: [Libav-user] libavcodec vorbis encoding In-Reply-To: References: Message-ID: Thanks for the help I tried to write in normal way to the container FLAC to Ogg, MP2 to Wav - works without problems, Vorbis to Ogg - writes garbage in the container the distorted data are located https://dl.dropbox.com/u/2114502/flac.ogg https://dl.dropbox.com/u/2114502/vorbis.ogg maybe this codec has any specific parameters ??? static void audio_encode_example(const char *filename) { AVFormatContext* out_format_context; AVStream * audio_stream ; AVCodec *codec; AVCodecContext *c= NULL; AVFrame *frame; AVPacket pkt; int i, j, k, ret, got_output; int buffer_size; FILE *f; uint16_t *samples; float t, tincr; printf("Encode audio file %s\n", filename); out_format_context = avformat_alloc_context(); out_format_context->oformat = av_guess_format(NULL, filename, NULL); if (out_format_context->oformat == NULL){ fprintf(stderr, "Could not guess output format\n"); exit(1); } audio_stream = av_new_stream(out_format_context, 0); if (!audio_stream) { fprintf(stderr, "Could not alloc audio stream!"); exit(1); } /* find encoder */ //codec = avcodec_find_encoder(AV_CODEC_ID_MP2); codec = avcodec_find_encoder(AV_CODEC_ID_VORBIS); //codec = avcodec_find_encoder(AV_CODEC_ID_FLAC); if (!codec) { fprintf(stderr, "Codec not found\n"); exit(1); } //c = avcodec_alloc_context3(codec); c=audio_stream->codec; c->bit_rate = 64000; c->sample_fmt = *codec->sample_fmts; c->sample_rate = select_sample_rate(codec); c->channel_layout = select_channel_layout(codec); c->channels = av_get_channel_layout_nb_channels(c->channel_layout); if(out_format_context->oformat->flags & AVFMT_GLOBALHEADER) c->flags |= CODEC_FLAG_GLOBAL_HEADER; /* open it */ if (avcodec_open2(c, codec, NULL) < 0) { fprintf(stderr, "Could not open codec\n"); exit(1); } if(avio_open(&out_format_context->pb, filename, AVIO_FLAG_WRITE)<0){ fprintf(stderr, "Error occurred when opening output file"); exit(1); } if (avformat_write_header(out_format_context, NULL) < 0) { fprintf(stderr, "Error occurred when opening output file"); exit(1); } frame = avcodec_alloc_frame(); if (!frame) { fprintf(stderr, "Could not allocate audio frame\n"); exit(1); } frame->nb_samples = c->frame_size; frame->format = c->sample_fmt; frame->channel_layout = c->channel_layout; buffer_size = av_samples_get_buffer_size(NULL, c->channels, c->frame_size, c->sample_fmt, 0); samples = (uint16_t*)av_malloc(buffer_size); if (!samples) { fprintf(stderr, "Could not allocate %d bytes for samples buffer\n", buffer_size); exit(1); } ret = avcodec_fill_audio_frame(frame, c->channels, c->sample_fmt, (const uint8_t*)samples, buffer_size, 0); if (ret < 0) { fprintf(stderr, "Could not setup audio frame\n"); exit(1); } t = 0; tincr = 2 * M_PI * 440.0 / c->sample_rate; for(i=0;i<200;i++) { av_init_packet(&pkt); pkt.data = NULL; pkt.size = 0; for (j = 0; j < c->frame_size; j++) { samples[2*j] = (int)(sin(t) * 10000); for (k = 1; k < c->channels; k++) samples[2*j + k] = samples[2*j]; t += tincr; } ret = avcodec_encode_audio2(c, &pkt, frame, &got_output); if (ret < 0) { fprintf(stderr, "Error encoding audio frame\n"); exit(1); } if (got_output) { pkt.pts=pkt.dts=AV_NOPTS_VALUE; //pkt.pts=pkt.dts=time; int ret = av_interleaved_write_frame(out_format_context, &pkt); if (ret < 0) { fprintf(stderr,"Error while write audio"); } //fwrite(pkt.data, 1, pkt.size, f); av_free_packet(&pkt); } } for (got_output = 1; got_output; i++) { ret = avcodec_encode_audio2(c, &pkt, NULL, &got_output); if (ret < 0) { fprintf(stderr, "Error encoding frame\n"); exit(1); } if (got_output) { pkt.pts=pkt.dts=AV_NOPTS_VALUE; int ret = av_interleaved_write_frame(out_format_context, &pkt); if (ret < 0) { fprintf(stderr,"Error while write audio"); } //fwrite(pkt.data, 1, pkt.size, f); av_free_packet(&pkt); } } av_write_trailer(out_format_context); avio_close(out_format_context->pb); av_freep(&samples); av_freep(&frame); avcodec_close(c); av_free(c); } int main(int argc, char **argv) { //avcodec_register_all(); av_register_all(); //audio_encode_example("test.wav"); audio_encode_example("test.ogg"); printf("Encoding is completed...\n"); getch(); return 0; } 2013/1/10 Carl Eugen Hoyos > ????????? ?????? writes: > > > Signal of 440 Hz it is coded and written to the container. > > AAC, MP2, AC3 works without problems.BUT categorically > > Vorbis doesn't want to workfunction avcodec_encode_audio2() > > works without mistakes and even something returns, but > > these data are damaged > > Is it possible that you are trying to write > a raw vorbis file (as opposed to muxing > vorbis in a container format)? > I don't think raw vorbis is defined. > (And generally, you should never "fwrite()" > what the encoder returns, but feed a muxer, > this can be the adts, mp2 or ac3 muxer if > you want raw files.) > > 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 david.longest at apx-labs.com Thu Jan 10 22:49:37 2013 From: david.longest at apx-labs.com (David Longest) Date: Thu, 10 Jan 2013 21:49:37 +0000 Subject: [Libav-user] Encoding H263+ video Message-ID: Hello! I am attempting to encode raw video from a camera to H263+ using the "decoding_encoding.c" file as an example. My code requires one more step since the camera provides an image in the NV21 format. While the conversion seems to work fine, I seem to get a crash (sigsegv) when encoding the output from the conversion. After investigating a bit, I have found that I will sometimes get a message stating "Provided packet is too small, needs to be ****" before it crashes. I tried allocating the AVPacket's data myself and it seems to stop crashing, but I get macro block corruption in the video I try to play back. >From looking at the example, it seems that libavcodec should be allocating the packet's data depending on how much memory it needs. Does anybody know why it would crash if I don't allocate memory for it? Thanks, David -------------- next part -------------- An HTML attachment was scrubbed... URL: From sangitachowdhary at gmail.com Fri Jan 11 10:40:01 2013 From: sangitachowdhary at gmail.com (sangeeta chowdhary) Date: Fri, 11 Jan 2013 15:10:01 +0530 Subject: [Libav-user] (no subject) Message-ID: Hi Team, I am Software Engineer, working on video adaption. I want to change video bit-rate, frame rate, resolution of the video according to the mobile handset used by the user, using C. I have tried to execute few examples like metadat.c( http://ffmpeg.org/doxygen/trunk/doc_2examples_2metadata_8c-example.html) but I am not able to compile. Can you help me by giving one simple example related to video adaption, described above, and way to compile and execute it in C on RHEL 6. I have installed ffmpef-1.0. It would be great help. Looking forward for your response. Regards, Sangeeta -------------- next part -------------- An HTML attachment was scrubbed... URL: From sangitachowdhary at gmail.com Fri Jan 11 10:44:48 2013 From: sangitachowdhary at gmail.com (sangeeta chowdhary) Date: Fri, 11 Jan 2013 15:14:48 +0530 Subject: [Libav-user] (no subject) In-Reply-To: References: Message-ID: Hi Team, I am Software Engineer, working on video adaption. I want to change video bit-rate, frame rate, resolution of the video according to the mobile handset used by the user, using C. I have tried to execute few examples like metadat.c( http://ffmpeg.org/doxygen/trunk/doc_2examples_2metadata_8c-example.html) but I am not able to compile. Can you help me by giving one simple example related to video adaption, described above, and way to compile and execute it in C on RHEL 6. I have installed ffmpef-1.0. It would be great help. Looking forward for your response. Regards, Sangeeta -------------- next part -------------- An HTML attachment was scrubbed... URL: From cehoyos at ag.or.at Fri Jan 11 11:29:12 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Fri, 11 Jan 2013 10:29:12 +0000 (UTC) Subject: [Libav-user] (no subject) References: Message-ID: sangeeta chowdhary writes: > I have tried to execute few examples like metadat.c > (http://ffmpeg.org/doxygen/trunk/doc_2examples_2metadata_8c-example.html) > but I am not able to compile. I fear that "not able to compile" is not enough information for anybody who wants to help you. > I have installed ffmpef-1.0 This is not the latest, if you are a user (and not a distributor), current git head is always recommended. Carl Eugen From sangitachowdhary at gmail.com Fri Jan 11 12:07:30 2013 From: sangitachowdhary at gmail.com (sangeeta chowdhary) Date: Fri, 11 Jan 2013 16:37:30 +0530 Subject: [Libav-user] (no subject) In-Reply-To: References: Message-ID: Hi Carl, I am installing ffmpeg using ffmpeginstall.3.2.1.tar.gz, but I am getting error - Installation of MPlayer-1.0rc1.tar.bz2 ....... Completed Mplayer installation Failed :( , please visit the forum Please help me for the same. Regards, Sangeeta On Fri, Jan 11, 2013 at 3:59 PM, Carl Eugen Hoyos wrote: > sangeeta chowdhary writes: > > > I have tried to execute few examples like metadat.c > > (http://ffmpeg.org/doxygen/trunk/doc_2examples_2metadata_8c-example.html > ) > > but I am not able to compile. > > I fear that "not able to compile" is not enough > information for anybody who wants to help you. > > > I have installed ffmpef-1.0 > > This is not the latest, if you are a user (and > not a distributor), current git head is always > recommended. > > 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 sangitachowdhary at gmail.com Fri Jan 11 12:07:38 2013 From: sangitachowdhary at gmail.com (sangeeta chowdhary) Date: Fri, 11 Jan 2013 16:37:38 +0530 Subject: [Libav-user] This, sangeeta chowdhary has invited you to open a Gmail account Message-ID: I've been using Gmail and thought you might like to try it out. Here's an invitation to create an account. You're Invited to Gmail! sangeeta chowdhary has invited you to open a Gmail account. Gmail is Google's free email service, built on the idea that email can be intuitive, efficient, and fun. Gmail has: *Less spam* Keep unwanted messages out of your inbox with Google's innovative technology. *Lots of space* Enough storage so that you'll never have to delete another message. *Built-in chat* Text or video chat with sangeeta chowdhary and other friends in real time. *Mobile access* Get your email anywhere with Gmail on your mobile phone. You can even import your contacts and email from Yahoo!, Hotmail, AOL, or any other web mail or POP accounts. Once you create your account, sangeeta chowdhary will be notified of your new Gmail address so you can stay in touch. Learn moreor get started ! Sign up Google Inc. | 1600 Ampitheatre Parkway | Mountain View, California 94043 -------------- next part -------------- An HTML attachment was scrubbed... URL: From sangitachowdhary at gmail.com Fri Jan 11 12:08:55 2013 From: sangitachowdhary at gmail.com (sangeeta chowdhary) Date: Fri, 11 Jan 2013 16:38:55 +0530 Subject: [Libav-user] (no subject) In-Reply-To: References: Message-ID: cp: cannot create regular file `/usr/local/cpffmpeg/etc/mplayer/codecs.conf': No such file or directory Installation of MPlayer-1.0rc1.tar.bz2 ....... Completed Mplayer installation Failed :( , please visit the forum This is the error. On Fri, Jan 11, 2013 at 4:37 PM, sangeeta chowdhary < sangitachowdhary at gmail.com> wrote: > Hi Carl, > > I am installing ffmpeg using ffmpeginstall.3.2.1.tar.gz, but I am getting > error - > > Installation of MPlayer-1.0rc1.tar.bz2 ....... Completed > > > Mplayer installation Failed :( , please visit the forum > > Please help me for the same. > > Regards, > Sangeeta > > > On Fri, Jan 11, 2013 at 3:59 PM, Carl Eugen Hoyos wrote: > >> sangeeta chowdhary writes: >> >> > I have tried to execute few examples like metadat.c >> > ( >> http://ffmpeg.org/doxygen/trunk/doc_2examples_2metadata_8c-example.html) >> > but I am not able to compile. >> >> I fear that "not able to compile" is not enough >> information for anybody who wants to help you. >> >> > I have installed ffmpef-1.0 >> >> This is not the latest, if you are a user (and >> not a distributor), current git head is always >> recommended. >> >> 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 nitinkumgoyal at gmail.com Fri Jan 11 12:20:59 2013 From: nitinkumgoyal at gmail.com (NITIN GOYAL) Date: Fri, 11 Jan 2013 16:50:59 +0530 Subject: [Libav-user] (no subject) In-Reply-To: References: Message-ID: I think the error you are mentioning is related to installation and not at all related to the compilation as you have mentioned in your first mail. Please check why the installation got failed. May be you can check the content of config.log and try to see. BTW, there are many other ways to install ffmpeg and mplayer. You can try out http://www.ffmpeginstaller.com/download/ and use tar file and the script to install. Regards Nitin On Fri, Jan 11, 2013 at 4:38 PM, sangeeta chowdhary wrote: > cp: cannot create regular file > `/usr/local/cpffmpeg/etc/mplayer/codecs.conf': No such file or directory > > Installation of MPlayer-1.0rc1.tar.bz2 ....... Completed > > > Mplayer installation Failed :( , please visit the forum > > > This is the error. > > > > On Fri, Jan 11, 2013 at 4:37 PM, sangeeta chowdhary > wrote: >> >> Hi Carl, >> >> I am installing ffmpeg using ffmpeginstall.3.2.1.tar.gz, but I am getting >> error - >> >> Installation of MPlayer-1.0rc1.tar.bz2 ....... Completed >> >> >> Mplayer installation Failed :( , please visit the forum >> >> Please help me for the same. >> >> Regards, >> Sangeeta >> >> >> On Fri, Jan 11, 2013 at 3:59 PM, Carl Eugen Hoyos >> wrote: >>> >>> sangeeta chowdhary writes: >>> >>> > I have tried to execute few examples like metadat.c >>> > >>> > (http://ffmpeg.org/doxygen/trunk/doc_2examples_2metadata_8c-example.html) >>> > but I am not able to compile. >>> >>> I fear that "not able to compile" is not enough >>> information for anybody who wants to help you. >>> >>> > I have installed ffmpef-1.0 >>> >>> This is not the latest, if you are a user (and >>> not a distributor), current git head is always >>> recommended. >>> >>> Carl Eugen >>> >>> _______________________________________________ >>> 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 sangitachowdhary at gmail.com Fri Jan 11 12:59:29 2013 From: sangitachowdhary at gmail.com (sangeeta chowdhary) Date: Fri, 11 Jan 2013 17:29:29 +0530 Subject: [Libav-user] (no subject) In-Reply-To: References: Message-ID: Hi Nitin, I have taken latest ffmpeg installer from http://ffmpeginstaller.com/download. Still I am getting error while installation. I didn't get config.log. This is the error - Removing old source Cloning into ffmpeg... ERROR: libfaac not found If you think configure made a mistake, make sure you are using the latest version from Git. If the latest version fails, report the problem to the ffmpeg-user at ffmpeg.org mailing list or IRC #ffmpeg on irc.freenode.net. Include the log file "config.log" produced by configure as this will help solving the problem. ^[[01;31mInstallation of FFMPEG ....... Completed^[[0m ^[[01;31m FFMPEG installation Failed :( , please visit the forum^[[0m Please help me for the same. On Fri, Jan 11, 2013 at 4:50 PM, NITIN GOYAL wrote: > log -------------- next part -------------- An HTML attachment was scrubbed... URL: From nitinkumgoyal at gmail.com Fri Jan 11 14:27:52 2013 From: nitinkumgoyal at gmail.com (NITIN GOYAL) Date: Fri, 11 Jan 2013 18:57:52 +0530 Subject: [Libav-user] (no subject) In-Reply-To: References: Message-ID: Have u installed faac? may be u can try to install libfaac or just remove '--enable-libfaac' from ur configure list. It may fix this issue. > > I have taken latest ffmpeg installer from > http://ffmpeginstaller.com/download. Still I am getting error while > installation. > I didn't get config.log. > > This is the error - > > Removing old source > Cloning into ffmpeg... > ERROR: libfaac not found > > If you think configure made a mistake, make sure you are using the latest > version from Git. If the latest version fails, report the problem to the > ffmpeg-user at ffmpeg.org mailing list or IRC #ffmpeg on irc.freenode.net. > Include the log file "config.log" produced by configure as this will help > solving the problem. > ^[[01;31mInstallation of FFMPEG ....... Completed^[[0m > > > ^[[01;31m FFMPEG installation Failed :( , please visit the forum^[[0m > > > > Please help me for the same. > > On Fri, Jan 11, 2013 at 4:50 PM, NITIN GOYAL > wrote: >> >> log > > > > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > From ndato at 3way.com.ar Fri Jan 11 16:43:47 2013 From: ndato at 3way.com.ar (=?ISO-8859-1?Q?Nicol=E1s_Dato?=) Date: Fri, 11 Jan 2013 12:43:47 -0300 Subject: [Libav-user] Decoding an AAC-LATM 5.1 audio returns errors and only 1 channel with data In-Reply-To: References: Message-ID: I was re reading the emails 2013/1/10 Carl Eugen Hoyos : > Note that 0.10 is not working correctly because > the channel is wrong, this was fixed at some > point between 0.10 and 0.11. Does it mean the .aac is wrong? is the source transmitting a corrupted/wrong aac-latm audio? Which channel is wrong? Thanks From cehoyos at ag.or.at Fri Jan 11 17:16:14 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Fri, 11 Jan 2013 16:16:14 +0000 (UTC) Subject: [Libav-user] Decoding an AAC-LATM 5.1 audio returns errors and only 1 channel with data References: Message-ID: Nicol?s Dato writes: > 2013/1/10 Carl Eugen Hoyos : > > Note that 0.10 is not working correctly because > > the channel is wrong, this was fixed at some > > point between 0.10 and 0.11. > > Does it mean the .aac is wrong? No, it means there was a bug in 0.10 (the 5.1 aac decoder produced output files with an incorrect channel order, at least for your sample) that was fixed later - it was fixed before 1232723, the version when your sample stopped to decoded correctly. (I don't know if the sample you uploaded is corrupt or not, difficult to say without a certified hardware decoder). Carl Eugen From wbsecg1 at gmail.com Fri Jan 11 19:01:12 2013 From: wbsecg1 at gmail.com (wb) Date: Sat, 12 Jan 2013 02:01:12 +0800 Subject: [Libav-user] g++ 4.7.2 fails to compile av_err2str Message-ID: <6537E256-5645-4E55-BE14-617A721B94FA@gmail.com> g++ 4.7.2 fails to compile av_err2str I use av_err2str in a c++ file, g++ 4.7.2 can not compile it. The error message is "taking address of temporary array". g++ 4.7.0 is ok -------------- next part -------------- An HTML attachment was scrubbed... URL: From cehoyos at ag.or.at Sat Jan 12 02:16:08 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Sat, 12 Jan 2013 01:16:08 +0000 (UTC) Subject: [Libav-user] =?utf-8?q?g++_4=2E7=2E2_fails_to_compile_av=5Ferr2st?= =?utf-8?q?r?= References: <6537E256-5645-4E55-BE14-617A721B94FA@gmail.com> Message-ID: wb writes: > g++ 4.7.2 fails to compile av_err2strI use av_err2str > in a c++ file, g++ 4.7.2 can not compile it. The error > message is "taking address of temporary array". Please provide a minimal test-case. Carl Eugen From alexcohn at netvision.net.il Sun Jan 13 14:44:15 2013 From: alexcohn at netvision.net.il (Alex Cohn) Date: Sun, 13 Jan 2013 15:44:15 +0200 Subject: [Libav-user] Encoding H263+ video In-Reply-To: References: Message-ID: On Thu, Jan 10, 2013 at 11:49 PM, David Longest wrote: > Hello! > > I am attempting to encode raw video from a camera to H263+ using the > ?decoding_encoding.c? file as an example. My code requires one more step > since the camera provides an image in the NV21 format. > > While the conversion seems to work fine, I seem to get a crash (sigsegv) > when encoding the output from the conversion. After investigating a bit, I > have found that I will sometimes get a message stating ?Provided packet is > too small, needs to be ****? before it crashes. I tried allocating the > AVPacket?s data myself and it seems to stop crashing, but I get macro block > corruption in the video I try to play back. > > From looking at the example, it seems that libavcodec should be allocating > the packet?s data depending on how much memory it needs. Does anybody know > why it would crash if I don?t allocate memory for it? > > Thanks, > > David Note that in terms of allocations and encoder logic, you can use nv21 input instead of yuv420p. The resulting video will be crap, but the encoder should not crash/fail, and you can expect to receive a movie file as output. You can even extract nv21 frames from this movie: ffmpeg -i video.h263v2 -pix_fmt yuv420p -vframes 1 foo-1.yuv You can even use ffplay to see the resulting frame: ffplay -pixel_format nv21 -video_size WxH foo-1.yuv So, please check if your problem is reproduced without the "extra step" of nv21 to yuv420p conversion. BR, Alex From sangitachowdhary at gmail.com Mon Jan 14 08:27:12 2013 From: sangitachowdhary at gmail.com (sangeeta chowdhary) Date: Mon, 14 Jan 2013 12:57:12 +0530 Subject: [Libav-user] (no subject) In-Reply-To: References: Message-ID: Hi Nitin, ffmpeg is installed successfully. Now I am trying to compile one simple program like [root at node2 ffmpeginstaller.7.4]# gcc -I/usr/src/ffmpegscript/ffmpeg/ test.c /tmp/ccjXEhvl.o: In function `main': test.c:(.text+0x10): undefined reference to `av_register_all' collect2: ld returned 1 exit status I am getting above error. Can you please help me. Thanks, Regards, Sangeeta On Fri, Jan 11, 2013 at 6:57 PM, NITIN GOYAL wrote: > Have u installed faac? > > may be u can try to install libfaac or just remove '--enable-libfaac' > from ur configure list. It may fix this issue. > > > > I have taken latest ffmpeg installer from > > http://ffmpeginstaller.com/download. Still I am getting error while > > installation. > > I didn't get config.log. > > > > This is the error - > > > > Removing old source > > Cloning into ffmpeg... > > ERROR: libfaac not found > > > > If you think configure made a mistake, make sure you are using the latest > > version from Git. If the latest version fails, report the problem to the > > ffmpeg-user at ffmpeg.org mailing list or IRC #ffmpeg on irc.freenode.net. > > Include the log file "config.log" produced by configure as this will help > > solving the problem. > > ^[[01;31mInstallation of FFMPEG ....... Completed^[[0m > > > > > > ^[[01;31m FFMPEG installation Failed :( , please visit the forum^[[0m > > > > > > > > Please help me for the same. > > > > On Fri, Jan 11, 2013 at 4:50 PM, NITIN GOYAL > > wrote: > >> > >> log > > > > > > > > > > _______________________________________________ > > 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 miscab at gmail.com Mon Jan 14 08:52:48 2013 From: miscab at gmail.com (=?gb2312?B?zuLBosP3IEpveSBXb28=?=) Date: Mon, 14 Jan 2013 15:52:48 +0800 Subject: [Libav-user] =?gb2312?b?tPC4tDogIChubyBzdWJqZWN0KQ==?= In-Reply-To: References: Message-ID: <002701cdf22c$2bab6cb0$83024610$@gmail.com> You need add the option of ?-l avformat? to gcc Joy Woo ???: libav-user-bounces at ffmpeg.org [mailto:libav-user-bounces at ffmpeg.org] ?? sangeeta chowdhary ????: 2013?1?14? 15:27 ???: This list is about using libavcodec, libavformat, libavutil, libavdevice and libavfilter. ??: Re: [Libav-user] (no subject) Hi Nitin, ffmpeg is installed successfully. Now I am trying to compile one simple program like [root at node2 ffmpeginstaller.7.4]# gcc -I/usr/src/ffmpegscript/ffmpeg/ test.c /tmp/ccjXEhvl.o: In function `main': test.c:(.text+0x10): undefined reference to `av_register_all' collect2: ld returned 1 exit status I am getting above error. Can you please help me. Thanks, Regards, Sangeeta On Fri, Jan 11, 2013 at 6:57 PM, NITIN GOYAL > wrote: Have u installed faac? may be u can try to install libfaac or just remove '--enable-libfaac' from ur configure list. It may fix this issue. > > I have taken latest ffmpeg installer from > http://ffmpeginstaller.com/download. Still I am getting error while > installation. > I didn't get config.log. > > This is the error - > > Removing old source > Cloning into ffmpeg... > ERROR: libfaac not found > > If you think configure made a mistake, make sure you are using the latest > version from Git. If the latest version fails, report the problem to the > ffmpeg-user at ffmpeg.org mailing list or IRC #ffmpeg on irc.freenode.net . > Include the log file "config.log" produced by configure as this will help > solving the problem. > ^[[01;31mInstallation of FFMPEG ....... Completed^[[0m > > > ^[[01;31m FFMPEG installation Failed :( , please visit the forum^[[0m > > > > Please help me for the same. > > On Fri, Jan 11, 2013 at 4:50 PM, NITIN GOYAL > > wrote: >> >> log > > > > > _______________________________________________ > 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 sangitachowdhary at gmail.com Mon Jan 14 08:59:34 2013 From: sangitachowdhary at gmail.com (sangeeta chowdhary) Date: Mon, 14 Jan 2013 13:29:34 +0530 Subject: [Libav-user] =?gb2312?b?tPC4tDogKG5vIHN1YmplY3Qp?= In-Reply-To: <002701cdf22c$2bab6cb0$83024610$@gmail.com> References: <002701cdf22c$2bab6cb0$83024610$@gmail.com> Message-ID: I am still getting error [root at node2 ffmpeginstaller.7.4]# gcc -I/usr/src/ffmpegscript/ffmpeg/ test.c -L/usr/src/ffmpegscript/ffmpeg/libavformat /tmp/ccWFuvbj.o: In function `main': test.c:(.text+0x10): undefined reference to `av_register_all' collect2: ld returned 1 exit status [root at node2 ffmpeginstaller.7.4]# gcc -I/usr/src/ffmpegscript/ffmpeg/ test.c -L/usr/src/ffmpegscript/ffmpeg/ -lavformat /usr/bin/ld: cannot find -lavformat collect2: ld returned 1 exit status [root at node2 ffmpeginstaller.7.4]# can you add me to your gtalk at sangitachowdhary at gmail.com On Mon, Jan 14, 2013 at 1:22 PM, ??? Joy Woo wrote: > -l avformat -------------- next part -------------- An HTML attachment was scrubbed... URL: From miscab at gmail.com Mon Jan 14 09:04:46 2013 From: miscab at gmail.com (=?gb2312?B?zuLBosP3IEpveSBXb28=?=) Date: Mon, 14 Jan 2013 16:04:46 +0800 Subject: [Libav-user] =?gb2312?b?tPC4tDogILTwuLQ6IChubyBzdWJqZWN0KQ==?= In-Reply-To: References: <002701cdf22c$2bab6cb0$83024610$@gmail.com> Message-ID: <003301cdf22d$d8a255e0$89e701a0$@gmail.com> gcc -I/usr/src/ffmpegscript/ffmpeg/ test.c -L/usr/src/ffmpegscript/ffmpeg/ -l avformat ???: libav-user-bounces at ffmpeg.org [mailto:libav-user-bounces at ffmpeg.org] ?? sangeeta chowdhary ????: 2013?1?14? 16:00 ???: This list is about using libavcodec, libavformat, libavutil, libavdevice and libavfilter. ??: Re: [Libav-user] ??: (no subject) I am still getting error [root at node2 ffmpeginstaller.7.4]# gcc -I/usr/src/ffmpegscript/ffmpeg/ test.c -L/usr/src/ffmpegscript/ffmpeg/libavformat /tmp/ccWFuvbj.o: In function `main': test.c:(.text+0x10): undefined reference to `av_register_all' collect2: ld returned 1 exit status [root at node2 ffmpeginstaller.7.4]# gcc -I/usr/src/ffmpegscript/ffmpeg/ test.c -L/usr/src/ffmpegscript/ffmpeg/ -lavformat /usr/bin/ld: cannot find -lavformat collect2: ld returned 1 exit status [root at node2 ffmpeginstaller.7.4]# can you add me to your gtalk at sangitachowdhary at gmail.com On Mon, Jan 14, 2013 at 1:22 PM, ??? Joy Woo > wrote: -l avformat -------------- next part -------------- An HTML attachment was scrubbed... URL: From sangitachowdhary at gmail.com Mon Jan 14 09:06:48 2013 From: sangitachowdhary at gmail.com (sangeeta chowdhary) Date: Mon, 14 Jan 2013 13:36:48 +0530 Subject: [Libav-user] =?gb2312?b?tPC4tDogtPC4tDogKG5vIHN1YmplY3Qp?= In-Reply-To: <003301cdf22d$d8a255e0$89e701a0$@gmail.com> References: <002701cdf22c$2bab6cb0$83024610$@gmail.com> <003301cdf22d$d8a255e0$89e701a0$@gmail.com> Message-ID: [root at node2 ffmpeginstaller.7.4]# gcc -I/usr/src/ffmpegscript/ffmpeg/ test.c -L/usr/src/ffmpegscript/ffmpeg/ -l avformat /usr/bin/ld: cannot find -lavformat collect2: ld returned 1 exit status On Mon, Jan 14, 2013 at 1:34 PM, ??? Joy Woo wrote: > gcc -I/usr/src/ffmpegscript/ffmpeg/ test.c -L/usr/src/ffmpegscript/ffmpeg/ > -l avformat -------------- next part -------------- An HTML attachment was scrubbed... URL: From sangitachowdhary at gmail.com Mon Jan 14 09:45:04 2013 From: sangitachowdhary at gmail.com (sangeeta chowdhary) Date: Mon, 14 Jan 2013 14:15:04 +0530 Subject: [Libav-user] =?gb2312?b?tPC4tDogtPC4tDogKG5vIHN1YmplY3Qp?= In-Reply-To: References: <002701cdf22c$2bab6cb0$83024610$@gmail.com> <003301cdf22d$d8a255e0$89e701a0$@gmail.com> Message-ID: Which library I am missing now? [root at node2 ffmpeginstaller.7.4]# gcc -I/usr/src/ffmpegscript/ffmpeg/ test.c -L/usr/src/ffmpegscript/mplayer/ffmpeg/libavformat/ -lavformat -L/usr/src/ffmpegscript/mplayer/ffmpeg/libavcodec/ -lavcodec -L/usr/src/ffmpegscript/mplayer/ffmpeg/libswscale/ -lswscale -L/usr/src/ffmpegscript/mplayer/ffmpeg/libavutil/ -lavutil /usr/src/ffmpegscript/mplayer/ffmpeg/libavformat//libavformat.a(swfdec.o): In function `swf_read_packet': swfdec.c:(.text+0x89f): undefined reference to `uncompress' /usr/src/ffmpegscript/mplayer/ffmpeg/libavformat//libavformat.a(swfdec.o): In function `swf_read_header': swfdec.c:(.text+0xd5d): undefined reference to `inflateInit_' /usr/src/ffmpegscript/mplayer/ffmpeg/libavformat//libavformat.a(swfdec.o): In function `zlib_refill': swfdec.c:(.text+0xeab): undefined reference to `inflate' /usr/src/ffmpegscript/mplayer/ffmpeg/libavformat//libavformat.a(swfdec.o): In function `swf_read_close': swfdec.c:(.text.unlikely+0xa): undefined reference to `inflateEnd' /usr/src/ffmpegscript/mplayer/ffmpeg/libavcodec//libavcodec.a(atrac3.o): In function `atrac3_decode_init': atrac3.c:(.text.unlikely+0xb9): undefined reference to `sin' atrac3.c:(.text.unlikely+0xf6): undefined reference to `sin' atrac3.c:(.text.unlikely+0x220): undefined reference to `exp2f' atrac3.c:(.text.unlikely+0x24d): undefined reference to `exp2f' /usr/src/ffmpegscript/mplayer/ffmpeg/libavcodec//libavcodec.a(binkaudio.o): In function `decode_init': binkaudio.c:(.text.unlikely+0x1fe): undefined reference to `expf' /usr/src/ffmpegscript/mplayer/ffmpeg/libavcodec//libavcodec.a(cngdec.o): In function `cng_decode_frame': cngdec.c:(.text+0x3c3): undefined reference to `pow' /usr/src/ffmpegscript/mplayer/ffmpeg/libavcodec//libavcodec.a(cngenc.o): In function `cng_encode_frame': cngenc.c:(.text+0xa3): undefined reference to `log10' /usr/src/ffmpegscript/mplayer/ffmpeg/libavcodec//libavcodec.a(cook.o): In function `cook_decode_init': cook.c:(.text.unlikely+0x64d): undefined reference to `pow' cook.c:(.text.unlikely+0x679): undefined reference to `pow' cook.c:(.text.unlikely+0x6d2): undefined reference to `pow' /usr/src/ffmpegscript/mplayer/ffmpeg/libavcodec//libavcodec.a(cscd.o): In function `decode_frame': cscd.c:(.text+0x226): undefined reference to `uncompress' /usr/src/ffmpegscript/mplayer/ffmpeg/libavcodec//libavcodec.a(dct.o): In function `ff_dct_init': dct.c:(.text.unlikely+0x10c): undefined reference to `sin' /usr/src/ffmpegscript/mplayer/ffmpeg/libavcodec//libavcodec.a(dxa.o): In function `decode_frame': dxa.c:(.text+0x6dc): undefined reference to `uncompress' /usr/src/ffmpegscript/mplayer/ffmpeg/libavcodec//libavcodec.a(exr.o): In function `decode_frame': exr.c:(.text+0x14ae): undefined reference to `uncompress' /usr/src/ffmpegscript/mplayer/ffmpeg/libavcodec//libavcodec.a(fft_float.o): In function `ff_init_ff_cos_tabs': fft_float.c:(.text.unlikely+0x7a): undefined reference to `cos' On Mon, Jan 14, 2013 at 1:36 PM, sangeeta chowdhary < sangitachowdhary at gmail.com> wrote: > [root at node2 ffmpeginstaller.7.4]# gcc -I/usr/src/ffmpegscript/ffmpeg/ > test.c -L/usr/src/ffmpegscript/ffmpeg/ -l avformat > /usr/bin/ld: cannot find -lavformat > collect2: ld returned 1 exit status > > > On Mon, Jan 14, 2013 at 1:34 PM, ??? Joy Woo wrote: > >> gcc -I/usr/src/ffmpegscript/ffmpeg/ test.c >> -L/usr/src/ffmpegscript/ffmpeg/ -l avformat > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From sangitachowdhary at gmail.com Mon Jan 14 09:56:56 2013 From: sangitachowdhary at gmail.com (sangeeta chowdhary) Date: Mon, 14 Jan 2013 14:26:56 +0530 Subject: [Libav-user] Need Help to execute demo program Message-ID: Hi Team, Which library I am missing ? [root at node2 ffmpeginstaller.7.4]# gcc -I/usr/src/ffmpegscript/ffmpeg/ test.c -L/usr/src/ffmpegscript/mplayer/ffmpeg/libavformat/ -lavformat -L/usr/src/ffmpegscript/mplayer/ffmpeg/libavcodec/ -lavcodec -L/usr/src/ffmpegscript/mplayer/ffmpeg/libswscale/ -lswscale -L/usr/src/ffmpegscript/mplayer/ffmpeg/libavutil/ -lavutil /usr/src/ffmpegscript/mplayer/ffmpeg/libavformat//libavformat.a(swfdec.o): In function `swf_read_packet': swfdec.c:(.text+0x89f): undefined reference to `uncompress' /usr/src/ffmpegscript/mplayer/ffmpeg/libavformat//libavformat.a(swfdec.o): In function `swf_read_header': swfdec.c:(.text+0xd5d): undefined reference to `inflateInit_' /usr/src/ffmpegscript/mplayer/ffmpeg/libavformat//libavformat.a(swfdec.o): In function `zlib_refill': swfdec.c:(.text+0xeab): undefined reference to `inflate' /usr/src/ffmpegscript/mplayer/ffmpeg/libavformat//libavformat.a(swfdec.o): In function `swf_read_close': swfdec.c:(.text.unlikely+0xa): undefined reference to `inflateEnd' /usr/src/ffmpegscript/mplayer/ffmpeg/libavcodec//libavcodec.a(atrac3.o): In function `atrac3_decode_init': atrac3.c:(.text.unlikely+0xb9): undefined reference to `sin' atrac3.c:(.text.unlikely+0xf6): undefined reference to `sin' atrac3.c:(.text.unlikely+0x220): undefined reference to `exp2f' atrac3.c:(.text.unlikely+0x24d): undefined reference to `exp2f' /usr/src/ffmpegscript/mplayer/ffmpeg/libavcodec//libavcodec.a(binkaudio.o): In function `decode_init': binkaudio.c:(.text.unlikely+0x1fe): undefined reference to `expf' /usr/src/ffmpegscript/mplayer/ffmpeg/libavcodec//libavcodec.a(cngdec.o): In function `cng_decode_frame': cngdec.c:(.text+0x3c3): undefined reference to `pow' /usr/src/ffmpegscript/mplayer/ffmpeg/libavcodec//libavcodec.a(cngenc.o): In function `cng_encode_frame': cngenc.c:(.text+0xa3): undefined reference to `log10' /usr/src/ffmpegscript/mplayer/ffmpeg/libavcodec//libavcodec.a(cook.o): In function `cook_decode_init': cook.c:(.text.unlikely+0x64d): undefined reference to `pow' cook.c:(.text.unlikely+0x679): undefined reference to `pow' cook.c:(.text.unlikely+0x6d2): undefined reference to `pow' /usr/src/ffmpegscript/mplayer/ffmpeg/libavcodec//libavcodec.a(cscd.o): In function `decode_frame': cscd.c:(.text+0x226): undefined reference to `uncompress' /usr/src/ffmpegscript/mplayer/ffmpeg/libavcodec//libavcodec.a(dct.o): In function `ff_dct_init': dct.c:(.text.unlikely+0x10c): undefined reference to `sin' /usr/src/ffmpegscript/mplayer/ffmpeg/libavcodec//libavcodec.a(dxa.o): In function `decode_frame': dxa.c:(.text+0x6dc): undefined reference to `uncompress' /usr/src/ffmpegscript/mplayer/ffmpeg/libavcodec//libavcodec.a(exr.o): In function `decode_frame': exr.c:(.text+0x14ae): undefined reference to `uncompress' /usr/src/ffmpegscript/mplayer/ffmpeg/libavcodec//libavcodec.a(fft_float.o): In function `ff_init_ff_cos_tabs': fft_float.c:(.text.unlikely+0x7a): undefined reference to `cos' On Mon, Jan 14, 2013 at 1:36 PM, sangeeta chowdhary < sangitachowdhary at gmail.com> wrote: > [root at node2 ffmpeginstaller.7.4]# gcc -I/usr/src/ffmpegscript/ffmpeg/ > test.c -L/usr/src/ffmpegscript/ffmpeg/ -l avformat > /usr/bin/ld: cannot find -lavformat > collect2: ld returned 1 exit status > > > On Mon, Jan 14, 2013 at 1:34 PM, ??? Joy Woo wrote: > >> gcc -I/usr/src/ffmpegscript/ffmpeg/ test.c >> -L/usr/src/ffmpegscript/ffmpeg/ -l avformat > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From wbsecg1 at gmail.com Mon Jan 14 11:01:34 2013 From: wbsecg1 at gmail.com (Wang Bin) Date: Mon, 14 Jan 2013 18:01:34 +0800 Subject: [Libav-user] g++ 4.7.2 fails to compile av_err2str In-Reply-To: References: <6537E256-5645-4E55-BE14-617A721B94FA@gmail.com> Message-ID: put attach files into ffmpeg source dir or tests dir, run tst_gxx.sh g++ -I.. -I. -D__STDC_CONSTANT_MACROS -c -o tst_gxx.o tst_gxx.cpp tst_gxx.cpp: In function 'int main()': tst_gxx.cpp:5:5: error: taking address of temporary array make: *** [tst_gxx.o] Error 1 i think we can use a inline function instead of macro av_always_inline char* av_err2str(int errnum) { static char str[AV_ERROR_MAX_STRING_SIZE]; memset(str, 0, sizeof(str)); return av_make_error_string(str, AV_ERROR_MAX_STRING_SIZE, errnum); } 2013/1/12 Carl Eugen Hoyos > wb writes: > > > g++ 4.7.2 fails to compile av_err2strI use av_err2str > > in a c++ file, g++ 4.7.2 can not compile it. The error > > message is "taking address of temporary array". > > Please provide a minimal test-case. > > 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: tst_gxx.sh Type: application/x-sh Size: 109 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: tst_gxx.cpp Type: text/x-c++src Size: 88 bytes Desc: not available URL: From wbsecg1 at gmail.com Mon Jan 14 11:09:07 2013 From: wbsecg1 at gmail.com (Wang Bin) Date: Mon, 14 Jan 2013 18:09:07 +0800 Subject: [Libav-user] g++ 4.7.2 fails to compile av_err2str In-Reply-To: References: <6537E256-5645-4E55-BE14-617A721B94FA@gmail.com> Message-ID: put attach files into ffmpeg source dir or tests dir, run tst_gxx.sh g++ -I.. -I. -D__STDC_CONSTANT_MACROS -c -o tst_gxx.o tst_gxx.cpp tst_gxx.cpp: In function 'int main()': tst_gxx.cpp:5:5: error: taking address of temporary array make: *** [tst_gxx.o] Error 1 i think we can use a inline function instead of macro av_always_inline char* av_err2str(int errnum) { static char str[AV_ERROR_MAX_STRING_SIZE]; memset(str, 0, sizeof(str)); return av_make_error_string(str, AV_ERROR_MAX_STRING_SIZE, errnum); } 2013/1/12 Carl Eugen Hoyos > wb writes: > > > g++ 4.7.2 fails to compile av_err2strI use av_err2str > > in a c++ file, g++ 4.7.2 can not compile it. The error > > message is "taking address of temporary array". > > Please provide a minimal test-case. > > 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 rjvbertin at gmail.com Mon Jan 14 11:20:24 2013 From: rjvbertin at gmail.com (=?iso-8859-1?Q?=22Ren=E9_J=2EV=2E_Bertin=22?=) Date: Mon, 14 Jan 2013 11:20:24 +0100 Subject: [Libav-user] g++ 4.7.2 fails to compile av_err2str In-Reply-To: References: <6537E256-5645-4E55-BE14-617A721B94FA@gmail.com> Message-ID: On Jan 14, 2013, at 11:01, Wang Bin wrote: > > g++ 4.7.2 fails to compile av_err2strI use av_err2str > > in a c++ file, g++ 4.7.2 can not compile it. The error > > message is "taking address of temporary array". > That's a surprising error for me ... the only physical explanation for a variable not having an address is when it is assigned to a register IMHO ... and the compiler is not supposed to do that when the variable's address is used later on. Semantics imposed by C++? R. -------------- next part -------------- An HTML attachment was scrubbed... URL: From cehoyos at ag.or.at Mon Jan 14 11:25:18 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Mon, 14 Jan 2013 10:25:18 +0000 (UTC) Subject: [Libav-user] Need Help to execute demo program References: Message-ID: sangeeta chowdhary writes: > swfdec.c:(.text+0xd5d): undefined reference to `inflateInit_' Looks like -lz is missing. > atrac3.c:(.text.unlikely+0xb9): undefined reference to `sin' Looks like -lm is missing. Carl Eugen From sangitachowdhary at gmail.com Mon Jan 14 11:31:31 2013 From: sangitachowdhary at gmail.com (sangeeta chowdhary) Date: Mon, 14 Jan 2013 16:01:31 +0530 Subject: [Libav-user] Need Help to execute demo program In-Reply-To: References: Message-ID: I have added lz and lm, still issues [root at node2 ffmpeginstaller.7.4]# gcc -I/usr/src/ffmpegscript/ffmpeg/ test.c -lm -lz -L/usr/src/ffmpegscript/mplayer/ffmpeg/libavformat/ -lavformat -L/usr/src/ffmpegscript/mplayer/ffmpeg/libavcodec/ -lavcodec -L/usr/src/ffmpegscript/mplayer/ffmpeg/libswscale/ -lswscale -L/usr/src/ffmpegscript/mplayer/ffmpeg/libavutil/ -lavutil /usr/src/ffmpegscript/mplayer/ffmpeg/libavcodec//libavcodec.a(libmp3lame.o): In function `mp3lame_encode_frame': libmp3lame.c:(.text+0x4f): undefined reference to `lame_encode_flush' libmp3lame.c:(.text+0x1c4): undefined reference to `lame_encode_buffer' libmp3lame.c:(.text+0x251): undefined reference to `lame_encode_buffer_int' libmp3lame.c:(.text+0x281): undefined reference to `lame_encode_buffer_float' /usr/src/ffmpegscript/mplayer/ffmpeg/libavcodec//libavcodec.a(libmp3lame.o): In function `mp3lame_encode_close': libmp3lame.c:(.text.unlikely+0x3a): undefined reference to `lame_close' /usr/src/ffmpegscript/mplayer/ffmpeg/libavcodec//libavcodec.a(libmp3lame.o): In function `mp3lame_encode_init': libmp3lame.c:(.text.unlikely+0x5e): undefined reference to `lame_init' libmp3lame.c:(.text.unlikely+0x79): undefined reference to `lame_set_num_channels' libmp3lame.c:(.text.unlikely+0x93): undefined reference to `lame_set_mode' libmp3lame.c:(.text.unlikely+0xa2): undefined reference to `lame_set_in_samplerate' libmp3lame.c:(.text.unlikely+0xb1): undefined reference to `lame_set_out_samplerate' libmp3lame.c:(.text.unlikely+0xc7): undefined reference to `lame_set_quality' libmp3lame.c:(.text.unlikely+0xce): undefined reference to `lame_set_quality' libmp3lame.c:(.text.unlikely+0xe2): undefined reference to `lame_set_VBR' libmp3lame.c:(.text.unlikely+0xf8): undefined reference to `lame_set_VBR_quality' libmp3lame.c:(.text.unlikely+0x116): undefined reference to `lame_set_brate' libmp3lame.c:(.text.unlikely+0x121): undefined reference to `lame_set_bWriteVbrTag' libmp3lame.c:(.text.unlikely+0x134): undefined reference to `lame_set_disable_reservoir' libmp3lame.c:(.text.unlikely+0x13d): undefined reference to `lame_init_params' libmp3lame.c:(.text.unlikely+0x14e): undefined reference to `lame_get_encoder_delay' libmp3lame.c:(.text.unlikely+0x16e): undefined reference to `lame_get_framesize' /usr/src/ffmpegscript/mplayer/ffmpeg/libavcodec//libavcodec.a(libopencore-amr.o): In function `amr_wb_decode_close': libopencore-amr.c:(.text+0x10): undefined reference to `D_IF_exit' /usr/src/ffmpegscript/mplayer/ffmpeg/libavcodec//libavcodec.a(libopencore-amr.o): In function `amr_wb_decode_frame': libopencore-amr.c:(.text+0xa4): undefined reference to `D_IF_decode' /usr/src/ffmpegscript/mplayer/ffmpeg/libavcodec//libavcodec.a(libopencore-amr.o): In function `amr_nb_decode_frame': libopencore-amr.c:(.text+0x1db): undefined reference to `Decoder_Interface_Decode' /usr/src/ffmpegscript/mplayer/ffmpeg/libavcodec//libavcodec.a(libopencore-amr.o): In function `amr_nb_encode_frame': libopencore-amr.c:(.text+0x695): undefined reference to `Encoder_Interface_Encode' /usr/src/ffmpegscript/mplayer/ffmpeg/libavcodec//libavcodec.a(libopencore-amr.o): In function `amr_wb_decode_init': libopencore-amr.c:(.text.unlikely+0x70): undefined reference to `D_IF_init' /usr/src/ffmpegscript/mplayer/ffmpeg/libavcodec//libavcodec.a(libopencore-amr.o): In function `amr_nb_encode_close': libopencore-amr.c:(.text.unlikely+0xa8): undefined reference to `Encoder_Interface_exit' /usr/src/ffmpegscript/mplayer/ffmpeg/libavcodec//libavcodec.a(libopencore-amr.o): In function `amr_nb_encode_init': libopencore-amr.c:(.text.unlikely+0x16e): undefined reference to `Encoder_Interface_init' /usr/src/ffmpegscript/mplayer/ffmpeg/libavcodec//libavcodec.a(libopencore-amr.o): In function `amr_nb_decode_close': libopencore-amr.c:(.text.unlikely+0x2c3): undefined reference to `Decoder_Interface_exit' /usr/src/ffmpegscript/mplayer/ffmpeg/libavcodec//libavcodec.a(libopencore-amr.o): In function `amr_nb_decode_init': libopencore-amr.c:(.text.unlikely+0x33e): undefined reference to `Decoder_Interface_init' /usr/src/ffmpegscript/mplayer/ffmpeg/libavcodec//libavcodec.a(libvorbisenc.o): In function `oggvorbis_encode_frame': libvorbisenc.c:(.text+0x48): undefined reference to `vorbis_analysis_buffer' libvorbisenc.c:(.text+0xa9): undefined reference to `vorbis_analysis_wrote' libvorbisenc.c:(.text+0xe5): undefined reference to `vorbis_analysis_blockout' libvorbisenc.c:(.text+0xfb): undefined reference to `vorbis_analysis' libvorbisenc.c:(.text+0x10e): undefined reference to `vorbis_bitrate_addblock' libvorbisenc.c:(.text+0x174): undefined reference to `vorbis_bitrate_flushpacket' libvorbisenc.c:(.text+0x2c9): undefined reference to `vorbis_analysis_wrote' /usr/src/ffmpegscript/mplayer/ffmpeg/libavcodec//libavcodec.a(libvorbisenc.o): In function `oggvorbis_encode_close': libvorbisenc.c:(.text.unlikely+0x20): undefined reference to `vorbis_analysis_wrote' libvorbisenc.c:(.text.unlikely+0x2c): undefined reference to `vorbis_block_clear' libvorbisenc.c:(.text.unlikely+0x38): undefined reference to `vorbis_dsp_clear' libvorbisenc.c:(.text.unlikely+0x44): undefined reference to `vorbis_info_clear' /usr/src/ffmpegscript/mplayer/ffmpeg/libavcodec//libavcodec.a(libvorbisenc.o): In function `oggvorbis_encode_init': libvorbisenc.c:(.text.unlikely+0xa1): undefined reference to `vorbis_info_init' libvorbisenc.c:(.text.unlikely+0xf9): undefined reference to `vorbis_encode_setup_vbr' libvorbisenc.c:(.text.unlikely+0x141): undefined reference to `vorbis_encode_setup_managed' libvorbisenc.c:(.text.unlikely+0x164): undefined reference to `vorbis_encode_ctl' libvorbisenc.c:(.text.unlikely+0x1a0): undefined reference to `vorbis_encode_ctl' libvorbisenc.c:(.text.unlikely+0x1ca): undefined reference to `vorbis_encode_ctl' libvorbisenc.c:(.text.unlikely+0x2d0): undefined reference to `vorbis_encode_setup_init' libvorbisenc.c:(.text.unlikely+0x31e): undefined reference to `vorbis_analysis_init' libvorbisenc.c:(.text.unlikely+0x343): undefined reference to `vorbis_block_init' libvorbisenc.c:(.text.unlikely+0x38e): undefined reference to `vorbis_comment_init' libvorbisenc.c:(.text.unlikely+0x3a6): undefined reference to `vorbis_comment_add_tag' libvorbisenc.c:(.text.unlikely+0x3be): undefined reference to `vorbis_analysis_headerout' libvorbisenc.c:(.text.unlikely+0x501): undefined reference to `vorbis_comment_clear' /usr/src/ffmpegscript/mplayer/ffmpeg/libavcodec//libavcodec.a(libx264.o): In function `X264_frame': libx264.c:(.text+0x30): undefined reference to `x264_picture_init' libx264.c:(.text+0x36): undefined reference to `x264_bit_depth' libx264.c:(.text+0xef): undefined reference to `x264_encoder_reconfig' libx264.c:(.text+0x11a): undefined reference to `x264_encoder_reconfig' libx264.c:(.text+0x16a): undefined reference to `x264_encoder_encode' libx264.c:(.text+0x2c0): undefined reference to `x264_encoder_delayed_frames' libx264.c:(.text+0x3b9): undefined reference to `x264_encoder_encode' libx264.c:(.text+0x3ed): undefined reference to `x264_encoder_delayed_frames' libx264.c:(.text+0x438): undefined reference to `x264_encoder_encode' /usr/src/ffmpegscript/mplayer/ffmpeg/libavcodec//libavcodec.a(libx264.o): In function `X264_init_static': libx264.c:(.text.unlikely+0x2): undefined reference to `x264_bit_depth' /usr/src/ffmpegscript/mplayer/ffmpeg/libavcodec//libavcodec.a(libx264.o): In function `X264_close': libx264.c:(.text.unlikely+0x57): undefined reference to `x264_encoder_close' /usr/src/ffmpegscript/mplayer/ffmpeg/libavcodec//libavcodec.a(libx264.o): In function `X264_init': libx264.c:(.text.unlikely+0x84): undefined reference to `x264_param_default' libx264.c:(.text.unlikely+0x104): undefined reference to `x264_param_default_preset' libx264.c:(.text.unlikely+0x21e): undefined reference to `x264_param_parse' libx264.c:(.text.unlikely+0x358): undefined reference to `x264_param_parse' libx264.c:(.text.unlikely+0x3f0): undefined reference to `x264_param_parse' libx264.c:(.text.unlikely+0x420): undefined reference to `x264_param_parse' libx264.c:(.text.unlikely+0x658): undefined reference to `x264_param_parse' /usr/src/ffmpegscript/mplayer/ffmpeg/libavcodec//libavcodec.a(libx264.o):libx264.c:(.text.unlikely+0x685): more undefined references to `x264_param_parse' follow /usr/src/ffmpegscript/mplayer/ffmpeg/libavcodec//libavcodec.a(libx264.o): In function `X264_init': libx264.c:(.text.unlikely+0x835): undefined reference to `x264_param_apply_fastfirstpass' libx264.c:(.text.unlikely+0x90c): undefined reference to `x264_param_apply_profile' libx264.c:(.text.unlikely+0xad1): undefined reference to `x264_encoder_open_129' libx264.c:(.text.unlikely+0xb1e): undefined reference to `x264_encoder_headers' /usr/src/ffmpegscript/mplayer/ffmpeg/libavcodec//libavcodec.a(libxvid.o): In function `xvid_encode_frame': libxvid.c:(.text+0x227): undefined reference to `xvid_encore' /usr/src/ffmpegscript/mplayer/ffmpeg/libavcodec//libavcodec.a(libxvid.o): In function `xvid_encode_close': libxvid.c:(.text.unlikely+0x1a): undefined reference to `xvid_encore' /usr/src/ffmpegscript/mplayer/ffmpeg/libavcodec//libavcodec.a(libxvid.o): In function `xvid_encode_init': libxvid.c:(.text.unlikely+0x1dc): undefined reference to `xvid_global' libxvid.c:(.text.unlikely+0x3ed): undefined reference to `xvid_plugin_2pass2' libxvid.c:(.text.unlikely+0x417): undefined reference to `xvid_plugin_single' libxvid.c:(.text.unlikely+0x460): undefined reference to `xvid_plugin_lumimasking' libxvid.c:(.text.unlikely+0x778): undefined reference to `xvid_encore' /usr/src/ffmpegscript/mplayer/ffmpeg/libavformat//libavformat.a(matroskadec.o): In function `matroska_decode_buffer': matroskadec.c:(.text+0x682): undefined reference to `BZ2_bzDecompressInit' matroskadec.c:(.text+0x6d8): undefined reference to `BZ2_bzDecompress' matroskadec.c:(.text+0x714): undefined reference to `BZ2_bzDecompressEnd' matroskadec.c:(.text+0x7bb): undefined reference to `BZ2_bzDecompressEnd' /usr/src/ffmpegscript/mplayer/ffmpeg/libavcodec//libavcodec.a(pthread.o): In function `frame_thread_free': pthread.c:(.text+0x1807): undefined reference to `pthread_join' /usr/src/ffmpegscript/mplayer/ffmpeg/libavcodec//libavcodec.a(pthread.o): In function `ff_thread_free': pthread.c:(.text+0x1912): undefined reference to `pthread_join' /usr/src/ffmpegscript/mplayer/ffmpeg/libavcodec//libavcodec.a(pthread.o): In function `ff_thread_init': pthread.c:(.text+0x1ce5): undefined reference to `pthread_create' pthread.c:(.text+0x1fbf): undefined reference to `pthread_create' /usr/src/ffmpegscript/mplayer/ffmpeg/libavcodec//libavcodec.a(frame_thread_encoder.o): In function `ff_frame_thread_encoder_free': frame_thread_encoder.c:(.text+0x339): undefined reference to `pthread_join' /usr/src/ffmpegscript/mplayer/ffmpeg/libavcodec//libavcodec.a(frame_thread_encoder.o): In function `ff_frame_thread_encoder_init': frame_thread_encoder.c:(.text+0x59c): undefined reference to `pthread_create' /usr/src/ffmpegscript/mplayer/ffmpeg/libavcodec//libavcodec.a(libxvid_rc.o): In function `ff_xvid_rate_control_uninit': libxvid_rc.c:(.text+0x16): undefined reference to `xvid_plugin_2pass2' /usr/src/ffmpegscript/mplayer/ffmpeg/libavcodec//libavcodec.a(libxvid_rc.o): In function `ff_xvid_rate_estimate_qscale': libxvid_rc.c:(.text+0x115): undefined reference to `xvid_plugin_2pass2' libxvid_rc.c:(.text+0x20f): undefined reference to `xvid_plugin_2pass2' /usr/src/ffmpegscript/mplayer/ffmpeg/libavcodec//libavcodec.a(libxvid_rc.o): In function `ff_xvid_rate_control_init': libxvid_rc.c:(.text+0x471): undefined reference to `xvid_plugin_2pass2' collect2: ld returned 1 exit status You have new mail in /var/spool/mail/root [root at node2 ffmpeginstaller.7.4]# On Mon, Jan 14, 2013 at 3:55 PM, Carl Eugen Hoyos wrote: > sangeeta chowdhary writes: > > > swfdec.c:(.text+0xd5d): undefined reference to `inflateInit_' > > Looks like -lz is missing. > > > atrac3.c:(.text.unlikely+0xb9): undefined reference to `sin' > > Looks like -lm is missing. > > 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 alexcohn at netvision.net.il Mon Jan 14 11:42:32 2013 From: alexcohn at netvision.net.il (Alex Cohn) Date: Mon, 14 Jan 2013 12:42:32 +0200 Subject: [Libav-user] g++ 4.7.2 fails to compile av_err2str In-Reply-To: References: <6537E256-5645-4E55-BE14-617A721B94FA@gmail.com> Message-ID: On Mon, Jan 14, 2013 at 12:20 PM, "Ren? J.V. Bertin" wrote: > > On Jan 14, 2013, at 11:01, Wang Bin wrote: >> >> > g++ 4.7.2 fails to compile av_err2strI use av_err2str >> > in a c++ file, g++ 4.7.2 can not compile it. The error >> > message is "taking address of temporary array". > > That's a surprising error for me ... the only physical explanation for a > variable not having an address is when it is assigned to a register IMHO ... > and the compiler is not supposed to do that when the variable's address is > used later on. Semantics imposed by C++? > > R. An easy test proves that adding "-x c" to command line resolves the problem. So it is a C++ artifact. BR, Alex Cohn From rjvbertin at gmail.com Mon Jan 14 12:31:30 2013 From: rjvbertin at gmail.com (=?iso-8859-1?Q?=22Ren=E9_J=2EV=2E_Bertin=22?=) Date: Mon, 14 Jan 2013 12:31:30 +0100 Subject: [Libav-user] g++ 4.7.2 fails to compile av_err2str In-Reply-To: References: <6537E256-5645-4E55-BE14-617A721B94FA@gmail.com> Message-ID: <85BB3A2C-59B9-41B0-B5E2-F06F9B6B8C7D@gmail.com> On Jan 14, 2013, at 11:42, Alex Cohn wrote: >> used later on. Semantics imposed by C++? >> >> R. > > An easy test proves that adding "-x c" to command line resolves the > problem. So it is a C++ artifact. As I feared. Note that the OP's tst_gxx.cpp does a simple av_err2str(AVERROR_BUG); i.e. stand-alone instead of using the function call as an argument to another function as is stipulated in the doxygen doc for av_err2str in my version of the code. Is it certain that the scope and type of a variable declared (char[SIZE]){0} in a function argument list is well defined and identical across all compilers? I personally find it an unreadable and ambiguous construct... R From cehoyos at ag.or.at Mon Jan 14 12:49:55 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Mon, 14 Jan 2013 11:49:55 +0000 (UTC) Subject: [Libav-user] Need Help to execute demo program References: Message-ID: sangeeta chowdhary writes: > libmp3lame.c:(.text+0x4f): undefined reference to `lame_encode_flush' Looks as if -lmp3lame is missing. Please do not top-post on this mailing list, it is considered rude, and please force your mailer to "text-only". Carl Eugen From alexcohn at netvision.net.il Mon Jan 14 13:48:20 2013 From: alexcohn at netvision.net.il (Alex Cohn) Date: Mon, 14 Jan 2013 14:48:20 +0200 Subject: [Libav-user] g++ 4.7.2 fails to compile av_err2str In-Reply-To: <85BB3A2C-59B9-41B0-B5E2-F06F9B6B8C7D@gmail.com> References: <6537E256-5645-4E55-BE14-617A721B94FA@gmail.com> <85BB3A2C-59B9-41B0-B5E2-F06F9B6B8C7D@gmail.com> Message-ID: On Mon, Jan 14, 2013 at 1:31 PM, "Ren? J.V. Bertin" wrote: > On Jan 14, 2013, at 11:42, Alex Cohn wrote: >>> used later on. Semantics imposed by C++? >>> >>> R. >> >> An easy test proves that adding "-x c" to command line resolves the >> problem. So it is a C++ artifact. > > As I feared. > > Note that the OP's tst_gxx.cpp does a simple > av_err2str(AVERROR_BUG); > > i.e. stand-alone instead of using the function call as an argument to another function as is stipulated in the doxygen doc for av_err2str in my version of the code. Is it certain that the scope and type of a variable declared (char[SIZE]){0} in a function argument list is well defined and identical across all compilers? I personally find it an unreadable and ambiguous construct... > > R The C++ error does not go away if av_err2str() is wrapped into an argument to another function, as puts(av_err2str(AVERROR_BUG)); ... but I believe that the solution is simple: this macro should not be used in C++, that's it! Whoever needs similar functionality in g++, may use #undef av_err2str #define av_err2str(errnum) \ av_make_error_string((char*)__builtin_alloca(AV_ERROR_MAX_STRING_SIZE), AV_ERROR_MAX_STRING_SIZE, errnum) From rjvbertin at gmail.com Mon Jan 14 13:59:17 2013 From: rjvbertin at gmail.com (=?iso-8859-1?Q?=22Ren=E9_J=2EV=2E_Bertin=22?=) Date: Mon, 14 Jan 2013 13:59:17 +0100 Subject: [Libav-user] g++ 4.7.2 fails to compile av_err2str In-Reply-To: References: <6537E256-5645-4E55-BE14-617A721B94FA@gmail.com> <85BB3A2C-59B9-41B0-B5E2-F06F9B6B8C7D@gmail.com> Message-ID: <6848341B-E849-4A0D-8F1E-2B488AB8181A@gmail.com> On Jan 14, 2013, at 13:48, Alex Cohn wrote: > ... but I believe that the solution is simple: this macro should not > be used in C++, that's it! Whoever needs similar functionality in g++, > may use > > #undef av_err2str > #define av_err2str(errnum) \ > av_make_error_string((char*)__builtin_alloca(AV_ERROR_MAX_STRING_SIZE), > AV_ERROR_MAX_STRING_SIZE, errnum) Indeed - though I'd advise to use alloca() for more portability and there's no reason to avoid it in C either. Of course there could be a specific C++ version using std::string, I presume, but why bother? R. From alexcohn at netvision.net.il Mon Jan 14 14:10:48 2013 From: alexcohn at netvision.net.il (Alex Cohn) Date: Mon, 14 Jan 2013 15:10:48 +0200 Subject: [Libav-user] g++ 4.7.2 fails to compile av_err2str In-Reply-To: <6848341B-E849-4A0D-8F1E-2B488AB8181A@gmail.com> References: <6537E256-5645-4E55-BE14-617A721B94FA@gmail.com> <85BB3A2C-59B9-41B0-B5E2-F06F9B6B8C7D@gmail.com> <6848341B-E849-4A0D-8F1E-2B488AB8181A@gmail.com> Message-ID: On Mon, Jan 14, 2013 at 2:59 PM, "Ren? J.V. Bertin" wrote: > On Jan 14, 2013, at 13:48, Alex Cohn wrote: > >> ... but I believe that the solution is simple: this macro should not >> be used in C++, that's it! Whoever needs similar functionality in g++, >> may use >> >> #undef av_err2str >> #define av_err2str(errnum) \ >> av_make_error_string((char*)__builtin_alloca(AV_ERROR_MAX_STRING_SIZE), >> AV_ERROR_MAX_STRING_SIZE, errnum) > > > Indeed - though I'd advise to use alloca() for more portability and there's no reason to avoid it in C either. Of course there could be a specific C++ version using std::string, I presume, but why bother? > > R. Yes, alloca() should be OK. Now that I think about it, that's right: it is compatible with C, too. But Microsoft compiler only recognizes _alloca(). BR, Alex Cohn From david.longest at apx-labs.com Mon Jan 14 17:06:57 2013 From: david.longest at apx-labs.com (David Longest) Date: Mon, 14 Jan 2013 16:06:57 +0000 Subject: [Libav-user] Encoding H263+ video In-Reply-To: References: Message-ID: > Alex Wrote: > > Note that in terms of allocations and encoder logic, you can use nv21 input instead of yuv420p. The resulting video will be crap, but the encoder should not > crash/fail, and you can expect to receive a movie file as output. You can even extract nv21 frames from this movie: > > ffmpeg -i video.h263v2 -pix_fmt yuv420p -vframes 1 foo-1.yuv > > You can even use ffplay to see the resulting frame: > > ffplay -pixel_format nv21 -video_size WxH foo-1.yuv > > So, please check if your problem is reproduced without the "extra step" of nv21 to yuv420p conversion. > > BR, > > Alex Alex, I just tried creating an AVFrame and setting the pixel format to PIX_FMT_YUV420P while still providing NV21 data. When passing this frame to avcodec_encode_video2, I will still get the crash unless I allocate the input packet's data field beforehand. I get the following stack trace. ffmpeg.so (ff_h263_encode_picture_header+860): Routine put_bits in ffmpeg/libavcodec/put_bits.h:160 ffmpeg.so (ff_MPV_encode_picture+3192): Routine encode_picture in ffmpeg/libavcodec/mpegvideo_enc.c:3421 ffmpeg.so (avcodec_encode_video2+184): Routine avcodec_encode_video2 in ffmpeg/libavcodec/utils.c:1409 Below I have added some more information that may be helpful with this issue. * The incoming data is raw NV21 video data coming in at a resolution of 320 x 240 * I am using libavcodec 54.59.100 directly when encoding the data. * The encoder context setup is as follows: - bit_rate: 262144 - bit_rate_tolerance: 100000 - gop_size: 10 - time_base: {1,25} - width: 240 - height: 320 Thanks, David From alexcohn at netvision.net.il Mon Jan 14 17:18:23 2013 From: alexcohn at netvision.net.il (Alex Cohn) Date: Mon, 14 Jan 2013 18:18:23 +0200 Subject: [Libav-user] Encoding H263+ video In-Reply-To: References: Message-ID: On Mon, Jan 14, 2013 at 6:06 PM, David Longest wrote: > > I just tried creating an AVFrame and setting the pixel format to > PIX_FMT_YUV420P while still providing NV21 data. When passing this frame to > avcodec_encode_video2, I will still get the crash unless I allocate the > input packet's data field beforehand. Please post your source code, if possible - the minimal crashing example. Make sure you use the latest version of fffmpeg libraries. What is your platform and compiler? BR, Alex -------------- next part -------------- An HTML attachment was scrubbed... URL: From nicolas.george at normalesup.org Mon Jan 14 17:49:13 2013 From: nicolas.george at normalesup.org (Nicolas George) Date: Mon, 14 Jan 2013 17:49:13 +0100 Subject: [Libav-user] g++ 4.7.2 fails to compile av_err2str In-Reply-To: References: <6537E256-5645-4E55-BE14-617A721B94FA@gmail.com> <85BB3A2C-59B9-41B0-B5E2-F06F9B6B8C7D@gmail.com> <6848341B-E849-4A0D-8F1E-2B488AB8181A@gmail.com> Message-ID: <20130114164913.GA23764@phare.normalesup.org> Le quintidi 25 niv?se, an CCXXI, Alex Cohn a ?crit?: > Yes, alloca() should be OK. Now that I think about it, that's right: > it is compatible with C, too. I am far from sure that alloca() exists in all supported C compilers. > But Microsoft compiler only recognizes > _alloca(). There you are. There is another problem with alloca(): the scope of the allocation is per function, while the scope of a compound literal, as used by the macro currently, is per block. That means that the following function: void encode(void) { while (packet = read_packet()) { if ((ret = avcodec_decode_video2(avc, frame, &out, packet)) < 0) { fprintf(stderr, "Error decoding: %s\n", av_err2str(ret)); continue; } if (out) output_frame(frame); } } with the current macro, works as expected, whereas if the macro were based on alloca(), the error strings would stay allocated until the loop is completed. That is a memory leak. Probably not terrible, but still a leak. Regards, -- Nicolas George -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: Digital signature URL: From rjvbertin at gmail.com Mon Jan 14 18:04:52 2013 From: rjvbertin at gmail.com (=?iso-8859-1?Q?=22Ren=E9_J=2EV=2E_Bertin=22?=) Date: Mon, 14 Jan 2013 18:04:52 +0100 Subject: [Libav-user] g++ 4.7.2 fails to compile av_err2str In-Reply-To: <20130114164913.GA23764@phare.normalesup.org> References: <6537E256-5645-4E55-BE14-617A721B94FA@gmail.com> <85BB3A2C-59B9-41B0-B5E2-F06F9B6B8C7D@gmail.com> <6848341B-E849-4A0D-8F1E-2B488AB8181A@gmail.com> <20130114164913.GA23764@phare.normalesup.org> Message-ID: <65A7BB54-4B5B-4806-B698-28A2192DB24F@gmail.com> On Jan 14, 2013, at 17:49, Nicolas George wrote: >> But Microsoft compiler only recognizes >> _alloca(). > > There you are. #ifdef _MSC_VER # define alloca(n) _alloca(n) #endif > > There is another problem with alloca(): the scope of the allocation is > per function, while the scope of a compound literal, as used by the macro > currently, is per block. Are you sure? I was under the impression that n = 10; { char *foo = (char*) alloca(n); // char foo[n] in gcc :) // fill foo printf( "%s\n", foo ); } is equivalent to { char foo[10]; // fill foo printf( "%s\n", foo ); } meaning that the stack-deallocation of *foo happens upon exit from the block, like the releasing of foo[10] ... > with the current macro, works as expected, whereas if the macro were based > on alloca(), the error strings would stay allocated until the loop is > completed. That is a memory leak. Probably not terrible, but still a leak. In my book, a memory leak is memory that's allocated but never deallocated. That's not the case here... it's more like a caching/garbage-collection scheme. And as long as there are few errors being reported, there won't be much memory to free. R. From nicolas.george at normalesup.org Mon Jan 14 19:14:18 2013 From: nicolas.george at normalesup.org (Nicolas George) Date: Mon, 14 Jan 2013 19:14:18 +0100 Subject: [Libav-user] g++ 4.7.2 fails to compile av_err2str In-Reply-To: <65A7BB54-4B5B-4806-B698-28A2192DB24F@gmail.com> References: <85BB3A2C-59B9-41B0-B5E2-F06F9B6B8C7D@gmail.com> <6848341B-E849-4A0D-8F1E-2B488AB8181A@gmail.com> <20130114164913.GA23764@phare.normalesup.org> <65A7BB54-4B5B-4806-B698-28A2192DB24F@gmail.com> Message-ID: <20130114181418.GA3602@phare.normalesup.org> Le quintidi 25 niv?se, an CCXXI, "Ren? J.V. Bertin" a ?crit?: > Are you sure? I was under the impression that > > n = 10; > { char *foo = (char*) alloca(n); // char foo[n] in gcc :) > // fill foo > printf( "%s\n", foo ); > } > > is equivalent to > > { char foo[10]; > // fill foo > printf( "%s\n", foo ); > } > > meaning that the stack-deallocation of *foo happens upon exit from the > block, like the releasing of foo[10] ... I checked both in the man page (from gcc+glibc) and a test program: if you use alloca() inside a loop, it returns a new block each time, while a compound literal has always the same address. The man page says: # This temporary space is automatically freed when the function that called # alloca() returns to its caller. > In my book, a memory leak is memory that's allocated but never > deallocated. That's not the case here... it's more like a > caching/garbage-collection scheme. Except that there is no garbage collection when the memory runs out. I count a block of memory that is freed later than expected without way of catching it as a leak. Otherwise, there would be no leaks possible, all memory is freed when a process terminates. > And as long as there are few errors being reported, there won't be much > memory to free. The stack can be quite small, and errors can be numerous. You can get errors to report very frequently. I see some OSes have a default thread stack of 64k, that is 1k errors. Decoding damaged streams from network can produce that kind of output. Regards, -- Nicolas George -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: Digital signature URL: From rjvbertin at gmail.com Mon Jan 14 20:41:29 2013 From: rjvbertin at gmail.com (=?iso-8859-1?Q?=22Ren=E9_J=2EV=2E_Bertin=22?=) Date: Mon, 14 Jan 2013 20:41:29 +0100 Subject: [Libav-user] g++ 4.7.2 fails to compile av_err2str In-Reply-To: <20130114181418.GA3602@phare.normalesup.org> References: <85BB3A2C-59B9-41B0-B5E2-F06F9B6B8C7D@gmail.com> <6848341B-E849-4A0D-8F1E-2B488AB8181A@gmail.com> <20130114164913.GA23764@phare.normalesup.org> <65A7BB54-4B5B-4806-B698-28A2192DB24F@gmail.com> <20130114181418.GA3602@phare.normalesup.org> Message-ID: <9EB31AE6-57F5-44F7-9424-0705A9D4E58D@gmail.com> On Jan 14, 2013, at 19:14, Nicolas George wrote: > > I checked both in the man page (from gcc+glibc) and a test program: if you > use alloca() inside a loop, it returns a new block each time, while a > compound literal has always the same address. The man page says: Ok. Note however that a changing address doesn't mean that the previous block wasn't allocated. > Except that there is no garbage collection when the memory runs out. I count > a block of memory that is freed later than expected without way of catching > it as a leak. Otherwise, there would be no leaks possible, all memory is > freed when a process terminates. True (though that wasn't always the case). Seems like this would speak for using a local std::string instance in C++ code where a compound literal cannot be used. R. From libav-user at szanni.org Mon Jan 14 22:05:06 2013 From: libav-user at szanni.org (Angelo Haller) Date: Mon, 14 Jan 2013 22:05:06 +0100 Subject: [Libav-user] Decoding audio: ffmpeg examples Message-ID: <50F47302.5050401@szanni.org> Hello, I've been looking at the examples on how to use ffmpeg and I found a few issues. Fist of all there seems to be a memory leak in doc/examples/demuxing.c (valgrind certainly tells me that). Freeing the AVPacket seems to resolve that issue (see the patch attached). Hope I didn't miss anything here. Another thing I noticed is that the demuxer example does not call avcodec_get_frame_defaults() on the frame that it is reusing. Or does that not really matter? The docs state that you "should" and not "must". Then when looking at doc/examples/decoding_encoding.c I noticed that there is no extra call to avcodec_decode_audio4() when decoding audio. The docs state that some decoders cache frames. Is that really true for audio decoding? Line 601 says something about P and I frames being delayed in the MPEG video decoder... If so, then I think that some of the audio could go missing in this example. Angelo -------------- next part -------------- A non-text attachment was scrubbed... Name: 0001-examples-demuxing-free-AVPacket-after-usage.patch Type: text/x-patch Size: 883 bytes Desc: not available URL: From cehoyos at ag.or.at Mon Jan 14 22:07:29 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Mon, 14 Jan 2013 21:07:29 +0000 (UTC) Subject: [Libav-user] Decoding audio: ffmpeg examples References: <50F47302.5050401@szanni.org> Message-ID: Angelo Haller writes: > Fist of all there seems to be a memory leak in > doc/examples/demuxing.c (valgrind certainly tells me that). > Freeing the AVPacket seems to resolve that issue (see the patch > attached). Please send patches to ffmpeg-devel. Carl Eugen From beyond702 at gmail.com Tue Jan 15 11:08:48 2013 From: beyond702 at gmail.com (Brian Chi) Date: Tue, 15 Jan 2013 18:08:48 +0800 Subject: [Libav-user] Function "avcodec_decode_audio3" cause signal 7 (SIGBUS). Message-ID: Hi, My program uses ffmpeg to decode a MP4 file, when it runs to function "avcodec_decode_audio3", it cause signal 7(SIGBUS). The audio codec is aac, ffmpeg version is 0.8.10. But it works well on the version 0.11.1 of ffmpeg. Does it caused by the reason that "avpkt->data should have 4 byte alignment at minimum and samples should be 16 byte aligned"? Thanks. -- Best Regards, Chi -------------- next part -------------- An HTML attachment was scrubbed... URL: From cehoyos at ag.or.at Tue Jan 15 12:32:51 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Tue, 15 Jan 2013 11:32:51 +0000 (UTC) Subject: [Libav-user] =?utf-8?q?Function_=22avcodec=5Fdecode=5Faudio3=22_c?= =?utf-8?q?ause_signal_7_=28SIGBUS=29=2E?= References: Message-ID: Brian Chi writes: > My program uses ffmpeg to decode a MP4 file, when > it runs to function "avcodec_decode_audio3", it > cause signal 7(SIGBUS). The audio codec is aac, > ffmpeg version is 0.8.10. > But it works well on the version 0.11.1 of ffmpeg. This sounds as if you are investing time to make your program work with a two year old version of FFmpeg although it works fine with a newer version. Please don't do that, if you are a user, use current git head, if you are a distributor, use the latest release series (1.1). Carl Eugen From sangitachowdhary at gmail.com Tue Jan 15 13:03:21 2013 From: sangitachowdhary at gmail.com (sangeeta chowdhary) Date: Tue, 15 Jan 2013 17:33:21 +0530 Subject: [Libav-user] Need Help to execute demo program In-Reply-To: References: Message-ID: Hi Carl, Can you please tell me which all libraries I need to include while compiling one short program, #include #include #include "libavcodec/avcodec.h" #include "libavformat/avformat.h" int main(int argc, char *argv[]) { av_register_all(); return 0; } I have given this command - gcc -I/usr/src/ffmpegscript/ffmpeg/ test.c -lpthread -L/usr/src/ffmpegscript/mplayer/ffmpeg/libavformat/ -lavformat -L/usr/src/ffmpegscript/mplayer/ffmpeg/libavcodec/ -lavcodec -L/usr/src/ffmpegscript/mplayer/ffmpeg/libswscale/ -lswscale -L/usr/src/ffmpegscript/mplayer/ffmpeg/libavutil/ -lavutil -L/usr/local/cpffmpeg/lib/ -lmp3lame -lm -lz -ldl I am still getting undefined references error. undefined reference to `vorbis_analysis_buffer' undefined reference to `D_IF_exit' undefined reference to `Encoder_Interface_Encode' undefined reference to `x264_picture_init' undefined reference to `x264_param_default_preset' undefined reference to `xvid_global' undefined reference to `BZ2_bzDecompressInit' Looking forward for your help. Regards, Thanks, Sangeeta On Mon, Jan 14, 2013 at 5:19 PM, Carl Eugen Hoyos wrote: > sangeeta chowdhary writes: > > > libmp3lame.c:(.text+0x4f): undefined reference to `lame_encode_flush' > > Looks as if -lmp3lame is missing. > > Please do not top-post on this mailing list, it is considered > rude, and please force your mailer to "text-only". > > 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 david.longest at apx-labs.com Tue Jan 15 15:27:23 2013 From: david.longest at apx-labs.com (David Longest) Date: Tue, 15 Jan 2013 14:27:23 +0000 Subject: [Libav-user] Encoding H263+ video In-Reply-To: References: Message-ID: > Please post your source code, if possible - the minimal crashing example. Make sure you use the latest version of fffmpeg libraries. What is your platform and compiler? > > BR, > Alex I have found what my problem was. As the following code sample would show, I was using av_malloc to allocate an AVPacket on the heap. While I called av_init_packet to initialize the fields of the AVPacket struct, that function does not zero out the data or size field. Changing this to av_mallocz instead fixed the issue I was running into. AVFrame* testFrame; AVCodecContext* context; /* I set up the frame and context in here. */ int validPacket = 0; AVPacket* packet = reinterpret_cast(av_malloc(sizeof(AVPacket))); av_init_packet(packet); int error = avcodec_encode_video2(context, packet, testFrame, &validPacket); if (validPacket) { // TODO: save out packet data. av_free_packet(packet); } av_free(packet); Thanks, David -------------- next part -------------- An HTML attachment was scrubbed... URL: From alexcohn at netvision.net.il Tue Jan 15 16:02:26 2013 From: alexcohn at netvision.net.il (Alex Cohn) Date: Tue, 15 Jan 2013 17:02:26 +0200 Subject: [Libav-user] Encoding H263+ video In-Reply-To: References: Message-ID: On Tue, Jan 15, 2013 at 4:27 PM, David Longest wrote: > > I have found what my problem was. As the following code sample would show, I was using av_malloc to allocate an AVPacket on the heap. While I called av_init_packet to initialize the fields of the AVPacket struct, that function does not zero out the data or size field. Changing this to av_mallocz instead fixed the issue I was running into. There is little advantage in allocation AVPacket in the heap. In the ?decoding_encoding.c? example, the packet structure is placed on stack and reused during encoding; but for each frame it is re-initialized av_init_packet(&pkt); pkt.data = NULL; // packet data will be allocated by the encoder pkt.size = 0; Anyways, it's good that you succeeded to resolve your problem. Alex From libav-user at szanni.org Tue Jan 15 21:23:53 2013 From: libav-user at szanni.org (Angelo Haller) Date: Tue, 15 Jan 2013 21:23:53 +0100 Subject: [Libav-user] Decoding audio: ffmpeg examples In-Reply-To: References: <50F47302.5050401@szanni.org> Message-ID: <50F5BAD9.4080807@szanni.org> On 01/14/2013 10:07 PM, Carl Eugen Hoyos wrote: > Please send patches to ffmpeg-devel. Almost thought so. Opened a ticket (#2142) and sent in the patch. From cehoyos at ag.or.at Tue Jan 15 21:23:43 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Tue, 15 Jan 2013 20:23:43 +0000 (UTC) Subject: [Libav-user] Decoding audio: ffmpeg examples References: <50F47302.5050401@szanni.org> <50F5BAD9.4080807@szanni.org> Message-ID: Angelo Haller writes: > On 01/14/2013 10:07 PM, Carl Eugen Hoyos wrote: > > Please send patches to ffmpeg-devel. > > Almost thought so. Opened a ticket (#2142) and sent in the patch. Thank you! Carl Eugen From mtaha.ansari at gmail.com Wed Jan 16 08:48:49 2013 From: mtaha.ansari at gmail.com (Taha Ansari) Date: Wed, 16 Jan 2013 12:48:49 +0500 Subject: [Libav-user] Detecting bit rate from live stream Message-ID: Hi! I am using h264 encoding to transmit video to destination network address using udp protocol. I also want to detect bit rate of the encoded frame on receiver end. In the pFormatCtx->bit_rate, and pCodecCtx->bit_rate, I see on receiver end, they are all zero. I understand since it is live streaming bit rate isn't stuffed there, but I would like to know if there is any way I could retrieve actual bit rate frame was transmitted on, on client side (i.e. decoder side decoding video over network). Can anyone kindly provide some guidance or tips on how to do this? Thanks for your time! -------------- next part -------------- An HTML attachment was scrubbed... URL: From alexcohn at netvision.net.il Wed Jan 16 09:45:06 2013 From: alexcohn at netvision.net.il (Alex Cohn) Date: Wed, 16 Jan 2013 10:45:06 +0200 Subject: [Libav-user] g++ 4.7.2 fails to compile av_err2str In-Reply-To: <9EB31AE6-57F5-44F7-9424-0705A9D4E58D@gmail.com> References: <85BB3A2C-59B9-41B0-B5E2-F06F9B6B8C7D@gmail.com> <6848341B-E849-4A0D-8F1E-2B488AB8181A@gmail.com> <20130114164913.GA23764@phare.normalesup.org> <65A7BB54-4B5B-4806-B698-28A2192DB24F@gmail.com> <20130114181418.GA3602@phare.normalesup.org> <9EB31AE6-57F5-44F7-9424-0705A9D4E58D@gmail.com> Message-ID: On Mon, Jan 14, 2013 at 9:41 PM, "Ren? J.V. Bertin" wrote: > On Jan 14, 2013, at 19:14, Nicolas George wrote: >> >> I checked both in the man page (from gcc+glibc) and a test program: if you >> use alloca() inside a loop, it returns a new block each time, while a >> compound literal has always the same address. The difference is that compound literal is resolved at compile time, so using it inside a loop does not produce extra instances. > Seems like this would speak for using a local std::string instance in C++ code where a compound literal cannot be used. Here is my C++ way of defining av_err2str: #ifdef __cplusplus static const std::string av_make_error_string(int errnum) { char errbuf[AV_ERROR_MAX_STRING_SIZE]; av_strerror(errnum, errbuf, AV_ERROR_MAX_STRING_SIZE); return (std::string)errbuf; } #undef av_err2str #define av_err2str(errnum) av_make_error_string(errnum).c_str() #endif // __cplusplus ... and here are some usage examples: puts(av_err2str(1)); std::cout << av_make_error_string(2) << std::endl; std::cout << av_err2str(3) << std::endl; BR, Alex Cohn From pavel at sokolov.me Wed Jan 16 15:57:14 2013 From: pavel at sokolov.me (Pavel Sokolov) Date: Wed, 16 Jan 2013 18:57:14 +0400 Subject: [Libav-user] encoder frame_size for AV_CODEC_ID_PCM_S16BE Message-ID: <50F6BFCA.8010605@sokolov.me> Hi! I need to encode audio with AV_CODEC_ID_PCM_S16BE codec. Which "frame_size" is right? From rjvbertin at gmail.com Wed Jan 16 16:09:21 2013 From: rjvbertin at gmail.com (=?iso-8859-1?Q?=22Ren=E9_J=2EV=2E_Bertin=22?=) Date: Wed, 16 Jan 2013 16:09:21 +0100 Subject: [Libav-user] g++ 4.7.2 fails to compile av_err2str In-Reply-To: References: <85BB3A2C-59B9-41B0-B5E2-F06F9B6B8C7D@gmail.com> <6848341B-E849-4A0D-8F1E-2B488AB8181A@gmail.com> <20130114164913.GA23764@phare.normalesup.org> <65A7BB54-4B5B-4806-B698-28A2192DB24F@gmail.com> <20130114181418.GA3602@phare.normalesup.org> <9EB31AE6-57F5-44F7-9424-0705A9D4E58D@gmail.com> Message-ID: On Jan 16, 2013, at 09:45, Alex Cohn wrote: > The difference is that compound literal is resolved at compile time, > so using it inside a loop does not produce extra instances. Evidently, as long as this is not a decision that's left to the compiler. > Here is my C++ way of defining av_err2str: > > #ifdef __cplusplus > > static const std::string av_make_error_string(int errnum) > { > char errbuf[AV_ERROR_MAX_STRING_SIZE]; > av_strerror(errnum, errbuf, AV_ERROR_MAX_STRING_SIZE); > return (std::string)errbuf; > } > > #undef av_err2str > #define av_err2str(errnum) av_make_error_string(errnum).c_str() > > #endif // __cplusplus Almost exactly as I also would have done it, or else using a specific new class containing a modifiable buffer of size AV_ERROR_MAX_STRING_SIZE to avoid the local variable and copying the string. But I have a doubt (I'm far from a C++ expert) ... what's the scope of the object returned as return (std::string)errbuf? AFAIK C++ doesn't have a retain/release mechanism like ObjC has, so is it the compiler that keeps track of when to deconstruct the returned string object? In C, returning a local string variable comes without warranty that the contents will still be available when the caller wants to access them! R. From alexcohn at netvision.net.il Wed Jan 16 16:30:49 2013 From: alexcohn at netvision.net.il (Alex Cohn) Date: Wed, 16 Jan 2013 17:30:49 +0200 Subject: [Libav-user] g++ 4.7.2 fails to compile av_err2str In-Reply-To: References: <85BB3A2C-59B9-41B0-B5E2-F06F9B6B8C7D@gmail.com> <6848341B-E849-4A0D-8F1E-2B488AB8181A@gmail.com> <20130114164913.GA23764@phare.normalesup.org> <65A7BB54-4B5B-4806-B698-28A2192DB24F@gmail.com> <20130114181418.GA3602@phare.normalesup.org> <9EB31AE6-57F5-44F7-9424-0705A9D4E58D@gmail.com> Message-ID: On Wed, Jan 16, 2013 at 5:09 PM, "Ren? J.V. Bertin" wrote: > On Jan 16, 2013, at 09:45, Alex Cohn wrote: > >> The difference is that compound literal is resolved at compile time, >> so using it inside a loop does not produce extra instances. > > Evidently, as long as this is not a decision that's left to the compiler. http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf 6.5.2.2.15 suggests that this decision is carved in stone. >> Here is my C++ way of defining av_err2str: >> >> #ifdef __cplusplus >> >> static const std::string av_make_error_string(int errnum) >> { >> char errbuf[AV_ERROR_MAX_STRING_SIZE]; >> av_strerror(errnum, errbuf, AV_ERROR_MAX_STRING_SIZE); >> return (std::string)errbuf; >> } >> >> #undef av_err2str >> #define av_err2str(errnum) av_make_error_string(errnum).c_str() >> >> #endif // __cplusplus > > Almost exactly as I also would have done it, or else using a specific new class containing a modifiable buffer of size AV_ERROR_MAX_STRING_SIZE to avoid the local variable and copying the string. People who use C++ and STL have enough classes to take care of, it would be cruel to impose yet another one on them. I decided to provide an implementation that could be used as close as possible to the original C usage pattern. > But I have a doubt (I'm far from a C++ expert) ... what's the scope of the object returned as return (std::string)errbuf? AFAIK C++ doesn't have a retain/release mechanism like ObjC has, so is it the compiler that keeps track of when to deconstruct the returned string object? In C, returning a local string variable comes without warranty that the contents will still be available when the caller wants to access them! Sure, you cannot pick the address of the returned object and save it for future use. Just as with the case currently in error.h for C, the result should be consumed immediately. If you need to keep it, you can naturally write std::string keep_result = av_make_error_string(42); Enjoy, Alex Cohn From onemda at gmail.com Wed Jan 16 16:55:46 2013 From: onemda at gmail.com (Paul B Mahol) Date: Wed, 16 Jan 2013 15:55:46 +0000 Subject: [Libav-user] encoder frame_size for AV_CODEC_ID_PCM_S16BE In-Reply-To: <50F6BFCA.8010605@sokolov.me> References: <50F6BFCA.8010605@sokolov.me> Message-ID: On 1/16/13, Pavel Sokolov wrote: > Hi! > > I need to encode audio with AV_CODEC_ID_PCM_S16BE codec. > Which "frame_size" is right? > number of samples per channel * channels * 2 > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > From wagner.patriota at gmail.com Wed Jan 16 18:55:29 2013 From: wagner.patriota at gmail.com (Wagner Patriota) Date: Wed, 16 Jan 2013 15:55:29 -0200 Subject: [Libav-user] Can sws_scale() mirror the frame? Message-ID: After decoding videos I get the frame upside down after sws_scale() from H.264 pixel format to AV_PIX_FMT_RGB24. And then I fix it, of course. Is there a way (some flags or some similar pixel format) for me to fix it with sws_scale() in a single shot? So I would not need my additional step. Thank you -------------- next part -------------- An HTML attachment was scrubbed... URL: From cehoyos at ag.or.at Wed Jan 16 23:42:57 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Wed, 16 Jan 2013 22:42:57 +0000 (UTC) Subject: [Libav-user] =?utf-8?q?Can_sws=5Fscale=28=29_mirror_the_frame=3F?= References: Message-ID: Wagner Patriota writes: > After decoding videos I get the frame upside down after > sws_scale() from H.264 pixel format to AV_PIX_FMT_RGB24. Pass a negative linesize (and an appropriately fixed starting pointer). ("Mirror" usually means horizontal flip, "flip" is vertical) Carl Eugen From harald.jordan at redstream.at Thu Jan 17 11:52:26 2013 From: harald.jordan at redstream.at (Harald Jordan) Date: Thu, 17 Jan 2013 11:52:26 +0100 Subject: [Libav-user] qmin qmax qscale settings when encoding always from raw yuv frames Message-ID: <012101cdf4a0$bd9c3c50$38d4b4f0$@redstream.at> Hi! As far as I was able to learn by now, the qmin and qmax settings relate very much to the quality of the input. Well, here is the first problem for me. The input for an encoder is anyway always a decoded frame, so it always has the "perfect" quality. So assumed we always want to have the best available quality, basically the assumption that the qscale settings depend on your input is not correct, right? Now, when I write an encoder using libavcodec that is always fed from yuv422p pictures, what sense do those settings make? Thanks for any Input J Harry -------------- next part -------------- An HTML attachment was scrubbed... URL: From rjvbertin at gmail.com Thu Jan 17 15:15:27 2013 From: rjvbertin at gmail.com (=?iso-8859-1?Q?=22Ren=E9_J=2EV=2E_Bertin=22?=) Date: Thu, 17 Jan 2013 15:15:27 +0100 Subject: [Libav-user] qmin qmax qscale settings when encoding always from raw yuv frames In-Reply-To: <012101cdf4a0$bd9c3c50$38d4b4f0$@redstream.at> References: <012101cdf4a0$bd9c3c50$38d4b4f0$@redstream.at> Message-ID: <7A0006E8-AB42-4D29-8C06-FFB8DEFDFC1C@gmail.com> On Jan 17, 2013, at 11:52, Harald Jordan wrote: > first problem for me. The input for an encoder is anyway always a decoded frame, so it always has the ?perfect? quality. So assumed we always want to have the best available quality, basically the assumption that the qscale settings depend on your input is not correct, right? Not exactly, I think - at least not for input that is decoded from a lossy compression method. It is my experience (using existing software, not tweaking qmin/qmax/qscale) that such re-encoding such frames with too high a quality setting can be counterproductive. I think of it as exaggerating the (de)compression artefacts that can result in a file size increase rather than decrease. > Now, when I write an encoder using libavcodec that is always fed from yuv422p pictures, what sense do those settings make? Control the level of detail in (and the size of) your encoded content, I presume? R From njahnke at gmail.com Fri Jan 18 00:45:02 2013 From: njahnke at gmail.com (Nathan Jahnke) Date: Thu, 17 Jan 2013 17:45:02 -0600 Subject: [Libav-user] stereo AAC decoding: right channel is silence Message-ID: Maybe someone can help me spot my error. It's a simple program that decodes a stereo AAC stream inside an mp4 container. I tried compiling and linking against both ffmpeg-1.1 and current git. In both cases I get all 0's where I should have the decoded right channel samples in the buffer. However, the standalone ffmpeg binary can decode both channels OK, so I know it is my error somewhere. http://nate.quandra.org/decode.c http://nate.quandra.org/input.mp4 My output is: AAC (Advanced Audio Coding): codec id 86018 counted 11318428 zeroes (50.223339%) The right channel is silent, thus all the 0's. But if I use the standalone ffmpeg binary: ffmpeg -i input.mp4 output.wav ... the right channel is OK in the output file. Thanks in advance for any advice. Nathan From mike at mikeversteeg.com Fri Jan 18 13:55:41 2013 From: mike at mikeversteeg.com (Mike Versteeg) Date: Fri, 18 Jan 2013 13:55:41 +0100 Subject: [Libav-user] recording with uncompressed audio speeds up video Message-ID: I have been using a recorder (based on muxer example) satisfactorily for quite some time for various formats. Now I need to use uncompressed audio to go with MJPEG video and I notice video speeds up considerable (like 10 times as fast) in the recorded file. Audio is OK, and if I use a compressed audio format (like mp3) video is fine as always. Does anyone have an idea why video speeds up the moment I use uncompresseed audio (CODEC_ID_PCM_S16LE)? Mike Versteeg mikeversteeg.com From francesco at bltitalia.com Fri Jan 18 17:12:47 2013 From: francesco at bltitalia.com (francesco at bltitalia.com) Date: Fri, 18 Jan 2013 17:12:47 +0100 (added by postmaster@virgilio.it) Subject: [Libav-user] Deprecated flag CODEC_FLAG2_INTRA_VLC and CODEC_FLAG2_NON_LINEAR_QUANT Message-ID: <50F0961500B3C97B@vsmtp4.tin.it> (added by postmaster@virgilio.it) Hi to all I update my project from ffmpeg libavcodec library version 0.7.11 to the 1.0 one. In this last the flags CODEC_FLAG2_INTRA_VLC and CODEC_FLAG2_NON_LINEAR_QUANT are deprecated and not defined at all. When I compress in mpeg2 4:2:2 format the output is unreadable for QT (white screen), while if I use the old libavcodec libraries with these flags set all is ok. Which flag replace the CODEC_FLAG2_INTRA_VLC and CODEC_FLAG2_NON_LINEAR_QUANT one ? Thanks From cehoyos at ag.or.at Fri Jan 18 18:59:16 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Fri, 18 Jan 2013 17:59:16 +0000 (UTC) Subject: [Libav-user] =?utf-8?q?Deprecated_flag_CODEC=5FFLAG2=5FINTRA=5FVL?= =?utf-8?q?C_and_CODEC=5FFLAG2=5FNON=5FLINEAR=5FQUANT?= References: <19573.2547239915$1358525590@news.gmane.org> Message-ID: writes: > I update my project from ffmpeg libavcodec library > version 0.7.11 to the 1.0 one. In this last the flags > CODEC_FLAG2_INTRA_VLC and CODEC_FLAG2_NON_LINEAR_QUANT > are deprecated and not defined at all. When I compress > in mpeg2 4:2:2 format the output is unreadable for QT > (white screen) It is difficult to parse your mail. Apart from the fact that 1.0 is (nearly) outdated now: Are the mentioned flags deprecated or not defined at all? Is the mpeg2 problem related to the flags? Is it reproducible with ffmpeg (the executable). (Does QuickTime really support 4:2:2?) Carl Eugen From cehoyos at ag.or.at Fri Jan 18 19:11:53 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Fri, 18 Jan 2013 18:11:53 +0000 (UTC) Subject: [Libav-user] =?utf-8?q?Deprecated_flag_CODEC=5FFLAG2=5FINTRA=5FVL?= =?utf-8?q?C_and_CODEC=5FFLAG2=5FNON=5FLINEAR=5FQUANT?= References: <19573.2547239915$1358525590@news.gmane.org> Message-ID: writes: > Which flag replace the CODEC_FLAG2_INTRA_VLC and This is now the mpeg-encoding specific option "intra_vlc". > CODEC_FLAG2_NON_LINEAR_QUANT one ? This mpeg-_2_-specific encoding option is called "non_linear_quant". Carl Eugen From jmorgie at yahoo.com Sat Jan 19 16:17:28 2013 From: jmorgie at yahoo.com (jim morgenstern) Date: Sat, 19 Jan 2013 10:17:28 -0500 Subject: [Libav-user] How to specify output format Message-ID: <01b701cdf658$18715d50$495417f0$@yahoo.com> I have C++ app [win 7] ?that is reading and writing video/audio stream. When I specify the output file as xxxx.MOV I am getting H264 compressed video at 24 fps. I want to have output as uncompressed at 30 or 60 fps according to the input. Some simple [I hope] questions: ? What is [where can I find] the mapping between file name extension and format used? ? Can I specify the output format I want rather than using av_guess_format ?? all the tutorials use guess ? What is your recommended format for uncompressed HD video ? thanks Jim Morgenstern Image Mining LLC 248-252-2626 From sender at ImageMining.net Sat Jan 19 07:55:22 2013 From: sender at ImageMining.net (Jim Morgenstern) Date: Sat, 19 Jan 2013 01:55:22 -0500 Subject: [Libav-user] How to specify output format Message-ID: <015501cdf611$f3b7ac30$db270490$@ImageMining.net> I have C++ app [win 7] that is reading and writing video/audio stream. When I specify the output file as xxxx.MOV I am getting H264 compressed video at 24 fps. I want to have output as uncompressed at 30 or 60 fps according to the input. Some simple [I hope] questions: . What is [where can I find] the mapping between file name extension and format used? . Can I specify the output format I want rather than using av_guess_format ? all the tutorials use guess . What is your recommended format for uncompressed HD video ? thanks Jim Morgenstern Image Mining LLC 248-252-2626 -------------- next part -------------- An HTML attachment was scrubbed... URL: From p3070011 at dias.aueb.gr Mon Jan 21 01:52:59 2013 From: p3070011 at dias.aueb.gr (Vitsas Nikolaos) Date: Mon, 21 Jan 2013 02:52:59 +0200 Subject: [Libav-user] Encoding and Decoding on separate ends Message-ID: Hi, I want to be able to open a video file on one end, encode it to h264 and then send it over RTP(custom library) to another end for decoding. I am not sure how exactly I am going to open the AVFormatContext and AVCodecContext on the receiving end. I am able to serialize AVPackets correctly. I am new to libav* and I can' t see how I need to initialize the AVFormat state on the decoding side. Thank you! From sangitachowdhary at gmail.com Mon Jan 21 06:32:02 2013 From: sangitachowdhary at gmail.com (sangeeta chowdhary) Date: Mon, 21 Jan 2013 11:02:02 +0530 Subject: [Libav-user] Need Help to execute demo program In-Reply-To: References: Message-ID: Hi Team, Which library I am missing ? [root at node2 ffmpeginstaller.7.4]# gcc -I/usr/src/ffmpegscript/ffmpeg/ test.c -L/usr/src/ffmpegscript/mplayer/ffmpeg/libavformat/ -lavformat -L/usr/src/ffmpegscript/mplayer/ffmpeg/libavcodec/ -lavcodec -L/usr/src/ffmpegscript/mplayer/ffmpeg/libswscale/ -lswscale -L/usr/src/ffmpegscript/mplayer/ffmpeg/libavutil/ -lavutil /usr/src/ffmpegscript/mplayer/ffmpeg/libavformat//libavformat.a(swfdec.o): In function `swf_read_packet': swfdec.c:(.text+0x89f): undefined reference to `uncompress' /usr/src/ffmpegscript/mplayer/ffmpeg/libavformat//libavformat.a(swfdec.o): In function `swf_read_header': swfdec.c:(.text+0xd5d): undefined reference to `inflateInit_' /usr/src/ffmpegscript/mplayer/ffmpeg/libavformat//libavformat.a(swfdec.o): In function `zlib_refill': swfdec.c:(.text+0xeab): undefined reference to `inflate' /usr/src/ffmpegscript/mplayer/ffmpeg/libavformat//libavformat.a(swfdec.o): In function `swf_read_close': swfdec.c:(.text.unlikely+0xa): undefined reference to `inflateEnd' /usr/src/ffmpegscript/mplayer/ffmpeg/libavcodec//libavcodec.a(atrac3.o): In function `atrac3_decode_init': atrac3.c:(.text.unlikely+0xb9): undefined reference to `sin' atrac3.c:(.text.unlikely+0xf6): undefined reference to `sin' atrac3.c:(.text.unlikely+0x220): undefined reference to `exp2f' atrac3.c:(.text.unlikely+0x24d): undefined reference to `exp2f' /usr/src/ffmpegscript/mplayer/ffmpeg/libavcodec//libavcodec.a(binkaudio.o): In function `decode_init': binkaudio.c:(.text.unlikely+0x1fe): undefined reference to `expf' /usr/src/ffmpegscript/mplayer/ffmpeg/libavcodec//libavcodec.a(cngdec.o): In function `cng_decode_frame': cngdec.c:(.text+0x3c3): undefined reference to `pow' /usr/src/ffmpegscript/mplayer/ffmpeg/libavcodec//libavcodec.a(cngenc.o): In function `cng_encode_frame': cngenc.c:(.text+0xa3): undefined reference to `log10' /usr/src/ffmpegscript/mplayer/ffmpeg/libavcodec//libavcodec.a(cook.o): In function `cook_decode_init': cook.c:(.text.unlikely+0x64d): undefined reference to `pow' cook.c:(.text.unlikely+0x679): undefined reference to `pow' cook.c:(.text.unlikely+0x6d2): undefined reference to `pow' /usr/src/ffmpegscript/mplayer/ffmpeg/libavcodec//libavcodec.a(cscd.o): In function `decode_frame': cscd.c:(.text+0x226): undefined reference to `uncompress' /usr/src/ffmpegscript/mplayer/ffmpeg/libavcodec//libavcodec.a(dct.o): In function `ff_dct_init': dct.c:(.text.unlikely+0x10c): undefined reference to `sin' /usr/src/ffmpegscript/mplayer/ffmpeg/libavcodec//libavcodec.a(dxa.o): In function `decode_frame': dxa.c:(.text+0x6dc): undefined reference to `uncompress' /usr/src/ffmpegscript/mplayer/ffmpeg/libavcodec//libavcodec.a(exr.o): In function `decode_frame': exr.c:(.text+0x14ae): undefined reference to `uncompress' /usr/src/ffmpegscript/mplayer/ffmpeg/libavcodec//libavcodec.a(fft_float.o): In function `ff_init_ff_cos_tabs': fft_float.c:(.text.unlikely+0x7a): undefined reference to `cos' On Mon, Jan 14, 2013 at 1:36 PM, sangeeta chowdhary < sangitachowdhary at gmail.com> wrote: > [root at node2 ffmpeginstaller.7.4]# gcc -I/usr/src/ffmpegscript/ffmpeg/ > test.c -L/usr/src/ffmpegscript/ffmpeg/ -l avformat > /usr/bin/ld: cannot find -lavformat > collect2: ld returned 1 exit status > > > On Mon, Jan 14, 2013 at 1:34 PM, ??? Joy Woo wrote: > >> gcc -I/usr/src/ffmpegscript/ffmpeg/ test.c >> -L/usr/src/ffmpegscript/ffmpeg/ -l avformat > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From francesco at bltitalia.com Mon Jan 21 09:53:27 2013 From: francesco at bltitalia.com (francesco at bltitalia.com) Date: Mon, 21 Jan 2013 09:53:27 +0100 (added by postmaster@virgilio.it) Subject: [Libav-user] =?utf-8?q?Deprecated_flag_CODEC=5FFLAG2=5FINTRA=5FVL?==?utf -8?q?C_and_CODEC=5FFLAG2=5FNON=5FLINEAR=5FQUANT?= Message-ID: <50AA345D07A0A926@vsmtp12.tin.it> (added by postmaster@virgilio.it) At 17.59 18/01/2013 +0000, you wrote: > writes: > >> I update my project from ffmpeg libavcodec library >> version 0.7.11 to the 1.0 one. In this last the flags >> CODEC_FLAG2_INTRA_VLC and CODEC_FLAG2_NON_LINEAR_QUANT >> are deprecated and not defined at all. When I compress >> in mpeg2 4:2:2 format the output is unreadable for QT >> (white screen) > >It is difficult to parse your mail. >Apart from the fact that 1.0 is (nearly) outdated now: >Are the mentioned flags deprecated or not defined at all? >Is the mpeg2 problem related to the flags? Is it >reproducible with ffmpeg (the executable). > >(Does QuickTime really support 4:2:2?) > >Carl Eugen > >_______________________________________________ >Libav-user mailing list >Libav-user at ffmpeg.org >http://ffmpeg.org/mailman/listinfo/libav-user > Dear Mr Eugen I apologize if I was not clear in explaination. I am using ffmpeg libraries inside my code (not using the ffmpeg.exe) in order to create a mov file both in D10 and in xdcam format for avid. Using old libraries the final file works, that is you can see it on QT and importing it on avid. Inserting new libraries, the result is in a white screen. With the new libraries, the only difference is in settings flag2, that is the original code: pQTCodecCtx->flags = CODEC_FLAG_INTERLACED_DCT | CODEC_CAP_AUTO_THREADS; ; pQTCodecCtx->flags |= CODEC_FLAG_LOW_DELAY; // Specific for AVID IMX 50 pQTCodecCtx->flags2 = CODEC_FLAG2_INTRA_VLC | CODEC_FLAG2_NON_LINEAR_QUANT; is changed bypassing the last line (the two codec flag are not defined at all). Now the result is that the final mov file doesn't work (white screen on QT and on avid media composer). If you give me your mail I can send you the piece of code with all settings. best regards From srinath3142 at gmail.com Mon Jan 21 10:59:07 2013 From: srinath3142 at gmail.com (Srinath M) Date: Mon, 21 Jan 2013 15:29:07 +0530 Subject: [Libav-user] undefined reference errors from linker Message-ID: Hi I am using ffmpeg version 0.11.1 with Ubuntu 10.04 I get the following linker errors when i try to compile a program tld.c:(.text+0x1a7): undefined reference to `avformat_network_init' tld.c:(.text+0x1c9): undefined reference to `avformat_open_input' tld.c:(.text+0x1dc): undefined reference to `avformat_find_stream_info' tld.c:(.text+0x255): undefined reference to `avcodec_open2' tld.c:(.text+0x333): undefined reference to `avcodec_decode_video2' tld.c:(.text+0x525): undefined reference to `avcodec_decode_video2' Which version of ffmpeg should i be using? is this a ffmpeg issue in the first place? -------------- next part -------------- An HTML attachment was scrubbed... URL: From cehoyos at ag.or.at Mon Jan 21 11:13:57 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Mon, 21 Jan 2013 10:13:57 +0000 (UTC) Subject: [Libav-user] undefined reference errors from linker References: Message-ID: Srinath M writes: > I am using ffmpeg version 0.11.1 with Ubuntu 10.04 This is a bit outdated. If you are a user, please update to current git head, if you are a distributor, please choose 1.1.1. Carl Eugen From pavel at sokolov.me Mon Jan 21 12:40:48 2013 From: pavel at sokolov.me (Pavel Sokolov) Date: Mon, 21 Jan 2013 15:40:48 +0400 Subject: [Libav-user] Reset AVFilterContext* after seeking Message-ID: <50FD2940.6090402@sokolov.me> Hi! I have filter: asetnsamples=n=320 I need to reset AVFilterContext* after seeking. Now i'm doing it like this: AVFilterBufferRef *ref = NULL; while (true){ int ret = av_buffersink_get_buffer_ref(_sinkFilter, &ref, 0); if (ret >= 0){ avfilter_unref_buffer(ref); } else { break; } } But there is some problem. Filter stores PTS inside it and next av_buffersink_get_buffer_ref() will return buffer with old PTS value. How to properly reset filter? From stefasab at gmail.com Mon Jan 21 13:49:35 2013 From: stefasab at gmail.com (Stefano Sabatini) Date: Mon, 21 Jan 2013 13:49:35 +0100 Subject: [Libav-user] How to specify output format In-Reply-To: <015501cdf611$f3b7ac30$db270490$@ImageMining.net> References: <015501cdf611$f3b7ac30$db270490$@ImageMining.net> Message-ID: <20130121124935.GV9458@arborea> In data Saturday 2013-01-19 01:55:22 -0500, Jim Morgenstern ha scritto: > I have C++ app [win 7] that is reading and writing video/audio stream. > > > > When I specify the output file as xxxx.MOV I am getting H264 compressed > video at 24 fps. > > > > I want to have output as uncompressed at 30 or 60 fps according to the > input. > > > > Some simple [I hope] questions: > > . What is [where can I find] the mapping between file name extension > and format used? In the source code, or you can show the ".extensions" field for all the registered AVInput/OutputFormats. > > . Can I specify the output format I want rather than using > av_guess_format ? all the tutorials use guess Yes, you need to specify avformat_alloc_output_context2() and rely on oformat/format_name parameters, or use av_guess_format(). > > . What is your recommended format for uncompressed HD video ? libx264 is the state of the art encoder (but it has licensing constraints). From stefasab at gmail.com Mon Jan 21 13:51:28 2013 From: stefasab at gmail.com (Stefano Sabatini) Date: Mon, 21 Jan 2013 13:51:28 +0100 Subject: [Libav-user] undefined reference errors from linker In-Reply-To: References: Message-ID: <20130121125128.GW9458@arborea> In data Monday 2013-01-21 15:29:07 +0530, Srinath M ha scritto: > Hi > > I am using ffmpeg version 0.11.1 with Ubuntu 10.04 > I get the following linker errors when i try to compile a program > tld.c:(.text+0x1a7): undefined reference to `avformat_network_init' > tld.c:(.text+0x1c9): undefined reference to `avformat_open_input' > tld.c:(.text+0x1dc): undefined reference to `avformat_find_stream_info' > tld.c:(.text+0x255): undefined reference to `avcodec_open2' > tld.c:(.text+0x333): undefined reference to `avcodec_decode_video2' > tld.c:(.text+0x525): undefined reference to `avcodec_decode_video2' > > Which version of ffmpeg should i be using? > is this a ffmpeg issue in the first place? Check doc/examples/Makefile, you should rely on pkg-config unless you really know what you're doing. A basic knowledge of linking/Makefile may also help. From stefasab at gmail.com Mon Jan 21 13:52:59 2013 From: stefasab at gmail.com (Stefano Sabatini) Date: Mon, 21 Jan 2013 13:52:59 +0100 Subject: [Libav-user] Reset AVFilterContext* after seeking In-Reply-To: <50FD2940.6090402@sokolov.me> References: <50FD2940.6090402@sokolov.me> Message-ID: <20130121125259.GX9458@arborea> In data Monday 2013-01-21 15:40:48 +0400, Pavel Sokolov ha scritto: > Hi! > > I have filter: asetnsamples=n=320 > > I need to reset AVFilterContext* after seeking. > > Now i'm doing it like this: > > AVFilterBufferRef *ref = NULL; > while (true){ > int ret = av_buffersink_get_buffer_ref(_sinkFilter, &ref, 0); > if (ret >= 0){ > avfilter_unref_buffer(ref); > } else { > break; > } > } > > But there is some problem. Filter stores PTS inside it and next > av_buffersink_get_buffer_ref() will return buffer with old PTS > value. > > How to properly reset filter? You may need to implement a command called "reset" or such (see process_command API). Patches/feature requests are welcome. From DSchere at skylinenet.net Mon Jan 21 14:15:11 2013 From: DSchere at skylinenet.net (DSchere at skylinenet.net) Date: Mon, 21 Jan 2013 08:15:11 -0500 Subject: [Libav-user] Possible infinite loop in libavcodec/h264.c Message-ID: <4A5D39451BA90342930681D4B481B52118C947D2B9@mail-btp-svr2.skyline.local> Hello, I am tracking down a memory leak in vlc where within a matter of seconds vlc consumes over 14G of memory, the problem is intermittent. I think that the problem may be an infinite loop in libavcodec/h264.c at around line 1894 inside a while loop that allocates frames: if(h0->current_slice == 0){ while(h->frame_num != h->prev_frame_num && h->frame_num != (h->prev_frame_num+1)%(1<sps.log2_max_frame_num)){ Picture *prev = h->short_ref_count ? h->short_ref[0] : NULL; av_log(h->s.avctx, AV_LOG_DEBUG, "Frame num gap %d %d\n", h->frame_num, h->prev_frame_num); if (ff_h264_frame_start(h) < 0) return -1; h->prev_frame_num++; h->prev_frame_num %= 1<sps.log2_max_frame_num; s->current_picture_ptr->frame_num= h->prev_frame_num; ff_generate_sliding_window_mmcos(h); ff_h264_execute_ref_pic_marking(h, h->mmco, h->mmco_index); /* Error concealment: if a ref is missing, copy the previous ref in its place. * FIXME: avoiding a memcpy would be nice, but ref handling makes many assumptions * about there being no actual duplicates. * FIXME: this doesn't copy padding for out-of-frame motion vectors. Given we're * concealing a lost frame, this probably isn't noticable by comparison, but it should * be fixed. */ if (h->short_ref_count) { if (prev) { av_image_copy(h->short_ref[0]->data, h->short_ref[0]->linesize, (const uint8_t**)prev->data, prev->linesize, s->avctx->pix_fmt, s->mb_width*16, s->mb_height*16); h->short_ref[0]->poc = prev->poc+2; } h->short_ref[0]->frame_num = h->prev_frame_num; } } What I did was created some diagnostic code which tracked the pointers from p_picture structures allocated from within VLC per thread. If the number of pictures allocated over one second exceeded a threshold (100 pictures) a flag was set that would raise an exception on the next allocation, this would in turn force a stack trace in gdb: (gdb) (gdb) where #0 0x00007ffff69e9a75 in *__GI_raise (sig=) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64 #1 0x00007ffff69ed5c0 in *__GI_abort () at abort.c:92 #2 0x00007ffff69e2941 in *__GI___assert_fail (assertion=0x7ffff6286c50 "p->i_owner_tid != AllocTidTrap", file=, line=893, function=0x7ffff6286cf0 "onPictAlloc") at assert.c:81 #3 0x00007ffff6214f38 in onPictAlloc (p=0x7ffff0304a30) at video_output/vout_pictures.c:893 #4 0x00007ffff6215287 in picture_NewFromResource (p_fmt=0x10a87e8, p_resource=0x0) at video_output/vout_pictures.c:983 #5 0x00007ffff62152bc in picture_NewFromFormat (p_fmt=0x10a87e8) at video_output/vout_pictures.c:992 #6 0x00007ffff41ceb4b in video_new_buffer_decoder (p_dec=0x10a85d8) at video.c:101 #7 0x00007ffff61dcbb4 in decoder_NewPicture (p_decoder=0x10a85d8) at input/decoder.c:187 #8 0x00007fffe345e47c in ffmpeg_NewPictBuf (p_dec=0x10a85d8, p_context=0xc699c0) at video.c:185 #9 0x00007fffe345ff03 in ffmpeg_GetFrameBuf (p_context=0xc699c0, p_ff_pic=0xc38730) at video.c:972 #10 0x00007fffe2988bc2 in alloc_frame_buffer (s=0x1899a080, pic=0xc38730) at libavcodec/mpegvideo.c:230 #11 0x00007fffe2988dd4 in ff_alloc_picture (s=0x1899a080, pic=0xc38730, shared=0) at libavcodec/mpegvideo.c:272 #12 0x00007fffe298c6e1 in MPV_frame_start (s=0x1899a080, avctx=0xc699c0) at libavcodec/mpegvideo.c:962 #13 0x00007fffe2866167 in ff_h264_frame_start (h=0x1899a080) at libavcodec/h264.c:920 #14 0x00007fffe286a4eb in decode_slice_header (h=0x1899a080, h0=0x1899a080) at libavcodec/h264.c:1897 #15 0x00007fffe286ec48 in decode_nal_units (h=0x1899a080, buf=0x56492e0 "", buf_size=5227) at libavcodec/h264.c:2849 #16 0x00007fffe286f3d0 in decode_frame (avctx=0xc699c0, data=0x245c060, data_size=0x7ffff412db70, avpkt=0x7ffff412daf0) at libavcodec/h264.c:3016 #17 0x00007fffe2a5741b in avcodec_decode_video2 (avctx=0xc699c0, picture=0x245c060, got_picture_ptr=0x7ffff412db70, avpkt=0x7ffff412daf0) at libavcodec/utils.c:667 #18 0x00007fffe345f237 in DecodeVideo (p_dec=0x10a85d8, pp_block=0x7ffff412dbb8) at video.c:560 #19 0x00007ffff41d108d in transcode_video_process (p_stream=0xc1fec8, id=0xef0290, in=0x5649270, out=0x7ffff412dcf0) at video.c:622 #20 0x00007ffff41cc0a9 in Send (p_stream=0xc1fec8, id=0xef0290, p_buffer=0x5649270) at transcode.c:712 #21 0x00007ffff6265149 in sout_InputSendBuffer (p_input=0x155b9180, p_buffer=0x5649270) at stream_output/stream_output.c:283 #22 0x00007ffff61e0454 in DecoderPlaySout (p_dec=0xc65318, p_sout_block=0x5649270, b_telx=false) at input/decoder.c:1660 #23 0x00007ffff61e088e in DecoderProcessSout (p_dec=0xc65318, p_block=0x7ffff00042e0) at input/decoder.c:1784 #24 0x00007ffff61e0f78 in DecoderProcess (p_dec=0xc65318, p_block=0x7ffff00042e0) at input/decoder.c:1984 #25 0x00007ffff61de73c in DecoderThread (p_this=0xc65318) at input/decoder.c:892 #26 0x00007ffff6244a89 in thread_entry (data=0xeecc650) at misc/threads.c:58 #27 0x00007ffff7bc69ca in start_thread (arg=) at pthread_create.c:300 #28 0x00007ffff6a9f16d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112 #29 0x0000000000000000 in ?? () The version of my Linux kernel does not support per thread memory statistics so this was the only way I could hunt down the leak. Any suggestions on a work around? Since I am not familiar with the code I think the best thing I can do in the meantime is setup a counter inside this wile loop in h264.c and if the count exceeds over 100 exit with an error and have VLC stop and start the stream. [cid:image001.jpg at 01CDF7AD.DC674250] David Schere Software Developer 508 - F McCormick Dr. 410.553.2600 x2040 (Office) 410.608.2618 (Cell) "No Limits" http://www.skylinenolimits.com "Skyline Network Engineering, LLC is now Skyline Technology Solutions" A member of the[cid:image002.jpg at 01CDF7AD.DC674250] P Please don't print this e-mail unless you really need to! CONFIDENTIALITY NOTICE: The information contained in this electronic message is confidential information intended for the use of the individual or entity named above. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this electronic message to the intended recipient, you are hereby notified that any dissemination or copying of this communication is strictly prohibited. If this message contains non-public personal information about any consumer or customer of the sender or intended recipient, you are further prohibited under penalty of law from using or disclosing the information to any third party by provisions of the federal Gramm-Leach-Bliley Act. If you have received this electronic message in error, please immediately notify us by telephone and return or destroy the original message to assure that it is not read, copied, or distributed by others. ________________________________ CONFIDENTIALITY NOTICE: The information contained in this electronic message is confidential information intended for the use of the individual or entity named above. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this electronic message to the intended recipient, you are hereby notified that any dissemination or copying of this communication is strictly prohibited. If this message contains non-public personal information about any consumer or customer of the sender or intended recipient, you are further prohibited under penalty of law from using or disclosing the information to any third party by provisions of the federal Gramm-Leach-Bliley Act. If you have received this electronic message in error, please immediately notify us by telephone and return or destroy the original message to assure that it is not read, copied, or distributed by others. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.jpg Type: image/jpeg Size: 2209 bytes Desc: image001.jpg URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image002.jpg Type: image/jpeg Size: 2443 bytes Desc: image002.jpg URL: From jmorgie at yahoo.com Mon Jan 21 15:37:41 2013 From: jmorgie at yahoo.com (jim morgenstern) Date: Mon, 21 Jan 2013 09:37:41 -0500 Subject: [Libav-user] How to specify output format In-Reply-To: <20130121124935.GV9458@arborea> References: <015501cdf611$f3b7ac30$db270490$@ImageMining.net> <20130121124935.GV9458@arborea> Message-ID: <030a01cdf7e4$de8bcb00$9ba36100$@yahoo.com> >> where can I find the list of formats and their extensions? > In the source code Yes but the source code is hundreds of files; can you tell me which one has the list and the mapping? > > . What is your recommended format for uncompressed HD video ? > > libx264 is the state of the art encode But I do not want any encoding or compression: I want flat file that can be read later on for more processing. So is there a recommendation for a particular file format that does this? > -----Original Message----- > From: libav-user-bounces at ffmpeg.org [mailto:libav-user-bounces at ffmpeg.org] > On Behalf Of Stefano Sabatini > Sent: Monday, January 21, 2013 7:50 AM > To: This list is about using libavcodec, libavformat, libavutil, libavdevice and > libavfilter. > Subject: Re: [Libav-user] How to specify output format > > In data Saturday 2013-01-19 01:55:22 -0500, Jim Morgenstern ha scritto: > > I have C++ app [win 7] that is reading and writing video/audio stream. > > > > > > > > When I specify the output file as xxxx.MOV I am getting H264 > > compressed video at 24 fps. > > > > > > > > I want to have output as uncompressed at 30 or 60 fps according to the > > input. > > > > > > > > Some simple [I hope] questions: > > > > . What is [where can I find] the mapping between file name extension > > and format used? > > In the source code, or you can show the ".extensions" field for all the registered > AVInput/OutputFormats. > > > > > . Can I specify the output format I want rather than using > > av_guess_format ? all the tutorials use guess > > Yes, you need to specify avformat_alloc_output_context2() and rely on > oformat/format_name parameters, or use av_guess_format(). > > > > > . What is your recommended format for uncompressed HD video ? > > libx264 is the state of the art encoder (but it has licensing constraints). > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user From onemda at gmail.com Mon Jan 21 15:50:24 2013 From: onemda at gmail.com (Paul B Mahol) Date: Mon, 21 Jan 2013 14:50:24 +0000 Subject: [Libav-user] How to specify output format In-Reply-To: <030a01cdf7e4$de8bcb00$9ba36100$@yahoo.com> References: <015501cdf611$f3b7ac30$db270490$@ImageMining.net> <20130121124935.GV9458@arborea> <030a01cdf7e4$de8bcb00$9ba36100$@yahoo.com> Message-ID: On 1/21/13, jim morgenstern wrote: >>> where can I find the list of formats and their extensions? >> In the source code > > Yes but the source code is hundreds of files; can you tell me which one > has > the list and the mapping? > > >> > . What is your recommended format for uncompressed HD video ? >> >> libx264 is the state of the art encode > > But I do not want any encoding or compression: I want flat file that can > be > read later on for more processing. So is there a recommendation for a > particular file format that does this? Depends on what you gonna use for more processing later. Depending on available storage and CPU speed you could use raw video formats... > > > > >> -----Original Message----- >> From: libav-user-bounces at ffmpeg.org >> [mailto:libav-user-bounces at ffmpeg.org] >> On Behalf Of Stefano Sabatini >> Sent: Monday, January 21, 2013 7:50 AM >> To: This list is about using libavcodec, libavformat, libavutil, > libavdevice and >> libavfilter. >> Subject: Re: [Libav-user] How to specify output format >> >> In data Saturday 2013-01-19 01:55:22 -0500, Jim Morgenstern ha scritto: >> > I have C++ app [win 7] that is reading and writing video/audio stream. >> > >> > >> > >> > When I specify the output file as xxxx.MOV I am getting H264 >> > compressed video at 24 fps. >> > >> > >> > >> > I want to have output as uncompressed at 30 or 60 fps according to the >> > input. >> > >> > >> > >> > Some simple [I hope] questions: >> > >> > . What is [where can I find] the mapping between file name > extension >> > and format used? >> >> In the source code, or you can show the ".extensions" field for all the > registered >> AVInput/OutputFormats. >> >> > >> > . Can I specify the output format I want rather than using >> > av_guess_format ? all the tutorials use guess >> >> Yes, you need to specify avformat_alloc_output_context2() and rely on >> oformat/format_name parameters, or use av_guess_format(). >> >> > >> > . What is your recommended format for uncompressed HD video ? >> >> libx264 is the state of the art encoder (but it has licensing > constraints). >> _______________________________________________ >> 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 jmorgie at yahoo.com Mon Jan 21 16:20:32 2013 From: jmorgie at yahoo.com (jim morgenstern) Date: Mon, 21 Jan 2013 10:20:32 -0500 Subject: [Libav-user] How to specify output format In-Reply-To: References: <015501cdf611$f3b7ac30$db270490$@ImageMining.net> <20130121124935.GV9458@arborea> <030a01cdf7e4$de8bcb00$9ba36100$@yahoo.com> Message-ID: <032601cdf7ea$dae21530$90a63f90$@yahoo.com> So what Specifically is the specific format extension that I give to ffmpeg that gives me the "raw video format" you cited? > -----Original Message----- > From: libav-user-bounces at ffmpeg.org [mailto:libav-user-bounces at ffmpeg.org] > On Behalf Of Paul B Mahol > Sent: Monday, January 21, 2013 9:50 AM > To: This list is about using libavcodec, libavformat, libavutil, libavdevice and > libavfilter. > Subject: Re: [Libav-user] How to specify output format > > On 1/21/13, jim morgenstern wrote: > >>> where can I find the list of formats and their extensions? > >> In the source code > > > > Yes but the source code is hundreds of files; can you tell me which > > one has the list and the mapping? > > > > > >> > . What is your recommended format for uncompressed HD video ? > >> > >> libx264 is the state of the art encode > > > > But I do not want any encoding or compression: I want flat file that > > can be read later on for more processing. So is there a > > recommendation for a particular file format that does this? > > Depends on what you gonna use for more processing later. > Depending on available storage and CPU speed you could use raw video > formats... > > > > > > > > > > >> -----Original Message----- > >> From: libav-user-bounces at ffmpeg.org > >> [mailto:libav-user-bounces at ffmpeg.org] > >> On Behalf Of Stefano Sabatini > >> Sent: Monday, January 21, 2013 7:50 AM > >> To: This list is about using libavcodec, libavformat, libavutil, > > libavdevice and > >> libavfilter. > >> Subject: Re: [Libav-user] How to specify output format > >> > >> In data Saturday 2013-01-19 01:55:22 -0500, Jim Morgenstern ha scritto: > >> > I have C++ app [win 7] that is reading and writing video/audio stream. > >> > > >> > > >> > > >> > When I specify the output file as xxxx.MOV I am getting H264 > >> > compressed video at 24 fps. > >> > > >> > > >> > > >> > I want to have output as uncompressed at 30 or 60 fps according to > >> > the input. > >> > > >> > > >> > > >> > Some simple [I hope] questions: > >> > > >> > . What is [where can I find] the mapping between file name > > extension > >> > and format used? > >> > >> In the source code, or you can show the ".extensions" field for all > >> the > > registered > >> AVInput/OutputFormats. > >> > >> > > >> > . Can I specify the output format I want rather than using > >> > av_guess_format ? all the tutorials use guess > >> > >> Yes, you need to specify avformat_alloc_output_context2() and rely on > >> oformat/format_name parameters, or use av_guess_format(). > >> > >> > > >> > . What is your recommended format for uncompressed HD video ? > >> > >> libx264 is the state of the art encoder (but it has licensing > > constraints). > >> _______________________________________________ > >> 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 onemda at gmail.com Mon Jan 21 16:41:29 2013 From: onemda at gmail.com (Paul B Mahol) Date: Mon, 21 Jan 2013 15:41:29 +0000 Subject: [Libav-user] How to specify output format In-Reply-To: <032601cdf7ea$dae21530$90a63f90$@yahoo.com> References: <015501cdf611$f3b7ac30$db270490$@ImageMining.net> <20130121124935.GV9458@arborea> <030a01cdf7e4$de8bcb00$9ba36100$@yahoo.com> <032601cdf7ea$dae21530$90a63f90$@yahoo.com> Message-ID: On 1/21/13, jim morgenstern wrote: > So what Specifically is the specific format extension that I give to ffmpeg > that gives me the "raw video format" you cited? Headerless : .raw, .yuv (You need to remember pixel format and dimensions stored in it) With headers : .nut (You must use -vcodec rawvideo and -pix_fmt same as your input video to keep video uncompressed) There are others like .avi, .. but they may not support pixel format of your input video. > >> -----Original Message----- >> From: libav-user-bounces at ffmpeg.org >> [mailto:libav-user-bounces at ffmpeg.org] >> On Behalf Of Paul B Mahol >> Sent: Monday, January 21, 2013 9:50 AM >> To: This list is about using libavcodec, libavformat, libavutil, > libavdevice and >> libavfilter. >> Subject: Re: [Libav-user] How to specify output format >> >> On 1/21/13, jim morgenstern wrote: >> >>> where can I find the list of formats and their extensions? >> >> In the source code >> > >> > Yes but the source code is hundreds of files; can you tell me which >> > one has the list and the mapping? >> > >> > >> >> > . What is your recommended format for uncompressed HD video ? >> >> >> >> libx264 is the state of the art encode >> > >> > But I do not want any encoding or compression: I want flat file that >> > can be read later on for more processing. So is there a >> > recommendation for a particular file format that does this? >> >> Depends on what you gonna use for more processing later. >> Depending on available storage and CPU speed you could use raw video >> formats... >> >> > >> > >> > >> > >> >> -----Original Message----- >> >> From: libav-user-bounces at ffmpeg.org >> >> [mailto:libav-user-bounces at ffmpeg.org] >> >> On Behalf Of Stefano Sabatini >> >> Sent: Monday, January 21, 2013 7:50 AM >> >> To: This list is about using libavcodec, libavformat, libavutil, >> > libavdevice and >> >> libavfilter. >> >> Subject: Re: [Libav-user] How to specify output format >> >> >> >> In data Saturday 2013-01-19 01:55:22 -0500, Jim Morgenstern ha >> >> scritto: >> >> > I have C++ app [win 7] that is reading and writing video/audio > stream. >> >> > >> >> > >> >> > >> >> > When I specify the output file as xxxx.MOV I am getting H264 >> >> > compressed video at 24 fps. >> >> > >> >> > >> >> > >> >> > I want to have output as uncompressed at 30 or 60 fps according to >> >> > the input. >> >> > >> >> > >> >> > >> >> > Some simple [I hope] questions: >> >> > >> >> > . What is [where can I find] the mapping between file name >> > extension >> >> > and format used? >> >> >> >> In the source code, or you can show the ".extensions" field for all >> >> the >> > registered >> >> AVInput/OutputFormats. >> >> >> >> > >> >> > . Can I specify the output format I want rather than using >> >> > av_guess_format ? all the tutorials use guess >> >> >> >> Yes, you need to specify avformat_alloc_output_context2() and rely on >> >> oformat/format_name parameters, or use av_guess_format(). >> >> >> >> > >> >> > . What is your recommended format for uncompressed HD video ? >> >> >> >> libx264 is the state of the art encoder (but it has licensing >> > constraints). >> >> _______________________________________________ >> >> 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 > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > From jmorgie at yahoo.com Mon Jan 21 17:01:17 2013 From: jmorgie at yahoo.com (jim morgenstern) Date: Mon, 21 Jan 2013 11:01:17 -0500 Subject: [Libav-user] How to specify output format In-Reply-To: References: <015501cdf611$f3b7ac30$db270490$@ImageMining.net> <20130121124935.GV9458@arborea> <030a01cdf7e4$de8bcb00$9ba36100$@yahoo.com> <032601cdf7ea$dae21530$90a63f90$@yahoo.com> Message-ID: <033501cdf7f0$8c73e670$a55bb350$@yahoo.com> Paul Thanks for the specifics. I don't like headerless so .raw and .yuv are out. Hadn't heard of .nut; I don't understand your comment about -vcodec etc. I am writing a C++ app not using the command line utilities. So what all do I need to know about .nut? Googled but cannot find any definitions or spec for the file. Can you send a url? > -----Original Message----- > From: libav-user-bounces at ffmpeg.org [mailto:libav-user-bounces at ffmpeg.org] > On Behalf Of Paul B Mahol > Sent: Monday, January 21, 2013 10:41 AM > To: This list is about using libavcodec, libavformat, libavutil, libavdevice and > libavfilter. > Subject: Re: [Libav-user] How to specify output format > > On 1/21/13, jim morgenstern wrote: > > So what Specifically is the specific format extension that I give to > > ffmpeg that gives me the "raw video format" you cited? > > Headerless : .raw, .yuv (You need to remember pixel format and dimensions > stored in it) > > With headers : .nut (You must use -vcodec rawvideo and -pix_fmt same as your > input video > to keep video uncompressed) > There are others like .avi, .. but they may not support pixel format of your > input video. > > > > >> -----Original Message----- > >> From: libav-user-bounces at ffmpeg.org > >> [mailto:libav-user-bounces at ffmpeg.org] > >> On Behalf Of Paul B Mahol > >> Sent: Monday, January 21, 2013 9:50 AM > >> To: This list is about using libavcodec, libavformat, libavutil, > > libavdevice and > >> libavfilter. > >> Subject: Re: [Libav-user] How to specify output format > >> > >> On 1/21/13, jim morgenstern wrote: > >> >>> where can I find the list of formats and their extensions? > >> >> In the source code > >> > > >> > Yes but the source code is hundreds of files; can you tell me > >> > which one has the list and the mapping? > >> > > >> > > >> >> > . What is your recommended format for uncompressed HD video ? > >> >> > >> >> libx264 is the state of the art encode > >> > > >> > But I do not want any encoding or compression: I want flat file > >> > that can be read later on for more processing. So is there a > >> > recommendation for a particular file format that does this? > >> > >> Depends on what you gonna use for more processing later. > >> Depending on available storage and CPU speed you could use raw video > >> formats... > >> > >> > > >> > > >> > > >> > > >> >> -----Original Message----- > >> >> From: libav-user-bounces at ffmpeg.org > >> >> [mailto:libav-user-bounces at ffmpeg.org] > >> >> On Behalf Of Stefano Sabatini > >> >> Sent: Monday, January 21, 2013 7:50 AM > >> >> To: This list is about using libavcodec, libavformat, libavutil, > >> > libavdevice and > >> >> libavfilter. > >> >> Subject: Re: [Libav-user] How to specify output format > >> >> > >> >> In data Saturday 2013-01-19 01:55:22 -0500, Jim Morgenstern ha > >> >> scritto: > >> >> > I have C++ app [win 7] that is reading and writing video/audio > > stream. > >> >> > > >> >> > > >> >> > > >> >> > When I specify the output file as xxxx.MOV I am getting H264 > >> >> > compressed video at 24 fps. > >> >> > > >> >> > > >> >> > > >> >> > I want to have output as uncompressed at 30 or 60 fps according > >> >> > to the input. > >> >> > > >> >> > > >> >> > > >> >> > Some simple [I hope] questions: > >> >> > > >> >> > . What is [where can I find] the mapping between file name > >> > extension > >> >> > and format used? > >> >> > >> >> In the source code, or you can show the ".extensions" field for > >> >> all the > >> > registered > >> >> AVInput/OutputFormats. > >> >> > >> >> > > >> >> > . Can I specify the output format I want rather than using > >> >> > av_guess_format ? all the tutorials use guess > >> >> > >> >> Yes, you need to specify avformat_alloc_output_context2() and rely > >> >> on oformat/format_name parameters, or use av_guess_format(). > >> >> > >> >> > > >> >> > . What is your recommended format for uncompressed HD video ? > >> >> > >> >> libx264 is the state of the art encoder (but it has licensing > >> > constraints). > >> >> _______________________________________________ > >> >> 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 > > > > _______________________________________________ > > 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 Jan 21 17:26:18 2013 From: onemda at gmail.com (Paul B Mahol) Date: Mon, 21 Jan 2013 16:26:18 +0000 Subject: [Libav-user] How to specify output format In-Reply-To: <033501cdf7f0$8c73e670$a55bb350$@yahoo.com> References: <015501cdf611$f3b7ac30$db270490$@ImageMining.net> <20130121124935.GV9458@arborea> <030a01cdf7e4$de8bcb00$9ba36100$@yahoo.com> <032601cdf7ea$dae21530$90a63f90$@yahoo.com> <033501cdf7f0$8c73e670$a55bb350$@yahoo.com> Message-ID: On 1/21/13, jim morgenstern wrote: > Paul > Thanks for the specifics. I don't like headerless so .raw and .yuv are > out. > > Hadn't heard of .nut; I don't understand your comment about -vcodec etc. > I am writing a C++ app not using the command line utilities. I mean video codec should be set to rawvideo. And pixel format for that codec should be same as one detected in input. > > So what all do I need to know about .nut? Googled but cannot find any > definitions or spec for the file. Can you send a url? You really should not need know anything, you just set output format to nut and it is all what is needed. I doubt you want nut spec if you gonna use libavformat to read nut files. > > > >> -----Original Message----- >> From: libav-user-bounces at ffmpeg.org >> [mailto:libav-user-bounces at ffmpeg.org] >> On Behalf Of Paul B Mahol >> Sent: Monday, January 21, 2013 10:41 AM >> To: This list is about using libavcodec, libavformat, libavutil, > libavdevice and >> libavfilter. >> Subject: Re: [Libav-user] How to specify output format >> >> On 1/21/13, jim morgenstern wrote: >> > So what Specifically is the specific format extension that I give to >> > ffmpeg that gives me the "raw video format" you cited? >> >> Headerless : .raw, .yuv (You need to remember pixel format and dimensions >> stored in it) >> >> With headers : .nut (You must use -vcodec rawvideo and -pix_fmt same as > your >> input video >> to keep video uncompressed) >> There are others like .avi, .. but they may not support pixel format > of your >> input video. >> >> > >> >> -----Original Message----- >> >> From: libav-user-bounces at ffmpeg.org >> >> [mailto:libav-user-bounces at ffmpeg.org] >> >> On Behalf Of Paul B Mahol >> >> Sent: Monday, January 21, 2013 9:50 AM >> >> To: This list is about using libavcodec, libavformat, libavutil, >> > libavdevice and >> >> libavfilter. >> >> Subject: Re: [Libav-user] How to specify output format >> >> >> >> On 1/21/13, jim morgenstern wrote: >> >> >>> where can I find the list of formats and their extensions? >> >> >> In the source code >> >> > >> >> > Yes but the source code is hundreds of files; can you tell me >> >> > which one has the list and the mapping? >> >> > >> >> > >> >> >> > . What is your recommended format for uncompressed HD video > ? >> >> >> >> >> >> libx264 is the state of the art encode >> >> > >> >> > But I do not want any encoding or compression: I want flat file >> >> > that can be read later on for more processing. So is there a >> >> > recommendation for a particular file format that does this? >> >> >> >> Depends on what you gonna use for more processing later. >> >> Depending on available storage and CPU speed you could use raw video >> >> formats... >> >> >> >> > >> >> > >> >> > >> >> > >> >> >> -----Original Message----- >> >> >> From: libav-user-bounces at ffmpeg.org >> >> >> [mailto:libav-user-bounces at ffmpeg.org] >> >> >> On Behalf Of Stefano Sabatini >> >> >> Sent: Monday, January 21, 2013 7:50 AM >> >> >> To: This list is about using libavcodec, libavformat, libavutil, >> >> > libavdevice and >> >> >> libavfilter. >> >> >> Subject: Re: [Libav-user] How to specify output format >> >> >> >> >> >> In data Saturday 2013-01-19 01:55:22 -0500, Jim Morgenstern ha >> >> >> scritto: >> >> >> > I have C++ app [win 7] that is reading and writing video/audio >> > stream. >> >> >> > >> >> >> > >> >> >> > >> >> >> > When I specify the output file as xxxx.MOV I am getting H264 >> >> >> > compressed video at 24 fps. >> >> >> > >> >> >> > >> >> >> > >> >> >> > I want to have output as uncompressed at 30 or 60 fps according >> >> >> > to the input. >> >> >> > >> >> >> > >> >> >> > >> >> >> > Some simple [I hope] questions: >> >> >> > >> >> >> > . What is [where can I find] the mapping between file name >> >> > extension >> >> >> > and format used? >> >> >> >> >> >> In the source code, or you can show the ".extensions" field for >> >> >> all the >> >> > registered >> >> >> AVInput/OutputFormats. >> >> >> >> >> >> > >> >> >> > . Can I specify the output format I want rather than using >> >> >> > av_guess_format ? all the tutorials use guess >> >> >> >> >> >> Yes, you need to specify avformat_alloc_output_context2() and rely >> >> >> on oformat/format_name parameters, or use av_guess_format(). >> >> >> >> >> >> > >> >> >> > . What is your recommended format for uncompressed HD video > ? >> >> >> >> >> >> libx264 is the state of the art encoder (but it has licensing >> >> > constraints). >> >> >> _______________________________________________ >> >> >> 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 >> > >> > _______________________________________________ >> > 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 francesco at bltitalia.com Mon Jan 21 18:35:39 2013 From: francesco at bltitalia.com (francesco at bltitalia.com) Date: Mon, 21 Jan 2013 18:35:39 +0100 (added by postmaster@virgilio.it) Subject: [Libav-user] Settings q_scale_type and intra_vlc_format Message-ID: <50AA345D07ABCDDF@vsmtp12.tin.it> (added by postmaster@virgilio.it) Hi to all I am using last release of ffmpeg libraries (mainly libavcodec) in orde to compress im MPEG2 format D10 IMX 50, and I found that these two flags are set at zero in the output stream, while using old version of libavcodec libraries both was set. I set the flag: pQTCodecCtx->flags |= CODEC_FLAG_QSCALE; but nothing. It seems that this instruction has non effect. Anyone can help ? Best regards From jmorgie at yahoo.com Mon Jan 21 18:58:28 2013 From: jmorgie at yahoo.com (jim morgenstern) Date: Mon, 21 Jan 2013 12:58:28 -0500 Subject: [Libav-user] How to specify output format In-Reply-To: References: <015501cdf611$f3b7ac30$db270490$@ImageMining.net> <20130121124935.GV9458@arborea> <030a01cdf7e4$de8bcb00$9ba36100$@yahoo.com> <032601cdf7ea$dae21530$90a63f90$@yahoo.com> <033501cdf7f0$8c73e670$a55bb350$@yahoo.com> Message-ID: <036501cdf800$eb7da1a0$c278e4e0$@yahoo.com> Paul -- couple of problems I did as you suggested and specified the output file as: *.nut ** ffmpeg associates the MPEG4 codec with this output and I want uncompressed ** the audio stream bombs Thanks for any help you can provide Here is a code snippet, then screen output from ffmpeg: ========= m_pOutputFormat = av_guess_format(NULL, filename, NULL); m_pFormatContext = avformat_alloc_context(); m_pFormatContext->oformat = m_pOutputFormat; _snprintf_s(m_pFormatContext->filename, sizeof(m_pFormatContext->filename), "%s", filename); // add the audio and video streams using the default format codecs and initialize the codecs. m_pAudioStream = NULL; if (m_pOutputFormat->audio_codec != CODEC_ID_NONE) { m_pAudioStream = add_audio_stream(m_pFormatContext, m_pOutputFormat->audio_codec, channels); } // and the abort comes from add_audio_stream ================== Starting MediaFileIO for D:\Data\Solavei.mov [mov,mp4,m4a,3gp,3g2,mj2 @ 00ad3320] Stream #1: not enough frames to estimate ra te; consider increasing probesize [mov,mp4,m4a,3gp,3g2,mj2 @ 00ad3320] Stream #2: not enough frames to estimate ra te; consider increasing probesize Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'D:\Data\Solavei.mov': Metadata: major_brand : qt minor_version : 537199360 compatible_brands: qt creation_time : 2012-07-12 23:41:43 Duration: 00:00:11.81, start: 0.000000, bitrate: 598161 kb/s Stream #0:0(eng): Video: v210 (v210 / 0x30313276), yuv422p10le, 1280x720, 59 6600 kb/s, SAR 1:1 DAR 16:9, 29.97 fps, 29.97 tbr, 30k tbn, 30k tbc Metadata: creation_time : 2012-07-12 23:41:43 handler_name : Apple Alias Data Handler Stream #0:1(eng): Audio: pcm_s16le (sowt / 0x74776F73), 48000 Hz, stereo, s1 6, 1536 kb/s Metadata: creation_time : 2012-07-12 23:41:43 handler_name : Apple Alias Data Handler Stream #0:2(eng): Data: none (tmcd / 0x64636D74) Metadata: creation_time : 2012-07-12 23:42:01 handler_name : Apple Alias Data Handler timecode : 00:00:28;11 Starting MediaFileIO for => D:\Data\TestSol.nut Output #0, nut, to 'D:\Data\TestSol.nut': Stream #0:0: Video: mpeg4, yuv420p, 1280x720, q=2-31, 5942 kb/s, 90k tbn, 29 tbc Stream #0:1: Audio: vorbis, 44100 Hz, 1 channels, s16, 64 kb/s [libvorbis @ 054e20c0] Specified sample_fmt is not supported. File Initialization Exception: output !! MediaFileWriter::open_audio: Could not open audio codec //this is my app error message > -----Original Message----- > From: libav-user-bounces at ffmpeg.org [mailto:libav-user-bounces at ffmpeg.org] > On Behalf Of Paul B Mahol > Sent: Monday, January 21, 2013 11:26 AM > To: This list is about using libavcodec, libavformat, libavutil, libavdevice and > libavfilter. > Subject: Re: [Libav-user] How to specify output format > > On 1/21/13, jim morgenstern wrote: > > Paul > > Thanks for the specifics. I don't like headerless so .raw and .yuv > > are out. > > > > Hadn't heard of .nut; I don't understand your comment about -vcodec etc. > > I am writing a C++ app not using the command line utilities. > > I mean video codec should be set to rawvideo. And pixel format for that codec > should be same as one detected in input. > > > > > So what all do I need to know about .nut? Googled but cannot find any > > definitions or spec for the file. Can you send a url? > > You really should not need know anything, you just set output format to nut and > it is all what is needed. I doubt you want nut spec if you gonna use libavformat to > read nut files. > > > > > > > > >> -----Original Message----- > >> From: libav-user-bounces at ffmpeg.org > >> [mailto:libav-user-bounces at ffmpeg.org] > >> On Behalf Of Paul B Mahol > >> Sent: Monday, January 21, 2013 10:41 AM > >> To: This list is about using libavcodec, libavformat, libavutil, > > libavdevice and > >> libavfilter. > >> Subject: Re: [Libav-user] How to specify output format > >> > >> On 1/21/13, jim morgenstern wrote: > >> > So what Specifically is the specific format extension that I give > >> > to ffmpeg that gives me the "raw video format" you cited? > >> > >> Headerless : .raw, .yuv (You need to remember pixel format and > >> dimensions stored in it) > >> > >> With headers : .nut (You must use -vcodec rawvideo and -pix_fmt same > >> as > > your > >> input video > >> to keep video uncompressed) > >> There are others like .avi, .. but they may not support pixel > >> format > > of your > >> input video. > >> > >> > > >> >> -----Original Message----- > >> >> From: libav-user-bounces at ffmpeg.org > >> >> [mailto:libav-user-bounces at ffmpeg.org] > >> >> On Behalf Of Paul B Mahol > >> >> Sent: Monday, January 21, 2013 9:50 AM > >> >> To: This list is about using libavcodec, libavformat, libavutil, > >> > libavdevice and > >> >> libavfilter. > >> >> Subject: Re: [Libav-user] How to specify output format > >> >> > >> >> On 1/21/13, jim morgenstern wrote: > >> >> >>> where can I find the list of formats and their extensions? > >> >> >> In the source code > >> >> > > >> >> > Yes but the source code is hundreds of files; can you tell me > >> >> > which one has the list and the mapping? > >> >> > > >> >> > > >> >> >> > . What is your recommended format for uncompressed HD > video > > ? > >> >> >> > >> >> >> libx264 is the state of the art encode > >> >> > > >> >> > But I do not want any encoding or compression: I want flat file > >> >> > that can be read later on for more processing. So is there a > >> >> > recommendation for a particular file format that does this? > >> >> > >> >> Depends on what you gonna use for more processing later. > >> >> Depending on available storage and CPU speed you could use raw > >> >> video formats... > >> >> > >> >> > > >> >> > > >> >> > > >> >> > > >> >> >> -----Original Message----- > >> >> >> From: libav-user-bounces at ffmpeg.org > >> >> >> [mailto:libav-user-bounces at ffmpeg.org] > >> >> >> On Behalf Of Stefano Sabatini > >> >> >> Sent: Monday, January 21, 2013 7:50 AM > >> >> >> To: This list is about using libavcodec, libavformat, > >> >> >> libavutil, > >> >> > libavdevice and > >> >> >> libavfilter. > >> >> >> Subject: Re: [Libav-user] How to specify output format > >> >> >> > >> >> >> In data Saturday 2013-01-19 01:55:22 -0500, Jim Morgenstern ha > >> >> >> scritto: > >> >> >> > I have C++ app [win 7] that is reading and writing > >> >> >> > video/audio > >> > stream. > >> >> >> > > >> >> >> > > >> >> >> > > >> >> >> > When I specify the output file as xxxx.MOV I am getting H264 > >> >> >> > compressed video at 24 fps. > >> >> >> > > >> >> >> > > >> >> >> > > >> >> >> > I want to have output as uncompressed at 30 or 60 fps > >> >> >> > according to the input. > >> >> >> > > >> >> >> > > >> >> >> > > >> >> >> > Some simple [I hope] questions: > >> >> >> > > >> >> >> > . What is [where can I find] the mapping between file name > >> >> > extension > >> >> >> > and format used? > >> >> >> > >> >> >> In the source code, or you can show the ".extensions" field for > >> >> >> all the > >> >> > registered > >> >> >> AVInput/OutputFormats. > >> >> >> > >> >> >> > > >> >> >> > . Can I specify the output format I want rather than using > >> >> >> > av_guess_format ? all the tutorials use guess > >> >> >> > >> >> >> Yes, you need to specify avformat_alloc_output_context2() and > >> >> >> rely on oformat/format_name parameters, or use av_guess_format(). > >> >> >> > >> >> >> > > >> >> >> > . What is your recommended format for uncompressed HD > video > > ? > >> >> >> > >> >> >> libx264 is the state of the art encoder (but it has licensing > >> >> > constraints). > >> >> >> _______________________________________________ > >> >> >> 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 > >> > > >> > _______________________________________________ > >> > 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 > > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user From david.longest at apx-labs.com Mon Jan 21 19:02:57 2013 From: david.longest at apx-labs.com (David Longest) Date: Mon, 21 Jan 2013 18:02:57 +0000 Subject: [Libav-user] Encoding and Decoding on separate ends In-Reply-To: References: Message-ID: Hello Vistas, > I want to be able to open a video file on one end, encode it to h264 and then send it over RTP(custom library) to another end for decoding. > I am not sure how exactly I am going to open the AVFormatContext and AVCodecContext on the receiving end. I am able to serialize AVPackets correctly. > I am new to libav* and I can' t see how I need to initialize the AVFormat state on the decoding side. I have recently been working with RTP data with h263. While I couldn't find a direct way to demux RTP packets, I found that providing the URL to a completed SDP file to avformat_open_input will allow ffmpeg to handle demuxing and decoding of the packets. Example SDP from the RFC (http://tools.ietf.org/html/rfc2327): v=0 o=mhandley 2890844526 2890842807 IN IP4 126.16.64.4 s=SDP Seminar i=A Seminar on the session description protocol u=http://www.cs.ucl.ac.uk/staff/M.Handley/sdp.03.ps e=mjh at isi.edu (Mark Handley) c=IN IP4 224.2.17.12/127 t=2873397496 2873404696 a=recvonly m=audio 49170 RTP/AVP 0 m=video 51372 RTP/AVP 31 m=application 32416 udp wb a=orient:portrait David From onemda at gmail.com Mon Jan 21 19:06:18 2013 From: onemda at gmail.com (Paul B Mahol) Date: Mon, 21 Jan 2013 18:06:18 +0000 Subject: [Libav-user] How to specify output format In-Reply-To: <036501cdf800$eb7da1a0$c278e4e0$@yahoo.com> References: <015501cdf611$f3b7ac30$db270490$@ImageMining.net> <20130121124935.GV9458@arborea> <030a01cdf7e4$de8bcb00$9ba36100$@yahoo.com> <032601cdf7ea$dae21530$90a63f90$@yahoo.com> <033501cdf7f0$8c73e670$a55bb350$@yahoo.com> <036501cdf800$eb7da1a0$c278e4e0$@yahoo.com> Message-ID: On 1/21/13, jim morgenstern wrote: > Paul -- couple of problems > > I did as you suggested and specified the output file as: *.nut > ** ffmpeg associates the MPEG4 codec with this output and I want > uncompressed > ** the audio stream bombs > > Thanks for any help you can provide I said you must set video codec to rawvideo aka CODEC_ID_RAWVIDEO. > > Here is a code snippet, then screen output from ffmpeg: > ========= > > m_pOutputFormat = av_guess_format(NULL, filename, NULL); > m_pFormatContext = avformat_alloc_context(); > m_pFormatContext->oformat = m_pOutputFormat; > _snprintf_s(m_pFormatContext->filename, > sizeof(m_pFormatContext->filename), "%s", filename); > > // add the audio and video streams using the default format codecs and > initialize the codecs. > m_pAudioStream = NULL; > if (m_pOutputFormat->audio_codec != CODEC_ID_NONE) > { > m_pAudioStream = add_audio_stream(m_pFormatContext, > m_pOutputFormat->audio_codec, channels); > } > // and the abort comes from add_audio_stream > ================== > > Starting MediaFileIO for D:\Data\Solavei.mov > > [mov,mp4,m4a,3gp,3g2,mj2 @ 00ad3320] Stream #1: not enough frames to > estimate ra > te; consider increasing probesize > [mov,mp4,m4a,3gp,3g2,mj2 @ 00ad3320] Stream #2: not enough frames to > estimate ra > te; consider increasing probesize > > Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'D:\Data\Solavei.mov': > Metadata: > major_brand : qt > minor_version : 537199360 > compatible_brands: qt > creation_time : 2012-07-12 23:41:43 > Duration: 00:00:11.81, start: 0.000000, bitrate: 598161 kb/s > Stream #0:0(eng): Video: v210 (v210 / 0x30313276), yuv422p10le, > 1280x720, 59 > 6600 kb/s, SAR 1:1 DAR 16:9, 29.97 fps, 29.97 tbr, 30k tbn, 30k tbc > Metadata: > creation_time : 2012-07-12 23:41:43 > handler_name : Apple Alias Data Handler > Stream #0:1(eng): Audio: pcm_s16le (sowt / 0x74776F73), 48000 Hz, > stereo, s1 > 6, 1536 kb/s > Metadata: > creation_time : 2012-07-12 23:41:43 > handler_name : Apple Alias Data Handler > Stream #0:2(eng): Data: none (tmcd / 0x64636D74) > Metadata: > creation_time : 2012-07-12 23:42:01 > handler_name : Apple Alias Data Handler > timecode : 00:00:28;11 > > > Starting MediaFileIO for => D:\Data\TestSol.nut > Output #0, nut, to 'D:\Data\TestSol.nut': > Stream #0:0: Video: mpeg4, yuv420p, 1280x720, q=2-31, 5942 kb/s, 90k > tbn, 29 > tbc > Stream #0:1: Audio: vorbis, 44100 Hz, 1 channels, s16, 64 kb/s > [libvorbis @ 054e20c0] Specified sample_fmt is not supported. > > File Initialization Exception: output !! > MediaFileWriter::open_audio: Could not open audio codec //this is my app > error message You want to store audio? If yes. What codec? > > > > > >> -----Original Message----- >> From: libav-user-bounces at ffmpeg.org >> [mailto:libav-user-bounces at ffmpeg.org] >> On Behalf Of Paul B Mahol >> Sent: Monday, January 21, 2013 11:26 AM >> To: This list is about using libavcodec, libavformat, libavutil, > libavdevice and >> libavfilter. >> Subject: Re: [Libav-user] How to specify output format >> >> On 1/21/13, jim morgenstern wrote: >> > Paul >> > Thanks for the specifics. I don't like headerless so .raw and .yuv >> > are out. >> > >> > Hadn't heard of .nut; I don't understand your comment about -vcodec > etc. >> > I am writing a C++ app not using the command line utilities. >> >> I mean video codec should be set to rawvideo. And pixel format for that > codec >> should be same as one detected in input. >> >> > >> > So what all do I need to know about .nut? Googled but cannot find any >> > definitions or spec for the file. Can you send a url? >> >> You really should not need know anything, you just set output format to > nut and >> it is all what is needed. I doubt you want nut spec if you gonna use > libavformat to >> read nut files. >> >> > >> > >> > >> >> -----Original Message----- >> >> From: libav-user-bounces at ffmpeg.org >> >> [mailto:libav-user-bounces at ffmpeg.org] >> >> On Behalf Of Paul B Mahol >> >> Sent: Monday, January 21, 2013 10:41 AM >> >> To: This list is about using libavcodec, libavformat, libavutil, >> > libavdevice and >> >> libavfilter. >> >> Subject: Re: [Libav-user] How to specify output format >> >> >> >> On 1/21/13, jim morgenstern wrote: >> >> > So what Specifically is the specific format extension that I give >> >> > to ffmpeg that gives me the "raw video format" you cited? >> >> >> >> Headerless : .raw, .yuv (You need to remember pixel format and >> >> dimensions stored in it) >> >> >> >> With headers : .nut (You must use -vcodec rawvideo and -pix_fmt same >> >> as >> > your >> >> input video >> >> to keep video uncompressed) >> >> There are others like .avi, .. but they may not support pixel >> >> format >> > of your >> >> input video. >> >> >> >> > >> >> >> -----Original Message----- >> >> >> From: libav-user-bounces at ffmpeg.org >> >> >> [mailto:libav-user-bounces at ffmpeg.org] >> >> >> On Behalf Of Paul B Mahol >> >> >> Sent: Monday, January 21, 2013 9:50 AM >> >> >> To: This list is about using libavcodec, libavformat, libavutil, >> >> > libavdevice and >> >> >> libavfilter. >> >> >> Subject: Re: [Libav-user] How to specify output format >> >> >> >> >> >> On 1/21/13, jim morgenstern wrote: >> >> >> >>> where can I find the list of formats and their extensions? >> >> >> >> In the source code >> >> >> > >> >> >> > Yes but the source code is hundreds of files; can you tell me >> >> >> > which one has the list and the mapping? >> >> >> > >> >> >> > >> >> >> >> > . What is your recommended format for uncompressed HD >> video >> > ? >> >> >> >> >> >> >> >> libx264 is the state of the art encode >> >> >> > >> >> >> > But I do not want any encoding or compression: I want flat file >> >> >> > that can be read later on for more processing. So is there a >> >> >> > recommendation for a particular file format that does this? >> >> >> >> >> >> Depends on what you gonna use for more processing later. >> >> >> Depending on available storage and CPU speed you could use raw >> >> >> video formats... >> >> >> >> >> >> > >> >> >> > >> >> >> > >> >> >> > >> >> >> >> -----Original Message----- >> >> >> >> From: libav-user-bounces at ffmpeg.org >> >> >> >> [mailto:libav-user-bounces at ffmpeg.org] >> >> >> >> On Behalf Of Stefano Sabatini >> >> >> >> Sent: Monday, January 21, 2013 7:50 AM >> >> >> >> To: This list is about using libavcodec, libavformat, >> >> >> >> libavutil, >> >> >> > libavdevice and >> >> >> >> libavfilter. >> >> >> >> Subject: Re: [Libav-user] How to specify output format >> >> >> >> >> >> >> >> In data Saturday 2013-01-19 01:55:22 -0500, Jim Morgenstern ha >> >> >> >> scritto: >> >> >> >> > I have C++ app [win 7] that is reading and writing >> >> >> >> > video/audio >> >> > stream. >> >> >> >> > >> >> >> >> > >> >> >> >> > >> >> >> >> > When I specify the output file as xxxx.MOV I am getting H264 >> >> >> >> > compressed video at 24 fps. >> >> >> >> > >> >> >> >> > >> >> >> >> > >> >> >> >> > I want to have output as uncompressed at 30 or 60 fps >> >> >> >> > according to the input. >> >> >> >> > >> >> >> >> > >> >> >> >> > >> >> >> >> > Some simple [I hope] questions: >> >> >> >> > >> >> >> >> > . What is [where can I find] the mapping between file > name >> >> >> > extension >> >> >> >> > and format used? >> >> >> >> >> >> >> >> In the source code, or you can show the ".extensions" field for >> >> >> >> all the >> >> >> > registered >> >> >> >> AVInput/OutputFormats. >> >> >> >> >> >> >> >> > >> >> >> >> > . Can I specify the output format I want rather than > using >> >> >> >> > av_guess_format ? all the tutorials use guess >> >> >> >> >> >> >> >> Yes, you need to specify avformat_alloc_output_context2() and >> >> >> >> rely on oformat/format_name parameters, or use >> >> >> >> av_guess_format(). >> >> >> >> >> >> >> >> > >> >> >> >> > . What is your recommended format for uncompressed HD >> video >> > ? >> >> >> >> >> >> >> >> libx264 is the state of the art encoder (but it has licensing >> >> >> > constraints). >> >> >> >> _______________________________________________ >> >> >> >> 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 >> >> > >> >> > _______________________________________________ >> >> > 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 >> > >> _______________________________________________ >> 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 jmorgie at yahoo.com Mon Jan 21 21:27:20 2013 From: jmorgie at yahoo.com (jim morgenstern) Date: Mon, 21 Jan 2013 15:27:20 -0500 Subject: [Libav-user] How to specify output format In-Reply-To: References: <015501cdf611$f3b7ac30$db270490$@ImageMining.net> <20130121124935.GV9458@arborea> <030a01cdf7e4$de8bcb00$9ba36100$@yahoo.com> <032601cdf7ea$dae21530$90a63f90$@yahoo.com> <033501cdf7f0$8c73e670$a55bb350$@yahoo.com> <036501cdf800$eb7da1a0$c278e4e0$@yahoo.com> Message-ID: <038201cdf815$b6be7830$243b6890$@yahoo.com> So this is the piece to the puzzle I am missing: * where does one set the output pixel format / video codec to CODEC_ID_RAWVIDEO ? I have > > m_pOutputFormat = av_guess_format(NULL, filename, NULL); > > m_pFormatContext = avformat_alloc_context(); > > m_pFormatContext->oformat = m_pOutputFormat; So after I get a format context then I can go in and tweak the various fields? Sure wish someone would write a book Thanks > -----Original Message----- > From: libav-user-bounces at ffmpeg.org [mailto:libav-user-bounces at ffmpeg.org] > On Behalf Of Paul B Mahol > Sent: Monday, January 21, 2013 1:06 PM > To: This list is about using libavcodec, libavformat, libavutil, libavdevice and > libavfilter. > Subject: Re: [Libav-user] How to specify output format > > On 1/21/13, jim morgenstern wrote: > > Paul -- couple of problems > > > > I did as you suggested and specified the output file as: *.nut > > ** ffmpeg associates the MPEG4 codec with this output and I want > > uncompressed > > ** the audio stream bombs > > > > Thanks for any help you can provide > > I said you must set video codec to rawvideo aka CODEC_ID_RAWVIDEO. > > > > > Here is a code snippet, then screen output from ffmpeg: > > ========= > > > > m_pOutputFormat = av_guess_format(NULL, filename, NULL); > > m_pFormatContext = avformat_alloc_context(); > > m_pFormatContext->oformat = m_pOutputFormat; > > _snprintf_s(m_pFormatContext->filename, > > sizeof(m_pFormatContext->filename), "%s", filename); > > > > // add the audio and video streams using the default format codecs and > > initialize the codecs. > > m_pAudioStream = NULL; > > if (m_pOutputFormat->audio_codec != CODEC_ID_NONE) > > { > > m_pAudioStream = add_audio_stream(m_pFormatContext, > > m_pOutputFormat->audio_codec, channels); > > } > > // and the abort comes from add_audio_stream ================== > > > > Starting MediaFileIO for D:\Data\Solavei.mov > > > > [mov,mp4,m4a,3gp,3g2,mj2 @ 00ad3320] Stream #1: not enough frames to > > estimate ra te; consider increasing probesize > > [mov,mp4,m4a,3gp,3g2,mj2 @ 00ad3320] Stream #2: not enough frames to > > estimate ra te; consider increasing probesize > > > > Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'D:\Data\Solavei.mov': > > Metadata: > > major_brand : qt > > minor_version : 537199360 > > compatible_brands: qt > > creation_time : 2012-07-12 23:41:43 > > Duration: 00:00:11.81, start: 0.000000, bitrate: 598161 kb/s > > Stream #0:0(eng): Video: v210 (v210 / 0x30313276), yuv422p10le, > > 1280x720, 59 > > 6600 kb/s, SAR 1:1 DAR 16:9, 29.97 fps, 29.97 tbr, 30k tbn, 30k tbc > > Metadata: > > creation_time : 2012-07-12 23:41:43 > > handler_name : Apple Alias Data Handler > > Stream #0:1(eng): Audio: pcm_s16le (sowt / 0x74776F73), 48000 Hz, > > stereo, s1 6, 1536 kb/s > > Metadata: > > creation_time : 2012-07-12 23:41:43 > > handler_name : Apple Alias Data Handler > > Stream #0:2(eng): Data: none (tmcd / 0x64636D74) > > Metadata: > > creation_time : 2012-07-12 23:42:01 > > handler_name : Apple Alias Data Handler > > timecode : 00:00:28;11 > > > > > > Starting MediaFileIO for => D:\Data\TestSol.nut Output #0, nut, to > > 'D:\Data\TestSol.nut': > > Stream #0:0: Video: mpeg4, yuv420p, 1280x720, q=2-31, 5942 kb/s, > > 90k tbn, 29 tbc > > Stream #0:1: Audio: vorbis, 44100 Hz, 1 channels, s16, 64 kb/s > > [libvorbis @ 054e20c0] Specified sample_fmt is not supported. > > > > File Initialization Exception: output !! > > MediaFileWriter::open_audio: Could not open audio codec //this is my app > > error message > > You want to store audio? If yes. What codec? > > > > > > > > > > > > > >> -----Original Message----- > >> From: libav-user-bounces at ffmpeg.org > >> [mailto:libav-user-bounces at ffmpeg.org] > >> On Behalf Of Paul B Mahol > >> Sent: Monday, January 21, 2013 11:26 AM > >> To: This list is about using libavcodec, libavformat, libavutil, > > libavdevice and > >> libavfilter. > >> Subject: Re: [Libav-user] How to specify output format > >> > >> On 1/21/13, jim morgenstern wrote: > >> > Paul > >> > Thanks for the specifics. I don't like headerless so .raw and .yuv > >> > are out. > >> > > >> > Hadn't heard of .nut; I don't understand your comment about > >> > -vcodec > > etc. > >> > I am writing a C++ app not using the command line utilities. > >> > >> I mean video codec should be set to rawvideo. And pixel format for > >> that > > codec > >> should be same as one detected in input. > >> > >> > > >> > So what all do I need to know about .nut? Googled but cannot find > >> > any definitions or spec for the file. Can you send a url? > >> > >> You really should not need know anything, you just set output format > >> to > > nut and > >> it is all what is needed. I doubt you want nut spec if you gonna use > > libavformat to > >> read nut files. > >> > >> > > >> > > >> > > >> >> -----Original Message----- > >> >> From: libav-user-bounces at ffmpeg.org > >> >> [mailto:libav-user-bounces at ffmpeg.org] > >> >> On Behalf Of Paul B Mahol > >> >> Sent: Monday, January 21, 2013 10:41 AM > >> >> To: This list is about using libavcodec, libavformat, libavutil, > >> > libavdevice and > >> >> libavfilter. > >> >> Subject: Re: [Libav-user] How to specify output format > >> >> > >> >> On 1/21/13, jim morgenstern wrote: > >> >> > So what Specifically is the specific format extension that I > >> >> > give to ffmpeg that gives me the "raw video format" you cited? > >> >> > >> >> Headerless : .raw, .yuv (You need to remember pixel format and > >> >> dimensions stored in it) > >> >> > >> >> With headers : .nut (You must use -vcodec rawvideo and -pix_fmt > >> >> same as > >> > your > >> >> input video > >> >> to keep video uncompressed) > >> >> There are others like .avi, .. but they may not support pixel > >> >> format > >> > of your > >> >> input video. > >> >> > >> >> > > >> >> >> -----Original Message----- > >> >> >> From: libav-user-bounces at ffmpeg.org > >> >> >> [mailto:libav-user-bounces at ffmpeg.org] > >> >> >> On Behalf Of Paul B Mahol > >> >> >> Sent: Monday, January 21, 2013 9:50 AM > >> >> >> To: This list is about using libavcodec, libavformat, > >> >> >> libavutil, > >> >> > libavdevice and > >> >> >> libavfilter. > >> >> >> Subject: Re: [Libav-user] How to specify output format > >> >> >> > >> >> >> On 1/21/13, jim morgenstern wrote: > >> >> >> >>> where can I find the list of formats and their extensions? > >> >> >> >> In the source code > >> >> >> > > >> >> >> > Yes but the source code is hundreds of files; can you tell > >> >> >> > me which one has the list and the mapping? > >> >> >> > > >> >> >> > > >> >> >> >> > . What is your recommended format for uncompressed HD > >> video > >> > ? > >> >> >> >> > >> >> >> >> libx264 is the state of the art encode > >> >> >> > > >> >> >> > But I do not want any encoding or compression: I want flat > >> >> >> > file that can be read later on for more processing. So is > >> >> >> > there a recommendation for a particular file format that does this? > >> >> >> > >> >> >> Depends on what you gonna use for more processing later. > >> >> >> Depending on available storage and CPU speed you could use raw > >> >> >> video formats... > >> >> >> > >> >> >> > > >> >> >> > > >> >> >> > > >> >> >> > > >> >> >> >> -----Original Message----- > >> >> >> >> From: libav-user-bounces at ffmpeg.org > >> >> >> >> [mailto:libav-user-bounces at ffmpeg.org] > >> >> >> >> On Behalf Of Stefano Sabatini > >> >> >> >> Sent: Monday, January 21, 2013 7:50 AM > >> >> >> >> To: This list is about using libavcodec, libavformat, > >> >> >> >> libavutil, > >> >> >> > libavdevice and > >> >> >> >> libavfilter. > >> >> >> >> Subject: Re: [Libav-user] How to specify output format > >> >> >> >> > >> >> >> >> In data Saturday 2013-01-19 01:55:22 -0500, Jim Morgenstern > >> >> >> >> ha > >> >> >> >> scritto: > >> >> >> >> > I have C++ app [win 7] that is reading and writing > >> >> >> >> > video/audio > >> >> > stream. > >> >> >> >> > > >> >> >> >> > > >> >> >> >> > > >> >> >> >> > When I specify the output file as xxxx.MOV I am getting > >> >> >> >> > H264 compressed video at 24 fps. > >> >> >> >> > > >> >> >> >> > > >> >> >> >> > > >> >> >> >> > I want to have output as uncompressed at 30 or 60 fps > >> >> >> >> > according to the input. > >> >> >> >> > > >> >> >> >> > > >> >> >> >> > > >> >> >> >> > Some simple [I hope] questions: > >> >> >> >> > > >> >> >> >> > . What is [where can I find] the mapping between file > > name > >> >> >> > extension > >> >> >> >> > and format used? > >> >> >> >> > >> >> >> >> In the source code, or you can show the ".extensions" field > >> >> >> >> for all the > >> >> >> > registered > >> >> >> >> AVInput/OutputFormats. > >> >> >> >> > >> >> >> >> > > >> >> >> >> > . Can I specify the output format I want rather than > > using > >> >> >> >> > av_guess_format ? all the tutorials use guess > >> >> >> >> > >> >> >> >> Yes, you need to specify avformat_alloc_output_context2() > >> >> >> >> and rely on oformat/format_name parameters, or use > >> >> >> >> av_guess_format(). > >> >> >> >> > >> >> >> >> > > >> >> >> >> > . What is your recommended format for uncompressed HD > >> video > >> > ? > >> >> >> >> > >> >> >> >> libx264 is the state of the art encoder (but it has > >> >> >> >> licensing > >> >> >> > constraints). > >> >> >> >> _______________________________________________ > >> >> >> >> 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 > >> >> > > >> >> > _______________________________________________ > >> >> > 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 > >> > > >> _______________________________________________ > >> 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 onemda at gmail.com Mon Jan 21 21:53:46 2013 From: onemda at gmail.com (Paul B Mahol) Date: Mon, 21 Jan 2013 20:53:46 +0000 Subject: [Libav-user] How to specify output format In-Reply-To: <038201cdf815$b6be7830$243b6890$@yahoo.com> References: <015501cdf611$f3b7ac30$db270490$@ImageMining.net> <20130121124935.GV9458@arborea> <030a01cdf7e4$de8bcb00$9ba36100$@yahoo.com> <032601cdf7ea$dae21530$90a63f90$@yahoo.com> <033501cdf7f0$8c73e670$a55bb350$@yahoo.com> <036501cdf800$eb7da1a0$c278e4e0$@yahoo.com> <038201cdf815$b6be7830$243b6890$@yahoo.com> Message-ID: On 1/21/13, jim morgenstern wrote: > So this is the piece to the puzzle I am missing: > > * where does one set the output pixel format / video codec to > CODEC_ID_RAWVIDEO ? > I have >> > m_pOutputFormat = av_guess_format(NULL, filename, NULL); >> > m_pFormatContext = avformat_alloc_context(); >> > m_pFormatContext->oformat = m_pOutputFormat; > > So after I get a format context then I can go in and tweak the various > fields? m_pFormatContext->oformat->video_codec = CODEC_ID_RAWVIDEO. When initialzing encoder you specify pix_fmt: example: avctx->pix_fmt = PIX_FMT_YUV420P; There is example code: http://git.videolan.org/?p=ffmpeg.git;a=blob;f=doc/examples/muxing.c > Sure wish someone would write a book > > Thanks > > > >> -----Original Message----- >> From: libav-user-bounces at ffmpeg.org >> [mailto:libav-user-bounces at ffmpeg.org] >> On Behalf Of Paul B Mahol >> Sent: Monday, January 21, 2013 1:06 PM >> To: This list is about using libavcodec, libavformat, libavutil, > libavdevice and >> libavfilter. >> Subject: Re: [Libav-user] How to specify output format >> >> On 1/21/13, jim morgenstern wrote: >> > Paul -- couple of problems >> > >> > I did as you suggested and specified the output file as: *.nut >> > ** ffmpeg associates the MPEG4 codec with this output and I want >> > uncompressed >> > ** the audio stream bombs >> > >> > Thanks for any help you can provide >> >> I said you must set video codec to rawvideo aka CODEC_ID_RAWVIDEO. >> >> > >> > Here is a code snippet, then screen output from ffmpeg: >> > ========= >> > >> > m_pOutputFormat = av_guess_format(NULL, filename, NULL); >> > m_pFormatContext = avformat_alloc_context(); >> > m_pFormatContext->oformat = m_pOutputFormat; >> > _snprintf_s(m_pFormatContext->filename, >> > sizeof(m_pFormatContext->filename), "%s", filename); >> > >> > // add the audio and video streams using the default format codecs and >> > initialize the codecs. >> > m_pAudioStream = NULL; >> > if (m_pOutputFormat->audio_codec != CODEC_ID_NONE) >> > { >> > m_pAudioStream = add_audio_stream(m_pFormatContext, >> > m_pOutputFormat->audio_codec, channels); >> > } >> > // and the abort comes from add_audio_stream ================== >> > >> > Starting MediaFileIO for D:\Data\Solavei.mov >> > >> > [mov,mp4,m4a,3gp,3g2,mj2 @ 00ad3320] Stream #1: not enough frames to >> > estimate ra te; consider increasing probesize >> > [mov,mp4,m4a,3gp,3g2,mj2 @ 00ad3320] Stream #2: not enough frames to >> > estimate ra te; consider increasing probesize >> > >> > Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'D:\Data\Solavei.mov': >> > Metadata: >> > major_brand : qt >> > minor_version : 537199360 >> > compatible_brands: qt >> > creation_time : 2012-07-12 23:41:43 >> > Duration: 00:00:11.81, start: 0.000000, bitrate: 598161 kb/s >> > Stream #0:0(eng): Video: v210 (v210 / 0x30313276), yuv422p10le, >> > 1280x720, 59 >> > 6600 kb/s, SAR 1:1 DAR 16:9, 29.97 fps, 29.97 tbr, 30k tbn, 30k tbc >> > Metadata: >> > creation_time : 2012-07-12 23:41:43 >> > handler_name : Apple Alias Data Handler >> > Stream #0:1(eng): Audio: pcm_s16le (sowt / 0x74776F73), 48000 Hz, >> > stereo, s1 6, 1536 kb/s >> > Metadata: >> > creation_time : 2012-07-12 23:41:43 >> > handler_name : Apple Alias Data Handler >> > Stream #0:2(eng): Data: none (tmcd / 0x64636D74) >> > Metadata: >> > creation_time : 2012-07-12 23:42:01 >> > handler_name : Apple Alias Data Handler >> > timecode : 00:00:28;11 >> > >> > >> > Starting MediaFileIO for => D:\Data\TestSol.nut Output #0, nut, to >> > 'D:\Data\TestSol.nut': >> > Stream #0:0: Video: mpeg4, yuv420p, 1280x720, q=2-31, 5942 kb/s, >> > 90k tbn, 29 tbc >> > Stream #0:1: Audio: vorbis, 44100 Hz, 1 channels, s16, 64 kb/s >> > [libvorbis @ 054e20c0] Specified sample_fmt is not supported. >> > >> > File Initialization Exception: output !! >> > MediaFileWriter::open_audio: Could not open audio codec //this is my > app >> > error message >> >> You want to store audio? If yes. What codec? >> >> >> > >> > >> > >> > >> > >> >> -----Original Message----- >> >> From: libav-user-bounces at ffmpeg.org >> >> [mailto:libav-user-bounces at ffmpeg.org] >> >> On Behalf Of Paul B Mahol >> >> Sent: Monday, January 21, 2013 11:26 AM >> >> To: This list is about using libavcodec, libavformat, libavutil, >> > libavdevice and >> >> libavfilter. >> >> Subject: Re: [Libav-user] How to specify output format >> >> >> >> On 1/21/13, jim morgenstern wrote: >> >> > Paul >> >> > Thanks for the specifics. I don't like headerless so .raw and .yuv >> >> > are out. >> >> > >> >> > Hadn't heard of .nut; I don't understand your comment about >> >> > -vcodec >> > etc. >> >> > I am writing a C++ app not using the command line utilities. >> >> >> >> I mean video codec should be set to rawvideo. And pixel format for >> >> that >> > codec >> >> should be same as one detected in input. >> >> >> >> > >> >> > So what all do I need to know about .nut? Googled but cannot find >> >> > any definitions or spec for the file. Can you send a url? >> >> >> >> You really should not need know anything, you just set output format >> >> to >> > nut and >> >> it is all what is needed. I doubt you want nut spec if you gonna use >> > libavformat to >> >> read nut files. >> >> >> >> > >> >> > >> >> > >> >> >> -----Original Message----- >> >> >> From: libav-user-bounces at ffmpeg.org >> >> >> [mailto:libav-user-bounces at ffmpeg.org] >> >> >> On Behalf Of Paul B Mahol >> >> >> Sent: Monday, January 21, 2013 10:41 AM >> >> >> To: This list is about using libavcodec, libavformat, libavutil, >> >> > libavdevice and >> >> >> libavfilter. >> >> >> Subject: Re: [Libav-user] How to specify output format >> >> >> >> >> >> On 1/21/13, jim morgenstern wrote: >> >> >> > So what Specifically is the specific format extension that I >> >> >> > give to ffmpeg that gives me the "raw video format" you cited? >> >> >> >> >> >> Headerless : .raw, .yuv (You need to remember pixel format and >> >> >> dimensions stored in it) >> >> >> >> >> >> With headers : .nut (You must use -vcodec rawvideo and -pix_fmt >> >> >> same as >> >> > your >> >> >> input video >> >> >> to keep video uncompressed) >> >> >> There are others like .avi, .. but they may not support pixel >> >> >> format >> >> > of your >> >> >> input video. >> >> >> >> >> >> > >> >> >> >> -----Original Message----- >> >> >> >> From: libav-user-bounces at ffmpeg.org >> >> >> >> [mailto:libav-user-bounces at ffmpeg.org] >> >> >> >> On Behalf Of Paul B Mahol >> >> >> >> Sent: Monday, January 21, 2013 9:50 AM >> >> >> >> To: This list is about using libavcodec, libavformat, >> >> >> >> libavutil, >> >> >> > libavdevice and >> >> >> >> libavfilter. >> >> >> >> Subject: Re: [Libav-user] How to specify output format >> >> >> >> >> >> >> >> On 1/21/13, jim morgenstern wrote: >> >> >> >> >>> where can I find the list of formats and their extensions? >> >> >> >> >> In the source code >> >> >> >> > >> >> >> >> > Yes but the source code is hundreds of files; can you tell >> >> >> >> > me which one has the list and the mapping? >> >> >> >> > >> >> >> >> > >> >> >> >> >> > . What is your recommended format for uncompressed HD >> >> video >> >> > ? >> >> >> >> >> >> >> >> >> >> libx264 is the state of the art encode >> >> >> >> > >> >> >> >> > But I do not want any encoding or compression: I want flat >> >> >> >> > file that can be read later on for more processing. So is >> >> >> >> > there a recommendation for a particular file format that does > this? >> >> >> >> >> >> >> >> Depends on what you gonna use for more processing later. >> >> >> >> Depending on available storage and CPU speed you could use raw >> >> >> >> video formats... >> >> >> >> >> >> >> >> > >> >> >> >> > >> >> >> >> > >> >> >> >> > >> >> >> >> >> -----Original Message----- >> >> >> >> >> From: libav-user-bounces at ffmpeg.org >> >> >> >> >> [mailto:libav-user-bounces at ffmpeg.org] >> >> >> >> >> On Behalf Of Stefano Sabatini >> >> >> >> >> Sent: Monday, January 21, 2013 7:50 AM >> >> >> >> >> To: This list is about using libavcodec, libavformat, >> >> >> >> >> libavutil, >> >> >> >> > libavdevice and >> >> >> >> >> libavfilter. >> >> >> >> >> Subject: Re: [Libav-user] How to specify output format >> >> >> >> >> >> >> >> >> >> In data Saturday 2013-01-19 01:55:22 -0500, Jim Morgenstern >> >> >> >> >> ha >> >> >> >> >> scritto: >> >> >> >> >> > I have C++ app [win 7] that is reading and writing >> >> >> >> >> > video/audio >> >> >> > stream. >> >> >> >> >> > >> >> >> >> >> > >> >> >> >> >> > >> >> >> >> >> > When I specify the output file as xxxx.MOV I am getting >> >> >> >> >> > H264 compressed video at 24 fps. >> >> >> >> >> > >> >> >> >> >> > >> >> >> >> >> > >> >> >> >> >> > I want to have output as uncompressed at 30 or 60 fps >> >> >> >> >> > according to the input. >> >> >> >> >> > >> >> >> >> >> > >> >> >> >> >> > >> >> >> >> >> > Some simple [I hope] questions: >> >> >> >> >> > >> >> >> >> >> > . What is [where can I find] the mapping between file >> > name >> >> >> >> > extension >> >> >> >> >> > and format used? >> >> >> >> >> >> >> >> >> >> In the source code, or you can show the ".extensions" field >> >> >> >> >> for all the >> >> >> >> > registered >> >> >> >> >> AVInput/OutputFormats. >> >> >> >> >> >> >> >> >> >> > >> >> >> >> >> > . Can I specify the output format I want rather than >> > using >> >> >> >> >> > av_guess_format ? all the tutorials use guess >> >> >> >> >> >> >> >> >> >> Yes, you need to specify avformat_alloc_output_context2() >> >> >> >> >> and rely on oformat/format_name parameters, or use >> >> >> >> >> av_guess_format(). >> >> >> >> >> >> >> >> >> >> > >> >> >> >> >> > . What is your recommended format for uncompressed HD >> >> video >> >> > ? >> >> >> >> >> >> >> >> >> >> libx264 is the state of the art encoder (but it has >> >> >> >> >> licensing >> >> >> >> > constraints). >> >> >> >> >> _______________________________________________ >> >> >> >> >> 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 >> >> >> > >> >> >> > _______________________________________________ >> >> >> > 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 >> >> > >> >> _______________________________________________ >> >> 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 > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > From jmorgie at yahoo.com Mon Jan 21 22:37:03 2013 From: jmorgie at yahoo.com (jim morgenstern) Date: Mon, 21 Jan 2013 16:37:03 -0500 Subject: [Libav-user] How to specify output format In-Reply-To: References: <015501cdf611$f3b7ac30$db270490$@ImageMining.net> <20130121124935.GV9458@arborea> <030a01cdf7e4$de8bcb00$9ba36100$@yahoo.com> <032601cdf7ea$dae21530$90a63f90$@yahoo.com> <033501cdf7f0$8c73e670$a55bb350$@yahoo.com> <036501cdf800$eb7da1a0$c278e4e0$@yahoo.com> <038201cdf815$b6be7830$243b6890$@yahoo.com> Message-ID: <039001cdf81f$74199280$5c4cb780$@yahoo.com> Thanks again. What I am not clear on is this -- after > m_pFormatContext->oformat = m_pOutputFormat; Sets up the whole structure, what individual fields can be tweaked and what tweaks require further tweaking other fields ... it is not clear to me what is connected to what. Yr comment re avctx was helpful jm > -----Original Message----- > From: libav-user-bounces at ffmpeg.org [mailto:libav-user-bounces at ffmpeg.org] > On Behalf Of Paul B Mahol > Sent: Monday, January 21, 2013 3:54 PM > To: This list is about using libavcodec, libavformat, libavutil, libavdevice and > libavfilter. > Subject: Re: [Libav-user] How to specify output format > > On 1/21/13, jim morgenstern wrote: > > So this is the piece to the puzzle I am missing: > > > > * where does one set the output pixel format / video codec to > > CODEC_ID_RAWVIDEO ? > > I have > >> > m_pOutputFormat = av_guess_format(NULL, filename, NULL); > >> > m_pFormatContext = avformat_alloc_context(); > >> > m_pFormatContext->oformat = m_pOutputFormat; > > > > So after I get a format context then I can go in and tweak the various > > fields? > > m_pFormatContext->oformat->video_codec = CODEC_ID_RAWVIDEO. > > When initialzing encoder you specify pix_fmt: example: > avctx->pix_fmt = PIX_FMT_YUV420P; > > There is example code: > > http://git.videolan.org/?p=ffmpeg.git;a=blob;f=doc/examples/muxing.c > > > Sure wish someone would write a book > > > > Thanks > > > > > > > >> -----Original Message----- > >> From: libav-user-bounces at ffmpeg.org > >> [mailto:libav-user-bounces at ffmpeg.org] > >> On Behalf Of Paul B Mahol > >> Sent: Monday, January 21, 2013 1:06 PM > >> To: This list is about using libavcodec, libavformat, libavutil, > > libavdevice and > >> libavfilter. > >> Subject: Re: [Libav-user] How to specify output format > >> > >> On 1/21/13, jim morgenstern wrote: > >> > Paul -- couple of problems > >> > > >> > I did as you suggested and specified the output file as: *.nut > >> > ** ffmpeg associates the MPEG4 codec with this output and I want > >> > uncompressed > >> > ** the audio stream bombs > >> > > >> > Thanks for any help you can provide > >> > >> I said you must set video codec to rawvideo aka CODEC_ID_RAWVIDEO. > >> > >> > > >> > Here is a code snippet, then screen output from ffmpeg: > >> > ========= > >> > > >> > m_pOutputFormat = av_guess_format(NULL, filename, NULL); > >> > m_pFormatContext = avformat_alloc_context(); > >> > m_pFormatContext->oformat = m_pOutputFormat; > >> > _snprintf_s(m_pFormatContext->filename, > >> > sizeof(m_pFormatContext->filename), "%s", filename); > >> > > >> > // add the audio and video streams using the default format codecs > >> > and initialize the codecs. > >> > m_pAudioStream = NULL; > >> > if (m_pOutputFormat->audio_codec != CODEC_ID_NONE) > >> > { > >> > m_pAudioStream = add_audio_stream(m_pFormatContext, > >> > m_pOutputFormat->audio_codec, channels); > >> > } > >> > // and the abort comes from add_audio_stream > ================== > >> > > >> > Starting MediaFileIO for D:\Data\Solavei.mov > >> > > >> > [mov,mp4,m4a,3gp,3g2,mj2 @ 00ad3320] Stream #1: not enough frames > >> > to estimate ra te; consider increasing probesize > >> > [mov,mp4,m4a,3gp,3g2,mj2 @ 00ad3320] Stream #2: not enough frames > >> > to estimate ra te; consider increasing probesize > >> > > >> > Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'D:\Data\Solavei.mov': > >> > Metadata: > >> > major_brand : qt > >> > minor_version : 537199360 > >> > compatible_brands: qt > >> > creation_time : 2012-07-12 23:41:43 > >> > Duration: 00:00:11.81, start: 0.000000, bitrate: 598161 kb/s > >> > Stream #0:0(eng): Video: v210 (v210 / 0x30313276), yuv422p10le, > >> > 1280x720, 59 > >> > 6600 kb/s, SAR 1:1 DAR 16:9, 29.97 fps, 29.97 tbr, 30k tbn, 30k tbc > >> > Metadata: > >> > creation_time : 2012-07-12 23:41:43 > >> > handler_name : Apple Alias Data Handler > >> > Stream #0:1(eng): Audio: pcm_s16le (sowt / 0x74776F73), 48000 > >> > Hz, stereo, s1 6, 1536 kb/s > >> > Metadata: > >> > creation_time : 2012-07-12 23:41:43 > >> > handler_name : Apple Alias Data Handler > >> > Stream #0:2(eng): Data: none (tmcd / 0x64636D74) > >> > Metadata: > >> > creation_time : 2012-07-12 23:42:01 > >> > handler_name : Apple Alias Data Handler > >> > timecode : 00:00:28;11 > >> > > >> > > >> > Starting MediaFileIO for => D:\Data\TestSol.nut Output #0, nut, to > >> > 'D:\Data\TestSol.nut': > >> > Stream #0:0: Video: mpeg4, yuv420p, 1280x720, q=2-31, 5942 > >> > kb/s, 90k tbn, 29 tbc > >> > Stream #0:1: Audio: vorbis, 44100 Hz, 1 channels, s16, 64 kb/s > >> > [libvorbis @ 054e20c0] Specified sample_fmt is not supported. > >> > > >> > File Initialization Exception: output !! > >> > MediaFileWriter::open_audio: Could not open audio codec //this is my > > app > >> > error message > >> > >> You want to store audio? If yes. What codec? > >> > >> > >> > > >> > > >> > > >> > > >> > > >> >> -----Original Message----- > >> >> From: libav-user-bounces at ffmpeg.org > >> >> [mailto:libav-user-bounces at ffmpeg.org] > >> >> On Behalf Of Paul B Mahol > >> >> Sent: Monday, January 21, 2013 11:26 AM > >> >> To: This list is about using libavcodec, libavformat, libavutil, > >> > libavdevice and > >> >> libavfilter. > >> >> Subject: Re: [Libav-user] How to specify output format > >> >> > >> >> On 1/21/13, jim morgenstern wrote: > >> >> > Paul > >> >> > Thanks for the specifics. I don't like headerless so .raw and > >> >> > .yuv are out. > >> >> > > >> >> > Hadn't heard of .nut; I don't understand your comment about > >> >> > -vcodec > >> > etc. > >> >> > I am writing a C++ app not using the command line utilities. > >> >> > >> >> I mean video codec should be set to rawvideo. And pixel format for > >> >> that > >> > codec > >> >> should be same as one detected in input. > >> >> > >> >> > > >> >> > So what all do I need to know about .nut? Googled but cannot > >> >> > find any definitions or spec for the file. Can you send a url? > >> >> > >> >> You really should not need know anything, you just set output > >> >> format to > >> > nut and > >> >> it is all what is needed. I doubt you want nut spec if you gonna > >> >> use > >> > libavformat to > >> >> read nut files. > >> >> > >> >> > > >> >> > > >> >> > > >> >> >> -----Original Message----- > >> >> >> From: libav-user-bounces at ffmpeg.org > >> >> >> [mailto:libav-user-bounces at ffmpeg.org] > >> >> >> On Behalf Of Paul B Mahol > >> >> >> Sent: Monday, January 21, 2013 10:41 AM > >> >> >> To: This list is about using libavcodec, libavformat, > >> >> >> libavutil, > >> >> > libavdevice and > >> >> >> libavfilter. > >> >> >> Subject: Re: [Libav-user] How to specify output format > >> >> >> > >> >> >> On 1/21/13, jim morgenstern wrote: > >> >> >> > So what Specifically is the specific format extension that I > >> >> >> > give to ffmpeg that gives me the "raw video format" you cited? > >> >> >> > >> >> >> Headerless : .raw, .yuv (You need to remember pixel format and > >> >> >> dimensions stored in it) > >> >> >> > >> >> >> With headers : .nut (You must use -vcodec rawvideo and -pix_fmt > >> >> >> same as > >> >> > your > >> >> >> input video > >> >> >> to keep video uncompressed) > >> >> >> There are others like .avi, .. but they may not support > >> >> >> pixel format > >> >> > of your > >> >> >> input video. > >> >> >> > >> >> >> > > >> >> >> >> -----Original Message----- > >> >> >> >> From: libav-user-bounces at ffmpeg.org > >> >> >> >> [mailto:libav-user-bounces at ffmpeg.org] > >> >> >> >> On Behalf Of Paul B Mahol > >> >> >> >> Sent: Monday, January 21, 2013 9:50 AM > >> >> >> >> To: This list is about using libavcodec, libavformat, > >> >> >> >> libavutil, > >> >> >> > libavdevice and > >> >> >> >> libavfilter. > >> >> >> >> Subject: Re: [Libav-user] How to specify output format > >> >> >> >> > >> >> >> >> On 1/21/13, jim morgenstern wrote: > >> >> >> >> >>> where can I find the list of formats and their extensions? > >> >> >> >> >> In the source code > >> >> >> >> > > >> >> >> >> > Yes but the source code is hundreds of files; can you > >> >> >> >> > tell me which one has the list and the mapping? > >> >> >> >> > > >> >> >> >> > > >> >> >> >> >> > . What is your recommended format for uncompressed > HD > >> >> video > >> >> > ? > >> >> >> >> >> > >> >> >> >> >> libx264 is the state of the art encode > >> >> >> >> > > >> >> >> >> > But I do not want any encoding or compression: I want > >> >> >> >> > flat file that can be read later on for more processing. > >> >> >> >> > So is there a recommendation for a particular file format > >> >> >> >> > that does > > this? > >> >> >> >> > >> >> >> >> Depends on what you gonna use for more processing later. > >> >> >> >> Depending on available storage and CPU speed you could use > >> >> >> >> raw video formats... > >> >> >> >> > >> >> >> >> > > >> >> >> >> > > >> >> >> >> > > >> >> >> >> > > >> >> >> >> >> -----Original Message----- > >> >> >> >> >> From: libav-user-bounces at ffmpeg.org > >> >> >> >> >> [mailto:libav-user-bounces at ffmpeg.org] > >> >> >> >> >> On Behalf Of Stefano Sabatini > >> >> >> >> >> Sent: Monday, January 21, 2013 7:50 AM > >> >> >> >> >> To: This list is about using libavcodec, libavformat, > >> >> >> >> >> libavutil, > >> >> >> >> > libavdevice and > >> >> >> >> >> libavfilter. > >> >> >> >> >> Subject: Re: [Libav-user] How to specify output format > >> >> >> >> >> > >> >> >> >> >> In data Saturday 2013-01-19 01:55:22 -0500, Jim > >> >> >> >> >> Morgenstern ha > >> >> >> >> >> scritto: > >> >> >> >> >> > I have C++ app [win 7] that is reading and writing > >> >> >> >> >> > video/audio > >> >> >> > stream. > >> >> >> >> >> > > >> >> >> >> >> > > >> >> >> >> >> > > >> >> >> >> >> > When I specify the output file as xxxx.MOV I am getting > >> >> >> >> >> > H264 compressed video at 24 fps. > >> >> >> >> >> > > >> >> >> >> >> > > >> >> >> >> >> > > >> >> >> >> >> > I want to have output as uncompressed at 30 or 60 fps > >> >> >> >> >> > according to the input. > >> >> >> >> >> > > >> >> >> >> >> > > >> >> >> >> >> > > >> >> >> >> >> > Some simple [I hope] questions: > >> >> >> >> >> > > >> >> >> >> >> > . What is [where can I find] the mapping between file > >> > name > >> >> >> >> > extension > >> >> >> >> >> > and format used? > >> >> >> >> >> > >> >> >> >> >> In the source code, or you can show the ".extensions" > >> >> >> >> >> field for all the > >> >> >> >> > registered > >> >> >> >> >> AVInput/OutputFormats. > >> >> >> >> >> > >> >> >> >> >> > > >> >> >> >> >> > . Can I specify the output format I want rather than > >> > using > >> >> >> >> >> > av_guess_format ? all the tutorials use guess > >> >> >> >> >> > >> >> >> >> >> Yes, you need to specify avformat_alloc_output_context2() > >> >> >> >> >> and rely on oformat/format_name parameters, or use > >> >> >> >> >> av_guess_format(). > >> >> >> >> >> > >> >> >> >> >> > > >> >> >> >> >> > . What is your recommended format for uncompressed > HD > >> >> video > >> >> > ? > >> >> >> >> >> > >> >> >> >> >> libx264 is the state of the art encoder (but it has > >> >> >> >> >> licensing > >> >> >> >> > constraints). > >> >> >> >> >> _______________________________________________ > >> >> >> >> >> 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 > >> >> >> > > >> >> >> > _______________________________________________ > >> >> >> > 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 > >> >> > > >> >> _______________________________________________ > >> >> 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 > > > > _______________________________________________ > > 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 cehoyos at ag.or.at Tue Jan 22 00:03:06 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Mon, 21 Jan 2013 23:03:06 +0000 (UTC) Subject: [Libav-user] Possible infinite loop in libavcodec/h264.c References: <4A5D39451BA90342930681D4B481B52118C947D2B9@mail-btp-svr2.skyline.local> Message-ID: writes: > I am tracking down a memory leak in vlc where within > a matter of seconds vlc consumes over 14G of memory, Is there a sample that allows to reproduce this? If yes, please provide it. > the problem is intermittent. (That is not a good sign.) > I think that the problem may be an infinite loop in > libavcodec/h264.c at around line 1894 inside a while > loop that allocates frames: (If you found a work-around that fixes the issue, please post it, even if not correct it may lead to the source of the problem.) [...] > What I did was created some diagnostic code which > tracked the pointers from p_picture structures > allocated from within VLC per thread. If the number of > pictures allocated over one second exceeded a threshold > (100 pictures) a flag was set that would raise an > exception on the next allocation, this would in turn > force a stack trace in gdb: Is it not possible to see the backtrace without additional changes? Did you already try to reproduce the issue with FFmpeg alone / without vlc? [...] > CONFIDENTIALITY NOTICE: The information contained in this electronic message is confidential information Please understand that this makes no sense in an email sent to a public mailing list that is mirrored many times on the internet. Carl Eugen From adrozdoff at gmail.com Tue Jan 22 00:08:30 2013 From: adrozdoff at gmail.com (hatred) Date: Tue, 22 Jan 2013 09:08:30 +1000 Subject: [Libav-user] Encoding and Decoding on separate ends In-Reply-To: References: Message-ID: Hi Vistas, > I want to be able to open a video file on one end, encode it to h264 and then send it over RTP(custom library) to another end for decoding.> I am not sure how exactly I am going to open the AVFormatContext and > AVCodecContext on the receiving end. I am able to serialize AVPackets correctly. > I am new to libav* and I can' t see how I need to initialize the AVFormat state on the decoding side. I use same work-flow in my live transcoder: https://www.gitorious.org/live-transcoder It read and decode packets in one thread, pass decoded data to multiple encode threads (to encode in multiple formats) and at the end, pass encoded packets to one or multiple muxing threads, that uses custom writer to send muxed data via HTTP. Transcoder uses my AVCPP lib, that C++ wrapper for libavformat, libavcodec and libavfilter (also: libavutil, libswscale) -------------- next part -------------- An HTML attachment was scrubbed... URL: From jmorgie at yahoo.com Tue Jan 22 00:31:11 2013 From: jmorgie at yahoo.com (jim morgenstern) Date: Mon, 21 Jan 2013 18:31:11 -0500 Subject: [Libav-user] How to specify output format In-Reply-To: References: <015501cdf611$f3b7ac30$db270490$@ImageMining.net> <20130121124935.GV9458@arborea> <030a01cdf7e4$de8bcb00$9ba36100$@yahoo.com> <032601cdf7ea$dae21530$90a63f90$@yahoo.com> <033501cdf7f0$8c73e670$a55bb350$@yahoo.com> <036501cdf800$eb7da1a0$c278e4e0$@yahoo.com> <038201cdf815$b6be7830$243b6890$@yahoo.com> Message-ID: <03b401cdf82f$65db88d0$31929a70$@yahoo.com> One [last] question: My 3 band image is in YUV422 pixel format so its in three 2D arrays . . . is the CodecID still RAWIMAGE or is there a better or correct choice ? jm > -----Original Message----- > From: libav-user-bounces at ffmpeg.org [mailto:libav-user-bounces at ffmpeg.org] > On Behalf Of Paul B Mahol > Sent: Monday, January 21, 2013 3:54 PM > To: This list is about using libavcodec, libavformat, libavutil, libavdevice and > libavfilter. > Subject: Re: [Libav-user] How to specify output format > > On 1/21/13, jim morgenstern wrote: > > So this is the piece to the puzzle I am missing: > > > > * where does one set the output pixel format / video codec to > > CODEC_ID_RAWVIDEO ? > > I have > >> > m_pOutputFormat = av_guess_format(NULL, filename, NULL); > >> > m_pFormatContext = avformat_alloc_context(); > >> > m_pFormatContext->oformat = m_pOutputFormat; > > > > So after I get a format context then I can go in and tweak the various > > fields? > > m_pFormatContext->oformat->video_codec = CODEC_ID_RAWVIDEO. > > When initialzing encoder you specify pix_fmt: example: > avctx->pix_fmt = PIX_FMT_YUV420P; > > There is example code: > > http://git.videolan.org/?p=ffmpeg.git;a=blob;f=doc/examples/muxing.c > > > Sure wish someone would write a book > > > > Thanks > > > > > > > >> -----Original Message----- > >> From: libav-user-bounces at ffmpeg.org > >> [mailto:libav-user-bounces at ffmpeg.org] > >> On Behalf Of Paul B Mahol > >> Sent: Monday, January 21, 2013 1:06 PM > >> To: This list is about using libavcodec, libavformat, libavutil, > > libavdevice and > >> libavfilter. > >> Subject: Re: [Libav-user] How to specify output format > >> > >> On 1/21/13, jim morgenstern wrote: > >> > Paul -- couple of problems > >> > > >> > I did as you suggested and specified the output file as: *.nut > >> > ** ffmpeg associates the MPEG4 codec with this output and I want > >> > uncompressed > >> > ** the audio stream bombs > >> > > >> > Thanks for any help you can provide > >> > >> I said you must set video codec to rawvideo aka CODEC_ID_RAWVIDEO. > >> > >> > > >> > Here is a code snippet, then screen output from ffmpeg: > >> > ========= > >> > > >> > m_pOutputFormat = av_guess_format(NULL, filename, NULL); > >> > m_pFormatContext = avformat_alloc_context(); > >> > m_pFormatContext->oformat = m_pOutputFormat; > >> > _snprintf_s(m_pFormatContext->filename, > >> > sizeof(m_pFormatContext->filename), "%s", filename); > >> > > >> > // add the audio and video streams using the default format codecs > >> > and initialize the codecs. > >> > m_pAudioStream = NULL; > >> > if (m_pOutputFormat->audio_codec != CODEC_ID_NONE) > >> > { > >> > m_pAudioStream = add_audio_stream(m_pFormatContext, > >> > m_pOutputFormat->audio_codec, channels); > >> > } > >> > // and the abort comes from add_audio_stream > ================== > >> > > >> > Starting MediaFileIO for D:\Data\Solavei.mov > >> > > >> > [mov,mp4,m4a,3gp,3g2,mj2 @ 00ad3320] Stream #1: not enough frames > >> > to estimate ra te; consider increasing probesize > >> > [mov,mp4,m4a,3gp,3g2,mj2 @ 00ad3320] Stream #2: not enough frames > >> > to estimate ra te; consider increasing probesize > >> > > >> > Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'D:\Data\Solavei.mov': > >> > Metadata: > >> > major_brand : qt > >> > minor_version : 537199360 > >> > compatible_brands: qt > >> > creation_time : 2012-07-12 23:41:43 > >> > Duration: 00:00:11.81, start: 0.000000, bitrate: 598161 kb/s > >> > Stream #0:0(eng): Video: v210 (v210 / 0x30313276), yuv422p10le, > >> > 1280x720, 59 > >> > 6600 kb/s, SAR 1:1 DAR 16:9, 29.97 fps, 29.97 tbr, 30k tbn, 30k tbc > >> > Metadata: > >> > creation_time : 2012-07-12 23:41:43 > >> > handler_name : Apple Alias Data Handler > >> > Stream #0:1(eng): Audio: pcm_s16le (sowt / 0x74776F73), 48000 > >> > Hz, stereo, s1 6, 1536 kb/s > >> > Metadata: > >> > creation_time : 2012-07-12 23:41:43 > >> > handler_name : Apple Alias Data Handler > >> > Stream #0:2(eng): Data: none (tmcd / 0x64636D74) > >> > Metadata: > >> > creation_time : 2012-07-12 23:42:01 > >> > handler_name : Apple Alias Data Handler > >> > timecode : 00:00:28;11 > >> > > >> > > >> > Starting MediaFileIO for => D:\Data\TestSol.nut Output #0, nut, to > >> > 'D:\Data\TestSol.nut': > >> > Stream #0:0: Video: mpeg4, yuv420p, 1280x720, q=2-31, 5942 > >> > kb/s, 90k tbn, 29 tbc > >> > Stream #0:1: Audio: vorbis, 44100 Hz, 1 channels, s16, 64 kb/s > >> > [libvorbis @ 054e20c0] Specified sample_fmt is not supported. > >> > > >> > File Initialization Exception: output !! > >> > MediaFileWriter::open_audio: Could not open audio codec //this is my > > app > >> > error message > >> > >> You want to store audio? If yes. What codec? > >> > >> > >> > > >> > > >> > > >> > > >> > > >> >> -----Original Message----- > >> >> From: libav-user-bounces at ffmpeg.org > >> >> [mailto:libav-user-bounces at ffmpeg.org] > >> >> On Behalf Of Paul B Mahol > >> >> Sent: Monday, January 21, 2013 11:26 AM > >> >> To: This list is about using libavcodec, libavformat, libavutil, > >> > libavdevice and > >> >> libavfilter. > >> >> Subject: Re: [Libav-user] How to specify output format > >> >> > >> >> On 1/21/13, jim morgenstern wrote: > >> >> > Paul > >> >> > Thanks for the specifics. I don't like headerless so .raw and > >> >> > .yuv are out. > >> >> > > >> >> > Hadn't heard of .nut; I don't understand your comment about > >> >> > -vcodec > >> > etc. > >> >> > I am writing a C++ app not using the command line utilities. > >> >> > >> >> I mean video codec should be set to rawvideo. And pixel format for > >> >> that > >> > codec > >> >> should be same as one detected in input. > >> >> > >> >> > > >> >> > So what all do I need to know about .nut? Googled but cannot > >> >> > find any definitions or spec for the file. Can you send a url? > >> >> > >> >> You really should not need know anything, you just set output > >> >> format to > >> > nut and > >> >> it is all what is needed. I doubt you want nut spec if you gonna > >> >> use > >> > libavformat to > >> >> read nut files. > >> >> > >> >> > > >> >> > > >> >> > > >> >> >> -----Original Message----- > >> >> >> From: libav-user-bounces at ffmpeg.org > >> >> >> [mailto:libav-user-bounces at ffmpeg.org] > >> >> >> On Behalf Of Paul B Mahol > >> >> >> Sent: Monday, January 21, 2013 10:41 AM > >> >> >> To: This list is about using libavcodec, libavformat, > >> >> >> libavutil, > >> >> > libavdevice and > >> >> >> libavfilter. > >> >> >> Subject: Re: [Libav-user] How to specify output format > >> >> >> > >> >> >> On 1/21/13, jim morgenstern wrote: > >> >> >> > So what Specifically is the specific format extension that I > >> >> >> > give to ffmpeg that gives me the "raw video format" you cited? > >> >> >> > >> >> >> Headerless : .raw, .yuv (You need to remember pixel format and > >> >> >> dimensions stored in it) > >> >> >> > >> >> >> With headers : .nut (You must use -vcodec rawvideo and -pix_fmt > >> >> >> same as > >> >> > your > >> >> >> input video > >> >> >> to keep video uncompressed) > >> >> >> There are others like .avi, .. but they may not support > >> >> >> pixel format > >> >> > of your > >> >> >> input video. > >> >> >> > >> >> >> > > >> >> >> >> -----Original Message----- > >> >> >> >> From: libav-user-bounces at ffmpeg.org > >> >> >> >> [mailto:libav-user-bounces at ffmpeg.org] > >> >> >> >> On Behalf Of Paul B Mahol > >> >> >> >> Sent: Monday, January 21, 2013 9:50 AM > >> >> >> >> To: This list is about using libavcodec, libavformat, > >> >> >> >> libavutil, > >> >> >> > libavdevice and > >> >> >> >> libavfilter. > >> >> >> >> Subject: Re: [Libav-user] How to specify output format > >> >> >> >> > >> >> >> >> On 1/21/13, jim morgenstern wrote: > >> >> >> >> >>> where can I find the list of formats and their extensions? > >> >> >> >> >> In the source code > >> >> >> >> > > >> >> >> >> > Yes but the source code is hundreds of files; can you > >> >> >> >> > tell me which one has the list and the mapping? > >> >> >> >> > > >> >> >> >> > > >> >> >> >> >> > . What is your recommended format for uncompressed > HD > >> >> video > >> >> > ? > >> >> >> >> >> > >> >> >> >> >> libx264 is the state of the art encode > >> >> >> >> > > >> >> >> >> > But I do not want any encoding or compression: I want > >> >> >> >> > flat file that can be read later on for more processing. > >> >> >> >> > So is there a recommendation for a particular file format > >> >> >> >> > that does > > this? > >> >> >> >> > >> >> >> >> Depends on what you gonna use for more processing later. > >> >> >> >> Depending on available storage and CPU speed you could use > >> >> >> >> raw video formats... > >> >> >> >> > >> >> >> >> > > >> >> >> >> > > >> >> >> >> > > >> >> >> >> > > >> >> >> >> >> -----Original Message----- > >> >> >> >> >> From: libav-user-bounces at ffmpeg.org > >> >> >> >> >> [mailto:libav-user-bounces at ffmpeg.org] > >> >> >> >> >> On Behalf Of Stefano Sabatini > >> >> >> >> >> Sent: Monday, January 21, 2013 7:50 AM > >> >> >> >> >> To: This list is about using libavcodec, libavformat, > >> >> >> >> >> libavutil, > >> >> >> >> > libavdevice and > >> >> >> >> >> libavfilter. > >> >> >> >> >> Subject: Re: [Libav-user] How to specify output format > >> >> >> >> >> > >> >> >> >> >> In data Saturday 2013-01-19 01:55:22 -0500, Jim > >> >> >> >> >> Morgenstern ha > >> >> >> >> >> scritto: > >> >> >> >> >> > I have C++ app [win 7] that is reading and writing > >> >> >> >> >> > video/audio > >> >> >> > stream. > >> >> >> >> >> > > >> >> >> >> >> > > >> >> >> >> >> > > >> >> >> >> >> > When I specify the output file as xxxx.MOV I am getting > >> >> >> >> >> > H264 compressed video at 24 fps. > >> >> >> >> >> > > >> >> >> >> >> > > >> >> >> >> >> > > >> >> >> >> >> > I want to have output as uncompressed at 30 or 60 fps > >> >> >> >> >> > according to the input. > >> >> >> >> >> > > >> >> >> >> >> > > >> >> >> >> >> > > >> >> >> >> >> > Some simple [I hope] questions: > >> >> >> >> >> > > >> >> >> >> >> > . What is [where can I find] the mapping between file > >> > name > >> >> >> >> > extension > >> >> >> >> >> > and format used? > >> >> >> >> >> > >> >> >> >> >> In the source code, or you can show the ".extensions" > >> >> >> >> >> field for all the > >> >> >> >> > registered > >> >> >> >> >> AVInput/OutputFormats. > >> >> >> >> >> > >> >> >> >> >> > > >> >> >> >> >> > . Can I specify the output format I want rather than > >> > using > >> >> >> >> >> > av_guess_format ? all the tutorials use guess > >> >> >> >> >> > >> >> >> >> >> Yes, you need to specify avformat_alloc_output_context2() > >> >> >> >> >> and rely on oformat/format_name parameters, or use > >> >> >> >> >> av_guess_format(). > >> >> >> >> >> > >> >> >> >> >> > > >> >> >> >> >> > . What is your recommended format for uncompressed > HD > >> >> video > >> >> > ? > >> >> >> >> >> > >> >> >> >> >> libx264 is the state of the art encoder (but it has > >> >> >> >> >> licensing > >> >> >> >> > constraints). > >> >> >> >> >> _______________________________________________ > >> >> >> >> >> 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 > >> >> >> > > >> >> >> > _______________________________________________ > >> >> >> > 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 > >> >> > > >> >> _______________________________________________ > >> >> 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 > > > > _______________________________________________ > > 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 mtaha.ansari at gmail.com Tue Jan 22 05:37:11 2013 From: mtaha.ansari at gmail.com (Taha Ansari) Date: Tue, 22 Jan 2013 09:37:11 +0500 Subject: [Libav-user] Detecting bit rate from live stream In-Reply-To: References: Message-ID: Hi, I've been looking deeper into this, unfortunately so far I could not find a way to detect live stream's bit rate, or any way I could some how 'stuff' custom data (which would be bit rate in my case) with the encoder, and extract that on the network decoding end. Kindly, could anyone guide me how can I achieve this? Also any hints are most welcome... Thanks for your time... On Wed, Jan 16, 2013 at 12:48 PM, Taha Ansari wrote: > Hi! > > I am using h264 encoding to transmit video to destination network address > using udp protocol. I also want to detect bit rate of the encoded frame on > receiver end. In the pFormatCtx->bit_rate, and pCodecCtx->bit_rate, I see > on receiver end, they are all zero. I understand since it is live streaming > bit rate isn't stuffed there, but I would like to know if there is any way > I could retrieve actual bit rate frame was transmitted on, on client side > (i.e. decoder side decoding video over network). > > Can anyone kindly provide some guidance or tips on how to do this? > > Thanks for your time! > -------------- next part -------------- An HTML attachment was scrubbed... URL: From kalileo at universalx.net Tue Jan 22 06:35:17 2013 From: kalileo at universalx.net (Kalileo) Date: Tue, 22 Jan 2013 12:35:17 +0700 Subject: [Libav-user] Detecting bit rate from live stream In-Reply-To: References: Message-ID: <5FC43C17-6E59-4C67-9461-8586CABB6B3C@universalx.net> On Jan 22, 2013, at 11:37 , Taha Ansari wrote: > Hi, > > I've been looking deeper into this, unfortunately so far I could not find a way to detect live stream's bit rate, or any way I could some how 'stuff' custom data (which would be bit rate in my case) with the encoder, and extract that on the network decoding end. > > Kindly, could anyone guide me how can I achieve this? Also any hints are most welcome... > > Thanks for your time... > > On Wed, Jan 16, 2013 at 12:48 PM, Taha Ansari wrote: > Hi! > > I am using h264 encoding to transmit video to destination network address using udp protocol. I also want to detect bit rate of the encoded frame on receiver end. In the pFormatCtx->bit_rate, and pCodecCtx->bit_rate, I see on receiver end, they are all zero. I understand since it is live streaming bit rate isn't stuffed there, but I would like to know if there is any way I could retrieve actual bit rate frame was transmitted on, on client side (i.e. decoder side decoding video over network). > > Can anyone kindly provide some guidance or tips on how to do this? > > Thanks for your time! > Did you try running avformat_find_stream_info() after opening the codec context and before checking the bitrate fields? From mtaha.ansari at gmail.com Tue Jan 22 08:34:53 2013 From: mtaha.ansari at gmail.com (Taha Ansari) Date: Tue, 22 Jan 2013 12:34:53 +0500 Subject: [Libav-user] Detecting bit rate from live stream In-Reply-To: <5FC43C17-6E59-4C67-9461-8586CABB6B3C@universalx.net> References: <5FC43C17-6E59-4C67-9461-8586CABB6B3C@universalx.net> Message-ID: Hi kalileo, Thanks for the reply, yes I just tried this - i.e. looking at following code: if(avformat_find_stream_info(this->pFormatCtx, NULL)<0) return -1; // Couldn't find stream information // Dump information about file onto standard error av_dump_format(this->pFormatCtx, 0, this->finalInputName.c_str(), 0); At time of opening up decoder for live udp stream (like: udp://localhost:8765/a.h264) is still giving me bit_rate '0'. On Tue, Jan 22, 2013 at 10:35 AM, Kalileo wrote: > > On Jan 22, 2013, at 11:37 , Taha Ansari wrote: > > > Hi, > > > > I've been looking deeper into this, unfortunately so far I could not > find a way to detect live stream's bit rate, or any way I could some how > 'stuff' custom data (which would be bit rate in my case) with the encoder, > and extract that on the network decoding end. > > > > Kindly, could anyone guide me how can I achieve this? Also any hints are > most welcome... > > > > Thanks for your time... > > > > On Wed, Jan 16, 2013 at 12:48 PM, Taha Ansari > wrote: > > Hi! > > > > I am using h264 encoding to transmit video to destination network > address using udp protocol. I also want to detect bit rate of the encoded > frame on receiver end. In the pFormatCtx->bit_rate, and > pCodecCtx->bit_rate, I see on receiver end, they are all zero. I understand > since it is live streaming bit rate isn't stuffed there, but I would like > to know if there is any way I could retrieve actual bit rate frame was > transmitted on, on client side (i.e. decoder side decoding video over > network). > > > > Can anyone kindly provide some guidance or tips on how to do this? > > > > Thanks for your time! > > > > Did you try running avformat_find_stream_info() after opening the codec > context and before checking the bitrate fields? > > _______________________________________________ > 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 mtaha.ansari at gmail.com Tue Jan 22 08:41:51 2013 From: mtaha.ansari at gmail.com (Taha Ansari) Date: Tue, 22 Jan 2013 12:41:51 +0500 Subject: [Libav-user] Detecting bit rate from live stream In-Reply-To: References: <5FC43C17-6E59-4C67-9461-8586CABB6B3C@universalx.net> Message-ID: As an update: I do not call 'avformat_find_stream_info()' after opening codec context, rather, the sequence is as similar to following: 1- pFormatCtx = avformat_alloc_context(); 2- rv = avformat_open_input(&this->pFormatCtx, this->finalInputName.c_str(), NULL, NULL); if ( this->pFormatCtx == NULL || this->pFormatCtx->iformat == NULL ) { return -1; } 3- if(avformat_find_stream_info(this->pFormatCtx, NULL)<0) return -1; // Couldn't find stream information // Dump information about file onto standard error av_dump_format(this->pFormatCtx, 0, this->finalInputName.c_str(), 0); 4- this->videoStream = -1; for(i=0; ipFormatCtx->nb_streams; i++) { if(this->pFormatCtx->streams[i]->codec->codec_type==AVMEDIA_TYPE_VIDEO) { this->videoStream=i; break; } } 5- if(this->videoStream !=-1) { // Get a pointer to the codec context for the video stream this->pCodecCtxVideo=this->pFormatCtx->streams[this->videoStream]->codec; // Find the decoder for the video stream this->pCodecVideo=avcodec_find_decoder(this->pCodecCtxVideo->codec_id); if(this->pCodecVideo==NULL) { fprintf(stderr, "Unsupported avido codec!\n"); return -1; // Codec not found } // Open codec AVDictionary *codecDictOptions = NULL; if(avcodec_open2(this->pCodecCtxVideo, this->pCodecVideo, &codecDictOptions)<0) return -1; // Could not open codec ... ... ... So on... So, in words, this is the sequence: 1- open format context 2- get video stream index 3- get codec context for video 'from' format context's stream 4- open codec using avcodec_open2 function On Tue, Jan 22, 2013 at 12:34 PM, Taha Ansari wrote: > Hi kalileo, > > Thanks for the reply, yes I just tried this - i.e. looking at following > code: > > if(avformat_find_stream_info(this->pFormatCtx, NULL)<0) > return -1; // Couldn't find stream information > > // Dump information about file onto standard error > av_dump_format(this->pFormatCtx, 0, this->finalInputName.c_str(), 0); > > At time of opening up decoder for live udp stream (like: > udp://localhost:8765/a.h264) is still giving me bit_rate '0'. > > > On Tue, Jan 22, 2013 at 10:35 AM, Kalileo wrote: > >> >> On Jan 22, 2013, at 11:37 , Taha Ansari wrote: >> >> > Hi, >> > >> > I've been looking deeper into this, unfortunately so far I could not >> find a way to detect live stream's bit rate, or any way I could some how >> 'stuff' custom data (which would be bit rate in my case) with the encoder, >> and extract that on the network decoding end. >> > >> > Kindly, could anyone guide me how can I achieve this? Also any hints >> are most welcome... >> > >> > Thanks for your time... >> > >> > On Wed, Jan 16, 2013 at 12:48 PM, Taha Ansari >> wrote: >> > Hi! >> > >> > I am using h264 encoding to transmit video to destination network >> address using udp protocol. I also want to detect bit rate of the encoded >> frame on receiver end. In the pFormatCtx->bit_rate, and >> pCodecCtx->bit_rate, I see on receiver end, they are all zero. I understand >> since it is live streaming bit rate isn't stuffed there, but I would like >> to know if there is any way I could retrieve actual bit rate frame was >> transmitted on, on client side (i.e. decoder side decoding video over >> network). >> > >> > Can anyone kindly provide some guidance or tips on how to do this? >> > >> > Thanks for your time! >> > >> >> Did you try running avformat_find_stream_info() after opening the codec >> context and before checking the bitrate fields? >> >> _______________________________________________ >> 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 34973832 at qq.com Tue Jan 22 08:45:24 2013 From: 34973832 at qq.com (=?utf-8?B?TXIuIFhpYW8=?=) Date: Tue, 22 Jan 2013 15:45:24 +0800 Subject: [Libav-user] Detecting bit rate from live stream Message-ID: An HTML attachment was scrubbed... URL: From onemda at gmail.com Tue Jan 22 10:48:28 2013 From: onemda at gmail.com (Paul B Mahol) Date: Tue, 22 Jan 2013 09:48:28 +0000 Subject: [Libav-user] How to specify output format In-Reply-To: <03b401cdf82f$65db88d0$31929a70$@yahoo.com> References: <015501cdf611$f3b7ac30$db270490$@ImageMining.net> <20130121124935.GV9458@arborea> <030a01cdf7e4$de8bcb00$9ba36100$@yahoo.com> <032601cdf7ea$dae21530$90a63f90$@yahoo.com> <033501cdf7f0$8c73e670$a55bb350$@yahoo.com> <036501cdf800$eb7da1a0$c278e4e0$@yahoo.com> <038201cdf815$b6be7830$243b6890$@yahoo.com> <03b401cdf82f$65db88d0$31929a70$@yahoo.com> Message-ID: On 1/21/13, jim morgenstern wrote: > One [last] question: > > My 3 band image is in YUV422 pixel format so its in three 2D arrays . . . > is the CodecID still RAWIMAGE or is there a better or correct choice ? codec id CODEC_ID_RAWVIDEO (you said uncompressed, this is only one possible) pix fmt PIX_FMT_YUV422P > > jm > >> -----Original Message----- >> From: libav-user-bounces at ffmpeg.org >> [mailto:libav-user-bounces at ffmpeg.org] >> On Behalf Of Paul B Mahol >> Sent: Monday, January 21, 2013 3:54 PM >> To: This list is about using libavcodec, libavformat, libavutil, > libavdevice and >> libavfilter. >> Subject: Re: [Libav-user] How to specify output format >> >> On 1/21/13, jim morgenstern wrote: >> > So this is the piece to the puzzle I am missing: >> > >> > * where does one set the output pixel format / video codec to >> > CODEC_ID_RAWVIDEO ? >> > I have >> >> > m_pOutputFormat = av_guess_format(NULL, filename, NULL); >> >> > m_pFormatContext = avformat_alloc_context(); >> >> > m_pFormatContext->oformat = m_pOutputFormat; >> > >> > So after I get a format context then I can go in and tweak the various >> > fields? >> >> m_pFormatContext->oformat->video_codec = CODEC_ID_RAWVIDEO. >> >> When initialzing encoder you specify pix_fmt: example: >> avctx->pix_fmt = PIX_FMT_YUV420P; >> >> There is example code: >> >> http://git.videolan.org/?p=ffmpeg.git;a=blob;f=doc/examples/muxing.c >> >> > Sure wish someone would write a book >> > >> > Thanks >> > >> > >> > >> >> -----Original Message----- >> >> From: libav-user-bounces at ffmpeg.org >> >> [mailto:libav-user-bounces at ffmpeg.org] >> >> On Behalf Of Paul B Mahol >> >> Sent: Monday, January 21, 2013 1:06 PM >> >> To: This list is about using libavcodec, libavformat, libavutil, >> > libavdevice and >> >> libavfilter. >> >> Subject: Re: [Libav-user] How to specify output format >> >> >> >> On 1/21/13, jim morgenstern wrote: >> >> > Paul -- couple of problems >> >> > >> >> > I did as you suggested and specified the output file as: *.nut >> >> > ** ffmpeg associates the MPEG4 codec with this output and I want >> >> > uncompressed >> >> > ** the audio stream bombs >> >> > >> >> > Thanks for any help you can provide >> >> >> >> I said you must set video codec to rawvideo aka CODEC_ID_RAWVIDEO. >> >> >> >> > >> >> > Here is a code snippet, then screen output from ffmpeg: >> >> > ========= >> >> > >> >> > m_pOutputFormat = av_guess_format(NULL, filename, NULL); >> >> > m_pFormatContext = avformat_alloc_context(); >> >> > m_pFormatContext->oformat = m_pOutputFormat; >> >> > _snprintf_s(m_pFormatContext->filename, >> >> > sizeof(m_pFormatContext->filename), "%s", filename); >> >> > >> >> > // add the audio and video streams using the default format codecs >> >> > and initialize the codecs. >> >> > m_pAudioStream = NULL; >> >> > if (m_pOutputFormat->audio_codec != CODEC_ID_NONE) >> >> > { >> >> > m_pAudioStream = add_audio_stream(m_pFormatContext, >> >> > m_pOutputFormat->audio_codec, channels); >> >> > } >> >> > // and the abort comes from add_audio_stream >> ================== >> >> > >> >> > Starting MediaFileIO for D:\Data\Solavei.mov >> >> > >> >> > [mov,mp4,m4a,3gp,3g2,mj2 @ 00ad3320] Stream #1: not enough frames >> >> > to estimate ra te; consider increasing probesize >> >> > [mov,mp4,m4a,3gp,3g2,mj2 @ 00ad3320] Stream #2: not enough frames >> >> > to estimate ra te; consider increasing probesize >> >> > >> >> > Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'D:\Data\Solavei.mov': >> >> > Metadata: >> >> > major_brand : qt >> >> > minor_version : 537199360 >> >> > compatible_brands: qt >> >> > creation_time : 2012-07-12 23:41:43 >> >> > Duration: 00:00:11.81, start: 0.000000, bitrate: 598161 kb/s >> >> > Stream #0:0(eng): Video: v210 (v210 / 0x30313276), yuv422p10le, >> >> > 1280x720, 59 >> >> > 6600 kb/s, SAR 1:1 DAR 16:9, 29.97 fps, 29.97 tbr, 30k tbn, 30k tbc >> >> > Metadata: >> >> > creation_time : 2012-07-12 23:41:43 >> >> > handler_name : Apple Alias Data Handler >> >> > Stream #0:1(eng): Audio: pcm_s16le (sowt / 0x74776F73), 48000 >> >> > Hz, stereo, s1 6, 1536 kb/s >> >> > Metadata: >> >> > creation_time : 2012-07-12 23:41:43 >> >> > handler_name : Apple Alias Data Handler >> >> > Stream #0:2(eng): Data: none (tmcd / 0x64636D74) >> >> > Metadata: >> >> > creation_time : 2012-07-12 23:42:01 >> >> > handler_name : Apple Alias Data Handler >> >> > timecode : 00:00:28;11 >> >> > >> >> > >> >> > Starting MediaFileIO for => D:\Data\TestSol.nut Output #0, nut, to >> >> > 'D:\Data\TestSol.nut': >> >> > Stream #0:0: Video: mpeg4, yuv420p, 1280x720, q=2-31, 5942 >> >> > kb/s, 90k tbn, 29 tbc >> >> > Stream #0:1: Audio: vorbis, 44100 Hz, 1 channels, s16, 64 kb/s >> >> > [libvorbis @ 054e20c0] Specified sample_fmt is not supported. >> >> > >> >> > File Initialization Exception: output !! >> >> > MediaFileWriter::open_audio: Could not open audio codec //this is > my >> > app >> >> > error message >> >> >> >> You want to store audio? If yes. What codec? >> >> >> >> >> >> > >> >> > >> >> > >> >> > >> >> > >> >> >> -----Original Message----- >> >> >> From: libav-user-bounces at ffmpeg.org >> >> >> [mailto:libav-user-bounces at ffmpeg.org] >> >> >> On Behalf Of Paul B Mahol >> >> >> Sent: Monday, January 21, 2013 11:26 AM >> >> >> To: This list is about using libavcodec, libavformat, libavutil, >> >> > libavdevice and >> >> >> libavfilter. >> >> >> Subject: Re: [Libav-user] How to specify output format >> >> >> >> >> >> On 1/21/13, jim morgenstern wrote: >> >> >> > Paul >> >> >> > Thanks for the specifics. I don't like headerless so .raw and >> >> >> > .yuv are out. >> >> >> > >> >> >> > Hadn't heard of .nut; I don't understand your comment about >> >> >> > -vcodec >> >> > etc. >> >> >> > I am writing a C++ app not using the command line utilities. >> >> >> >> >> >> I mean video codec should be set to rawvideo. And pixel format for >> >> >> that >> >> > codec >> >> >> should be same as one detected in input. >> >> >> >> >> >> > >> >> >> > So what all do I need to know about .nut? Googled but cannot >> >> >> > find any definitions or spec for the file. Can you send a url? >> >> >> >> >> >> You really should not need know anything, you just set output >> >> >> format to >> >> > nut and >> >> >> it is all what is needed. I doubt you want nut spec if you gonna >> >> >> use >> >> > libavformat to >> >> >> read nut files. >> >> >> >> >> >> > >> >> >> > >> >> >> > >> >> >> >> -----Original Message----- >> >> >> >> From: libav-user-bounces at ffmpeg.org >> >> >> >> [mailto:libav-user-bounces at ffmpeg.org] >> >> >> >> On Behalf Of Paul B Mahol >> >> >> >> Sent: Monday, January 21, 2013 10:41 AM >> >> >> >> To: This list is about using libavcodec, libavformat, >> >> >> >> libavutil, >> >> >> > libavdevice and >> >> >> >> libavfilter. >> >> >> >> Subject: Re: [Libav-user] How to specify output format >> >> >> >> >> >> >> >> On 1/21/13, jim morgenstern wrote: >> >> >> >> > So what Specifically is the specific format extension that I >> >> >> >> > give to ffmpeg that gives me the "raw video format" you cited? >> >> >> >> >> >> >> >> Headerless : .raw, .yuv (You need to remember pixel format and >> >> >> >> dimensions stored in it) >> >> >> >> >> >> >> >> With headers : .nut (You must use -vcodec rawvideo and -pix_fmt >> >> >> >> same as >> >> >> > your >> >> >> >> input video >> >> >> >> to keep video uncompressed) >> >> >> >> There are others like .avi, .. but they may not support >> >> >> >> pixel format >> >> >> > of your >> >> >> >> input video. >> >> >> >> >> >> >> >> > >> >> >> >> >> -----Original Message----- >> >> >> >> >> From: libav-user-bounces at ffmpeg.org >> >> >> >> >> [mailto:libav-user-bounces at ffmpeg.org] >> >> >> >> >> On Behalf Of Paul B Mahol >> >> >> >> >> Sent: Monday, January 21, 2013 9:50 AM >> >> >> >> >> To: This list is about using libavcodec, libavformat, >> >> >> >> >> libavutil, >> >> >> >> > libavdevice and >> >> >> >> >> libavfilter. >> >> >> >> >> Subject: Re: [Libav-user] How to specify output format >> >> >> >> >> >> >> >> >> >> On 1/21/13, jim morgenstern wrote: >> >> >> >> >> >>> where can I find the list of formats and their >> >> >> >> >> >>> extensions? >> >> >> >> >> >> In the source code >> >> >> >> >> > >> >> >> >> >> > Yes but the source code is hundreds of files; can you >> >> >> >> >> > tell me which one has the list and the mapping? >> >> >> >> >> > >> >> >> >> >> > >> >> >> >> >> >> > . What is your recommended format for uncompressed >> HD >> >> >> video >> >> >> > ? >> >> >> >> >> >> >> >> >> >> >> >> libx264 is the state of the art encode >> >> >> >> >> > >> >> >> >> >> > But I do not want any encoding or compression: I want >> >> >> >> >> > flat file that can be read later on for more processing. >> >> >> >> >> > So is there a recommendation for a particular file format >> >> >> >> >> > that does >> > this? >> >> >> >> >> >> >> >> >> >> Depends on what you gonna use for more processing later. >> >> >> >> >> Depending on available storage and CPU speed you could use >> >> >> >> >> raw video formats... >> >> >> >> >> >> >> >> >> >> > >> >> >> >> >> > >> >> >> >> >> > >> >> >> >> >> > >> >> >> >> >> >> -----Original Message----- >> >> >> >> >> >> From: libav-user-bounces at ffmpeg.org >> >> >> >> >> >> [mailto:libav-user-bounces at ffmpeg.org] >> >> >> >> >> >> On Behalf Of Stefano Sabatini >> >> >> >> >> >> Sent: Monday, January 21, 2013 7:50 AM >> >> >> >> >> >> To: This list is about using libavcodec, libavformat, >> >> >> >> >> >> libavutil, >> >> >> >> >> > libavdevice and >> >> >> >> >> >> libavfilter. >> >> >> >> >> >> Subject: Re: [Libav-user] How to specify output format >> >> >> >> >> >> >> >> >> >> >> >> In data Saturday 2013-01-19 01:55:22 -0500, Jim >> >> >> >> >> >> Morgenstern ha >> >> >> >> >> >> scritto: >> >> >> >> >> >> > I have C++ app [win 7] that is reading and writing >> >> >> >> >> >> > video/audio >> >> >> >> > stream. >> >> >> >> >> >> > >> >> >> >> >> >> > >> >> >> >> >> >> > >> >> >> >> >> >> > When I specify the output file as xxxx.MOV I am getting >> >> >> >> >> >> > H264 compressed video at 24 fps. >> >> >> >> >> >> > >> >> >> >> >> >> > >> >> >> >> >> >> > >> >> >> >> >> >> > I want to have output as uncompressed at 30 or 60 fps >> >> >> >> >> >> > according to the input. >> >> >> >> >> >> > >> >> >> >> >> >> > >> >> >> >> >> >> > >> >> >> >> >> >> > Some simple [I hope] questions: >> >> >> >> >> >> > >> >> >> >> >> >> > . What is [where can I find] the mapping between > file >> >> > name >> >> >> >> >> > extension >> >> >> >> >> >> > and format used? >> >> >> >> >> >> >> >> >> >> >> >> In the source code, or you can show the ".extensions" >> >> >> >> >> >> field for all the >> >> >> >> >> > registered >> >> >> >> >> >> AVInput/OutputFormats. >> >> >> >> >> >> >> >> >> >> >> >> > >> >> >> >> >> >> > . Can I specify the output format I want rather > than >> >> > using >> >> >> >> >> >> > av_guess_format ? all the tutorials use guess >> >> >> >> >> >> >> >> >> >> >> >> Yes, you need to specify avformat_alloc_output_context2() >> >> >> >> >> >> and rely on oformat/format_name parameters, or use >> >> >> >> >> >> av_guess_format(). >> >> >> >> >> >> >> >> >> >> >> >> > >> >> >> >> >> >> > . What is your recommended format for uncompressed >> HD >> >> >> video >> >> >> > ? >> >> >> >> >> >> >> >> >> >> >> >> libx264 is the state of the art encoder (but it has >> >> >> >> >> >> licensing >> >> >> >> >> > constraints). >> >> >> >> >> >> _______________________________________________ >> >> >> >> >> >> 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 >> >> >> >> > >> >> >> >> > _______________________________________________ >> >> >> >> > 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 >> >> >> > >> >> >> _______________________________________________ >> >> >> 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 >> > >> > _______________________________________________ >> > 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 drabner at zoobe.com Tue Jan 22 11:30:14 2013 From: drabner at zoobe.com (Jan drabner) Date: Tue, 22 Jan 2013 11:30:14 +0100 Subject: [Libav-user] avformat_write_header produces invalid header (resulting MPG broken) Message-ID: Hey, I am rendering a video file from input pictures that come from a 3D engine at runtime (I don't pass an actual picture file, just RGB memory). This works perfectly when outputting MP4 using CODEC_ID_H264 as video codec. But when I want to create an MPG file using CODEC_ID_MPEG2VIDEO, the resulting file is simply broken. It is unplayable by any player* and when I then want to transform that MPG to MP4 in another step (I need to do that to concatenate it with some other video, which only works with MPG afaik), the resulting .mp4 file has both videos, but many frames from the original MPG video (and only video!) are simply skipped. *Well, VLC manages to play it starting at some random second, playing only sound and some weird pictures... At first I thought the MPG -> MP4 conversion was the problem, but then I noticed that the initial MPG, which comes from the video render engine, is already broken, which would speak for broken headers. Not sure if it is the system or sequence headers that are broken, though. Or if it could be something totally different. If you want to have a look, here is the file: http://www.file-upload.net/download-7093306/broken.mpg.html Again, the exact same muxing code works perfectly fine when directly creating an MP4 from the video render engine, so I'm pretty sure the input data, swscale(), etc. is correct. The only difference is that CODEC_ID_H264 is used and some additional variables (like qmin, qmax, etc.) are set, which are all specific to H264 so should not have an impact. Also, neither avformat_write_header nor av_write_trailer report an error. As an additional info, when viewing the codec data of the MPG in VLC player, it is not able to show the FPS, resolution and format (should show 640x360, 30 fps and 4:2:0 YUV). I am using a very new (some weeks, maybe) FFmpeg version, which I compiled from sources with MinGW. -- Jan Drabner ? TD Programming Engine & Animation zoobe message entertainment gmbh kurf?rstendamm 226 l 10719 berlin email: drabner at zoobe.com l mob: 0172 7017640 gesch?ftsf?hrer: lenard f. krawinkel tel: +49 30. 288 838 88 l site: *www.zoobe.com* ? email: *info at zoobe.com* amtsgericht charlottenburg, berlin ? hrb-nr. 11 42 79 b -------------- next part -------------- An HTML attachment was scrubbed... URL: From wbsecg1 at gmail.com Tue Jan 22 12:10:29 2013 From: wbsecg1 at gmail.com (Wang Bin) Date: Tue, 22 Jan 2013 19:10:29 +0800 Subject: [Libav-user] the beginning decoded pictures are almost gray Message-ID: I play some videos using my player, the beginning of few frames are almost gray. ffmpeg prints some messages: Error number 3062 occurred Error number 635 occurred [mpeg4 @ 0238bb60] warning: first frame is no keyframe the first picture type is AV_PICTURE_TYPE_NONE, then followed by lot of P and B. The picture keeps gray until I frame comes. I tried other players such as mplayer to play those videos, no problem. So there must be some problems in my code, but i have no idea. What seems to be the problem? Here is my player: https://sourceforge.net/projects/qtav -------------- next part -------------- An HTML attachment was scrubbed... URL: From srinath3142 at gmail.com Wed Jan 23 10:42:28 2013 From: srinath3142 at gmail.com (Srinath M) Date: Wed, 23 Jan 2013 15:12:28 +0530 Subject: [Libav-user] undefined reference errors from linker In-Reply-To: <20130121125128.GW9458@arborea> References: <20130121125128.GW9458@arborea> Message-ID: I am using ffmpeg version 1.1.1 now. The examples in /doc/examples all compile without any issue. The program i am compiling is here http://libccv.org/post/ccv-now-has-a-state-of-art-tracking-algorithm/ I plan to install it on a gumstix with Angstrom linux and opkg doesn't support ffmpeg. So i build from scratch. Compilation to object file stage proceeds without any issue( which implies it found the ffmpeg headers). It is the linker that gives me errors always. These are the errors with version 1.1.1 of ffmpeg clang -o tld tld.o -L"../lib" -lccv -lavformat -lavcodec -lswscale -lz -lm /usr/local/lib/libavformat.a(concat.o): In function `concat_close': /home/srinath/Downloads/ffmpeg-1.1.1/libavformat/concat.c:52: undefined reference to `av_freep' And many many more similar errors. I don't have the luxury of using pkg-config, on a gumstix and have built from scratch. Do these sorts of errors ring a bell as to where i should look? On Mon, Jan 21, 2013 at 6:21 PM, Stefano Sabatini wrote: > In data Monday 2013-01-21 15:29:07 +0530, Srinath M ha scritto: > > Hi > > > > I am using ffmpeg version 0.11.1 with Ubuntu 10.04 > > I get the following linker errors when i try to compile a program > > tld.c:(.text+0x1a7): undefined reference to `avformat_network_init' > > tld.c:(.text+0x1c9): undefined reference to `avformat_open_input' > > tld.c:(.text+0x1dc): undefined reference to `avformat_find_stream_info' > > tld.c:(.text+0x255): undefined reference to `avcodec_open2' > > tld.c:(.text+0x333): undefined reference to `avcodec_decode_video2' > > tld.c:(.text+0x525): undefined reference to `avcodec_decode_video2' > > > > Which version of ffmpeg should i be using? > > is this a ffmpeg issue in the first place? > > Check doc/examples/Makefile, you should rely on pkg-config unless you > really know what you're doing. A basic knowledge of linking/Makefile > may also help. > _______________________________________________ > 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 Wed Jan 23 10:52:00 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Wed, 23 Jan 2013 09:52:00 +0000 (UTC) Subject: [Libav-user] undefined reference errors from linker References: <20130121125128.GW9458@arborea> Message-ID: Srinath M writes: > clang -o tld tld.o -L"../lib" -lccv -lavformat -lavcodec -lswscale -lz -lm > > /usr/local/lib/libavformat.a(concat.o): In function `concat_close': > /home/srinath/Downloads/ffmpeg-1.1.1/libavformat/concat.c:52: > undefined reference to `av_freep' Whenever you link with one of FFmpeg's libraries, you have to add avutil which is a prerequisite for all other libraries. Generally, it may be a good idea to run "grep" in such a case (or even nm), it may tell you were the missing symbol is defined. Please do not top-post here, it is considered rude. Carl Eugen From srinath3142 at gmail.com Wed Jan 23 11:49:07 2013 From: srinath3142 at gmail.com (Srinath M) Date: Wed, 23 Jan 2013 16:19:07 +0530 Subject: [Libav-user] undefined reference errors from linker In-Reply-To: References: <20130121125128.GW9458@arborea> Message-ID: On Wed, Jan 23, 2013 at 3:22 PM, Carl Eugen Hoyos wrote: > Srinath M writes: > > > clang -o tld tld.o -L"../lib" -lccv -lavformat -lavcodec -lswscale -lz > -lm > > > > /usr/local/lib/libavformat.a(concat.o): In function `concat_close': > > /home/srinath/Downloads/ffmpeg-1.1.1/libavformat/concat.c:52: > > undefined reference to `av_freep' > > Whenever you link with one of FFmpeg's libraries, you > have to add avutil which is a prerequisite for all > other libraries. > > Generally, it may be a good idea to run "grep" in such > a case (or even nm), it may tell you were the missing > symbol is defined. > > Please do not top-post here, it is considered rude. > > Carl Eugen > Thanks Carl, that reduced the linker errors from more than a 100 to about 10. This is a sample of the 10 or so that remain clang -o tld tld.o -L"../lib" -lccv -lavformat -lavcodec -lswscale -lavutil -lz -lm /usr/local/lib/libavformat.a(matroskadec.o): In function `matroska_decode_buffer': /home/srinath/Downloads/ffmpeg-1.1.1/libavformat/matroskadec.c:1138: undefined reference to `BZ2_bzDecompressInit' /usr/local/lib/libavformat.a(udp.o): In function `udp_close': /home/srinath/Downloads/ffmpeg-1.1.1/libavformat/udp.c:824: undefined reference to `pthread_cancel' And 8 more similar errors. nm libavformat.a | grep 'matroska_decode_buffer' 000005e0 t matroska_decode_buffer nm libavformat.a | grep 'BZ2_bzDecompressInit' U BZ2_bzDecompressInit Infact when i run nm with the -U option it lists a large number of undefined symbols. How could i make ffmpeg and compile the /doc/examples succesfully and still have so many undefined symbols? Are these dependency packages that would normally be installed by Ubuntu or other Linux flavors? I don't think so because some of the undefined symbols are things such as xwma.o: U __divdi3 U __udivdi3 U av_add_index_entry U av_free U av_get_packet U av_log U av_log_ask_for_sample U av_malloc > > _______________________________________________ > 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 mike at mikeversteeg.com Wed Jan 23 11:52:09 2013 From: mike at mikeversteeg.com (Mike Versteeg) Date: Wed, 23 Jan 2013 11:52:09 +0100 Subject: [Libav-user] recording with uncompressed audio speeds up video In-Reply-To: References: Message-ID: No one has a clue? Mike Versteeg mikeversteeg.com On Fri, Jan 18, 2013 at 1:55 PM, Mike Versteeg wrote: > I have been using a recorder (based on muxer example) satisfactorily > for quite some time for various formats. Now I need to use > uncompressed audio to go with MJPEG video and I notice video speeds up > considerable (like 10 times as fast) in the recorded file. Audio is > OK, and if I use a compressed audio format (like mp3) video is fine as > always. Does anyone have an idea why video speeds up the moment I use > uncompresseed audio (CODEC_ID_PCM_S16LE)? > > Mike Versteeg > mikeversteeg.com From cehoyos at ag.or.at Wed Jan 23 12:26:43 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Wed, 23 Jan 2013 11:26:43 +0000 (UTC) Subject: [Libav-user] undefined reference errors from linker References: <20130121125128.GW9458@arborea> Message-ID: Srinath M writes: > /usr/local/lib/libavformat.a(matroskadec.o): In function > `matroska_decode_buffer': > /home/srinath/Downloads/ffmpeg-1.1.1/libavformat/matroskadec.c:1138: > undefined reference to `BZ2_bzDecompressInit' The first letters of the missing symbol seem to indicate that you want to link against libbz2. Carl Eugen From alexcohn at netvision.net.il Wed Jan 23 12:37:06 2013 From: alexcohn at netvision.net.il (Alex Cohn) Date: Wed, 23 Jan 2013 13:37:06 +0200 Subject: [Libav-user] recording with uncompressed audio speeds up video In-Reply-To: References: Message-ID: On Fri, Jan 18, 2013 at 2:55 PM, Mike Versteeg wrote: > I have been using a recorder (based on muxer example) satisfactorily > for quite some time for various formats. Now I need to use > uncompressed audio to go with MJPEG video and I notice video speeds up > considerable (like 10 times as fast) in the recorded file. Audio is > OK, and if I use a compressed audio format (like mp3) video is fine as > always. Does anyone have an idea why video speeds up the moment I use > uncompresseed audio (CODEC_ID_PCM_S16LE)? > > Mike Versteeg > mikeversteeg.com I was waiting for a more educated guess, but if it is not coming, here is my 2?: When you switch to PCM (raw) audio, there is no container left to keep track of timestamps, therefore playback happens at the full speed of your CPU. The problem is that MJPEG itself is time agnostic. BR, Alex From srinath3142 at gmail.com Wed Jan 23 12:41:25 2013 From: srinath3142 at gmail.com (Srinath M) Date: Wed, 23 Jan 2013 17:11:25 +0530 Subject: [Libav-user] undefined reference errors from linker In-Reply-To: References: <20130121125128.GW9458@arborea> Message-ID: On Wed, Jan 23, 2013 at 4:56 PM, Carl Eugen Hoyos wrote: > Srinath M writes: > > > /usr/local/lib/libavformat.a(matroskadec.o): In function > > `matroska_decode_buffer': > > /home/srinath/Downloads/ffmpeg-1.1.1/libavformat/matroskadec.c:1138: > > undefined reference to `BZ2_bzDecompressInit' > > The first letters of the missing symbol seem to > indicate that you want to link against libbz2. > > Carl Eugen > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > Thanks, i added some more missing libraries and it compiles. This was my final list clang -o tld tld.o -L"../lib" -lccv -lavformat -lavcodec -lswscale -lavutil -lbz2 -lz -lpthread -lm -------------- next part -------------- An HTML attachment was scrubbed... URL: From mike at mikeversteeg.com Wed Jan 23 15:20:09 2013 From: mike at mikeversteeg.com (Mike Versteeg) Date: Wed, 23 Jan 2013 15:20:09 +0100 Subject: [Libav-user] recording with uncompressed audio speeds up video In-Reply-To: References: Message-ID: Thanks Alex! When I examine an MJPEG video file that plays correctly in a popular NLE like Adobe Premiere, it uses the exact same combination of MJPEG and CODEC_ID_PCM_S16LE in an AVI container. Any idea how they did that? Mike From sender at ImageMining.net Wed Jan 23 19:23:40 2013 From: sender at ImageMining.net (Jim Morgenstern) Date: Wed, 23 Jan 2013 13:23:40 -0500 Subject: [Libav-user] RAW VIDEO complains packet wrong size Message-ID: <06a801cdf996$c532bde0$4f9839a0$@ImageMining.net> Trying to write video stream as uncompressed. Have tried both AVI and MOV as the output file type; same error in both. Have set the output codec >> >> > m_pOutputFormat = av_guess_format(NULL, filename, NULL); >> >> > m_pFormatContext = avformat_alloc_context(); >> >> > m_pFormatContext->oformat = m_pOutputFormat; >> >>> m_pFormatContext->oformat->video_codec = CODEC_ID_RAWVIDEO. Data is YUV422 1280 X 720. Error message comes from writing output: [rawvideo @ 01179900] Provided packet is too small, needs to be 1382400 [printed in RED] * what else do I need to set to get rawvideo to work ? * who is setting the expected packet size? * Which structure, which field ? * thanks Jim Morgenstern Image Mining LLC 248-252-2626 From sakonst at gmail.com Wed Jan 23 20:16:17 2013 From: sakonst at gmail.com (SAkonst) Date: Wed, 23 Jan 2013 23:16:17 +0400 Subject: [Libav-user] Add frame rate after muxing Message-ID: <9210019060.20130123231617@gmail.com> Hello! Please, Help. I try to write video from camera to mkv container with libavformat. Use lagarith codec (FourCC "lags") In my case I receive an image from camera, but a frame rate is not known before recording. I can calculate it just after I stop recording. How can I add frame rate into header after muxing? Is it possible at all? -- Best regards, SAkonst mailto:SAkonst at gmail.com From jmorgie at yahoo.com Wed Jan 23 22:16:28 2013 From: jmorgie at yahoo.com (jim morgenstern) Date: Wed, 23 Jan 2013 16:16:28 -0500 Subject: [Libav-user] searching for module documentation Message-ID: <06f201cdf9ae$e8f5a1d0$bae0e570$@yahoo.com> How do I get from http://ffmpeg.org/doxygen/trunk/modules.html to search for specific module documentation ? I thought I remembered that I used to be able to search. [running chrome - I don't see a search box anywhere.] thanks Jim Morgenstern Image Mining LLC 248-252-2626 -------------- next part -------------- An HTML attachment was scrubbed... URL: From brado at bighillsoftware.com Wed Jan 23 23:04:14 2013 From: brado at bighillsoftware.com (Bradley O'Hearne) Date: Wed, 23 Jan 2013 15:04:14 -0700 Subject: [Libav-user] Transcoding + streaming to server Message-ID: Hello, I have a use case that is conceptually pretty simple: I need to programmatically (i.e. in code using the ffmpeg libraries) capture video from a webcam, and stream it to a server. The devil's always in the details, here are mine: 1. I am capturing video from a webcam on Mac OS X using QTKit (already works, no problem there). 2. I need to feed the frames captured in 1 to ffmpeg, and transcode the video to flv format. 3. I need to push the flv video frames via RTMP to Wowza streaming server. Now, I have proofed very near to this concept by successfully using the ffmpeg binary to transcode and stream to Wowza using the following command from the console: ffmpeg -i ~/SampleVideo.mp4 -re -r 24 -b:v 1000k -f flv rtmp://localhost/live/SAMPLE_STREAM This works, and I can successfully consume this published video to Wowza in a video player, so that would seem to be a solid indication that ffmpeg can do what is being attempted. The guidance I need from all of you ffmpeg gurus on the list, is some guidance for how to convert the command line above to code, i.e. what libraries to use (and how to use them programmatically) to accomplish the same transcoding and streaming. If anyone can lend some guidance, sample code, and/or maybe a good coffee to drink while figuring this out, I would be very appreciative. Thanks in advance, Brad Brad O'Hearne Founder/Lead Developer Big Hill Software LLC http://www.bighillsoftware.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From alan.3976 at gmail.com Thu Jan 24 05:58:55 2013 From: alan.3976 at gmail.com (Alan) Date: Wed, 23 Jan 2013 20:58:55 -0800 (PST) Subject: [Libav-user] Mixes multiple audio inputs into a single output. Message-ID: <9998115.Na7I83ZOtt@linux-m1n0.site> Dear all, I'd like to mix two audio into a single output. But I always got this error #ffmpeg -i 1.wav -i 2.wav -filter_complex amix=inputs=2:duration=first:dropout_transition=2 out.wav ffmpeg version 0.11.2 Copyright (c) 2000-2012 the FFmpeg developers built on Nov 5 2012 10:44:13 with gcc 4.7.1 20120723 [gcc-4_7-branch revision 189773] configuration: --disable-yasm WARNING: library configuration mismatch avutil configuration: --prefix=/usr --disable-yasm --enable-shared avcodec configuration: --prefix=/usr --disable-yasm --enable-shared avformat configuration: --prefix=/usr --disable-yasm --enable-shared avdevice configuration: --prefix=/usr --disable-yasm --enable-shared avfilter configuration: --prefix=/usr --disable-yasm --enable-shared swscale configuration: --prefix=/usr --disable-yasm --enable-shared swresample configuration: --prefix=/usr --disable-yasm --enable-shared libavutil 51. 54.100 / 51. 54.100 libavcodec 54. 23.100 / 54. 23.100 libavformat 54. 6.100 / 54. 6.100 libavdevice 54. 0.100 / 54. 0.100 libavfilter 2. 77.100 / 2. 77.100 libswscale 2. 1.100 / 2. 1.100 libswresample 0. 15.100 / 0. 15.100 Guessed Channel Layout for Input Stream #0.0 : stereo Input #0, wav, from '1.wav': Duration: 00:00:03.76, bitrate: 1411 kb/s Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, stereo, s16, 1411 kb/s Guessed Channel Layout for Input Stream #1.0 : stereo Input #1, wav, from '2.wav': Duration: 00:00:03.76, bitrate: 1411 kb/s Stream #1:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, stereo, s16, 1411 kb/s [abuffersink @ 0x10dd900] No opaque field provided, an AVABufferSinkParams struct is required Error configuring filter. If this is not the right place to post this question, please correct me. Thanks BRs Alan From alexcohn at netvision.net.il Thu Jan 24 09:16:51 2013 From: alexcohn at netvision.net.il (Alex Cohn) Date: Thu, 24 Jan 2013 10:16:51 +0200 Subject: [Libav-user] recording with uncompressed audio speeds up video In-Reply-To: References: Message-ID: On Wed, Jan 23, 2013 at 4:20 PM, Mike Versteeg wrote: > Thanks Alex! When I examine an MJPEG video file that plays correctly > in a popular NLE like Adobe Premiere, it uses the exact same > combination of MJPEG and CODEC_ID_PCM_S16LE in an AVI container. Any > idea how they did that? The timestamps are stored in the AVI container. From kalileo at universalx.net Thu Jan 24 10:35:58 2013 From: kalileo at universalx.net (Kalileo) Date: Thu, 24 Jan 2013 16:35:58 +0700 Subject: [Libav-user] avformat_open_input using custom AVDictionary to set video_size Message-ID: I'm producing MPEGTS streams (h264/aac) using ffmpeg, so I know exactly how they are coded, and I could modify that if needed. Now, when I receive them in my own code, I always have to run them through avformat_open_input and avformat_find_stream_info to get the settings into the codec context. Because udp mpegts streams have no header, both avformat_open_input and avformat_find_stream_info sometimes have problems to get all settings correctly. However, all settings are known, and so I try to inform avformat_open_input and avformat_find_stream_info about them, using a AVDictionary. However, despite setting the video_size to 720x576, I often get "unspecified size". Other AVDictionary options such as "probesize" are honored though. Ideally I want to skip the avformat_find_stream_info step completely and preset all settings. But how to do that correctly? Also sometimes avformat_open_input does not get it correctly that there is a video and an audio stream. I'm reading the stream though a memory buffer, and not directly from a file or url. This is what I tried: ====== av_dict_set(&format_opts, "video_size", "720x576", 0); <<== seems to be ignored // av_dict_set(&format_opts, "pixel_format", av_get_pix_fmt_name(ffmpeg::PIX_FMT_YUV420P), 0); av_dict_set(&format_opts, "pixel_format", "yuv420p", 0); av_dict_set(&format_opts, "sample_format", "fltp", 0); av_dict_set(&format_opts, "analyzeduration", "8000000", 0); <<== honored av_dict_set(&format_opts, "probesize", "8000000", 0); <<== honored av_dict_set(&format_opts, "channels", "2", 0); av_dict_set(&format_opts, "sample_rate", "48000", 0); av_dict_set(&format_opts, "seekable", "0", 0); ... err = avformat_open_input(&pFormatCtx, "", inputFmt, &format_opts); => sometimes sees one stream only av_dict_set(&format_opts, "video_size", "720x576", 0); <<== seems to be ignored ... err = avformat_find_stream_info(pFormatCtx, &format_opts); av_dump_format(pFormatCtx, 0, "Memory Buffer", false); => often says "unspecified size" ====== I'm using the very latest ffmpeg 1.0.3 from 2 days ago. My Questions are: How do I pass the video size to avformat_open_input and avformat_find_stream_info so that it is taken? Which settings do i have to set to set (and how) to avoid the need for avformat_find_stream_info? How do i tell avformat_open_input that there is a video stream and an audio stream, or help it to find them (possible a change in the encoding parameters)? Thanks for any hints or help! Regards, Kalileo From cehoyos at ag.or.at Thu Jan 24 10:36:11 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Thu, 24 Jan 2013 09:36:11 +0000 (UTC) Subject: [Libav-user] Mixes multiple audio inputs into a single output. References: <9998115.Na7I83ZOtt@linux-m1n0.site> Message-ID: Alan writes: > But I always got this error > > #ffmpeg -i 1.wav -i 2.wav -filter_complex > amix=inputs=2:duration=first:dropout_transition=2 out.wav > > ffmpeg version 0.11.2 Please test current git head, filter_complex is a fairly new option that has seen some improvements since. > configuration: --disable-yasm This is a very bad configuration option, don't use it. (Install yasm if necessary, it is a small static binary.) > WARNING: library configuration mismatch And please try to avoid this one, if you believe you need shared libraries, use only one run (with --enable-shared), alternatively compile without --enable-shared to not break your existing installation. Carl Eugen From alan.3976 at gmail.com Thu Jan 24 11:46:50 2013 From: alan.3976 at gmail.com (Alan) Date: Thu, 24 Jan 2013 18:46:50 +0800 Subject: [Libav-user] Mixes multiple audio inputs into a single output. In-Reply-To: References: <9998115.Na7I83ZOtt@linux-m1n0.site> Message-ID: <1556840.reyuURuaF5@linux-m1n0.site> On Thursday 24 January 2013 09:36:11 Carl Eugen Hoyos wrote: > Please test current git head, filter_complex is a fairly > new option that has seen some improvements since. Thanks for your suggestion Carl. From mike at mikeversteeg.com Thu Jan 24 11:55:58 2013 From: mike at mikeversteeg.com (Mike Versteeg) Date: Thu, 24 Jan 2013 11:55:58 +0100 Subject: [Libav-user] recording with uncompressed audio speeds up video In-Reply-To: References: Message-ID: I see... Then I do not understand why this is not being done by the muxer automatically, but I'll try to do it manually. Any guidance is appreciated. Thanks, Mike From pavel at sokolov.me Thu Jan 24 12:22:12 2013 From: pavel at sokolov.me (Pavel Sokolov) Date: Thu, 24 Jan 2013 15:22:12 +0400 Subject: [Libav-user] MPEG-TS DVB-CSA descrambler Message-ID: <51011964.7060701@sokolov.me> Hi! Somebody knows any way to demux scrambled MPEG-TS with FFdecsa descrambler (or other DVB-CSA descrabler) ? So, i think that I need to add read callback to MPEG-TS demuxer: my_descrambler(uint8_t* buf, int buf_size); where buf - is 188-aligned buffer How to add this callback without patching sources of the FFmpeg? From rjvbertin at gmail.com Thu Jan 24 19:04:33 2013 From: rjvbertin at gmail.com (=?iso-8859-1?Q?=22Ren=E9_J=2EV=2E_Bertin=22?=) Date: Thu, 24 Jan 2013 19:04:33 +0100 Subject: [Libav-user] porting FFusion codec to current FFmpeg libs - ParseContext1 ?? Message-ID: <7B07B13C-F379-4BE8-9F6D-F541576BBDD5@gmail.com> Hello List, I'm hacking my way around the version of the FFusion codec component that is included in Perian, the catch-all importer/exporter plugin collection for QuickTime. FFusion is the part that relies on FFmpeg for demuxing and decoding ? I'm interested only in the codec functionality, not in adding support for various container formats. Once this works on Mac OS X, the goal is to get it to build on Win32, in the hope of improving Win32 QuickTime's playback performance for mpg4, h264, etc. I'm currently at the point where I've stripped out all unneeded functionality from my FFusion component, and I'm trying to get it to build with the current FFmpeg version (for which I can get the Win32 DLLs easily). Perian, and thus my FFusion pet project, use an older FFmpeg version, major 52 ... with quite a few patches from what I've seen ... and it hooks into "internal" functionality, notably in order to do additional parsing of, for instance, AVContext->extradata . I've no idea why this is needed, but if I strip this out altogether, I'm getting white or black content in my player. Here's an example: static int parse_mpeg4_extra(FFusionParserContext *parser, const uint8_t *buf, int buf_size) { ParseContext1 *pc1 = (ParseContext1 *)parser->pc->priv_data; pc1->pc.frame_start_found = 0; MpegEncContext *s = pc1->enc; GetBitContext gb1, *gb = &gb1; s->avctx = parser->avctx; s->current_picture_ptr = &s->current_picture; init_get_bits(gb, buf, 8 * buf_size); ff_mpeg4_decode_picture_header(s, gb); return 1; } /* * Long story short, FFMpeg's parsers suck for our use. This function parses an mpeg4 bitstream, * and assumes that it is given at least a full frame of data. * @param parser A FFusionParserContext structure containg all our info * @param buf The buffer to parse * @param buf_size Size of the input buffer * @param out_buf_size The number of bytes present in the first frame of data * @param type The frame Type: FF_*_TYPE * @param pts The PTS of the frame * @return 1 if a frame is found, 0 otherwise */ static int parse_mpeg4_stream(FFusionParserContext *parser, const uint8_t *buf, int buf_size, int *out_buf_size, int *type, int *skippable, int *skipped) { ParseContext1 *pc1 = (ParseContext1 *)parser->pc->priv_data; pc1->pc.frame_start_found = 0; int endOfFrame = ff_mpeg4_find_frame_end(&(pc1->pc), buf, buf_size); MpegEncContext *s = pc1->enc; GetBitContext gb1, *gb = &gb1; s->avctx = parser->avctx; s->current_picture_ptr = &s->current_picture; init_get_bits(gb, buf, 8 * buf_size); int parse_res = ff_mpeg4_decode_picture_header(s, gb); if(parse_res == FRAME_SKIPPED) { *out_buf_size = buf_size; *type = FF_P_TYPE; *skippable = 1; *skipped = 1; } if(parse_res != 0) return 0; *type = s->pict_type; *skippable = (*type == FF_B_TYPE); *skipped = 0; #if 0 /*this was an attempt to figure out the PTS information and detect an out of order P frame before we hit its B frame */ int64_t *lastPtsPtr = (int64_t *)parser->internalContext; int64_t lastPts = *lastPtsPtr; int64_t currentPts = s->current_picture.pts; switch(s->pict_type) { case FF_I_TYPE: *lastPtsPtr = currentPts; *precedesAPastFrame = 0; break; case FF_P_TYPE: if(currentPts > lastPts + 1) *precedesAPastFrame = 1; else *precedesAPastFrame = 0; *lastPtsPtr = currentPts; break; case FF_B_TYPE: *precedesAPastFrame = 0; break; default: break; } #endif if(endOfFrame == END_NOT_FOUND) *out_buf_size = buf_size; else *out_buf_size = endOfFrame; return 1; } (parser->pc is a struct AVCodecParserContext). I'm a bit stuck on how to port this code/functionality. I'm guessing there must be a more official way, using published APIs, but for now I have no idea where to start looking. Of course, if someone can help me to a set of Win32 DLLs for libavcodec, libavutil and libavcore of a compatible version (or give me some pointers on how to build them off the Perian code using a mingw23 crossCC) that would suit me too ... O:-) TIA, Ren? From ratin3 at gmail.com Thu Jan 24 21:39:19 2013 From: ratin3 at gmail.com (Ratin) Date: Thu, 24 Jan 2013 12:39:19 -0800 Subject: [Libav-user] avcodec_decode_video2 error handling Message-ID: Hi, I have been using my HW accelerated decoder that I build up with VAAPI / Intel driver in co-ordication with stock lgpl ffmpeg (ffmpeg passes the the bitstream to VLD), as I am decoding frames from a camera which puts out videos of sizes 2536 x 1600, I occassionally get this errors: [h264 @ 0x7fffe80dd6c0] QP 117 out of range [h264 @ 0x7fffe80dd6c0] decode_slice_header error I think it happens because of corrupt RTP video packets. But regardless, I am not getting an error code from FFMpeg's avcodec_decode_video2. Also once this happens, it never recovers. But restarting the whole chain fixes it again. I would like to know if there is a way to set error_recognition ( like in AVFormatContext ) for codec context when I am creating the codec context myself based on information i gather from the camera. Perhaps that will force an error to be send to upper level. Thanks Ratin -------------- next part -------------- An HTML attachment was scrubbed... URL: From pavel at sokolov.me Thu Jan 24 22:23:29 2013 From: pavel at sokolov.me (Pavel Sokolov) Date: Fri, 25 Jan 2013 01:23:29 +0400 Subject: [Libav-user] AVI mpeg4 DivX 5.0 and DivX 3 bitstreams passing to hardware decoder Message-ID: <5101A651.4050604@sokolov.me> Hi! I have very specific MIPS device, which has hardware player. I'm using FFmpeg to demux streams to AVPacket. It can play any MPEG2, MPEG4, H263 and H264 data, but it need to remux all data to MPEG2 PES before I feed data to h/w decoder. I'm applying h264_mp4toannexb bitstream filters to H264 from the avi/mkv container and it play it fine. But now I have some trouble: It does not want to play AVI with mpeg4 DivX 3 and DivX 5 streams. May be such streams also need to do some bitstream modifications before pushing packets to h/w decoder? From cehoyos at ag.or.at Thu Jan 24 22:30:08 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Thu, 24 Jan 2013 21:30:08 +0000 (UTC) Subject: [Libav-user] AVI mpeg4 DivX 5.0 and DivX 3 bitstreams passing to hardware decoder References: <5101A651.4050604@sokolov.me> Message-ID: Pavel Sokolov writes: > I'm applying h264_mp4toannexb bitstream filters to > H264 from the avi/mkv container and it play it fine. > > But now I have some trouble: It does not want to > play AVI with mpeg4 DivX 3 and DivX 5 streams. Try dump_extra. Carl Eugen From davmac at davmac.org Fri Jan 25 01:40:52 2013 From: davmac at davmac.org (Davin McCall) Date: Fri, 25 Jan 2013 00:40:52 +0000 Subject: [Libav-user] Can't get simple demux -> copy -> remux to work properly Message-ID: <5101D494.5070707@davmac.org> Hi, I'm trying to get a simple demux / stream copy / remux program to work. The full source (reasonably small) is at: http://davmac.org/avtest.cc I compile it using: g++ -Wall -o avtest src/avtest.cc -lavformat -lavcodec -lavutil -lpthread -lz -lbz2 I hope the strategy is pretty clear. It opens the input file (as specified on the command line) and writes to "test-out.avi". It just copies the streams, no decoding or encoding is performed. It does produce a playable output, but something is wrong. For this small example input file: http://davmac.org/lucinda-part.avi I can run ffprobe on the output: ffprobe -show_streams -count_frames -count_packets test-out.avi ... and get this output for the audio stream: duration_ts=N/A duration=N/A bit_rate=119232 nb_frames=50 nb_read_frames=248 nb_read_packets=248 There are two issues: duration isn't specified, and nb_frames doesn't match the actual number of frames in the file. If I copy the same input file to another avi container using ffmpeg, I do not see this issue. It only happens with my own program. Can anyone see what's wrong with the program? Thanks Davin. From gf at unixsol.org Fri Jan 25 09:43:20 2013 From: gf at unixsol.org (Georgi Chorbadzhiyski) Date: Fri, 25 Jan 2013 10:43:20 +0200 Subject: [Libav-user] MPEG-TS DVB-CSA descrambler In-Reply-To: <51011964.7060701@sokolov.me> References: <51011964.7060701@sokolov.me> Message-ID: <510245A8.5030300@unixsol.org> On 1/24/13 1:22 PM, Pavel Sokolov wrote: > Somebody knows any way to demux scrambled MPEG-TS with FFdecsa > descrambler (or other DVB-CSA descrabler) ? > > So, i think that I need to add read callback to MPEG-TS demuxer: > > my_descrambler(uint8_t* buf, int buf_size); > > where buf - is 188-aligned buffer > > How to add this callback without patching sources of the FFmpeg? Use a proper tool that is designed for the purpose of decrypting transport streams - tsdecrypt. -- Georgi Chorbadzhiyski http://georgi.unixsol.org/ From pavel at sokolov.me Fri Jan 25 09:50:04 2013 From: pavel at sokolov.me (Pavel Sokolov) Date: Fri, 25 Jan 2013 12:50:04 +0400 Subject: [Libav-user] MPEG-TS DVB-CSA descrambler In-Reply-To: <510245A8.5030300@unixsol.org> References: <51011964.7060701@sokolov.me> <510245A8.5030300@unixsol.org> Message-ID: <5102473C.1050904@sokolov.me> 25.01.2013 12:43, Georgi Chorbadzhiyski ?????: > On 1/24/13 1:22 PM, Pavel Sokolov wrote: >> Somebody knows any way to demux scrambled MPEG-TS with FFdecsa >> descrambler (or other DVB-CSA descrabler) ? >> >> So, i think that I need to add read callback to MPEG-TS demuxer: >> >> my_descrambler(uint8_t* buf, int buf_size); >> >> where buf - is 188-aligned buffer >> >> How to add this callback without patching sources of the FFmpeg? > > Use a proper tool that is designed for the purpose of decrypting > transport streams - tsdecrypt. > > I can't use any external tool. I need to do it "on the fly" while reading packets from AVFormat From cehoyos at ag.or.at Fri Jan 25 16:19:57 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Fri, 25 Jan 2013 15:19:57 +0000 (UTC) Subject: [Libav-user] MPEG-TS DVB-CSA descrambler References: <51011964.7060701@sokolov.me> <510245A8.5030300@unixsol.org> <5102473C.1050904@sokolov.me> Message-ID: Pavel Sokolov writes: > I can't use any external tool. I need to do it "on the fly" > while reading packets from AVFormat Note that I suspect that a patch that adds a wrapper for FFdecsa would be very welcome! Carl Eugen From cehoyos at ag.or.at Fri Jan 25 16:22:47 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Fri, 25 Jan 2013 15:22:47 +0000 (UTC) Subject: [Libav-user] porting FFusion codec to current FFmpeg libs - ParseContext1 ?? References: <7B07B13C-F379-4BE8-9F6D-F541576BBDD5@gmail.com> Message-ID: Ren? J.V. Bertin writes: > Perian, and thus my FFusion pet project, use > an older FFmpeg version, major 52 Please understand that every effort you put into lavc 52 is useless afacit, it is missing both many features and many bug fixes compared to current lavc and you will only get very, very limited support. (In case that is not obvious: The only reason for this is limited man-power, if you volunteer to maintain lavc 52, please send a mail to ffmpeg-devel) Carl Eugen From rjvbertin at gmail.com Fri Jan 25 16:29:44 2013 From: rjvbertin at gmail.com (=?iso-8859-1?Q?=22Ren=E9_J=2EV=2E_Bertin=22?=) Date: Fri, 25 Jan 2013 16:29:44 +0100 Subject: [Libav-user] porting FFusion codec to current FFmpeg libs - ParseContext1 ?? In-Reply-To: References: <7B07B13C-F379-4BE8-9F6D-F541576BBDD5@gmail.com> Message-ID: On Jan 25, 2013, at 16:22, Carl Eugen Hoyos wrote: > Ren? J.V. Bertin writes: > >> Perian, and thus my FFusion pet project, use >> an older FFmpeg version, major 52 > > Please understand that every effort you put into > lavc 52 is useless afacit, it is missing both > many features and many bug fixes compared to > current lavc and you will only get very, very > limited support. I am trying to get rid of lavc 52 for exactly that reason, and hoping to get some feedback on how to proceed. Mainstream calls were clearly not much of an issue (the only thing I'm not sure about is how to replace avcodec_thread_init), but code using non-documented/published parts of the parser API is a different thing, especially since there is basically no explanation of what's being done. Was my request that unclear??? Ren? From rjvbertin at gmail.com Fri Jan 25 16:41:50 2013 From: rjvbertin at gmail.com (=?iso-8859-1?Q?=22Ren=E9_J=2EV=2E_Bertin=22?=) Date: Fri, 25 Jan 2013 16:41:50 +0100 Subject: [Libav-user] porting FFusion codec to current FFmpeg libs - ParseContext1 ?? In-Reply-To: References: <7B07B13C-F379-4BE8-9F6D-F541576BBDD5@gmail.com> Message-ID: <5663ECA3-E83C-42BF-BA86-DCBE95DC10B1@gmail.com> On Jan 25, 2013, at 16:22, Carl Eugen Hoyos wrote: > lavc 52 is useless afacit, it is missing both > many features and many bug fixes compared to > current lavc and you will only get very, very In fact, is it possible that the hackish functions in the Perian codebase (bitstream_info.c for those who know the source) do things that are currently done by lavc? At least that's the impression I get looking at the function I copied in my OP, and the functions that access the context's extradata in the current mpeg4video_parser.c ... R From cehoyos at ag.or.at Fri Jan 25 17:53:49 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Fri, 25 Jan 2013 16:53:49 +0000 (UTC) Subject: [Libav-user] porting FFusion codec to current FFmpeg libs - ParseContext1 ?? References: <7B07B13C-F379-4BE8-9F6D-F541576BBDD5@gmail.com> Message-ID: Ren? J.V. Bertin writes: > Was my request that unclear??? I am not a native speaker... I suggest you study the git history to find out how function usage was replaced inside of FFmpeg / lavc to find out which changes are necessary. Carl Eugen From jmorgie at yahoo.com Sat Jan 26 07:42:03 2013 From: jmorgie at yahoo.com (jim morgenstern) Date: Sat, 26 Jan 2013 01:42:03 -0500 Subject: [Libav-user] av_interleaved_write_frame has divide by zero? Message-ID: <023001cdfb90$407d7a80$c1786f80$@yahoo.com> Can anyone offer an insight into which field / why / av_interleaved_write_frame is throwing an integer divide by zero? Possibly to do with PTS ?? Jim Morgenstern Image Mining LLC 248-252-2626 From cehoyos at ag.or.at Sat Jan 26 11:52:47 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Sat, 26 Jan 2013 10:52:47 +0000 (UTC) Subject: [Libav-user] =?utf-8?q?av=5Finterleaved=5Fwrite=5Fframe_has_divid?= =?utf-8?q?e_by_zero=3F?= References: <023001cdfb90$407d7a80$c1786f80$@yahoo.com> Message-ID: jim morgenstern writes: > Can anyone offer an insight into which field / why / > av_interleaved_write_frame is throwing an integer divide by zero? Command line, sample, console output and (even if not reproducible with ffmpeg) backtrace etc. missing. Carl Eugen From jmorgie at yahoo.com Sat Jan 26 16:56:36 2013 From: jmorgie at yahoo.com (jim morgenstern) Date: Sat, 26 Jan 2013 10:56:36 -0500 Subject: [Libav-user] av_interleaved_write_frame has divide by zero? In-Reply-To: References: <023001cdfb90$407d7a80$c1786f80$@yahoo.com> Message-ID: <000601cdfbdd$b8bf4760$2a3dd620$@yahoo.com> VS2012 C++ app using library versions from Nov ============================ Unhandled exception at 0x69b0f7ee in Viper1B_10.exe: 0xC0000094: Integer division by zero. ==================================================== Screen output: Starting MediaFileIO for U:\ImageMining\StreamApp\Data\Solavei Intro VideoV3_Mus ic up_1280x720p29.mov [mov,mp4,m4a,3gp,3g2,mj2 @ 00483b20] Stream #1: not enough frames to estimate ra te; consider increasing probesize [mov,mp4,m4a,3gp,3g2,mj2 @ 00483b20] Stream #2: not enough frames to estimate ra te; consider increasing probesize Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'U:\ImageMining\StreamApp\Data\Solavei I ntro VideoV3_Music up_1280x720p29.mov': Metadata: major_brand : qt minor_version : 537199360 compatible_brands: qt creation_time : 2012-07-12 23:41:43 Duration: 00:00:11.81, start: 0.000000, bitrate: 598161 kb/s Stream #0:0(eng): Video: v210 (v210 / 0x30313276), yuv422p10le, 1280x720, 59 6600 kb/s, SAR 1:1 DAR 16:9, 29.97 fps, 29.97 tbr, 30k tbn, 30k tbc Metadata: creation_time : 2012-07-12 23:41:43 handler_name : Apple Alias Data Handler Stream #0:1(eng): Audio: pcm_s16le (sowt / 0x74776F73), 48000 Hz, stereo, s1 6, 1536 kb/s Metadata: creation_time : 2012-07-12 23:41:43 handler_name : Apple Alias Data Handler Stream #0:2(eng): Data: none (tmcd / 0x64636D74) Metadata: creation_time : 2012-07-12 23:42:01 handler_name : Apple Alias Data Handler timecode : 00:00:28;11 Starting MediaFileIO for => U:\ImageMining\StreamApp\Data\TestSol10Unc.mov Output #0, mov, to 'U:\ImageMining\StreamApp\Data\TestSol10Unc.mov': Stream #0:0: Video: rawvideo, yuv422p, 1280x720, q=2-31, 5942 kb/s, 90k tbn, 29 tbc Stream #0:1: Audio: aac, 44100 Hz, 1 channels, s16, 64 kb/s [mov @ 0048d3a0] Tag Y42B/0x42323459 incompatible with output codec id '14' INIT Then first time this is called: if (oc->oformat->flags & AVFMT_RAWPICTURE) { /* raw video case. */ AVPacket pkt; av_init_packet(&pkt); pkt.flags |= AV_PKT_FLAG_KEY; pkt.stream_index= st->index; pkt.data= (uint8_t *)m_pPicture; pkt.size= sizeof(AVPicture); ret = av_interleaved_write_frame ( oc, &pkt); } And oc is here: - oc 0x0048d3a0 {av_class=0x69b44f20 iformat=0x00000000 oformat=0x69b23340 ...} AVFormatContext * + av_class 0x69b44f20 {class_name=0x69b44f05 "AVFormatContext" item_name=0x6998c350 option=0x69b45520 ...} const AVClass * + iformat 0x00000000 {name=??? long_name=??? flags=??? ...} AVInputFormat * + oformat 0x69b23340 {name=0x69b3eaa4 "mov" long_name=0x69b3f035 "MOV format" mime_type=0x00000000 ...} AVOutputFormat * priv_data 0x00000000 void * + pb 0x0038ed20 {av_class=0x69b31da0 buffer=0x003a4200 " ctx_flags 0 int nb_streams 2 unsigned int + streams 0x00399da0 AVStream * * + filename 0x0048d3c0 "U:\ImageMining\StreamApp\Data\TestSol10Unc.mov" char [1024] start_time 0 __int64 duration 0 __int64 bit_rate 0 int packet_size 0 unsigned int max_delay -1 int flags 0 int probesize 5000000 unsigned int max_analyze_duration 5000000 int + key 0x00000000 const unsigned char * keylen 0 int nb_programs 0 unsigned int + programs 0x00000000 AVProgram * * video_codec_id CODEC_ID_NONE CodecID audio_codec_id CODEC_ID_NONE CodecID subtitle_codec_id CODEC_ID_NONE CodecID max_index_size 1048576 unsigned int max_picture_buffer 3041280 unsigned int nb_chapters 0 unsigned int + chapters 0x00000000 AVChapter * * metadata 0x00000000 AVDictionary * metadata 0x00000000 AVDictionary * start_time_realtime 0 __int64 fps_probe_size -1 int error_recognition 1 int + interrupt_callback {callback=0x00000000 opaque=0x00000000 } AVIOInterruptCB debug 0 int ts_id 0 int audio_preload 0 int max_chunk_duration 0 int max_chunk_size 0 int + packet_buffer 0x00000000 {pkt={...} next=??? } AVPacketList * + packet_buffer_end 0x00000000 {pkt={...} next=??? } AVPacketList * data_offset 0 __int64 + raw_packet_buffer 0x00000000 {pkt={...} next=??? } AVPacketList * + raw_packet_buffer_end 0x00000000 {pkt={...} next=??? } AVPacketList * + parse_queue 0x00000000 {pkt={...} next=??? } AVPacketList * + parse_queue_end 0x00000000 {pkt={...} next=??? } AVPacketList * raw_packet_buffer_remaining_size 0 int avio_flags 0 int > -----Original Message----- > From: libav-user-bounces at ffmpeg.org [mailto:libav-user-bounces at ffmpeg.org] > On Behalf Of Carl Eugen Hoyos > Sent: Saturday, January 26, 2013 5:53 AM > To: libav-user at ffmpeg.org > Subject: Re: [Libav-user] av_interleaved_write_frame has divide by zero? > > jim morgenstern writes: > > > Can anyone offer an insight into which field / why / > > av_interleaved_write_frame is throwing an integer divide by zero? > > Command line, sample, console output and (even if not reproducible with ffmpeg) > backtrace etc. missing. > > Carl Eugen > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user From rjvbertin at gmail.com Mon Jan 28 11:46:34 2013 From: rjvbertin at gmail.com (=?iso-8859-1?Q?=22Ren=E9_J=2EV=2E_Bertin=22?=) Date: Mon, 28 Jan 2013 11:46:34 +0100 Subject: [Libav-user] porting FFusion codec to current FFmpeg libs - ParseContext1 ?? In-Reply-To: References: <7B07B13C-F379-4BE8-9F6D-F541576BBDD5@gmail.com> Message-ID: On Jan 25, 2013, at 17:53, Carl Eugen Hoyos wrote: > Ren? J.V. Bertin writes: > >> Was my request that unclear??? > > I am not a native speaker... > > I suggest you study the git history to find out how > function usage was replaced inside of FFmpeg / lavc > to find out which changes are necessary. > Thing is that I'm neither a "native" FFmpeg contributor nor a "native" video decoding specialist. I gave myself the challenge to do the porting I described thinking it couldn't be that hard to adapt the old FFusion code to the current lavc API, and then get it to build on win32 using prebuilt shared libraries downloaded from the repository. Without intimate knowledge of FFmpeg's internal 'cuisine' nor copious comments describing what the code is doing (or rather, why) it's neigh impossible to follow your suggestion without making it a full time job. As to building lavc52 for win32 - I got it to build, using the mingw32-gcc-4.3.1 crosscompiler from the Cocotron project on Mac OS X 10.6.8. I even got its ffmpeg to run on my Win7 machine, but something goes wrong building the shared library version, even with a very simple test programme that only calls avcodec_version, avcore_version and avutil_version. Built under cygwin (linked with fully optimised ffmpeg ddls), the test runs fine in debug and optimised mode. But when I use MSVC 2010 Express, the optimised version crashes when trying to access avutil_version (the others are fine?!). It's as if the function is mapped to an invalid address. BTW, something similar but worse happens with the current-version ffmpeg dlls built with the same cross compiler so it does NOT have to do with the older code or Perian's patches to it. I've been looking at what ffplay does, thinking it could be a more viable approach ... except that ffplay (also) does not explain what it's doing. I'm going to post a different question on this in hope I'll get some more feedback. R. From cehoyos at ag.or.at Mon Jan 28 12:06:29 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Mon, 28 Jan 2013 11:06:29 +0000 (UTC) Subject: [Libav-user] porting FFusion codec to current FFmpeg libs - ParseContext1 ?? References: <7B07B13C-F379-4BE8-9F6D-F541576BBDD5@gmail.com> Message-ID: Ren? J.V. Bertin writes: > But when I use MSVC 2010 Express, the optimised version > crashes when trying to access avutil_version (the others > are fine?!). It's as if the function is mapped to an > invalid address. > BTW, something similar but worse happens with the > current-version ffmpeg dlls built with the same cross > compiler so it does NOT have to do with the older code > or Perian's patches to it. I may misunderstand this sentence(s) but please note that MSVC compilation is tested on a regular basis: http://fate.ffmpeg.org/ (compilation currently fails;-( but this should be fixed withing the next hours.) Carl Eugen From rjvbertin at gmail.com Mon Jan 28 12:13:26 2013 From: rjvbertin at gmail.com (=?iso-8859-1?Q?=22Ren=E9_J=2EV=2E_Bertin=22?=) Date: Mon, 28 Jan 2013 12:13:26 +0100 Subject: [Libav-user] porting FFusion codec to current FFmpeg libs - ParseContext1 ?? In-Reply-To: References: <7B07B13C-F379-4BE8-9F6D-F541576BBDD5@gmail.com> Message-ID: <0108394F-C3F2-46E6-98F1-E05DFE6A1F85@gmail.com> On Jan 28, 2013, at 12:06, Carl Eugen Hoyos wrote: > I may misunderstand this sentence(s) but please note that > MSVC compilation is tested on a regular basis: > http://fate.ffmpeg.org/ > (compilation currently fails;-( but this should be fixed > withing the next hours.) I was under the impression that building FFmpeg for win32 or win64 required a mingw cross compiler on a unix platform because of the C 'dialect' used. So much the better if that's not the case, but was MSVC already supported in the days of lavc52? In any case, once I manage to update my code to the current FFmpeg release version there is no justifiable reason for me to keep building FFmpeg myself! R. From rjvbertin at gmail.com Mon Jan 28 12:17:34 2013 From: rjvbertin at gmail.com (=?iso-8859-1?Q?=22Ren=E9_J=2EV=2E_Bertin=22?=) Date: Mon, 28 Jan 2013 12:17:34 +0100 Subject: [Libav-user] n00b question : decompressing into a contiguous pixmap Message-ID: <3457FF9B-3634-4ED9-BF92-9237B96AB788@gmail.com> Hello list, I'm looking for some pointers/explanation/help on how to decompress, say mp4v, content into a contiguous pixmap expected by a 3rd party multimedia framework. After being informed of the movie's width, height and depth, the framework provides me with a destination baseAdr and a rowBytes value, describing a contiguous pixmap of size height * rowBytes, in which the decoded pixels are stored without inter-pixel or inter-line padding (except for possibly a few empty bits at the end of each line). The pixel format is clearly RGBA or ARGB. I am working from code using an *old* libavcodec that invokes functions no longer existing as such in the current ffmpeg version, apparently in part to complete the compressed/input frame in case the framework didn't provide it completely. This helped me to whip up something that works for some content (h.264 doesn't appear to require anything but a call to avcoded_decode_video2). So I tried to follow the flow in ffplay, thinking it ought to be doing something comparable to my task. Sadly ffplay.c contains little to no useful comments to explain why it does what it does and its multithreaded nature doesn't make debugging it any easier. Can anyone provide me with some constructive feedback, pointers, explanations, help, whatever? The basic question appears to be: "What should I do after (or before?!) calling avcodec_decode_video2 to receive the decoded picture frame in a pixmap of the format described above?" I should point out that I'm quite new to this level of video processing, and I do not even have good documentation or tutorial describing decoder plugins for the multimedia framework in question. So delving into the history of ffmpeg's evolution to figure out how to replace the fossil APIs used by the old plugin wouldn't get me far, I'm afraid. I've made the code I'm working on available via github.com/RJVB/FFusion . Thanks in advance! Ren? From alexcohn at netvision.net.il Mon Jan 28 12:38:57 2013 From: alexcohn at netvision.net.il (Alex Cohn) Date: Mon, 28 Jan 2013 13:38:57 +0200 Subject: [Libav-user] porting FFusion codec to current FFmpeg libs - ParseContext1 ?? In-Reply-To: <0108394F-C3F2-46E6-98F1-E05DFE6A1F85@gmail.com> References: <7B07B13C-F379-4BE8-9F6D-F541576BBDD5@gmail.com> <0108394F-C3F2-46E6-98F1-E05DFE6A1F85@gmail.com> Message-ID: On Mon, Jan 28, 2013 at 1:13 PM, "Ren? J.V. Bertin" wrote: > > In any case, once I manage to update my code to the current FFmpeg release version there is no justifiable reason for me to keep building FFmpeg myself! .. but if you need access to internal functions not exported by the standard DLLs, there will be no choice but keep building libavcodec, libavformat, etc. yourself. BR, Alex From cehoyos at ag.or.at Mon Jan 28 14:35:31 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Mon, 28 Jan 2013 13:35:31 +0000 (UTC) Subject: [Libav-user] n00b question : decompressing into a contiguous pixmap References: <3457FF9B-3634-4ED9-BF92-9237B96AB788@gmail.com> Message-ID: Ren? J.V. Bertin writes: > I'm looking for some pointers/explanation/help on how to > decompress, say mp4v, content into a contiguous > pixmap expected by a 3rd party multimedia framework. > After being informed of the movie's width, height > and depth, the framework provides me with a destination > baseAdr and a rowBytes value, describing a contiguous > pixmap of size height * rowBytes, in which the decoded > pixels are stored This sounds like a general description of the decoding procedure, did you look into doc/examples/ ? > without inter-pixel or inter-line padding (except for > possibly a few empty bits at the end of each line). > The pixel format is clearly RGBA or ARGB. These lines are more difficult to understand... Note that ffplay does not support playing RGBA (or ARGB), so it may not be the best example application for this task. Carl Eugen From rjvbertin at gmail.com Mon Jan 28 18:07:06 2013 From: rjvbertin at gmail.com (=?iso-8859-1?Q?=22Ren=E9_J=2EV=2E_Bertin=22?=) Date: Mon, 28 Jan 2013 18:07:06 +0100 Subject: [Libav-user] porting FFusion codec to current FFmpeg libs - ParseContext1 ?? In-Reply-To: References: <7B07B13C-F379-4BE8-9F6D-F541576BBDD5@gmail.com> Message-ID: <8960B366-210D-4ECD-ABC9-1F6C1420FEAB@gmail.com> On Jan 28, 2013, at 12:06, Carl Eugen Hoyos wrote: > I may misunderstand this sentence(s) but please note that > MSVC compilation is tested on a regular basis: > http://fate.ffmpeg.org/ > (compilation currently fails;-( but this should be fixed > withing the next hours.) OK, my bad. I read the building docs almost 2 months ago and only tested my static build at that time. I clearly should have re-read it; after recreating the import (.lib) libraries with MS's own lib.exe my little test app runs perfectly even in optimised mode. Looks like I'll be trying the lavc52 path a bit more! Ren? From mjs5450 at rit.edu Tue Jan 29 07:05:36 2013 From: mjs5450 at rit.edu (Marty Sullivan) Date: Tue, 29 Jan 2013 01:05:36 -0500 Subject: [Libav-user] Modern C tutorials on reading frames and converting them to ppm Message-ID: I am currently using the following C tutorial: http://linux.amazingdev.com/blog/archives/2011/09/28/tutorial01.c I thought this one would work better than drangers ~8 year old tutorial but alas there are still many deprecated or removed functions since this was written. Can anyone recommend a tutorial that uses the latest versions of libav/ffmpeg libraries? Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: From cehoyos at ag.or.at Tue Jan 29 10:31:07 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Tue, 29 Jan 2013 09:31:07 +0000 (UTC) Subject: [Libav-user] Modern C tutorials on reading frames and converting them to ppm References: Message-ID: Marty Sullivan writes: > I am currently using the following C tutorial: > > http://linux.amazingdev.com/blog/archives/2011/09/28/tutorial01.c > > > I thought this one would work better than drangers ~8 year > old tutorial but alas there are still many deprecated or > removed functions since this was written. Did you already look into doc/examples ? Some effort was recently put into improving the examples. Carl Eugen From secu_tech at yahoo.com Tue Jan 29 12:20:01 2013 From: secu_tech at yahoo.com (amir amir) Date: Tue, 29 Jan 2013 03:20:01 -0800 (PST) Subject: [Libav-user] FFmpeg and Libraries Message-ID: <1359458401.54960.YahooMailNeo@web164503.mail.gq1.yahoo.com> Dear all, I am new to FFmpeg and I should evaluate the source code of it and find the point which libx264 is called. my purpose of this is to perform some parallel implementation when Transcoding is done. my OS platform is Windows and I have downloaded the??FFmpeg 64-bit Shared Versions. but what I need is the source code of the implementations of .lib files. is there any open source implementation under windows platform? Kind Regards, Amir -------------- next part -------------- An HTML attachment was scrubbed... URL: From cehoyos at ag.or.at Tue Jan 29 12:24:16 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Tue, 29 Jan 2013 11:24:16 +0000 (UTC) Subject: [Libav-user] FFmpeg and Libraries References: <1359458401.54960.YahooMailNeo@web164503.mail.gq1.yahoo.com> Message-ID: amir amir writes: > is there any open source implementation under windows platform? You can find FFmpeg source code at http://ffmpeg.org/download.html Carl Eugen From secu_tech at yahoo.com Tue Jan 29 16:43:42 2013 From: secu_tech at yahoo.com (amir amir) Date: Tue, 29 Jan 2013 07:43:42 -0800 (PST) Subject: [Libav-user] FFmpeg and Libraries In-Reply-To: References: <1359458401.54960.YahooMailNeo@web164503.mail.gq1.yahoo.com> Message-ID: <1359474222.42614.YahooMailNeo@web164506.mail.gq1.yahoo.com> Dear Carl, I ?have source code. what i want is: header + implementation files of FFMPEG for win not .lib and .dll files Amir ________________________________ From: Carl Eugen Hoyos To: libav-user at ffmpeg.org Sent: Tuesday, January 29, 2013 2:54 PM Subject: Re: [Libav-user] FFmpeg and Libraries amir amir writes: > is there any open source implementation under windows platform? You can find FFmpeg source code at http://ffmpeg.org/download.html 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 francisco at appschmiede.de Tue Jan 29 17:24:14 2013 From: francisco at appschmiede.de (Francisco Medina) Date: Tue, 29 Jan 2013 17:24:14 +0100 Subject: [Libav-user] mpeg-ts EIT and EPG info Message-ID: Hi, I'm currently developing an iOS application, which basically receives an mpeg-ts stream and demux it. I'm handling the RTSP session with help of live555 and then feeding the packets to ffmpeg. Until now I'm able to feed the packets to ffmpeg and see the different programs as well as audio, video, subtitles, teletext and other streams. I was wondering if the library also has support to access the Event Information Table (EIT) or/and EPG. I can see in Wireshark that the information is being sent, but when I feed it to ffmpeg all I can see is the list of programs. Thanks in advance Greetings -------------- next part -------------- An HTML attachment was scrubbed... URL: From cehoyos at ag.or.at Wed Jan 30 00:05:53 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Tue, 29 Jan 2013 23:05:53 +0000 (UTC) Subject: [Libav-user] mpeg-ts EIT and EPG info References: Message-ID: Francisco Medina writes: > I was wondering if the library also has support to > access the Event Information Table (EIT) or/and ?EPG. Not yet afaik, patch welcome! Carl Eugen From video-server at aab.sk Wed Jan 30 13:08:37 2013 From: video-server at aab.sk (video-server) Date: Wed, 30 Jan 2013 13:08:37 +0100 Subject: [Libav-user] avconv http custom headers are ignored Message-ID: <51090D45.70108@aab.sk> hello i have a ip camera that requires cookies to return jpg image the following syntax is my attempt to add cookies to headers avconv -v debug -nostats -analyzeduration 0 -f image2 -loop 1 -i http://ip/snap.jpg -headers $'Cookie: pwdid=admin; usrid=admin\r\n' -vsync vfr -s 640x480 -f mpjpeg -vcodec mjpeg -b 8000k -vf drawtext=fontfile=/usr/share/fonts/truetype/freefont/FreeMonoBold.ttf:fontsize=15:text='%F %T ip':fontcolor=red - (output to stdout,redirected to file) but the problem is, i see in wireshark that only the default headers get sent to ip camera GET /snap.jpg HTTP/1.1 User-Agent: Lavf53.21.1 Accept: */* Range: bytes=0- Connection: close Host: ip could anyone please help me find out why this doesn't work? my distro is debian squeeze, libav-tools from debian-backports thank you Mike following avconv output: avconv version 0.8.5-6:0.8.5-1~bpo60+1, Copyright (c) 2000-2012 the Libav developers built on Jan 24 2013 20:38:51 with gcc 4.4.5 configuration: --arch=i386 --enable-pthreads --enable-runtime-cpudetect --extra-version='6:0.8.5-1~bpo60+1' --libdir=/usr/lib/ --prefix=/usr --enable-bzlib --enable-libdc1394 --enable-libdirac --enable-libfreetype --enable-frei0r --enable-gnutls --enable-libgsm --enable-libmp3lame --enable-librtmp --enable-libopenjpeg --enable-libpulse --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-vaapi --enable-vdpau --enable-libvorbis --enable-libvpx --enable-zlib --enable-gpl --enable-postproc --enable-swscale --enable-libcdio --enable-x11grab --enable-libx264 --enable-libxvid --enable-shared --disable-static avutil configuration: --arch=i386 --enable-pthreads --enable-runtime-cpudetect --extra-version='6:0.8.5-1~bpo60+1' --libdir=/usr/lib/ --prefix=/usr --enable-bzlib --enable-libdc1394 --enable-libdirac --enable-libfreetype --enable-frei0r --enable-gnutls --enable-libgsm --enable-libmp3lame --enable-librtmp --enable-libopenjpeg --enable-libpulse --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-vaapi --enable-vdpau --enable-libvorbis --enable-libvpx --enable-zlib --enable-gpl --enable-postproc --enable-swscale --enable-libcdio --enable-x11grab --enable-libx264 --enable-libxvid --shlibdir=/usr/lib//i686/cmov --cpu=i686 --enable-shared --disable-static avcodec configuration: --arch=i386 --enable-pthreads --enable-runtime-cpudetect --extra-version='6:0.8.5-1~bpo60+1' --libdir=/usr/lib/ --prefix=/usr --enable-bzlib --enable-libdc1394 --enable-libdirac --enable-libfreetype --enable-frei0r --enable-gnutls --enable-libgsm --enable-libmp3lame --enable-librtmp --enable-libopenjpeg --enable-libpulse --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-vaapi --enable-vdpau --enable-libvorbis --enable-libvpx --enable-zlib --enable-gpl --enable-postproc --enable-swscale --enable-libcdio --enable-x11grab --enable-libx264 --enable-libxvid --shlibdir=/usr/lib//i686/cmov --cpu=i686 --enable-shared --disable-static avformat configuration: --arch=i386 --enable-pthreads --enable-runtime-cpudetect --extra-version='6:0.8.5-1~bpo60+1' --libdir=/usr/lib/ --prefix=/usr --enable-bzlib --enable-libdc1394 --enable-libdirac --enable-libfreetype --enable-frei0r --enable-gnutls --enable-libgsm --enable-libmp3lame --enable-librtmp --enable-libopenjpeg --enable-libpulse --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-vaapi --enable-vdpau --enable-libvorbis --enable-libvpx --enable-zlib --enable-gpl --enable-postproc --enable-swscale --enable-libcdio --enable-x11grab --enable-libx264 --enable-libxvid --shlibdir=/usr/lib//i686/cmov --cpu=i686 --enable-shared --disable-static avdevice configuration: --arch=i386 --enable-pthreads --enable-runtime-cpudetect --extra-version='6:0.8.5-1~bpo60+1' --libdir=/usr/lib/ --prefix=/usr --enable-bzlib --enable-libdc1394 --enable-libdirac --enable-libfreetype --enable-frei0r --enable-gnutls --enable-libgsm --enable-libmp3lame --enable-librtmp --enable-libopenjpeg --enable-libpulse --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-vaapi --enable-vdpau --enable-libvorbis --enable-libvpx --enable-zlib --enable-gpl --enable-postproc --enable-swscale --enable-libcdio --enable-x11grab --enable-libx264 --enable-libxvid --shlibdir=/usr/lib//i686/cmov --cpu=i686 --enable-shared --disable-static avfilter configuration: --arch=i386 --enable-pthreads --enable-runtime-cpudetect --extra-version='6:0.8.5-1~bpo60+1' --libdir=/usr/lib/ --prefix=/usr --enable-bzlib --enable-libdc1394 --enable-libdirac --enable-libfreetype --enable-frei0r --enable-gnutls --enable-libgsm --enable-libmp3lame --enable-librtmp --enable-libopenjpeg --enable-libpulse --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-vaapi --enable-vdpau --enable-libvorbis --enable-libvpx --enable-zlib --enable-gpl --enable-postproc --enable-swscale --enable-libcdio --enable-x11grab --enable-libx264 --enable-libxvid --shlibdir=/usr/lib//i686/cmov --cpu=i686 --enable-shared --disable-static swscale configuration: --arch=i386 --enable-pthreads --enable-runtime-cpudetect --extra-version='6:0.8.5-1~bpo60+1' --libdir=/usr/lib/ --prefix=/usr --enable-bzlib --enable-libdc1394 --enable-libdirac --enable-libfreetype --enable-frei0r --enable-gnutls --enable-libgsm --enable-libmp3lame --enable-librtmp --enable-libopenjpeg --enable-libpulse --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-vaapi --enable-vdpau --enable-libvorbis --enable-libvpx --enable-zlib --enable-gpl --enable-postproc --enable-swscale --enable-libcdio --enable-x11grab --enable-libx264 --enable-libxvid --shlibdir=/usr/lib//i686/cmov --cpu=i686 --enable-shared --disable-static postproc configuration: --arch=i386 --enable-pthreads --enable-runtime-cpudetect --extra-version='6:0.8.5-1~bpo60+1' --libdir=/usr/lib/ --prefix=/usr --enable-bzlib --enable-libdc1394 --enable-libdirac --enable-libfreetype --enable-frei0r --enable-gnutls --enable-libgsm --enable-libmp3lame --enable-librtmp --enable-libopenjpeg --enable-libpulse --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-vaapi --enable-vdpau --enable-libvorbis --enable-libvpx --enable-zlib --enable-gpl --enable-postproc --enable-swscale --enable-libcdio --enable-x11grab --enable-libx264 --enable-libxvid --shlibdir=/usr/lib//i686/cmov --cpu=i686 --enable-shared --disable-static libavutil 51. 22. 1 / 51. 22. 1 libavcodec 53. 35. 0 / 53. 35. 0 libavformat 53. 21. 1 / 53. 21. 1 libavdevice 53. 2. 0 / 53. 2. 0 libavfilter 2. 15. 0 / 2. 15. 0 libswscale 2. 1. 0 / 2. 1. 0 libpostproc 52. 0. 0 / 52. 0. 0 http://ip/snap.jpg: No such file or directory From cehoyos at ag.or.at Wed Jan 30 13:34:19 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Wed, 30 Jan 2013 12:34:19 +0000 (UTC) Subject: [Libav-user] avconv http custom headers are ignored References: <51090D45.70108@aab.sk> Message-ID: video-server writes: > avconv version 0.8.5-6:0.8.5-1~bpo60+1, > Copyright (c) 2000-2012 the Libav developers This is an intentionally broken version of FFmpeg, it contains several hundred bugs not reproducible with FFmpeg, some of them security relevant, please understand that we therefore cannot support this version. Please see http://ffmpeg.org/download.html for supported versions, current git head is always recommended if you are a user (and not a distributor yourself). Carl Eugen From video-server at aab.sk Wed Jan 30 14:06:21 2013 From: video-server at aab.sk (video-server) Date: Wed, 30 Jan 2013 14:06:21 +0100 Subject: [Libav-user] avconv http custom headers are ignored In-Reply-To: References: <51090D45.70108@aab.sk> Message-ID: <51091ACD.8060607@aab.sk> i understand, i was confused by the name of this list, thought this was libav version of ffmpeg. thank you. D?a 30.01.2013 13:34, Carl Eugen Hoyos wrote / nap?sal(a): > video-server writes: > >> avconv version 0.8.5-6:0.8.5-1~bpo60+1, >> Copyright (c) 2000-2012 the Libav developers > This is an intentionally broken version of FFmpeg, > it contains several hundred bugs not reproducible > with FFmpeg, some of them security relevant, please > understand that we therefore cannot support this > version. > Please see http://ffmpeg.org/download.html for > supported versions, current git head is always > recommended if you are a user (and not a > distributor yourself). > > Carl Eugen > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user From cehoyos at ag.or.at Wed Jan 30 14:14:35 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Wed, 30 Jan 2013 13:14:35 +0000 (UTC) Subject: [Libav-user] avconv http custom headers are ignored References: <51090D45.70108@aab.sk> <51091ACD.8060607@aab.sk> Message-ID: video-server writes: > i understand, i was confused by the name of this list This mailing list exists for five years, the fork you tested since two, so I guess they did not choose their name very well. Is the problem you see also reproducible with current FFmpeg? Carl Eugen From video-server at aab.sk Wed Jan 30 14:17:00 2013 From: video-server at aab.sk (video-server) Date: Wed, 30 Jan 2013 14:17:00 +0100 Subject: [Libav-user] avconv http custom headers are ignored In-Reply-To: References: <51090D45.70108@aab.sk> <51091ACD.8060607@aab.sk> Message-ID: <51091D4C.6090001@aab.sk> i don't know yet, but it will take some time, because i must first find out the parameter syntax for ffmpeg for achieveing the same thing. D?a 30.01.2013 14:14, Carl Eugen Hoyos wrote / nap?sal(a): > video-server writes: > >> i understand, i was confused by the name of this list > This mailing list exists for five years, the fork you > tested since two, so I guess they did not choose their > name very well. > > Is the problem you see also reproducible with current > FFmpeg? > > Carl Eugen > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user From cehoyos at ag.or.at Wed Jan 30 14:22:57 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Wed, 30 Jan 2013 13:22:57 +0000 (UTC) Subject: [Libav-user] avconv http custom headers are ignored References: <51090D45.70108@aab.sk> <51091ACD.8060607@aab.sk> <51091D4C.6090001@aab.sk> Message-ID: video-server writes: > i don't know yet, but it will take some time, because > i must first find out the parameter syntax for ffmpeg > for achieveing the same thing. If you find an option that is not supported by ffmpeg, please report it! (From a quick loop, FFmpeg supports all options you use and I don't know of any options at all that are missing.) Carl Eugen From video-server at aab.sk Wed Jan 30 15:06:30 2013 From: video-server at aab.sk (video-server) Date: Wed, 30 Jan 2013 15:06:30 +0100 Subject: [Libav-user] avconv http custom headers are ignored In-Reply-To: References: <51090D45.70108@aab.sk> <51091ACD.8060607@aab.sk> <51091D4C.6090001@aab.sk> Message-ID: <510928E6.5060001@aab.sk> no parameter changes were neccessary,the situation persists in ffmpeg too. maybe i have made some parameter wrong... ./ffmpeg -v debug -f image2 -loop 1 -ihttp://ip/snap.jpg -headers $'Cookie: pwdid=admin; usrid=admin\r\n' -vsync vfr -s 640x480 -f mpjpeg -vcodec mjpeg -b 8000k -vf drawtext=fontfile=/usr/share/fonts/truetype/freefont/FreeMonoBold.ttf:fontsize=15:text='%F %T ciko outdoor test':fontcolor=red - > a.mjpg wireshark: GET /snap.jpg HTTP/1.1 User-Agent: Lavf54.61.104 Accept: */* Range: bytes=0- Connection: close Host: ip system: debian wheezy (today's build) , ffmpeg compiled from git ffmpeg version N-49452-g91f3592 Copyright (c) 2000-2013 the FFmpeg developers built on Jan 30 2013 14:54:37 with gcc 4.7 (Debian 4.7.2-5) configuration: libavutil 52. 17.100 / 52. 17.100 libavcodec 54. 91.100 / 54. 91.100 libavformat 54. 61.104 / 54. 61.104 libavdevice 54. 3.102 / 54. 3.102 libavfilter 3. 34.101 / 3. 34.101 libswscale 2. 2.100 / 2. 2.100 libswresample 0. 17.102 / 0. 17.102 Splitting the commandline. Reading option '-v' ... matched as option 'v' (set libav* logging level) with argument 'debug'. Reading option '-f' ... matched as option 'f' (force format) with argument 'image2'. Reading option '-loop' ... matched as AVOption 'loop' with argument '1'. Reading option '-i' ... matched as input file with argument 'http://ip/snap.jpg'. Reading option '-headers' ... matched as AVOption 'headers' with argument 'Cookie: pwdid=admin; usrid=admin '. Reading option '-vsync' ... matched as option 'vsync' (video sync method) with argument 'vfr'. Reading option '-s' ... matched as option 's' (set frame size (WxH or abbreviation)) with argument '640x480'. Reading option '-f' ... matched as option 'f' (force format) with argument 'mpjpeg'. Reading option '-vcodec' ... matched as option 'vcodec' (force video codec ('copy' to copy stream)) with argument 'mjpeg'. Reading option '-b' ... matched as option 'b' (video bitrate (please use -b:v)) with argument '8000k'. Reading option '-vf' ... matched as option 'vf' (set video filters) with argument 'drawtext=fontfile=/usr/share/fonts/truetype/freefont/FreeMonoBold.ttf:fontsize=15:text=%F %T ciko outdoor test:fontcolor=red'. Reading option '-' ... matched as output file. Finished splitting the commandline. Parsing a group of options: global . Applying option v (set libav* logging level) with argument debug. Applying option vsync (video sync method) with argument vfr. Successfully parsed a group of options. Parsing a group of options: input filehttp://ip/snap.jpg. Applying option f (force format) with argument image2. Successfully parsed a group of options. Opening an input file:http://ip/snap.jpg. [image2 @ 0x167b280] Could find no file with with path 'http://ip/snap.jpg' and index in the range 0-4 http://ip/snap.jpg: No such file or directory D?a 30.01.2013 14:22, Carl Eugen Hoyos wrote / nap?sal(a): > video-server writes: > >> i don't know yet, but it will take some time, because >> i must first find out the parameter syntax for ffmpeg >> for achieveing the same thing. > If you find an option that is not supported by ffmpeg, > please report it! > (From a quick loop, FFmpeg supports all options you use > and I don't know of any options at all that are missing.) > > Carl Eugen > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user From p3070011 at dias.aueb.gr Wed Jan 30 14:50:47 2013 From: p3070011 at dias.aueb.gr (Vitsas Nikolaos) Date: Wed, 30 Jan 2013 15:50:47 +0200 Subject: [Libav-user] Output to stdout Message-ID: libav-user at ffmpeg.org Hi, I have an mp4 input file and I want to be able to play it' s video stream(h264) in real time through ffplay. It all works well when I try outputting the video to a file(file plays great with ffplay, no errors) but I really cannot find how to pipe the output into ffplay. I think what I am looking for is the correct filename for av_guess_format. I' m using Windows and the latest FFmpeg build. I know /dev/stdout won' t work. I read somewhere that "-" means stdout but this did not help(I just got a file named "-"). I have also tried specifying "con" but it turns out that' s for console output... Any ideas? Thank you. From cehoyos at ag.or.at Wed Jan 30 15:42:30 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Wed, 30 Jan 2013 14:42:30 +0000 (UTC) Subject: [Libav-user] avconv http custom headers are ignored References: <51090D45.70108@aab.sk> <51091ACD.8060607@aab.sk> <51091D4C.6090001@aab.sk> <510928E6.5060001@aab.sk> Message-ID: video-server writes: > ./ffmpeg -v debug -f image2 -loop 1 -ihttp://ip/snap.jpg > -headers $'Cookie: pwdid=admin;usrid=admin\r\n' Could you test if the following works? $ ffmpeg -headers ... -i http://ip/snap.jpg Carl Eugen From cehoyos at ag.or.at Wed Jan 30 15:45:30 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Wed, 30 Jan 2013 14:45:30 +0000 (UTC) Subject: [Libav-user] avconv http custom headers are ignored References: <51090D45.70108@aab.sk> <51091ACD.8060607@aab.sk> <51091D4C.6090001@aab.sk> <510928E6.5060001@aab.sk> Message-ID: video-server writes: > ./ffmpeg -v debug -f image2 -loop 1 -ihttp://ip/snap.jpg Did you already read this part of the documentation? http://ffmpeg.org/ffmpeg-protocols.html#http It contains some hints on how to pass cookies iiuc. Carl Eugen From gregoire at gentil.com Wed Jan 30 08:53:30 2013 From: gregoire at gentil.com (Gregoire Gentil) Date: Tue, 29 Jan 2013 23:53:30 -0800 Subject: [Libav-user] UDP Stream Read Pixelation Message-ID: <5108D17A.708@gentil.com> Hello, While using ffmpeg on Android, I'm hitting a similar problem to this: http://ffmpeg.org/pipermail/libav-user/2012-June/002310.html I have posted an example here: http://stackoverflow.com/questions/14593531/too-small-ffmpeg-rtsp-decoding-buffer Is there a way to fix this problem? Thanks in advance for any help, Gr?goire From kanglin at coship.com Thu Jan 31 17:01:17 2013 From: kanglin at coship.com (kanglin) Date: Fri, 1 Feb 2013 00:01:17 +0800 Subject: [Libav-user] How to generate an index image files? Message-ID: <002601cdffcc$34700420$9d500c60$@coship.com> Ffmpeg can generate an index image file. But I don't know how to generate an index image files. For example: every six hundred seconds to produce an index picture? Can tell me how to do use ffmpeg?