From harry at gps-laptimer.de Sat Mar 1 17:50:03 2014 From: harry at gps-laptimer.de (Harald Schlangmann) Date: Sat, 1 Mar 2014 17:50:03 +0100 Subject: [Libav-user] Simplified demux/decode/encode/mux Message-ID: <3CC5C270-A913-4281-87AF-5B3CD21910DC@gps-laptimer.de> Hi, I use the FFmpeg libs to read a video file, apply changes to the video stream, and write both the changed video frames and *unchanged* audio frames to another file. All of this is done on Android (NDK). Currently, I do have the video part running and wanted to start the audio part now. 2 questions: #1: As I do not want to change the audio part, what is the preferred and fastest way to pass this stream through? Is it valid to simply read audio packets (not frames) and write them unchanged? To me it seems it does not make too much sense to first decode them and encode them later? Or am I missing something? #2: I have learned about pts/dts and roughly understand what it is all about. Samples I have seen do quite sophisticated things to derive a PTS for real time display and so on? In my scenario (which is a simple batch process), is it a valid approach to ignore that stuff completely and simple copy over the original pts/dts fields on packet level (both audio and video) when writing them to the second file? I?m looking forward to any feedback. Greetings Harald - Harald Schlangmann Antwerpener Str. 52, 50672 K?ln, Germany +49 151 2265 4439 Harry at gps-laptimer.de www.gps-laptimer.de -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 4145 bytes Desc: not available URL: From eclipse7 at gmx.net Sat Mar 1 19:17:52 2014 From: eclipse7 at gmx.net (Alexander Strasser) Date: Sat, 1 Mar 2014 19:17:52 +0100 Subject: [Libav-user] [CLT2014] FFmpeg at Chemnitzer Linux-Tage Message-ID: <20140301181752.GA3864@akuma.Speedport_W_723V_1_32_000> We happily announce that FFmpeg will be represented at `Chemnitzer Linux-Tage' in Chemnitz, Germany. The event will take place on 15th and 16th of March. More information can be found here: http://chemnitzer.linux-tage.de/2014/en/info/ We hereby invite you to visit us at our booth located in the Linux-Live area! There we will demonstrate usage of FFmpeg, answer your questions and listen to your problems and wishes. Especially if you have media files that cannot be processed correctly with FFmpeg, be sure to have a sample with you so we can have a look! -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 181 bytes Desc: not available URL: From george at nsup.org Sat Mar 1 19:15:46 2014 From: george at nsup.org (Nicolas George) Date: Sat, 1 Mar 2014 19:15:46 +0100 Subject: [Libav-user] Simplified demux/decode/encode/mux In-Reply-To: <3CC5C270-A913-4281-87AF-5B3CD21910DC@gps-laptimer.de> References: <3CC5C270-A913-4281-87AF-5B3CD21910DC@gps-laptimer.de> Message-ID: <20140301181546.GA2345@phare.normalesup.org> Le primidi 11 vent?se, an CCXXII, Harald Schlangmann a ?crit?: > #1: As I do not want to change the audio part, what is the preferred and > fastest way to pass this stream through? Is it valid to simply read audio > packets (not frames) and write them unchanged? For most formats and codecs, this is valid. This is what the ffmpeg command-line tool does when you use "-c copy". > #2: I have learned about pts/dts and roughly understand what it is all > about. Samples I have seen do quite sophisticated things to derive a PTS > for real time display and so on? In my scenario (which is a simple batch > process), is it a valid approach to ignore that stuff completely and > simple copy over the original pts/dts fields on packet level (both audio > and video) when writing them to the second file? Not exactly, there are two issues you must take care of. First, if you are transcoding, especially video, you must make sure to set the frame's PTS (a frame does not have a DTS), and let the encoder set the packet's PTS and DTS. The DTS exists to take into account the B-frames and codec delay. You can not know that your encoder will make the same decisions about that than the original encoded content. Second, and that applies both for packets just encoded and packets copied from the input as is: you need to rescale the packet's PTS and DTS to the stream's time base. Regards, -- Nicolas George -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: From d3ck0r at gmail.com Sun Mar 2 07:34:01 2014 From: d3ck0r at gmail.com (J Decker) Date: Sat, 1 Mar 2014 22:34:01 -0800 Subject: [Libav-user] Video Timing Message-ID: Can someone point me at something that shows how to get reliable stream timing? Depending on the video, video_packet->pts = INT64MIN or video_packet->pts is equivalent to the frame index or ... pts increments in approximate units of 3000/frame... what builds this 3000 number? Ticks per frame is often 2; which is needed... I understand how the numerator/denominator work; but depending on the video the encoding of all these informations is unreliable... how do I get a reliable pts for the video? Audio seems easy; since it's a slow steady, packed stream... so I'm pretty close overriding and just using the encoded_frame data from the video packet to determine time... but I ran into another that I'm not sure what's wrong with it... And by now, why isn't all of this just fixed so after the decoder I know exactly what the time should be? :) -------------- next part -------------- An HTML attachment was scrubbed... URL: From harry at gps-laptimer.de Sun Mar 2 09:20:52 2014 From: harry at gps-laptimer.de (Harald Schlangmann) Date: Sun, 2 Mar 2014 09:20:52 +0100 Subject: [Libav-user] Simplified demux/decode/encode/mux In-Reply-To: <20140301181546.GA2345@phare.normalesup.org> References: <3CC5C270-A913-4281-87AF-5B3CD21910DC@gps-laptimer.de> <20140301181546.GA2345@phare.normalesup.org> Message-ID: <7CA3DD5A-71CA-4FF2-89AB-96C158A6636D@gps-laptimer.de> Thanks Nicolas, very helpful and precise feedback! > For most formats and codecs, this is valid. This is what the ffmpeg > command-line tool does when you use ?-c copy". I will check the source for the copy option. > Second, and that applies both for packets just encoded and packets copied > from the input as is: you need to rescale the packet's PTS and DTS to the > stream?s time base. Just to make sure I do not miss anything here? As I copy the time_base from the source too, I assume a rescale is not necessary? Greetings Harald - Harald Schlangmann Antwerpener Str. 52, 50672 K?ln, Germany +49 151 2265 4439 Harry at gps-laptimer.de www.gps-laptimer.de -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 4145 bytes Desc: not available URL: From george at nsup.org Sun Mar 2 15:36:11 2014 From: george at nsup.org (Nicolas George) Date: Sun, 2 Mar 2014 15:36:11 +0100 Subject: [Libav-user] Simplified demux/decode/encode/mux In-Reply-To: <7CA3DD5A-71CA-4FF2-89AB-96C158A6636D@gps-laptimer.de> References: <3CC5C270-A913-4281-87AF-5B3CD21910DC@gps-laptimer.de> <20140301181546.GA2345@phare.normalesup.org> <7CA3DD5A-71CA-4FF2-89AB-96C158A6636D@gps-laptimer.de> Message-ID: <20140302143611.GB8715@phare.normalesup.org> Le duodi 12 vent?se, an CCXXII, Harald Schlangmann a ?crit?: > Just to make sure I do not miss anything here? As I copy the time_base > from the source too, I assume a rescale is not necessary? Not all formats support any time base. Some formats will change the time base for their streams during the write_header() phase. Therefore, to keep your program generic, you need to rescale anyway. Regards, -- Nicolas George -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: From mathias.hjartstrom at a2b.se Mon Mar 3 13:12:05 2014 From: mathias.hjartstrom at a2b.se (=?iso-8859-1?Q?Mathias_Hj=E4rtstr=F6m?=) Date: Mon, 3 Mar 2014 13:12:05 +0100 Subject: [Libav-user] Decoding HE-AAC? Message-ID: <000001cf36d9$cb4dcb30$61e96190$@a2b.se> I have a transport stream file containing several services using MPEG1 and HE-AAC audio. I can play back the file using ffplay, even though I get some warnings and errors at the command prompt (probably because the TS was recorded straight from a TV transmission). I use the ?vst and ?ast parameters to make sure what PIDs to play. The ffprobe application will report the audio streams as being aac_latm (in parallel with mp1) and I have configured my own application (that can play MPEG1, MPEG2 and regular AAC audio just fine, no problem at all) to use the AV_CODEC_ID_AAC_LATM to decode the HE-AAC streams. I get no errors during initialization, but I get lots of ?frame length mismatch? messages, some ?envelope scalefactor overflow in dequant? messages and sometimes also some ?is not implemented? ones while decoding the frames with avcodec_decode_audio4(). I use FFmpeg release 2.1. I realize it?s my own fault and probably has something to do with initialization, but I can?t figure out what it is. Is there for instance some av_opt_set_int() call or something similar that must be made in order to play back HE-AAC, as opposed to how everything is initialized when playing back MPEG1, MPEG2 or AAC audio? Thanks for your help! Best regards, Mathias -------------- next part -------------- An HTML attachment was scrubbed... URL: From stephen at napkinstudio.com Mon Mar 3 22:07:48 2014 From: stephen at napkinstudio.com (Stephen H. Gerstacker) Date: Mon, 3 Mar 2014 16:07:48 -0500 Subject: [Libav-user] AVFilterGraph and an In-Memory Image In-Reply-To: References: <9937C12F-C389-475D-9BDD-7E98816EF667@napkinstudio.com> Message-ID: <85A72DFA-4DFA-4461-9CE4-704CF3DF6080@napkinstudio.com> Here?s the final output graph from my set up. To get the alpha properly, you need to force overlay to rgb, then format it back to yuv before the buffersink. +-------------+ | watermarkIn |default--[439x102 1:1 bgra]--overlay:overlay | (buffer) | +-------------+ +----------+ | in |default--[640x960 0:1 yuvj420p]--pad:default | (buffer) | +----------+ +-------+ in:default--[640x960 0:1 yuvj420p]--default| pad |default--[640x960 0:1 yuvj420p]--auto-inserted scaler 0:default | (pad) | +-------+ +-----------+ auto-inserted scaler 0:default--[640x960 0:1 bgra]-----main| overlay |default--[640x960 0:1 bgra]--auto-inserted scaler 1:default watermarkIn:default-------------[439x102 1:1 bgra]--overlay| (overlay) | +-----------+ +----------+ auto-inserted scaler 1:default--[640x960 0:1 yuv420p]--default| format |default--[640x960 0:1 yuv420p]--out:default | (format) | +----------+ +--------------+ format:default--[640x960 0:1 yuv420p]--default| out | | (buffersink) | +--------------+ +------------------------+ pad:default--[640x960 0:1 yuvj420p]--default| auto-inserted scaler 0 |default--[640x960 0:1 bgra]--overlay:main | (scale) | +------------------------+ +------------------------+ overlay:default--[640x960 0:1 bgra]--default| auto-inserted scaler 1 |default--[640x960 0:1 yuv420p]--format:default | (scale) | +------------------------+ - Stephen On Feb 28, 2014, at 4:41 PM, Stephen H. Gerstacker wrote: > As a follow up, I attempted the following > > Create a new ?buffer? that I dump BGRA frames in to (that?s the format the watermark is in as memory). > Every time I add a frame to my original buffer, I add a watermark frame to my watermark buffer. > After the pad link, I added an ?overlay? filter with the pad and watermark buffer as inputs, outputting to the buffersink. > > This worked, but I loose the alpha transparency. Anything I can do to preserve that? > > - Stephen > > > > On Feb 28, 2014, at 9:54 AM, Stephen H. Gerstacker wrote: > >> I'm making an AVFilterGraph in code. I need to apply a watermark to the video. >> >> My assumption is that I need to use the "movie" AVFilter to then overlay it. My watermark is just stored in memory, not in a file, so I'm unsure how to point the "movie" filter to use that watermark? >> >> Can someone clarify how I would do that? >> >> My current filter graph is basically: >> >> buffer -> (optional rotation) -> scale -> pad -> buffersink >> >> The watermark would come in after the pad and overlaid there. >> >> - Stephen >> >> >> >> _______________________________________________ >> 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 cehoyos at ag.or.at Mon Mar 3 23:27:53 2014 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Mon, 3 Mar 2014 22:27:53 +0000 (UTC) Subject: [Libav-user] Decoding HE-AAC? References: <000001cf36d9$cb4dcb30$61e96190$@a2b.se> Message-ID: Mathias Hj?rtstr?m writes: > The ffprobe application will report the audio > streams as being aac_latm > (in parallel with mp1) This specific bug should be fixed, if not please report! [...] > I use FFmpeg release 2.1. Please understand that only current FFmpeg git head is generally supported. Carl Eugen From mrfun.china at gmail.com Mon Mar 3 23:58:50 2014 From: mrfun.china at gmail.com (YIRAN LI) Date: Tue, 4 Mar 2014 09:58:50 +1100 Subject: [Libav-user] reduce dll size Message-ID: Hi, I'm building ffmpeg dlls for Windows using MingW, and the dlls I got seems quite large. libavcodec 8 MB and libavformat 1.5 MB. Firstly may I know, since ffmpeg is built into several dlls, is it possible that same code got built into each dll so that there're some unnecessary waste? Is it possible to build all code into one dll? Second, is there any option I can use to reduce the size of the dlls? Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: From phpdev at ehrhardt.nl Tue Mar 4 00:15:25 2014 From: phpdev at ehrhardt.nl (Jan Ehrhardt) Date: Tue, 04 Mar 2014 00:15:25 +0100 Subject: [Libav-user] reduce dll size References: Message-ID: YIRAN LI in gmane.comp.video.ffmpeg.libav.user (Tue, 4 Mar 2014 09:58:50 +1100): >Second, is there any option I can use to reduce the size of the dlls? Try 'strip avcodec.dll' etc. Jan From donmoir at comcast.net Tue Mar 4 00:18:47 2014 From: donmoir at comcast.net (Don Moir) Date: Mon, 3 Mar 2014 18:18:47 -0500 Subject: [Libav-user] reduce dll size References: Message-ID: >From: YIRAN LI >To: This list is about using libavcodec, libavformat, libavutil,libavdevice and libavfilter. >Sent: Monday, March 03, 2014 5:58 PM >Subject: [Libav-user] reduce dll size >Hi, >I'm building ffmpeg dlls for Windows using MingW, and the dlls I got seems quite large. libavcodec 8 MB and libavformat 1.5 MB. >Firstly may I know, since ffmpeg is built into several dlls, is it possible that same code got built into each dll so that there're >some unnecessary waste? Is it possible to build all code into one dll? >Second, is there any option I can use to reduce the size of the dlls? Use UPX. Works very well. http://upx.sourceforge.net/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From mrfun.china at gmail.com Tue Mar 4 00:45:55 2014 From: mrfun.china at gmail.com (YIRAN LI) Date: Tue, 4 Mar 2014 10:45:55 +1100 Subject: [Libav-user] reduce dll size In-Reply-To: References: Message-ID: Thanks friends. Any other options? Because the largest dll is libavcode, and infact I only need all decoders + selected encoders, so will disabling those unneeded encoders save me spaces? Thanks 2014-03-04 10:18 GMT+11:00 Don Moir : > >From: YIRAN LI > >To: This list is about using libavcodec, libavformat, > libavutil,libavdevice and libavfilter. > >Sent: Monday, March 03, 2014 5:58 PM > >Subject: [Libav-user] reduce dll size > > >Hi, > > >I'm building ffmpeg dlls for Windows using MingW, and the dlls I got > seems quite large. libavcodec 8 MB and libavformat 1.5 MB. > > >Firstly may I know, since ffmpeg is built into several dlls, is it > possible that same code got built into each dll so that there're > >some unnecessary waste? Is it possible to build all code into one dll? > > >Second, is there any option I can use to reduce the size of the dlls? > > Use UPX. Works very well. > > http://upx.sourceforge.net/ > > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mrfun.china at gmail.com Tue Mar 4 00:49:07 2014 From: mrfun.china at gmail.com (YIRAN LI) Date: Tue, 4 Mar 2014 10:49:07 +1100 Subject: [Libav-user] reduce dll size In-Reply-To: References: Message-ID: And can anyone let me know, if there're reused/duplicate code among dlls, if so, is it possible to build one dll instead of separated ones to save space? Thanks 2014-03-04 10:45 GMT+11:00 YIRAN LI : > Thanks friends. > > Any other options? Because the largest dll is libavcode, and infact I only > need all decoders + selected encoders, so will disabling those unneeded > encoders save me spaces? > > Thanks > > > 2014-03-04 10:18 GMT+11:00 Don Moir : > >> >From: YIRAN LI >> >To: This list is about using libavcodec, libavformat, >> libavutil,libavdevice and libavfilter. >> >Sent: Monday, March 03, 2014 5:58 PM >> >Subject: [Libav-user] reduce dll size >> >> >Hi, >> >> >I'm building ffmpeg dlls for Windows using MingW, and the dlls I got >> seems quite large. libavcodec 8 MB and libavformat 1.5 MB. >> >> >Firstly may I know, since ffmpeg is built into several dlls, is it >> possible that same code got built into each dll so that there're >> >some unnecessary waste? Is it possible to build all code into one dll? >> >> >Second, is there any option I can use to reduce the size of the dlls? >> >> Use UPX. Works very well. >> >> http://upx.sourceforge.net/ >> >> >> _______________________________________________ >> 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 jkordani at lsa2.com Tue Mar 4 00:50:44 2014 From: jkordani at lsa2.com (Joshua Kordani) Date: Mon, 03 Mar 2014 18:50:44 -0500 Subject: [Libav-user] Yet another question about decoding h264 Message-ID: <53151554.4000906@lsa2.com> All, I have h264 nalus in memory. I can successfully make h264 annex b files playable with ffplay. I want to now decode them and work with the frames. All the example code I've found involves standing up the proper datastructures starting with the container format of an input file (ffplay, or demuxing_decoding.c in examples), but I'll need to stand up the decoder by hand. I've reviewed the avcodec.c in doc/examples and notice that if using the h264 output type in this program that decoding the test video and writing it to disk is skipped. After modifying the code to setup the decoder as an h264 decoder instead of the mpeg1video, and calling the decode function, the decoder step fails with the following output on the console: Decode video file test.h264 to test%02d.pgm [h264 @ 0x7fd22ab5ba00] Missing reference picture, default is 0 [h264 @ 0x7fd22ab5ba00] decode_slice_header error [h264 @ 0x7fd22ab5ba00] reference picture missing during reorder [h264 @ 0x7fd22ab5ba00] Missing reference picture, default is 0 [h264 @ 0x7fd22ab5ba00] reference picture missing during reorder [h264 @ 0x7fd22ab5ba00] Missing reference picture, default is 2 [h264 @ 0x7fd22ab5ba00] left block unavailable for requested intra mode at 0 13 [h264 @ 0x7fd22ab5ba00] error while decoding MB 0 13, bytestream (-4) [h264 @ 0x7fd22ab5ba00] concealing 159 DC, 159 AC, 159 MV errors in P frame [h264 @ 0x7fd22ab5ba00] reference picture missing during reorder [h264 @ 0x7fd22ab5ba00] Missing reference picture, default is 65530 [h264 @ 0x7fd22ab5ba00] reference picture missing during reorder [h264 @ 0x7fd22ab5ba00] Missing reference picture, default is 65532 [h264 @ 0x7fd22ab5ba00] Invalid mix of idr and non-idr slices Error while decoding frame 0 Obviously, playing the generated .h264 file in ffplay works, and I imagine that decoding to h264 was left out for a reason. I understand that I need to set up the decoder with the sps and pps nals before I can begin feeding it nals for the purposes of generating frames, but I only understand this conceptually. I could use some pointers as to where I need to put the proper initialization data so that I can begin decoding. Additionally, the doxygen for avcodec_open2 suggests that a dictionary structure can be used to... pass in parameters (to the codec I guess?), but is also used to enumerate the list of parameters that were not found?? (what does this mean?) Where can I find a list of parameters appropriate for the h264 codec, as something tells me this is what I would use to pass in the sps and pps nals? I appreciate any pointers or documentation that would help me work out what to do, thanks! -- Joshua Kordani LSA Autonomy -------------- next part -------------- An HTML attachment was scrubbed... URL: From cehoyos at ag.or.at Tue Mar 4 01:14:28 2014 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Tue, 4 Mar 2014 00:14:28 +0000 (UTC) Subject: [Libav-user] reduce dll size References: Message-ID: YIRAN LI writes: > I'm building ffmpeg dlls for Windows using MingW, and > the dlls I got seems quite large. libavcodec 8 MB and > libavformat 1.5 MB. This sounds like unstripped sizes, as explained you normally want stripped libraries (that are significantly smaller). If you don't need all decoders, use the configure option --disable-everything and enable the parts of FFmpeg you need (there are also --disable-encoders and friends, see configure --help). You may want to test the result of your configure line, note that for example some demuxers have dependencies that are not immediately obvious, and parsers are often needed. Note that combining libavcodec and libavformat into one library is not supported here, if you do it, please do not ask for support;-) (You may of course ask for support if your particular configure line does not work the way you need it: Just post it and tell us what doesn't work.) Carl Eugen From mrfun.china at gmail.com Tue Mar 4 02:22:49 2014 From: mrfun.china at gmail.com (YIRAN LI) Date: Tue, 4 Mar 2014 12:22:49 +1100 Subject: [Libav-user] reduce dll size In-Reply-To: References: Message-ID: Great thanks Carl, Could you also let me know how to strip the Windows dll, I have no experience on this :D. Of course I'll also try to work it out myself. Thanks 2014-03-04 11:14 GMT+11:00 Carl Eugen Hoyos : > YIRAN LI writes: > > > I'm building ffmpeg dlls for Windows using MingW, and > > the dlls I got seems quite large. libavcodec 8 MB and > > libavformat 1.5 MB. > > This sounds like unstripped sizes, as explained you > normally want stripped libraries (that are significantly > smaller). > If you don't need all decoders, use the configure option > --disable-everything and enable the parts of FFmpeg you > need (there are also --disable-encoders and friends, see > configure --help). > > You may want to test the result of your configure line, > note that for example some demuxers have dependencies > that are not immediately obvious, and parsers are often > needed. > > Note that combining libavcodec and libavformat into one > library is not supported here, if you do it, please do > not ask for support;-) > > (You may of course ask for support if your particular > configure line does not work the way you need it: Just > post it and tell us what doesn't work.) > > 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 i.like.privacy.too at gmail.com Tue Mar 4 05:24:39 2014 From: i.like.privacy.too at gmail.com (Camera Man) Date: Tue, 04 Mar 2014 06:24:39 +0200 Subject: [Libav-user] reduce dll size In-Reply-To: References: Message-ID: <53155587.7050905@gmail.com> On 03/04/2014 12:58 AM, YIRAN LI wrote: > Hi, > > I'm building ffmpeg dlls for Windows using MingW, and the dlls I got > seems quite large. libavcodec 8 MB and libavformat 1.5 MB. > > Firstly may I know, since ffmpeg is built into several dlls, is it > possible that same code got built into each dll so that there're > some unnecessary waste? Is it possible to build all code into > one dll? As far as I know there isn't really any waste, and while it is always possible to build everything into one dll, that is not supported by the existing configure/make system. If you configure to only use parts you need (decoders/encoders/parsers), the .dlls may be much smaller. However, if you care so much about distribution size, you are probably better off using static linking. You would still need to configure only the decoders/encoders you need. And you must also abide by the licenses of the code you use (e.g. libx264 is GPL, meaning that your software must be GPL if you use it; some ffmpeg is LGPL, meaning that if you do a static link you will need to LGPL your code as well). > Second, is there any option I can use to reduce the size of the > dlls? UPX is useful for this - both for .dlls and for .exes; though note that if you do use upx, then mutliple processes will not share their read-only memory sections -- e.g. if you have 40MB code (happens with some C++ code bases...), and you use UPX and run 10 copies, it will take 400MB of RAM; if you don't use UPX, that code will only take ~40MB of ram no matter how many copies you run. Do remember the license issues though. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mrfun.china at gmail.com Tue Mar 4 05:35:08 2014 From: mrfun.china at gmail.com (YIRAN LI) Date: Tue, 4 Mar 2014 15:35:08 +1100 Subject: [Libav-user] reduce dll size In-Reply-To: <53155587.7050905@gmail.com> References: <53155587.7050905@gmail.com> Message-ID: Thanks Camera Man, Do you know is there any options in configuration to let the ffmpeg make system strip for us? Thanks 2014-03-04 15:24 GMT+11:00 Camera Man : > On 03/04/2014 12:58 AM, YIRAN LI wrote: > > > > Hi, > > > > I'm building ffmpeg dlls for Windows using MingW, and the dlls I got > > seems quite large. libavcodec 8 MB and libavformat 1.5 MB. > > > > Firstly may I know, since ffmpeg is built into several dlls, is it > > possible that same code got built into each dll so that there're > > some unnecessary waste? Is it possible to build all code into > > one dll? > > > As far as I know there isn't really any waste, and while it is always > possible to build everything into one dll, that is not supported by the > existing configure/make system. > > > If you configure to only use parts you need (decoders/encoders/parsers), > the .dlls may be much smaller. However, if you care so much about > distribution size, you are probably better off using static linking. You > would still need to configure only the decoders/encoders you need. And you > must also abide by the licenses of the code you use (e.g. libx264 is GPL, > meaning that your software must be GPL if you use it; some ffmpeg is LGPL, > meaning that if you do a static link you will need to LGPL your code as > well). > > > > Second, is there any option I can use to reduce the size of the > > dlls? > > > UPX is useful for this - both for .dlls and for .exes; though note that if > you do use upx, then mutliple processes will not share their read-only > memory sections -- e.g. if you have 40MB code (happens with some C++ code > bases...), and you use UPX and run 10 copies, it will take 400MB of RAM; if > you don't use UPX, that code will only take ~40MB of ram no matter how many > copies you run. > > > Do remember the license issues though. > > > _______________________________________________ > 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 Tue Mar 4 10:09:24 2014 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Tue, 4 Mar 2014 09:09:24 +0000 (UTC) Subject: [Libav-user] reduce dll size References: <53155587.7050905@gmail.com> Message-ID: YIRAN LI writes: > Do you know is there any options in configuration > to let the ffmpeg make system strip for us? If you cannot call "strip" yourself, configure with --disable-debug Carl Eugen From mrfun.china at gmail.com Tue Mar 4 10:14:49 2014 From: mrfun.china at gmail.com (YIRAN LI) Date: Tue, 4 Mar 2014 20:14:49 +1100 Subject: [Libav-user] reduce dll size In-Reply-To: References: <53155587.7050905@gmail.com> Message-ID: Thanks Carl, I'll have a try! 2014-03-04 20:09 GMT+11:00 Carl Eugen Hoyos : > YIRAN LI writes: > > > Do you know is there any options in configuration > > to let the ffmpeg make system strip for us? > > If you cannot call "strip" yourself, configure > with --disable-debug > > Carl Eugen > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mrfun.china at gmail.com Tue Mar 4 10:24:57 2014 From: mrfun.china at gmail.com (YIRAN LI) Date: Tue, 4 Mar 2014 20:24:57 +1100 Subject: [Libav-user] reduce dll size In-Reply-To: References: <53155587.7050905@gmail.com> Message-ID: Sorry Carl, I think our dlls were built with --disable-debug on. Any way I'll have a try and check size difference with this option on and off. Thanks 2014-03-04 20:14 GMT+11:00 YIRAN LI : > Thanks Carl, I'll have a try! > > > 2014-03-04 20:09 GMT+11:00 Carl Eugen Hoyos : > > YIRAN LI writes: >> >> > Do you know is there any options in configuration >> > to let the ffmpeg make system strip for us? >> >> If you cannot call "strip" yourself, configure >> with --disable-debug >> >> 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 Tue Mar 4 12:21:12 2014 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Tue, 4 Mar 2014 11:21:12 +0000 (UTC) Subject: [Libav-user] reduce dll size References: <53155587.7050905@gmail.com> Message-ID: YIRAN LI writes: > I think our dlls were built with --disable-debug on. Yes, 8MB is the size of the stripped binary, the debug binaries would be several times as big. Sorry for the confusion. If you don't need all features of libavcodec, only enable the ones you need to get a smaller library. Please do not top-post here, Carl Eugen From mrfun.china at gmail.com Tue Mar 4 12:42:51 2014 From: mrfun.china at gmail.com (YIRAN LI) Date: Tue, 4 Mar 2014 22:42:51 +1100 Subject: [Libav-user] reduce dll size In-Reply-To: References: <53155587.7050905@gmail.com> Message-ID: 2014-03-04 22:21 GMT+11:00 Carl Eugen Hoyos : > YIRAN LI writes: > > > I think our dlls were built with --disable-debug on. > > Yes, 8MB is the size of the stripped binary, the > debug binaries would be several times as big. > Sorry for the confusion. > > If you don't need all features of libavcodec, only > enable the ones you need to get a smaller library. > > Please do not top-post here, Carl Eugen > > Sorry for top-post Carl, I've checked that ffmpeg build by default does strip. So since I've already disabled debug, there may not have many options to significantly reduce the dll size, unless I turn to build it with MSVC :( Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: From cehoyos at ag.or.at Tue Mar 4 13:06:48 2014 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Tue, 4 Mar 2014 12:06:48 +0000 (UTC) Subject: [Libav-user] reduce dll size References: <53155587.7050905@gmail.com> Message-ID: Camera Man writes: > some ffmpeg is LGPL, meaning that if you do a static > link you will need to LGPL your code as well This is not correct, you may of course use static linking and can still fulfill all requirements of the LGPL. (It may just be a little more complicated.) Or in other words: static or dynamic linking and LGPL are completely independent, in both cases, you have to give your users the option to update the library (FFmpeg). Carl Eugen From get2jils at gmail.com Tue Mar 4 13:52:44 2014 From: get2jils at gmail.com (whoami Jils) Date: Tue, 4 Mar 2014 18:22:44 +0530 Subject: [Libav-user] avformat_open_input difference between http:... and rtsp:/video Message-ID: HI all, Could someone explain what is the difference between using http:// , andrtsp:// My limited Iddea: HTTP protocol is used to get the streaming information first [ ie: where the streaming server is, what sort of protocol it supports, etc..], after than it connects through TCP/UDP to streaming server for data transfer. Correct me if i am wrong? -------------- next part -------------- An HTML attachment was scrubbed... URL: From mrfun.china at gmail.com Tue Mar 4 02:45:27 2014 From: mrfun.china at gmail.com (YIRAN LI) Date: Tue, 4 Mar 2014 12:45:27 +1100 Subject: [Libav-user] reduce dll size In-Reply-To: References: Message-ID: I did a strip in MingW and sizes only got a bit smaller. [image: ???? 1] 2014-03-04 12:22 GMT+11:00 YIRAN LI : > Great thanks Carl, > > Could you also let me know how to strip the Windows dll, I have no > experience on this :D. Of course I'll also try to work it out myself. > > Thanks > > > 2014-03-04 11:14 GMT+11:00 Carl Eugen Hoyos : > > YIRAN LI writes: >> >> > I'm building ffmpeg dlls for Windows using MingW, and >> > the dlls I got seems quite large. libavcodec 8 MB and >> > libavformat 1.5 MB. >> >> This sounds like unstripped sizes, as explained you >> normally want stripped libraries (that are significantly >> smaller). >> If you don't need all decoders, use the configure option >> --disable-everything and enable the parts of FFmpeg you >> need (there are also --disable-encoders and friends, see >> configure --help). >> >> You may want to test the result of your configure line, >> note that for example some demuxers have dependencies >> that are not immediately obvious, and parsers are often >> needed. >> >> Note that combining libavcodec and libavformat into one >> library is not supported here, if you do it, please do >> not ask for support;-) >> >> (You may of course ask for support if your particular >> configure line does not work the way you need it: Just >> post it and tell us what doesn't work.) >> >> 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: Capture.JPG Type: image/jpeg Size: 74516 bytes Desc: not available URL: From lorrai.m at gmail.com Tue Mar 4 13:11:53 2014 From: lorrai.m at gmail.com (Marco Lorrai) Date: Tue, 4 Mar 2014 13:11:53 +0100 Subject: [Libav-user] problems sending stream through network Message-ID: Hi all, I took the muxing.c example and modified it in order to send a stream through a network socket. I only made few modifications: main function now looks like: int main() { AVOutputFormat *fmt; AVFormatContext *oc; AVStream *audio_st, *video_st; AVCodec *audio_codec, *video_codec; double audio_time, video_time; int flush, ret; /* Initialize libavcodec, and register all codecs and formats. */ av_register_all(); avformat_network_init(); /* allocate the output media context */ avformat_alloc_output_context2(&oc, NULL, "mpegts", NULL); if (!oc) { printf("Could not deduce output format from file extension: using MPEG.\n"); avformat_alloc_output_context2(&oc, NULL, "mpegts", NULL); } if (!oc) return 1; fmt = oc->oformat; //fmt->video_codec = AV_CODEC_ID_MPEG2VIDEO; //fmt->audio_codec = AV_CODEC_ID_MP3; /* Add the audio and video streams using the default format codecs * and initialize the codecs. */ video_st = NULL; audio_st = NULL; if (fmt->video_codec != AV_CODEC_ID_NONE) video_st = add_stream(oc, &video_codec, fmt->video_codec); if (fmt->audio_codec != AV_CODEC_ID_NONE) audio_st = add_stream(oc, &audio_codec, fmt->audio_codec); /* Now that all the parameters are set, we can open the audio and * video codecs and allocate the necessary encode buffers. */ if (video_st) open_video(oc, video_codec, video_st); if (audio_st) open_audio(oc, audio_codec, audio_st); av_dump_format(oc, 0, "http://localhost:8090/feed1.ffm", 1); /* open the output file, if needed */ if (!(fmt->flags & AVFMT_NOFILE)) { ret = avio_open(&oc->pb, "http://localhost:8090/feed1.ffm", AVIO_FLAG_WRITE); if (ret < 0) { fprintf(stderr, "Could not open '%s': %s\n", " http://localhost:8090/feed1.ffm", av_err2str(ret)); return 1; } } /* Write the stream header, if any. */ ret = avformat_write_header(oc, NULL); if (ret < 0) { fprintf(stderr, "Error occurred when opening output file: %s\n", av_err2str(ret)); return 1; } flush = 0; while ((video_st && !video_is_eof) || (audio_st && !audio_is_eof)) { /* Compute current audio and video time. */ audio_time = (audio_st && !audio_is_eof) ? audio_st->pts.val * av_q2d(audio_st->time_base) : INFINITY; video_time = (video_st && !video_is_eof) ? video_st->pts.val * av_q2d(video_st->time_base) : INFINITY; if (!flush && (!audio_st || audio_time >= STREAM_DURATION) && (!video_st || video_time >= STREAM_DURATION)) { flush = 1; } /* write interleaved audio and video frames */ if (audio_st && !audio_is_eof && audio_time <= video_time) { write_audio_frame(oc, audio_st, flush); } else if (video_st && !video_is_eof && video_time < audio_time) { write_video_frame(oc, video_st, flush); } } /* Write the trailer, if any. The trailer must be written before you * close the CodecContexts open when you wrote the header; otherwise * av_write_trailer() may try to use memory that was freed on * av_codec_close(). */ av_write_trailer(oc); /* Close each codec. */ if (video_st) close_video(oc, video_st); if (audio_st) close_audio(oc, audio_st); if (!(fmt->flags & AVFMT_NOFILE)) /* Close the output file. */ avio_close(oc->pb); /* free the stream */ avformat_free_context(oc); return 0; } and, in order to avoid a warning about channel layout not specified, I added: c->channel_layout = av_get_default_channel_layout(c->channels); in function AVStream *add_stream(AVFormatContext *oc, AVCodec **codec, enum AVCodecID codec_id) just under the row c->channels = 2; I also raised a ffserver with the following configuration (showing only feed lines): File /tmp/feed1.ffm FileMaxSize 1GB ACL allow 127.0.0.1 ACL allow 192.168.0.0 192.168.255.255 ffserver is working fine if I feed it with a ffmpeg commandline, e.g: ffmpeg -r 25 -i movie.mp4 -acodec libfdk_aac -ab 128k -vcodec libx264 -fpre libx264-fast.ffpreset http://localhost:8090/feed1.ffm But with my example, I can write only few frames and after that may muxing modified program ends with: Error while writing audio frame: Connection reset by peer I tried also different codecs (h264) and format (flv), turning out in a different number of frames written, but eventually I got the same error above. ffserver do not reports errors at all, only write: Tue Mar 4 12:55:10 2014 127.0.0.1 - - [POST] "/feed1.ffm HTTP/1.1" 200 4096 confirming that the communication socket was open What I am missing?? Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: From grecd at yandex.ru Tue Mar 4 14:33:31 2014 From: grecd at yandex.ru (Michail Zhukov) Date: Tue, 04 Mar 2014 17:33:31 +0400 Subject: [Libav-user] Ip camera drawing on screen Message-ID: <8441393940011@web30h.yandex.ru> Hello! I'm using ffmpeg 1.2 to take video from ip camera.I make it draw on the screen, so I wonder if there is some event mechanism to to know if it is time to call av_read_frame? If I read frame not so frequent as the camera gives frames i get segmentation fault = on some malloc functions inside ffmpeg routines. From chisholm at mitre.org Wed Mar 5 00:42:29 2014 From: chisholm at mitre.org (Michael Chisholm) Date: Tue, 4 Mar 2014 18:42:29 -0500 Subject: [Libav-user] reduce dll size In-Reply-To: References: <53155587.7050905@gmail.com> Message-ID: <531664E5.5020808@mitre.org> On 3/4/2014 6:42 AM, YIRAN LI wrote: > 2014-03-04 22:21 GMT+11:00 Carl Eugen Hoyos : > >> YIRAN LI writes: >> >>> I think our dlls were built with --disable-debug on. >> >> Yes, 8MB is the size of the stripped binary, the >> debug binaries would be several times as big. >> Sorry for the confusion. >> >> If you don't need all features of libavcodec, only >> enable the ones you need to get a smaller library. >> >> Please do not top-post here, Carl Eugen >> >> Sorry for top-post Carl, > > I've checked that ffmpeg build by default does strip. So since I've already > disabled debug, there may not have many options > to significantly reduce the dll size, unless I turn to build it with MSVC :( > Just throwing this out there: I see a configure script param: --optflags=OPTFLAGS override optimization-related compiler flags You could tell the compiler to optimize for size rather than speed by using -Os [1]. The libs may not perform as well, but that's the tradeoff. I've never tried this, so I don't know how much of an effect it would make. Andy 1. http://gcc.gnu.org/onlinedocs/gcc-4.8.2/gcc/Optimize-Options.html#Optimize-Options From cehoyos at ag.or.at Wed Mar 5 10:47:15 2014 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Wed, 5 Mar 2014 09:47:15 +0000 (UTC) Subject: [Libav-user] reduce dll size References: <53155587.7050905@gmail.com> <531664E5.5020808@mitre.org> Message-ID: Michael Chisholm writes: > Just throwing this out there: I see a configure script param: > > --optflags=OPTFLAGS override optimization-related compiler flags > > You could tell the compiler to optimize for size rather than speed by > using -Os [1]. What is wrong with the configure option "--enable-small"? It does indeed save another 30%, thank you for reminding us! Carl Eugen From anshul.ffmpeg at gmail.com Wed Mar 5 12:07:40 2014 From: anshul.ffmpeg at gmail.com (anshul) Date: Wed, 05 Mar 2014 16:37:40 +0530 Subject: [Libav-user] Extract Closed caption interlaced in Userdata Message-ID: <5317057C.30107@gmail.com> Hi I am looking to extract Closed Caption interlaced in userdata Frame using libavcodec. just now ffprobe does not say any thing about closed caption when I do normal ffprobe (gdb) r -analyzeduration 100000000 -probesize 2000000000 ~/test_videos/test.ts Starting program: /home/anshul/Software/ffmpeg/ffprobe_g -analyzeduration 100000000 -probesize 2000000000 ~/test_videos/test.ts [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/libthread_db.so.1". ffprobe version N-61086-g9477512 Copyright (c) 2007-2014 the FFmpeg developers built on Mar 5 2014 12:53:35 with gcc 4.7 (SUSE Linux) configuration: --enable-libfaac --enable-libx264 --enable-memory-poisoning --enable-memalign-hack --enable-nonfree --enable-gpl --enable-libfreetype --disable-optimizations libavutil 52. 66.101 / 52. 66.101 libavcodec 55. 52.102 / 55. 52.102 libavformat 55. 33.101 / 55. 33.101 libavdevice 55. 11.100 / 55. 11.100 libavfilter 4. 2.100 / 4. 2.100 libswscale 2. 5.101 / 2. 5.101 libswresample 0. 18.100 / 0. 18.100 libpostproc 52. 3.100 / 52. 3.100 Input #0, mpegts, from '/home/anshul/test_videos/test.ts': Duration: 00:01:42.69, start: 1.433367, bitrate: 9901 kb/s Program 1 Metadata: service_name : Service01 service_provider: FFmpeg Stream #0:0[0x100]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002), yuv420p(tv), 1920x1080 [SAR 1:1 DAR 16:9], max. 80000 kb/s, 29.97 fps, 59.94 tbr, 90k tbn, 59.94 tbc As I have seen that ffprobe -show_frames get into function mpeg_decode_a53_cc and also in mpeg_field_start but I dont find any way to extract the AVFrameSideData in my program as i have copied the code snippet from mpeg_field_start where it save a53_caption but I dont know the way to extract the caption. 1639 if (s1->a53_caption) { 1640 AVFrameSideData *sd = av_frame_new_side_data( 1641 &s->current_picture_ptr->f, AV_FRAME_DATA_A53_CC, 1642 s1->a53_caption_size); 1643 if (sd) 1644 memcpy(sd->data, s1->a53_caption, s1->a53_caption_size); 1645 av_freep(&s1->a53_caption); 1646 } Thanks Anshul Maheshwari From chisholm at mitre.org Wed Mar 5 22:02:25 2014 From: chisholm at mitre.org (Michael Chisholm) Date: Wed, 5 Mar 2014 16:02:25 -0500 Subject: [Libav-user] reduce dll size In-Reply-To: References: <53155587.7050905@gmail.com> <531664E5.5020808@mitre.org> Message-ID: <531790E1.50205@mitre.org> On 3/5/2014 4:47 AM, Carl Eugen Hoyos wrote: > Michael Chisholm writes: > >> Just throwing this out there: I see a configure script param: >> >> --optflags=OPTFLAGS override optimization-related compiler flags >> >> You could tell the compiler to optimize for size rather than speed by >> using -Os [1]. > > What is wrong with the configure option "--enable-small"? > > It does indeed save another 30%, thank you for reminding > us! > > Carl Eugen > Whoops, I guess I was thinking in terms of compiler commandline options, so I naturally looked at the section where those are configured. One might even expect to find it in the "Optimization options" section... :) I should have just grepped instead of eyeballing the --help output. So it's even easier! Andy From mail654 at gmx.de Thu Mar 6 15:45:37 2014 From: mail654 at gmx.de (kragen) Date: Thu, 6 Mar 2014 14:45:37 +0000 (UTC) Subject: [Libav-user] gif extension isn't guessed with image2pipe Message-ID: Hi, A gif file isn't guessed any more after gif was removed from img_tags[] in img2.c. Below there is a sample which results in "codec_name=, codec_id=0" for a gif file. Other codecs listed in img_tags[] are detected correctly. Is this behaviour intended? I need to use image2pipe, because I need a custom AVIOContext. regards #include #include int main (int argc, char **argv) { av_register_all(); AVFormatContext *avFormat = avformat_alloc_context(); AVInputFormat *fmt = av_find_input_format("image2pipe"); avformat_open_input(&avFormat, "test.gif", fmt, NULL); printf("codec_name=%s, codec_id=%i\n", avFormat->streams[0]->codec->codec_name, avFormat->streams[0]->codec->codec_id); return 0; } From mrfun.china at gmail.com Fri Mar 7 02:58:28 2014 From: mrfun.china at gmail.com (YIRAN LI) Date: Fri, 7 Mar 2014 12:58:28 +1100 Subject: [Libav-user] reduce dll size In-Reply-To: <531790E1.50205@mitre.org> References: <53155587.7050905@gmail.com> <531664E5.5020808@mitre.org> <531790E1.50205@mitre.org> Message-ID: Hi All, I had a try on ffmpeg 2.0.1 with this options --disable-static --enable-shared --disable-doc --disable-ffmpeg --disable-ffplay --disable-ffprobe --disable-ffserver --disable-network --disable-avfilter --disable-avdevice --enable-small --enable-memalign-hack --disable-bsfs --disable-protocol=pipe --disable-bzlib --disable-devices --disable-filters --disable-iconv --disable-zlib --disable-debug and the dlls size are 5547801 Mar 7 10:19 ./ffmpeg/libavcodec/avcodec.dll 1397577 Mar 7 10:20 ./ffmpeg/libavformat/avformat.dll I manually striped them in MinGW and then size changed to 4804110 Mar 7 10:35 ./ffmpeg/libavcodec/avcodec.dll 1036814 Mar 7 10:36 ./ffmpeg/libavformat/avformat.dll I found that strip for libraries will only be called when 'make install' (I used to call make only, because I only need the dlls to run on Windows). So I called make install and then dlls were installed into /mingw/bin and they are exactly the same size as that achieved when I manually can strip. So, I guess 4804110 for avcodec and 1036814 for avformat may be the best we can get. Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: From jyavenard at gmail.com Fri Mar 7 09:03:00 2014 From: jyavenard at gmail.com (Jean-Yves Avenard) Date: Fri, 7 Mar 2014 19:03:00 +1100 Subject: [Libav-user] question about AVFormatContext::bit_rate Message-ID: Hi Trying to understand a misbehaviour of mine in an application I'm involved with. I have adaptative streaming code which makes some decision according to the field bit_rate in the AVFormatContext structure. According to the doc: "Total stream bitrate in bit/s, 0 if not available." I get very wierd value from there. Playing a SD mpeg2-ts stream (with one mpeg2 video stream, and a mp2 stereo audio stream); which I know is about 3.5Mbit/s (it's captured from a DVB-T adapter). bit_rate value is 756,000 ; so 756kbit/s That's incredibly low. Monitoring the network interface, it streams at an average rate of 3.4Mbit/s A 1080i mpeg2 stream, with an 5.1 AC3 channel (48KHz) shows up at 848kbit/s So the question becomes: what exactly does the value bit_rate represents? can we use it ? Thanks JY From nfxjfg at googlemail.com Fri Mar 7 10:13:50 2014 From: nfxjfg at googlemail.com (wm4) Date: Fri, 7 Mar 2014 10:13:50 +0100 Subject: [Libav-user] question about AVFormatContext::bit_rate In-Reply-To: References: Message-ID: <20140307101350.074ca36b@debian> On Fri, 7 Mar 2014 19:03:00 +1100 Jean-Yves Avenard wrote: > Hi > > Trying to understand a misbehaviour of mine in an application I'm involved with. > > I have adaptative streaming code which makes some decision according > to the field bit_rate in the AVFormatContext structure. > > According to the doc: > > "Total stream bitrate in bit/s, 0 if not available." > > I get very wierd value from there. As far as I know, this is only a bad guess, and usually inaccurate. Calculate it yourself, or try to improve it in libavformat/utils.c. From cehoyos at ag.or.at Fri Mar 7 11:37:49 2014 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Fri, 7 Mar 2014 10:37:49 +0000 (UTC) Subject: [Libav-user] reduce dll size References: <53155587.7050905@gmail.com> <531664E5.5020808@mitre.org> <531790E1.50205@mitre.org> Message-ID: YIRAN LI writes: > I had a try on ffmpeg 2.0.1 with this options Unrelated: 2.0.1 is not just old and unsupported, it contains known bugs (including security-relevant issues) that were fixed since. Please use current git head (or 2.2) which is still binary-compatible. > ? ?--disable-static > ? ?--enable-shared ? ?? > > ? ?--disable-doc ? ? ?? > ? ?--disable-ffmpeg ? ? > ? ?--disable-ffplay ? ? > ? ?--disable-ffprobe ?? > ? ?--disable-ffserver ? --disable-programs > ? ?--disable-network ?? > ? ?--disable-avfilter ? > > ? ?--disable-avdevice ? > ? ?--enable-small? > ? ?--enable-memalign-hack? Is this really needed? > ? ?--disable-bsfs? > ? ?--disable-protocol=pipe? > ? ?--disable-bzlib This affects some mkv files (not many). > ? ?--disable-devices > ? ?--disable-filters > ? ?--disable-iconv? > ? ?--disable-zlib This is not a good idea. > ? ?--disable-debug Does --disable-hwaccels make no difference? As said, you will get a massive reduction of the binary size by only enabling the features of lavc and lavf that you actually need. (Since you disable bzlib, you obviously don't need all features of lavf.) Carl Eugen From etrousset at awox.com Fri Mar 7 16:46:20 2014 From: etrousset at awox.com (Eric Trousset) Date: Fri, 7 Mar 2014 16:46:20 +0100 Subject: [Libav-user] Compiling under windows... Message-ID: Hi, I m quitte new to ffmpeg. I m trying to build it under windows using MSVC toolchain, but need to diable encoders and decoders. So I use the following configure param : ./configure --toolchain=msvc --prefix=/usr/local/ffmpeg-2.1.4-nocodecs-vs2013 --disable-decoders -disable-encoders --enable-shared I installed VS2013 express, and added the inttypes.h in the paths in INCLUDE. I was able to build a full featured version. But when using the previous options I get errors : $ make V=1 makedef libswresample/libswresample.ver libswresample/audioconvert.o libswresample/dither.o libswresample/log2_tab.o libswresample/rematrix.o libswresample/resample.o libswresample/swresample.o libswresample/x86/audio_convert.o libswresample/x86/rematrix.o libswresample/x86/swresample_x86.o > libswresample/swresample-0.def c99wrap link -dll -def:libswresample/swresample-0.def -implib:libswresample/swresample.lib -libpath:libavcodec -libpath:libavdevice -libpath:libavfilter -libpath:libavformat -libpath:libavresample -libpath:libavutil -libpath:libpostproc -libpath:libswscale -libpath:libswresample -nologo -debug -out libswresample/swresample-0.dll libswresample/audioconvert.o libswresample/dither.o libswresample/log2_tab.o libswresample/rematrix.o libswresample/resample.o libswresample/swresample.o libswresample/x86/audio_convert.o libswresample/x86/rematrix.o libswresample/x86/swresample_x86.o avutil.lib vfw32.lib user32.lib psapi.lib ole32.lib strmiids.lib uuid.lib ws2_32.lib psapi.lib advapi32.lib shell32.lib Creating library libswresample/swresample.lib and object libswresample/swresample.exp LINK : fatal error LNK1207: incompatible PDB format in 'c:\source_ext\ffmpeg-2.1.4\libswresample\swresample-0.pdb'; delete and rebuild make: *** [libswresample/swresample-0.dll] Error 1 etrousset at Madagascar /c/source_ext/ffmpeg-2.1.4 $ which link.exe /c/Program Files (x86)/Microsoft Visual Studio 12.0/VC/BIN/link.exe Any idea on how to fix this? Regards, Eric T. -------------- next part -------------- An HTML attachment was scrubbed... URL: From krueger at lesspain.de Fri Mar 7 17:54:26 2014 From: krueger at lesspain.de (=?UTF-8?Q?Robert_Kr=C3=BCger?=) Date: Fri, 7 Mar 2014 17:54:26 +0100 Subject: [Libav-user] deprecated pixel format used, make sure you did set range correctly Message-ID: Hi, you get this warning if you just decode a jpg and scale it using swscale. What would be the correct way to get rid of this warning? No longer use the YUVJ formats in the mjpeg decoder? Are there any plans regarding this? Regards, Robert From rhuang.work at gmail.com Fri Mar 7 18:15:12 2014 From: rhuang.work at gmail.com (Ricky Huang) Date: Fri, 7 Mar 2014 09:15:12 -0800 Subject: [Libav-user] Good libavfilter tutorial Message-ID: <590E1C7C-EAA1-4747-ADAD-2F5707E1CFA7@gmail.com> Hello all, I am new to libavfilter and I am currently learning how to develop my own filter for frame analysis. I am using this tutorial/guide, http://wiki.multimedia.cx/index.php?title=FFmpeg_filter_HOWTO, and it feels outdated being modified last on July 2010. The example it uses, vf_negatem, does not exist any more. Also the libavfilter documentation packaged in the ffmpeg source only describes what they are, now how to write one. Any pointers would be appreciated. Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: From nfxjfg at googlemail.com Fri Mar 7 18:42:30 2014 From: nfxjfg at googlemail.com (wm4) Date: Fri, 7 Mar 2014 18:42:30 +0100 Subject: [Libav-user] Good libavfilter tutorial In-Reply-To: <590E1C7C-EAA1-4747-ADAD-2F5707E1CFA7@gmail.com> References: <590E1C7C-EAA1-4747-ADAD-2F5707E1CFA7@gmail.com> Message-ID: <20140307184230.6f299ee4@debian> On Fri, 7 Mar 2014 09:15:12 -0800 Ricky Huang wrote: > Hello all, > > I am new to libavfilter and I am currently learning how to develop my own filter for frame analysis. I am using this tutorial/guide, http://wiki.multimedia.cx/index.php?title=FFmpeg_filter_HOWTO, and it feels outdated being modified last on July 2010. The example it uses, vf_negatem, does not exist any more. Also the libavfilter documentation packaged in the ffmpeg source only describes what they are, now how to write one. > > Any pointers would be appreciated. Thanks. > Extract the code from ffplay.c or ffmpeg_filter.c. From nfxjfg at googlemail.com Fri Mar 7 18:44:19 2014 From: nfxjfg at googlemail.com (wm4) Date: Fri, 7 Mar 2014 18:44:19 +0100 Subject: [Libav-user] deprecated pixel format used, make sure you did set range correctly In-Reply-To: References: Message-ID: <20140307184419.28217528@debian> On Fri, 7 Mar 2014 17:54:26 +0100 Robert Kr?ger wrote: > Hi, > > you get this warning if you just decode a jpg and scale it using > swscale. What would be the correct way to get rid of this warning? No > longer use the YUVJ formats in the mjpeg decoder? Are there any plans > regarding this? The YUVJ formats have been deprecated for years now. They _should_ be removed, but it hasn't happened set. (Yep, the situation is ridiculous.) For now, you can just either ignore the warning, or change the pixel format manually from YUVJ the the proper ones. But if you use swscale, you also have to be set the range yourself, or the result will be incorrect. From cehoyos at ag.or.at Fri Mar 7 18:42:18 2014 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Fri, 7 Mar 2014 17:42:18 +0000 (UTC) Subject: [Libav-user] Compiling under windows... References: Message-ID: Eric Trousset writes: > I m quitte new to ffmpeg. > I m trying to build it under windows using MSVC > toolchain, but need to disable encoders and decoders. (Out of curiosity: What are you planning to use the resulting binary for?) > So I use the following configure param : > ? > ./configure --toolchain=msvc > --prefix=/usr/local/ffmpeg-2.1.4-nocodecs-vs2013 > --disable-decoders ?disable-encoders --enable-shared Is the problem also reproducible if you don't disable any FFmpeg features? > LINK : fatal error LNK1207: incompatible PDB format in > 'c:\source_ext\ffmpeg-2.1.4\libswresample\swresample-0.pdb'; > delete and rebuild > make: *** [libswresample/swresample-0.dll] Error 1 Could you confirm that you run make distclean before configure? Carl Eugen From i.like.privacy.too at gmail.com Fri Mar 7 19:17:23 2014 From: i.like.privacy.too at gmail.com (Camera Man) Date: Fri, 07 Mar 2014 20:17:23 +0200 Subject: [Libav-user] reduce dll size In-Reply-To: References: <53155587.7050905@gmail.com> Message-ID: <531A0D33.3030104@gmail.com> An HTML attachment was scrubbed... URL: From i.like.privacy.too at gmail.com Fri Mar 7 19:20:16 2014 From: i.like.privacy.too at gmail.com (Camera Man) Date: Fri, 07 Mar 2014 20:20:16 +0200 Subject: [Libav-user] reduce dll size In-Reply-To: References: <53155587.7050905@gmail.com> Message-ID: <531A0DE0.1070007@gmail.com> [My thunderbird, despite repeat reconfiguration, insists on sending HTML unless I explicitly force it not to in every message - appologies if you can't read the previous HTML version. Guess it's time I upgrade to a newer Thunderbird] On 03/04/2014 06:35 AM, YIRAN LI wrote: > Thanks Camera Man, > > Do you know is there any options in configuration to let the ffmpeg make system strip for us? > I see you figured that out. But let me repeat: the smallest executable set (.dlls + .exe) is to use static linking - configure --enable-static --disable-shared to make sure that you don't link in any shared library by mistake. If you do that, everything you need will be inside your .exe and you will not need any of the ffmpeg av*.dll files. When I select just the parts I need (encoders, decoders, parser, etc), I can get down to 4MB static executable (that does not need any .dll and includes my own code as well as everything from ffmpeg that I need), and upx actually cuts that down to ~1MB. However, the license (LGPL) requires that you let user upgrade the library without your help. That is usually easy to achieve when you ship .dlls, but not as easy when you do static linking. If you use a GPL component (e.g. the x264 encoder), you will need to make your project GPL as well, which means releasing complete buildable sources of every executable you deliver, or at the very least making an offer to provide those. (Thanks to Carl Eugen Hoyos for correcting my earlier wrong statement about the LGPL - I had the GPL and LGPL confused). From u at pkh.me Fri Mar 7 22:33:48 2014 From: u at pkh.me (=?utf-8?B?Q2zDqW1lbnQgQsWTc2No?=) Date: Fri, 7 Mar 2014 22:33:48 +0100 Subject: [Libav-user] Good libavfilter tutorial In-Reply-To: <20140307184230.6f299ee4@debian> References: <590E1C7C-EAA1-4747-ADAD-2F5707E1CFA7@gmail.com> <20140307184230.6f299ee4@debian> Message-ID: <20140307213348.GA7127@leki.pkh.me> On Fri, Mar 07, 2014 at 06:42:30PM +0100, wm4 wrote: > On Fri, 7 Mar 2014 09:15:12 -0800 > Ricky Huang wrote: > > > Hello all, > > > > I am new to libavfilter and I am currently learning how to develop my own filter for frame analysis. I am using this tutorial/guide, http://wiki.multimedia.cx/index.php?title=FFmpeg_filter_HOWTO, and it feels outdated being modified last on July 2010. The example it uses, vf_negatem, does not exist any more. Also the libavfilter documentation packaged in the ffmpeg source only describes what they are, now how to write one. > > > > Any pointers would be appreciated. Thanks. > > > > Extract the code from ffplay.c or ffmpeg_filter.c. For writing a filter, the best way to do it is to actually look at existing filters. It really depends on the filter you actually want to write. Is it a simple one frame in, one frame out? If so you can look at simple filters like edgedetect. Also, since libavfilter is monolithic and you can basically only write filter for the library, feel free to ask on ffmpeg-devel at ffmpeg.org. -- Cl?ment B. -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 490 bytes Desc: not available URL: From jyavenard at gmail.com Sat Mar 8 09:31:57 2014 From: jyavenard at gmail.com (Jean-Yves Avenard) Date: Sat, 8 Mar 2014 19:31:57 +1100 Subject: [Libav-user] question about AVFormatContext::bit_rate In-Reply-To: <20140307101350.074ca36b@debian> References: <20140307101350.074ca36b@debian> Message-ID: Le vendredi 7 mars 2014, wm4 a ?crit : > On Fri, 7 Mar 2014 19:03:00 +1100 > > > I get very wierd value from there. > > As far as I know, this is only a bad guess, and usually inaccurate. > Calculate it yourself, or try to improve it in libavformat/utils.c. > > Hi Thanks for the response and the pointer I'll see what can be improved in there -------------- next part -------------- An HTML attachment was scrubbed... URL: From foerster at ifoerster.com Sun Mar 9 11:23:18 2014 From: foerster at ifoerster.com (Ingo Foerster) Date: Sun, 9 Mar 2014 11:23:18 +0100 Subject: [Libav-user] Ffmpeg compatiility problem Message-ID: <1253723654.20140309112318@ifoerster.com> Hello libav developers, my Name is Ingo and I'am new to ffmpeg and its mailing list. I overtake a project from another developer. This project is using ffmpeg libs. I have a problem with older ffmpeg, I hope it is ok to post this question here. If it is only dedicated to newest libs please let me know. Ok, my probelm: The project is using very old libs but I needed to update them to use Opus. However, I was able to update the ffmpeg libs to the release 1.08 "Angel". Everything works fine but all files bigger than 2 GB are damaged. Mediainfo shows no content. I think there is a bug with write_trailer on files bigger than 2 GB with this version but I cannot find any information about this problem. Currently I'am not able to use the 1.1.9 "Fire Flower" version because it is not compatible with the software. I will update this later. So anybody here who knows the problem in "Angel" with files bigger than 2 GB? And can give me a hint to find a patch or the git version I have to use to get a fixed version? (BTW: I use NTFS). Many thanks in advance. And myn thanks to the ffmpeg developers for this great software, Thanks, Ingo From cehoyos at ag.or.at Sun Mar 9 14:27:27 2014 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Sun, 9 Mar 2014 13:27:27 +0000 (UTC) Subject: [Libav-user] Ffmpeg compatiility problem References: <1253723654.20140309112318@ifoerster.com> Message-ID: Ingo Foerster writes: > I have a problem with older ffmpeg, I hope it > is ok to post this question here. If it is only > dedicated to newest libs please let me know. Only current FFmpeg git head is supported here. One exception would be if you want to report a regression (a bug that you found in an older version that is not reproducible in an ever older version). Iiuc, you have already verified that your problem is not reproducible with a newer version. Why don't you cherry-pick the commit that fixed your issue? Or do I misunderstand and the issue is reproducible with current git head? In this case, please explain how we can reproduce it. Carl Eugen From foerster at ifoerster.com Sun Mar 9 14:41:07 2014 From: foerster at ifoerster.com (Ingo Foerster) Date: Sun, 9 Mar 2014 14:41:07 +0100 Subject: [Libav-user] Ffmpeg compatiility problem In-Reply-To: References: <1253723654.20140309112318@ifoerster.com> Message-ID: <1205743413.20140309144107@ifoerster.com> Hello Carl Eugen Hoyos, many thanks for your answer. I do not know that only the newest git is supported here. Well, I do not understand this because until you offer older releases there have to be also some help. That a "official" release has a 2 GB error is not a small issue so I hoped to get some help or hint to find a patch or to find the GIT version that "fixed" this issue. The newest version is not useable for me, I use a own developed CUDA module that is not supported in the latest master build. There are too many changes in the API and threading of ffmpeg all the time that make it really difficult to update and upgrade. However, sorry that I posted the problem and question here, I will try to get somewhere else help. Regards, Ingo > Ingo Foerster writes: >> I have a problem with older ffmpeg, I hope it >> is ok to post this question here. If it is only >> dedicated to newest libs please let me know. > Only current FFmpeg git head is supported here. > One exception would be if you want to report a > regression (a bug that you found in an older > version that is not reproducible in an ever > older version). > Iiuc, you have already verified that your problem > is not reproducible with a newer version. Why > don't you cherry-pick the commit that fixed your > issue? > Or do I misunderstand and the issue is reproducible > with current git head? In this case, please explain > how we can reproduce it. > Carl Eugen > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user From etrousset at awox.com Mon Mar 10 09:23:02 2014 From: etrousset at awox.com (Eric Trousset) Date: Mon, 10 Mar 2014 09:23:02 +0100 Subject: [Libav-user] RE : Compiling under windows... In-Reply-To: References: , Message-ID: ________________________________________ De : libav-user-bounces at ffmpeg.org [libav-user-bounces at ffmpeg.org] de la part de Carl Eugen Hoyos [cehoyos at ag.or.at] Date d'envoi : vendredi 7 mars 2014 18:42 ? : libav-user at ffmpeg.org Objet : Re: [Libav-user] Compiling under windows... Eric Trousset writes: > I m quitte new to ffmpeg. > I m trying to build it under windows using MSVC > toolchain, but need to disable encoders and decoders. (Out of curiosity: What are you planning to use the resulting binary for?) To transmux medias > So I use the following configure param : > > ./configure --toolchain=msvc > --prefix=/usr/local/ffmpeg-2.1.4-nocodecs-vs2013 > --disable-decoders ?disable-encoders --enable-shared Is the problem also reproducible if you don't disable any FFmpeg features? If I disable no features, it builds fine > LINK : fatal error LNK1207: incompatible PDB format in > 'c:\source_ext\ffmpeg-2.1.4\libswresample\swresample-0.pdb'; > delete and rebuild > make: *** [libswresample/swresample-0.dll] Error 1 Could you confirm that you run make distclean before configure? Yes I did run distclean before configure Carl Eugen _______________________________________________ Libav-user mailing list Libav-user at ffmpeg.org http://ffmpeg.org/mailman/listinfo/libav-user From cehoyos at ag.or.at Mon Mar 10 14:31:07 2014 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Mon, 10 Mar 2014 13:31:07 +0000 (UTC) Subject: [Libav-user] Compiling under windows... References: , Message-ID: Eric Trousset writes: > > > I m trying to build it under windows using MSVC > > > toolchain, but need to disable encoders and decoders. > > > > (Out of curiosity: What are you planning to use the > > resulting binary for?) > > To transmux medias Note that some demuxers need some decoders to work correctly, so you may see problems. > > > So I use the following configure param : > > > > > > ./configure --toolchain=msvc > > > --prefix=/usr/local/ffmpeg-2.1.4-nocodecs-vs2013 > > > --disable-decoders ?disable-encoders --enable-shared > > > > Is the problem also reproducible if you don't > > disable any FFmpeg features? > > > > If I disable no features, it builds fine > > > > > LINK : fatal error LNK1207: incompatible PDB format in > > > 'c:\source_ext\ffmpeg-2.1.4\libswresample\swresample-0.pdb'; > > > delete and rebuild > > > make: *** [libswresample/swresample-0.dll] Error 1 > > > > Could you confirm that you run make distclean > > before configure? > > Yes I did run distclean before configure You could now test current FFmpeg git head or test if it works if you only provide --disable-encoders or only --disable-decoders. Please fix your quoting, your email is nearly unreadable. Carl Eugen From etrousset at awox.com Mon Mar 10 14:40:10 2014 From: etrousset at awox.com (Eric Trousset) Date: Mon, 10 Mar 2014 14:40:10 +0100 Subject: [Libav-user] Compiling under windows... In-Reply-To: References: , Message-ID: > -----Original Message----- > From: libav-user-bounces at ffmpeg.org [mailto:libav-user- > bounces at ffmpeg.org] On Behalf Of Carl Eugen Hoyos > Sent: lundi 10 mars 2014 14:31 > To: libav-user at ffmpeg.org > Subject: Re: [Libav-user] Compiling under windows... > > Eric Trousset writes: > > > > > I m trying to build it under windows using MSVC toolchain, but > > > > need to disable encoders and decoders. > > > > > > (Out of curiosity: What are you planning to use the resulting binary > > > for?) > > > > To transmux medias > > Note that some demuxers need some decoders to work correctly, so you > may see problems. > > > > > So I use the following configure param : > > > > > > > > ./configure --toolchain=msvc > > > > --prefix=/usr/local/ffmpeg-2.1.4-nocodecs-vs2013 > > > > --disable-decoders ?disable-encoders --enable-shared > > > > > > Is the problem also reproducible if you don't disable any FFmpeg > > > features? > > > > > > If I disable no features, it builds fine > > > > > > > LINK : fatal error LNK1207: incompatible PDB format in > > > > 'c:\source_ext\ffmpeg-2.1.4\libswresample\swresample-0.pdb'; > > > > delete and rebuild > > > > make: *** [libswresample/swresample-0.dll] Error 1 > > > > > > Could you confirm that you run make distclean before configure? > > > > Yes I did run distclean before configure > > You could now test current FFmpeg git head or test if it works if you only > provide --disable-encoders or only --disable-decoders. I already tried this with no success. I'll try the git head and let you know. > > Please fix your quoting, your email is nearly unreadable. Yes sorry for that, I was on the web client and couldn't figure out how to change the quoting. > > Carl Eugen > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user From cehoyos at ag.or.at Mon Mar 10 15:16:20 2014 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Mon, 10 Mar 2014 14:16:20 +0000 (UTC) Subject: [Libav-user] Compiling under windows... References: , Message-ID: Eric Trousset writes: > > > > > I m trying to build it under windows using > > > > > MSVC toolchain, but need to disable encoders > > > > > and decoders. > > > > > > > > (Out of curiosity: What are you planning to > > > > use the resulting binary for?) > > > > > > To transmux medias > > > > Note that some demuxers need some decoders to work > > correctly, so you may see problems. Just to make sure: Container formats are of course also patented. > > > > > LINK : fatal error LNK1207: incompatible PDB format in > > > > > 'c:\source_ext\ffmpeg-2.1.4\libswresample\swresample-0.pdb'; > > > > > delete and rebuild > > > > > make: *** [libswresample/swresample-0.dll] Error 1 > > > > > > > > Could you confirm that you run make distclean before configure? > > > > > > Yes I did run distclean before configure Just to make sure I understand correctly: The following works fine: $ make distclean $ ./configure --toolchain=msvc --enable-shared $ make ffmpeg.exe The following fails with an error when linking libswresample: $ make distclean $ ./configure --toolchain=msvc --enable-shared --disable-encoders $ make ffmpeg.exe And the same for this configure line: $ make distclean $ ./configure --toolchain=msvc --enable-shared --disable-deoders $ make ffmpeg.exe This is very difficult to understand... Carl Eugen From etrousset at awox.com Mon Mar 10 15:37:19 2014 From: etrousset at awox.com (Eric Trousset) Date: Mon, 10 Mar 2014 15:37:19 +0100 Subject: [Libav-user] Compiling under windows... In-Reply-To: References: , Message-ID: > -----Original Message----- > From: libav-user-bounces at ffmpeg.org [mailto:libav-user- > bounces at ffmpeg.org] On Behalf Of Carl Eugen Hoyos > Sent: lundi 10 mars 2014 15:16 > To: libav-user at ffmpeg.org > Subject: Re: [Libav-user] Compiling under windows... > > Eric Trousset writes: > > > > > > > I m trying to build it under windows using MSVC toolchain, but > > > > > > need to disable encoders and decoders. > > > > > > > > > > (Out of curiosity: What are you planning to use the resulting > > > > > binary for?) > > > > > > > > To transmux medias > > > > > > Note that some demuxers need some decoders to work correctly, so you > > > may see problems. > > Just to make sure: > Container formats are of course also patented. > > > > > > > LINK : fatal error LNK1207: incompatible PDB format in > > > > > > 'c:\source_ext\ffmpeg-2.1.4\libswresample\swresample-0.pdb'; > > > > > > delete and rebuild > > > > > > make: *** [libswresample/swresample-0.dll] Error 1 > > > > > > > > > > Could you confirm that you run make distclean before configure? > > > > > > > > Yes I did run distclean before configure > > Just to make sure I understand correctly: > The following works fine: > $ make distclean > $ ./configure --toolchain=msvc --enable-shared $ make ffmpeg.exe > > The following fails with an error when linking > libswresample: > $ make distclean > $ ./configure --toolchain=msvc --enable-shared --disable-encoders $ make > ffmpeg.exe > > And the same for this configure line: > $ make distclean > $ ./configure --toolchain=msvc --enable-shared --disable-deoders $ make > ffmpeg.exe > > This is very difficult to understand... Yes it was the case with ffmpeg 2.1.4, but it seems to work with git head files. Also for now I've only tried with nodecoders. > > Carl Eugen > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user From jason.j.blum at gmail.com Mon Mar 10 15:53:18 2014 From: jason.j.blum at gmail.com (Jason Blum) Date: Mon, 10 Mar 2014 10:53:18 -0400 Subject: [Libav-user] segmentation fault on avcodec_decode_video2( ) call Message-ID: Hello. I have been wrestling with a bug for a long while now. I'm new at this, so I figure it's coming from me, but I just can't find the issue. I am trying to decode the h264 video stream from an AR.Drone, but every time I call avcodec_decode_video2( ) my program immediately segfaults. I posted this on stack overflow in detail (includes link to source code, console output, and valgrind output): http://stackoverflow.com/questions/22161211/ar-drone-2-ffmpeg-avcodec-decode-video2-segmentation-fault The only response I received there doesn't seem relevant or helpful. Btw, if I use "codecContext->debug = true;", I get a segfault in a different avcodec library function call. I can post that valgrind output later as well, but I don't have access to it right now. Does anyone have any suggestions? I really don't want to abandon my c++ implementation of this. Thanks, Jason -------------- next part -------------- An HTML attachment was scrubbed... URL: From cehoyos at ag.or.at Mon Mar 10 16:01:42 2014 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Mon, 10 Mar 2014 15:01:42 +0000 (UTC) Subject: [Libav-user] =?utf-8?q?segmentation_fault_on_avcodec=5Fdecode=5Fv?= =?utf-8?q?ideo2=28_=29_call?= References: Message-ID: Jason Blum writes: > every time I call avcodec_decode_video2( ) my program > immediately segfaults. Run again with unstripped libavcodec and post backtrace or valgrind output here. Carl Eugen From get2jils at gmail.com Mon Mar 10 16:40:32 2014 From: get2jils at gmail.com (whoami Jils) Date: Mon, 10 Mar 2014 21:10:32 +0530 Subject: [Libav-user] avformat_open_input hangs, and found getaddrinfo fails. Message-ID: Hi all, I am trying the below: avformat_open_input(&pFormatCtx, "http:///myvideo.sdp", NULL, NULL) probably after 30 seconds, it returns the error AVERROR_INVALIDDATA , and found that getaddrinfo is failing. i am not sure if something to do with ffmepg?. I am trying in android platform. Kindly let know if there are any quirks i need to be aware of ? -------------- next part -------------- An HTML attachment was scrubbed... URL: From jason.j.blum at gmail.com Mon Mar 10 17:09:34 2014 From: jason.j.blum at gmail.com (Jason Blum) Date: Mon, 10 Mar 2014 12:09:34 -0400 Subject: [Libav-user] segmentation fault on avcodec_decode_video2( ) call In-Reply-To: References: Message-ID: Thanks for the quick reply. > Run again with unstripped libavcodec and post backtrace > or valgrind output here. Would I compile the unstripped libavcodec by changing the make file, removing the "-s" and then re-running make? Are there other optimization flags that I should turn off? I'll do this ASAP, but it won't be until the evening :/ Thanks, Jason On Mon, Mar 10, 2014 at 11:01 AM, Carl Eugen Hoyos wrote: > Jason Blum writes: > > > every time I call avcodec_decode_video2( ) my program > > immediately segfaults. > > Run again with unstripped libavcodec and post backtrace > or valgrind output here. > > Carl Eugen > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > -------------- next part -------------- An HTML attachment was scrubbed... URL: From cehoyos at ag.or.at Mon Mar 10 18:39:42 2014 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Mon, 10 Mar 2014 17:39:42 +0000 (UTC) Subject: [Libav-user] reduce dll size References: <53155587.7050905@gmail.com> <531A0D33.3030104@gmail.com> Message-ID: Camera Man writes: > However, the license (LGPL) requires that you let > user upgrade the library without your help. That is > usually easy to achieve when you ship .dlls, but > not as easy when you do static linking. If you use > a GPL component (e.g. the x264 encoder), you will > need to make your project GPL as well You are of course right that it is (slightly) easier to fullfill the LGPL if you provide dynamic libraries instead of linking static libraries but we agree that in both cases it is possible to fullfill the requirements. But I wonder now if there is a reason that your next sentence speaks about the GPL: Don't you agree that it makes no difference if you link GPL'd libraries statically or dynamically? Carl Eugen From donmoir at comcast.net Mon Mar 10 19:08:05 2014 From: donmoir at comcast.net (Don Moir) Date: Mon, 10 Mar 2014 14:08:05 -0400 Subject: [Libav-user] reduce dll size References: <53155587.7050905@gmail.com><531A0D33.3030104@gmail.com> Message-ID: <7689B9D93784488892DF0407837ECC9E@MANLAP> ----- Original Message ----- From: "Carl Eugen Hoyos" To: Sent: Monday, March 10, 2014 1:39 PM Subject: Re: [Libav-user] reduce dll size > Camera Man writes: > >> However, the license (LGPL) requires that you let >> user upgrade the library without your help. That is >> usually easy to achieve when you ship .dlls, but >> not as easy when you do static linking. If you use >> a GPL component (e.g. the x264 encoder), you will >> need to make your project GPL as well > > You are of course right that it is (slightly) easier > to fullfill the LGPL if you provide dynamic libraries > instead of linking static libraries but we agree that > in both cases it is possible to fullfill the > requirements. Kind of silly though to allow user to update the ffmpeg libraries. Every time I get new ffmpeg libraries I test it for quite a long time and not unusual to find something broken or something has changed that leads a break somewhere else. Don't know about you but things need to work for me and if user is just adhoc changing the libraries then that's a problem. > But I wonder now if there is a reason that your next > sentence speaks about the GPL: Don't you agree that it > makes no difference if you link GPL'd libraries > statically or dynamically? > > Carl Eugen > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user From rhuang.work at gmail.com Tue Mar 11 00:18:27 2014 From: rhuang.work at gmail.com (Ricky Huang) Date: Mon, 10 Mar 2014 16:18:27 -0700 Subject: [Libav-user] Help with unpacking PIX_FMT_YUV4* data types Message-ID: <232A9BE1-70F2-4E48-890A-EB41013CB983@gmail.com> Hello all, I am writing code that extracts the luminance component of an input video using my own custom filter in libavfilter - specifically I am extracting it from "PIX_FMT_YUV420P" a video and I am wondering how to go about doing so. According to the pixfmt.h header: > > PIX_FMT_YUV420P, ///< planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples) I am not sure how to interpret that. Assuming I am doing this in my draw_slice() function. It has the definition of: > > static void draw_slice(AVFilterLink *inlink, int y0, int h, int slice_dir) I know I can get to the input data plane by: > > AVFilterBufferRef *cur_pic = link->cur_buf; > uint8_t *data = cur_pic->data[0]; But there are multiple "planes" in the data. Does data[0], data[1], data[2] correspond to each of the Y, U, V channels? Also, once I am able to point my pointer at the correct coordinate, how should I interpret the extracted result (float, int, etc)? Thank you in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: From d3ck0r at gmail.com Tue Mar 11 00:28:36 2014 From: d3ck0r at gmail.com (J Decker) Date: Mon, 10 Mar 2014 16:28:36 -0700 Subject: [Libav-user] Help with unpacking PIX_FMT_YUV4* data types In-Reply-To: <232A9BE1-70F2-4E48-890A-EB41013CB983@gmail.com> References: <232A9BE1-70F2-4E48-890A-EB41013CB983@gmail.com> Message-ID: I would think you would just use 'sws_getContext' and 'sws_scale' worked good for me... On Mon, Mar 10, 2014 at 4:18 PM, Ricky Huang wrote: > Hello all, > > I am writing code that extracts the luminance component of an input video > using my own custom filter in libavfilter - specifically I am extracting it > from "PIX_FMT_YUV420P" a video and I am wondering how to go about doing so. > According to the pixfmt.h header: > > > PIX_FMT_YUV420P, ///< planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 > Y samples) > > > I am not sure how to interpret that. Assuming I am doing this in my > draw_slice() function. It has the definition of: > > > static void draw_slice(AVFilterLink *inlink, int y0, int h, int slice_dir) > > > I know I can get to the input data plane by: > > > AVFilterBufferRef *cur_pic = link->cur_buf; > uint8_t *data = cur_pic->data[0]; > > > But there are multiple "planes" in the data. Does data[0], data[1], > data[2] correspond to each of the Y, U, V channels? > > Also, once I am able to point my pointer at the correct coordinate, how > should I interpret the extracted result (float, int, etc)? > > > Thank you in advance. > > _______________________________________________ > 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 nfxjfg at googlemail.com Tue Mar 11 00:47:47 2014 From: nfxjfg at googlemail.com (wm4) Date: Tue, 11 Mar 2014 00:47:47 +0100 Subject: [Libav-user] Help with unpacking PIX_FMT_YUV4* data types In-Reply-To: <232A9BE1-70F2-4E48-890A-EB41013CB983@gmail.com> References: <232A9BE1-70F2-4E48-890A-EB41013CB983@gmail.com> Message-ID: <20140311004747.133d8fc6@debian> On Mon, 10 Mar 2014 16:18:27 -0700 Ricky Huang wrote: > Hello all, > > I am writing code that extracts the luminance component of an input video using my own custom filter in libavfilter - specifically I am extracting it from "PIX_FMT_YUV420P" a video and I am wondering how to go about doing so. According to the pixfmt.h header: > > > > PIX_FMT_YUV420P, ///< planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples) > > I am not sure how to interpret that. Assuming I am doing this in my draw_slice() function. It has the definition of: > > > > static void draw_slice(AVFilterLink *inlink, int y0, int h, int slice_dir) > > I know I can get to the input data plane by: > > > > AVFilterBufferRef *cur_pic = link->cur_buf; > > uint8_t *data = cur_pic->data[0]; I think this functionality was removed long ago. You're supposed to write/read AVFrames from the filters. > But there are multiple "planes" in the data. Does data[0], data[1], data[2] correspond to each of the Y, U, V channels? Yes, for YUV420P. > Also, once I am able to point my pointer at the correct coordinate, how should I interpret the extracted result (float, int, etc)? > > > Thank you in advance. From rhuang.work at gmail.com Tue Mar 11 02:11:47 2014 From: rhuang.work at gmail.com (Ricky Huang) Date: Mon, 10 Mar 2014 18:11:47 -0700 Subject: [Libav-user] Help with unpacking PIX_FMT_YUV4* data types In-Reply-To: References: <232A9BE1-70F2-4E48-890A-EB41013CB983@gmail.com> Message-ID: <9454F9A7-09B0-4A85-9860-843B9C193A82@gmail.com> On Mar 10, 2014, at 4:28 PM, J Decker wrote: > I would think you would just use 'sws_getContext' and 'sws_scale' > worked good for me... Thank you for the pointer. May I have a little more info regarding how you used sws_getContext()? I found its API definition as follows: struct SwsContext * sws_getContext (int srcW, int srcH, enum PixelFormat srcFormat, int dstW, int dstH, enum PixelFormat dstFormat, int flags, SwsFilter *srcFilter, SwsFilter *dstFilter, const double *param) and it allocates and returns a struct SwsContext*. In my case I am not modifying anything in my filter, why is this function good for me? (I am assuming this performs some kind of transformation because there's a source and destination). Also in the returned SwsContext struct, I see there are 4 members: int lumXInc int chrXInc int lumYInc int chrYInc perhaps this is where I can get the luminance? In that case, does it mean I have to perform some kind of transformation before even able to get the Context? Thank you for in advance for clarification. > On Mon, Mar 10, 2014 at 4:18 PM, Ricky Huang wrote: > Hello all, > > I am writing code that extracts the luminance component of an input video using my own custom filter in libavfilter - specifically I am extracting it from "PIX_FMT_YUV420P" a video and I am wondering how to go about doing so. According to the pixfmt.h header: >> >> PIX_FMT_YUV420P, ///< planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples) > > I am not sure how to interpret that. Assuming I am doing this in my draw_slice() function. It has the definition of: >> >> static void draw_slice(AVFilterLink *inlink, int y0, int h, int slice_dir) > > I know I can get to the input data plane by: >> >> AVFilterBufferRef *cur_pic = link->cur_buf; >> uint8_t *data = cur_pic->data[0]; > > But there are multiple "planes" in the data. Does data[0], data[1], data[2] correspond to each of the Y, U, V channels? > > Also, once I am able to point my pointer at the correct coordinate, how should I interpret the extracted result (float, int, etc)? > > > Thank you in advance. > > _______________________________________________ > 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 rhuang.work at gmail.com Tue Mar 11 02:32:54 2014 From: rhuang.work at gmail.com (Ricky Huang) Date: Mon, 10 Mar 2014 18:32:54 -0700 Subject: [Libav-user] Help with unpacking PIX_FMT_YUV4* data types In-Reply-To: <20140311004747.133d8fc6@debian> References: <232A9BE1-70F2-4E48-890A-EB41013CB983@gmail.com> <20140311004747.133d8fc6@debian> Message-ID: <54574FC0-B492-4E59-9C94-1FF4CDB16032@gmail.com> On Mar 10, 2014, at 4:47 PM, wm4 wrote: > On Mon, 10 Mar 2014 16:18:27 -0700 > Ricky Huang wrote: > >> Hello all, >> >> I am writing code that extracts the luminance component of an input video using my own custom filter in libavfilter - specifically I am extracting it from "PIX_FMT_YUV420P" a video and I am wondering how to go about doing so. According to the pixfmt.h header: >>> >>> PIX_FMT_YUV420P, ///< planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples) >> >> I am not sure how to interpret that. Assuming I am doing this in my draw_slice() function. It has the definition of: >>> >>> static void draw_slice(AVFilterLink *inlink, int y0, int h, int slice_dir) >> >> I know I can get to the input data plane by: >>> >>> AVFilterBufferRef *cur_pic = link->cur_buf; >>> uint8_t *data = cur_pic->data[0]; > > I think this functionality was removed long ago. You're supposed to > write/read AVFrames from the filters. Due to internal reasons, we are running ffmpeg 0.7, so the primary arguments to draw_slice() is AVFilterLink*. Sorry I should have specified that when asked the question. Or maybe I am missing something obvious here? Can you help me out with how to use AVFrame to extract the luminance component? >> But there are multiple "planes" in the data. Does data[0], data[1], data[2] correspond to each of the Y, U, V channels? > > Yes, for YUV420P. > >> Also, once I am able to point my pointer at the correct coordinate, how should I interpret the extracted result (float, int, etc)? >> >> >> Thank you in advance. > _______________________________________________ > 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 jkordani at lsa2.com Tue Mar 11 00:23:00 2014 From: jkordani at lsa2.com (Joshua Kordani) Date: Mon, 10 Mar 2014 19:23:00 -0400 Subject: [Libav-user] segmentation fault on avcodec_decode_video2( ) call In-Reply-To: References: Message-ID: <531E4954.80902@lsa2.com> On 3/10/14 12:09 PM, Jason Blum wrote: > Thanks for the quick reply. > > > Run again with unstripped libavcodec and post backtrace > > or valgrind output here. > > Would I compile the unstripped libavcodec by changing the make file, > removing the "-s" and then re-running make? Are there other > optimization flags that I should turn off? > > I'll do this ASAP, but it won't be until the evening :/ > > Thanks, > Jason > > You would rerun the configure call with the --disable-stripping flag and --enable-debug. with --enable-debug, the --help flag indicates that it accepts an =level, where level is simply text? appended to the -g flag passed to the assembler and compiler. so --enable-debug=gdb would create a compiler flag of -ggdb, if you needed to specify whatever it is that this specifies. I don't know if you need to leave it blank for -g, or remove the = sign, or if -g is default. If you want to reuse your old configure line, do a head of config.mak, and that will give you the last configure line that was run, so you can copy paste and add the new flags and go from there. -- Joshua Kordani LSA Autonomy -------------- next part -------------- An HTML attachment was scrubbed... URL: From i.like.privacy.too at gmail.com Tue Mar 11 04:45:29 2014 From: i.like.privacy.too at gmail.com (Camera Man) Date: Tue, 11 Mar 2014 05:45:29 +0200 Subject: [Libav-user] reduce dll size In-Reply-To: References: <53155587.7050905@gmail.com> <531A0D33.3030104@gmail.com> Message-ID: <531E86D9.7070104@gmail.com> On 03/10/2014 07:39 PM, Carl Eugen Hoyos wrote: > Camera Man writes: > >> However, the license (LGPL) requires that you let >> user upgrade the library without your help. That is >> usually easy to achieve when you ship .dlls, but >> not as easy when you do static linking. If you use >> a GPL component (e.g. the x264 encoder), you will >> need to make your project GPL as well > > But I wonder now if there is a reason that your next > sentence speaks about the GPL: Don't you agree that it > makes no difference if you link GPL'd libraries > statically or dynamically? Yes, I definitely agree - if the project is GPL, the linking (and in fact, binary form) shouldn't matter - the distribution should effectively (either directly, or by a direct immediate offer) include a buildable source. I specifically mentioned GPL in the context of the x264 encoder (which is GPL licensed) to emphasize that the earlier discussion about the LGPL of "just making it possible to replace the .dll" does NOT apply once GPL components are involved - and x264 is one such GPL component. Summary of my understanding: If only LGPL ("plain" ffmpeg, for example) code is involved, then the requirement is to let user update LGPL components on their own. One way to achieve that is to use the LGPL code in a .so/.dll which can be replaced (however, care must be taken to make this feasible - e.g., any changes applied to ffmpeg must be provided to the end user in source form). Once GPL code is involved (e.g. the libx264 encoder), then the requirement is for the user to be able to rebuild everything from source -- effectively, to provide complete usable source code for the entire project that uses said code, which must also be licensed under the GPL itself. I'm not a lawyer, and if one releases software, one should consult legal advice competent in copyrights and in the relevant jurisdiction. Carl, thanks for all the work on ffmpeg and the help you provide on the mailing list. From d3ck0r at gmail.com Tue Mar 11 04:53:47 2014 From: d3ck0r at gmail.com (J Decker) Date: Mon, 10 Mar 2014 20:53:47 -0700 Subject: [Libav-user] segmentation fault on avcodec_decode_video2( ) call In-Reply-To: <531E4954.80902@lsa2.com> References: <531E4954.80902@lsa2.com> Message-ID: Pass a 0 filled AVFrame buffer.... On Mon, Mar 10, 2014 at 4:23 PM, Joshua Kordani wrote: > On 3/10/14 12:09 PM, Jason Blum wrote: > > Thanks for the quick reply. > > > Run again with unstripped libavcodec and post backtrace > > or valgrind output here. > > Would I compile the unstripped libavcodec by changing the make file, > removing the "-s" and then re-running make? Are there other optimization > flags that I should turn off? > > I'll do this ASAP, but it won't be until the evening :/ > > Thanks, > Jason > > > You would rerun the configure call with the --disable-stripping flag and > --enable-debug. with --enable-debug, the --help flag indicates that it > accepts an =level, where level is simply text? appended to the -g flag > passed to the assembler and compiler. so --enable-debug=gdb would create a > compiler flag of -ggdb, if you needed to specify whatever it is that this > specifies. I don't know if you need to leave it blank for -g, or remove > the = sign, or if -g is default. > > If you want to reuse your old configure line, do a head of config.mak, and > that will give you the last configure line that was run, so you can copy > paste and add the new flags and go from there. > > -- > Joshua Kordani > LSA Autonomy > > > _______________________________________________ > 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 jason.j.blum at gmail.com Tue Mar 11 05:22:17 2014 From: jason.j.blum at gmail.com (Jason Blum) Date: Tue, 11 Mar 2014 00:22:17 -0400 Subject: [Libav-user] segmentation fault on avcodec_decode_video2( ) call In-Reply-To: <531E4954.80902@lsa2.com> References: <531E4954.80902@lsa2.com> Message-ID: > You would rerun the configure call with the --disable-stripping flag and > --enable-debug. I have been trying to do this for hours, but have been unsuccessful. I can compile the library into static library files (.a) without issue, but I cannot link to them. My compilation just completely ignores them. I've been searching for solutions for hours, like -static and such. Nothing works! Only the old shared .so libraries are recognized, using -lavcodec for example. So I think, well why don't I compile ffmpeg as shared. I use this: $ ./configure --enable-shared --enable-debug --disable-stripping Which leads to my next problem, the error message: LD libavcodec/libavcodec.so.55 /usr/bin/ld: libavcodec/mqc.o: relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC libavcodec/mqc.o: could not read symbols: Bad value collect2: error: ld returned 1 exit status make: *** [libavcodec/libavcodec.so.55] Error 1 So I attempt to use ./configure --enable-shared --enable-debug --disable-stripping --extra-cflags="-fPIC" and ./configure --enable-shared --enable-debug --disable-stripping --extra-cxxflags="-fPIC" But neither stop the error about fPIC from occurring. Any ideas? Thanks, Jason From jason.j.blum at gmail.com Tue Mar 11 05:25:38 2014 From: jason.j.blum at gmail.com (Jason Blum) Date: Tue, 11 Mar 2014 00:25:38 -0400 Subject: [Libav-user] segmentation fault on avcodec_decode_video2( ) call In-Reply-To: References: <531E4954.80902@lsa2.com> Message-ID: > Pass a 0 filled AVFrame buffer.... I tried setting the AVPkt to zero filled, but not the AVFrame. I'll give that a go once I get the debugging symbols back into the library and figure out how to link it. Thanks, Jason From jason.j.blum at gmail.com Tue Mar 11 05:38:50 2014 From: jason.j.blum at gmail.com (Jason Blum) Date: Tue, 11 Mar 2014 00:38:50 -0400 Subject: [Libav-user] segmentation fault on avcodec_decode_video2( ) call In-Reply-To: References: <531E4954.80902@lsa2.com> Message-ID: > Which leads to my next problem, the error message: > LD libavcodec/libavcodec.so.55 > /usr/bin/ld: libavcodec/mqc.o: relocation R_X86_64_32 against > `.rodata' can not be used when making a shared object; recompile with > -fPIC > libavcodec/mqc.o: could not read symbols: Bad value > collect2: error: ld returned 1 exit status > make: *** [libavcodec/libavcodec.so.55] Error 1 I just noticed the --enabled-pic option. Just tried ./configure --enable-shared --enable-debug --disable-stripping --disable-static --enable-pic but still get the same error. From d3ck0r at gmail.com Tue Mar 11 05:46:17 2014 From: d3ck0r at gmail.com (J Decker) Date: Mon, 10 Mar 2014 21:46:17 -0700 Subject: [Libav-user] Help with unpacking PIX_FMT_YUV4* data types In-Reply-To: <9454F9A7-09B0-4A85-9860-843B9C193A82@gmail.com> References: <232A9BE1-70F2-4E48-890A-EB41013CB983@gmail.com> <9454F9A7-09B0-4A85-9860-843B9C193A82@gmail.com> Message-ID: During Init..... file->pVideoFrameRGB = ffmpeg.av_frame_alloc(); { int num_bytes; #ifdef WIN32 #define PIX_FMT PIX_FMT_BGRA #else #define PIX_FMT PIX_FMT_RGBA #endif num_bytes = ffmpeg.avpicture_get_size(PIX_FMT, file->pVideoCodecCtx->width, file->pVideoCodecCtx->height); file->rgb_buffer = (_8 *)ffmpeg.av_malloc(num_bytes*sizeof(uint8_t)); ffmpeg.avpicture_fill((AVPicture*)file->pVideoFrameRGB, file->rgb_buffer, PIX_FMT , file->pVideoCodecCtx->width, file->pVideoCodecCtx->height); } file->img_convert_ctx = ffmpeg.sws_getContext(file->pVideoCodecCtx->width, file->pVideoCodecCtx->height , file->pVideoCodecCtx->pix_fmt , file->pVideoCodecCtx->width, file->pVideoCodecCtx->height , PIX_FMT, SWS_BICUBIC, NULL, NULL, NULL); // CDATA is _32 color data in my library, image surface is the raw out RGB CDATA *surface = GetImageSurface( out_surface ); ffmpeg.sws_scale(file->img_convert_ctx , (const uint8_t*const*)file->pVideoFrame->data, file->pVideoFrame->linesize , 0, file->pVideoCodecCtx->height , file->pVideoFrameRGB->data , file->pVideoFrameRGB->linesize); // depending on target platform, the image needs to be 'flipped' on output from the pVideoFrameRGB { #ifdef _INVERT_IMAGE int row; for( row = 0; row < file->pVideoFrame->height; row++ ) { memcpy( surface + ( file->pVideoFrame->height - row - 1 ) * file->pVideoFrame->width , file->rgb_buffer + row * sizeof(CDATA) * file->pVideoFrame->width, file->pVideoFrame->width * sizeof( CDATA ) ); } #else memcpy( surface , file->rgb_buffer , file->pVideoFrame->height * file->pVideoFrame->width * sizeof( CDATA ) ); #endif } // Output surface to display On Mon, Mar 10, 2014 at 6:11 PM, Ricky Huang wrote: > > On Mar 10, 2014, at 4:28 PM, J Decker wrote: > > I would think you would just use 'sws_getContext' and 'sws_scale' > worked good for me... > > > Thank you for the pointer. May I have a little more info regarding how > you used sws_getContext()? I found its API definition as follows: > > struct SwsContext * sws_getContext (int srcW, int srcH, > enum PixelFormat srcFormat, int dstW, int dstH, enum PixelFormat dstFormat, > int flags, SwsFilter *srcFilter, SwsFilter *dstFilter, const double *param) > > and it allocates and returns a struct SwsContext*. > > In my case I am not modifying anything in my filter, why is this function > good for me? (I am assuming this performs some kind of transformation > because there's a source and destination). Also in the returned SwsContext > struct, I see there are 4 members: > > int lumXInc > int chrXInc > int lumYInc > int chrYInc > > perhaps this is where I can get the luminance? In that case, does it mean > I have to perform some kind of transformation before even able to get the > Context? > > > Thank you for in advance for clarification. > > > > On Mon, Mar 10, 2014 at 4:18 PM, Ricky Huang wrote: > >> Hello all, >> >> I am writing code that extracts the luminance component of an input video >> using my own custom filter in libavfilter - specifically I am extracting it >> from "PIX_FMT_YUV420P" a video and I am wondering how to go about doing so. >> According to the pixfmt.h header: >> >> >> PIX_FMT_YUV420P, ///< planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per >> 2x2 Y samples) >> >> >> I am not sure how to interpret that. Assuming I am doing this in my >> draw_slice() function. It has the definition of: >> >> >> static void draw_slice(AVFilterLink *inlink, int y0, int h, int slice_dir) >> >> >> I know I can get to the input data plane by: >> >> >> AVFilterBufferRef *cur_pic = link->cur_buf; >> uint8_t *data = cur_pic->data[0]; >> >> >> But there are multiple "planes" in the data. Does data[0], data[1], >> data[2] correspond to each of the Y, U, V channels? >> >> Also, once I am able to point my pointer at the correct coordinate, how >> should I interpret the extracted result (float, int, etc)? >> >> >> Thank you in advance. >> >> _______________________________________________ >> 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 > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From cehoyos at ag.or.at Tue Mar 11 09:37:49 2014 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Tue, 11 Mar 2014 08:37:49 +0000 (UTC) Subject: [Libav-user] =?utf-8?q?segmentation_fault_on_avcodec=5Fdecode=5Fv?= =?utf-8?q?ideo2=28_=29_call?= References: <531E4954.80902@lsa2.com> Message-ID: Jason Blum writes: > $ ./configure --enable-shared --enable-debug --disable-stripping --enable-debug is the default, you can remove it. I like static linking for debugging, so I usually don't use --enable-shared, if you want shared libraries, you may also specify --disable-static > Which leads to my next problem, the error message: > LD libavcodec/libavcodec.so.55 > /usr/bin/ld: libavcodec/mqc.o: relocation R_X86_64_32 against > `.rodata' can not be used when making a shared object; > recompile with -fPIC Always run make distclean before a recompilation with different configure options. (And always run make distclean after a linking failure and try again.) Carl Eugen From etrousset at awox.com Tue Mar 11 10:03:45 2014 From: etrousset at awox.com (Eric Trousset) Date: Tue, 11 Mar 2014 10:03:45 +0100 Subject: [Libav-user] Compiling under windows... In-Reply-To: References: , Message-ID: Hi, Things work great with the head. Thx for the help, Eric T. > -----Original Message----- > From: libav-user-bounces at ffmpeg.org [mailto:libav-user- > bounces at ffmpeg.org] On Behalf Of Eric Trousset > Sent: lundi 10 mars 2014 15:37 > To: This list is about using libavcodec, libavformat, libavutil, libavdevice and > libavfilter. > Subject: Re: [Libav-user] Compiling under windows... > > > > > -----Original Message----- > > From: libav-user-bounces at ffmpeg.org [mailto:libav-user- > > bounces at ffmpeg.org] On Behalf Of Carl Eugen Hoyos > > Sent: lundi 10 mars 2014 15:16 > > To: libav-user at ffmpeg.org > > Subject: Re: [Libav-user] Compiling under windows... > > > > Eric Trousset writes: > > > > > > > > > I m trying to build it under windows using MSVC toolchain, > > > > > > > but need to disable encoders and decoders. > > > > > > > > > > > > (Out of curiosity: What are you planning to use the resulting > > > > > > binary for?) > > > > > > > > > > To transmux medias > > > > > > > > Note that some demuxers need some decoders to work correctly, so > > > > you may see problems. > > > > Just to make sure: > > Container formats are of course also patented. > > > > > > > > > LINK : fatal error LNK1207: incompatible PDB format in > > > > > > > 'c:\source_ext\ffmpeg-2.1.4\libswresample\swresample-0.pdb'; > > > > > > > delete and rebuild > > > > > > > make: *** [libswresample/swresample-0.dll] Error 1 > > > > > > > > > > > > Could you confirm that you run make distclean before configure? > > > > > > > > > > Yes I did run distclean before configure > > > > Just to make sure I understand correctly: > > The following works fine: > > $ make distclean > > $ ./configure --toolchain=msvc --enable-shared $ make ffmpeg.exe > > > > The following fails with an error when linking > > libswresample: > > $ make distclean > > $ ./configure --toolchain=msvc --enable-shared --disable-encoders $ > > make ffmpeg.exe > > > > And the same for this configure line: > > $ make distclean > > $ ./configure --toolchain=msvc --enable-shared --disable-deoders $ > > make ffmpeg.exe > > > > This is very difficult to understand... > > Yes it was the case with ffmpeg 2.1.4, but it seems to work with git head files. > Also for now I've only tried with nodecoders. > > > > > 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 foerster at ifoerster.com Tue Mar 11 10:26:57 2014 From: foerster at ifoerster.com (Ingo Foerster) Date: Tue, 11 Mar 2014 10:26:57 +0100 Subject: [Libav-user] List of FMT for available decoders Message-ID: <353705879.20140311102657@ifoerster.com> Hello, because many decoders act different, is there a list available for the FMT that each decoder is using? Thanks for help, Ingo From cehoyos at ag.or.at Tue Mar 11 10:49:46 2014 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Tue, 11 Mar 2014 09:49:46 +0000 (UTC) Subject: [Libav-user] List of FMT for available decoders References: <353705879.20140311102657@ifoerster.com> Message-ID: Ingo Foerster writes: > because many decoders act different, is there a list > available for the FMT that each decoder is using? (FMT is a little unclear imo.) If you mean the colour space and the raw audio format, then you can read AVCodecContext->pix_fmt and AVCodecContext->sample_fmt to get the format the decoder produced for your input. There is no "list" because afaict it wouldn't help you: The output format depends on the input you provide. (There are decoders for which you can specify a preferred output format, but this is very unusual, primarily used to stop libavcodec from decoding alpha planes if they aren't needed.) Carl Eugen From jkordani at lsa2.com Tue Mar 11 14:39:00 2014 From: jkordani at lsa2.com (Joshua Kordani) Date: Tue, 11 Mar 2014 09:39:00 -0400 Subject: [Libav-user] segmentation fault on avcodec_decode_video2( ) call In-Reply-To: References: <531E4954.80902@lsa2.com> Message-ID: <531F11F4.6000902@lsa2.com> On 3/11/14 12:22 AM, Jason Blum wrote: >> You would rerun the configure call with the --disable-stripping flag and >> --enable-debug. > I have been trying to do this for hours, but have been unsuccessful. > > I can compile the library into static library files (.a) without > issue, but I cannot link to them. My compilation just completely > ignores them. I've been searching for solutions for hours, like > -static and such. Nothing works! Only the old shared .so libraries are > recognized, using -lavcodec for example. > What do you mean, your compilation ignores them? -- Joshua Kordani LSA Autonomy -------------- next part -------------- An HTML attachment was scrubbed... URL: From foerster at ifoerster.com Tue Mar 11 14:45:02 2014 From: foerster at ifoerster.com (Ingo Foerster) Date: Tue, 11 Mar 2014 14:45:02 +0100 Subject: [Libav-user] List of FMT for available decoders In-Reply-To: References: <353705879.20140311102657@ifoerster.com> Message-ID: <1408031209.20140311144502@ifoerster.com> Hello Carl Eugen Hoyos, I'am sorry, my question was a little bit unclear written. What I ment is the Sample_fmt of the audioc codec, as sample: AV_SAMPLE_FMT_S16 There are many audio codecs available and it will be very helpful to have a list of the decoders and sample-fmt to write own converters. Regards, Ingo > Ingo Foerster writes: >> because many decoders act different, is there a list >> available for the FMT that each decoder is using? > (FMT is a little unclear imo.) > If you mean the colour space and the raw audio format, > then you can read AVCodecContext->pix_fmt and AVCodecContext->>sample_fmt to get the format the > decoder produced for your input. > There is no "list" because afaict it wouldn't help you: > The output format depends on the input you provide. > (There are decoders for which you can specify a > preferred output format, but this is very unusual, > primarily used to stop libavcodec from decoding alpha > planes if they aren't needed.) > Carl Eugen > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user From jason.j.blum at gmail.com Tue Mar 11 15:28:30 2014 From: jason.j.blum at gmail.com (Jason Blum) Date: Tue, 11 Mar 2014 10:28:30 -0400 Subject: [Libav-user] segmentation fault on avcodec_decode_video2( ) call In-Reply-To: <531F11F4.6000902@lsa2.com> References: <531E4954.80902@lsa2.com> <531F11F4.6000902@lsa2.com> Message-ID: > What do you mean, your compilation ignores them? Any time I specify libraries to link to (-lavcodec), it only recognizes the old .so libraries in my /usr/lib/x86_64-linux. In an IDE, if I specify the exact path of the new .a files, like /usr/local/lib/libavcodec.a, it has hundreds of undefined reference errors. I am also using include paths like /usr/local/include. Is there something special you have to do to link to a static library? I saw some people online say you need -static, but that didn't make a difference. I am new at this, so I could be missing something very simple. But when I searched online for responses to this problem, they were all very simple things, like accidentally leaving "lib" in a -l flag, and I'm not making that kind of mistake. My next step was to use the command line instead of the IDE so I could be 100% sure about what flags I'm feeding it. Thanks, Jason From jkordani at lsa2.com Tue Mar 11 16:04:03 2014 From: jkordani at lsa2.com (Joshua Kordani) Date: Tue, 11 Mar 2014 11:04:03 -0400 Subject: [Libav-user] segmentation fault on avcodec_decode_video2( ) call In-Reply-To: References: <531E4954.80902@lsa2.com> <531F11F4.6000902@lsa2.com> Message-ID: <531F25E3.9000404@lsa2.com> On 3/11/14 10:28 AM, Jason Blum wrote: >> What do you mean, your compilation ignores them? > Any time I specify libraries to link to (-lavcodec), it only > recognizes the old .so libraries in my /usr/lib/x86_64-linux. In an > IDE, if I specify the exact path of the new .a files, like > /usr/local/lib/libavcodec.a, it has hundreds of undefined reference > errors. I am also using include paths like /usr/local/include. Is > there something special you have to do to link to a static library? I > saw some people online say you need -static, but that didn't make a > difference. > > I am new at this, so I could be missing something very simple. But > when I searched online for responses to this problem, they were all > very simple things, like accidentally leaving "lib" in a -l flag, and > I'm not making that kind of mistake. > > My next step was to use the command line instead of the IDE so I could > be 100% sure about what flags I'm feeding it. > > Thanks, > Jason > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user At the end of the day, you need to direct your linker to find the libraries you want it to link with, there are options to add search paths to the linker call (or you could add the explicit path of each library), which you would use to point to your locally built version of the libraries. Once you do that and you get linker errors, paste those to pastebin and link here I guess. -- Joshua Kordani LSA Autonomy -------------- next part -------------- An HTML attachment was scrubbed... URL: From cehoyos at ag.or.at Tue Mar 11 17:44:00 2014 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Tue, 11 Mar 2014 16:44:00 +0000 (UTC) Subject: [Libav-user] List of FMT for available decoders References: <353705879.20140311102657@ifoerster.com> <1408031209.20140311144502@ifoerster.com> Message-ID: Ingo Foerster writes: > What I ment is the Sample_fmt of the audioc codec, > as sample: AV_SAMPLE_FMT_S16 Every decoder tells you what format it outputs in AVCodecContext->sample_fmt. Note that the format has changed in the past (without major bump) for given decoders, the API requires you to check the sample_fmt in your code. Please do not top-post here, it is considered rude. Carl Eugen From cehoyos at ag.or.at Tue Mar 11 18:26:04 2014 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Tue, 11 Mar 2014 17:26:04 +0000 (UTC) Subject: [Libav-user] List of FMT for available decoders References: <353705879.20140311102657@ifoerster.com> <1408031209.20140311144502@ifoerster.com> Message-ID: Ingo Foerster writes: > What I ment is the Sample_fmt of the audioc codec, > as sample: AV_SAMPLE_FMT_S16 > There are many audio codecs available and it will > be very helpful to have a list of the decoders > and sample-fmt The list of audio sample formats for each decoder is in AVCodec->sample_fmts but allow me to repeat that the output formats are expected to (possibly) change from revision to revision, you have to read sample_fmt. > to write own converters. I may misunderstand but you should really leave conversion to either the aresample filter or the libswresample library. Carl Eugen From rhuang.work at gmail.com Wed Mar 12 00:01:25 2014 From: rhuang.work at gmail.com (Ricky Huang) Date: Tue, 11 Mar 2014 16:01:25 -0700 Subject: [Libav-user] Help with unpacking PIX_FMT_YUV4* data types In-Reply-To: References: <232A9BE1-70F2-4E48-890A-EB41013CB983@gmail.com> <9454F9A7-09B0-4A85-9860-843B9C193A82@gmail.com> Message-ID: <8D84B60F-EE54-4FE6-AA77-6ABFD9AC8806@gmail.com> Hello J., Thank you for the sample code. From what I am able to understand from your code, you are - extracting the video frames out of the videos via ffmpeg.avpicture_fill() call - converting the image context from the original FMT to either FMT_BGRA or FMT_RGBA - sws_scale()'ing which performs the actual conversion (input/destination sizes are the same, what's change is the PIX_FMT) - perform the flip (or not) and output the image So what I am wondering is that I do not see anywhere in you code that unpacks the luminance component (Y channel in the original email). Are you suggesting I should convert YUV into RGB, then calculate the luminance value based on the RGB to luminance formula found here: http://stackoverflow.com/questions/596216/formula-to-determine-brightness-of-rgb-color? Thank you again! On Mar 10, 2014, at 9:46 PM, J Decker wrote: > During Init..... > > > file->pVideoFrameRGB = ffmpeg.av_frame_alloc(); > { > int num_bytes; > #ifdef WIN32 > #define PIX_FMT PIX_FMT_BGRA > #else > #define PIX_FMT PIX_FMT_RGBA > #endif > num_bytes = ffmpeg.avpicture_get_size(PIX_FMT, file->pVideoCodecCtx->width, file->pVideoCodecCtx->height); > file->rgb_buffer = (_8 *)ffmpeg.av_malloc(num_bytes*sizeof(uint8_t)); > ffmpeg.avpicture_fill((AVPicture*)file->pVideoFrameRGB, file->rgb_buffer, PIX_FMT > , file->pVideoCodecCtx->width, file->pVideoCodecCtx->height); > } > file->img_convert_ctx = ffmpeg.sws_getContext(file->pVideoCodecCtx->width, file->pVideoCodecCtx->height > , file->pVideoCodecCtx->pix_fmt > , file->pVideoCodecCtx->width, file->pVideoCodecCtx->height > , PIX_FMT, SWS_BICUBIC, NULL, NULL, NULL); > > > > // CDATA is _32 color data in my library, image surface is the raw out RGB > > CDATA *surface = GetImageSurface( out_surface ); > ffmpeg.sws_scale(file->img_convert_ctx > , (const uint8_t*const*)file->pVideoFrame->data, file->pVideoFrame->linesize > , 0, file->pVideoCodecCtx->height > , file->pVideoFrameRGB->data > , file->pVideoFrameRGB->linesize); > > // depending on target platform, the image needs to be 'flipped' on output from the pVideoFrameRGB > { > #ifdef _INVERT_IMAGE > int row; > for( row = 0; row < file->pVideoFrame->height; row++ ) > { > memcpy( surface + ( file->pVideoFrame->height - row - 1 ) * file->pVideoFrame->width > , file->rgb_buffer + row * sizeof(CDATA) * file->pVideoFrame->width, file->pVideoFrame->width * sizeof( CDATA ) ); > } > #else > memcpy( surface > , file->rgb_buffer , file->pVideoFrame->height * file->pVideoFrame->width * sizeof( CDATA ) ); > #endif > } > > > // Output surface to display > > > On Mon, Mar 10, 2014 at 6:11 PM, Ricky Huang wrote: > > On Mar 10, 2014, at 4:28 PM, J Decker wrote: > >> I would think you would just use 'sws_getContext' and 'sws_scale' >> worked good for me... > > Thank you for the pointer. May I have a little more info regarding how you used sws_getContext()? I found its API definition as follows: > > struct SwsContext * sws_getContext (int srcW, int srcH, enum PixelFormat srcFormat, int dstW, int dstH, enum PixelFormat dstFormat, int flags, SwsFilter *srcFilter, SwsFilter *dstFilter, const double *param) > > and it allocates and returns a struct SwsContext*. > > > In my case I am not modifying anything in my filter, why is this function good for me? (I am assuming this performs some kind of transformation because there's a source and destination). Also in the returned SwsContext struct, I see there are 4 members: > > int lumXInc > int chrXInc > int lumYInc > int chrYInc > > perhaps this is where I can get the luminance? In that case, does it mean I have to perform some kind of transformation before even able to get the Context? > > > Thank you for in advance for clarification. > > > >> On Mon, Mar 10, 2014 at 4:18 PM, Ricky Huang wrote: >> Hello all, >> >> I am writing code that extracts the luminance component of an input video using my own custom filter in libavfilter - specifically I am extracting it from "PIX_FMT_YUV420P" a video and I am wondering how to go about doing so. According to the pixfmt.h header: >>> >>> PIX_FMT_YUV420P, ///< planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples) >> >> I am not sure how to interpret that. Assuming I am doing this in my draw_slice() function. It has the definition of: >>> >>> static void draw_slice(AVFilterLink *inlink, int y0, int h, int slice_dir) >> >> I know I can get to the input data plane by: >>> >>> AVFilterBufferRef *cur_pic = link->cur_buf; >>> uint8_t *data = cur_pic->data[0]; >> >> But there are multiple "planes" in the data. Does data[0], data[1], data[2] correspond to each of the Y, U, V channels? >> >> Also, once I am able to point my pointer at the correct coordinate, how should I interpret the extracted result (float, int, etc)? >> >> >> Thank you in advance. >> >> _______________________________________________ >> 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From salsaman at gmail.com Wed Mar 12 00:43:52 2014 From: salsaman at gmail.com (salsaman) Date: Tue, 11 Mar 2014 20:43:52 -0300 Subject: [Libav-user] about avpriv_set_pts_info Message-ID: Hi, I was wondering what was the logic behind removing av_set_pts_info() function and using avpriv_set_pts_info() instead ? Is there another way to call this function without using avpriv ? This function is actually used in other projects and I would like to request that you kindly make available some public interface to this function. Regards, Salsaman. main developer, the LiVES project. http://lives.sourceforge.net https://www.ohloh.net/accounts/salsaman -------------- next part -------------- An HTML attachment was scrubbed... URL: From jason.j.blum at gmail.com Wed Mar 12 00:45:53 2014 From: jason.j.blum at gmail.com (Jason Blum) Date: Tue, 11 Mar 2014 19:45:53 -0400 Subject: [Libav-user] segmentation fault on avcodec_decode_video2( ) call In-Reply-To: <531F25E3.9000404@lsa2.com> References: <531E4954.80902@lsa2.com> <531F11F4.6000902@lsa2.com> <531F25E3.9000404@lsa2.com> Message-ID: > Once you do that and you get linker errors, paste those > to pastebin and link here I guess. The order of the linking makes a difference between the types of undefined reference errors that I'm getting. If I use: g++ -g -D__STDC_CONSTANT_MACROS -L/usr/local/lib/ -lswscale -lavformat -lavcodec main.cpp it results in the following: http://pastebin.com/LtJzA7Hj If I use: g++ main.cpp -g -D__STDC_CONSTANT_MACROS -L/usr/local/lib/ -lswscale -lavformat -lavcodec it results a 16000 line long error output too large for free PasteBin. The abridged version: http://pastebin.com/8dsv2pMY I don't really understand linking order issues, but I would have guessed at least one of the orders would have worked. If I don't include the -D__STDC_CONST_MACROS flag, one of the header files complains, so I think it is including the headers, which are in /usr/local/include. Any ideas what I'm missing? Thanks, Jason From nfxjfg at googlemail.com Wed Mar 12 01:03:25 2014 From: nfxjfg at googlemail.com (wm4) Date: Wed, 12 Mar 2014 01:03:25 +0100 Subject: [Libav-user] Help with unpacking PIX_FMT_YUV4* data types In-Reply-To: <54574FC0-B492-4E59-9C94-1FF4CDB16032@gmail.com> References: <232A9BE1-70F2-4E48-890A-EB41013CB983@gmail.com> <20140311004747.133d8fc6@debian> <54574FC0-B492-4E59-9C94-1FF4CDB16032@gmail.com> Message-ID: <20140312010325.60214cf8@debian> On Mon, 10 Mar 2014 18:32:54 -0700 Ricky Huang wrote: > >>> AVFilterBufferRef *cur_pic = link->cur_buf; > >>> uint8_t *data = cur_pic->data[0]; > > > > I think this functionality was removed long ago. You're supposed to > > write/read AVFrames from the filters. > > Due to internal reasons, we are running ffmpeg 0.7, so the primary arguments to draw_slice() is AVFilterLink*. Sorry I should have specified that when asked the question. Sure is ancient... > Or maybe I am missing something obvious here? Can you help me out with how to use AVFrame to extract the luminance component? AVFrame works similar to AVFilterBufferRef. Assuming the data member contains the plane pointers, data[0] will contain the plane with the luminance data. From nfxjfg at googlemail.com Wed Mar 12 01:05:28 2014 From: nfxjfg at googlemail.com (wm4) Date: Wed, 12 Mar 2014 01:05:28 +0100 Subject: [Libav-user] List of FMT for available decoders In-Reply-To: <353705879.20140311102657@ifoerster.com> References: <353705879.20140311102657@ifoerster.com> Message-ID: <20140312010528.136b6a13@debian> On Tue, 11 Mar 2014 10:26:57 +0100 Ingo Foerster wrote: > Hello, > > because many decoders act different, is there a list available for the > FMT that each decoder is using? That won't work. A decoder could change the format it outputs in the future, or it can even depend on the file. You'll either have to support _all_ documented formats, or you'll have to write all the boiler plate to use libswscale/libavresample to convert video/audio to the formats you support. From rhuang.work at gmail.com Wed Mar 12 01:55:34 2014 From: rhuang.work at gmail.com (Ricky Huang) Date: Tue, 11 Mar 2014 17:55:34 -0700 Subject: [Libav-user] Help with unpacking PIX_FMT_YUV4* data types In-Reply-To: <20140312010325.60214cf8@debian> References: <232A9BE1-70F2-4E48-890A-EB41013CB983@gmail.com> <20140311004747.133d8fc6@debian> <54574FC0-B492-4E59-9C94-1FF4CDB16032@gmail.com> <20140312010325.60214cf8@debian> Message-ID: <83CBBFFA-CD21-431B-A1CD-AE4525C90EC0@gmail.com> On Mar 11, 2014, at 5:03 PM, wm4 wrote: > On Mon, 10 Mar 2014 18:32:54 -0700 > Ricky Huang wrote: > >>>>> AVFilterBufferRef *cur_pic = link->cur_buf; >>>>> uint8_t *data = cur_pic->data[0]; >>> >>> I think this functionality was removed long ago. You're supposed to >>> write/read AVFrames from the filters. >> >> Due to internal reasons, we are running ffmpeg 0.7, so the primary arguments to draw_slice() is AVFilterLink*. Sorry I should have specified that when asked the question. > > Sure is ancient... > >> Or maybe I am missing something obvious here? Can you help me out with how to use AVFrame to extract the luminance component? > > AVFrame works similar to AVFilterBufferRef. Assuming the data member > contains the plane pointers, data[0] will contain the plane with the > luminance data. Thank you for responding, wm4. Let's use this from pixfmt.h header file as an example: PIX_FMT_YUV420P, ///< planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples) Does that mean I should read in the luminance plane 2 bytes at a time and interpret it as a number together? The reason I ask that is because the linesize of data[0] is twice as wide as data[1] or data[2] (720 vs 368 and 368, respectively). Also the data point is declared as "uint8_t *", how does one determine how to interpret the type of the value - int, float, etc? Thank you again! > _______________________________________________ > 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 foerster at ifoerster.com Wed Mar 12 02:11:26 2014 From: foerster at ifoerster.com (Ingo Foerster) Date: Wed, 12 Mar 2014 02:11:26 +0100 Subject: [Libav-user] Magic Realloc In-Reply-To: References: <353705879.20140311102657@ifoerster.com> <1408031209.20140311144502@ifoerster.com> Message-ID: <788060989.20140312021126@ifoerster.com> Hello, I updated to newest ffmpeg and now I run into a problem. It seems that ffmpeg do a magic realloc and so I get strange problems with the buffer. I use: unsigned char *bit_buffer; bit_buffer = (unsigned char *)av_malloc(2048 * 32 * 2 + FF_INPUT_BUFFER_PADDING_SIZE); bit_buffer_size = 2048 * 32; AVIOContext *avIO = avio_alloc_context(bit_buffer, bit_buffer_size, 0, cryPut, cryPut->read, NULL, NULL);//cryPut->seek); avIO->seekable = 0; input_file = avformat_alloc_context(); input_file->pb = avIO; int ret; if((ret = avformat_open_input(&input_file, "", NULL, NULL)) < 0) { char desc[1024]; int ret2 = av_strerror(ret, desc, 1024); return -1; } No I see in the stack that ffmpeg do a realloc. After this it is possible to free the buffer: if(bit_buffer) { av_free(bit_buffer); bit_buffer = NULL; } <--- Bad crash. So how act ffmpeg here? Normaly a realloc create a pointer to a pointer and handle the free/delete itself. But if I do not use av_free then I have a big memleak. Any idea? Thanks, Ingo From jason.j.blum at gmail.com Wed Mar 12 03:48:17 2014 From: jason.j.blum at gmail.com (Jason Blum) Date: Tue, 11 Mar 2014 22:48:17 -0400 Subject: [Libav-user] segmentation fault on avcodec_decode_video2( ) call In-Reply-To: References: <531E4954.80902@lsa2.com> <531F11F4.6000902@lsa2.com> <531F25E3.9000404@lsa2.com> Message-ID: > Any ideas what I'm missing? Running make distclean and then recompiling with --enable-shared worked. I now have .so libraries, and I can link those without any issue. I'm still in the dark about why I can't link to static .a libraries, but I'll look into that offline. One last compiling error remains: /tmp/ccfDAPSV.o:(.eh_frame+0x6b): undefined reference to `__gxx_personality_v0' In response to that I included the -lstdc++ flag: gcc main.cpp -o main -g -D__STDC_CONSTANT_MACROS -I/usr/local/include -L/usr/local/lib -lavcodec -lavformat -lswscale -lstdc++ This makes that error go away. Now I get another type of error entirely. ./main: error while loading shared libraries: libavcodec.so.55: cannot open shared object file: No such file or directory Forgot to use ldconfig after make install. Running ldconfig fixed that issue. (all of this is probably obvious to the more experienced, but I'm writing it out here for the possible benefit of others beginners seeking help like me) If I compile my code using g++ instead of gcc, the result has stack smashing errors. But if I use gcc as written above, the code seems to execute fine and no segmentation faults occur, though valgrind reports significant memory loss. I'll need to dig into why, unless someone knows off the top of their head. Making progress! Thanks for everyone's replies and help! -Jason From mtaha.ansari at gmail.com Wed Mar 12 08:33:01 2014 From: mtaha.ansari at gmail.com (Taha Ansari) Date: Wed, 12 Mar 2014 12:33:01 +0500 Subject: [Libav-user] Two-pass encoding example Message-ID: Hi, I want to do two pass encoding using FFmpeg libraries. Sample codes provided as documentation show encoding/decoding, muxing/demuxing etc., but the encoding process is single pass. I want to do/experiment with two-pass encoding. Is there some example/sample provided elsewhere? Thanks in advance! -------------- next part -------------- An HTML attachment was scrubbed... URL: From h.leppkes at gmail.com Wed Mar 12 08:54:58 2014 From: h.leppkes at gmail.com (Hendrik Leppkes) Date: Wed, 12 Mar 2014 08:54:58 +0100 Subject: [Libav-user] Magic Realloc In-Reply-To: <788060989.20140312021126@ifoerster.com> References: <353705879.20140311102657@ifoerster.com> <1408031209.20140311144502@ifoerster.com> <788060989.20140312021126@ifoerster.com> Message-ID: On Wed, Mar 12, 2014 at 2:11 AM, Ingo Foerster wrote: > Hello, > > I updated to newest ffmpeg and now I run into a problem. It seems that > ffmpeg do a magic realloc and so I get strange problems with the > buffer. > > I use: > > unsigned char *bit_buffer; > > bit_buffer = (unsigned char *)av_malloc(2048 * 32 * 2 + FF_INPUT_BUFFER_PADDING_SIZE); > bit_buffer_size = 2048 * 32; > > AVIOContext *avIO = avio_alloc_context(bit_buffer, bit_buffer_size, 0, cryPut, cryPut->read, NULL, NULL);//cryPut->seek); > avIO->seekable = 0; > > input_file = avformat_alloc_context(); > input_file->pb = avIO; > int ret; > if((ret = avformat_open_input(&input_file, "", NULL, NULL)) < 0) > { > char desc[1024]; > int ret2 = av_strerror(ret, desc, 1024); > return -1; > } > > No I see in the stack that ffmpeg do a realloc. After this it is > possible to free the buffer: if(bit_buffer) { av_free(bit_buffer); > bit_buffer = NULL; } <--- Bad crash. > > So how act ffmpeg here? Normaly a realloc create a pointer to a > pointer and handle the free/delete itself. But if I do not use av_free > then I have a big memleak. Any idea? > You can free avIO->buffer, it always points to the re-allocated version. Even saves you tracking of one variable. :) - Hendrik From marco_sie at web.de Wed Mar 12 10:54:20 2014 From: marco_sie at web.de (Silver) Date: Wed, 12 Mar 2014 02:54:20 -0700 (PDT) Subject: [Libav-user] Transcoding Decoding_Encoding to MP4/h264 - asynchron tracks In-Reply-To: <1392124265162-4659230.post@n4.nabble.com> References: <1392124265162-4659230.post@n4.nabble.com> Message-ID: <1394618060257-4659429.post@n4.nabble.com> Hello, i dont have a solution now, why my video files gets out of sync after 2-4mins. If you use the scrubbing tool or play and pause, it gets back to sync. I heard something that you have to set a sync point for a certain i-frame, for the encoder. Isn't this the pts? I mean Video 1-Frame doesnt mean it has the same length like 1 Audioframe, but if the pts/dts aren't correct should it be asynchron the entire clip? The weird thing is that it is sync for at least 1-3 min and so more you play, so more it gets asynchron. But still ... im confused why play/pause, scrubbing brings it back to sync. --- If im searching for sync points here... there are some attributes. ffmpeg source But i have no clue at all... what i can do. Any help possible? -- View this message in context: http://libav-users.943685.n4.nabble.com/Transcoding-Decoding-Encoding-to-MP4-h264-asynchron-tracks-tp4659230p4659429.html Sent from the libav-users mailing list archive at Nabble.com. From mtaha.ansari at gmail.com Wed Mar 12 11:45:57 2014 From: mtaha.ansari at gmail.com (Taha Ansari) Date: Wed, 12 Mar 2014 15:45:57 +0500 Subject: [Libav-user] Two-pass encoding example In-Reply-To: References: Message-ID: On Wed, Mar 12, 2014 at 12:33 PM, Taha Ansari wrote: > Hi, > > I want to do two pass encoding using FFmpeg libraries. Sample codes > provided as documentation show encoding/decoding, muxing/demuxing etc., but > the encoding process is single pass. I want to do/experiment with two-pass > encoding. Is there some example/sample provided elsewhere? > > Thanks in advance! > Hi everyone, Any pointers in this direction? -------------- next part -------------- An HTML attachment was scrubbed... URL: From marco_sie at web.de Wed Mar 12 12:39:27 2014 From: marco_sie at web.de (Silver) Date: Wed, 12 Mar 2014 04:39:27 -0700 (PDT) Subject: [Libav-user] Two-pass encoding example In-Reply-To: References: Message-ID: <1394624366919-4659431.post@n4.nabble.com> Hi, I don't know the Solution but there is a CODEC_FLAG_PASS2. You can look for it how it is used in ffmpeg Code or you search for it, maybe you will find a solution. https://ffmpeg.org/doxygen/trunk/ffmpeg_8c_source.html#l02255 Taha Ansari wrote > On Wed, Mar 12, 2014 at 12:33 PM, Taha Ansari < > mtaha.ansari@ > >wrote: > >> Hi, >> >> I want to do two pass encoding using FFmpeg libraries. Sample codes >> provided as documentation show encoding/decoding, muxing/demuxing etc., >> but >> the encoding process is single pass. I want to do/experiment with >> two-pass >> encoding. Is there some example/sample provided elsewhere? >> >> Thanks in advance! >> > > Hi everyone, > > Any pointers in this direction? > > _______________________________________________ > Libav-user mailing list > Libav-user@ > http://ffmpeg.org/mailman/listinfo/libav-user -- View this message in context: http://libav-users.943685.n4.nabble.com/Libav-user-Two-pass-encoding-example-tp4659427p4659431.html Sent from the libav-users mailing list archive at Nabble.com. From mtaha.ansari at gmail.com Wed Mar 12 14:01:52 2014 From: mtaha.ansari at gmail.com (Taha Ansari) Date: Wed, 12 Mar 2014 18:01:52 +0500 Subject: [Libav-user] Two-pass encoding example In-Reply-To: <1394624366919-4659431.post@n4.nabble.com> References: <1394624366919-4659431.post@n4.nabble.com> Message-ID: On Wed, Mar 12, 2014 at 4:39 PM, Silver wrote: > Hi, > > I don't know the Solution but there is a CODEC_FLAG_PASS2. > > You can look for it how it is used in ffmpeg Code or you search for it, > maybe you will find a solution. > https://ffmpeg.org/doxygen/trunk/ffmpeg_8c_source.html#l02255 > > > > That is a good direction - will try to dig from there, thanks!... > > > Taha Ansari wrote > > On Wed, Mar 12, 2014 at 12:33 PM, Taha Ansari < > > > mtaha.ansari@ > > > >wrote: > > > >> Hi, > >> > >> I want to do two pass encoding using FFmpeg libraries. Sample codes > >> provided as documentation show encoding/decoding, muxing/demuxing etc., > >> but > >> the encoding process is single pass. I want to do/experiment with > >> two-pass > >> encoding. Is there some example/sample provided elsewhere? > >> > >> Thanks in advance! > >> > > > > Hi everyone, > > > > Any pointers in this direction? > > > > _______________________________________________ > > Libav-user mailing list > > > Libav-user@ > > > http://ffmpeg.org/mailman/listinfo/libav-user > > > > > > -- > View this message in context: > http://libav-users.943685.n4.nabble.com/Libav-user-Two-pass-encoding-example-tp4659427p4659431.html > Sent from the libav-users mailing list archive at Nabble.com. > _______________________________________________ > 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 jkordani at lsa2.com Wed Mar 12 16:20:03 2014 From: jkordani at lsa2.com (Joshua Kordani) Date: Wed, 12 Mar 2014 11:20:03 -0400 Subject: [Libav-user] segmentation fault on avcodec_decode_video2( ) call In-Reply-To: References: <531E4954.80902@lsa2.com> <531F11F4.6000902@lsa2.com> <531F25E3.9000404@lsa2.com> Message-ID: <53207B23.70106@lsa2.com> On 3/11/14 7:45 PM, Jason Blum wrote: >> Once you do that and you get linker errors, paste those >> to pastebin and link here I guess. > The order of the linking makes a difference between the types of > undefined reference errors that I'm getting. > > If I use: > > g++ -g -D__STDC_CONSTANT_MACROS -L/usr/local/lib/ -lswscale -lavformat > -lavcodec main.cpp > > it results in the following: http://pastebin.com/LtJzA7Hj > > If I use: > > g++ main.cpp -g -D__STDC_CONSTANT_MACROS -L/usr/local/lib/ -lswscale > -lavformat -lavcodec > > it results a 16000 line long error output too large for free PasteBin. > The abridged version: http://pastebin.com/8dsv2pMY > > I don't really understand linking order issues, but I would have > guessed at least one of the orders would have worked. If I don't > include the -D__STDC_CONST_MACROS flag, one of the header files > complains, so I think it is including the headers, which are in > /usr/local/include. > > Any ideas what I'm missing? Compile the main.cpp into an object file first, and then, link order should be main.o and then all the libraries. I am not sure about the behavior of the compiler in this case and I think that it should "do the right thing", but to guarantee the proper linking order, build main into an object file, then link them all with main.o as the first in the list. When linking, the linker maintains a master symbol table as it reads in objects and libraries. Symbols from libraries are only included in the master symbol table if there have been prior references to them. Symbols from object files are included automatically. main.o will reference everything needed from the libraries. So a linker call with main.o followed by a pkg-config --libs ffmpeg (see below) should stand up the appropriate linker line. Refer to doc/examples/Makefile. Here, simple example programs are built against ffmpeg libraries. In this example, pkg-config is used to stand up the proper compiler and linker flags. I'll admit, I don't know where in this makefile the actual compiler call is made, but notice how the makefile builds a list of object filenames. In this makefile, pkg-config will find your systemwide installed .pc files, so if you wish to use locally built copy, .pc files are provided in a subdirectory of the installed location, and using pkg-config with an explicit path to these pc files "I believe" will let pkg-config stand up the args for your local ffmpeg libs. -- Joshua Kordani LSA Autonomy -------------- next part -------------- An HTML attachment was scrubbed... URL: From nfxjfg at googlemail.com Wed Mar 12 17:09:28 2014 From: nfxjfg at googlemail.com (wm4) Date: Wed, 12 Mar 2014 17:09:28 +0100 Subject: [Libav-user] Help with unpacking PIX_FMT_YUV4* data types In-Reply-To: <83CBBFFA-CD21-431B-A1CD-AE4525C90EC0@gmail.com> References: <232A9BE1-70F2-4E48-890A-EB41013CB983@gmail.com> <20140311004747.133d8fc6@debian> <54574FC0-B492-4E59-9C94-1FF4CDB16032@gmail.com> <20140312010325.60214cf8@debian> <83CBBFFA-CD21-431B-A1CD-AE4525C90EC0@gmail.com> Message-ID: <20140312170928.19c8453e@debian> On Tue, 11 Mar 2014 17:55:34 -0700 Ricky Huang wrote: > > On Mar 11, 2014, at 5:03 PM, wm4 wrote: > > > On Mon, 10 Mar 2014 18:32:54 -0700 > > Ricky Huang wrote: > > > >>>>> AVFilterBufferRef *cur_pic = link->cur_buf; > >>>>> uint8_t *data = cur_pic->data[0]; > >>> > >>> I think this functionality was removed long ago. You're supposed to > >>> write/read AVFrames from the filters. > >> > >> Due to internal reasons, we are running ffmpeg 0.7, so the primary arguments to draw_slice() is AVFilterLink*. Sorry I should have specified that when asked the question. > > > > Sure is ancient... > > > >> Or maybe I am missing something obvious here? Can you help me out with how to use AVFrame to extract the luminance component? > > > > AVFrame works similar to AVFilterBufferRef. Assuming the data member > > contains the plane pointers, data[0] will contain the plane with the > > luminance data. > > Thank you for responding, wm4. Let's use this from pixfmt.h header file as an example: > > PIX_FMT_YUV420P, ///< planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples) > > Does that mean I should read in the luminance plane 2 bytes at a time and interpret it as a number together? The reason I ask that is because the linesize of data[0] is twice as wide as data[1] or data[2] (720 vs 368 and 368, respectively). Also the data point is declared as "uint8_t *", how does one determine how to interpret the type of the value - int, float, etc? This format uses 1 byte per sample on each plane, so basically you'd access it as uint8_t. The linesizes of the two chroma planes are smaller, because YUV420P is a sub-sampled format, and, as the comment on the pixel format says, uses 1 chroma sample per 2x2 luminance sample. (Ignore the the mention of "12bpp", this is an average and is confusing at best.) So I guess you'll have to read up on how planar YUV formats work. Or just convert to RGB. (Using RGB might be more correct in some ways, because you don't have to deal with different colorspaces and color ranges etc..) From yoopercc at yahoo.com Wed Mar 12 22:59:53 2014 From: yoopercc at yahoo.com (yoopercc at yahoo.com) Date: Wed, 12 Mar 2014 14:59:53 -0700 (PDT) Subject: [Libav-user] encoding woes Message-ID: <1394661593.83244.YahooMailNeo@web160106.mail.bf1.yahoo.com> I work for a PBS affiliate and we recently started receiving files to play out on our Omneon system that we've been having problems converting. ?They're coming to us as a PCM wrapper in HD with Dolby. ?The problem files are .m2v video and a minimum of two .aiff AC3 audio files. ?We've been unable to convert them using iffmpeg front end trying various settings. ?Has anyone had any success working with anything like this? ?Is it possible to decode/encode these with ffmpeg? ?We don't have the budget to get the commercial hardware/software solutions. ?Thanks! -------------- next part -------------- An HTML attachment was scrubbed... URL: From cehoyos at ag.or.at Wed Mar 12 23:10:18 2014 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Wed, 12 Mar 2014 22:10:18 +0000 (UTC) Subject: [Libav-user] encoding woes References: <1394661593.83244.YahooMailNeo@web160106.mail.bf1.yahoo.com> Message-ID: writes: > We've been unable to convert them using iffmpeg > front end trying various settings. Failing command lines including the complete, uncut console output missing. Carl Eugen From ggarra13 at gmail.com Thu Mar 13 00:55:28 2014 From: ggarra13 at gmail.com (Gonzalo Garramuno) Date: Wed, 12 Mar 2014 20:55:28 -0300 Subject: [Libav-user] Probing a file Message-ID: <5320F3F0.1090207@gmail.com> I am wondering, in code, what's the most reliable way to probe a file to see if ffmpeg will open it. I can open a context and see the return value. However, this returns true for image formats like jpeg, png, and others and I find those handled better with other libraries. Is there a way to have ffmpeg test to open only video codecs with no image codecs. Currently the hack I have is: bool aviImage::test_filename( const char* buf ) { AVFormatContext* ctx = NULL; int error = avformat_open_input( &ctx, buf, NULL, NULL ); if ( ctx ) avformat_close_input( &ctx ); if ( error <= 0 ) return false; return true; } The error <= 0 line is intentional instead of just error < 0. This hack seems to avoid jpeg and others detection. From mrfun.china at gmail.com Thu Mar 13 02:23:53 2014 From: mrfun.china at gmail.com (YIRAN LI) Date: Thu, 13 Mar 2014 12:23:53 +1100 Subject: [Libav-user] How to build static libs for Windows Message-ID: Hi all, I'm looking for a way to generate ffmpeg static libs for Windows (not import .libs + dll) so that my application no longer needs dlls. If I configure with --enable-static --disable-shared, then I can only get .a files (compiled under both MinGW and VS2013). I'm not sure if these .a files can be used in VisualStudio, or is there any way I can generate standalone .libs? Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: From jason.j.blum at gmail.com Thu Mar 13 04:16:33 2014 From: jason.j.blum at gmail.com (Jason Blum) Date: Wed, 12 Mar 2014 23:16:33 -0400 Subject: [Libav-user] stack smash on return Message-ID: Still working on decoding the AR.Drone 2.0's h264 video stream. I am no longer getting the segmentation faults immediately upon calling avcodec_decode_video2(), but I am getting a stack smash termination when I exit my fetch_and_decode() function. The got_picture_ptr has been set to 1 and the function returns the size of the AVPacket I fed it. I free the AVPacket, then try to return from fetch_and_decode(), but it immediately terminates due to a stack smash. my latest source code: http://pastebin.com/XsZm5GVt the corresponding valgrind output: http://pastebin.com/pvpRcZUM I'm trying to follow the "demuxing_decoding.c" example in terms of what I need to do to avoid memory leaks and such. But I don't understand why the stack smash is happening as I return from a function rather than at some meat-and-potatoes array operation. Any ideas? Thanks, Jason From cehoyos at ag.or.at Thu Mar 13 07:55:05 2014 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Thu, 13 Mar 2014 06:55:05 +0000 (UTC) Subject: [Libav-user] =?utf-8?q?segmentation_fault_on_avcodec=5Fdecode=5Fv?= =?utf-8?q?ideo2=28_=29_call?= References: <531E4954.80902@lsa2.com> <531F11F4.6000902@lsa2.com> <531F25E3.9000404@lsa2.com> Message-ID: Jason Blum writes: > I'm still in the dark about why I can't link to static .a > libraries, but I'll look into that offline. Just put your static libraries on the compile line of your own program just like you would put an object file there: $ gcc main.cpp -o main -g -D__STDC_CONSTANT_MACROS /path/to/libavformat.a /path/to/libavcodec.a ... > This makes that error go away. Now I get another > type of error entirely. > ./main: error while loading shared libraries: > libavcodec.so.55: cannot open shared object file: > No such file or directory The above also fixes this problem, the alternative is to fix LD_LIBRARY_PATH. Carl Eugen From cehoyos at ag.or.at Thu Mar 13 07:57:57 2014 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Thu, 13 Mar 2014 06:57:57 +0000 (UTC) Subject: [Libav-user] Probing a file References: <5320F3F0.1090207@gmail.com> Message-ID: Gonzalo Garramuno writes: > I can open a context and see the return value. However, > this returns true for image formats like jpeg, png, and > others and I find those handled better with other libraries. Then remove image2 from your libavformat compilation. What problems did you find with FFmpeg's jpeg or png implementation? Note that we are very interested in such reports! Carl Eugen From cehoyos at ag.or.at Thu Mar 13 12:54:34 2014 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Thu, 13 Mar 2014 11:54:34 +0000 (UTC) Subject: [Libav-user] stack smash on return References: Message-ID: Jason Blum writes: > I am getting a stack smash termination > when I exit my fetch_and_decode() function. valgrind should help with such problems. Carl Eugen From ggarra13 at gmail.com Thu Mar 13 16:00:31 2014 From: ggarra13 at gmail.com (Gonzalo Garramuno) Date: Thu, 13 Mar 2014 12:00:31 -0300 Subject: [Libav-user] Probing a file In-Reply-To: References: <5320F3F0.1090207@gmail.com> Message-ID: <5321C80F.9040604@gmail.com> On 13/03/14 03:57, Carl Eugen Hoyos wrote: > Gonzalo Garramuno writes: > >> I can open a context and see the return value. However, >> this returns true for image formats like jpeg, png, and >> others and I find those handled better with other libraries. > Then remove image2 from your libavformat compilation. I can do that easily for Linux but for Windows I'd have to set up the whole compilation thingy instead of relying on zeranoe. > What problems did you find with FFmpeg's jpeg or png > implementation? Note that we are very interested in > such reports! > > Carl Eugen There's the lack of EXIF support and when used in my application, only the first frame was loaded and the ending of the sequence was set to 1. I was unable to read the other frames. From nfxjfg at googlemail.com Thu Mar 13 16:12:59 2014 From: nfxjfg at googlemail.com (wm4) Date: Thu, 13 Mar 2014 16:12:59 +0100 Subject: [Libav-user] Probing a file In-Reply-To: References: <5320F3F0.1090207@gmail.com> Message-ID: <20140313161259.158fa4a0@debian> On Thu, 13 Mar 2014 06:57:57 +0000 (UTC) Carl Eugen Hoyos wrote: > What problems did you find with FFmpeg's jpeg or png > implementation? Note that we are very interested in > such reports! It probes only by filename? From nfxjfg at googlemail.com Thu Mar 13 16:15:05 2014 From: nfxjfg at googlemail.com (wm4) Date: Thu, 13 Mar 2014 16:15:05 +0100 Subject: [Libav-user] Probing a file In-Reply-To: <5320F3F0.1090207@gmail.com> References: <5320F3F0.1090207@gmail.com> Message-ID: <20140313161505.09ac48ed@debian> On Wed, 12 Mar 2014 20:55:28 -0300 Gonzalo Garramuno wrote: > I am wondering, in code, what's the most reliable way to probe a file to > see if ffmpeg will open it. I can open a context and see the return > value. However, this returns true for image formats like jpeg, png, and > others and I find those handled better with other libraries. Is there a > way to have ffmpeg test to open only video codecs with no image codecs. > Currently the hack I have is: Personally I just use av_probe_input_format2() and accept the result only if it's at least "AVPROBE_SCORE_MAX / 4 + 1", which is documented as the recommended limit. I also don't set the filename, so no extension matching is performed. (Although I do a second pass with filename set, but only after I run my own image format checks.) From soho123.2012 at gmail.com Thu Mar 13 17:01:35 2014 From: soho123.2012 at gmail.com (Diaz Soho) Date: Fri, 14 Mar 2014 00:01:35 +0800 Subject: [Libav-user] fixed point decoder Message-ID: Hi All, is it possible to use fixed-point for aac decoder in libav? Any input was appreciated !!!! -------------- next part -------------- An HTML attachment was scrubbed... URL: From ggarra13 at gmail.com Thu Mar 13 17:13:29 2014 From: ggarra13 at gmail.com (Gonzalo Garramuno) Date: Thu, 13 Mar 2014 13:13:29 -0300 Subject: [Libav-user] Probing a file In-Reply-To: <20140313161505.09ac48ed@debian> References: <5320F3F0.1090207@gmail.com> <20140313161505.09ac48ed@debian> Message-ID: <5321D929.1020002@gmail.com> On 13/03/14 12:15, wm4 wrote: > Personally I just use av_probe_input_format2() and accept the result > only if it's at least "AVPROBE_SCORE_MAX / 4 + 1", which is documented > as the recommended limit. I also don't set the filename, so no > extension matching is performed. (Although I do a second pass with > filename set, but only after I run my own image format checks.) Oh, that works SO nicely. I had missed that function completely. Thanks a lot! From marco_sie at web.de Thu Mar 13 18:01:48 2014 From: marco_sie at web.de (Silver) Date: Thu, 13 Mar 2014 10:01:48 -0700 (PDT) Subject: [Libav-user] Transcoding Decoding_Encoding to MP4/h264 - asynchron tracks In-Reply-To: <1394618060257-4659429.post@n4.nabble.com> References: <1392124265162-4659230.post@n4.nabble.com> <1394618060257-4659429.post@n4.nabble.com> Message-ID: <1394730108074-4659448.post@n4.nabble.com> Can i somehow prevent this video/audio sync drift? I'm going back to Zero... is there a way to narrow it down? Im done with Trial and Error... if such oldschool mail list can't help me... is there some other place where i can look? It seems People are rar with some insight and KnowHow? I started to read different things.. and somehow i feel that this whole time_base,pts/dts, keyframes has something to do with it. Is there no Bulding-Plan? Step A, Step B, Step C? http://www.ttcdas.com/products/daus_encoders/pdf/_tech_papers/tp_2010_time_stamp_video_system.pdf http://en.wikipedia.org/wiki/MPEG_transport_stream I use the avcodec libs which comes from ffmpeg 1.2.4. What is the different between 1.2 and 2.1 ffmpeg? Because it makes such a huge jump 1.2 -> 2.0, instead 1.3,1.4,.... is it somewhere explained? Maybe i found it already and forgot it... Should i try the new avcodec libs from 2.1 ? Im a Newbie i totally have no clue.. ----- totally agree: [offtopic] http://ffmpeg.org/pipermail/libav-user/2013-April/004304.html [/offtopic] Silver wrote > Hello, > > i dont have a solution now, why my video files gets out of sync after > 2-4mins. > If you use the scrubbing tool or play and pause, it gets back to sync. > > I heard something that you have to set a sync point for a certain i-frame, > for the encoder. > Isn't this the pts? I mean Video 1-Frame doesnt mean it has the same > length like 1 Audioframe, but if the pts/dts aren't correct should it be > asynchron the entire clip? The weird thing is that it is sync for at least > 1-3 min and so more you play, so more it gets asynchron. > > But still ... im confused why play/pause, scrubbing brings it back to > sync. > --- > > If im searching for sync points here... there are some attributes. > ffmpeg source > > > But i have no clue at all... what i can do. > Any help possible? -- View this message in context: http://libav-users.943685.n4.nabble.com/Transcoding-Decoding-Encoding-to-MP4-h264-asynchron-tracks-tp4659230p4659448.html Sent from the libav-users mailing list archive at Nabble.com. From foerster at ifoerster.com Fri Mar 14 00:45:25 2014 From: foerster at ifoerster.com (Ingo Foerster) Date: Fri, 14 Mar 2014 00:45:25 +0100 Subject: [Libav-user] RAW AAC encoding In-Reply-To: References: <1394661593.83244.YahooMailNeo@web160106.mail.bf1.yahoo.com> Message-ID: <36300680.20140314004525@ifoerster.com> Hello, after some issues I have updated to the latest master. But now RAW AAC encoding fails. Is it possible that FFmpeg do not support RAW AAC encoding anymore? Thanks, Ingo From cehoyos at ag.or.at Fri Mar 14 07:27:15 2014 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Fri, 14 Mar 2014 06:27:15 +0000 (UTC) Subject: [Libav-user] RAW AAC encoding References: <1394661593.83244.YahooMailNeo@web160106.mail.bf1.yahoo.com> <36300680.20140314004525@ifoerster.com> Message-ID: Ingo Foerster writes: > after some issues I have updated to the latest master. > But now RAW AAC encoding fails. Is it possible > that FFmpeg do not support RAW AAC encoding anymore? Please test ffmpeg (the application) for an answer. Please: Do not highjack threads. Do not top-post. If you believe this is not explained on https://ffmpeg.org/contact.html please tell us! Carl Eugen From stephen at napkinstudio.com Fri Mar 14 14:34:31 2014 From: stephen at napkinstudio.com (Stephen H. Gerstacker) Date: Fri, 14 Mar 2014 09:34:31 -0400 Subject: [Libav-user] Timing Issues Only With Windows Media Player Message-ID: I?m constructing a video file from pre-encoded packets. Video is H.264, Audio is AAC, and the container is MP4. As an example, I have: - 20 seconds of video - 10 seconds of audio, starting at 5 seconds in. I?m checking PTSs and writing with av_write_frame in the proper order. The resulting file works great in VLC and QuickTime, but if I open the video in Windows Media Player, that audio starts playing immediately. Everything else about the audio is fine, it just starts at the wrong time. Any idea on why this would be happening? Is there a proper way to push audio in to a video file that doesn?t start immediately? I?ve also tried av_interleaved_write_frame, but that didn?t change anything. - Stephen From nfxjfg at googlemail.com Fri Mar 14 16:49:28 2014 From: nfxjfg at googlemail.com (wm4) Date: Fri, 14 Mar 2014 16:49:28 +0100 Subject: [Libav-user] Timing Issues Only With Windows Media Player In-Reply-To: References: Message-ID: <20140314164928.3d5e4505@debian> On Fri, 14 Mar 2014 09:34:31 -0400 "Stephen H. Gerstacker" wrote: > I?m constructing a video file from pre-encoded packets. Video is H.264, Audio is AAC, and the container is MP4. > > As an example, I have: > - 20 seconds of video > - 10 seconds of audio, starting at 5 seconds in. > > I?m checking PTSs and writing with av_write_frame in the proper order. The resulting file works great in VLC and QuickTime, but if I open the video in Windows Media Player, that audio starts playing immediately. Everything else about the audio is fine, it just starts at the wrong time. > > Any idea on why this would be happening? Is there a proper way to push audio in to a video file that doesn?t start immediately? > > I?ve also tried av_interleaved_write_frame, but that didn?t change anything. For starters, does windows media player even allow audio to start at a different time? If so, you could e.g. take a "working" file and compare it with a ffmpeg produced file. From vagrawal at aptina.com Thu Mar 13 11:11:53 2014 From: vagrawal at aptina.com (Vishal Agrawal) Date: Thu, 13 Mar 2014 10:11:53 +0000 Subject: [Libav-user] How to add frames in every x second Message-ID: <46FD3D1F71B9DB44995C27CF28562B5701CB72@PSJMBX1.aptina.com> Hi Sir/Mam, I have an application(in windows) in which we stream video from the Camera at run time. Now I would like to record this streaming in mp4 format. How can I record mp4 file using FFmpeg. FYI: I get the things upto find_encoder, now How I will append the frames to file. Framerate is 30. Any help from your side will be appreciated. I f this ques is already been asked by somebody else, you can link me with that answer.. Thanks & Regards, Vishal Aptina India Private Limited / Frontline Grandeur, 14 Walton Road, Bangalore - 560001, India. This e-mail and any attachments contain confidential information and are solely for the review and use of the intended recipient. If you have received this e-mail in error, please notify the sender and destroy this e-mail and any copies. -------------- next part -------------- An HTML attachment was scrubbed... URL: From stephen at napkinstudio.com Fri Mar 14 19:16:48 2014 From: stephen at napkinstudio.com (Stephen H. Gerstacker) Date: Fri, 14 Mar 2014 14:16:48 -0400 Subject: [Libav-user] Timing Issues Only With Windows Media Player In-Reply-To: <20140314164928.3d5e4505@debian> References: <20140314164928.3d5e4505@debian> Message-ID: <3BFE8E52-38A2-475C-AC51-70A815CA93DC@napkinstudio.com> That?s more to the question. Is there a ?proper? way to create an MP4 / H.264 / AAC file? I wrote some code to inject empty audio frames at the very beginning of the audio stream, which seems to help, but I had to restructure a lot of code to get it there. Am I missing a flag of the stream? the container? Oddly enough, once the audio stream is initially padded, it?s fine. So I can have: - 20 seconds of video - 5 second audio pause, 5 second audio, 5 second pause, 5 second audio The second audio part plays at the proper time, so it just seems like the initial audio padding is just needed. I have similar code on the Mac side using AVFoundation and their encoder seems to push in empty audio packets. - Stephen On Mar 14, 2014, at 11:49 AM, wm4 wrote: > On Fri, 14 Mar 2014 09:34:31 -0400 > "Stephen H. Gerstacker" wrote: > >> I?m constructing a video file from pre-encoded packets. Video is H.264, Audio is AAC, and the container is MP4. >> >> As an example, I have: >> - 20 seconds of video >> - 10 seconds of audio, starting at 5 seconds in. >> >> I?m checking PTSs and writing with av_write_frame in the proper order. The resulting file works great in VLC and QuickTime, but if I open the video in Windows Media Player, that audio starts playing immediately. Everything else about the audio is fine, it just starts at the wrong time. >> >> Any idea on why this would be happening? Is there a proper way to push audio in to a video file that doesn?t start immediately? >> >> I?ve also tried av_interleaved_write_frame, but that didn?t change anything. > > For starters, does windows media player even allow audio to start at a > different time? If so, you could e.g. take a "working" file and compare > it with a ffmpeg produced file. > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user From donmoir at comcast.net Fri Mar 14 20:26:30 2014 From: donmoir at comcast.net (Don Moir) Date: Fri, 14 Mar 2014 15:26:30 -0400 Subject: [Libav-user] Timing Issues Only With Windows Media Player References: <20140314164928.3d5e4505@debian> Message-ID: ----- Original Message ----- From: "wm4" To: Sent: Friday, March 14, 2014 11:49 AM Subject: Re: [Libav-user] Timing Issues Only With Windows Media Player > On Fri, 14 Mar 2014 09:34:31 -0400 > "Stephen H. Gerstacker" wrote: > >> I?m constructing a video file from pre-encoded packets. Video is H.264, Audio is AAC, and the container is MP4. >> >> As an example, I have: >> - 20 seconds of video >> - 10 seconds of audio, starting at 5 seconds in. >> >> I?m checking PTSs and writing with av_write_frame in the proper order. The resulting file works great in VLC and QuickTime, but >> if I open the video in Windows Media Player, that audio starts playing immediately. Everything else about the audio is fine, it >> just starts at the wrong time. >> >> Any idea on why this would be happening? Is there a proper way to push audio in to a video file that doesn?t start immediately? >> >> I?ve also tried av_interleaved_write_frame, but that didn?t change anything. > > For starters, does windows media player even allow audio to start at a > different time? If so, you could e.g. take a "working" file and compare > it with a ffmpeg produced file. I think it may be whatever codec is installed for playback of that file type and could be just installing a different codec pak or whatever could fix it. Codec packs can be a mess though and ffmpeg removes that nonsense if used for playback. It is totally up to the player though either directly or indirectly to handle the time offsets of audio and video that might occur. WMP may or may not have anything to do with it. You should be able to tell though what is being used (codec pak) for playback or if it's a format that is internal to WMP. From get2jils at gmail.com Mon Mar 17 17:50:19 2014 From: get2jils at gmail.com (whoami Jils) Date: Mon, 17 Mar 2014 22:20:19 +0530 Subject: [Libav-user] Unable to set UDP timeout for av_read_frame () . It goes with default value of 20 seconds. Message-ID: Hi i follow below step to set UDP socket timeout of 5 seconds. AVDictionary *stream_opts = 0; av_dict_set(&stream_opts, "timeout", 3000000) // in microseconds. avformat_open_input ( &myContext, "timeout = strtol(buf, NULL, 10); 606 h->rw_timeout = s->timeout; *I am unable to locate the interesting part of where UDP socket is configured with h->rw_timeout ?* -------------- next part -------------- An HTML attachment was scrubbed... URL: From nfxjfg at googlemail.com Mon Mar 17 18:10:07 2014 From: nfxjfg at googlemail.com (wm4) Date: Mon, 17 Mar 2014 18:10:07 +0100 Subject: [Libav-user] Unable to set UDP timeout for av_read_frame () . It goes with default value of 20 seconds. In-Reply-To: References: Message-ID: <20140317181007.375688a1@debian> On Mon, 17 Mar 2014 22:20:19 +0530 whoami Jils wrote: > Hi > > i follow below step to set UDP socket timeout of 5 seconds. > > AVDictionary *stream_opts = 0; > av_dict_set(&stream_opts, "timeout", 3000000) // in microseconds. > avformat_open_input ( &myContext, " Greetings all. I have a bitstream consisting of just idr and p frames, (nals type 5 and 1). How do I present them in the AVPacket being fed to the decode call? [7 8 5] [7 8 5 1] [7 8 5 1 1]... or [7 8 5] [1] [1] [1] [1] Do I prepend startcodes to the [1] buffer? If I see a new idr frame, do I need to present [7 8 5] again? or just [5]? Any documentation I can read that describes how this should be done in general, at least with h264? Thanks all -- Joshua Kordani LSA Autonomy -------------- next part -------------- An HTML attachment was scrubbed... URL: From get2jils at gmail.com Tue Mar 18 11:16:57 2014 From: get2jils at gmail.com (Ramprakash Jelari) Date: Tue, 18 Mar 2014 15:46:57 +0530 Subject: [Libav-user] Unable to set UDP timeout for av_read_frame () . It goes with default value of 20 seconds. In-Reply-To: <20140317181007.375688a1@debian> References: <20140317181007.375688a1@debian> Message-ID: Yes, it does work. but i am bit hesitant to go with this approach, as it increases the CPU load, if i am not wrong, as each time interrupt callback will get invoked. correct me if i am wrong? On Mon, Mar 17, 2014 at 10:40 PM, wm4 wrote: > On Mon, 17 Mar 2014 22:20:19 +0530 > whoami Jils wrote: > > > Hi > > > > i follow below step to set UDP socket timeout of 5 seconds. > > > > AVDictionary *stream_opts = 0; > > av_dict_set(&stream_opts, "timeout", 3000000) // in microseconds. > > avformat_open_input ( &myContext, " > Just an uniformed guess: does setting the interrupt callback 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 jason.j.blum at gmail.com Wed Mar 19 02:36:45 2014 From: jason.j.blum at gmail.com (Jason Blum) Date: Tue, 18 Mar 2014 21:36:45 -0400 Subject: [Libav-user] stack smash on return In-Reply-To: References: Message-ID: > valgrind should help with such problems >From everything I've been reading online, buffer overrun is one of the things valgrind is least suited for, though there is an experimental option called sgcheck. I found my error, and it was so simple that it was hiding in plain sight. In fetch_and_decode( ) I was using 76 as the size of the PaVE header in a memcpy command, which is more than what the structure is defined as. Yet another strike against Parrot's confusing documentation vs. practical application with their product. Fixing that leads to what seems like a healthy output. From info at non-lethal-applications.com Wed Mar 19 16:18:04 2014 From: info at non-lethal-applications.com (Info || Non-Lethal Applications) Date: Wed, 19 Mar 2014 16:18:04 +0100 Subject: [Libav-user] Reading timecode track info ... just getting started Message-ID: Hey there, I?m a total ffmpeg noob so please be a little bit patient. Currently, I?m just overwhelmed by the tons of source code and I?m trying my best to work myself into it. Until now I?ve been using Apple?s QuickTime library (I?m writing a Mac app) and I used it to read info from a given movie file. These infos included codec names (converted from the FOURCCs) and also the timecode track info. I have sample code here from the ffmpeg tutorial but I can?t seem to understand how to read the timecode track infos. I?d just like to get the timecode track start TC and the frame rate of the TC track. I am looping over the available streams and from av_dump_format I know that stream number 2 (zero indexed) is my TC track. And this stream has the codec_type AVMEDIA_TYPE_DATA. However, timecode_frame_start (which I found in the docs and sounded promising) always returns -1. The timeBase is also somewhat weird as it should be 2398/100 but is 24/1 ? for(i=0; inb_streams; i++) { printf("Codec type: %i", pFormatCtx->streams[i]->codec->codec_type); if(pFormatCtx->streams[i]->codec->codec_type==AVMEDIA_TYPE_DATA) { int64_t timeCode = pFormatCtx->streams[i]->codec->timecode_frame_start; AVRational timeBase = pFormatCtx->streams[i]->codec->time_base; } } I would appreciate any hint and maybe someone can tell me where to start delving into this huge project! Thanks in advance!! Best, Flo -------------- next part -------------- An HTML attachment was scrubbed... URL: From mtaha.ansari at gmail.com Thu Mar 20 06:57:51 2014 From: mtaha.ansari at gmail.com (Taha Ansari) Date: Thu, 20 Mar 2014 10:57:51 +0500 Subject: [Libav-user] Two pass encoding for VP8 Message-ID: Hi, I am trying to simulate two-pass encoding using FFmpeg libraries. Code I have so far is working fine for h264 codec, now I want it to work also for VP8. Normal encoding (i.e. single pass) works fine, both for mp4, and webm; but the changes in code for two pass works only for mp4s. I have tried to tally code from ffmpeg.c file, and add it up in my encoding routines. Looking closer at different locations, developer logs, etc., I have come down to following possibilities: - 'stats_out' buffer is never allocated (though documentation says it is allocated automatically for encoding) - avcodec_encode_video2(c, &pkt, frame, &got_output) never sets 'got_output' for first pass Necessary bits of code: https://gist.github.com/anonymous/3e01cfdeb64fd577cc48 In above code, for CODEC_FLAG_PASS1, stats file is created, but stats_out is always NULL, and avcodec_encode_video2() never sets got_output, so code under it is never executed. Apparently I have missed out something, but cannot understand what, exactly. Can anyone guide me towards my mistake? Thanks! -------------- next part -------------- An HTML attachment was scrubbed... URL: From xdd123www at gmail.com Thu Mar 20 07:30:01 2014 From: xdd123www at gmail.com (Ben Gan) Date: Thu, 20 Mar 2014 14:30:01 +0800 Subject: [Libav-user] Question of libavformat about h263 packetization Message-ID: Hi, I am freshman to ffmpeg and I have one question about h263 packetization after reading the source code of libavformat. In function send_mode_a() of rtpenc_h263_rfc2190.c, the sbit flag of each h263 rtp packets shall equal 0. But according rfc2190, the format of rtp packets should like this: 1st Packet : SBIT 0, EBIT 5. 2nd Packet : SBIT 3, EBIT 0. I am very confused about this, any help? Thanks, Ben -------------- next part -------------- An HTML attachment was scrubbed... URL: From harry at gps-laptimer.de Fri Mar 21 13:18:41 2014 From: harry at gps-laptimer.de (Harald Schlangmann) Date: Fri, 21 Mar 2014 13:18:41 +0100 Subject: [Libav-user] Huge packet sized during encoding Message-ID: Hi, I?m developing an app on Android reading in a video, applying an overlay, and writing it back to another video. Besides several issues I faced already ;-) I?m currently struggling to find the reason for - well - bad encoding results using xlib264. What I get from my tracing: Information on video processed (from av_dump_format ()): 2101226411 00 --> call to VideoSource::startAssetReader () 2101226411 01 --> opening video /storage/emulated/legacy/Movies/IMG_0806.mp4 2101226419 01 --> Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/storage/emulated/legacy/Movies/IMG_0806.mp4': 2101226419 01 --> Metadata: 2101226419 01 --> major_brand : isom 2101226419 01 --> minor_version : 512 2101226419 01 --> compatible_brands: isomiso2avc1mp41 2101226419 01 --> encoder : Lavf55.19.104 2101226419 01 --> Duration: 00:15:40.57, bitrate: N/A 2101226419 01 --> Stream #0:0(und), 0, 1/30000: Video: h264 (avc1 / 0x31637661), 1280x720, 0/1, 2274 kb/s, 29.97 fps, 29.97 tbr, 30k tbn (default) 2101226419 01 --> Metadata: 2101226419 01 --> handler_name : VideoHandler 2101226419 01 --> Stream #0:1(und), 0, 1/44100: Audio: aac (mp4a / 0x6134706D), 44100 Hz, 1 channels, 128 kb/s (default) 2101226419 01 --> Metadata: 2101226419 01 --> handler_name : SoundHandler 2101226423 00 ?> VideoSource::startAssetReader () returns Information on video created: 2101226748 00 --> call to AssetWriter::startAssetWriter () 2101226748 01 --> adding stream for encoder 'h264' 2101226749 01 --> set video resolution to 1280 x 720 2101226749 01 --> set bit rate to 2.169246 MBit/s 2101226749 01 --> time_base set to 1001/30000 s 2101226749 01 --> adding stream for encoder 'aac' 2101226764 01 --> Output #0, mp4, to '/storage/emulated/legacy/Movies/Overlay-20140221-003642.mp4': 2101226764 01 --> Stream #0:0, 0, 1/90000: Video: h264 (libx264), yuv420p, 1280x720, 1001/30000, q=-1--1, 2274 kb/s, 90k tbn, 29.97 tbc 2101226764 01 --> Stream #0:1, 0, 1/90000: Audio: aac, 44100 Hz, 2 channels, fltp, 64 kb/s 2101226764 00 --> AssetWriter::startAssetWriter () returns Now, looking into the packets written, I see (approximately 1 second of video, 30 frames): 2101227476 01 --> video packet sized 156862 bytes written for pts = 6873867 with stream time_base 1 / 30000 (229.13s) 2101227502 01 --> video packet sized 64695 bytes written for pts = 6875869 with stream time_base 1 / 30000 (229.20s) 2101227530 01 --> video packet sized 22829 bytes written for pts = 6874868 with stream time_base 1 / 30000 (229.16s) 2101227615 01 --> video packet sized 103060 bytes written for pts = 6877871 with stream time_base 1 / 30000 (229.26s) 2101227643 01 --> video packet sized 31593 bytes written for pts = 6876870 with stream time_base 1 / 30000 (229.23s) 2101227668 01 --> video packet sized 89404 bytes written for pts = 6880874 with stream time_base 1 / 30000 (229.36s) 2101227694 01 --> video packet sized 29312 bytes written for pts = 6879873 with stream time_base 1 / 30000 (229.33s) 2101227718 01 --> video packet sized 21731 bytes written for pts = 6878872 with stream time_base 1 / 30000 (229.30s) 2101227811 01 --> video packet sized 286220 bytes written for pts = 6883877 with stream time_base 1 / 30000 (229.46s) 2101227839 01 --> video packet sized 77027 bytes written for pts = 6882876 with stream time_base 1 / 30000 (229.43s) 2101227865 01 --> video packet sized 32279 bytes written for pts = 6881875 with stream time_base 1 / 30000 (229.40s) 2101227905 01 --> video packet sized 267214 bytes written for pts = 6884878 with stream time_base 1 / 30000 (229.50s) 2101227932 01 --> video packet sized 320495 bytes written for pts = 6885879 with stream time_base 1 / 30000 (229.53s) 2101227959 01 --> video packet sized 335585 bytes written for pts = 6887881 with stream time_base 1 / 30000 (229.60s) 2101228060 01 --> video packet sized 235464 bytes written for pts = 6886880 with stream time_base 1 / 30000 (229.56s) 2101228085 01 --> video packet sized 392501 bytes written for pts = 6889883 with stream time_base 1 / 30000 (229.66s) 2101228110 01 --> video packet sized 255984 bytes written for pts = 6888882 with stream time_base 1 / 30000 (229.63s) 2101228245 01 --> video packet sized 339338 bytes written for pts = 6891885 with stream time_base 1 / 30000 (229.73s) 2101228279 01 --> video packet sized 251143 bytes written for pts = 6890884 with stream time_base 1 / 30000 (229.70s) 2101228306 01 --> video packet sized 382294 bytes written for pts = 6893887 with stream time_base 1 / 30000 (229.80s) 2101228331 01 --> video packet sized 231140 bytes written for pts = 6892886 with stream time_base 1 / 30000 (229.76s) 2101228360 01 --> video packet sized 383165 bytes written for pts = 6896890 with stream time_base 1 / 30000 (229.90s) 2101228389 01 --> video packet sized 271674 bytes written for pts = 6895889 with stream time_base 1 / 30000 (229.86s) 2101228477 01 --> video packet sized 252329 bytes written for pts = 6894888 with stream time_base 1 / 30000 (229.83s) 2101228523 01 --> video packet sized 484016 bytes written for pts = 6897891 with stream time_base 1 / 30000 (229.93s) 2101228556 01 --> video packet sized 362961 bytes written for pts = 6899893 with stream time_base 1 / 30000 (230.00s) 2101228584 01 --> video packet sized 263645 bytes written for pts = 6898892 with stream time_base 1 / 30000 (229.96s) 2101228669 01 --> video packet sized 386746 bytes written for pts = 6901895 with stream time_base 1 / 30000 (230.06s) 2101228709 01 --> video packet sized 284070 bytes written for pts = 6900894 with stream time_base 1 / 30000 (230.03s) 2101228828 01 --> video packet sized 369222 bytes written for pts = 6903897 with stream time_base 1 / 30000 (230.13s) Adding up the packet sized, these are 6983998 bytes which means nearly 7 MB per second. A video with length 3.5 minutes is 1.6 GB large - which is in line with this sample. Instead of the 2274 kb/s defined for the stream, the above sample means 54562 kb/s? So my question: what could be the reason the video output gets that large? The configuration I apply to the video stream?s codec context is setting the codec_id, width, height, bitrate, time_base, gop_size=12, and pix_fmt = AV_PIX_FMT_YUV420P (see dump output above). The step I do when writing a frame is scaling / encoding a frame (size 1280x720, from RGB565 to AV_PIX_FMT_YUV420P, resulting in size = 1843200 bytes), setting its pts field, initializing a new packet, writing the frame using avcodec_encode_video2 (), and writing it using av_interleaved_write_frame () in case I got a packet completed (by avcodec_encode_video2). Sorry for the long mail. In case code snippets are required, I?m happy to add. Thanks for any thought how I can fix or debug that! Greetings Harald - Harald Schlangmann Antwerpener Str. 52, 50672 K?ln, Germany +49 151 2265 4439 Harry at gps-laptimer.de www.gps-laptimer.de -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 4145 bytes Desc: not available URL: From cehoyos at ag.or.at Fri Mar 21 14:51:53 2014 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Fri, 21 Mar 2014 13:51:53 +0000 (UTC) Subject: [Libav-user] Huge packet sized during encoding References: Message-ID: Harald Schlangmann writes: > 2101226749 01 --> set bit rate to 2.169246 MBit/s This doesn't really say what you set and to which value... Carl Eugen From harry at gps-laptimer.de Fri Mar 21 14:59:17 2014 From: harry at gps-laptimer.de (Harald Schlangmann) Date: Fri, 21 Mar 2014 14:59:17 +0100 Subject: [Libav-user] Huge packet sized during encoding In-Reply-To: References: Message-ID: Yes, but three lines further down you can see the result: > 2101226764 01 --> Stream #0:0, 0, 1/90000: Video: h264 (libx264), yuv420p, 1280x720, 1001/30000, q=-1--1, 2274 kb/s, 90k tbn, 29.97 tbc So it should be set to 2274 kb/s? Actually I?m simply taking the bit rate from the video processed: c->bit_rate = masterCodecCtx->bit_rate; Greetings Harald - Harald Schlangmann Antwerpener Str. 52, 50672 K?ln, Germany +49 151 2265 4439 Harry at gps-laptimer.de www.gps-laptimer.de On 21.03.2014, at 14:51, Carl Eugen Hoyos wrote: > Harald Schlangmann writes: > >> 2101226749 01 --> set bit rate to 2.169246 MBit/s > > This doesn't really say what you set and to which value... > > Carl Eugen > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 4145 bytes Desc: not available URL: From harry at gps-laptimer.de Fri Mar 21 17:26:18 2014 From: harry at gps-laptimer.de (Harald Schlangmann) Date: Fri, 21 Mar 2014 17:26:18 +0100 Subject: [Libav-user] Huge packet sized during encoding In-Reply-To: References: Message-ID: I just switched the encoder from H.264 to MPEG4 Part2(?) without changing anything else. The result is a file with a size of 394 MB instead of the 1.6 GB with H.264? The ?design size? at 2274 kb/s should be 61 MB plus audio? Just in case this triggers an idea? It seems the bit rate defined in the codec ctx is not achieved in both cases, but the situation is worse for xlib264. Is there probably something wrong with the frame rate? I write 30 frames / s, do I need to configure this somewhere? As written in my first mail, the timebase is set. Greetings Harald - Harald Schlangmann Antwerpener Str. 52, 50672 K?ln, Germany +49 151 2265 4439 Harry at gps-laptimer.de www.gps-laptimer.de On 21.03.2014, at 14:51, Carl Eugen Hoyos wrote: > Harald Schlangmann writes: > >> 2101226749 01 --> set bit rate to 2.169246 MBit/s > > This doesn't really say what you set and to which value... > > Carl Eugen > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 4145 bytes Desc: not available URL: From ggarra13 at gmail.com Sun Mar 23 00:35:13 2014 From: ggarra13 at gmail.com (Gonzalo Garramuno) Date: Sat, 22 Mar 2014 20:35:13 -0300 Subject: [Libav-user] How to build static libs for Windows In-Reply-To: References: Message-ID: <532E1E31.3040007@gmail.com> On 12/03/14 22:23, YIRAN LI wrote: > Hi all, > > I'm looking for a way to generate ffmpeg static libs for Windows (not > import .libs + dll) so that my application no longer needs dlls. > > If I configure with --enable-static --disable-shared, then I can only get > .a files (compiled under both MinGW and VS2013). > > I'm not sure if these .a files can be used in VisualStudio, or is there any > way I can generate standalone .libs? Yes, those .a files are .lib files and you should be able to use them. From mrfun.china at gmail.com Mon Mar 24 01:54:39 2014 From: mrfun.china at gmail.com (YIRAN LI) Date: Mon, 24 Mar 2014 11:54:39 +1100 Subject: [Libav-user] reduce dll size In-Reply-To: References: Message-ID: Note that combining libavcodec and libavformat into one library is not supported here, if you do it, please do not ask for support;-) (You may of course ask for support if your particular configure line does not work the way you need it: Just post it and tell us what doesn't work.) Hi Carl, I'm trying to build all components into one dll, because my manager insisted that building into a single dll may save space by avoiding build duplicated code into separate dlls. I think ffmpeg uses those automake tools to generate configure and makefile. I'm totally new to these tools. I checked ffmpeg's git repo, seems makefile.am and any other files needed for these tools are not available. May I know if there's anyway to get them so that at least I have something to reference. Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: From winterfa at gmail.com Mon Mar 24 09:42:57 2014 From: winterfa at gmail.com (Winter Fa) Date: Mon, 24 Mar 2014 16:42:57 +0800 Subject: [Libav-user] Maximize CPU usage when decoding h264 Message-ID: Hi all, I am trying to use libavcodec(55.39.101) to decode h264 video as fast as possible, I found that the library can only make use of around 160% of CPU ( i3-2100, 2 core, 4 threads) on some of the h264 videos (eg. Video A, see link below), but able to use over 300% CPU on other h264 videos (eg. Video B, see link below) >From mediainfo, Video A is interlaced while B is progressive. Does this really affect the parallelism of decoding? I've tried using x264 to encode videos to h264 with interlace/progressive options, either option videos can let libavcodec use over 300% CPU to do decoding. so it seems that interlace/progressive may not be the root cause which affects CPU usage. My question is what factors are affecting the CPU usage of decoding h264 videos? Is there a way to maximize CPU usage so that decoding can become faster? I use ffmpeg benchmark command to illustrate the difference of CPU usage: ffmpeg -benchmark -threads auto -i ~/Videos/fileA.h264 -f null - (-threads=4, 8 or auto, results are similar) Video A - http://downloads.mainconcept.com/MainConceptLogo_Blu-ray_AVC_1920x1080_LPCM.zip Video B - http://download.blender.org/durian/trailer/Sintel_Trailer1.1080p.DivX_Plus_HD.mkv I appreciate any help from you, thanks! Winter Fa -------------- next part -------------- An HTML attachment was scrubbed... URL: From cehoyos at ag.or.at Mon Mar 24 15:03:23 2014 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Mon, 24 Mar 2014 14:03:23 +0000 (UTC) Subject: [Libav-user] reduce dll size References: Message-ID: YIRAN LI writes: > I'm trying to build all components into one dll, because my manager > insisted that building into a single dll may save space by avoiding > build duplicated code into separate dlls. How is this supposed to work? Or, to rephrase: What are the duplicated code parts that you found in different FFmpeg dlls and how much (in %) did they take of the overall space? > I think ffmpeg uses those automake tools No. (Do you find that the content of our configure script looks automake-made or the output? I am curious.) Please fix your quoting, Carl Eugen From cehoyos at ag.or.at Mon Mar 24 14:59:53 2014 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Mon, 24 Mar 2014 13:59:53 +0000 (UTC) Subject: [Libav-user] Maximize CPU usage when decoding h264 References: Message-ID: Winter Fa writes: > My question is what factors are affecting the CPU usage of decoding h264 > videos? (Many, among them cabac vs cavlc, B-frames, bitrate and probably less obvious things. There is a x264 option that takes this into account iirc but it may not suit your use case.) > Is there a way to maximize CPU usage so that decoding can become faster? Intra-only streams allow to use much more CPU while decoding. Is your use-case to decode as many files as possible in a given time or to decode one file as fast as possible? If you have many files, -threads 1 is significantly more effective (up to the bandwidth of your hard disk). Carl Eugen From mrfun.china at gmail.com Tue Mar 25 00:00:51 2014 From: mrfun.china at gmail.com (YIRAN LI) Date: Tue, 25 Mar 2014 10:00:51 +1100 Subject: [Libav-user] reduce dll size In-Reply-To: References: Message-ID: > YIRAN LI writes: > > > I'm trying to build all components into one dll, because my manager > > insisted that building into a single dll may save space by avoiding > > build duplicated code into separate dlls. > > How is this supposed to work? > > Or, to rephrase: What are the duplicated code parts that you found > in different FFmpeg dlls and how much (in %) did they take of the > overall space? > > Hi Carl, I know those functions like strcpy strlen are linked from msvcrt.dll so they are not duplicated. But to be honest I'm not familiar with Linux build so I don't know how to check or if there's any other duplicate code that might be statically linked into separated dlls. So it's just a guess:( > I think ffmpeg uses those automake tools > > No. > (Do you find that the content of our configure script looks > automake-made or the output? I am curious.) > > Please fix your quoting, Carl Eugen > > For the configure, in fact I totally have no idea on autotools so it's also a guess. Sorry for that. So if it's not generated by autotools, the configure and Makefiles are all handwritten? Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: From mrfun.china at gmail.com Tue Mar 25 03:40:49 2014 From: mrfun.china at gmail.com (YIRAN LI) Date: Tue, 25 Mar 2014 13:40:49 +1100 Subject: [Libav-user] reduce dll size In-Reply-To: References: Message-ID: > I'm trying to build all components into one dll, because my manager > insisted that building into a single dll may save space by avoiding > build duplicated code into separate dlls. How is this supposed to work? Or, to rephrase: What are the duplicated code parts that you found in different FFmpeg dlls and how much (in %) did they take of the overall space? >> Hi Carl, I found that every dll links to libm, if it's a static lib (I can only find .a on my system), does that mean some code will be built into every dll? Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: From winterfa at gmail.com Tue Mar 25 03:44:10 2014 From: winterfa at gmail.com (Winter Fa) Date: Mon, 24 Mar 2014 19:44:10 -0700 (PDT) Subject: [Libav-user] Maximize CPU usage when decoding h264 In-Reply-To: References: Message-ID: <1395715450762-4659475.post@n4.nabble.com> > Is your use-case to decode as many files as possible in a given time > or to decode one file as fast as possible? If you have many files, > -threads 1 is significantly more effective (up to the bandwidth of > your hard disk). Thanks Carl, my use-case is to decode one stream as fast as possible, so I can't use the approach of running several single-threaded instances to speed up the process. > There is a x264 option that takes this into account iirc > but it may not suit your use case.) And I have to decode h264 videos from random sources, so I have no control of how the video being encoded. Can I say that, at the decoder side, there is nothing I can do to ensure all h264 videos from random sources can use the maximum CPU power to decode? > Intra-only streams allow to use much more CPU while decoding. Can you point out for me which tool can show if the h264 video is intra-only streams? Thanks again! -- View this message in context: http://libav-users.943685.n4.nabble.com/Libav-user-Maximize-CPU-usage-when-decoding-h264-tp4659470p4659475.html Sent from the libav-users mailing list archive at Nabble.com. From alexcohn at netvision.net.il Tue Mar 25 08:51:55 2014 From: alexcohn at netvision.net.il (Alex Cohn) Date: Tue, 25 Mar 2014 09:51:55 +0200 Subject: [Libav-user] reduce dll size Message-ID: On Tue, Mar 25, 2014 at 4:40 AM, YIRAN LI wrote: > > > I'm trying to build all components into one dll, because my manager > > insisted that building into a single dll may save space by avoiding > > build duplicated code into separate dlls. > > How is this supposed to work? > > Or, to rephrase: What are the duplicated code parts that you found > in different FFmpeg dlls and how much (in %) did they take of the > overall space? > > >> Hi Carl, > > I found that every dll links to libm, if it's a static lib (I can only find .a on my system), does that mean > some code will be built into every dll? Yes, there definitely is some amount of duplication with multiple DLLs. You can easily find the amount of overhead, in a supported way. Build your project with static version of ffmpeg libraries, and compare the size of your binary with the size of binary you have now (which is built with libavcodec.dll, libavformat.dll, etc.). For the latter, sum up all the DLLs that you need to deploy. If you find that the difference is significant for your project, only then it's worthwhile to work on reducing the size of DLLs or the amount of code duplication. As CameraMan mentioned above, the monolithic binary may require special considerations re ffmpeg license, but again, it would be wise to delay these discussions until you have an evidence that the simple way (with multiple DLLs) can be shrinked down significantly. BR, Alex Cohn From xenosender at gmail.com Tue Mar 25 11:29:47 2014 From: xenosender at gmail.com (cyril poulet) Date: Tue, 25 Mar 2014 11:29:47 +0100 Subject: [Libav-user] Motion estimation : replacement for deprecated AVFrame::motion_val ? Message-ID: Hi all As others who already posted on this matter but got no answers, I'm trying to get motion vectors from h264 codec (P-frames). Before v2, they seemed to be available in AVFrame::motion_val, (along with motion_subsample_log2 and mb_type), which are now deprecated. Is there any way to get these values since v2 ? (I'm also interested in getting back the dct_coeff for I-frames, but something tells me that all these questions are linked) Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: From tomas.hardin at codemill.se Tue Mar 25 12:06:20 2014 From: tomas.hardin at codemill.se (=?ISO-8859-1?Q?Tomas_H=E4rdin?=) Date: Tue, 25 Mar 2014 12:06:20 +0100 Subject: [Libav-user] Motion estimation : replacement for deprecated AVFrame::motion_val ? In-Reply-To: References: Message-ID: <5331632C.2020605@codemill.se> On 2014-03-25 11:29, cyril poulet wrote: > Hi all > As others who already posted on this matter but got no answers, I'm > trying to get motion vectors from h264 codec (P-frames). > Before v2, they seemed to be available in AVFrame::motion_val, (along > with motion_subsample_log2 and mb_type), which are now deprecated. > > Is there any way to get these values since v2 ? > > (I'm also interested in getting back the dct_coeff for I-frames, but > something tells me that all these questions are linked) I think the general direction nowadays is to hide such internals. If you want access to this stuff in the future you'll have to fork and hack the functionality in /Tomas From cyril.poulet at centraliens.net Tue Mar 25 12:10:52 2014 From: cyril.poulet at centraliens.net (cyril poulet) Date: Tue, 25 Mar 2014 12:10:52 +0100 Subject: [Libav-user] Motion estimation : replacement for deprecated AVFrame::motion_val ? In-Reply-To: <5331632C.2020605@codemill.se> References: <5331632C.2020605@codemill.se> Message-ID: So i've understood, but I don't really see why these values are not available anymore. I realize that messing with the internals of various codecs is not why libav is made for, but these fields are calculated anyway, so why not propagate it to the AVFrame ? 2014-03-25 12:06 GMT+01:00 Tomas H?rdin : > > On 2014-03-25 11:29, cyril poulet wrote: > >> Hi all >> As others who already posted on this matter but got no answers, I'm >> trying to get motion vectors from h264 codec (P-frames). >> Before v2, they seemed to be available in AVFrame::motion_val, (along >> with motion_subsample_log2 and mb_type), which are now deprecated. >> >> Is there any way to get these values since v2 ? >> >> (I'm also interested in getting back the dct_coeff for I-frames, but >> something tells me that all these questions are linked) >> > I think the general direction nowadays is to hide such internals. If you > want access to this stuff in the future you'll have to fork and hack the > functionality in > > /Tomas > _______________________________________________ > 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 xenosender at gmail.com Tue Mar 25 12:13:55 2014 From: xenosender at gmail.com (cyril poulet) Date: Tue, 25 Mar 2014 12:13:55 +0100 Subject: [Libav-user] Motion estimation : replacement for deprecated AVFrame::motion_val ? In-Reply-To: <5331632C.2020605@codemill.se> References: <5331632C.2020605@codemill.se> Message-ID: So i've understood, but I don't really see why these values are not available anymore. I realize that messing with the internals of various codecs is not why libav is made for, but these fields are calculated anyway, so why not propagate it to the AVFrame ? 2014-03-25 12:06 GMT+01:00 Tomas H?rdin : > > On 2014-03-25 11:29, cyril poulet wrote: > >> Hi all >> As others who already posted on this matter but got no answers, I'm >> trying to get motion vectors from h264 codec (P-frames). >> Before v2, they seemed to be available in AVFrame::motion_val, (along >> with motion_subsample_log2 and mb_type), which are now deprecated. >> >> Is there any way to get these values since v2 ? >> >> (I'm also interested in getting back the dct_coeff for I-frames, but >> something tells me that all these questions are linked) >> > I think the general direction nowadays is to hide such internals. If you > want access to this stuff in the future you'll have to fork and hack the > functionality in > > /Tomas > _______________________________________________ > 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 tomas.hardin at codemill.se Tue Mar 25 13:29:03 2014 From: tomas.hardin at codemill.se (=?ISO-8859-1?Q?Tomas_H=E4rdin?=) Date: Tue, 25 Mar 2014 13:29:03 +0100 Subject: [Libav-user] Motion estimation : replacement for deprecated AVFrame::motion_val ? In-Reply-To: References: <5331632C.2020605@codemill.se> Message-ID: <5331768F.4030907@codemill.se> Please avoid top posting on these lists - it's considered bad form. On 2014-03-25 12:10, cyril poulet wrote: > 2014-03-25 12:06 GMT+01:00 Tomas H?rdin >: > > > On 2014-03-25 11:29, cyril poulet wrote: > > Hi all > As others who already posted on this matter but got no > answers, I'm trying to get motion vectors from h264 codec > (P-frames). > Before v2, they seemed to be available in AVFrame::motion_val, > (along with motion_subsample_log2 and mb_type), which are now > deprecated. > > Is there any way to get these values since v2 ? > > (I'm also interested in getting back the dct_coeff for > I-frames, but something tells me that all these questions are > linked) > > I think the general direction nowadays is to hide such internals. > If you want access to this stuff in the future you'll have to fork > and hack the functionality in > > /Tomas > > So i've understood, but I don't really see why these values are not > available anymore. I realize that messing with the internals of > various codecs is not why libav is made for, but these fields are > calculated anyway, so why not propagate it to the AVFrame ? Because they're internal, and having them exposed hampers refactoring efforts. If you want stuff to remain "like before" then just use some specific old version of ffmpeg in your application (or even a specific commit) /Tomas -------------- next part -------------- An HTML attachment was scrubbed... URL: From vojtech at kral.hk Tue Mar 25 13:50:48 2014 From: vojtech at kral.hk (=?UTF-8?Q?Vojt=C4=9Bch_Kr=C3=A1l?=) Date: Tue, 25 Mar 2014 13:50:48 +0100 Subject: [Libav-user] =?utf-8?q?Motion_estimation_=3A_replacement_for_depr?= =?utf-8?q?ecated_AVFrame=3A=3Amotion=5Fval_=3F?= In-Reply-To: <5331768F.4030907@codemill.se> References: " " <5331632C.2020605@codemill.se> <5331768F.4030907@codemill.se> Message-ID: <7aef8fb0c1fc50e799b13b8f102bcb2c@kral.hk> On 2014-03-25 13:29, Tomas H?rdin wrote: > Please avoid top posting on these lists - it's considered bad form. > > On 2014-03-25 12:10, cyril poulet wrote: > > 2014-03-25 12:06 GMT+01:00 Tomas H?rdin : > > On 2014-03-25 11:29, cyril poulet wrote: > Hi all > As others who already posted on this matter but got no answers, I'm trying to get motion vectors from h264 codec (P-frames). > Before v2, they seemed to be available in AVFrame::motion_val, (along with motion_subsample_log2 and mb_type), which are now deprecated. > > Is there any way to get these values since v2 ? > > (I'm also interested in getting back the dct_coeff for I-frames, but something tells me that all these questions are linked) I think the general direction nowadays is to hide such internals. If you want access to this stuff in the future you'll have to fork and hack the functionality in > > /Tomas > So i've understood, but I don't really see why these values are not available anymore. I realize that messing with the internals of various codecs is not why libav is made for, but these fields are calculated anyway, so why not propagate it to the AVFrame ? Because they're internal, and having them exposed hampers refactoring efforts. If you want stuff to remain "like before" then just use some specific old version of ffmpeg in your application (or even a specific commit) /Tomas That's a rather evasive answer... I myself would too welcome if the API for access to internals such as DCTs and MVs was preserved (mostly for academical / experimental purposes, as I'm working on a bc thesis concerning video right now). Refactoring is a great thing, but it doesn't have to entail removing funcionality... For example, let's have a look at libjpeg: It has had a well-defined API for accessing DCT coefficients since always and as far as I'm aware nobody's having problem with it. (Refer to the chapter "Really raw data: DCT coefficients" in libjpeg.txt) It would be very nice if ffmpeg had something similar. While I unserstand that it's not at all a mainstream usecase, I still think it's worthwhile. Thanks, BR, Vojt?ch Kr?l -------------- next part -------------- An HTML attachment was scrubbed... URL: From nfxjfg at googlemail.com Tue Mar 25 14:40:24 2014 From: nfxjfg at googlemail.com (wm4) Date: Tue, 25 Mar 2014 14:40:24 +0100 Subject: [Libav-user] Motion estimation : replacement for deprecated AVFrame::motion_val ? In-Reply-To: <7aef8fb0c1fc50e799b13b8f102bcb2c@kral.hk> References: <5331632C.2020605@codemill.se> <5331768F.4030907@codemill.se> <7aef8fb0c1fc50e799b13b8f102bcb2c@kral.hk> Message-ID: <20140325144024.549720d1@debian> On Tue, 25 Mar 2014 13:50:48 +0100 Vojt?ch Kr?l wrote: > > > On 2014-03-25 13:29, Tomas H?rdin wrote: > > > Please avoid top posting on these lists - it's considered bad form. > > > > On 2014-03-25 12:10, cyril poulet wrote: > > > > 2014-03-25 12:06 GMT+01:00 Tomas H?rdin : > > > > On 2014-03-25 11:29, cyril poulet wrote: > > Hi all > > As others who already posted on this matter but got no answers, I'm trying to get motion vectors from h264 codec (P-frames). > > Before v2, they seemed to be available in AVFrame::motion_val, (along with motion_subsample_log2 and mb_type), which are now deprecated. > > > > Is there any way to get these values since v2 ? > > > > (I'm also interested in getting back the dct_coeff for I-frames, but something tells me that all these questions are linked) I think the general direction nowadays is to hide such internals. If you want access to this stuff in the future you'll have to fork and hack the functionality in > > > > /Tomas > > > So i've understood, but I don't really see why these values are not available anymore. I realize that messing with the internals of various codecs is not why libav is made for, but these fields are calculated anyway, so why not propagate it to the AVFrame ? > > Because they're internal, and having them exposed hampers refactoring > efforts. If you want stuff to remain "like before" then just use some > specific old version of ffmpeg in your application (or even a specific > commit) > > /Tomas > > That's a rather evasive answer... I myself would too welcome if the API > for access to internals such as DCTs and MVs was preserved (mostly for > academical / experimental purposes, as I'm working on a bc thesis > concerning video right now). Refactoring is a great thing, but it > doesn't have to entail removing funcionality... As far as I know, the API was deprecated by Libav. Libav also removed the implementation of these. FFmpeg merged the deprecation, but not the removal of the implementation (or at least not all of it). So there's hope for you to convince the developers to un-deprecate it. From anatoliy-leshin at yandex.ru Tue Mar 25 17:11:14 2014 From: anatoliy-leshin at yandex.ru (K4) Date: Tue, 25 Mar 2014 09:11:14 -0700 (PDT) Subject: [Libav-user] Compile libAV + libswsscale for QNX Message-ID: <1395763874328-4659484.post@n4.nabble.com> Hello, i want to build my project that use libAV on QNX target. First of all i want to ask: is it possible? I didnt find any documentation or manual, if it's exists - please give me links. I hope that you'll give me some manuals and i wont ask my next question about crosscompile. -- View this message in context: http://libav-users.943685.n4.nabble.com/Compile-libAV-libswsscale-for-QNX-tp4659484.html Sent from the libav-users mailing list archive at Nabble.com. From cehoyos at ag.or.at Tue Mar 25 17:39:49 2014 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Tue, 25 Mar 2014 16:39:49 +0000 (UTC) Subject: [Libav-user] Compile libAV + libswsscale for QNX References: <1395763874328-4659484.post@n4.nabble.com> Message-ID: K4 writes: > Hello, i want to build my project that use libAV on QNX target. > > First of all i want to ask: is it possible? I think current FFmpeg is supported on QNX. That being said, they were several reports that claim one or more problems, unfortunately, none of those reports contained the information necessary to fix those problems;-( Please download current FFmpeg git head and try to configure with (approximately) the following: $ ./configure --enable-cross-compile --arch=arm --cc=qcc --target-os=qnx This will probably not be enough, as said, please report back here! (One report indicates that --tempprefix might be needed.) Carl Eugen From nikitos1550 at yandex.ru Tue Mar 25 18:37:50 2014 From: nikitos1550 at yandex.ru (Nik Orlov) Date: Tue, 25 Mar 2014 21:37:50 +0400 Subject: [Libav-user] libav h.264 vaapi encoding Message-ID: <1988121395769070@web19g.yandex.ru> Hello! Are there any example about encoding h.264 with vaapi? What is the way to do such encoding? Are there special codec_id for this? As I understand ffmpeg cli doesn`t support vaapi. But liavcodec does. Ffmpeg builds with vaapi support, it has autodect at configure step. Can I include libx264 to ffmpeg binaries, and choose between x264 and vaapi h.264 encoding or I must choose at build time? -- ??? ????? mailto:nikitos1550 at yandex.ru From chisholm at mitre.org Tue Mar 25 20:37:35 2014 From: chisholm at mitre.org (Michael Chisholm) Date: Tue, 25 Mar 2014 15:37:35 -0400 Subject: [Libav-user] reduce dll size In-Reply-To: References: Message-ID: <5331DAFF.70403@mitre.org> On 3/24/2014 10:40 PM, YIRAN LI wrote: >> I'm trying to build all components into one dll, because my manager >> insisted that building into a single dll may save space by avoiding >> build duplicated code into separate dlls. > > How is this supposed to work? > > Or, to rephrase: What are the duplicated code parts that you found > in different FFmpeg dlls and how much (in %) did they take of the > overall space? > >>> Hi Carl, > > I found that every dll links to libm, if it's a static lib (I can only find > .a on my system), does that mean > some code will be built into every dll? > I think you're getting a bit beyond ffmpeg here. The way I see it, a library is a product of its *.o files. If there is duplication of code across *.o files, the only way to fix it is changing the source, because that'll change what goes into the *.o files. You can lump them all into a single library or split them up, afaik it's not going to change the overall library contents. The reason you split them up is so that you can pick and choose the components you need. It's not all-or-nothing. There may be some extra packaging overhead in having multiple libs, but it seems to me it would be relatively minor. An obvious source code artifact that would cause code duplication is inline functions. I'm not sure even turning optimizations off (disabling inlining) would eliminate the dupes, because inline functions are defined in headers, which means they're included in multiple translation units, which means the code is compiled into multiple *.o files. The only way to fix that is to change them to no longer be inline, which is a source code change. Are you sure you want to go to that much trouble... :-P (And anyone please correct me if I'm wrong ;) I am aware that some code changes related to dupe removal can occur at link time, e.g. in C++ where multiple dupe template instantiations can be merged, but I don't know if there's anything like that for C?) Anyway, its starting to seem to me like your manager's expectations are a tad unrealistic... Andy From chisholm at mitre.org Tue Mar 25 20:45:07 2014 From: chisholm at mitre.org (Michael Chisholm) Date: Tue, 25 Mar 2014 15:45:07 -0400 Subject: [Libav-user] reduce dll size In-Reply-To: References: Message-ID: <5331DCC3.5080206@mitre.org> On 3/25/2014 3:51 AM, Alex Cohn wrote: > On Tue, Mar 25, 2014 at 4:40 AM, YIRAN LI wrote: >> >>> I'm trying to build all components into one dll, because my manager >>> insisted that building into a single dll may save space by avoiding >>> build duplicated code into separate dlls. >> >> How is this supposed to work? >> >> Or, to rephrase: What are the duplicated code parts that you found >> in different FFmpeg dlls and how much (in %) did they take of the >> overall space? >> >>>> Hi Carl, >> >> I found that every dll links to libm, if it's a static lib (I can only find .a on my system), does that mean >> some code will be built into every dll? > > Yes, there definitely is some amount of duplication with multiple > DLLs. You can easily find the amount of overhead, in a supported way. > Build your project with static version of ffmpeg libraries, and > compare the size of your binary with the size of binary you have now > (which is built with libavcodec.dll, libavformat.dll, etc.). For the > latter, sum up all the DLLs that you need to deploy. > > If you find that the difference is significant for your project, only > then it's worthwhile to work on reducing the size of DLLs or the > amount of code duplication. > > As CameraMan mentioned above, the monolithic binary may require > special considerations re ffmpeg license, but again, it would be wise > to delay these discussions until you have an evidence that the simple > way (with multiple DLLs) can be shrinked down significantly. > Aha, I just sent a mail saying it's all a bunch of *.o files regardless of how you split them up into libraries. I'd be interested to know how this eliminates dupe code. It seems to me, what you may gain by linking to a static lib, is that only that library code which is actually used by the app is pulled in to the exe (right? It pulls in some subset of the *.o's from the *.a). If you bundle all the DLLs, you include everything that was compiled into the libraries, whether the app actually uses it or not. That's a good point, but I don't think it's about code duplication, is it? (and sorry, just realized I'm mixing windows terms and *nix terms... *.o's and *.a's with DLLs... but you get the idea :) Andy From alexcohn at netvision.net.il Tue Mar 25 22:27:07 2014 From: alexcohn at netvision.net.il (Alex Cohn) Date: Tue, 25 Mar 2014 23:27:07 +0200 Subject: [Libav-user] reduce dll size In-Reply-To: <5331DCC3.5080206@mitre.org> References: <5331DCC3.5080206@mitre.org> Message-ID: On Tue, Mar 25, 2014 at 9:45 PM, Michael Chisholm wrote: > It seems to me, what you may gain by linking to a static lib, is that only > that library code which is actually used by the app is pulled in to the exe Yes and no. With "normal" linker, the granularity is on the OBJ level, which has one-to-one relationship with compilation units, a.k.a. C files. This means that if we have a huge C file with only one little function used in our app, we still have all this code linked into our app. Some linkers allow extra "optimization" and can eliminate unused functions from an OBJ. > (right? It pulls in some subset of the *.o's from the *.a). If you bundle > all the DLLs, you include everything that was compiled into the libraries, > whether the app actually uses it or not. That's a good point, but I don't > think it's about code duplication, is it? You are right, and the major concern is about these unused OBJs. Yiran Li was worried more about another kind of extra fat: that each DLL may also contain its own copy of some functions from LIBM. There may be some truth to that, but its effect is probably negligible. Anyways, the experiment I describe can provide the lower estimate of what can be achieved by manipulation of the DLLs. Sincerely, Alex Cohn From marcinus_007 at wp.pl Tue Mar 25 23:15:04 2014 From: marcinus_007 at wp.pl (Marcin krycho) Date: Tue, 25 Mar 2014 23:15:04 +0100 Subject: [Libav-user] Mixing many video and audio files Message-ID: <5331ffe81cc7c9.94447281@wp.pl> Hello, I am developing APP for Android with FFMPEG library. So far I am able to achieve this using FFMPEG: 1. Create mp4 video from screen shots. 2. Add audio stream to this video from AAC file. This is working perfectly. Next I would like to mix to this mp4 file more sound from other audio or video files. Sound from other mp4 files can start and end at any moment of movie. I assume this is amix command, but how to do it using FFMPEG API in code? I was not able to find any examples of muxing files in code. Any filter has to be created? Is it possible to somehow "add" audio frames in order to achive "sum" of these frames? And result frame add to audio stream of mp4 file? Any help and code examples would be appreciated. Thanks, M From chisholm at mitre.org Tue Mar 25 23:15:53 2014 From: chisholm at mitre.org (Michael Chisholm) Date: Tue, 25 Mar 2014 18:15:53 -0400 Subject: [Libav-user] reduce dll size In-Reply-To: References: <5331DCC3.5080206@mitre.org> Message-ID: <53320019.1070709@mitre.org> On 3/25/2014 5:27 PM, Alex Cohn wrote: > On Tue, Mar 25, 2014 at 9:45 PM, Michael Chisholm wrote: >> It seems to me, what you may gain by linking to a static lib, is that only >> that library code which is actually used by the app is pulled in to the exe > > Yes and no. With "normal" linker, the granularity is on the OBJ level, > which has one-to-one relationship with compilation units, a.k.a. C > files. This means that if we have a huge C file with only one little > function used in our app, we still have all this code linked into our > app. Some linkers allow extra "optimization" and can eliminate unused > functions from an OBJ. > >> (right? It pulls in some subset of the *.o's from the *.a). If you bundle >> all the DLLs, you include everything that was compiled into the libraries, >> whether the app actually uses it or not. That's a good point, but I don't >> think it's about code duplication, is it? > > You are right, and the major concern is about these unused OBJs. Yiran > Li was worried more about another kind of extra fat: that each DLL may > also contain its own copy of some functions from LIBM. There may be > some truth to that, but its effect is probably negligible. > > Anyways, the experiment I describe can provide the lower estimate of > what can be achieved by manipulation of the DLLs. > Yes, it would show how well you could do by paring down DLLs along object boundaries. I think you can get duplication and other weirdness if you mix static and dynamic linking. E.g. if multiple DLLs statically link to the same library, and then the app dynamically links to the DLLs. Each DLL could wind up with its own copy of the static lib, so the app would have multiple copies. But what Yiran's toolchain does when you pass "-lm" on the link commandline is beyond the purview of ffmpeg I think. I also don't think the ffmpeg build process explicitly mixes the linking styles together among the libs it builds, so the code duplication concern (due to linking style) seems like a moot point as far as ffmpeg goes. That was the original topic of the big thread: how do I build one monolithic DLL so that there is no code duplication. The libm concern seemed to me more like grasping at straws. So we're down to paring away objects from libraries. If you use static libraries, the linker does it for you and you don't have to bundle separate ffmpeg library dependencies. That seems easier. If you use dynamic libraries, you do have to bundle separate DLLs, and if you don't like how the existing build process builds them, you're in for a bunch of manual labor doing it yourself... that seems like the hard route. Andy From anatoliy-leshin at yandex.ru Wed Mar 26 08:57:42 2014 From: anatoliy-leshin at yandex.ru (=?koi8-r?B?4c7B1M/Mycog7KPbyc4=?=) Date: Wed, 26 Mar 2014 11:57:42 +0400 Subject: [Libav-user] libav h.264 vaapi encoding In-Reply-To: <1988121395769070@web19g.yandex.ru> References: <1988121395769070@web19g.yandex.ru> Message-ID: <441121395820662@web10m.yandex.ru> ??????, ??????. ? ????????? ? ?? ???? ?????? ?? ???? ??????, ?.?. ??? ??????? ????? ???????? ? libav. ?? ????? ffmpeg'a ????????, ??? libav ???????? ?????? ffmpeg'a (?????? ??? ??? ??????????) ? ?????????? ? ??? ???????????? ? ?????????????? ?????\?????. ??? ????? ??????? ??????? ????? ? ? ??????????? ????????, ??????? ????? ? libavcodec/api-example.c. ????? ????? ???????? ???? ?? http://stackoverflow.com/ ;) 25.03.2014, 22:17, "Nik Orlov" : > ?Hello! > > ?Are there any example about encoding h.264 with vaapi? > ?What is the way to do such encoding? Are there special codec_id for this? > > ?As I understand ffmpeg cli doesn`t support vaapi. But liavcodec does. > > ?Ffmpeg builds with vaapi support, it has autodect at configure step. > ?Can I include libx264 to ffmpeg binaries, and choose between x264 and vaapi h.264 encoding or I must choose at build time? > > ?-- > ???? ????? mailto:nikitos1550 at yandex.ru > ?_______________________________________________ > ?Libav-user mailing list > ?Libav-user at ffmpeg.org > ?http://ffmpeg.org/mailman/listinfo/libav-user From mrfun.china at gmail.com Wed Mar 26 09:04:43 2014 From: mrfun.china at gmail.com (YIRAN LI) Date: Wed, 26 Mar 2014 19:04:43 +1100 Subject: [Libav-user] reduce dll size In-Reply-To: References: Message-ID: Yes, there definitely is some amount of duplication with multiple DLLs. You can easily find the amount of overhead, in a supported way. Build your project with static version of ffmpeg libraries, and compare the size of your binary with the size of binary you have now (which is built with libavcodec.dll, libavformat.dll, etc.). For the latter, sum up all the DLLs that you need to deploy. >>> Thanks for all the response friends, you're really kind to me. Alex, our program uses dll and won't statically link with ffmpeg .a libs. So the question simplified to, in each dll, is there any duplicate code, (instead of if statically link my program with .a can save me space because only those needed will be bundled) -lm is an example, if only static library found, any dll uses math function will include corresponding .o. But I think Michael is correct in his last mail, it's not likely that libm dependency cause so much duplication. I'm now using -Wl, -Map to dump the map file (configure with -Wl -Map). I only build shared libraries and no executables. But I only get one map in root folder, instead of separate map files in component folder. With different components enabled/disabled the content of the map file does change. So I assume this map file contains all the info of libraries built. Is it correct? -------------- next part -------------- An HTML attachment was scrubbed... URL: From mrfun.china at gmail.com Wed Mar 26 09:16:16 2014 From: mrfun.china at gmail.com (YIRAN LI) Date: Wed, 26 Mar 2014 19:16:16 +1100 Subject: [Libav-user] Will --extra-ldflags=ELDFLAGS be added to each library build? Message-ID: Hi, I added a --extra-ldflags=-Wl,-Map=out.map when configure, and then build shared libraries. When build finishes, I got an out.map in root folder, and no map file in component folder. I added this option to check what's inside each dll. I didn't build any execuatble so I assume there should be one map file for each dll. Does any one know why there's only one map file? If I build several dlls but get only one map file, what the content of the this map file supposed to be? Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: From anatoliy-leshin at yandex.ru Wed Mar 26 09:45:59 2014 From: anatoliy-leshin at yandex.ru (=?koi8-r?B?4c7B1M/Mycog7KPbyc4=?=) Date: Wed, 26 Mar 2014 12:45:59 +0400 Subject: [Libav-user] Compile libAV + libswsscale for QNX In-Reply-To: References: <1395763874328-4659484.post@n4.nabble.com> Message-ID: <4170061395823559@web30g.yandex.ru> Hi, Carl. Here is report of your configure: ~/ffmpeg/FFmpeg$ ./configure --enable-cross-compile --arch=arm --cc=qcc --target-os=qnx qcc is unable to create an executable file. C compiler test failed. 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. -------------------------------- 25.03.2014, 20:40, "Carl Eugen Hoyos" : > K4 writes: > >> ?Hello, i want to build my project that use libAV on QNX target. >> >> ?First of all i want to ask: is it possible? > > I think current FFmpeg is supported on QNX. > That being said, they were several reports that > claim one or more problems, unfortunately, none > of those reports contained the information > necessary to fix those problems;-( > > Please download current FFmpeg git head and > try to configure with (approximately) the > following: > $ ./configure --enable-cross-compile --arch=arm > --cc=qcc --target-os=qnx > > This will probably not be enough, as said, > please report back here! > > (One report indicates that --tempprefix might > be needed.) > > Carl Eugen > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user From anatoliy-leshin at yandex.ru Wed Mar 26 09:37:26 2014 From: anatoliy-leshin at yandex.ru (K4) Date: Wed, 26 Mar 2014 01:37:26 -0700 (PDT) Subject: [Libav-user] Compile libAV + libswsscale for QNX In-Reply-To: References: <1395763874328-4659484.post@n4.nabble.com> Message-ID: <1395823046108-4659495.post@n4.nabble.com> Hi, Carl. Here is report of your configure: ~/ffmpeg/FFmpeg$ ./configure --enable-cross-compile --arch=arm --cc=qcc --target-os=qnx qcc is unable to create an executable file. C compiler test failed. 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. //--------------------------------------- -- View this message in context: http://libav-users.943685.n4.nabble.com/Compile-libAV-libswsscale-for-QNX-tp4659484p4659495.html Sent from the libav-users mailing list archive at Nabble.com. From nfxjfg at googlemail.com Wed Mar 26 10:33:46 2014 From: nfxjfg at googlemail.com (wm4) Date: Wed, 26 Mar 2014 10:33:46 +0100 Subject: [Libav-user] libav h.264 vaapi encoding In-Reply-To: <1988121395769070@web19g.yandex.ru> References: <1988121395769070@web19g.yandex.ru> Message-ID: <20140326103346.24d3e74f@debian> On Tue, 25 Mar 2014 21:37:50 +0400 Nik Orlov wrote: > Hello! > > Are there any example about encoding h.264 with vaapi? > What is the way to do such encoding? Are there special codec_id for this? > > As I understand ffmpeg cli doesn`t support vaapi. But liavcodec does. > > Ffmpeg builds with vaapi support, it has autodect at configure step. > Can I include libx264 to ffmpeg binaries, and choose between x264 and vaapi h.264 encoding or I must choose at build time? > No, FFmpeg has no GPU encoding at all. Here's an absurd but relatively self-contained example how to use it: http://cgit.freedesktop.org/wayland/weston/tree/src/vaapi-recorder.c From anatoliy-leshin at yandex.ru Wed Mar 26 10:38:54 2014 From: anatoliy-leshin at yandex.ru (=?koi8-r?B?4c7B1M/Mycog7KPbyc4=?=) Date: Wed, 26 Mar 2014 13:38:54 +0400 Subject: [Libav-user] Compile libAV + libswsscale for QNX In-Reply-To: References: <1395763874328-4659484.post@n4.nabble.com> Message-ID: <98501395826734@web15h.yandex.ru> Hi, Carl. I downloaded the last version of ffmpeg and tried to configure, here is the report ~/ffmpeg/FFmpeg$ ./configure --enable-cross-compile --arch=arm --cc=qcc --target-os=qnx qcc is unable to create an executable file. C compiler test failed. 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 [hidden email] 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. //--------------------------------------- But i was able to make configure with these flags: ./configure --enable-cross-compile --arch=x86 --cc=ntox86-gcc --target-os=qnx I'm using machine with x86 architecture, so i changed your configure line a liitle, and changed compiler, because i have been recieved error "qcc is unable to create an executable file. C compiler test failed." I dont know what part of configure log u need, so: install prefix /usr/local source path . C compiler ntox86-gcc C library host C compiler gcc host C library glibc ARCH x86 (generic) big-endian no runtime cpu detection yes yasm yes MMX enabled yes MMXEXT enabled yes 3DNow! enabled yes 3DNow! extended enabled yes SSE enabled yes SSSE3 enabled yes AVX enabled yes XOP enabled yes FMA3 enabled yes FMA4 enabled yes i686 features enabled yes CMOV is fast no EBX available yes EBP available yes debug symbols yes strip symbols yes optimize for size no optimizations yes static yes shared no postprocessing support no new filter support yes network support yes threading support pthreads safe bitstream reader yes SDL support no opencl enabled no libzvbi enabled no texi2html enabled no perl enabled yes pod2man enabled yes makeinfo enabled no ........ ....... ........ Enabled indevs: lavfi Enabled outdevs: License: LGPL version 2.1 or later Creating config.mak, config.h, and doc/config.texi... config.h is unchanged config.asm is unchanged libavutil/avconfig.h is unchanged 25.03.2014, 20:40, "Carl Eugen Hoyos" : > K4 writes: > >> ?Hello, i want to build my project that use libAV on QNX target. >> >> ?First of all i want to ask: is it possible? > > I think current FFmpeg is supported on QNX. > That being said, they were several reports that > claim one or more problems, unfortunately, none > of those reports contained the information > necessary to fix those problems;-( > > Please download current FFmpeg git head and > try to configure with (approximately) the > following: > $ ./configure --enable-cross-compile --arch=arm > --cc=qcc --target-os=qnx > > This will probably not be enough, as said, > please report back here! > > (One report indicates that --tempprefix might > be needed.) > > 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 Mar 26 10:47:20 2014 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Wed, 26 Mar 2014 09:47:20 +0000 (UTC) Subject: [Libav-user] Compile libAV + libswsscale for QNX References: <1395763874328-4659484.post@n4.nabble.com> <98501395826734@web15h.yandex.ru> Message-ID: ???????? ????? writes: > But i was able to make configure with these flags: > ./configure --enable-cross-compile --arch=x86 > --cc=ntox86-gcc --target-os=qnx Does the build succeed? (And just to make sure: Is the host qnx or another system?) Did you try to run fate to check the build? Please don't top-post here, Carl Eugen From nikitos1550 at yandex.ru Wed Mar 26 10:48:30 2014 From: nikitos1550 at yandex.ru (Nik Orlov) Date: Wed, 26 Mar 2014 13:48:30 +0400 Subject: [Libav-user] libav h.264 vaapi encoding In-Reply-To: <1988121395769070@web19g.yandex.ru> Message-ID: <2122021395827310@web6j.yandex.ru> Hello! Are there any example about encoding h.264 with vaapi? What is the way to do such encoding? Are there special codec_id for this? As I understand ffmpeg cli doesn`t support vaapi. But liavcodec does. Ffmpeg builds with vaapi support, it has autodect at configure step. Can I include libx264 to ffmpeg binaries, and choose between x264 and vaapi h.264 encoding or I must choose at build time? -- Nikita mailto:nikitos1550 at yandex.ru From cehoyos at ag.or.at Wed Mar 26 10:53:28 2014 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Wed, 26 Mar 2014 09:53:28 +0000 (UTC) Subject: [Libav-user] reduce dll size References: <5331DCC3.5080206@mitre.org> Message-ID: Michael Chisholm writes: > It seems to me, what you may gain by linking to a static > lib, is that only that library code which is actually > used by the app is pulled in to the exe This is true but it (mostly) does not apply to FFmpeg: All the encoders, decoders, demuxers, muxers, parsers etc. are linked into your static executable no matter if you need them or not. If you need smaller binaries, use --disable-everything (or --disable-all) and enable the features you need. Carl Eugen From alexcohn at netvision.net.il Wed Mar 26 11:01:40 2014 From: alexcohn at netvision.net.il (Alex Cohn) Date: Wed, 26 Mar 2014 12:01:40 +0200 Subject: [Libav-user] reduce dll size In-Reply-To: References: <5331DCC3.5080206@mitre.org> Message-ID: On 26 Mar 2014 11:54, "Carl Eugen Hoyos" wrote: > > Michael Chisholm writes: > > > It seems to me, what you may gain by linking to a static > > lib, is that only that library code which is actually > > used by the app is pulled in to the exe > > This is true but it (mostly) does not apply to FFmpeg: > All the encoders, decoders, demuxers, muxers, parsers etc. > are linked into your static executable no matter if you > need them or not. ... and that's by virtue of register_all() and her kin, is that true? Alex Cohn -------------- next part -------------- An HTML attachment was scrubbed... URL: From anatoliy-leshin at yandex.ru Wed Mar 26 12:09:30 2014 From: anatoliy-leshin at yandex.ru (K4) Date: Wed, 26 Mar 2014 04:09:30 -0700 (PDT) Subject: [Libav-user] Compile libAV + libswsscale for QNX In-Reply-To: References: <1395763874328-4659484.post@n4.nabble.com> <98501395826734@web15h.yandex.ru> Message-ID: <1395832170127-4659504.post@n4.nabble.com> Yes, build succeed. I'm building the by using linux x32 host and i want to build it for qnx. I didn't run fate yet, doing it right now. -- View this message in context: http://libav-users.943685.n4.nabble.com/Compile-libAV-libswsscale-for-QNX-tp4659484p4659504.html Sent from the libav-users mailing list archive at Nabble.com. From anatoliy-leshin at yandex.ru Wed Mar 26 12:56:02 2014 From: anatoliy-leshin at yandex.ru (K4) Date: Wed, 26 Mar 2014 04:56:02 -0700 (PDT) Subject: [Libav-user] Compile libAV + libswsscale for QNX In-Reply-To: <1395832170127-4659504.post@n4.nabble.com> References: <1395763874328-4659484.post@n4.nabble.com> <98501395826734@web15h.yandex.ru> <1395832170127-4659504.post@n4.nabble.com> Message-ID: <1395834962629-4659505.post@n4.nabble.com> Carl, i can't do a fate test, because i can't get Samples with "make fate-rsync". Sockets are closed by proxy and i can do nothing with it (not in my power). Is there another option how to check build or how to get samples another way? -- View this message in context: http://libav-users.943685.n4.nabble.com/Compile-libAV-libswsscale-for-QNX-tp4659484p4659505.html Sent from the libav-users mailing list archive at Nabble.com. From cehoyos at ag.or.at Wed Mar 26 13:38:33 2014 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Wed, 26 Mar 2014 12:38:33 +0000 (UTC) Subject: [Libav-user] Compile libAV + libswsscale for QNX References: <1395763874328-4659484.post@n4.nabble.com> <98501395826734@web15h.yandex.ru> <1395832170127-4659504.post@n4.nabble.com> <1395834962629-4659505.post@n4.nabble.com> Message-ID: K4 writes: > Carl, i can't do a fate test, because i can't > get Samples with "make fate-rsync". Sockets are > closed by proxy and i can do nothing with it (not > in my power). (Some tests don't need fate-rsync.) You can scp them from another computer. The more difficult part is that you have to pass --target-exec, --target-path and --target-samples to configure (but a few tests will still fail). Can you ssh to your qnx box? If not, no fate tests will be possible. The other requirement is that you have to mount your build directory on the other system, ie either build in a directory that is physically on the qnx hardware or mount your Linux build directory on the qnx system. Carl Eugen From anatoliy-leshin at yandex.ru Wed Mar 26 14:38:56 2014 From: anatoliy-leshin at yandex.ru (K4) Date: Wed, 26 Mar 2014 06:38:56 -0700 (PDT) Subject: [Libav-user] Compile libAV + libswsscale for QNX In-Reply-To: References: <1395763874328-4659484.post@n4.nabble.com> <98501395826734@web15h.yandex.ru> <1395832170127-4659504.post@n4.nabble.com> <1395834962629-4659505.post@n4.nabble.com> Message-ID: <1395841136450-4659507.post@n4.nabble.com> Carl Eugen Hoyos wrote > (Some tests don't need fate-rsync.) > You can scp them from another computer. Ok, if any tests are available in ffmpeg git repository - i can run them, but i really cant get samples right now. Carl Eugen Hoyos wrote > The more difficult part is that you have to pass > --target-exec, --target-path and --target-samples > to configure (but a few tests will still fail). > Can you ssh to your qnx box? If not, no fate tests > will be possible. The other requirement is that > you have to mount your build directory on the other > system, ie either build in a directory that is > physically on the qnx hardware or mount your Linux > build directory on the qnx system. Yes, i can ssh to qnx box. So i can build on qnx box, or i can crosscompile on Linux and then copy it to qnx box. -- View this message in context: http://libav-users.943685.n4.nabble.com/Compile-libAV-libswsscale-for-QNX-tp4659484p4659507.html Sent from the libav-users mailing list archive at Nabble.com. From quy.tangphuong at gmail.com Wed Mar 26 08:04:08 2014 From: quy.tangphuong at gmail.com (=?UTF-8?B?VMSDbmcgUGjGsMahbmcgUXXDvQ==?=) Date: Wed, 26 Mar 2014 14:04:08 +0700 Subject: [Libav-user] Convert AMR NB to PCM problem Message-ID: Dear sir, I need to convert in memory amr file to pcm, but after it has been coverted, the data was far different from the original and double the audio sample. Here is my code: #define AUDIO_INBUF_SIZE 20480#define AUDIO_REFILL_THRESH 4096#define AMR_NB_HEADER_SIZE 6#define WAV_RIFF_HEADER_SIZE 44#define OGG_POLYMNOMIAL 0x04C11DB7#define OGG_PAGE_HEADER 27 class Buffer {public: void* buffer; int size; public: Buffer() { buffer = NULL; size = 0; } void resize(int newSize) { if (newSize > 0 && newSize != size) { size = newSize; buffer = realloc(buffer, size); } } void extend(int extendSize) { if (extendSize > 0) { size += extendSize; buffer = realloc(buffer, size); } } void free() { size = 0; if (buffer != NULL) { ::free(buffer); buffer = NULL; } }};void AudioProcessor::fillPCMRIFFHeader(void* buffer, int16_t channels, int16_t bps, int pcmSizeInBytes, int samplingRate) { //ChunkID - RIFF *((int8_t*) buffer) = 0x52; *((int8_t*) buffer + 1) = 0x49; *((int8_t*) buffer + 2) = 0x46; *((int8_t*) buffer + 3) = 0x46; //ChunkSize *((int32_t *) ((int8_t*) buffer + 4)) = 36 + pcmSizeInBytes; //Format - WAVE *((int8_t*) buffer + 8) = 0x57; *((int8_t*) buffer + 9) = 0x41; *((int8_t*) buffer + 10) = 0x56; *((int8_t*) buffer + 11) = 0x45; //Subchunk1ID - "fmt " *((int8_t*) buffer + 12) = 0x66; *((int8_t*) buffer + 13) = 0x6d; *((int8_t*) buffer + 14) = 0x74; *((int8_t*) buffer + 15) = 0x20; //Subchunk1Size *((int8_t*) buffer + 16) = 0x10; *((int8_t*) buffer + 17) = 0x00; *((int8_t*) buffer + 18) = 0x00; *((int8_t*) buffer + 19) = 0x00; //AudioFormat *((int8_t*) buffer + 20) = 0x01; *((int8_t*) buffer + 21) = 0x00; //NumChannels if (channels == 2) { *((int8_t*) buffer + 22) = 0x2; } else { *((int8_t*) buffer + 22) = 0x1; } *((int8_t*) buffer + 23) = 0x00; //SampleRate *((int32_t *)((int8_t*) buffer + 24)) = samplingRate; //ByteRate *((int32_t *)((int8_t*) buffer + 28)) = samplingRate * 2; //BlockAlign *((int16_t *)((int8_t*) buffer + 32)) = 2; //BitsPerSample *((int16_t *)((int8_t*) buffer + 34)) = 16; //Subchunk2ID - data *((int8_t*) buffer + 36) = 0x64; *((int8_t*) buffer + 37) = 0x61; *((int8_t*) buffer + 38) = 0x74; *((int8_t*) buffer + 39) = 0x61; //Subchunk2Size *((int32_t *)((int8_t*) buffer + 40)) = pcmSizeInBytes;}void AudioProcessor::amrnbToPCM(const Buffer* in, Buffer* out) { AVCodec *codec; AVCodecContext *c = NULL; int len; uint8_t inbuf[AUDIO_INBUF_SIZE + FF_INPUT_BUFFER_PADDING_SIZE]; AVPacket avpkt; AVFrame *decoded_frame = NULL; av_init_packet(&avpkt); codec = avcodec_find_decoder(AV_CODEC_ID_AMR_NB); if (!codec) { return; } c = avcodec_alloc_context3(codec); if (!c) { return; } if (avcodec_open2(c, codec, NULL) < 0) { return; } avpkt.data = inbuf; int inOffset = AUDIO_INBUF_SIZE; if (inOffset > in->size - AMR_NB_HEADER_SIZE) { inOffset = in->size - AMR_NB_HEADER_SIZE; } printf("inOffset: %d\n", inOffset); memcpy(inbuf, (int8_t*) in->buffer + AMR_NB_HEADER_SIZE, inOffset); avpkt.size = inOffset; avpkt.dts = avpkt.pts = AV_NOPTS_VALUE; inOffset += AMR_NB_HEADER_SIZE; printf("inOffset: %d\n", inOffset); printf("outSize: %d\n", out->size); out->resize(60000); printf("outSize: %d\n", out->size); int outLen = WAV_RIFF_HEADER_SIZE; decoded_frame = av_frame_alloc(); int sampleRate = 8000; while (avpkt.size > 0) { int got_frame = 0; if (!decoded_frame) { decoded_frame = av_frame_alloc(); } len = avcodec_decode_audio4(c, decoded_frame, &got_frame, &avpkt); if (len < 0) { printf("break\n"); break; } printf("gotframe: %d - %d\n", got_frame, len); if (got_frame) { int data_size = av_samples_get_buffer_size(NULL, c->channels, decoded_frame->nb_samples, c->sample_fmt, 1); sampleRate = decoded_frame->sample_rate; while (outLen + data_size > out->size) { out->extend(6000); } memcpy((int8_t*) out->buffer + outLen, decoded_frame->data[0], data_size); outLen += data_size; av_frame_free(&decoded_frame); decoded_frame = NULL; } avpkt.size -= len; avpkt.data += len; avpkt.dts = avpkt.pts = AV_NOPTS_VALUE; if (avpkt.size < AUDIO_REFILL_THRESH && inOffset < in->size) { if (avpkt.size > 0) { memmove(inbuf, avpkt.data, avpkt.size); } avpkt.data = inbuf; if (inOffset + len > in->size) { len = in->size - inOffset; } if (len > 0) { memcpy(avpkt.data + avpkt.size, (int8_t*)in->buffer + inOffset, len); inOffset += len; avpkt.size += len; } } } int pcmSizeInBytes = outLen - WAV_RIFF_HEADER_SIZE; fillPCMRIFFHeader(out->buffer, 1, 16, pcmSizeInBytes, sampleRate); out->size = outLen; avcodec_close(c); av_free(c); if (decoded_frame) { av_frame_free(&decoded_frame); } } Please help me pointing out what I am wrong. Input file: http://www.mediafire.com/download/0kw3n35z363x9ka/_01.amr Thank you very much, QuyTang -------------- next part -------------- An HTML attachment was scrubbed... URL: From gedikmert89 at gmail.com Thu Mar 27 09:27:41 2014 From: gedikmert89 at gmail.com (Mert Gedik) Date: Thu, 27 Mar 2014 10:27:41 +0200 Subject: [Libav-user] Recording an RTSP stream Message-ID: Hello devs, I've successfully implement my rtsp player and now I want to save AVPackets WITHOUT any transcoding... I don't want to change any property or any setting in the stream, just want to save these AVPackets to a file with the identically same as the original rtsp stream, I've searched this on the internet and find some useful codes/infos how ever, they have all some problems like wrong FPS, AV sync, etc. (for example: http://bluexmas.tistory.com/272) Could someone help me about how to save an RTSP stream without any transcoding ... Thanks, -MG -------------- next part -------------- An HTML attachment was scrubbed... URL: From roman.fietze at telemotive.de Thu Mar 27 09:57:03 2014 From: roman.fietze at telemotive.de (Roman Fietze) Date: Thu, 27 Mar 2014 09:57:03 +0100 Subject: [Libav-user] Recording an RTSP stream In-Reply-To: References: Message-ID: <3048366.Tv1HT3FkkK@rfietze> Hello Mert, On Thu, 27.03.2014 10:27:41 Mert Gedik wrote: > I've successfully implement my rtsp player and now I want to save AVPackets > WITHOUT any transcoding... I'm doing something like that. I stream media from up to four AXIS-Cameras using RTSP and libav 2.1.4 w/o decoding the frames/packets, just looking at their flags, and cut them into pieces every let's say 60 seconds, so the resulting files don't get too large. > I don't want to change any property or any setting in the stream I'm not sure if you will get away that easiliy. I had to rescale DTS/PTS and durtion in order to be able to play those clips. But the image and audio data is absolutley untouched. If you want me to post some (the relevant parts) of my work, just let me know. I've written a very small test program to test the code bevor trying to get it work in our "big" SW. Probably that can help you a little bit. Roman -- Roman Fietze Telemotive AG Buero Muehlhausen Breitwiesen 73347 Muehlhausen Tel.: +49(0)7335/18493-45 http://www.telemotive.de From foerster at ifoerster.com Thu Mar 27 10:46:18 2014 From: foerster at ifoerster.com (Ingo Foerster) Date: Thu, 27 Mar 2014 10:46:18 +0100 Subject: [Libav-user] RAW DTS difference Message-ID: <1666568823.20140327104618@ifoerster.com> Hello, i have following issue: I have a DTS stream ready to mux into different video files. I muxed into a M2ts and also into a MKV. Both with h264 video stream. Now I open the packets I get from the ffmpeg decoder and the M2TS audio packages are equal to the DTS I muxed in. IF I open the MKV with ffmpeg and compare the RAW packages, they are different. Do ffmpeg mux additional data to the dts in MKV? Like PTS info? Ingo From gedikmert89 at gmail.com Thu Mar 27 12:23:23 2014 From: gedikmert89 at gmail.com (Mert Gedik) Date: Thu, 27 Mar 2014 13:23:23 +0200 Subject: [Libav-user] Recording an RTSP stream In-Reply-To: <3048366.Tv1HT3FkkK@rfietze> References: <3048366.Tv1HT3FkkK@rfietze> Message-ID: Hello Roman, Thanks for the info you gave, I am appreciated If you share an example of how to do that you mentioned, Regards, - MG On Thu, Mar 27, 2014 at 10:57 AM, Roman Fietze wrote: > Hello Mert, > > On Thu, 27.03.2014 10:27:41 Mert Gedik wrote: > > > I've successfully implement my rtsp player and now I want to save > AVPackets > > WITHOUT any transcoding... > > I'm doing something like that. I stream media from up to four > AXIS-Cameras using RTSP and libav 2.1.4 w/o decoding the > frames/packets, just looking at their flags, and cut them into pieces > every let's say 60 seconds, so the resulting files don't get too > large. > > > I don't want to change any property or any setting in the stream > > I'm not sure if you will get away that easiliy. I had to rescale > DTS/PTS and durtion in order to be able to play those clips. > > But the image and audio data is absolutley untouched. > > If you want me to post some (the relevant parts) of my work, just let > me know. I've written a very small test program to test the code bevor > trying to get it work in our "big" SW. Probably that can help you a > little bit. > > > Roman > > -- > Roman Fietze Telemotive AG Buero Muehlhausen > Breitwiesen 73347 Muehlhausen > Tel.: +49(0)7335/18493-45 http://www.telemotive.de > > _______________________________________________ > 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 anatoliy-leshin at yandex.ru Thu Mar 27 14:01:49 2014 From: anatoliy-leshin at yandex.ru (K4) Date: Thu, 27 Mar 2014 06:01:49 -0700 (PDT) Subject: [Libav-user] Compile libAV + libswsscale for QNX In-Reply-To: References: <1395763874328-4659484.post@n4.nabble.com> <98501395826734@web15h.yandex.ru> <1395832170127-4659504.post@n4.nabble.com> <1395834962629-4659505.post@n4.nabble.com> Message-ID: <1395925309744-4659513.post@n4.nabble.com> Hey again, Carl. I want to ask you the main question: I have my project that uses libavcodec (i use only video decoding). When i build it for Linux - all is ok, project builds, runs and work correctly. But when i try to cross compile it for qnx - i have problems with includes. There are headers of libav: #include "libswscale/swscale.h" #include "libavcodec/avcodec.h" #include "libavformat/avformat.h" #include "libavutil/channel_layout.h" #include "libavutil/common.h" #include "libavutil/imgutils.h" #include "libavutil/mathematics.h" #include "libavutil/samplefmt.h" ------------------------------------------------ These headers are wrote by using "C" language and when i'm compilile it under Linux i just use "extern "C" " and all is ok. extern "C" { #include "libswscale/swscale.h" #include "libavcodec/avcodec.h" #include "libavformat/avformat.h" #include "libavutil/channel_layout.h" #include "libavutil/common.h" #include "libavutil/imgutils.h" #include "libavutil/mathematics.h" #include "libavutil/samplefmt.h" } ----------------------------------------------- But when i compile it for qnx i have mistakes: /opt/qnx650/target/qnx6//usr/include/xtgmath.h:116: error: template with C linkage /opt/qnx650/target/qnx6//usr/include/xtgmath.h:150: error: template with C linkage /opt/qnx650/target/qnx6//usr/include/xtgmath.h:157: error: template with C linkage It happens because libav headers includes another headers (xtgmath.h for example) and they have c++ stuff inside. So i cannot simply wrap libav headers with "extern "C" ". Do you know how to fix it? -- View this message in context: http://libav-users.943685.n4.nabble.com/Compile-libAV-libswsscale-for-QNX-tp4659484p4659513.html Sent from the libav-users mailing list archive at Nabble.com. From ggarra13 at gmail.com Thu Mar 27 15:49:24 2014 From: ggarra13 at gmail.com (Gonzalo Garramuno) Date: Thu, 27 Mar 2014 11:49:24 -0300 Subject: [Libav-user] h264 illegal short term buffer state detected Message-ID: <53343A74.3020402@gmail.com> After upgrading to 2.1, I am getting in my player for a h264 movie. "illegal short term buffer state detected" whenever I stop the playback and resume it immediately. When I stop the playback I flush all caches. I am wondering if someone can explain what might be causing it. ffplay seems fine, thou, so it is something I am probably doing wrong. From nfxjfg at googlemail.com Thu Mar 27 15:55:10 2014 From: nfxjfg at googlemail.com (wm4) Date: Thu, 27 Mar 2014 15:55:10 +0100 Subject: [Libav-user] h264 illegal short term buffer state detected In-Reply-To: <53343A74.3020402@gmail.com> References: <53343A74.3020402@gmail.com> Message-ID: <20140327155510.2a48265e@debian> On Thu, 27 Mar 2014 11:49:24 -0300 Gonzalo Garramuno wrote: > After upgrading to 2.1, I am getting in my player for a h264 movie. > > "illegal short term buffer state detected" > > whenever I stop the playback and resume it immediately. When I stop the > playback I flush all caches. > > I am wondering if someone can explain what might be causing it. > ffplay seems fine, thou, so it is something I am probably doing wrong. If by flushing the caches you mean dropping packet data and/or flushing the decoder just for pausing, you can't do that. Either you don't drop/flush anything, or you have to issue a seek to resume playback properly. From ggarra13 at gmail.com Thu Mar 27 18:01:40 2014 From: ggarra13 at gmail.com (Gonzalo Garramuno) Date: Thu, 27 Mar 2014 14:01:40 -0300 Subject: [Libav-user] h264 illegal short term buffer state detected In-Reply-To: <20140327155510.2a48265e@debian> References: <53343A74.3020402@gmail.com> <20140327155510.2a48265e@debian> Message-ID: <53345974.4070604@gmail.com> On 27/03/14 11:55, wm4 wrote: > If by flushing the caches you mean dropping packet data and/or > flushing the decoder just for pausing, you can't do that. I drop the packets and flush the decoder. > Either you don't drop/flush anything, or you have to issue a seek to > resume playback properly. I do exactly the second option. I issue a seek before playback. I found that ensures a better audio/video sync. Yet I get the error. The ffmpeg error appears but visually I see no change ( the video is normal ). It seems the error should be a warning instead. From nfxjfg at googlemail.com Thu Mar 27 18:23:05 2014 From: nfxjfg at googlemail.com (wm4) Date: Thu, 27 Mar 2014 18:23:05 +0100 Subject: [Libav-user] h264 illegal short term buffer state detected In-Reply-To: <53345974.4070604@gmail.com> References: <53343A74.3020402@gmail.com> <20140327155510.2a48265e@debian> <53345974.4070604@gmail.com> Message-ID: <20140327182305.0f2c5f3a@debian> On Thu, 27 Mar 2014 14:01:40 -0300 Gonzalo Garramuno wrote: > On 27/03/14 11:55, wm4 wrote: > > If by flushing the caches you mean dropping packet data and/or > > flushing the decoder just for pausing, you can't do that. > I drop the packets and flush the decoder. > > Either you don't drop/flush anything, or you have to issue a seek to > > resume playback properly. > I do exactly the second option. I issue a seek before playback. I > found that ensures a better audio/video sync. Yet I get the error. > > The ffmpeg error appears but visually I see no change ( the video is > normal ). It seems the error should be a warning instead. Then you should see the same error when seeking with ffplay. (AFAIK you have to click with the mouse to seek or something.) From francesco at bltitalia.com Thu Mar 27 18:21:32 2014 From: francesco at bltitalia.com (Francesco BLT) Date: Thu, 27 Mar 2014 17:21:32 +0000 (UTC) Subject: [Libav-user] =?utf-8?q?Decoding_XDCAM_4=3A2=3A2_using_libavcodec-?= =?utf-8?q?5=2E5_=3A_error_0xbebbb1b7_=28AVERROR=5FINVALIDDATA=29?= Message-ID: Hi to all I have written a code for decoding IMX-D10 at 30, 40 and 50 M and works fine. Attempting to decode XDCAM 4:2:2 at 1920x1080 it seems that only first frame (I-Frame) is decoded. After this I receive the error 0xbebbbb1b7 from avcodec_decode_video2 routine. Here is the code: pCodec = NULL; pFrame = NULL; pCodecCtx = NULL; av_init_packet(&packet); pCodec=avcodec_find_decoder(CODEC_ID_MPEG2VIDEO); if( pCodec==NULL) { str1.printf("Error at frame %ld: Unable to find CODEC_ID_MPEG2VIDEO exited",frmcnt,err);smsmemo->Memo1->Lines->Add(str1); errDS10 = -3; goto end_convDS10; } pCodecCtx = avcodec_alloc_context3(pCodec); // Allocate video frame pFrame=avcodec_alloc_frame(); // Open codec if(avcodec_open2(pCodecCtx, pCodec,NULL)<0) { smsmemo->Memo1->Lines->Add("Unable to open codec!"); errDS10 = -5; goto end_convDS10;} packet.size = bfsz; // This is the size passed to the routine packet.data = fbuf; // This is the buffer passed to the routine frameFinished = 1; err = 0; do { // Decode video frame err = avcodec_decode_video2(pCodecCtx, pFrame, &frameFinished,&packet); if(err<0) { str1.printf("Error (%lx) at frame %ld returned from avcodec_decode_video2, exited",err,frmcnt); smsmemo->Memo1->Lines->Add(str1); errDS10 = -7; goto end_convDS10; } Application->ProcessMessages(); } while ((!frameFinished)&&(packet.size>0)) ; The first frame is decoded correctly; is an I-Frame and these are the first bytes of header: 00 00 01 B3 78 04 38 33 7A 12 22 02 10 20 20 26 20 26 2C 2C 2C 2C 2C 2C 34 30 34 36 36 36 34 34 34 34 36 36 36 3A 3A 3A 44 44 44 3A 3A 3A 36 36 3A 3A 40 40 44 44 4A 4C 4A 46 46 44 46 4C 4C 50 50 50 60 60 5C 5C 70 70 74 8A 8A A7 10 11 11 12 12 12 13 13 13 13 14 14 14 14 14 15 15 15 15 15 15 16 16 16 16 16 16 16 17 17 17 17 17 17 17 17 18 18 18 19 18 18 18 19 1A 1A 1A 1A 19 1B 1B 1B 1B 1B 1C 1C 1C 1C 1E 1E 1E 1F 1F 21 00 00 01 B5 18 24 00 01 01 00 00 00 01 B5 21 01 01 01 1E 02 21 C0 00 00 01 B8 00 08 00 40 00 00 01 00 00 8B 22 10 00 00 00 01 B5 ... as you can see from first pachet header (00 00 00 01 00) is an I-Frame (byte 5 is 0x8B that is 10001011 and insulating bits 3,4 and 5 we have 1 => I-Frame). Second packet is an B frame, here is header: 00 00 01 00 00 1A D7 83 B8 00 00 01 B5 84 45 4B 9C 00 00 00 01 B5 38 40 80 80 98 80 98 B0 B0 B0 B0 B0 B0 D0 C0 D0 D8 D8 D8 D0 D0 D0 D0 D8 D8 D8 E8 E8 E9 11 11 10 E8 E8 E8 D8 D8 E8 E9 01 01 11 11 29 31 29 19 19 11 19 31 we have 0x1a that is 00011010 and now bits 3,4and 5 are 011 that identify a B-Frame. I receive error till next I frame. There is something I'm missing or it's a bug (or limit ) of this version of libavcodec ? Regards From info at non-lethal-applications.com Thu Mar 27 22:37:35 2014 From: info at non-lethal-applications.com (Info || Non-Lethal Applications) Date: Thu, 27 Mar 2014 22:37:35 +0100 Subject: [Libav-user] Replacement for release_buffer Message-ID: I?m fairly new to ffmpeg. Thus, I worked through the excellent tutorials of Stephen Dranger. In his tutorial number 5, he presents a method to get the correct pts of a given frame. This involves setting a custom get_buffer and release_buffer function to the AVCodecContext. As both of these are now deprecated, I used get_buffer2 but I couldn?t get a replacement for release_buffer. Could anyone point me in the right direction? Thanks! Best, Flo From nfxjfg at googlemail.com Thu Mar 27 23:04:06 2014 From: nfxjfg at googlemail.com (wm4) Date: Thu, 27 Mar 2014 23:04:06 +0100 Subject: [Libav-user] Replacement for release_buffer In-Reply-To: References: Message-ID: <20140327230406.5bab68ff@debian> On Thu, 27 Mar 2014 22:37:35 +0100 Info || Non-Lethal Applications wrote: > I?m fairly new to ffmpeg. Thus, I worked through the excellent tutorials of Stephen Dranger. > In his tutorial number 5, he presents a method to get the correct pts of a given frame. > > This involves setting a custom get_buffer and release_buffer function to the AVCodecContext. > As both of these are now deprecated, I used get_buffer2 but I couldn?t get a replacement for release_buffer. > > Could anyone point me in the right direction? You don't need get_buffer/release_buffer to get the PTS. The tutorial is probably hopelessly outdated (as the FFmpeg API moves fast), and will do more damage than it helps in any way. If you really want to use get_buffer2 (which you probably don't), then read the comment surrounding it: you need to setup an AVBuffer reference, which is released when the frame is released. If you just want the PTS, look at AVFrame.pkt_pts and pkt_dts. From lou at lrcd.com Fri Mar 28 00:04:07 2014 From: lou at lrcd.com (Lou) Date: Thu, 27 Mar 2014 15:04:07 -0800 Subject: [Libav-user] Replacement for release_buffer In-Reply-To: References: Message-ID: <20140327150407.1cfe9793@lrcd.com> On Thu, 27 Mar 2014 22:37:35 +0100 Info || Non-Lethal Applications wrote: > I?m fairly new to ffmpeg. Thus, I worked through the excellent tutorials of Stephen Dranger. An updated version of that tutorial is: https://github.com/chelyaev/ffmpeg-tutorial From info at non-lethal-applications.com Fri Mar 28 00:16:03 2014 From: info at non-lethal-applications.com (Info || Non-Lethal Applications) Date: Fri, 28 Mar 2014 00:16:03 +0100 Subject: [Libav-user] Replacement for release_buffer In-Reply-To: <20140327150407.1cfe9793@lrcd.com> References: <20140327150407.1cfe9793@lrcd.com> Message-ID: <5FE6CB5F-0AA9-4BE4-AF30-C8C08DA28A9E@non-lethal-applications.com> I have seen this update but it also still uses both a custom get_buffer (the tut was updated to use get_buffer2) and a custom release_buffer. My custom get_buffer is called but the release_buffer is not. Thus, I'm allocating memory I can't free (or at least I wouldn't know where the best place would be). Stephen Dranger wrote that there are certain circumstances where the pts is not correct and thus he introduced this get/release buffer workaround to always retrieve a correct pts. Can anyone tell me if this is still required? I'd just like to be sure to always get the correct pts. Thanks! > On 28.03.2014, at 00:04, Lou wrote: > > On Thu, 27 Mar 2014 22:37:35 +0100 > Info || Non-Lethal Applications > wrote: > >> I?m fairly new to ffmpeg. Thus, I worked through the excellent tutorials of Stephen Dranger. > > An updated version of that tutorial is: > https://github.com/chelyaev/ffmpeg-tutorial > _______________________________________________ > 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 nfxjfg at googlemail.com Fri Mar 28 00:29:26 2014 From: nfxjfg at googlemail.com (wm4) Date: Fri, 28 Mar 2014 00:29:26 +0100 Subject: [Libav-user] Replacement for release_buffer In-Reply-To: <5FE6CB5F-0AA9-4BE4-AF30-C8C08DA28A9E@non-lethal-applications.com> References: <20140327150407.1cfe9793@lrcd.com> <5FE6CB5F-0AA9-4BE4-AF30-C8C08DA28A9E@non-lethal-applications.com> Message-ID: <20140328002926.164b4527@debian> On Fri, 28 Mar 2014 00:16:03 +0100 Info || Non-Lethal Applications wrote: > I have seen this update but it also still uses both a custom get_buffer (the tut was updated to use get_buffer2) and a custom release_buffer. It combines get_buffer2 with release_buffer, which is complete non-sense. Now I don't want to talk badly about them, but I wouldn't try to learn from a tutorial from people who don't know what they're doing. The best way to guess how ffmpeg is supposed to work is probably still looking at ffplay.c. > My custom get_buffer is called but the release_buffer is not. Thus, I'm allocating memory I can't free (or at least I wouldn't know where the best place would be). get_buffer is legacy, and get_buffer2 is not used with release_buffer. > Stephen Dranger wrote that there are certain circumstances where the pts is not correct and thus he introduced this get/release buffer workaround to always retrieve a correct pts. > > Can anyone tell me if this is still required? I'd just like to be sure to always get the correct pts. No. From mrfun.china at gmail.com Fri Mar 28 04:32:30 2014 From: mrfun.china at gmail.com (YIRAN LI) Date: Fri, 28 Mar 2014 14:32:30 +1100 Subject: [Libav-user] reduce dll size In-Reply-To: References: <5331DCC3.5080206@mitre.org> Message-ID: Hi friends, Here are some update. I added a --extra-ldflags=-Wl,-Map=out.map as configure option and then was able to generate the map file. And from it I can see that .text and .rdata sections occupy most space of the dll. Since map file also tells which object file introduces how much space into .text and .rdata. I could easily figure out what codecs I should remove to save space. Another thing is, objects statically linked into avcodec from external libraries are quite smaller. There do have some objects from libgcc, libmingw32 that is built into avcodec, but the total size in .text and .rdata is just about 30-50K which is negligible. 2014-03-26 21:01 GMT+11:00 Alex Cohn : > On 26 Mar 2014 11:54, "Carl Eugen Hoyos" wrote: > > > > Michael Chisholm writes: > > > > > It seems to me, what you may gain by linking to a static > > > lib, is that only that library code which is actually > > > used by the app is pulled in to the exe > > > > This is true but it (mostly) does not apply to FFmpeg: > > All the encoders, decoders, demuxers, muxers, parsers etc. > > are linked into your static executable no matter if you > > need them or not. > > ... and that's by virtue of register_all() and her kin, is that true? > > Alex Cohn > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mrfun.china at gmail.com Fri Mar 28 04:52:15 2014 From: mrfun.china at gmail.com (YIRAN LI) Date: Fri, 28 Mar 2014 14:52:15 +1100 Subject: [Libav-user] reduce dll size In-Reply-To: References: <5331DCC3.5080206@mitre.org> Message-ID: Sorry for top posting, email mistakenly sent before finished :D As I said in last mail, statically linked external objects are quite small in avcodec, and all other reference like strlen strcpy is to msvcrt.dll, so I think the answer to common code duplication in dlls is no. So the options I have now is, either to manually disable some codecs, or, to remove some never used exported functions. My version of libavcode exports 285 functions, and a part of them won't be used in my program. (but may be used in avcodec itself, like those ff_*** ). So what I'd like to know is, can I first remove the function names from libavcodec.v (so that symbols are not exported), and then build and strip. If a function is never used in libavcodec and is only for export purpose, will exclude it from export causes strip to remove it completely? (because it's not used, and not exported). I know is more about a ld problem than a ffmpeg problem. But really need your help. Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: From harry at gps-laptimer.de Fri Mar 28 09:17:06 2014 From: harry at gps-laptimer.de (Harald Schlangmann) Date: Fri, 28 Mar 2014 09:17:06 +0100 Subject: [Libav-user] Replacement for release_buffer In-Reply-To: <20140328002926.164b4527@debian> References: <20140327150407.1cfe9793@lrcd.com> <5FE6CB5F-0AA9-4BE4-AF30-C8C08DA28A9E@non-lethal-applications.com> <20140328002926.164b4527@debian> Message-ID: <17EE3AD1-A408-4484-996E-621383B3E591@gps-laptimer.de> On 28.03.2014, at 00:29, wm4 wrote: >> Stephen Dranger wrote that there are certain circumstances where the pts is not correct and thus he introduced this get/release buffer workaround to always retrieve a correct pts. >> >> Can anyone tell me if this is still required? I'd just like to be sure to always get the correct pts. > > No. The correct way to retrieve the pts is av_frame_get_best_effort_timestamp now, correct? - Harald - Harald Schlangmann Antwerpener Str. 52, 50672 K?ln, Germany +49 151 2265 4439 Harry at gps-laptimer.de www.gps-laptimer.de -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 4145 bytes Desc: not available URL: From xenosender at gmail.com Fri Mar 28 10:18:01 2014 From: xenosender at gmail.com (cyril poulet) Date: Fri, 28 Mar 2014 10:18:01 +0100 Subject: [Libav-user] Motion estimation : replacement for deprecated AVFrame::motion_val ? In-Reply-To: <20140325144024.549720d1@debian> References: <5331632C.2020605@codemill.se> <5331768F.4030907@codemill.se> <7aef8fb0c1fc50e799b13b8f102bcb2c@kral.hk> <20140325144024.549720d1@debian> Message-ID: As a matter of fact, I wanted to use them for computer vision, where calculating edge densities and motion estimation are important. Now that these are deprecated, the only way is to first decode each frame then re-calculate MVs and DCTs, which is computationnally costly... 2014-03-25 14:40 GMT+01:00 wm4 : > On Tue, 25 Mar 2014 13:50:48 +0100 > Vojt?ch Kr?l wrote: > > > > > > > On 2014-03-25 13:29, Tomas H?rdin wrote: > > > > > Please avoid top posting on these lists - it's considered bad form. > > > > > > On 2014-03-25 12:10, cyril poulet wrote: > > > > > > 2014-03-25 12:06 GMT+01:00 Tomas H?rdin : > > > > > > On 2014-03-25 11:29, cyril poulet wrote: > > > Hi all > > > As others who already posted on this matter but got no answers, I'm > trying to get motion vectors from h264 codec (P-frames). > > > Before v2, they seemed to be available in AVFrame::motion_val, (along > with motion_subsample_log2 and mb_type), which are now deprecated. > > > > > > Is there any way to get these values since v2 ? > > > > > > (I'm also interested in getting back the dct_coeff for I-frames, but > something tells me that all these questions are linked) I think the general > direction nowadays is to hide such internals. If you want access to this > stuff in the future you'll have to fork and hack the functionality in > > > > > > /Tomas > > > > > So i've understood, but I don't really see why these values are not > available anymore. I realize that messing with the internals of various > codecs is not why libav is made for, but these fields are calculated > anyway, so why not propagate it to the AVFrame ? > > > > Because they're internal, and having them exposed hampers refactoring > > efforts. If you want stuff to remain "like before" then just use some > > specific old version of ffmpeg in your application (or even a specific > > commit) > > > > /Tomas > > > > That's a rather evasive answer... I myself would too welcome if the API > > for access to internals such as DCTs and MVs was preserved (mostly for > > academical / experimental purposes, as I'm working on a bc thesis > > concerning video right now). Refactoring is a great thing, but it > > doesn't have to entail removing funcionality... > > As far as I know, the API was deprecated by Libav. Libav also removed > the implementation of these. FFmpeg merged the deprecation, but not the > removal of the implementation (or at least not all of it). So there's > hope for you to convince the developers to un-deprecate it. > _______________________________________________ > 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 nfxjfg at googlemail.com Fri Mar 28 18:54:06 2014 From: nfxjfg at googlemail.com (wm4) Date: Fri, 28 Mar 2014 18:54:06 +0100 Subject: [Libav-user] Replacement for release_buffer In-Reply-To: <17EE3AD1-A408-4484-996E-621383B3E591@gps-laptimer.de> References: <20140327150407.1cfe9793@lrcd.com> <5FE6CB5F-0AA9-4BE4-AF30-C8C08DA28A9E@non-lethal-applications.com> <20140328002926.164b4527@debian> <17EE3AD1-A408-4484-996E-621383B3E591@gps-laptimer.de> Message-ID: <20140328185406.38d08e04@debian> On Fri, 28 Mar 2014 09:17:06 +0100 Harald Schlangmann wrote: > On 28.03.2014, at 00:29, wm4 wrote: > > >> Stephen Dranger wrote that there are certain circumstances where the pts is not correct and thus he introduced this get/release buffer workaround to always retrieve a correct pts. > >> > >> Can anyone tell me if this is still required? I'd just like to be sure to always get the correct pts. > > > > No. > > The correct way to retrieve the pts is av_frame_get_best_effort_timestamp now, correct? Yes, but it's better to determine it from pkt_pts and pkt_dts, because best_effort_timestamp doesn't exist on Libav. From lucas.soltic at orange.fr Fri Mar 28 21:19:55 2014 From: lucas.soltic at orange.fr (Lucas Soltic) Date: Fri, 28 Mar 2014 21:19:55 +0100 Subject: [Libav-user] av_frame_get_best_effort_timestamp(): PTS or DTS? Message-ID: Hello! Does av_frame_get_best_effort_timestamp() gives a PTS or DTS? At first I would have thought it's a PTS, because it's impossible for decoding to correctly happen if DTS does not exist in the packet, but then I read that the packet DTS may be AV_NOPTS_VALUE (DTS being a NOPTS..??!). If that is correct, is there a reliable way to know the DTS too (in the core meaning of DTS, even if the file does not set it)? Thanks, Lucas From perez.didac at gmail.com Fri Mar 28 22:03:56 2014 From: perez.didac at gmail.com (=?ISO-8859-1?Q?D=EDdac_P=E9rez?=) Date: Fri, 28 Mar 2014 22:03:56 +0100 Subject: [Libav-user] av_frame_get_best_effort_timestamp(): PTS or DTS? In-Reply-To: References: Message-ID: I can only answer by my short experience... in my case I decode frames from an IP camera, H.264. As I have realized, av_frame_get_best_effort_timestamp() always returns me the packet pts minus 1/fps, so I "guess" that this function works with pts instead of dts and, in my case, that differente is because of the bidirectional frame prediction of the H.264. Cheers, -- D?dac P?rez 2014-03-28 21:19 GMT+01:00 Lucas Soltic : > Hello! > > Does av_frame_get_best_effort_timestamp() gives a PTS or DTS? > > At first I would have thought it's a PTS, because it's impossible for > decoding to correctly happen if DTS does not exist in the packet, but then > I read that the packet DTS may be AV_NOPTS_VALUE (DTS being a NOPTS..??!). > If that is correct, is there a reliable way to know the DTS too (in the > core meaning of DTS, even if the file does not set it)? > > Thanks, > Lucas > _______________________________________________ > 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 nfxjfg at googlemail.com Fri Mar 28 22:04:41 2014 From: nfxjfg at googlemail.com (wm4) Date: Fri, 28 Mar 2014 22:04:41 +0100 Subject: [Libav-user] av_frame_get_best_effort_timestamp(): PTS or DTS? In-Reply-To: References: Message-ID: <20140328220441.6ca67ac6@debian> On Fri, 28 Mar 2014 21:19:55 +0100 Lucas Soltic wrote: > Hello! > > Does av_frame_get_best_effort_timestamp() gives a PTS or DTS? > > At first I would have thought it's a PTS, because it's impossible for decoding to correctly happen if DTS does not exist in the packet, but then I read that the packet DTS may be AV_NOPTS_VALUE (DTS being a NOPTS..??!). If that is correct, is there a reliable way to know the DTS too (in the core meaning of DTS, even if the file does not set it)? Some files have PTS and DTS mixed (mpeg mostly), some files have PTS only (e.g. Matroska), some files have DTS only (e.g. AVI). The general solution is to use DTS if PTS is set to NOPTS. Here's how av_frame_get_best_effort_timestamp() is calculated: https://git.videolan.org/?p=ffmpeg.git;a=blob;f=libavcodec/utils.c;h=b43f67540e834d45058f9d694cc6c090d1b4c27d;hb=HEAD#l1995 Looks complicated, but is rather simple. As I understand, this is mostly a workaround if PTS or DTS are set incorrectly. This function takes AVFrame.pkt_pts and AVFrame.pkt_dts as inputs. It returns what will be used as AVFrame.best_effort_timestamp. What this function does is: 1. count how often it happens that PTS or DTS are not monotonic (normally, the DTS _and_ PTS should not decrease after the decoder; this is not true _before_ the decoder, but the decoder should reorder them so that they're monotonic, and some broken files might violate this) 2. if PTS is more often wrong than DTS, use the DTS as output timestamp Libav does not have the AVFrame.best_effort_timestamp field. Butthe Libav command line tools (avplay, avconv) calculates it the same way: https://git.libav.org/?p=libav.git;a=blob;f=cmdutils.c;h=69a11bdd4fb33ccdc1420e15edb7c47c8ce84098;hb=HEAD#l1431 And that's why I would recommend just copying the code. It's trivial anyway, at least once you understand it, and your project will be compatible to both FFmpeg and Libav. From i.like.privacy.too at gmail.com Fri Mar 28 23:38:11 2014 From: i.like.privacy.too at gmail.com (Camera Man) Date: Sat, 29 Mar 2014 01:38:11 +0300 Subject: [Libav-user] Motion estimation : replacement for deprecated AVFrame::motion_val ? In-Reply-To: References: <5331632C.2020605@codemill.se> <5331768F.4030907@codemill.se> <7aef8fb0c1fc50e799b13b8f102bcb2c@kral.hk> <20140325144024.549720d1@debian> Message-ID: <5335F9D3.3000603@gmail.com> On 03/28/2014 12:18 PM, cyril poulet wrote: > As a matter of fact, I wanted to use them for computer vision, where > calculating edge densities and motion estimation are important. > Now that these are deprecated, the only way is to first decode each > frame then re-calculate MVs and DCTs, which is computationnally costly... You probably don't want to use them for computer vision; They are specifically optimized for minimizing visual artifacts on one hand, and staying within protocol constraints on the other (e.g. some streams have no I-frames but do have guaranteed "frame convergence" - which means the motion on those is guaranteed to be "wrong"). It's not that they can't be useful, it's that the MV information is "very noisy" compared to what you'd get from computer vision stuff. Doing a pyramid Lucas-Kanade (openCV and libccv both have good implementations, supposedly) does not require a lot of CPU and provides vastly better motion estimation for computer vision. From lucas.soltic at orange.fr Sat Mar 29 00:49:18 2014 From: lucas.soltic at orange.fr (Lucas Soltic) Date: Sat, 29 Mar 2014 00:49:18 +0100 Subject: [Libav-user] av_frame_get_best_effort_timestamp(): PTS or DTS? In-Reply-To: <20140328220441.6ca67ac6@debian> References: <20140328220441.6ca67ac6@debian> Message-ID: <6D4685CD-67DE-43AB-819C-633CF3A55D50@orange.fr> Le 28 mars 2014 ? 22:04, wm4 a ?crit : > On Fri, 28 Mar 2014 21:19:55 +0100 > Lucas Soltic wrote: > >> Hello! >> >> Does av_frame_get_best_effort_timestamp() gives a PTS or DTS? >> >> At first I would have thought it's a PTS, because it's impossible for decoding to correctly happen if DTS does not exist in the packet, but then I read that the packet DTS may be AV_NOPTS_VALUE (DTS being a NOPTS..??!). If that is correct, is there a reliable way to know the DTS too (in the core meaning of DTS, even if the file does not set it)? > > Some files have PTS and DTS mixed (mpeg mostly), some files have PTS > only (e.g. Matroska), some files have DTS only (e.g. AVI). The general > solution is to use DTS if PTS is set to NOPTS. > > Here's how av_frame_get_best_effort_timestamp() is calculated: > > https://git.videolan.org/?p=ffmpeg.git;a=blob;f=libavcodec/utils.c;h=b43f67540e834d45058f9d694cc6c090d1b4c27d;hb=HEAD#l1995 > > Looks complicated, but is rather simple. As I understand, this is > mostly a workaround if PTS or DTS are set incorrectly. > > > This function takes AVFrame.pkt_pts and AVFrame.pkt_dts as inputs. It > returns what will be used as AVFrame.best_effort_timestamp. What this > function does is: > > 1. count how often it happens that PTS or DTS are not monotonic > (normally, the DTS _and_ PTS should not decrease after the decoder; > this is not true _before_ the decoder, but the decoder should > reorder them so that they're monotonic, and some broken files might > violate this) > 2. if PTS is more often wrong than DTS, use the DTS as output timestamp > > Libav does not have the AVFrame.best_effort_timestamp field. Butthe > Libav command line tools (avplay, avconv) calculates it the same way: > > https://git.libav.org/?p=libav.git;a=blob;f=cmdutils.c;h=69a11bdd4fb33ccdc1420e15edb7c47c8ce84098;hb=HEAD#l1431 > > And that's why I would recommend just copying the code. It's trivial > anyway, at least once you understand it, and your project will be > compatible to both FFmpeg and Libav. > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user Thanks for all your answers :) So... to sum it up, some formats have DTS or PTS or both. I guess no file has none? Then if I want to seek, I saw that some demuxers seek by PTS, others by DTS, depending on whether AVFMT_SEEK_TO_PTS is set. If the format only has DTS, will AVFMT_SEEK_TO_PTS never be set? If the format only has PTS, will AVFMT_SEEK_TO_PTS always be set? If AVFMT_SEEK_TO_PTS is set, are the PTS provided by the format reliable? If AVFMT_SEEK_TO_PTS is not set, are the DTS provided by the format reliable? Lucas From nfxjfg at googlemail.com Sat Mar 29 01:34:48 2014 From: nfxjfg at googlemail.com (wm4) Date: Sat, 29 Mar 2014 01:34:48 +0100 Subject: [Libav-user] av_frame_get_best_effort_timestamp(): PTS or DTS? In-Reply-To: <6D4685CD-67DE-43AB-819C-633CF3A55D50@orange.fr> References: <20140328220441.6ca67ac6@debian> <6D4685CD-67DE-43AB-819C-633CF3A55D50@orange.fr> Message-ID: <20140329013448.41ae6dec@debian> On Sat, 29 Mar 2014 00:49:18 +0100 Lucas Soltic wrote: > Le 28 mars 2014 ? 22:04, wm4 a ?crit : > > > On Fri, 28 Mar 2014 21:19:55 +0100 > > Lucas Soltic wrote: > > > >> Hello! > >> > >> Does av_frame_get_best_effort_timestamp() gives a PTS or DTS? > >> > >> At first I would have thought it's a PTS, because it's impossible for decoding to correctly happen if DTS does not exist in the packet, but then I read that the packet DTS may be AV_NOPTS_VALUE (DTS being a NOPTS..??!). If that is correct, is there a reliable way to know the DTS too (in the core meaning of DTS, even if the file does not set it)? > > > > Some files have PTS and DTS mixed (mpeg mostly), some files have PTS > > only (e.g. Matroska), some files have DTS only (e.g. AVI). The general > > solution is to use DTS if PTS is set to NOPTS. > > > > Here's how av_frame_get_best_effort_timestamp() is calculated: > > > > https://git.videolan.org/?p=ffmpeg.git;a=blob;f=libavcodec/utils.c;h=b43f67540e834d45058f9d694cc6c090d1b4c27d;hb=HEAD#l1995 > > > > Looks complicated, but is rather simple. As I understand, this is > > mostly a workaround if PTS or DTS are set incorrectly. > > > > > > This function takes AVFrame.pkt_pts and AVFrame.pkt_dts as inputs. It > > returns what will be used as AVFrame.best_effort_timestamp. What this > > function does is: > > > > 1. count how often it happens that PTS or DTS are not monotonic > > (normally, the DTS _and_ PTS should not decrease after the decoder; > > this is not true _before_ the decoder, but the decoder should > > reorder them so that they're monotonic, and some broken files might > > violate this) > > 2. if PTS is more often wrong than DTS, use the DTS as output timestamp > > > > Libav does not have the AVFrame.best_effort_timestamp field. Butthe > > Libav command line tools (avplay, avconv) calculates it the same way: > > > > https://git.libav.org/?p=libav.git;a=blob;f=cmdutils.c;h=69a11bdd4fb33ccdc1420e15edb7c47c8ce84098;hb=HEAD#l1431 > > > > And that's why I would recommend just copying the code. It's trivial > > anyway, at least once you understand it, and your project will be > > compatible to both FFmpeg and Libav. > > _______________________________________________ > > Libav-user mailing list > > Libav-user at ffmpeg.org > > http://ffmpeg.org/mailman/listinfo/libav-user > > Thanks for all your answers :) > > So... to sum it up, some formats have DTS or PTS or both. I guess no file has none? I guess it's not impossible that some files have no or just broken timestamps. But with "normal" files this usually doesn't happen. > Then if I want to seek, I saw that some demuxers seek by PTS, others by DTS, depending on whether AVFMT_SEEK_TO_PTS is set. > > If the format only has DTS, will AVFMT_SEEK_TO_PTS never be set? > If the format only has PTS, will AVFMT_SEEK_TO_PTS always be set? > If AVFMT_SEEK_TO_PTS is set, are the PTS provided by the format reliable? > If AVFMT_SEEK_TO_PTS is not set, are the DTS provided by the format reliable? I don't think you should try to conclude anything from these flags. They're probably mostly for the libavformat internal seek code. From lucas.soltic at orange.fr Sat Mar 29 01:52:30 2014 From: lucas.soltic at orange.fr (Lucas Soltic) Date: Sat, 29 Mar 2014 01:52:30 +0100 Subject: [Libav-user] av_frame_get_best_effort_timestamp(): PTS or DTS? In-Reply-To: <20140329013448.41ae6dec@debian> References: <20140328220441.6ca67ac6@debian> <6D4685CD-67DE-43AB-819C-633CF3A55D50@orange.fr> <20140329013448.41ae6dec@debian> Message-ID: > Le 29 mars 2014 ? 01:34, wm4 a ?crit : > > On Sat, 29 Mar 2014 00:49:18 +0100 > Lucas Soltic wrote: > >>> Le 28 mars 2014 ? 22:04, wm4 a ?crit : >>> >>> On Fri, 28 Mar 2014 21:19:55 +0100 >>> Lucas Soltic wrote: >>> >>>> Hello! >>>> >>>> Does av_frame_get_best_effort_timestamp() gives a PTS or DTS? >>>> >>>> At first I would have thought it's a PTS, because it's impossible for decoding to correctly happen if DTS does not exist in the packet, but then I read that the packet DTS may be AV_NOPTS_VALUE (DTS being a NOPTS..??!). If that is correct, is there a reliable way to know the DTS too (in the core meaning of DTS, even if the file does not set it)? >>> >>> Some files have PTS and DTS mixed (mpeg mostly), some files have PTS >>> only (e.g. Matroska), some files have DTS only (e.g. AVI). The general >>> solution is to use DTS if PTS is set to NOPTS. >>> >>> Here's how av_frame_get_best_effort_timestamp() is calculated: >>> >>> https://git.videolan.org/?p=ffmpeg.git;a=blob;f=libavcodec/utils.c;h=b43f67540e834d45058f9d694cc6c090d1b4c27d;hb=HEAD#l1995 >>> >>> Looks complicated, but is rather simple. As I understand, this is >>> mostly a workaround if PTS or DTS are set incorrectly. >>> >>> >>> This function takes AVFrame.pkt_pts and AVFrame.pkt_dts as inputs. It >>> returns what will be used as AVFrame.best_effort_timestamp. What this >>> function does is: >>> >>> 1. count how often it happens that PTS or DTS are not monotonic >>> (normally, the DTS _and_ PTS should not decrease after the decoder; >>> this is not true _before_ the decoder, but the decoder should >>> reorder them so that they're monotonic, and some broken files might >>> violate this) >>> 2. if PTS is more often wrong than DTS, use the DTS as output timestamp >>> >>> Libav does not have the AVFrame.best_effort_timestamp field. Butthe >>> Libav command line tools (avplay, avconv) calculates it the same way: >>> >>> https://git.libav.org/?p=libav.git;a=blob;f=cmdutils.c;h=69a11bdd4fb33ccdc1420e15edb7c47c8ce84098;hb=HEAD#l1431 >>> >>> And that's why I would recommend just copying the code. It's trivial >>> anyway, at least once you understand it, and your project will be >>> compatible to both FFmpeg and Libav. >>> _______________________________________________ >>> Libav-user mailing list >>> Libav-user at ffmpeg.org >>> http://ffmpeg.org/mailman/listinfo/libav-user >> >> Thanks for all your answers :) >> >> So... to sum it up, some formats have DTS or PTS or both. I guess no file has none? > > I guess it's not impossible that some files have no or just broken > timestamps. But with "normal" files this usually doesn't happen. > >> Then if I want to seek, I saw that some demuxers seek by PTS, others by DTS, depending on whether AVFMT_SEEK_TO_PTS is set. >> >> If the format only has DTS, will AVFMT_SEEK_TO_PTS never be set? >> If the format only has PTS, will AVFMT_SEEK_TO_PTS always be set? >> If AVFMT_SEEK_TO_PTS is set, are the PTS provided by the format reliable? >> If AVFMT_SEEK_TO_PTS is not set, are the DTS provided by the format reliable? > > I don't think you should try to conclude anything from these flags. > They're probably mostly for the libavformat internal seek code. > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user Well.. the purpose is not really to make deductions but just to make sure there is no inconsistency. If a format requires to seek by PTS when the same format has no pts is clearly an error. As for the last two questions, the point rather was "is there always a reliable way to seek?". Lucas From nfxjfg at googlemail.com Sat Mar 29 02:24:16 2014 From: nfxjfg at googlemail.com (wm4) Date: Sat, 29 Mar 2014 02:24:16 +0100 Subject: [Libav-user] av_frame_get_best_effort_timestamp(): PTS or DTS? In-Reply-To: References: <20140328220441.6ca67ac6@debian> <6D4685CD-67DE-43AB-819C-633CF3A55D50@orange.fr> <20140329013448.41ae6dec@debian> Message-ID: <20140329022416.6adf48b1@debian> On Sat, 29 Mar 2014 01:52:30 +0100 Lucas Soltic wrote: > > Le 29 mars 2014 ? 01:34, wm4 a ?crit : > > > > On Sat, 29 Mar 2014 00:49:18 +0100 > > Lucas Soltic wrote: > > > >>> Le 28 mars 2014 ? 22:04, wm4 a ?crit : > >>> > >>> On Fri, 28 Mar 2014 21:19:55 +0100 > >>> Lucas Soltic wrote: > >>> > >>>> Hello! > >>>> > >>>> Does av_frame_get_best_effort_timestamp() gives a PTS or DTS? > >>>> > >>>> At first I would have thought it's a PTS, because it's impossible for decoding to correctly happen if DTS does not exist in the packet, but then I read that the packet DTS may be AV_NOPTS_VALUE (DTS being a NOPTS..??!). If that is correct, is there a reliable way to know the DTS too (in the core meaning of DTS, even if the file does not set it)? > >>> > >>> Some files have PTS and DTS mixed (mpeg mostly), some files have PTS > >>> only (e.g. Matroska), some files have DTS only (e.g. AVI). The general > >>> solution is to use DTS if PTS is set to NOPTS. > >>> > >>> Here's how av_frame_get_best_effort_timestamp() is calculated: > >>> > >>> https://git.videolan.org/?p=ffmpeg.git;a=blob;f=libavcodec/utils.c;h=b43f67540e834d45058f9d694cc6c090d1b4c27d;hb=HEAD#l1995 > >>> > >>> Looks complicated, but is rather simple. As I understand, this is > >>> mostly a workaround if PTS or DTS are set incorrectly. > >>> > >>> > >>> This function takes AVFrame.pkt_pts and AVFrame.pkt_dts as inputs. It > >>> returns what will be used as AVFrame.best_effort_timestamp. What this > >>> function does is: > >>> > >>> 1. count how often it happens that PTS or DTS are not monotonic > >>> (normally, the DTS _and_ PTS should not decrease after the decoder; > >>> this is not true _before_ the decoder, but the decoder should > >>> reorder them so that they're monotonic, and some broken files might > >>> violate this) > >>> 2. if PTS is more often wrong than DTS, use the DTS as output timestamp > >>> > >>> Libav does not have the AVFrame.best_effort_timestamp field. Butthe > >>> Libav command line tools (avplay, avconv) calculates it the same way: > >>> > >>> https://git.libav.org/?p=libav.git;a=blob;f=cmdutils.c;h=69a11bdd4fb33ccdc1420e15edb7c47c8ce84098;hb=HEAD#l1431 > >>> > >>> And that's why I would recommend just copying the code. It's trivial > >>> anyway, at least once you understand it, and your project will be > >>> compatible to both FFmpeg and Libav. > >>> _______________________________________________ > >>> Libav-user mailing list > >>> Libav-user at ffmpeg.org > >>> http://ffmpeg.org/mailman/listinfo/libav-user > >> > >> Thanks for all your answers :) > >> > >> So... to sum it up, some formats have DTS or PTS or both. I guess no file has none? > > > > I guess it's not impossible that some files have no or just broken > > timestamps. But with "normal" files this usually doesn't happen. > > > >> Then if I want to seek, I saw that some demuxers seek by PTS, others by DTS, depending on whether AVFMT_SEEK_TO_PTS is set. > >> > >> If the format only has DTS, will AVFMT_SEEK_TO_PTS never be set? > >> If the format only has PTS, will AVFMT_SEEK_TO_PTS always be set? > >> If AVFMT_SEEK_TO_PTS is set, are the PTS provided by the format reliable? > >> If AVFMT_SEEK_TO_PTS is not set, are the DTS provided by the format reliable? > > > > I don't think you should try to conclude anything from these flags. > > They're probably mostly for the libavformat internal seek code. > > _______________________________________________ > > Libav-user mailing list > > Libav-user at ffmpeg.org > > http://ffmpeg.org/mailman/listinfo/libav-user > > Well.. the purpose is not really to make deductions but just to make sure there is no inconsistency. If a format requires to seek by PTS when the same format has no pts is clearly an error. > > As for the last two questions, the point rather was "is there always a reliable way to seek?". From my experience, seeking often goes wrong. For file formats that were not designed for seeking (like transport streams etc.), you can be lucky if seeking works well enough for your purposes. If you want 100% reliable seeking, you'll have to decode the whole file and index it, or something like this. (Libraries like ffms2 do this for you.) From lucas.soltic at orange.fr Sat Mar 29 09:21:51 2014 From: lucas.soltic at orange.fr (Lucas Soltic) Date: Sat, 29 Mar 2014 09:21:51 +0100 Subject: [Libav-user] av_frame_get_best_effort_timestamp(): PTS or DTS? In-Reply-To: <20140329022416.6adf48b1@debian> References: <20140328220441.6ca67ac6@debian> <6D4685CD-67DE-43AB-819C-633CF3A55D50@orange.fr> <20140329013448.41ae6dec@debian> <20140329022416.6adf48b1@debian> Message-ID: <58082DFF-09E3-4F5F-B751-A3EC8F1E482E@orange.fr> > Le 29 mars 2014 ? 02:24, wm4 a ?crit : > > On Sat, 29 Mar 2014 01:52:30 +0100 > Lucas Soltic wrote: > >>> Le 29 mars 2014 ? 01:34, wm4 a ?crit : >>> >>> On Sat, 29 Mar 2014 00:49:18 +0100 >>> Lucas Soltic wrote: >>> >>>>> Le 28 mars 2014 ? 22:04, wm4 a ?crit : >>>>> >>>>> On Fri, 28 Mar 2014 21:19:55 +0100 >>>>> Lucas Soltic wrote: >>>>> >>>>>> Hello! >>>>>> >>>>>> Does av_frame_get_best_effort_timestamp() gives a PTS or DTS? >>>>>> >>>>>> At first I would have thought it's a PTS, because it's impossible for decoding to correctly happen if DTS does not exist in the packet, but then I read that the packet DTS may be AV_NOPTS_VALUE (DTS being a NOPTS..??!). If that is correct, is there a reliable way to know the DTS too (in the core meaning of DTS, even if the file does not set it)? >>>>> >>>>> Some files have PTS and DTS mixed (mpeg mostly), some files have PTS >>>>> only (e.g. Matroska), some files have DTS only (e.g. AVI). The general >>>>> solution is to use DTS if PTS is set to NOPTS. >>>>> >>>>> Here's how av_frame_get_best_effort_timestamp() is calculated: >>>>> >>>>> https://git.videolan.org/?p=ffmpeg.git;a=blob;f=libavcodec/utils.c;h=b43f67540e834d45058f9d694cc6c090d1b4c27d;hb=HEAD#l1995 >>>>> >>>>> Looks complicated, but is rather simple. As I understand, this is >>>>> mostly a workaround if PTS or DTS are set incorrectly. >>>>> >>>>> >>>>> This function takes AVFrame.pkt_pts and AVFrame.pkt_dts as inputs. It >>>>> returns what will be used as AVFrame.best_effort_timestamp. What this >>>>> function does is: >>>>> >>>>> 1. count how often it happens that PTS or DTS are not monotonic >>>>> (normally, the DTS _and_ PTS should not decrease after the decoder; >>>>> this is not true _before_ the decoder, but the decoder should >>>>> reorder them so that they're monotonic, and some broken files might >>>>> violate this) >>>>> 2. if PTS is more often wrong than DTS, use the DTS as output timestamp >>>>> >>>>> Libav does not have the AVFrame.best_effort_timestamp field. Butthe >>>>> Libav command line tools (avplay, avconv) calculates it the same way: >>>>> >>>>> https://git.libav.org/?p=libav.git;a=blob;f=cmdutils.c;h=69a11bdd4fb33ccdc1420e15edb7c47c8ce84098;hb=HEAD#l1431 >>>>> >>>>> And that's why I would recommend just copying the code. It's trivial >>>>> anyway, at least once you understand it, and your project will be >>>>> compatible to both FFmpeg and Libav. >>>>> _______________________________________________ >>>>> Libav-user mailing list >>>>> Libav-user at ffmpeg.org >>>>> http://ffmpeg.org/mailman/listinfo/libav-user >>>> >>>> Thanks for all your answers :) >>>> >>>> So... to sum it up, some formats have DTS or PTS or both. I guess no file has none? >>> >>> I guess it's not impossible that some files have no or just broken >>> timestamps. But with "normal" files this usually doesn't happen. >>> >>>> Then if I want to seek, I saw that some demuxers seek by PTS, others by DTS, depending on whether AVFMT_SEEK_TO_PTS is set. >>>> >>>> If the format only has DTS, will AVFMT_SEEK_TO_PTS never be set? >>>> If the format only has PTS, will AVFMT_SEEK_TO_PTS always be set? >>>> If AVFMT_SEEK_TO_PTS is set, are the PTS provided by the format reliable? >>>> If AVFMT_SEEK_TO_PTS is not set, are the DTS provided by the format reliable? >>> >>> I don't think you should try to conclude anything from these flags. >>> They're probably mostly for the libavformat internal seek code. >>> _______________________________________________ >>> Libav-user mailing list >>> Libav-user at ffmpeg.org >>> http://ffmpeg.org/mailman/listinfo/libav-user >> >> Well.. the purpose is not really to make deductions but just to make sure there is no inconsistency. If a format requires to seek by PTS when the same format has no pts is clearly an error. >> >> As for the last two questions, the point rather was "is there always a reliable way to seek?". > > From my experience, seeking often goes wrong. For file formats that > were not designed for seeking (like transport streams etc.), you can be > lucky if seeking works well enough for your purposes. > > If you want 100% reliable seeking, you'll have to decode the whole file > and index it, or something like this. (Libraries like ffms2 do this for > you.) > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user Oh ok.. is there a list or something to know which formats do support well seeking, and which format really don't support this at all (except with indexing) ? I don't plan to work with network streams for now so I guess transport streams are not a problem for me. Thanks a lot for your help :) Lucas From xenosender at gmail.com Sat Mar 29 14:46:33 2014 From: xenosender at gmail.com (cyril poulet) Date: Sat, 29 Mar 2014 14:46:33 +0100 Subject: [Libav-user] Motion estimation : replacement for deprecated AVFrame::motion_val ? In-Reply-To: <5335F9D3.3000603@gmail.com> References: <5331632C.2020605@codemill.se> <5331768F.4030907@codemill.se> <7aef8fb0c1fc50e799b13b8f102bcb2c@kral.hk> <20140325144024.549720d1@debian> <5335F9D3.3000603@gmail.com> Message-ID: Thanks for the advice. On my particular case, I'm interested in detecting overlays, so it's not really about estimating the motion but more estimating what's not moving. Recent papers have obtained good results by estimating a first approximate overlay position directly on these MVs, though after that you effectively have to work on parts of the decoded frames. Anyway, thanks for the explanation ! 2014-03-28 23:38 GMT+01:00 Camera Man : > On 03/28/2014 12:18 PM, cyril poulet wrote: > > As a matter of fact, I wanted to use them for computer vision, where >> calculating edge densities and motion estimation are important. >> Now that these are deprecated, the only way is to first decode each frame >> then re-calculate MVs and DCTs, which is computationnally costly... >> > > You probably don't want to use them for computer vision; They are > specifically optimized for minimizing visual artifacts on one hand, and > staying within protocol constraints on the other (e.g. some streams have no > I-frames but do have guaranteed "frame convergence" - which means the > motion on those is guaranteed to be "wrong"). > > It's not that they can't be useful, it's that the MV information is "very > noisy" compared to what you'd get from computer vision stuff. Doing a > pyramid Lucas-Kanade (openCV and libccv both have good implementations, > supposedly) does not require a lot of CPU and provides vastly better motion > estimation for computer vision. > > > > _______________________________________________ > 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 ggarra13 at gmail.com Sat Mar 29 22:45:30 2014 From: ggarra13 at gmail.com (Gonzalo Garramuno) Date: Sat, 29 Mar 2014 18:45:30 -0300 Subject: [Libav-user] h264 illegal short term buffer state detected In-Reply-To: <20140327182305.0f2c5f3a@debian> References: <53343A74.3020402@gmail.com> <20140327155510.2a48265e@debian> <53345974.4070604@gmail.com> <20140327182305.0f2c5f3a@debian> Message-ID: <53373EFA.3070408@gmail.com> On 27/03/14 14:23, wm4 wrote: > Then you should see the same error when seeking with ffplay. (AFAIK you > have to click with the mouse to seek or something.) No, I don't see the error on ffplay. I also don't see the error on other h264 movies. Only in one I am seeing this error. It would be helpful if you or someone else could explain what the error means. From marcinus_007 at wp.pl Mon Mar 31 10:03:18 2014 From: marcinus_007 at wp.pl (Marcin krycho) Date: Mon, 31 Mar 2014 10:03:18 +0200 Subject: [Libav-user] Odp: Mixing many video and audio files Message-ID: <533921465d8b42.93089854@wp.pl> Dnia Wtorek, 25 Marca 2014 23:15 Marcin krycho napisa?(a) > Hello, > I am developing APP for Android with FFMPEG library. So far I am able to achieve this using FFMPEG: > 1. Create mp4 video from screen shots. > 2. Add audio stream to this video from AAC file. > This is working perfectly. Next I would like to mix to this mp4 file more sound from other audio or video files. Sound from other mp4 files can start and end at any moment of movie. > > I assume this is amix command, but how to do it using FFMPEG API in code? I was not able to find any examples of muxing files in code. Any filter has to be created? Is it possible to somehow "add" audio frames in order to achive "sum" of these frames? And result frame add to audio stream of mp4 file? Any help and code examples would be appreciated. > Really no hints? From george at nsup.org Mon Mar 31 10:10:32 2014 From: george at nsup.org (Nicolas George) Date: Mon, 31 Mar 2014 10:10:32 +0200 Subject: [Libav-user] Odp: Mixing many video and audio files In-Reply-To: <533921465d8b42.93089854@wp.pl> References: <533921465d8b42.93089854@wp.pl> Message-ID: <20140331081032.GA6091@phare.normalesup.org> Le primidi 11 germinal, an CCXXII, Marcin krycho a ?crit?: > > Hello, > > I am developing APP for Android with FFMPEG library. So far I am able to achieve this using FFMPEG: > > 1. Create mp4 video from screen shots. > > 2. Add audio stream to this video from AAC file. > > This is working perfectly. Next I would like to mix to this mp4 file > > more sound from other audio or video files. Sound from other mp4 files > > can start and end at any moment of movie. > > > > I assume this is amix command, but how to do it using FFMPEG API in > > code? I was not able to find any examples of muxing files in code. Any > > filter has to be created? Is it possible to somehow "add" audio frames > > in order to achive "sum" of these frames? And result frame add to audio > > stream of mp4 file? Any help and code examples would be appreciated. You need to create a filter graph, with a buffersrc for each input you want to mix together, and something to do the mixing. I would suggest to use amerge + pan rather than amix. > Really no hints? Can you expect hints before your message actually appears on the list? Regards, -- Nicolas George -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: From marcinus_007 at wp.pl Mon Mar 31 10:50:17 2014 From: marcinus_007 at wp.pl (Marcin krycho) Date: Mon, 31 Mar 2014 10:50:17 +0200 Subject: [Libav-user] Odp: Re: Odp: Mixing many video and audio files Message-ID: <53392c4938fe30.13583353@wp.pl> Dnia Poniedzia?ek, 31 Marca 2014 10:10 Nicolas George napisa?(a) > Le primidi 11 germinal, an CCXXII, Marcin krycho a ?crit?: > > > Hello, > > > I am developing APP for Android with FFMPEG library. So far I am able to achieve this using FFMPEG: > > > 1. Create mp4 video from screen shots. > > > 2. Add audio stream to this video from AAC file. > > > This is working perfectly. Next I would like to mix to this mp4 file > > > more sound from other audio or video files. Sound from other mp4 files > > > can start and end at any moment of movie. > > > > > > I assume this is amix command, but how to do it using FFMPEG API in > > > code? I was not able to find any examples of muxing files in code. Any > > > filter has to be created? Is it possible to somehow "add" audio frames > > > in order to achive "sum" of these frames? And result frame add to audio > > > stream of mp4 file? Any help and code examples would be appreciated. > > You need to create a filter graph, with a buffersrc for each input you want > to mix together, and something to do the mixing. I would suggest to use > amerge + pan rather than amix. > > > Really no hints? > > Can you expect hints before your message actually appears on the list? > > Regards, > > -- > Nicolas George Hello, sorry but I sent this message almost week ago, I did not know it was not visible on the list. Thank you for answer. So my understanding is that there are two solutions for this problem. First solution is to use amix: filter graph + buffer for each input + mixing. Second solution would be to create video file with many audio streams with "amerge" and than mix these all channels using pan(recomended)? Is there any code example for these two methods? FFMPEG allows to do it, so maybe you know where it is implemented in FFMPEG? Which file etc. It is not easy to start from scratch with such mixing, this is why I am looking for example. BR, Marcin From george at nsup.org Mon Mar 31 11:07:26 2014 From: george at nsup.org (Nicolas George) Date: Mon, 31 Mar 2014 11:07:26 +0200 Subject: [Libav-user] Odp: Re: Odp: Mixing many video and audio files In-Reply-To: <53392c4938fe30.13583353@wp.pl> References: <53392c4938fe30.13583353@wp.pl> Message-ID: <20140331090726.GA23719@phare.normalesup.org> Le primidi 11 germinal, an CCXXII, Marcin krycho a ?crit?: > sorry but I sent this message almost week ago, I did not know it was not visible on the list. Your MUA is breaking threads (see the archive on Gmane for example). This is probably linked. You should fix this > Thank you for answer. So my understanding is that there are two solutions > for this problem. First solution is to use amix: filter graph + buffer for > each input + mixing. Second solution would be to create video file with > many audio streams with "amerge" and than mix these all channels using > pan(recomended)? They are the same solution, with only a slight difference in implementation, in the way you write the filter graph. The global result is the same: you feed frames on all inputs and you get a single mixed frame on the output. > Is there any code example for these two methods? FFMPEG allows to do it, > so maybe you know where it is implemented in FFMPEG? Which file etc. It is > not easy to start from scratch with such mixing, this is why I am looking > for example. There are examples for filtering audio, although I believe there are no example for graphs with several inputs. Regards, -- Nicolas George From marcinus_007 at wp.pl Mon Mar 31 11:29:20 2014 From: marcinus_007 at wp.pl (Marcin krycho) Date: Mon, 31 Mar 2014 11:29:20 +0200 Subject: [Libav-user] Odp: Re: Odp: Re: Odp: Mixing many video and audio files Message-ID: <533935709d20a0.69424707@wp.pl> Dnia Poniedzia?ek, 31 Marca 2014 11:07 Nicolas George napisa?(a) > Le primidi 11 germinal, an CCXXII, Marcin krycho a ?crit?: > > sorry but I sent this message almost week ago, I did not know it was not visible on the list. > > Your MUA is breaking threads (see the archive on Gmane for example). This is > probably linked. You should fix this > > > Thank you for answer. So my understanding is that there are two solutions > > for this problem. First solution is to use amix: filter graph + buffer for > > each input + mixing. Second solution would be to create video file with > > many audio streams with "amerge" and than mix these all channels using > > pan(recomended)? > > They are the same solution, with only a slight difference in implementation, > in the way you write the filter graph. The global result is the same: you > feed frames on all inputs and you get a single mixed frame on the output. > > > Is there any code example for these two methods? FFMPEG allows to do it, > > so maybe you know where it is implemented in FFMPEG? Which file etc. It is > > not easy to start from scratch with such mixing, this is why I am looking > > for example. > > There are examples for filtering audio, although I believe there are no > example for graphs with several inputs. > > Regards, > > -- > Nicolas George Thanks for hints. For now I do not have more questions. In the nearest future I will try to do this so maybe than I will write again. BR, Marcin From cehoyos at ag.or.at Mon Mar 31 17:36:23 2014 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Mon, 31 Mar 2014 15:36:23 +0000 (UTC) Subject: [Libav-user] Compile libAV + libswsscale for QNX References: <1395763874328-4659484.post@n4.nabble.com> <98501395826734@web15h.yandex.ru> <1395832170127-4659504.post@n4.nabble.com> <1395834962629-4659505.post@n4.nabble.com> <1395841136450-4659507.post@n4.nabble.com> Message-ID: K4 writes: > Yes, i can ssh to qnx box. So i can build on qnx box Then please compile there (crosscompilation makes running the tests very, very difficult, sorry if I was unclear before), simply copy the fate-suite with scp on the device and run fate. Carl Eugen From rogerdpack2 at gmail.com Mon Mar 31 23:26:39 2014 From: rogerdpack2 at gmail.com (Roger Pack) Date: Mon, 31 Mar 2014 15:26:39 -0600 Subject: [Libav-user] [FFmpeg-user] ffmpeg burst traffic problem In-Reply-To: References: <52A06042.3060208@neterra.net> Message-ID: On 12/5/13, Andrey Utkin wrote: > ffmpeg lacks UDP output speed smoothing functionality. You can see in > libavformat/udp.c in circular_buffer_task() that data is output as > soon as it appears. To eliminate bursty output it is needed either to > patch ffmpeg or to substitute ffmpeg output facility with another > application's one, e.g. you could do > ffmpeg (...options...) -f mpegts - | pv -L $BITRATE | socat (...options...) I had a patch once that would "slow down" udp output if you'd like to try it...what is the problem though, are you unable to receive it on the receiving side?