From cg85 at hotmail.com Thu Oct 4 14:10:47 2012 From: cg85 at hotmail.com (CHAUVET Guillaume) Date: Thu, 4 Oct 2012 14:10:47 +0200 Subject: [Libav-user] Encoding workflow process and container Message-ID: Hello libav users ! I tried to create a very simple mpeg2 file : a container with one video stream. But I don't understand very well all API functions needed to perform this operation : When I execute the attached sample program (below) I obtain an empty "video.mpg" file. Is avformat_write_header function who write the media file header ? Or some information are missing in my settings ? I have to admit I'm a little bit confused :-( #include "libavutil/opt.h" #include "libavformat/avformat.h" #include "libavcodec/avcodec.h" #include "libavutil/imgutils.h" static const char *video = "video.mpg"; static const int fps = 25; int main(int argc, char **argv) { avcodec_register_all(); av_register_all(); AVFormatContext *outfile; AVCodec *codec = avcodec_find_encoder(AV_CODEC_ID_MPEG2VIDEO); if (codec != NULL) { avformat_alloc_output_context2(&outfile, NULL, "mpeg2video", NULL); AVStream *stream = avformat_new_stream(outfile, codec); stream->codec->codec_id = codec->id; stream->codec->width = 1920; stream->codec->height = 1080; stream->codec->time_base = (AVRational) {1, fps}; stream->codec->pix_fmt = PIX_FMT_YUV422P; stream->codec->bit_rate = 15 * 1000 * 1000; stream->codec->gop_size = fps / 2; stream->codec->max_b_frames = 1; avio_open(&outfile->pb, video, AVIO_FLAG_WRITE); // Without this line no file created avformat_write_header(outfile, NULL); av_dump_format(outfile, 0, video, 1); avformat_free_context(outfile); } return 0; } Sincerly, Guillaume -------------- next part -------------- An HTML attachment was scrubbed... URL: From ggarra13 at gmail.com Thu Oct 4 16:20:14 2012 From: ggarra13 at gmail.com (Gonzalo Garramuno) Date: Thu, 4 Oct 2012 11:20:14 -0300 Subject: [Libav-user] Encoding workflow process and container In-Reply-To: References: Message-ID: 2012/10/4 CHAUVET Guillaume > Hello libav users ! > > I tried to create a very simple mpeg2 file : a container with one video stream. > But I don't understand very well all API functions needed to perform this operation : > When I execute the attached sample program (below) I obtain an empty "video.mpg" file. Is avformat_write_header function who write the media file header ? > Or some information are missing in my settings ? I have to admit I'm a little bit confused :-( > > > You are missing two things: 1) Create some content for the video. 2) Write the trailer of the video. See the docs/examples/muxing.c example in the distribution of ffmpeg. -- Gonzalo Garramu?o ggarra13 at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From lalahohohu at gmail.com Thu Oct 4 18:12:36 2012 From: lalahohohu at gmail.com (longjian yu) Date: Fri, 5 Oct 2012 01:12:36 +0900 Subject: [Libav-user] FFmpeg nonfree option Message-ID: To whom it may concern When I do a build of *FFmpeg *with --enable-nonfree option, there are several build result such as libffmpeg.so,libavcodec.a,libavformat.a,libavutil.a and libswscale.a. I found following Help option comment. I have a question for you. Does the libffmpeg.so include nonfree code when I do a build of *FFmpeg *with --enable-nonfree option? As I understand the libffmpeg.so doesn't include any nonfree doec such as aac codec with --enable-nonfree option. --enable-nonfree allow use of nonfree code, the resulting libs and binaries will be unredistributable [no] Let me explain why I think like above. I figured out there are no changes of libffmpeg.so even though I do build with changing "nonfree" option. But I found some changes in libavcodec.a. So If I do a build with --enable-nonfree option there will not be any nonfree code such as aac codec releated code in libffmpeg.so. And there will be nonfree code such as aac codec releated code in libavcodec.a. Please let me know my understanding is correct or not. Thank you. -------------- next part -------------- An HTML attachment was scrubbed... URL: From alex.smeshkov at gmail.com Wed Oct 3 10:39:59 2012 From: alex.smeshkov at gmail.com (Alex Smeshkov) Date: Wed, 3 Oct 2012 11:39:59 +0300 Subject: [Libav-user] AC3 decoder in FFmpeg Message-ID: Dear Sirs, I kindly ask you to give me your comments on the question of AC3 decoder in FFmpeg library use in my project. In particular, I am concerned about legal aspect of this matter. As I gathered from FFmpeg website AC3 decoder is licensed under LGPL in FFmpeg library. Could you please advise if I can use FFmpeg library containing AC3 decoder in a commercial project without obtaining license from "Dolby" in the following cases: - Static linking with FFmpeg library containing AC3 decoder in my open source project licensed under LGPL; - Dynamic linking with FFmpeg library containing AC3 decoder in my open source project licensed under LGPL (or any other applicable license); - Distribution of the application that will not contain FFmpeg library although at the same time it will be able to work with the shared library if the end users download it on their own. I would much appreciate your comments on this issue. Thanks in advance! Best regards, Alex Smeshkov -------------- next part -------------- An HTML attachment was scrubbed... URL: From cehoyos at ag.or.at Fri Oct 5 02:08:53 2012 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Fri, 5 Oct 2012 00:08:53 +0000 (UTC) Subject: [Libav-user] FFmpeg nonfree option References: Message-ID: longjian yu writes: > Please let me know my understanding is > correct or not. I may misunderstand you but I believe your understanding is not correct. If you configure FFmpeg with --enable-nonfree you cannot legally distribute the resulting binaries. (If you are using --enable-nonfree but no other configure option, the best solution to get a binary that you are allowed to distribute is to simply remove --enable-nonfree from your configure line.) Carl Eugen From cehoyos at ag.or.at Fri Oct 5 02:06:20 2012 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Fri, 5 Oct 2012 00:06:20 +0000 (UTC) Subject: [Libav-user] AC3 decoder in FFmpeg References: Message-ID: Alex Smeshkov writes: > Could you please advise if I can use FFmpeg library > containing AC3 decoder in a commercial project without > obtaining license from "Dolby" Wrong mailing list? Carl Eugen From discover.ab at gmail.com Fri Oct 5 07:30:53 2012 From: discover.ab at gmail.com (abhishek bansal) Date: Fri, 5 Oct 2012 11:00:53 +0530 Subject: [Libav-user] TimeStamping Message-ID: Hi all, This is my first time with ffmpeg library. I am trying to encode a live video feed which is coming from frame-grabber cards. This feed is having variable frame rate and i have no control over it. Feed is captured using Directshow's ISampleGrabber interface. Now when i try to encode this feed using ffmpeg library my resulted video play back is either very slow or very fast. I searched over internet and i suspect that I can control them using timestamps. I am setting timestamp when i get frame from directshow filter as per following code _startTime = _lastTime; _lastTime += CRefTime(pvi->AvgTimePerFrame); pSample->SetTime( (REFERENCE_TIME *)&_startTime, (REFERENCE_TIME*)&_lastTime ); -- Thanks & Regards, Abhishek Bansal http://abhishekbansal.miyuri.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From discover.ab at gmail.com Fri Oct 5 07:42:09 2012 From: discover.ab at gmail.com (abhishek bansal) Date: Fri, 5 Oct 2012 11:12:09 +0530 Subject: [Libav-user] Timestamping a live video feed with variable framerate Message-ID: Hi all, I am very sorry that I mistakenly sent incomplete mail previously.. please ignore my previous mail !! This is my first time with ffmpeg library. I am trying to encode a live video feed which is coming from frame-grabber cards. This feed is having variable frame rate and i have no control over it. Feed is captured using Directshow's ISampleGrabber interface. Now when i try to encode this feed using ffmpeg library my resulted video play back is either very slow or very fast. I searched over internet and i suspect that I can control them using timestamps. I am setting timestamp when i get frame from directshow filter as per following code _startTime = _lastTime; _lastTime += CRefTime(pvi->AvgTimePerFrame); pSample->SetTime( (REFERENCE_TIME *)&_startTime, (REFERENCE_TIME*)&_lastTime ); Now i want to use same timestamp while recording in ffmpeg. My question is can i use same timestamp in ffmpeg recording ? how can I achieve that ? right now if i use frame->pts = timestamp; before avcodec_encode_video() than av_write_frame() return negative value. And recording does not happen. timestamp is __int64 type. -- Thanks & Regards, Abhishek Bansal -------------- next part -------------- An HTML attachment was scrubbed... URL: From mail at tim-hauke.de Fri Oct 5 22:25:09 2012 From: mail at tim-hauke.de (Tim Hauke) Date: Fri, 05 Oct 2012 22:25:09 +0200 Subject: [Libav-user] avformat_open_input() fails with unicode filenames of image files Message-ID: <506F4225.90108@tim-hauke.de> Hello, I?m using ffmpeg libraries version 0.11.1 on Windows 7 for my applications. Now I?ve got a problem with avformat_open_input(). As arguments I hand over to this method a pointer to an AVFormatContext allocated with avformat_alloc_context() and a filename as char array encoded in utf8. Last two arguments are NULL. The filename is handed over from Java code as a JString via the Java Native Interface by using GetStringUTFChars(). So generally it works quite well. I?m using it with mp4 , avi, jpg, bmp and tif files. But when I try to open an image file (jpg, bmp, tif) whose filename contains other characters than from the ASCII charset, avformat_open_input() returns -2. For example when trying to open a file named with russian characters or filename that contains a german umlaut. I think -2 is the "no such file or directory" error code? I can?t figure out, what the problem is. Video files (mp4, avi) are working anytime, no matter what unicode characters the filename contains. And image files are working as well, but just with ASCII characters in filename. But avformat_open_input() fails when renaming the same image file with no ASCII characters. Can anyone help me? Thanks in advance. Best regards - Tim From cehoyos at ag.or.at Sat Oct 6 11:52:46 2012 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Sat, 6 Oct 2012 09:52:46 +0000 (UTC) Subject: [Libav-user] =?utf-8?q?vformat=5Fopen=5Finput=28=29_fails_with_un?= =?utf-8?q?icode_filenames_of_image_files?= References: <506F4225.90108@tim-hauke.de> Message-ID: Tim Hauke writes: > But when I try to open an image file (jpg, bmp, tif) > whose filename contains other characters than from > the ASCII charset, avformat_open_input() returns -2. Is this also reproducible with ffmpeg.exe? Carl Eugen From mail at tim-hauke.de Sat Oct 6 12:04:47 2012 From: mail at tim-hauke.de (Tim Hauke) Date: Sat, 06 Oct 2012 12:04:47 +0200 Subject: [Libav-user] vformat_open_input() fails with unicode filenames of image files In-Reply-To: References: <506F4225.90108@tim-hauke.de> Message-ID: <5070023F.9030306@tim-hauke.de> Am 06.10.2012 11:52, schrieb Carl Eugen Hoyos: > Tim Hauke writes: > >> But when I try to open an image file (jpg, bmp, tif) >> whose filename contains other characters than from >> the ASCII charset, avformat_open_input() returns -2. > Is this also reproducible with ffmpeg.exe? > > Carl Eugen I didn?t test with ffmpeg.exe, but with ffplay.exe and it also failed. I will test with ffmpeg.exe soon. Tim Hauke > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user From mail at tim-hauke.de Sat Oct 6 13:03:27 2012 From: mail at tim-hauke.de (Tim Hauke) Date: Sat, 06 Oct 2012 13:03:27 +0200 Subject: [Libav-user] avformat_open_input() fails with unicode filenames of image files In-Reply-To: References: <506F4225.90108@tim-hauke.de> Message-ID: <50700FFF.7000905@tim-hauke.de> Am 06.10.2012 11:52, schrieb Carl Eugen Hoyos: > Tim Hauke writes: > >> But when I try to open an image file (jpg, bmp, tif) >> whose filename contains other characters than from >> the ASCII charset, avformat_open_input() returns -2. > Is this also reproducible with ffmpeg.exe? > > Carl Eugen Now I have tested wit ffmpeg.exe and it also fails. I proceeded following tests. 1: Six jpg files (all the same) named as door1.jpg, door2.jpg,..., door6.jpg Run ffmpeg.exe with the command: ffmpeg -f image2 -i door%d.jpg door.mpg It worked, result was a running door.mpg file. 2: Same six jpg files as before renamed in t?r1.jpg, t?r2.jpg,...,t?r6.jpg Runing ffmpeg.exe with the same command: ffmpeg -f image2 -i t?r%d.jpg t?r.mpg It failed with this error message in the windows command shell: [image2 @ 0002e6c0] Could find no file with with path 't??r%d.jpg' and index in the range 0-4 t??r%d.jpg: No such file or directory 3: With the resulting door.mpg from test 1 running ffmpeg.exe with the command: ffmpeg -i door.mpg door%d.jpg It worked with 6 jpg files door1.jpg, door2.jpg,..., door6.jpg as result. 4: Renaming door.mpg in t?r.mpg and running it with the command from test 3: ffmpeg -i t?r.mpg t?r%d.jpg It also worked with 6 jpg files t?r1.jpg, t?r2.jpg,..., t?r6.jpg as rsult. 5: Playing door.mpg and t?r.mpg in ffplay.exe - both worked. Playing door.jpg in ffplay.exe - worked. Playing t?r.jpg in ffplay - failed with the same error as test 2: [image2 @ 019f4a60] Could find no file with with path 't??r.jpg' and index in the range 0-4 t??r.jpg: No such file or directory Can someone confirm my test results and has someone a workaround to avoid this fails? Best regards - Tim Hauke > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user From cehoyos at ag.or.at Sat Oct 6 13:38:43 2012 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Sat, 6 Oct 2012 11:38:43 +0000 (UTC) Subject: [Libav-user] =?utf-8?q?avformat=5Fopen=5Finput=28=29_fails_with_u?= =?utf-8?q?nicode_filenames_of_image_files?= References: <506F4225.90108@tim-hauke.de> <50700FFF.7000905@tim-hauke.de> Message-ID: Tim Hauke writes: > Same six jpg files as before renamed in t?r1.jpg,...,t?r6.jpg > Runing ffmpeg.exe with the same command: > ffmpeg -f image2 -i t?r%d.jpg t?r.mpg > It failed Please add (command line together with) complete, uncut console output. (It works fine here.) Carl Eugen From cehoyos at ag.or.at Sun Oct 7 11:05:25 2012 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Sun, 7 Oct 2012 09:05:25 +0000 (UTC) Subject: [Libav-user] =?utf-8?q?avformat=5Fopen=5Finput=28=29_fails_with_u?= =?utf-8?q?nicode_filenames_of=09image_files?= References: <506F4225.90108@tim-hauke.de> Message-ID: Tim Hauke writes: > So generally it works quite well. I?m using it with mp4, > avi, jpg, bmp and tif files. But when I try to open an > image file (jpg, bmp, tif) whose filename contains other > characters than from the ASCII charset, > avformat_open_input() returns -2. Found the relevant ticket, consider adding yourself to CC: https://ffmpeg.org/trac/ffmpeg/ticket/819 Carl Eugen From gmxubuntu at yahoo.de Mon Oct 8 10:39:51 2012 From: gmxubuntu at yahoo.de (Sartre Salam) Date: Mon, 8 Oct 2012 09:39:51 +0100 (BST) Subject: [Libav-user] encode - decode vorbis Message-ID: <1349685591.40753.YahooMailNeo@web171601.mail.ir2.yahoo.com> Hi , I'm trying to encode and decode audio with the Vorbis Codec, but it is not successfull.? This is how I set the encoder: ??? ??? ??? ?? pCodecRawCodec = avcodec_find_encoder((AVCodecID)AV_CODEC_ID_VORBIS); ??? ??? ??? ??? ??? if(!pCodecRawCodec) ??? ??? ??? ??? ??? { ??? ??? ??? ??? ??? ??? printf("codec not found\n"); ??? ??? ??? ??? ??? ??? return -1; ??? ??? ??? ??? ??? } ??? ??? ??? ??? ??? pCodecContextRawCodec = avcodec_alloc_context3(pCodecRawCodec); ??? ??? ??? ??? ??? pCodecContextRawCodec->bit_rate = pCodecContextRawInit->bit_rate; ??? ??? ??? ??? ??? pCodecContextRawCodec->sample_rate = pCodecContextRawInit->sample_rate; ??? ??? ??? ??? ??? pCodecContextRawCodec->channels = pCodecContextRawInit->channels; ??? ??? ??? ??? ??? pCodecContextRawCodec->sample_fmt = AV_SAMPLE_FMT_FLT; ??? ??? ?? ??? ??? ??? ??? ??? pCodecContextRawCodec->channel_layout = select_channel_layout(pCodecRawCodec); ??? ??? ??? ??? ??? if(avcodec_open2(pCodecContextRawCodec,pCodecRawCodec,NULL)<0) ??? ??? ??? ??? ??? { ??? ??? ??? ??? ??? ??? printf("could not open codec audio\n"); ??? ??? ??? ??? ??? } And this is how I set the Vorbis decoder : ??? ??? ??? ??? pCodecCodecRaw = avcodec_find_decoder((AVCodecID)AV_CODEC_ID_VORBIS); ??? ??? ??? ??? ??? ??? if(!pCodecCodecRaw) ??? ??? ??? ??? ??? ??? { ??? ??? ??? ??? ??? ??? ??? printf("error found decoder \n"); ??? ??? ??? ??? ??? ??? ??? return -1; ??? ??? ??? ??? ??? ??? } ??? ??? ??? ??? ??? ??? pCodecContextCodecRaw = avcodec_alloc_context3(pCodecCodecRaw); ??? ??? ??? ??? ??? ??? pCodecContextCodecRaw->bit_rate = pCodecContextRawInit->bit_rate; ??? ??? ??? ??? ??? ??? pCodecContextCodecRaw->sample_rate = pCodecContextRawInit->sample_rate; ??? ??? ??? ??? ??? ??? pCodecContextCodecRaw->channels = pCodecContextRawInit->channels; ??? ??? ??? ??? ??? ??? pCodecContextCodecRaw->sample_fmt = AV_SAMPLE_FMT_FLT; ??? ??? ??? ??? ??? ??? pCodecContextCodecRaw->channel_layout = select_channel_layout(pCodecRawCodec); ??? ??? ??? ??? ??? ??? pCodecContextCodecRaw->extradata = pCodecContextRawCodec->extradata; ??? ??? ??? ??? ??? ??? pCodecContextCodecRaw->extradata_size = pCodecContextRawCodec->extradata_size; ??? ??? ??? ??? ??? ??? if(avcodec_open2(pCodecContextCodecRaw,pCodecCodecRaw,NULL)<0) ??? ??? ??? ??? ??? ??? { ??? ??? ??? ??? ??? ??? ??? printf("could not open codec decoder vp8\n"); ??? ??? ??? ??? ??? ??? } I get sometimes the error? "[libvorbis @ 01e03340] packet buffer is too small" by encoding the raw packet. And when I think the encoding and decoding was ?successfull without errors, the file has only zeros, that cant be read as raw audio data. There is a mistake that I make by set the AVCodecContext for Vorbis ? Any idea would be very helpfull, thnx. arctor -------------- next part -------------- An HTML attachment was scrubbed... URL: From mail at tim-hauke.de Mon Oct 8 16:18:44 2012 From: mail at tim-hauke.de (Tim Hauke) Date: Mon, 08 Oct 2012 16:18:44 +0200 Subject: [Libav-user] avformat_open_input() fails with unicode filenames of image files In-Reply-To: References: <506F4225.90108@tim-hauke.de> Message-ID: <5072E0C4.4040005@tim-hauke.de> Am 07.10.2012 11:05, schrieb Carl Eugen Hoyos: > Tim Hauke writes: > >> So generally it works quite well. I?m using it with mp4, >> avi, jpg, bmp and tif files. But when I try to open an >> image file (jpg, bmp, tif) whose filename contains other >> characters than from the ASCII charset, >> avformat_open_input() returns -2. > Found the relevant ticket, consider adding yourself to CC: > https://ffmpeg.org/trac/ffmpeg/ticket/819 > > Carl Eugen > > Hi Carl Eugen, thanks for Your replies. You wrote that it?s working fine with Your installation. Which version do You use and on which platform? Thanks - Tim Hauke From cehoyos at ag.or.at Mon Oct 8 17:38:40 2012 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Mon, 8 Oct 2012 15:38:40 +0000 (UTC) Subject: [Libav-user] =?utf-8?q?avformat=5Fopen=5Finput=28=29_fails_with_u?= =?utf-8?q?nicode_filenames_of_image_files?= References: <506F4225.90108@tim-hauke.de> <5072E0C4.4040005@tim-hauke.de> Message-ID: Tim Hauke writes: > > https://ffmpeg.org/trac/ffmpeg/ticket/819 > You wrote that it?s working fine with Your installation. > Which version do You use and on which platform? Looking into the ticket, I suspect anything != Windows works fine (win32 might be wrong, should probably be win). Carl Eugen From d.santanche at tiscali.it Mon Oct 8 17:39:16 2012 From: d.santanche at tiscali.it (d.santanche at tiscali.it) Date: Mon, 8 Oct 2012 17:39:16 +0200 (CEST) Subject: [Libav-user] Bad H264 streaming over WiFi connection Message-ID: <24926637.124411349710756904.JavaMail.defaultUser@defaultHost> Hi, I'm trying to implement streaming video based on h264 codec. The video is generated from a remote device connected over WIFI, and the stream is sent using RTSP protocol. I've implemented a working prototype but the quality of the video is very bad if RTSP streaming is made an UDP transport protocol and is quite good if the RTSP stream is made using TCP transport. It seems that over UDP some packet are lost. I'm trying to detect the amount of packet lost and so I'd like to print the RTP packet sequence number on the server and on the client. Where can I find this information? Best Regards Invita i tuoi amici e Tiscali ti premia! Il consiglio di un amico vale pi? di uno spot in TV. Per ogni nuovo abbonato 30 ? di premio per te e per lui! Un amico al mese e parli e navighi sempre gratis: http://freelosophy.tiscali.it/ From ddurham at davyandbeth.com Mon Oct 8 19:25:19 2012 From: ddurham at davyandbeth.com (Davy Durham) Date: Mon, 08 Oct 2012 12:25:19 -0500 Subject: [Libav-user] ReZound Integration Question Message-ID: <50730C7F.2010602@davyandbeth.com> I need some advice on integration. I'm experimenting with changing rezound (a destructive audio editor) to use libavcodec/libavformat instead of its current use of many other libraries (libsndfile, libaudiofile, lame, manual coding in some places, etc). I did all of that work a LONG time ago. *Q1:* So, loading audio files that might have multiple streams is rather straight forward in concept.. I don't think users of rezound would normally load files with multiple streams (e.g. video files), but I can certainly enumerate the audio streams and present the user with a choice of which audio stream to load. Let's call that chosen stream "stream X". So then if the user chooses the save the file after doing their editing, is it feasible (with libavformat) to replace stream X in the original file leaving all other streams intact? I'm guessing this could be done (in concept) by opening a new temp file for write, and re-opening the original file for reading. Then as I read the packets from the file, if the packet was for some other stream, then I just write it verbatim to the new file, but if the packet was for stream X, then I write the new encoded packet to the new file. Then when it's all done, I move the tmp file back to the original file. This would generally preserve the interlacing of packets within the file. I assume it would be a bad idea to simply drop all the original file's packets for !stream X and then simply append stream X's new packets to the end of the file. So that, or is that kind of functionality already built into libavformat? (i.e. functionality to /rewrite/ one of the streams within a file) *Q2:* It's daunting to consider the type and extent of UI that needs to be in place if a user chooses to save a file in a chosen format with a chosen codec. That is, just how many little options and their sensible defaults would need to be presented to the user for all the minutia of all the supported audio codecs. Does ffmpeg provide any sort of programatic enumeration of the parameters (along with their name, data-type, defaults, etc) that need to be specified in the encode operation? I don't immediately see something like a struct for each supported codec that describes all the options for that codec. [Did I miss it?] Also, is there a way to know from the library what codecs are supported by a given muxer? (just beginning to look at how -formats, -decodes, -encoders) work --- As you can tell, I'm just beginning to look at the idea of switching to ffmpeg. I'm looking at the ffplay code (which only helps with understanding how to read). I've found the doxygen code and the api-example.c (which only helps with libavcodec). Are there other good resources for figuring this stuff out? Thanks. Any suggestions, guidance, ideas, warnings, etc are appreciated. -- Davy -------------- next part -------------- An HTML attachment was scrubbed... URL: From i.like.privacy.too at gmail.com Mon Oct 8 21:04:34 2012 From: i.like.privacy.too at gmail.com (Camera Man) Date: Mon, 08 Oct 2012 15:04:34 -0400 Subject: [Libav-user] Bad H264 streaming over WiFi connection In-Reply-To: <24926637.124411349710756904.JavaMail.defaultUser@defaultHost> References: <24926637.124411349710756904.JavaMail.defaultUser@defaultHost> Message-ID: <507323C2.2010207@gmail.com> An HTML attachment was scrubbed... URL: From info at denisgottardello.it Mon Oct 8 22:24:17 2012 From: info at denisgottardello.it (Denis) Date: Mon, 8 Oct 2012 22:24:17 +0200 Subject: [Libav-user] FFMpeg and CODEC_ID_MJPEG Message-ID: <201210082224.17793.info@denisgottardello.it> I have a problem with "decoding_encoding.c" example making a video with mjpeg codec. I obtain the error "Encode video file mjpeg.mpg [mjpeg @ 0x956b020] Specified pix_fmt is not supported could not open codec" Wich is the right way to encode to mjpeg format? -- www.denisgottardello.it Skype: mrdebug Videosurveillance and home automation! http://www.denisgottardello.it/DomusBoss/DomusBossIndice.php From cehoyos at ag.or.at Mon Oct 8 23:23:14 2012 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Mon, 8 Oct 2012 21:23:14 +0000 (UTC) Subject: [Libav-user] ReZound Integration Question References: <50730C7F.2010602@davyandbeth.com> Message-ID: Davy Durham writes: > I'm experimenting with changing rezound (a destructive audio > editor) to use libavcodec/libavformat instead of its current > use of many other libraries (libsndfile, libaudiofile, lame, > manual coding in some places, etc). Without knowing anything about rezound, I wonder if it wouldn't make more sense to integrate rezound as an audio filter in libavfilter (assuming it is a library)... [...] > So then if the user chooses the save the file after doing > their editing, is it feasible (with libavformat) to replace > stream X in the original file leaving all other streams > intact? "Replace" might be the wrong word: You can mux video and audio streams into the usual containers (and some more), and you not just mux the edited and encoded audio from rezound but also the unchanged streams from the input file, but I wouldn't call the muxing "replacing" anything. [...] > I don't immediately see something like a struct for each > supported codec that describes all the options for that > codec.? [Did I miss it?] I think so because many codecs have an AVOption struct that describe their codec-specific options. (Many options are global though). > Also, is there a way to know from the library what codecs > are supported by a given muxer? I don't think so, but some containers (like avi and nut) support basically any stream while others are special (and some allow you to put things in it that don't belong there). I suspect initializing a muxer with streams tells you the answer. [...] > I've found the doxygen code and the api-example.c (which > only helps with libavcodec).?Are there other good > resources for figuring this stuff out? doc/examples contains some more example code nowadays. Carl Eugen From cehoyos at ag.or.at Mon Oct 8 23:24:52 2012 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Mon, 8 Oct 2012 21:24:52 +0000 (UTC) Subject: [Libav-user] =?utf-8?q?FFMpeg_and_CODEC=5FID=5FMJPEG?= References: <201210082224.17793.info@denisgottardello.it> Message-ID: Denis writes: > I have a problem with "decoding_encoding.c" example > making a video with mjpeg codec. I obtain the error > > "Encode video file mjpeg.mpg > [mjpeg @ 0x956b020] Specified pix_fmt is not supported > could not open codec" (The following is of course pure guessing, since all necessary information is missing.) MJPEG does not support yuv420p, it needs PIX_FMT_YUVJ420P (or PIX_FMT_YUVJ422P). Carl Eugen From ddurham at davyandbeth.com Tue Oct 9 00:32:55 2012 From: ddurham at davyandbeth.com (Davy Durham) Date: Mon, 08 Oct 2012 17:32:55 -0500 Subject: [Libav-user] ReZound Integration Question In-Reply-To: References: <50730C7F.2010602@davyandbeth.com> Message-ID: <50735497.9000604@davyandbeth.com> On 10/08/2012 04:23 PM, Carl Eugen Hoyos wrote: > Davy Durham writes: > >> I'm experimenting with changing rezound (a destructive audio >> editor) to use libavcodec/libavformat instead of its current >> use of many other libraries (libsndfile, libaudiofile, lame, >> manual coding in some places, etc). > Without knowing anything about rezound, I wonder if it wouldn't > make more sense to integrate rezound as an audio filter in > libavfilter (assuming it is a library)... Well, ReZound is basically an editor.. you load the file, edit it, save it again. I just need to read the decoded audio into the native formatted working file, and then re-encode it back to the original file (File->Save) or into a new file (File->Save As) > [...] > >> So then if the user chooses the save the file after doing >> their editing, is it feasible (with libavformat) to replace >> stream X in the original file leaving all other streams >> intact? > "Replace" might be the wrong word: > You can mux video and audio streams into the usual containers > (and some more), and you not just mux the edited and encoded > audio from rezound but also the unchanged streams from the > input file, but I wouldn't call the muxing "replacing" > anything. Given the above, that's what I mean by replace. The user would be "replacing" the stream in the file that they loaded when they choose to "File->Save" it. > [...] > >> I don't immediately see something like a struct for each >> supported codec that describes all the options for that >> codec. [Did I miss it?] > I think so because many codecs have an AVOption struct that > describe their codec-specific options. > (Many options are global though). Would libavcodec/ac3enc.h: struct AC3EncOptions be an example? That's not an AVOptions struct.. How/Where is an AC3EncOptions object given to the codec when encoding AC3? That might help answer my question. >> Also, is there a way to know from the library what codecs >> are supported by a given muxer? > I don't think so, but some containers (like avi and nut) > support basically any stream while others are special > (and some allow you to put things in it that don't > belong there). I suspect initializing a muxer with streams > tells you the answer. > > [...] Makes sense >> I've found the doxygen code and the api-example.c (which >> only helps with libavcodec). Are there other good >> resources for figuring this stuff out? > doc/examples contains some more example code nowadays. Thanks, I'll give those a look-see. > Carl Eugen > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user From cehoyos at ag.or.at Tue Oct 9 01:23:34 2012 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Mon, 8 Oct 2012 23:23:34 +0000 (UTC) Subject: [Libav-user] ReZound Integration Question References: <50730C7F.2010602@davyandbeth.com> <50735497.9000604@davyandbeth.com> Message-ID: Davy Durham writes: > >> I don't immediately see something like a struct for each > >> supported codec that describes all the options for that > >> codec. [Did I miss it?] > > > > I think so because many codecs have an AVOption struct that > > describe their codec-specific options. > > (Many options are global though). > > Would libavcodec/ac3enc.h: struct AC3EncOptions be an example? The struct to describe the options for ac-3 encoding is ac3_options[] in ac3enc_opts_template.c. Options can be set programmatically, but I am not an expert for this;-( Carl Eugen From gmxubuntu at yahoo.de Tue Oct 9 12:18:28 2012 From: gmxubuntu at yahoo.de (Sartre Salam) Date: Tue, 9 Oct 2012 11:18:28 +0100 (BST) Subject: [Libav-user] muxing-example.c on windows Message-ID: <1349777908.33896.YahooMailNeo@web171604.mail.ir2.yahoo.com> Hi , I have compile the muxing-example.c on windows with the last binaries from Zeranoe.com. After this I try to mux an .mp4 file , but I get the error "[mp4 @ 00622bc0] pts <0> < dts <1> in stream 0 Error while writing video frame" Then I try to mux a webm file and it was successfull, I only have to change the sample_fmt from audio encoder from AV_SAMPLE_FMT_S16 to AV_SAMPLE_FMT_FLT. But the sample webm file has no sound.? There are another tutorials about muxing with ffmpeg liavformat libraries? And it is possible to encode and decode audio with the vorbis encoder ? thnx -------------- next part -------------- An HTML attachment was scrubbed... URL: From gmxubuntu at yahoo.de Tue Oct 9 12:59:18 2012 From: gmxubuntu at yahoo.de (Sartre Salam) Date: Tue, 9 Oct 2012 11:59:18 +0100 (BST) Subject: [Libav-user] muxing-example.c on windows In-Reply-To: <1349777908.33896.YahooMailNeo@web171604.mail.ir2.yahoo.com> References: <1349777908.33896.YahooMailNeo@web171604.mail.ir2.yahoo.com> Message-ID: <1349780358.4235.YahooMailNeo@web171601.mail.ir2.yahoo.com> srry, the name of the example is not muxing-example.c , it is muxing.c thnx ________________________________ Von: Sartre Salam An: "libav-user at ffmpeg.org" Gesendet: 12:18 Dienstag, 9.Oktober 2012 Betreff: [Libav-user] muxing-example.c on windows Hi , I have compile the muxing-example.c on windows with the last binaries from Zeranoe.com. After this I try to mux an .mp4 file , but I get the error "[mp4 @ 00622bc0] pts <0> < dts <1> in stream 0 Error while writing video frame" Then I try to mux a webm file and it was successfull, I only have to change the sample_fmt from audio encoder from AV_SAMPLE_FMT_S16 to AV_SAMPLE_FMT_FLT. But the sample webm file has no sound.? There are another tutorials about muxing with ffmpeg liavformat libraries? And it is possible to encode and decode audio with the vorbis encoder ? thnx _______________________________________________ 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 cg85 at hotmail.com Tue Oct 9 23:49:22 2012 From: cg85 at hotmail.com (CHAUVET Guillaume) Date: Tue, 9 Oct 2012 23:49:22 +0200 Subject: [Libav-user] Encoding workflow process and container In-Reply-To: References: , Message-ID: Hello Gonzalo, Thank you very much; I finished my program by means of muxing.c. The resulting video works well apart from the fact that estimated duration is invalid (256204778:48:05) Sincerly, Guillaume From phamsyquybk at gmail.com Wed Oct 10 07:02:34 2012 From: phamsyquybk at gmail.com (Quy Pham Sy) Date: Wed, 10 Oct 2012 14:02:34 +0900 Subject: [Libav-user] [libav-user] is avio_set_interrupt_cb deprecated? Message-ID: Hi all, Is the avio_set_interrupt_cb function deprecated? What is the substitute? Jack From cehoyos at ag.or.at Wed Oct 10 10:32:17 2012 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Wed, 10 Oct 2012 08:32:17 +0000 (UTC) Subject: [Libav-user] =?utf-8?q?=5Blibav-user=5D_is_avio=5Fset=5Finterrupt?= =?utf-8?q?=5Fcb_deprecated=3F?= References: Message-ID: Quy Pham Sy writes: > Is the avio_set_interrupt_cb function deprecated? No, it was already removed in January. > What is the substitute? At the time of depreciation, the fine sources read: Use interrupt_callback in AVFormatContext/avio_open2 instead. Carl Eugen From rishy.gupta.svc at gmail.com Wed Oct 10 14:05:19 2012 From: rishy.gupta.svc at gmail.com (rishi gupta) Date: Wed, 10 Oct 2012 17:35:19 +0530 Subject: [Libav-user] Problem using Libav APi for converting video and audio In-Reply-To: References: Message-ID: Hi , I have seen your mail in this link : https://lists.ffmpeg.org/pipermail/libav-user/2012-May/002130.html And i m going through same problem, i want to convert audio files in different format and trying to use libav with qt 4.7 but dont know how to use decode and encode file. Did you find any solution of your problem. i will very thankful if you guide me. Thanks and Regards :- Rishi Kant Gupta Mob :- +919023535450 -------------- next part -------------- An HTML attachment was scrubbed... URL: From matthew.c.lawrence at gmail.com Wed Oct 10 19:34:16 2012 From: matthew.c.lawrence at gmail.com (Matthew Lawrence) Date: Wed, 10 Oct 2012 12:34:16 -0500 Subject: [Libav-user] FFmpeg License Violation - What Are My Remedies? Message-ID: I recently purchased an app from Google Play that incorporates the FFmpeg library. Because the app is a derivative work under the LGPLv2.1, I believe I am entitled to a copy of the source code for the entire app. I have e-mailed the developer's support staff, but they are refusing to release the source code. I have cited the LGPL to them, but hey claim they are required to provide only the source code for the FFmpeg library. I believe that they are in violation of the license and are violating both my legal rights and those of the FFmpeg team. What are my remedies in this situation? What steps can I take (other than hiring a lawyer) to assert my rights? Who at FFmpeg can I notify of this violation so that they can enforce their rights? The app is Paper Camera by JFDP Labs. https://play.google.com/store/apps/details?id=com.dama.papercamera -------------- next part -------------- An HTML attachment was scrubbed... URL: From ggarra13 at gmail.com Wed Oct 10 19:45:06 2012 From: ggarra13 at gmail.com (=?ISO-8859-1?Q?Gonzalo_Garramu=F1o?=) Date: Wed, 10 Oct 2012 14:45:06 -0300 Subject: [Libav-user] FFmpeg License Violation - What Are My Remedies? In-Reply-To: References: Message-ID: <5075B422.2080202@gmail.com> El 10/10/2012 02:34 p.m., Matthew Lawrence escribi?: > I recently purchased an app from Google Play that incorporates the > FFmpeg library. Because the app is a derivative work under the > LGPLv2.1, I believe I am entitled to a copy of the source code for the > entire app. I have e-mailed the developer's support staff, but they > are refusing to release the source code. I have cited the LGPL to > them, but hey claim they are required to provide only the source code > for the FFmpeg library. I believe that they are in violation of the > license and are violating both my legal rights and those of the FFmpeg > team. They are right. Under the LGPL they only need to release the source code to any changes to ffmpeg. Under GPL they would require to release source code to all their code. From philip at turmel.org Wed Oct 10 19:45:14 2012 From: philip at turmel.org (Phil Turmel) Date: Wed, 10 Oct 2012 13:45:14 -0400 Subject: [Libav-user] FFmpeg License Violation - What Are My Remedies? In-Reply-To: References: Message-ID: <5075B42A.4030907@turmel.org> On 10/10/2012 01:34 PM, Matthew Lawrence wrote: > I recently purchased an app from Google Play that incorporates the FFmpeg > library. Because the app is a derivative work under the LGPLv2.1, I > believe I am entitled to a copy of the source code for the entire app. I > have e-mailed the developer's support staff, but they are refusing to > release the source code. I have cited the LGPL to them, but hey claim they > are required to provide only the source code for the FFmpeg library. I > believe that they are in violation of the license and are violating both my > legal rights and those of the FFmpeg team. If in fact they only shipped an LGPL binary of ffmpeg, you are *not* entitled to their entire source code. Please re-read the LGPL, noting that LGPL != GPL. Also, you might re-read http://ffmpeg.org/legal.html IANAL, etc. Phil From matthew.c.lawrence at gmail.com Wed Oct 10 21:09:47 2012 From: matthew.c.lawrence at gmail.com (Matthew Lawrence) Date: Wed, 10 Oct 2012 14:09:47 -0500 Subject: [Libav-user] FFmpeg License Violation - What Are My Remedies? In-Reply-To: <5075B422.2080202@gmail.com> References: <5075B422.2080202@gmail.com> Message-ID: Can you provide a citation for your claim? Section 5 of the LGPLv2.1 states in part: "5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. " Under the first paragraph, the app is a "work that uses the Library". However, because the work is distributed together with the Library in a single executable (DEX file within an APK), the work is not "in isolation" and is therefore not outside the scope of the License. Instead, the second paragraph applies. When they build the APK from source, they are statically linking the "work that uses the Library" with the Library. The final product (the APK and the DEX file inside it) is a derivative work because it contains the Library. This is precisely the condition covered by Paragraph 2 of Section 5. As a result, the APK is covered by the License, and they are bound by Section 6 which requires them to distribute the source of their "work that uses the Library" to anyone who requests it. What am I missing? Matthew On Wed, Oct 10, 2012 at 12:45 PM, Gonzalo Garramu?o wrote: > El 10/10/2012 02:34 p.m., Matthew Lawrence escribi?: > > I recently purchased an app from Google Play that incorporates the FFmpeg >> library. Because the app is a derivative work under the LGPLv2.1, I >> believe I am entitled to a copy of the source code for the entire app. I >> have e-mailed the developer's support staff, but they are refusing to >> release the source code. I have cited the LGPL to them, but hey claim they >> are required to provide only the source code for the FFmpeg library. I >> believe that they are in violation of the license and are violating both my >> legal rights and those of the FFmpeg team. >> > > They are right. Under the LGPL they only need to release the source code > to any changes to ffmpeg. Under GPL they would require to release source > code to all their code. > > ______________________________**_________________ > 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 edward at edwardandalison.com Wed Oct 10 21:35:51 2012 From: edward at edwardandalison.com (Edward Richards) Date: Wed, 10 Oct 2012 12:35:51 -0700 Subject: [Libav-user] FFmpeg License Violation - What Are My Remedies? In-Reply-To: References: <5075B422.2080202@gmail.com> Message-ID: <918202A6-5530-4C3C-93C1-E143BE37115C@EDWARDandALISON.com> Then talk to a lawyer about your rights to sue if that's your interpretation. Do you even know if it is statically linked? Because the free software foundation consensus is that runtime linking is ok since YOU the user is doing the violation not the deployment media. Besides...Bringing it up here isn't going to do anything. How dare anybody try to improve the global economy by developing and selling a product using LGPL - which was designed to make the commercial use of open source viable. The gaul! From info at denisgottardello.it Wed Oct 10 22:17:36 2012 From: info at denisgottardello.it (Denis) Date: Wed, 10 Oct 2012 22:17:36 +0200 Subject: [Libav-user] FFMpeg and CODEC_ID_MJPEG In-Reply-To: References: <201210082224.17793.info@denisgottardello.it> Message-ID: <201210102217.36405.info@denisgottardello.it> In data luned? 08 ottobre 2012 23:24:52, Carl Eugen Hoyos ha scritto: > MJPEG does not support yuv420p, it needs PIX_FMT_YUVJ420P > (or PIX_FMT_YUVJ422P). Thanks, now works. -- www.denisgottardello.it Skype: mrdebug Videosurveillance and home automation! http://www.denisgottardello.it/DomusBoss/DomusBossIndice.php From i.like.privacy.too at gmail.com Wed Oct 10 22:50:02 2012 From: i.like.privacy.too at gmail.com (Camera Man) Date: Wed, 10 Oct 2012 16:50:02 -0400 Subject: [Libav-user] FFmpeg License Violation - What Are My Remedies? In-Reply-To: References: <5075B422.2080202@gmail.com> Message-ID: <5075DF7A.30404@gmail.com> An HTML attachment was scrubbed... URL: From alexcohn at netvision.net.il Wed Oct 10 22:51:24 2012 From: alexcohn at netvision.net.il (Alex Cohn) Date: Wed, 10 Oct 2012 22:51:24 +0200 Subject: [Libav-user] FFmpeg License Violation - What Are My Remedies? In-Reply-To: References: <5075B422.2080202@gmail.com> Message-ID: On 10 Oct 2012 21:09, "Matthew Lawrence" wrote: > > Can you provide a citation for your claim? > > Section 5 of the LGPLv2.1 states in part: > > "5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. > > However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. " > > Under the first paragraph, the app is a "work that uses the Library". However, because the work is distributed together with the Library in a single executable (DEX file within an APK), the work is not "in isolation" and is therefore not outside the scope of the License. Instead, the second paragraph applies. When they build the APK from source, they are statically linking the "work that uses the Library" with the Library. The final product (the APK and the DEX file inside it) is a derivative work because it contains the Library. This is precisely the condition covered by Paragraph 2 of Section 5. As a result, the APK is covered by the License, and they are bound by Section 6 which requires them to distribute the source of their "work that uses the Library" to anyone who requests it. > > What am I missing? > > Matthew Technically you are almost right. But the prevailing tradition is that packaging of LGPL library inside an APK is not considered violation of the License. Note that the Java part (the DEX file you mentioned) is forced to use dynamic linking (which follows section 5) by the limitations of the Android platform. In my eyes, the practice of bundling binaries into APK has one specific problem with the spirit (but not the letter) of LGPL: while replacing the library with another one, that the end user built him/herself from the open sources, is possible, but requires root access. I have proposed an alternative mechanism elsewhere (http://stackoverflow.com/questions/12744849/android-library-engineering/12753468#12753468), which would allow anyone to replace the LGPL component on Android, but the adoption rate is rather slow. BR, Alex Cohn From info at denisgottardello.it Wed Oct 10 23:15:38 2012 From: info at denisgottardello.it (Denis) Date: Wed, 10 Oct 2012 23:15:38 +0200 Subject: [Libav-user] decoding_encoding.c and theora Message-ID: <201210102315.38658.info@denisgottardello.it> I have a problem with decoding_encoding.c and theora. The example produces correctly the file but I can watch it with vlc or mplayer. I call the function in this mode: video_encode_example("theora.ogg", CODEC_ID_THEORA); -- www.denisgottardello.it Skype: mrdebug Videosurveillance and home automation! http://www.denisgottardello.it/DomusBoss/DomusBossIndice.php -------------- next part -------------- An HTML attachment was scrubbed... URL: From cehoyos at ag.or.at Wed Oct 10 23:52:06 2012 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Wed, 10 Oct 2012 21:52:06 +0000 (UTC) Subject: [Libav-user] FFmpeg License Violation - What Are My Remedies? References: Message-ID: Matthew Lawrence writes: > I recently purchased an app from Google Play that > incorporates the FFmpeg library.? Because the app is a > derivative work under the LGPLv2.1, I believe I am > entitled to a copy of the source code for the entire app. Apart from what was already said (LGPL does not require them to ship source code, the packaging should not make any difference, even static linking is ok if you can relink by them providing object files): Do they forbid reverse engineering in their EULA? (That would make the software LGPL-incompatible.) Carl Eugen From mbradshaw at sorensonmedia.com Thu Oct 11 01:33:02 2012 From: mbradshaw at sorensonmedia.com (Michael Bradshaw) Date: Wed, 10 Oct 2012 17:33:02 -0600 Subject: [Libav-user] FFmpeg License Violation - What Are My Remedies? In-Reply-To: References: Message-ID: On Wed, Oct 10, 2012 at 11:34 AM, Matthew Lawrence wrote: >[...] > What steps can I take (other than hiring a lawyer) to assert my rights? Pretty much nothing. You can ask for it all you want, and they can say no all they want. IANAL, so I've no clue who's in the right, but if you really want it and they say no, pretty much the only thing you can do is take them to court and let the court decide if you're entitled to the source or not. > Who at FFmpeg can I notify of this violation so that they can enforce their rights? I can't speak for FFmpeg, but I doubt there's anything anyone in the FFmpeg project can/will do (aside from putting them on a wall of shame or hiring a lawyer and suing). --Michael From mbradshaw at sorensonmedia.com Thu Oct 11 01:35:08 2012 From: mbradshaw at sorensonmedia.com (Michael Bradshaw) Date: Wed, 10 Oct 2012 17:35:08 -0600 Subject: [Libav-user] FFmpeg License Violation - What Are My Remedies? In-Reply-To: References: Message-ID: On Wed, Oct 10, 2012 at 5:33 PM, Michael Bradshaw wrote: > On Wed, Oct 10, 2012 at 11:34 AM, Matthew Lawrence > wrote: >>[...] > >> What steps can I take (other than hiring a lawyer) to assert my rights? > > Pretty much nothing. You can ask for it all you want, and they can say > no all they want. IANAL, so I've no clue who's in the right, but if > you really want it and they say no, pretty much the only thing you can > do is take them to court and let the court decide if you're entitled > to the source or not. > >> Who at FFmpeg can I notify of this violation so that they can enforce their rights? > > I can't speak for FFmpeg, but I doubt there's anything anyone in the > FFmpeg project can/will do (aside from putting them on a wall of shame > or hiring a lawyer and suing). Sorry, I meant the only two things I see as options for the FFmpeg project is putting them on a wall of shame or hiring a lawyer and suing, neither of which I expect to happen. I didn't word that very well. From phamsyquybk at gmail.com Thu Oct 11 02:17:34 2012 From: phamsyquybk at gmail.com (Quy Pham Sy) Date: Thu, 11 Oct 2012 09:17:34 +0900 Subject: [Libav-user] [libav-user] is avio_set_interrupt_cb deprecated? In-Reply-To: References: Message-ID: hi thanks Carl, Here is my code using avio_open2: int decode_interrupt_cb(void) { // Do something } const AVIOInterruptCB int_cb = { decode_interrupt_cb, NULL }; int main(int argc, char *argv[]) { .... AVFormatContext *pFormatCtx; // Open video file if(avformat_open_input(&pFormatCtx, filename, NULL, NULL)!=0) return -1; pFormatCtx->interrupt_callback = int_cb; if (avio_open2(&pFormatCtx->pb, filename, AVIO_FLAG_READ, &pFormatCtx->interrupt_callback, NULL)) return -1; ... } Should I have called the avio_open2 first or not? P.S.Q From wseemann at gmail.com Thu Oct 11 06:06:25 2012 From: wseemann at gmail.com (William Seemann) Date: Wed, 10 Oct 2012 23:06:25 -0500 Subject: [Libav-user] FFmpeg components needed to extract audio/video metadata In-Reply-To: References: Message-ID: <507645C1.5010404@gmail.com> Hello! I'm currently developing an Android application that uses FFmpeg to retrieve metadata for core supported audio/video formats (see the formats here: http://developer.android.com/guide/appendix/media-formats.html). In order to keep the APK build size small I was wondering if anyone can tell me what components are required to extract metadata? In other words, what flags are needed at compile time to extract metadata. I'm currently using the following flags (which work) but I know they could be more granular: FLAGS="$FLAGS --enable-shared --disable-symver" FLAGS="$FLAGS --enable-small --optimization-flags=-O2" FLAGS="$FLAGS --disable-doc" FLAGS="$FLAGS --disable-ffmpeg" FLAGS="$FLAGS --disable-ffplay" FLAGS="$FLAGS --disable-ffprobe" FLAGS="$FLAGS --disable-ffserver" FLAGS="$FLAGS --disable-avdevice" FLAGS="$FLAGS --disable-swresample" FLAGS="$FLAGS --disable-swscale" FLAGS="$FLAGS --disable-postproc" FLAGS="$FLAGS --disable-avfilter" FLAGS="$FLAGS --disable-everything" FLAGS="$FLAGS --disable-gpl" FLAGS="$FLAGS --enable-parsers" FLAGS="$FLAGS --enable-protocol=http" FLAGS="$FLAGS --enable-demuxers" For instance, if I only need to extract metadata for mp3, ogg, and flac what specifically needs to be enabled? Thanks in advance for any help. - William From rizwan.raza at gmail.com Thu Oct 11 07:56:36 2012 From: rizwan.raza at gmail.com (Rizwan Raza) Date: Thu, 11 Oct 2012 00:56:36 -0500 Subject: [Libav-user] Not able to convert to mp4 from wmv format Message-ID: Hi: I am using the commands below to convert from *.wmv to *.mp4 but the conversion is producing 0kb size file /usr/local/bin/ffmpeg -y -i /var/www/vhosts/ 30a.tv/httpdocs/uploads/avi/myhaEzeEZWtPTOZQnRbG.wmv -an -pass 1 -threads 2 -vcodec libx264 -b 512k -bf 3 -subq 6 -cmp 256 -refs 5 -qmin 10 -qmax 51 -qdiff 4 -coder 1 -me_range 16 -trellis 1 -flags +mv4 -partitions parti4x4+parti8x8+partp4x4+partp8x8+partb8x8 -g 250 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 /var/www/vhosts/ 30a.tv/httpdocs/uploads/myhaEzeEZWtPTOZQnRbG.mp4 /usr/local/bin/ffmpeg -y -i /var/www/vhosts/ 30a.tv/httpdocs/uploads/avi/myhaEzeEZWtPTOZQnRbG.wmv -acodec libfaac -ar 44100 -ab 96k -pass 2 -threads 2 -vcodec libx264 -b 512k -bf 3 -subq 6 -cmp 256 -refs 5 -qmin 10 -qmax 51 -qdiff 4 -coder 1 -me_range 16 -trellis 1 -flags +mv4 -partitions parti4x4+parti8x8+partp4x4+partp8x8+partb8x8 -g 250 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 /var/www/vhosts/ 30a.tv/httpdocs/uploads/myhaEzeEZWtPTOZQnRbG.mp4 I would appreciate any help into this matter. Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: From cehoyos at ag.or.at Thu Oct 11 16:34:46 2012 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Thu, 11 Oct 2012 14:34:46 +0000 (UTC) Subject: [Libav-user] Not able to convert to mp4 from wmv format References: Message-ID: Rizwan Raza writes: > I would appreciate any help into this matter. Please provide complete, uncut console output (together with the command line) of the failed transcoding attempt. If the problem also appears with the following command line, output would be prefered for this one because it does not use external libraries (libx264, libfaac): $ ffmpeg -i myhaEzeEZWtPTOZQnRbG.wmv -strict -2 -acodec aac -vcodec mpeg4 -qscale 2 -ab 320k out.mp4 Carl Eugen From cehoyos at ag.or.at Thu Oct 11 16:42:40 2012 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Thu, 11 Oct 2012 14:42:40 +0000 (UTC) Subject: [Libav-user] =?utf-8?q?FFmpeg_components_needed_to_extract_audio/?= =?utf-8?q?video=09metadata?= References: <507645C1.5010404@gmail.com> Message-ID: William Seemann writes: > FLAGS="$FLAGS --enable-shared --disable-symver" (You could add --disable-debug although it is not default for shared anyway iirc.) > FLAGS="$FLAGS --enable-small --optimization-flags=-O2" There are two possibilities: Either "-O2" is good (be it for all use cases, or only for --enable-small), then it should be made default (either in all cases, or if --enable-small was selected) = please report that it should be made default (and why), so other users profit from your experience! Or it is bad, then don't use it ;-) > FLAGS="$FLAGS --disable-doc" > FLAGS="$FLAGS --disable-ffmpeg" > FLAGS="$FLAGS --disable-ffplay" > FLAGS="$FLAGS --disable-ffprobe" > FLAGS="$FLAGS --disable-ffserver" > FLAGS="$FLAGS --disable-avdevice" > FLAGS="$FLAGS --disable-swresample" > FLAGS="$FLAGS --disable-swscale" > FLAGS="$FLAGS --disable-postproc" > FLAGS="$FLAGS --disable-avfilter" > FLAGS="$FLAGS --disable-everything" Doesn't --disable-everything make the others unneeded (at least some of them)? > FLAGS="$FLAGS --disable-gpl" This is unneded (disable-gpl is the default). > FLAGS="$FLAGS --enable-parsers" I suspect this enables a very large part of the software you disabled above. Try to enable only the parsers you need. > FLAGS="$FLAGS --enable-protocol=http" > FLAGS="$FLAGS --enable-demuxers" > > For instance, if I only need to extract metadata > for mp3, ogg, and flac what specifically needs to > be enabled? Did you try --enable-demuxer=mp3,ogg,flac instead of --enable-demuxers? Carl Eugen From nicolas.george at normalesup.org Wed Oct 10 20:06:14 2012 From: nicolas.george at normalesup.org (Nicolas George) Date: Wed, 10 Oct 2012 20:06:14 +0200 Subject: [Libav-user] FFmpeg License Violation - What Are My Remedies? In-Reply-To: References: Message-ID: <20121010180614.GA22417@phare.normalesup.org> Le nonidi 19 vend?miaire, an CCXXI, Matthew Lawrence a ?crit?: > I recently purchased an app from Google Play that incorporates the FFmpeg > library. Because the app is a derivative work under the LGPLv2.1, I > believe I am entitled to a copy of the source code for the entire app. I > have e-mailed the developer's support staff, but they are refusing to > release the source code. I have cited the LGPL to them, but hey claim they > are required to provide only the source code for the FFmpeg library. I > believe that they are in violation of the license and are violating both my > legal rights and those of the FFmpeg team. As other have pointed out, since this is the LGPL and not the GPL, they are not required to give away their full source code, only the source code of FFmpeg as they have built it. They are also required to provide anything you might need to rebuild their application using a modified version of ffmpeg. In this particular case, FFmpeg is likely loaded as a shared library, so they would only have to provide the possible JNI glue they have included in said library, and possibly only as pre-built object files. Also note that you are not legally party of the LGPL violation, only the FFmpeg copyright holders are entitled to seek reparation in such a case. Regards, -- Nicolas George -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: Digital signature URL: From eric at teratorn.org Wed Oct 10 19:55:23 2012 From: eric at teratorn.org (Eric P. Mangold) Date: Wed, 10 Oct 2012 13:55:23 -0400 Subject: [Libav-user] FFmpeg License Violation - What Are My Remedies? In-Reply-To: References: Message-ID: <20121010175523.GA23318@ragnarok.teratorn.org> You could start by CC'ing the party in question. On Wed, Oct 10, 2012 at 12:34:16PM -0500, Matthew Lawrence wrote: > I recently purchased an app from Google Play that incorporates the FFmpeg > library. Because the app is a derivative work under the LGPLv2.1, I > believe I am entitled to a copy of the source code for the entire app. I > have e-mailed the developer's support staff, but they are refusing to > release the source code. I have cited the LGPL to them, but hey claim they > are required to provide only the source code for the FFmpeg library. I > believe that they are in violation of the license and are violating both my > legal rights and those of the FFmpeg team. > > What are my remedies in this situation? What steps can I take (other than > hiring a lawyer) to assert my rights? Who at FFmpeg can I notify of this > violation so that they can enforce their rights? > > The app is Paper Camera by JFDP Labs. > https://play.google.com/store/apps/details?id=com.dama.papercamera > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user From lou at lrcd.com Thu Oct 11 19:53:46 2012 From: lou at lrcd.com (Lou) Date: Thu, 11 Oct 2012 09:53:46 -0800 Subject: [Libav-user] FFmpeg License Violation - What Are My Remedies? In-Reply-To: Message-ID: <20121011095346.37f457f2@lrcd.com> On Wed, Oct 10, 2012 at 5:33 PM, Michael Bradshaw wrote: > Sorry, I meant the only two things I see as options for the FFmpeg > project is putting them on a wall of shame or hiring a lawyer and > suing, neither of which I expect to happen. I didn't word that very > well. The Hall of Shame no longer exists (a page exists without entries, but I think it is orphaned from the menu/legal page). It was a maintenance burden, its effectiveness was questionable, and it was getting really long. From mbradshaw at sorensonmedia.com Thu Oct 11 20:01:17 2012 From: mbradshaw at sorensonmedia.com (Michael Bradshaw) Date: Thu, 11 Oct 2012 12:01:17 -0600 Subject: [Libav-user] FFmpeg License Violation - What Are My Remedies? In-Reply-To: <20121011095346.37f457f2@lrcd.com> References: <20121011095346.37f457f2@lrcd.com> Message-ID: On Thu, Oct 11, 2012 at 11:53 AM, Lou wrote: > On Wed, Oct 10, 2012 at 5:33 PM, Michael Bradshaw wrote: > >> Sorry, I meant the only two things I see as options for the FFmpeg >> project is putting them on a wall of shame or hiring a lawyer and >> suing, neither of which I expect to happen. I didn't word that very >> well. > > The Hall of Shame no longer exists (a page exists without entries, but > I think it is orphaned from the menu/legal page). It was a maintenance > burden, its effectiveness was questionable, and it was getting really > long. Which is why I don't expect it to happen :) From nicolas.george at normalesup.org Thu Oct 11 21:04:15 2012 From: nicolas.george at normalesup.org (Nicolas George) Date: Thu, 11 Oct 2012 21:04:15 +0200 Subject: [Libav-user] FFmpeg License Violation - What Are My Remedies? In-Reply-To: References: Message-ID: <20121011190414.GA11553@phare.normalesup.org> Le nonidi 19 vend?miaire, an CCXXI, Michael Bradshaw a ?crit?: > Sorry, I meant the only two things I see as options for the FFmpeg > project is putting them on a wall of shame or hiring a lawyer and > suing, neither of which I expect to happen. I didn't word that very > well. In this particular case, there may be a more efficient way: the application in question is sold on Google Play, any copyright holder of the distributed version of ffmpeg would be entitled to get it taken down by the market authorities. Of course, it would require very careful examination to be sure that there is indeed infringement. A verbatim copy of the mails requesting the source code and their replies would be an absolute prerequisite. Regards, -- Nicolas George -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: Digital signature URL: From info at denisgottardello.it Thu Oct 11 22:12:10 2012 From: info at denisgottardello.it (Denis) Date: Thu, 11 Oct 2012 22:12:10 +0200 Subject: [Libav-user] decoding_encoding.c and theora Message-ID: <201210112212.11085.info@denisgottardello.it> > > I have a problem with decoding_encoding.c and theora. The example produces > correctly the file but I can watch it with vlc or mplayer. > > call the function in this mode: > ideo_encode_example("theora.ogg", CODEC_ID_THEORA); > Nobody can help me? -- www.denisgottardello.it Skype: mrdebug Videosurveillance and home automation! http://www.denisgottardello.it/DomusBoss/DomusBossIndice.php -------------- next part -------------- An HTML attachment was scrubbed... URL: From marco.anastasi at gmail.com Thu Oct 11 22:42:38 2012 From: marco.anastasi at gmail.com (Marco Anastasi) Date: Thu, 11 Oct 2012 21:42:38 +0100 Subject: [Libav-user] Detecting broken frame Message-ID: Hi all, I'm using avcodec to decode an RTSP video stream for a custom streaming application that I'm working on, and I noticed that sometimes a frame gets corrupted and the video breaks completely, until it goes back to normal after a while, I guess when a key frame is received. I believe the breakage to happen when a keyframe goes missing, or when a packet is corrupted or missing. I would like to detect when this happens, in order to send an out-of-band message to the streaming server and force it to send another keyframe when one is lost. Could anyone give me any hint about how / where I could retrieve this information? -------------- next part -------------- An HTML attachment was scrubbed... URL: From andrewk at vbrick.com Thu Oct 11 22:57:10 2012 From: andrewk at vbrick.com (Andrew Krupiczka) Date: Thu, 11 Oct 2012 20:57:10 +0000 Subject: [Libav-user] Detecting broken frame In-Reply-To: References: Message-ID: <14DEDC03E591D14DAC395C318D9783B401268EC4@EX2K10MB2.vb.loc> Assuming you're successful with your approach have you thought about what you're going to display to user until you get back all requested data. That's not how things are normally working - very likely you have less or more significant data buffering going at your video decoder. Instead, you should be rather thinking about improving a decoding resiliency e.g. just by repeating non-corrupted/missing data or by using some more advanced tools present in H.264 - if that is your format. Best regards, Andrew From: libav-user-bounces at ffmpeg.org [mailto:libav-user-bounces at ffmpeg.org] On Behalf Of Marco Anastasi Sent: Thursday, October 11, 2012 4:43 PM To: libav-user at ffmpeg.org Subject: [Libav-user] Detecting broken frame Hi all, I'm using avcodec to decode an RTSP video stream for a custom streaming application that I'm working on, and I noticed that sometimes a frame gets corrupted and the video breaks completely, until it goes back to normal after a while, I guess when a key frame is received. I believe the breakage to happen when a keyframe goes missing, or when a packet is corrupted or missing. I would like to detect when this happens, in order to send an out-of-band message to the streaming server and force it to send another keyframe when one is lost. Could anyone give me any hint about how / where I could retrieve this information? -------------- next part -------------- An HTML attachment was scrubbed... URL: From T.Glover at nottingham.ac.uk Thu Oct 11 23:10:47 2012 From: T.Glover at nottingham.ac.uk (Tony Glover) Date: Thu, 11 Oct 2012 22:10:47 +0100 Subject: [Libav-user] Detecting broken frame In-Reply-To: References: Message-ID: <8824AAED239A0A48AE135277DC2B79B43EF5C3BC3F@EXCHANGE1.ad.nottingham.ac.uk> Hi, You can always detect when packets are lost or out of order via checking the sequence numbers that are contained within each packet, these are just sequential numbers contained in the packet header. The header will also typically tell you whether this packet is the start or end of a frame. However, usually you would not want to get the missed frames re-sent if you have already processed more recent frames, these would be of no use to you. You could wait for the missing data to be re-sent if it's been missed, but typically applications such as this would use TCP to ensure reliable data delivery. As the other reply to this mail also stated, what would you show the user while the video was stalling? Packet loss is an inevitable part of transmitting data over networks using UDP and some applications handle the loss better than others. Cheers, Tony. This message and any attachment are intended solely for the addressee and may contain confidential information. If you have received this message in error, please send it back to me, and immediately delete it. Please do not use, copy or disclose the information contained in this message or in any attachment. Any views or opinions expressed by the author of this email do not necessarily reflect the views of the University of Nottingham. This message has been checked for viruses but the contents of an attachment may still contain software viruses which could damage your computer system: you are advised to perform your own checks. Email communications with the University of Nottingham may be monitored as permitted by UK legislation. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mbradshaw at sorensonmedia.com Thu Oct 11 23:47:52 2012 From: mbradshaw at sorensonmedia.com (Michael Bradshaw) Date: Thu, 11 Oct 2012 15:47:52 -0600 Subject: [Libav-user] avcodec_open2 is changing the channels and channel_layout... why? Message-ID: I've just been hunting down a bug in one of our programs, and I tracked it down to the number of channels reported by ffmpeg. When I first open the AVFormatContext and do avformat_find_stream_info(), I can see that my audio stream's AVCodecContext has a reported channel_layout of 3 (stereo) and channels == 2. However, when I call avcodec_open2() to start decoding, it changes the streams' AVCodecContext channel info so that channel_layout is 4 (mono) and channels == 1! This is causing a crash in a later part of the program, as one part of the program expects two channels and the other part expects 1 channel. Two questions: 1) Is this "expected behavior" in any case, or is it a bug? 2) Under what situations does avcodec_open2 change the channel info? FYI, I'm opening an MP4 with AAC audio, and I am using FFmpeg 1.0. I can provide more details, of course, but I'd at least like to know whether or not avcodec_open2 can change the channel info under certain circumstances. I've looked at the source of it and there isn't anything I see that would change both the channel count and channel layout. Thanks, Michael From cehoyos at ag.or.at Fri Oct 12 00:03:02 2012 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Thu, 11 Oct 2012 22:03:02 +0000 (UTC) Subject: [Libav-user] FFmpeg License Violation - What Are My Remedies? References: <20121011095346.37f457f2@lrcd.com> Message-ID: Hi Lou! Lou writes: > The Hall of Shame no longer exists (a page > exists without entries, but I think it is > orphaned from the menu/legal page). > It was a maintenance burden, Sorry, but this is simply not true. > its effectiveness was questionable, >and it was getting really long. And I am not sure I understand this argument: Do you mean if there are enough license violators, we should ignore them? ;-) Carl Eugen From cehoyos at ag.or.at Fri Oct 12 00:06:05 2012 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Thu, 11 Oct 2012 22:06:05 +0000 (UTC) Subject: [Libav-user] =?utf-8?q?avcodec=5Fopen2_is_changing_the_channels_a?= =?utf-8?q?nd_channel=5Flayout=2E=2E=2E_why=3F?= References: Message-ID: Michael Bradshaw writes: > I've just been hunting down a bug in one of our programs, and I > tracked it down to the number of channels reported by ffmpeg. When I > first open the AVFormatContext and do avformat_find_stream_info(), I > can see that my audio stream's AVCodecContext has a reported > channel_layout of 3 (stereo) and channels == 2. However, when I call > avcodec_open2() to start decoding, it changes the streams' > AVCodecContext channel info so that channel_layout is 4 (mono) and > channels == 1! This is causing a crash in a later part of the program, > as one part of the program expects two channels and the other part > expects 1 channel. > > Two questions: > > 1) Is this "expected behavior" in any case, or is it a bug? While I cannot really answer the question, I wonder what you expect when the number of channels really change: At least for AC-3 and AAC, this is not only allowed, but happens regularly (for example on DVB). So perhaps your application should expect a change... Carl Eugen From mbradshaw at sorensonmedia.com Fri Oct 12 00:25:16 2012 From: mbradshaw at sorensonmedia.com (Michael Bradshaw) Date: Thu, 11 Oct 2012 16:25:16 -0600 Subject: [Libav-user] avcodec_open2 is changing the channels and channel_layout... why? In-Reply-To: References: Message-ID: On Thu, Oct 11, 2012 at 4:06 PM, Carl Eugen Hoyos wrote: > Michael Bradshaw writes: > >> I've just been hunting down a bug in one of our programs, and I >> tracked it down to the number of channels reported by ffmpeg. When I >> first open the AVFormatContext and do avformat_find_stream_info(), I >> can see that my audio stream's AVCodecContext has a reported >> channel_layout of 3 (stereo) and channels == 2. However, when I call >> avcodec_open2() to start decoding, it changes the streams' >> AVCodecContext channel info so that channel_layout is 4 (mono) and >> channels == 1! This is causing a crash in a later part of the program, >> as one part of the program expects two channels and the other part >> expects 1 channel. >> >> Two questions: >> >> 1) Is this "expected behavior" in any case, or is it a bug? > > While I cannot really answer the question, I wonder > what you expect when the number of channels really change: > At least for AC-3 and AAC, this is not only allowed, > but happens regularly (for example on DVB). Really? That's useful to know. I suppose I should rely on AVFrame.channels, correct? While that's useful to know, I don't think it this AAC stream changes channels. I just used ffprobe to look at this file. You'll see that when it dumps the format (dump_format), it shows the aac stream as being stereo, but the [STREAM] info from ffprobe says channels=1. ./ffprobe -show_streams -select_streams 0 ~/MP4-Apple264-AACPlus.mp4 ffprobe version N-45341-g3632f35 Copyright (c) 2007-2012 the FFmpeg developers built on Oct 11 2012 16:10:23 with gcc 4.2.1 (GCC) (Apple Inc. build 5666) (dot 3) configuration: --enable-libopenjpeg --enable-libx264 --enable-gpl libavutil 51. 74.100 / 51. 74.100 libavcodec 54. 65.100 / 54. 65.100 libavformat 54. 32.100 / 54. 32.100 libavdevice 54. 3.100 / 54. 3.100 libavfilter 3. 19.102 / 3. 19.102 libswscale 2. 1.101 / 2. 1.101 libswresample 0. 16.100 / 0. 16.100 libpostproc 52. 1.100 / 52. 1.100 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/Users/mjbshaw/MP4-Apple264-AACPlus.mp4': Metadata: major_brand : mp42 minor_version : 0 compatible_brands: mp42isomavc1 creation_time : 2012-01-16 21:01:41 encoder : Sorenson Squeeze Duration: 00:00:11.19, start: 0.000000, bitrate: 789 kb/s Stream #0:0(und): Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, s16, 32 kb/s Metadata: creation_time : 2012-01-16 21:01:41 handler_name : soun Stream #0:1(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 480x360, 765 kb/s, 23.98 fps, 23.98 tbr, 23976 tbn, 47952 tbc Metadata: creation_time : 2012-01-16 21:01:41 handler_name : vide Stream #0:2(und): Data: none (mp4s / 0x7334706D) Metadata: creation_time : 2012-01-16 21:01:57 handler_name : sdsm Stream #0:3(und): Data: none (mp4s / 0x7334706D) Metadata: creation_time : 2012-01-16 21:01:57 handler_name : odsm Unsupported codec with id 0 for input stream 2 Unsupported codec with id 0 for input stream 3 [STREAM] index=0 codec_name=aac codec_long_name=AAC (Advanced Audio Coding) profile=unknown codec_type=audio codec_time_base=1/22050 codec_tag_string=mp4a codec_tag=0x6134706d sample_fmt=s16 sample_rate=44100 channels=1 bits_per_sample=0 id=N/A r_frame_rate=0/0 avg_frame_rate=0/0 time_base=1/44100 start_pts=0 start_time=0.000000 duration_ts=493568 duration=11.192018 bit_rate=32000 nb_frames=241 nb_read_frames=N/A nb_read_packets=N/A DISPOSITION:default=0 DISPOSITION:dub=0 DISPOSITION:original=0 DISPOSITION:comment=0 DISPOSITION:lyrics=0 DISPOSITION:karaoke=0 DISPOSITION:forced=0 DISPOSITION:hearing_impaired=0 DISPOSITION:visual_impaired=0 DISPOSITION:clean_effects=0 DISPOSITION:attached_pic=0 TAG:creation_time=2012-01-16 21:01:41 TAG:language=und TAG:handler_name=soun [/STREAM] But all of the frames have channels=2: $ ./ffprobe -show_frames -select_streams 0 ~/MP4-Apple264-AACPlus.mp4 ffprobe version N-45341-g3632f35 Copyright (c) 2007-2012 the FFmpeg developers built on Oct 11 2012 16:10:23 with gcc 4.2.1 (GCC) (Apple Inc. build 5666) (dot 3) configuration: --enable-libopenjpeg --enable-libx264 --enable-gpl libavutil 51. 74.100 / 51. 74.100 libavcodec 54. 65.100 / 54. 65.100 libavformat 54. 32.100 / 54. 32.100 libavdevice 54. 3.100 / 54. 3.100 libavfilter 3. 19.102 / 3. 19.102 libswscale 2. 1.101 / 2. 1.101 libswresample 0. 16.100 / 0. 16.100 libpostproc 52. 1.100 / 52. 1.100 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/Users/mjbshaw/MP4-Apple264-AACPlus.mp4': Metadata: major_brand : mp42 minor_version : 0 compatible_brands: mp42isomavc1 creation_time : 2012-01-16 21:01:41 encoder : Sorenson Squeeze Duration: 00:00:11.19, start: 0.000000, bitrate: 789 kb/s Stream #0:0(und): Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, s16, 32 kb/s Metadata: creation_time : 2012-01-16 21:01:41 handler_name : soun Stream #0:1(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 480x360, 765 kb/s, 23.98 fps, 23.98 tbr, 23976 tbn, 47952 tbc Metadata: creation_time : 2012-01-16 21:01:41 handler_name : vide Stream #0:2(und): Data: none (mp4s / 0x7334706D) Metadata: creation_time : 2012-01-16 21:01:57 handler_name : sdsm Stream #0:3(und): Data: none (mp4s / 0x7334706D) Metadata: creation_time : 2012-01-16 21:01:57 handler_name : odsm Unsupported codec with id 0 for input stream 2 Unsupported codec with id 0 for input stream 3 [FRAME] media_type=audio key_frame=1 pkt_pts=0 pkt_pts_time=0.000000 pkt_dts=0 pkt_dts_time=0.000000 pkt_duration=2048 pkt_duration_time=0.046440 pkt_pos=6211 sample_fmt=s16 nb_samples=2048 channels=2 channel_layout=stereo [/FRAME] [FRAME] media_type=audio key_frame=1 pkt_pts=2048 pkt_pts_time=0.046440 pkt_dts=2048 pkt_dts_time=0.046440 pkt_duration=2048 pkt_duration_time=0.046440 pkt_pos=24505 sample_fmt=s16 nb_samples=2048 channels=2 channel_layout=stereo [/FRAME] [...and so on; every frame has channels=2...] Any thoughts? Thanks, Michael From cehoyos at ag.or.at Fri Oct 12 00:49:26 2012 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Thu, 11 Oct 2012 22:49:26 +0000 (UTC) Subject: [Libav-user] =?utf-8?q?avcodec=5Fopen2_is_changing_the_channels_a?= =?utf-8?q?nd_channel=5Flayout=2E=2E=2E_why=3F?= References: Message-ID: Michael Bradshaw writes: > > While I cannot really answer the question, I wonder > > what you expect when the number of channels really change: > > At least for AC-3 and AAC, this is not only allowed, > > but happens regularly (for example on DVB). > > Really? That's useful to know. I suppose I should rely on > AVFrame.channels, correct? > > While that's useful to know, I don't think it this > AAC stream changes channels. I did not want to imply that what happens cannot be a bug, I just wanted to make sure you know that channel count (and channel layout) may change. Did you verify if the problem is not that container and stream have different opinions about the number of channels? (What does QuickTime say about the number of channels?) Carl Eugen From mbradshaw at sorensonmedia.com Fri Oct 12 01:09:28 2012 From: mbradshaw at sorensonmedia.com (Michael Bradshaw) Date: Thu, 11 Oct 2012 17:09:28 -0600 Subject: [Libav-user] avcodec_open2 is changing the channels and channel_layout... why? In-Reply-To: References: Message-ID: On Thu, Oct 11, 2012 at 4:49 PM, Carl Eugen Hoyos wrote: > Michael Bradshaw writes: > >> > While I cannot really answer the question, I wonder >> > what you expect when the number of channels really change: >> > At least for AC-3 and AAC, this is not only allowed, >> > but happens regularly (for example on DVB). >> >> Really? That's useful to know. I suppose I should rely on >> AVFrame.channels, correct? >> >> While that's useful to know, I don't think it this >> AAC stream changes channels. > > I did not want to imply that what happens cannot be a bug, > I just wanted to make sure you know that channel count > (and channel layout) may change. I know, and thank you for that. But I can rely on AVFrame.channels, right? > Did you verify if the problem is not that container and > stream have different opinions about the number of channels? I've tried remuxing it with ffmpeg -i MP4-Apple264-AACPlus.mp4 -acodec copy -vn out.aac and now ffprobe -show_streams reports 2 streams. > (What does QuickTime say about the number of channels?) QuickTime reports it as mono. So does Windows Media Player. It plays ok in ffplay and QuickTime though (didn't try Windows Media Player). Seeing as remuxing the audio stream to plain .aac seems to have fixed the issue, I'm thinking the container might be bad. Do you know of any tools or options in ffmpeg to help validate that conclusion? Thanks! --Michael From cehoyos at ag.or.at Fri Oct 12 01:15:22 2012 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Thu, 11 Oct 2012 23:15:22 +0000 (UTC) Subject: [Libav-user] =?utf-8?q?avcodec=5Fopen2_is_changing_the_channels_a?= =?utf-8?q?nd_channel=5Flayout=2E=2E=2E_why=3F?= References: Message-ID: Michael Bradshaw writes: > QuickTime reports it as mono. So does Windows Media Player. It plays > ok in ffplay and QuickTime though (didn't try Windows Media Player). > > Seeing as remuxing the audio stream to plain .aac seems to have fixed > the issue, I'm thinking the container might be bad. Do you know of any > tools or options in ffmpeg to help validate that conclusion? I would say you just have to open out.aac in QuickTime or am I wrong? Carl Eugen From mbradshaw at sorensonmedia.com Fri Oct 12 01:19:31 2012 From: mbradshaw at sorensonmedia.com (Michael Bradshaw) Date: Thu, 11 Oct 2012 17:19:31 -0600 Subject: [Libav-user] avcodec_open2 is changing the channels and channel_layout... why? In-Reply-To: References: Message-ID: On Thu, Oct 11, 2012 at 5:15 PM, Carl Eugen Hoyos wrote: > Michael Bradshaw writes: > >> QuickTime reports it as mono. So does Windows Media Player. It plays >> ok in ffplay and QuickTime though (didn't try Windows Media Player). >> >> Seeing as remuxing the audio stream to plain .aac seems to have fixed >> the issue, I'm thinking the container might be bad. Do you know of any >> tools or options in ffmpeg to help validate that conclusion? > > I would say you just have to open out.aac in QuickTime > or am I wrong? Actually, I just tried ffmpeg -i ~/MP4-Apple264-AACPlus.mp4 -acodec copy -vcodec copy ~/out.mp4 and it generated a .mp4 with the same issue (that is, ffprobe -show_streams reports the audio stream as having 1 channel, whereas the dump and show_frames reports 2 channels). I get the same thing if I also do ./ffmpeg -i ~/MP4-Apple264-AACPlus.mp4 -acodec copy -vn ~/out.mp4 Why would ffmpeg generate an .mp4 with the same issue? I think it's weird because if I just remux the audio alone to a .aac it works fine in ffprobe, but if I remux it into .mp4 it has the same problems. From notzed at gmail.com Fri Oct 12 11:02:38 2012 From: notzed at gmail.com (Michael Zucchi) Date: Fri, 12 Oct 2012 19:32:38 +1030 Subject: [Libav-user] FFmpeg License Violation - What Are My Remedies? In-Reply-To: References: Message-ID: <5077DCAE.6080907@gmail.com> On 11/10/12 04:04, Matthew Lawrence wrote: > I recently purchased an app from Google Play that incorporates the > FFmpeg library. Because the app is a derivative work under the > LGPLv2.1, I believe I am entitled to a copy of the source code for the > entire app. I have e-mailed the developer's support staff, but they are > refusing to release the source code. I have cited the LGPL to them, but > hey claim they are required to provide only the source code for the > FFmpeg library. I believe that they are in violation of the license and > are violating both my legal rights and those of the FFmpeg team. In essence, LGPL requires that you are able to 1: obtain the complete and compilable source code of the LGPL components they used (imo this wouldn't include any jni stuff and certainly not the application itself), and 2: replace the binary components of the LGPL compiled source (at least here in australia, compiled code has the same legal standing as the source itself - as it is only a machine translation of the original expression) - either the .so file or the .o files if it is statically linked - in the specific application you have installed. Of course, apk's and the android shop are somewhat problematic wrt to the second point. If you used the 'shop', then you actually got the application from google. So you are quite entitled to ask google for the source as they were the ones who `distributed' or 'conveyed' the software to you. They are required to supply source if asked for, and if they don't *they* lose the right to distribute it at all (which would cover the FFmpeg source components used - and impact on all 'apps' which used them). The (L)GPL only comes into effect once distribution occurs, which is why you can do basically anything if you link with it privately - distribution creates all the obligations. TBH i'm surprised they allow any of the (L)GPL licenses at all, since they don't even have a mechanism for distributing source and are thus automatically violating all L?GPL2.* source code regardless of whether the guys creating the apps are or not. e.g. in the preamble: "To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code." Note this part says nothing about linking (that is the next sentence). It only says 'distribute' and 'distributor', an "app store" is definitely a distribution channel, as much as a cd or a yum server is ... But they're richer than you: so, well, "sucked in" if you were the author, and as a customer you don't even get that much of a look-see. The LGPL seems to be the most misunderstood of all the licenses, although quite why is a mystery - the language is quite clear and thoroughly explained. One presumes much of it is just FUD for commercial gain. Z From tps at netmaster.dk Fri Oct 12 13:57:09 2012 From: tps at netmaster.dk (Thomas Seilund) Date: Fri, 12 Oct 2012 13:57:09 +0200 Subject: [Libav-user] Insert an AVFrame into another AVFrame Message-ID: <50780595.9080101@netmaster.dk> Hi All I am writing a video filter that implements a scoreboard. I have a number of bitmap files that act as scoreboard background and different numbers for the scoreboard. All the bitmap files are read by the filter init function and stored in the filter private data as AVFrames. The idea is to insert the scoreboard background on the current frame and also insert the relevant parts of the scoreboard giving a frame that holds a scoreboard with game time and game score. The frames representing the scoreboard will be inserted in the current frame in the filter draw_slice function. My problem is that I don?t know how to traverse the data element of the AVFrames in order to insert the parts of the scoreboard on the current frame. This is illustrated below: // Called once for each frame the filter handles. static int draw_slice(AVFilterLink *link, int y, int h, int slice_dir) { AVFilterContext *ctx = link->dst; scoreboardContext *scoreboard = ctx->priv; int bitmap = 123; AVFrame *frame = scoreboard->pFrameInserts[bitmap]; av_log(NULL, AV_LOG_INFO, "draw_slice() canvas: %dx%d %s -.\n", link->w, link->h, av_get_pix_fmt_name(link->format)); /* * * Code to insert an AVFrame in the frame that the filter currently handles. * */ return ff_draw_slice(link->dst->outputs[0], y, h, slice_dir); } Any help would be appreciated. Thanks Thomas S From mbradshaw at sorensonmedia.com Sat Oct 13 00:23:28 2012 From: mbradshaw at sorensonmedia.com (Michael Bradshaw) Date: Fri, 12 Oct 2012 16:23:28 -0600 Subject: [Libav-user] avcodec_open2 is changing the channels and channel_layout... why? In-Reply-To: References: Message-ID: On Thu, Oct 11, 2012 at 5:19 PM, Michael Bradshaw wrote: >[...] > Actually, I just tried ffmpeg -i ~/MP4-Apple264-AACPlus.mp4 -acodec > copy -vcodec copy ~/out.mp4 and it generated a .mp4 with the same > issue (that is, ffprobe -show_streams reports the audio stream as > having 1 channel, whereas the dump and show_frames reports 2 > channels). I get the same thing if I also do ./ffmpeg -i > ~/MP4-Apple264-AACPlus.mp4 -acodec copy -vn ~/out.mp4 > > Why would ffmpeg generate an .mp4 with the same issue? I think it's > weird because if I just remux the audio alone to a .aac it works fine > in ffprobe, but if I remux it into .mp4 it has the same problems. Would it matter if the AAC stream is HE-AAC? I can provide the sample if necessary. From cehoyos at ag.or.at Sat Oct 13 00:53:03 2012 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Fri, 12 Oct 2012 22:53:03 +0000 (UTC) Subject: [Libav-user] =?utf-8?q?avcodec=5Fopen2_is_changing_the_channels_a?= =?utf-8?q?nd_channel=5Flayout=2E=2E=2E_why=3F?= References: Message-ID: Michael Bradshaw writes: > I can provide the sample if necessary. If this is reproducible with current git head (and I do not doubt this) and you have a sample, then it should be possible for you to open a ticket. Thank you, Carl Eugen From cbhattac at adobe.com Mon Oct 15 11:26:49 2012 From: cbhattac at adobe.com (Chandranath Bhattacharyya) Date: Mon, 15 Oct 2012 14:56:49 +0530 Subject: [Libav-user] examples/demuxing.c not working properly Message-ID: <5DA090DC8DCD3549BE9DF08C5074509E01603FC436@indiambx01.corp.adobe.com> Hi All, I downloaded windows ffmpeg build from http://ffmpeg.zeranoe.com/builds/. The build downloaded is ffmpeg-20121009-git-f3f35f7-win32-shared.7z & ffmpeg-20121009-git-f3f35f7-win32-dev.7z. I built "examples/demuxing.c" using Visual Studio 10 on windows. However, it's not working. When invoked with command line: output.mp4, it's exiting with the following errors: [mp4 @ 00582ea0] Encoder did not produce proper pts, making some up. [mp4 @ 00582ea0] pts (0) < dts (1) in stream 0 Error while writing video frame I figured out that av_interleaved_write_frame is failing because a call to avcodec_encode_video2 is not changing AVCodecContext::coded_frames->pts. It's always 0, and hence AVPacket.pts is 0. However the call to avcodec_encode_video2 is increasing the AVPacket.dts value from -2, -1, 0, 1. So in 4th call to av_interleaved_write_frame, AVPacket.pts < AVPacket.dts causing the issue. I made some code changes to ensure that pts > dts, and then the file was written. However when opened in Windows Media Player Classic, the file is showing a frame rate of 12800. I was using following. Modified STREAM_DURATION to 10.0 from 200.0. #define STREAM_DURATION 10.0 #define STREAM_FRAME_RATE 25 /* 25 images/s */ #define STREAM_NB_FRAMES ((int)(STREAM_DURATION * STREAM_FRAME_RATE)) With these parameters, AVStream::codec->time_base = { num: 1, den: 25}, but just after call to avformat_write_header, the AVStream::time_base = { num: 1, den: 12800 }. What's going wrong? AVStream::time_base.den = 12800; seems to be wrong data. Other than fixing some compilation errors, I did not modify anything else in examples/demuxing.c. Regards, Chandranath -------------- next part -------------- An HTML attachment was scrubbed... URL: From stephane.debusne at gmail.com Mon Oct 15 11:37:15 2012 From: stephane.debusne at gmail.com (Stephane Debusne) Date: Mon, 15 Oct 2012 11:37:15 +0200 Subject: [Libav-user] examples/demuxing.c not working properly In-Reply-To: <5DA090DC8DCD3549BE9DF08C5074509E01603FC436@indiambx01.corp.adobe.com> References: <5DA090DC8DCD3549BE9DF08C5074509E01603FC436@indiambx01.corp.adobe.com> Message-ID: <507BD94B.8050005@gmail.com> Le 15/10/2012 11:26, Chandranath Bhattacharyya a ?crit : > > Hi All, > > I downloaded windows ffmpeg build from > http://ffmpeg.zeranoe.com/builds/. The build downloaded is > ffmpeg-20121009-git-f3f35f7-win32-shared.7z & > ffmpeg-20121009-git-f3f35f7-win32-dev.7z. > > I built "examples/demuxing.c" using Visual Studio 10 on windows. > However, it's not working. When invoked with command line: > output.mp4, it's exiting with the following errors: > > [mp4 @ 00582ea0] Encoder did not produce proper pts, making some up. > > [mp4 @ 00582ea0] pts (0) < dts (1) in stream 0 > > Error while writing video frame > > I figured out that av_interleaved_write_frame is failing because a > call to avcodec_encode_video2 is not changing > AVCodecContext::coded_frames->pts. It's always 0, and hence > AVPacket.pts is 0. However the call to avcodec_encode_video2 is > increasing the AVPacket.dts value from -2, -1, 0, 1. So in 4^th call > to av_interleaved_write_frame, AVPacket.pts < AVPacket.dts causing the > issue. > > I made some code changes to ensure that pts > dts, and then the file > was written. However when opened in Windows Media Player Classic, the > file is showing a frame rate of 12800. > > I was using following. Modified STREAM_DURATION to 10.0 from 200.0. > > #defineSTREAM_DURATION 10.0 > > #defineSTREAM_FRAME_RATE 25 /* 25 images/s */ > > #defineSTREAM_NB_FRAMES ((int)(STREAM_DURATION * STREAM_FRAME_RATE)) > > With these parameters,AVStream::codec->time_base = { num: 1, den: 25}, > but just after call toavformat_write_header, the AVStream::time_base = > { num: 1, den: 12800 }. > > What's going wrong?AVStream::time_base.den = 12800; seems to be wrong > data. Other than fixing some compilation errors, I did not modify > anything else in examples/demuxing.c. > > Regards, > > Chandranath > It seems i've got the same troubles since the 3 last zeranoe packages. Previous ones were ok, but last 3 gives 12800 fps frame for .mp4 rate and i've got some others troubles like that with other encoders / containers... So i'm very interested in an answer to this question too ! And as a bonus question : Should be set .pts for each frame to a correct value for the encoder and for the container or can we keep AV_NOPTS_VALUE ? regards Stephane -------------- next part -------------- An HTML attachment was scrubbed... URL: From gmxubuntu at yahoo.de Mon Oct 15 14:42:27 2012 From: gmxubuntu at yahoo.de (Sartre Salam) Date: Mon, 15 Oct 2012 13:42:27 +0100 (BST) Subject: [Libav-user] libswresample- audio Message-ID: <1350304947.81934.YahooMailNeo@web171604.mail.ir2.yahoo.com> Hi, I need to resample audio data from 44,1KHz to 48KHz, I have read some examples and I decide to use libswresample for this issue. Some code for the resample is this: SwrContext *ctx = NULL; ctx = swr_alloc_set_opts(ctx,AV_CH_LAYOUT_STEREO,AV_SAMPLE_FMT_16,48000, ???????????????????????????????????????? AV_CH_LAYOUT_STEREO,AV_SAMPLE_FMT_16,44100,0,0); if(swr_init(ctx) < 0) ???? return -1; ..... ........ int? resample_samples = swr_convert(ctx,(uint8_t**)&pcmBuffer,resamplesize, ???????????????????????????????????????? (const uint8_t**)&pFrameRawInit->data[0],data_size,0,0); fwrite(pcmBuffer,resample_samples,1,outfile); ...... ..... swr_free(&ctx); When I play the pcm data in the with the new sample rate, I can here the sound with the right speed, but there is another noise like a buzz. Has somebody an idea, how can I resample correctly without another sounds, should I use a filter?, If so, where is an example. I would be really helpfull. And sorry, I dont know if this is the right mailing list for this issue. arctor -------------- next part -------------- An HTML attachment was scrubbed... URL: From stefasab at gmail.com Mon Oct 15 16:00:02 2012 From: stefasab at gmail.com (Stefano Sabatini) Date: Mon, 15 Oct 2012 16:00:02 +0200 Subject: [Libav-user] decoding_encoding.c and theora In-Reply-To: <201210112212.11085.info@denisgottardello.it> References: <201210112212.11085.info@denisgottardello.it> Message-ID: <20121015140002.GF6136@arborea> On date Thursday 2012-10-11 22:12:10 +0200, Denis encoded: > > > > > I have a problem with decoding_encoding.c and theora. The example produces > > correctly the file but I can watch it with vlc or mplayer. I assume it was "I can *not*". > > > > call the function in this mode: > > ideo_encode_example("theora.ogg", CODEC_ID_THEORA); > > > > Nobody can help me? decoding_encoding.c only works with stream-based formats, and is only meant to show encoding/decoding API rather than muxing, so in general it won't work if you replace MPEG/H.264 with another (non stream-based) codec. Check muxing.c for a better example. From cbhattac at adobe.com Mon Oct 15 16:13:30 2012 From: cbhattac at adobe.com (Chandranath Bhattacharyya) Date: Mon, 15 Oct 2012 19:43:30 +0530 Subject: [Libav-user] examples/demuxing.c not working properly In-Reply-To: <507BD94B.8050005@gmail.com> References: <5DA090DC8DCD3549BE9DF08C5074509E01603FC436@indiambx01.corp.adobe.com> <507BD94B.8050005@gmail.com> Message-ID: <5DA090DC8DCD3549BE9DF08C5074509E01603FC487@indiambx01.corp.adobe.com> >> What's going wrong? AVStream::time_base.den = 12800; seems to be wrong data. Other than fixing some compilation errors, I did not modify anything else in examples/demuxing.c. - I downloaded the older version (ffmpeg-20121003-git-df82454-win32-*) from http://ffmpeg.zeranoe.com/builds/. Now AVStream::time_base.den = 25 - perfect!! However, I had to comment out the following lines in write_video_frame (muxing.c) to get rid of pts (0) < dts (1) error: if (c->coded_frame->pts != AV_NOPTS_VALUE) pkt.pts = av_rescale_q(c->coded_frame->pts, c->time_base, st->time_base); In above c->coded_frame->pts was always 0 causing the problem. Also, the file I was referring to was example/muxing.c (not demuxing.c). Sorry for the error. Regards, Chandranath -------------- next part -------------- An HTML attachment was scrubbed... URL: From mbradshaw at sorensonmedia.com Mon Oct 15 16:56:12 2012 From: mbradshaw at sorensonmedia.com (Michael Bradshaw) Date: Mon, 15 Oct 2012 08:56:12 -0600 Subject: [Libav-user] avcodec_open2 is changing the channels and channel_layout... why? In-Reply-To: References: Message-ID: On Fri, Oct 12, 2012 at 4:53 PM, Carl Eugen Hoyos wrote: > Michael Bradshaw writes: > >> I can provide the sample if necessary. > > If this is reproducible with current git head (and I do > not doubt this) and you have a sample, then it should be > possible for you to open a ticket. Reported as ticket 1819: https://ffmpeg.org/trac/ffmpeg/ticket/1819 Thanks, Michael From rishy.gupta.svc at gmail.com Tue Oct 16 06:54:20 2012 From: rishy.gupta.svc at gmail.com (rishi gupta) Date: Tue, 16 Oct 2012 10:24:20 +0530 Subject: [Libav-user] examples/demuxing.c not working properly In-Reply-To: <5DA090DC8DCD3549BE9DF08C5074509E01603FC487@indiambx01.corp.adobe.com> References: <5DA090DC8DCD3549BE9DF08C5074509E01603FC436@indiambx01.corp.adobe.com> <507BD94B.8050005@gmail.com> <5DA090DC8DCD3549BE9DF08C5074509E01603FC487@indiambx01.corp.adobe.com> Message-ID: I am trying to convert audio file format and using libav for this but dont know how to do it can you guys help me how to do it, i will very thankful. On Mon, Oct 15, 2012 at 7:43 PM, Chandranath Bhattacharyya < cbhattac at adobe.com> wrote: > >> What?s going wrong? AVStream::time_base.den = 12800; seems to be wrong > data. Other than fixing some compilation errors, I did not modify anything > else in examples/demuxing.c.**** > > ** ** > > - I downloaded the older version (ffmpeg-20121003-git-df82454-win32-*) > from http://ffmpeg.zeranoe.com/builds/. Now AVStream::time_base.den = 25 > ? perfect!!**** > > ** ** > > However, I had to comment out the following lines in write_video_frame > (muxing.c) to get rid of pts (0) < dts (1) error:**** > > if (c->coded_frame->pts != AV_NOPTS_VALUE)**** > > pkt.pts = av_rescale_q(c->coded_frame->pts,**** > > c->time_base, st->time_base);**** > > ** ** > > In above c->coded_frame->pts was always 0 causing the problem.**** > > ** ** > > Also, the file I was referring to was example/muxing.c (not demuxing.c). > Sorry for the error.**** > > ** ** > > Regards,**** > > Chandranath**** > > ** ** > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > > -- Thanks and Regards :- Rishi Kant Gupta Mob :- +917827055522 -------------- next part -------------- An HTML attachment was scrubbed... URL: From phamsyquybk at gmail.com Tue Oct 16 10:11:21 2012 From: phamsyquybk at gmail.com (Quy Pham Sy) Date: Tue, 16 Oct 2012 17:11:21 +0900 Subject: [Libav-user] [libav-user] Memory leak in Mac OS X Lion Message-ID: Hi, I made a simple console test base on Dranger 's tutorial code by replace deprecated function by the new versions. here the full source code: https://github.com/phamquy/FFmpeg-tutorial-samples/blob/master/tutorial01.c It works fine, but there is a huge memory leak (i use Instrument to for leak detection). It seem like the leaks caused by the while loop, there is no leak after i commented out this part: i=0; while(av_read_frame(pFormatCtx, &packet)>=0) { if(packet.stream_index==videoStreamIdx) { avcodec_decode_video2(pCodecCtx, pFrame, &frameFinished, &packet); if(frameFinished) { static struct SwsContext *img_convert_ctx; int w = pCodecCtx->width; int h = pCodecCtx->height; img_convert_ctx = sws_getContext(w, h, pCodecCtx->pix_fmt, w, h, PIX_FMT_RGB24, SWS_BICUBIC, NULL, NULL, NULL); sws_scale(img_convert_ctx, (const uint8_t * const *)pFrame->data, pFrame->linesize, 0, pCodecCtx->height, pFrameRGB->data, pFrameRGB->linesize); if(++i<=5) SaveFrame(pFrameRGB, pCodecCtx->width, pCodecCtx->height, i); } } av_free_packet(&packet); } What is wrong with this code? Thanks PhamQuy From lixiaohui9219 at 126.com Tue Oct 16 10:35:07 2012 From: lixiaohui9219 at 126.com (=?GBK?B?wOjQobvU?=) Date: Tue, 16 Oct 2012 16:35:07 +0800 (CST) Subject: [Libav-user] rtmp seek support Message-ID: <38f5ef5f.158b8.13a68b6482d.Coremail.lixiaohui9219@126.com> Hi all, My mediaplayer based on FFmpeg's old version. Now I want to make it support rtmp seek. What shoud I do use the FFmpeg' api which supports the rtmp seek. Thanks! -------------- next part -------------- An HTML attachment was scrubbed... URL: From mbradshaw at sorensonmedia.com Tue Oct 16 15:56:22 2012 From: mbradshaw at sorensonmedia.com (Michael Bradshaw) Date: Tue, 16 Oct 2012 07:56:22 -0600 Subject: [Libav-user] [libav-user] Memory leak in Mac OS X Lion In-Reply-To: References: Message-ID: On Oct 16, 2012 2:11 AM, "Quy Pham Sy" wrote: > > Hi, > > I made a simple console test base on Dranger 's tutorial code by > replace deprecated function by the new versions. > here the full source code: > > https://github.com/phamquy/FFmpeg-tutorial-samples/blob/master/tutorial01.c > > It works fine, but there is a huge memory leak (i use Instrument to > for leak detection). > It seem like the leaks caused by the while loop, > there is no leak after i commented out this part: > > > i=0; > while(av_read_frame(pFormatCtx, &packet)>=0) { > if(packet.stream_index==videoStreamIdx) { > avcodec_decode_video2(pCodecCtx, pFrame, &frameFinished, &packet); > > if(frameFinished) { > static struct SwsContext *img_convert_ctx; > int w = pCodecCtx->width; > int h = pCodecCtx->height; > img_convert_ctx = sws_getContext(w, h, pCodecCtx->pix_fmt, > w, h, PIX_FMT_RGB24, > SWS_BICUBIC, NULL, NULL, NULL); > > sws_scale(img_convert_ctx, (const uint8_t * const > *)pFrame->data, > pFrame->linesize, 0, pCodecCtx->height, > pFrameRGB->data, pFrameRGB->linesize); > > if(++i<=5) > SaveFrame(pFrameRGB, pCodecCtx->width, pCodecCtx->height, > i); > } > } > av_free_packet(&packet); > } > > > What is wrong with this code? One thing is that you never release the SwsContext. It's best to just get it once and re-use it, and then release it at the end. It's also possible you're leaking something in SaveFrame. --Michael -------------- next part -------------- An HTML attachment was scrubbed... URL: From info at denisgottardello.it Tue Oct 16 20:56:54 2012 From: info at denisgottardello.it (Denis) Date: Tue, 16 Oct 2012 20:56:54 +0200 Subject: [Libav-user] decoding_encoding.c and theora In-Reply-To: <20121015140002.GF6136@arborea> References: <201210112212.11085.info@denisgottardello.it> <20121015140002.GF6136@arborea> Message-ID: <201210162056.54980.info@denisgottardello.it> In data luned? 15 ottobre 2012 16:00:02, Stefano Sabatini ha scritto: > decoding_encoding.c only works with stream-based formats, and is only > meant to show encoding/decoding API rather than muxing, so in general > it won't work if you replace MPEG/H.264 with another (non > stream-based) codec. > > Check muxing.c for a better example. Wow! This is a new scenario for me. How can I obtain informations about each codec? (If the codec is for streaming or muxing...) Where I can find the explaination of muxing and streaming? -- www.denisgottardello.it Skype: mrdebug Videosurveillance and home automation! http://www.denisgottardello.it/DomusBoss/DomusBossIndice.php From mbradshaw at sorensonmedia.com Tue Oct 16 21:06:00 2012 From: mbradshaw at sorensonmedia.com (Michael Bradshaw) Date: Tue, 16 Oct 2012 13:06:00 -0600 Subject: [Libav-user] decoding_encoding.c and theora In-Reply-To: <201210162056.54980.info@denisgottardello.it> References: <201210112212.11085.info@denisgottardello.it> <20121015140002.GF6136@arborea> <201210162056.54980.info@denisgottardello.it> Message-ID: On Tue, Oct 16, 2012 at 12:56 PM, Denis wrote: > In data luned? 15 ottobre 2012 16:00:02, Stefano Sabatini ha scritto: >> decoding_encoding.c only works with stream-based formats, and is only >> meant to show encoding/decoding API rather than muxing, so in general >> it won't work if you replace MPEG/H.264 with another (non >> stream-based) codec. >> >> Check muxing.c for a better example. > > Wow! This is a new scenario for me. > How can I obtain informations about each codec? (If the codec is for streaming > or muxing...) Probably check out http://ffmpeg.org/general.html It will list the file formats supported as well as the audio and video codecs supported. Note that streams get encoded (or "compressed") with a particular codec (kind of like an algorithm), and then the streams get muxed (stuffed into a container (output file format)). > Where I can find the explaination of muxing and streaming? muxing is short for multiplexing. Google and Wikipedia can explain it better than I can, but it's more or less mixing two different electronic signals together in a specific way. From mbradshaw at sorensonmedia.com Tue Oct 16 23:13:27 2012 From: mbradshaw at sorensonmedia.com (Michael Bradshaw) Date: Tue, 16 Oct 2012 15:13:27 -0600 Subject: [Libav-user] How do I seek to the very beginning of a file? Message-ID: I'm trying to reliably seek to the very start of a file. Seeing as avformat_seek_file is still in "beta" and isn't finished, I'd rather not rely on it, so I'm using av_seek_frame (plus I've been advised to stay away from avformat_seek_file until it's properly implemented). However, I can't figure out how to get av_seek_frame to reliably seek to the beginning of the file (that is, I want all streams to be at their beginning). I've tried av_seek_frame with AVSEEK_FLAG_BYTE with a "timestamp"/byte offset of 0, but for some reason that doesn't seem to work. av_seek_frame returns 0, but all subsequent calls to av_read_frame return < 0. However, if I change the seeking flags to just AVSEEK_FLAG_BACKWARD then subsequent calls to av_read_frame return 0 (and av_seek_frame still returns 0). However, I don't like seeking with AVSEEK_FLAG_BACKWARD because 1) av_seek_frame only seeks by one stream (that is, it only makes sure one stream is at the requested position, and depending on how packets/frames are ordered in the file, other streams can potentially be past the requested time (I really need all of them to be at the beginning)), and 2) seeking by timestamps seems silly when I know I just want all the streams to start from the very beginning (mostly because timestamp seeking can use PTS or DTS and it seems like an unnecessary mess when all I want is the start, regardless of PTS/DTS values). Is there any way to do this with the C API? The only workaround I can see is closing and reopening the file, which feels like a really ugly hack. Plus that's a lot slower compared to using protocols/formats that support seeking, particularly over networked videos. Thanks, Michael From donmoir at comcast.net Wed Oct 17 01:10:23 2012 From: donmoir at comcast.net (Don Moir) Date: Tue, 16 Oct 2012 19:10:23 -0400 Subject: [Libav-user] How do I seek to the very beginning of a file? References: Message-ID: > I'm trying to reliably seek to the very start of a file. Seeing as > avformat_seek_file is still in "beta" and isn't finished, I'd rather > not rely on it, so I'm using av_seek_frame (plus I've been advised to > stay away from avformat_seek_file until it's properly implemented). > However, I can't figure out how to get av_seek_frame to reliably seek > to the beginning of the file (that is, I want all streams to be at > their beginning). > > I've tried av_seek_frame with AVSEEK_FLAG_BYTE with a "timestamp"/byte > offset of 0, but for some reason that doesn't seem to work. > av_seek_frame returns 0, but all subsequent calls to av_read_frame > return < 0. However, if I change the seeking flags to just > AVSEEK_FLAG_BACKWARD then subsequent calls to av_read_frame return 0 > (and av_seek_frame still returns 0). However, I don't like seeking > with AVSEEK_FLAG_BACKWARD because 1) av_seek_frame only seeks by one > stream (that is, it only makes sure one stream is at the requested > position, and depending on how packets/frames are ordered in the file, > other streams can potentially be past the requested time (I really > need all of them to be at the beginning)), and 2) seeking by > timestamps seems silly when I know I just want all the streams to > start from the very beginning (mostly because timestamp seeking can > use PTS or DTS and it seems like an unnecessary mess when all I want > is the start, regardless of PTS/DTS values). > > Is there any way to do this with the C API? The only workaround I can > see is closing and reopening the file, which feels like a really ugly > hack. Plus that's a lot slower compared to using protocols/formats > that support seeking, particularly over networked videos. > > Thanks, > > Michael I use avformat_seek_file and so does ffplay etc. I always use a valid stream index and not -1. I don't leave it up to ffmpeg to determine what stream to seek on. I always take the first_dts for the stream into account. The first_dts will be the zero mark for the stream. first_dts can be zero, less than zero, or greater than zero. I use AVSEEK_FLAG_BACKWARD (regardless if seeking to zero or not). With above logic, I can't remember the last time I had a problem seeking to zero (first_dts). Should I have to do the above ? probably not... Also not to say there isn't a few problem files here and there but these just need to be reported so it can be fixed. Do you have a particular file that is a problem and can be posted ? Don From phamsyquybk at gmail.com Wed Oct 17 02:06:25 2012 From: phamsyquybk at gmail.com (Quy Pham Sy) Date: Wed, 17 Oct 2012 09:06:25 +0900 Subject: [Libav-user] [lav-user] Memory leaks in Mac OSX Lion Message-ID: Hi, I update the source code from Dranger's tutorials (http://dranger.com/ffmpeg/) Here is tutorials01 (https://github.com/phamquy/FFmpeg-tutorial-samples/blob/master/tutorial01.c), Everything works fine, except there is a huge memory leak detected by Mac's Instrument. Here is the part i think is the suspected code, which i found that the leak is gone if i commented out it -------- // Read frames and save first five frames to disk i=0; while(av_read_frame(pFormatCtx, &packet)>=0) { if(packet.stream_index==videoStreamIdx) { avcodec_decode_video2(pCodecCtx, pFrame, &frameFinished, &packet); if(frameFinished) { static struct SwsContext *img_convert_ctx; int w = pCodecCtx->width; int h = pCodecCtx->height; img_convert_ctx = sws_getContext(w, h, pCodecCtx->pix_fmt, w, h, PIX_FMT_RGB24, SWS_BICUBIC, NULL, NULL, NULL); sws_scale(img_convert_ctx, (const uint8_t * const *)pFrame->data, pFrame->linesize, 0, pCodecCtx->height, pFrameRGB->data, pFrameRGB->linesize); // Save the frame to disk if(++i<=5) SaveFrame(pFrameRGB, pCodecCtx->width, pCodecCtx->height, i); } } av_free_packet(&packet); } ------- What is wrong with these code that might cause the leak? Thanks, Jack From mbradshaw at sorensonmedia.com Wed Oct 17 02:26:20 2012 From: mbradshaw at sorensonmedia.com (Michael Bradshaw) Date: Tue, 16 Oct 2012 18:26:20 -0600 Subject: [Libav-user] How do I seek to the very beginning of a file? In-Reply-To: References: Message-ID: On Tue, Oct 16, 2012 at 5:10 PM, Don Moir wrote: > I use avformat_seek_file and so does ffplay etc. I always use a valid stream > index and not -1. I don't leave it up to ffmpeg to determine what stream to > seek on. > > I always take the first_dts for the stream into account. The first_dts will > be the zero mark for the stream. first_dts can be zero, less than zero, or > greater than zero. > > I use AVSEEK_FLAG_BACKWARD (regardless if seeking to zero or not). > > With above logic, I can't remember the last time I had a problem seeking to > zero (first_dts). > > Should I have to do the above ? probably not... Ugh, seems complex. It's complicated by the fact that not all formats seek by DTS (some seek by PTS, like nut). I may have to do that, but I'm hoping there's a better alternative... Heck, even seeking by byte to the first packet position seems preferable (though I can't see why seeking to a byte index of 0 shouldn't work). It's not that the above is super complex and overly hard... it's just that for such a basic, frequently used operation (seeking to the beginning), it seems... wrong. > Also not to say there isn't a few problem files here and there but these > just need to be reported so it can be fixed. > > Do you have a particular file that is a problem and can be posted ? I've got a bunch of files that seem to completely ignore AVSEEK_FLAG_BYTE and seeking to 0, despite returning "success." I can also write some sample code if needed to demonstrate. Shall I? Thanks, Michael From mbradshaw at sorensonmedia.com Wed Oct 17 02:29:04 2012 From: mbradshaw at sorensonmedia.com (Michael Bradshaw) Date: Tue, 16 Oct 2012 18:29:04 -0600 Subject: [Libav-user] [lav-user] Memory leaks in Mac OSX Lion In-Reply-To: References: Message-ID: On Tue, Oct 16, 2012 at 6:06 PM, Quy Pham Sy wrote: > Hi, > > [...] > > What is wrong with these code that might cause the leak? > > Thanks, > Jack Is this an accidental repost? From donmoir at comcast.net Wed Oct 17 03:24:16 2012 From: donmoir at comcast.net (Don Moir) Date: Tue, 16 Oct 2012 21:24:16 -0400 Subject: [Libav-user] How do I seek to the very beginning of a file? References: Message-ID: > On Tue, Oct 16, 2012 at 5:10 PM, Don Moir wrote: >> I use avformat_seek_file and so does ffplay etc. I always use a valid stream >> index and not -1. I don't leave it up to ffmpeg to determine what stream to >> seek on. >> >> I always take the first_dts for the stream into account. The first_dts will >> be the zero mark for the stream. first_dts can be zero, less than zero, or >> greater than zero. >> >> I use AVSEEK_FLAG_BACKWARD (regardless if seeking to zero or not). >> >> With above logic, I can't remember the last time I had a problem seeking to >> zero (first_dts). >> >> Should I have to do the above ? probably not... > > Ugh, seems complex. It's complicated by the fact that not all formats > seek by DTS (some seek by PTS, like nut). I may have to do that, but > I'm hoping there's a better alternative... Heck, even seeking by byte > to the first packet position seems preferable (though I can't see why > seeking to a byte index of 0 shouldn't work). It's not that the above > is super complex and overly hard... it's just that for such a basic, > frequently used operation (seeking to the beginning), it seems... > wrong. > >> Also not to say there isn't a few problem files here and there but these >> just need to be reported so it can be fixed. >> >> Do you have a particular file that is a problem and can be posted ? > > I've got a bunch of files that seem to completely ignore > AVSEEK_FLAG_BYTE and seeking to 0, despite returning "success." I can > also write some sample code if needed to demonstrate. Shall I? > Oh yeah you can't use AV_SEEK_BYTE in general because a lot of formats don't support it. With seek by PTS they just added more confusion to the mix. Don't need any sample code but if you have a nut sample or another file that is a particular problem I would like to see it if it's easy for you to post. When I first started using ffmpeg most of the learning curve was in timestamps and why seeking didn't work as expected. Over time seeking has been much improved but I can see now why it didn't make sense in the first place. (Because it was incorrect in many cases) I think in the ideal case, you would just seek from 0 to duration in ms or us and be done with it. My interface to ffmpeg does exactly that. From phamsyquybk at gmail.com Wed Oct 17 03:26:39 2012 From: phamsyquybk at gmail.com (Quy Pham Sy) Date: Wed, 17 Oct 2012 10:26:39 +0900 Subject: [Libav-user] [lav-user] Memory leaks in Mac OSX Lion In-Reply-To: References: Message-ID: > Is this an accidental repost? Sorry, my mistake, i didnt see the post in my sent box i though i accidentally discard the previous post. Please delete it From mbradshaw at sorensonmedia.com Wed Oct 17 04:14:23 2012 From: mbradshaw at sorensonmedia.com (Michael Bradshaw) Date: Tue, 16 Oct 2012 20:14:23 -0600 Subject: [Libav-user] How do I seek to the very beginning of a file? In-Reply-To: References: Message-ID: On Tue, Oct 16, 2012 at 7:24 PM, Don Moir wrote: > >> On Tue, Oct 16, 2012 at 5:10 PM, Don Moir wrote: >>> >>> I use avformat_seek_file and so does ffplay etc. I always use a valid >>> stream >>> index and not -1. I don't leave it up to ffmpeg to determine what stream >>> to >>> seek on. >>> >>> I always take the first_dts for the stream into account. The first_dts >>> will >>> be the zero mark for the stream. first_dts can be zero, less than zero, >>> or >>> greater than zero. >>> >>> I use AVSEEK_FLAG_BACKWARD (regardless if seeking to zero or not). >>> >>> With above logic, I can't remember the last time I had a problem seeking >>> to >>> zero (first_dts). >>> >>> Should I have to do the above ? probably not... >> >> >> Ugh, seems complex. It's complicated by the fact that not all formats >> seek by DTS (some seek by PTS, like nut). I may have to do that, but >> I'm hoping there's a better alternative... Heck, even seeking by byte >> to the first packet position seems preferable (though I can't see why >> seeking to a byte index of 0 shouldn't work). It's not that the above >> is super complex and overly hard... it's just that for such a basic, >> frequently used operation (seeking to the beginning), it seems... >> wrong. >> >>> Also not to say there isn't a few problem files here and there but these >>> just need to be reported so it can be fixed. >>> >>> Do you have a particular file that is a problem and can be posted ? >> >> >> I've got a bunch of files that seem to completely ignore >> AVSEEK_FLAG_BYTE and seeking to 0, despite returning "success." I can >> also write some sample code if needed to demonstrate. Shall I? >> > > Oh yeah you can't use AV_SEEK_BYTE in general because a lot of formats don't > support it. But it should return an error if that's the case (-1 to be exact). It checks for (AVFormatContext.iformat.flags & AVFMT_NO_BYTE_SEEK) and returns -1 if byte-seeking is not allowed/supported. But all these cases of mine return 0 indicating success... Does anyone have any thoughts on this? > With seek by PTS they just added more confusion to the mix. > > Don't need any sample code but if you have a nut sample or another file that > is a particular problem I would like to see it if it's easy for you to post. > > When I first started using ffmpeg most of the learning curve was in > timestamps and why seeking didn't work as expected. Over time seeking has > been much improved but I can see now why it didn't make sense in the first > place. (Because it was incorrect in many cases) > > I think in the ideal case, you would just seek from 0 to duration in ms or > us and be done with it. My interface to ffmpeg does exactly that. I had a sample that seeking to 0 failed (or rather, it succeeded, but sought to the second keyframe instead of the beginning frame) because the first frame had a DTS of -1. There were a few more details that complicated matters, but yes, that's the kind of interface I'm striving for but reliability is critical in my case, so I'm looking for the most reliable way of seeking to the very first frame/packet for all streams. But yes, I very well may have to end up doing what you suggested. From phamsyquybk at gmail.com Wed Oct 17 03:52:14 2012 From: phamsyquybk at gmail.com (jackode) Date: Tue, 16 Oct 2012 18:52:14 -0700 (PDT) Subject: [Libav-user] [libav-user] Memory leak in Mac OS X Lion In-Reply-To: References: Message-ID: <1350438734363-4655853.post@n4.nabble.com> Thanks Michael, I really overlooked that one. -- View this message in context: http://libav-users.943685.n4.nabble.com/Libav-user-libav-user-Memory-leak-in-Mac-OS-X-Lion-tp4655841p4655853.html Sent from the libav-users mailing list archive at Nabble.com. From donmoir at comcast.net Wed Oct 17 04:49:51 2012 From: donmoir at comcast.net (Don Moir) Date: Tue, 16 Oct 2012 22:49:51 -0400 Subject: [Libav-user] How do I seek to the very beginning of a file? References: Message-ID: <8A9A8B98FBBE4001ACAB7F830911B87E@MANLAP> >>> On Tue, Oct 16, 2012 at 5:10 PM, Don Moir wrote: >>>> >>>> I use avformat_seek_file and so does ffplay etc. I always use a valid >>>> stream >>>> index and not -1. I don't leave it up to ffmpeg to determine what stream >>>> to >>>> seek on. >>>> >>>> I always take the first_dts for the stream into account. The first_dts >>>> will >>>> be the zero mark for the stream. first_dts can be zero, less than zero, >>>> or >>>> greater than zero. >>>> >>>> I use AVSEEK_FLAG_BACKWARD (regardless if seeking to zero or not). >>>> >>>> With above logic, I can't remember the last time I had a problem seeking >>>> to >>>> zero (first_dts). >>>> >>>> Should I have to do the above ? probably not... >>> >>> >>> Ugh, seems complex. It's complicated by the fact that not all formats >>> seek by DTS (some seek by PTS, like nut). I may have to do that, but >>> I'm hoping there's a better alternative... Heck, even seeking by byte >>> to the first packet position seems preferable (though I can't see why >>> seeking to a byte index of 0 shouldn't work). It's not that the above >>> is super complex and overly hard... it's just that for such a basic, >>> frequently used operation (seeking to the beginning), it seems... >>> wrong. >>> >>>> Also not to say there isn't a few problem files here and there but these >>>> just need to be reported so it can be fixed. >>>> >>>> Do you have a particular file that is a problem and can be posted ? >>> >>> >>> I've got a bunch of files that seem to completely ignore >>> AVSEEK_FLAG_BYTE and seeking to 0, despite returning "success." I can >>> also write some sample code if needed to demonstrate. Shall I? >>> >> >> Oh yeah you can't use AV_SEEK_BYTE in general because a lot of formats don't >> support it. > > But it should return an error if that's the case (-1 to be exact). It > checks for (AVFormatContext.iformat.flags & AVFMT_NO_BYTE_SEEK) and > returns -1 if byte-seeking is not allowed/supported. But all these > cases of mine return 0 indicating success... Does anyone have any > thoughts on this? > > >> With seek by PTS they just added more confusion to the mix. >> >> Don't need any sample code but if you have a nut sample or another file that >> is a particular problem I would like to see it if it's easy for you to post. >> >> When I first started using ffmpeg most of the learning curve was in >> timestamps and why seeking didn't work as expected. Over time seeking has >> been much improved but I can see now why it didn't make sense in the first >> place. (Because it was incorrect in many cases) >> >> I think in the ideal case, you would just seek from 0 to duration in ms or >> us and be done with it. My interface to ffmpeg does exactly that. > > I had a sample that seeking to 0 failed (or rather, it succeeded, but > sought to the second keyframe instead of the beginning frame) because > the first frame had a DTS of -1. There were a few more details that > complicated matters, but yes, that's the kind of interface I'm > striving for but reliability is critical in my case, so I'm looking > for the most reliable way of seeking to the very first frame/packet > for all streams. But yes, I very well may have to end up doing what > you suggested. Yeah reliability was important for me too so thats why I ended up doing it the way I suggested. Some things have changed since way back when like there is a start_time and maybe that would be better. But kind of settled in on it now but if someone has a better suggestion I am all ears. first_dts has been fairly reliable but has been broken a couple times but fixed right away. I don't really want to get into to seeing how reliable start_time is at the moment. Also be aware that first_dts can be AV_NOPTS_VALUE. From donmoir at comcast.net Wed Oct 17 05:33:01 2012 From: donmoir at comcast.net (Don Moir) Date: Tue, 16 Oct 2012 23:33:01 -0400 Subject: [Libav-user] How do I seek to the very beginning of a file? References: <8A9A8B98FBBE4001ACAB7F830911B87E@MANLAP> Message-ID: >>>> On Tue, Oct 16, 2012 at 5:10 PM, Don Moir wrote: >>>>> >>>>> I use avformat_seek_file and so does ffplay etc. I always use a valid >>>>> stream >>>>> index and not -1. I don't leave it up to ffmpeg to determine what stream >>>>> to >>>>> seek on. >>>>> >>>>> I always take the first_dts for the stream into account. The first_dts >>>>> will >>>>> be the zero mark for the stream. first_dts can be zero, less than zero, >>>>> or >>>>> greater than zero. >>>>> >>>>> I use AVSEEK_FLAG_BACKWARD (regardless if seeking to zero or not). >>>>> >>>>> With above logic, I can't remember the last time I had a problem seeking >>>>> to >>>>> zero (first_dts). >>>>> >>>>> Should I have to do the above ? probably not... >>>> >>>> >>>> Ugh, seems complex. It's complicated by the fact that not all formats >>>> seek by DTS (some seek by PTS, like nut). I may have to do that, but >>>> I'm hoping there's a better alternative... Heck, even seeking by byte >>>> to the first packet position seems preferable (though I can't see why >>>> seeking to a byte index of 0 shouldn't work). It's not that the above >>>> is super complex and overly hard... it's just that for such a basic, >>>> frequently used operation (seeking to the beginning), it seems... >>>> wrong. >>>> >>>>> Also not to say there isn't a few problem files here and there but these >>>>> just need to be reported so it can be fixed. >>>>> >>>>> Do you have a particular file that is a problem and can be posted ? >>>> >>>> >>>> I've got a bunch of files that seem to completely ignore >>>> AVSEEK_FLAG_BYTE and seeking to 0, despite returning "success." I can >>>> also write some sample code if needed to demonstrate. Shall I? >>>> >>> >>> Oh yeah you can't use AV_SEEK_BYTE in general because a lot of formats don't >>> support it. >> >> But it should return an error if that's the case (-1 to be exact). It >> checks for (AVFormatContext.iformat.flags & AVFMT_NO_BYTE_SEEK) and >> returns -1 if byte-seeking is not allowed/supported. But all these >> cases of mine return 0 indicating success... Does anyone have any >> thoughts on this? >> >> >>> With seek by PTS they just added more confusion to the mix. >>> >>> Don't need any sample code but if you have a nut sample or another file that >>> is a particular problem I would like to see it if it's easy for you to post. >>> >>> When I first started using ffmpeg most of the learning curve was in >>> timestamps and why seeking didn't work as expected. Over time seeking has >>> been much improved but I can see now why it didn't make sense in the first >>> place. (Because it was incorrect in many cases) >>> >>> I think in the ideal case, you would just seek from 0 to duration in ms or >>> us and be done with it. My interface to ffmpeg does exactly that. >> >> I had a sample that seeking to 0 failed (or rather, it succeeded, but >> sought to the second keyframe instead of the beginning frame) because >> the first frame had a DTS of -1. There were a few more details that >> complicated matters, but yes, that's the kind of interface I'm >> striving for but reliability is critical in my case, so I'm looking >> for the most reliable way of seeking to the very first frame/packet >> for all streams. But yes, I very well may have to end up doing what >> you suggested. > > Yeah reliability was important for me too so thats why I ended up doing it the way I suggested. Some things have changed since way > back when like there is a start_time and maybe that would be better. But kind of settled in on it now but if someone has a better > suggestion I am all ears. first_dts has been fairly reliable but has been broken a couple times but fixed right away. I don't > really want to get into to seeing how reliable start_time is at the moment. > > Also be aware that first_dts can be AV_NOPTS_VALUE. Also just don't use AV_SEEK_BYTE because you will end up with logic that is worse. Most things like this lend themselves to timestamps anyway. But agree there were several cases in the past that a seek returned 0 instead of -1 when it failed but that has gotten better. Apparently not for AV_SEEK_BYTE though. From supretsonu99 at gmail.com Wed Oct 17 09:03:48 2012 From: supretsonu99 at gmail.com (sujith sudhakaran) Date: Wed, 17 Oct 2012 12:33:48 +0530 Subject: [Libav-user] Any brief explanation for ffm_set_write_index() Message-ID: hi all, I was trying to find some documentation for the functions like but not successful: 1) ffm_set_write_index(AVFormatContext *s, int64_t pos, int64_t file_size) -- referenced in HTTPSTATE_SEND_DATA 2) ffm_write_write_index(int fd, int64_t pos) -- referenced in http_receive_data 3) ffm_read_write_index(int fd) -- referenced in http_start_receive_data Can anyone please explain in brief what is the significance of these functions? -------------- next part -------------- An HTML attachment was scrubbed... URL: From stefasab at gmail.com Wed Oct 17 11:56:56 2012 From: stefasab at gmail.com (Stefano Sabatini) Date: Wed, 17 Oct 2012 11:56:56 +0200 Subject: [Libav-user] examples/demuxing.c not working properly In-Reply-To: <5DA090DC8DCD3549BE9DF08C5074509E01603FC487@indiambx01.corp.adobe.com> References: <5DA090DC8DCD3549BE9DF08C5074509E01603FC436@indiambx01.corp.adobe.com> <507BD94B.8050005@gmail.com> <5DA090DC8DCD3549BE9DF08C5074509E01603FC487@indiambx01.corp.adobe.com> Message-ID: <20121017095656.GD21113@arborea> On date Monday 2012-10-15 19:43:30 +0530, Chandranath Bhattacharyya encoded: > >> What's going wrong? AVStream::time_base.den = 12800; seems to be wrong data. Other than fixing some compilation errors, I did not modify anything else in examples/demuxing.c. > > - I downloaded the older version (ffmpeg-20121003-git-df82454-win32-*) from http://ffmpeg.zeranoe.com/builds/. Now AVStream::time_base.den = 25 - perfect!! > > However, I had to comment out the following lines in write_video_frame (muxing.c) to get rid of pts (0) < dts (1) error: > if (c->coded_frame->pts != AV_NOPTS_VALUE) > pkt.pts = av_rescale_q(c->coded_frame->pts, > c->time_base, st->time_base); > > In above c->coded_frame->pts was always 0 causing the problem. > > Also, the file I was referring to was example/muxing.c (not demuxing.c). Sorry for the error. Should be fixed in latest git (see also trac ticket #1801). From nicolas.george at normalesup.org Wed Oct 17 17:44:01 2012 From: nicolas.george at normalesup.org (Nicolas George) Date: Wed, 17 Oct 2012 17:44:01 +0200 Subject: [Libav-user] FFmpeg License Violation - What Are My Remedies? In-Reply-To: <5077DCAE.6080907@gmail.com> References: <5077DCAE.6080907@gmail.com> Message-ID: <20121017154401.GC20872@phare.normalesup.org> Le primidi 21 vend?miaire, an CCXXI, Michael Zucchi a ?crit?: > Of course, apk's and the android shop are somewhat problematic wrt > to the second point. If you used the 'shop', then you actually got > the application from google. So you are quite entitled to ask > google for the source as they were the ones who `distributed' or > 'conveyed' the software to you. This is an interesting point. I believe Google could seriously argue that their "app shop" acts as a service provider to allow the editor to distribute the app. To compare it with another situation: If company A is producing and selling in its shop a physical device with its firmware infringing the GPL, there is no doubt that its is doing the distribution and therefore responsible for the infringement. If said company A sells by mail order, is the delivery service responsible for the infringement? I do not believe so. If said company A sells to big resellers (hypermarket chains and so), are the resellers responsible for the infringement? This is less obvious than the previous case, but they should not be, as they have no way of knowing they are infringing. On the whole, I believe that no judge would hold someone responsible if they infringe unknowingly because they themselves are victim of the same infringement. OTOH, I really do not like the policy of Google's "app shop", especially (but not only) with regard to their (lack of) handling of Free software licenses, so if there was a way to force them to fix it, it would be nice. Regards, -- Nicolas George -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: Digital signature URL: From zhou.wenpeng at rdnet.fi Wed Oct 17 23:36:28 2012 From: zhou.wenpeng at rdnet.fi (Wenpeng Zhou) Date: Thu, 18 Oct 2012 00:36:28 +0300 Subject: [Libav-user] Can we get two live streams with one USB camera (C++) Message-ID: <006001cdacaf$791d25a0$6b5770e0$@rdnet.fi> Hi, I am wondering if we can get two live streams with one USB camera. So, we can stream one of live streams, and save the other stream frames to memory buffer that has a fixed length. for example, the buffer can contain 200 frames. at some point, I can save these 200 frames to an AVI file. I will implement with C++ windows, please give me some code example. Thanks in advance! -------------- next part -------------- An HTML attachment was scrubbed... URL: From mark.kenna at sureviewsystems.com Thu Oct 18 17:43:18 2012 From: mark.kenna at sureviewsystems.com (Mark Kenna) Date: Thu, 18 Oct 2012 16:43:18 +0100 Subject: [Libav-user] SDP Parsing Message-ID: Could someone tell me if this SDP looks correct? I was under the impression that you couldn't have more than one a=rtpmap within a m= media tag? Note that I've taken the capture through WireShark and omitted the top parts Session Description Protocol ...... ...... Media Description, name and address (m): video 0 RTP/AVP 26 96 Media Attribute (a): rtpmap:26 JPEG/90000 Media Title (i): video stream 1 in camera 1 Media Attribute (a): control:rtsp://74.112.34.42:554/media/1/video/1 Media Attribute (a): x-bufferdelay:0.050000 Media Attribute (a): mimetype:string;"video/JPEG" Media Attribute (a): rtpmap:96 H264/90000 Media Attribute (a): fmtp:96 packetization-mode=1; profile-level-id=420029; config=0000000167420029e2900800c3602dc0404069078911500000000168ce3c80; sprop-parameter-sets=Z0IAKeKQCADDYC3AQEBpB4kRUA==,aM48gA==; Media Title (i): video stream 1 in camera 1 Media Attribute (a): control:rtsp://74.112.34.42:554/media/1/video/1 Media Attribute (a): x-bufferdelay:0.050000 Media Attribute (a): mimetype:string;"video/H264" It looks as if this SDK is trying to say that the media track could be MJPEG or h264. FFmpeg is reading the codec as MJPEG and then failing when the media data delivered is actually h264. I just need to know if this is a valid SDP and whether there could be a bug in FFMpeg. Thanks, Mark. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mbradshaw at sorensonmedia.com Thu Oct 18 21:35:30 2012 From: mbradshaw at sorensonmedia.com (Michael Bradshaw) Date: Thu, 18 Oct 2012 13:35:30 -0600 Subject: [Libav-user] How do I seek to the very beginning of a file? In-Reply-To: References: <8A9A8B98FBBE4001ACAB7F830911B87E@MANLAP> Message-ID: On Tue, Oct 16, 2012 at 9:33 PM, Don Moir wrote: > Also just don't use AV_SEEK_BYTE because you will end up with logic that is > worse. Most things like this lend themselves to timestamps anyway. But agree > there were several cases in the past that a seek returned 0 instead of -1 > when it failed but that has gotten better. Apparently not for AV_SEEK_BYTE > though. FYI, I've reported it as ticket #1831: https://ffmpeg.org/trac/ffmpeg/ticket/1831 I ended up just reading the first packet in the file to know which stream it belongs to, and then seeking by that stream (and AVSEEK_FLAG_BACKWARD | AVSEEK_FLAG_ANY) to a very negative number to ensure it seeks backward to the very first packet. It seems to work for the time being. --Michael From mbradshaw at sorensonmedia.com Fri Oct 19 21:49:53 2012 From: mbradshaw at sorensonmedia.com (Michael Bradshaw) Date: Fri, 19 Oct 2012 13:49:53 -0600 Subject: [Libav-user] How do I properly use swr_set_compensation() in swresample? Message-ID: I'm just wondering more about what swr_set_compensation() does. I'm not fully understanding the docs about it and the ffplay code isn't incredibly clear to me. Can I use it to skip the first few samples of input audio (that is, say my source has samples 0-100, and my output wants samples 20-120, can I use swr_set_compensation() to conveniently skip the first 20 samples)? Or is it used for something else? Thanks! --Michael From svetlana.olonetsky at gmail.com Sun Oct 21 10:24:26 2012 From: svetlana.olonetsky at gmail.com (Svetlana Olonetsky) Date: Sun, 21 Oct 2012 10:24:26 +0200 Subject: [Libav-user] reading video with multiple video streams Message-ID: Hi, I am reading video files using ffmpeg in C++. I have some videos from users with multiple video streams. For example, running ffmpeg directly gives stream info: Stream #0:0: Video: mjpeg, yuvj420p, 640x480, 90k tbr, 90k tbn, 90k tbc Metadata: comment : Movie/video screen capture Stream #0:1(eng): Audio: wmav2 (a[1][0][0] / 0x0161), 48000 Hz, stereo, s16, 192 kb/s Stream #0:2(eng): Video: wmv3 (Main) (WMV3 / 0x33564D57), yuv420p, 640x480, 5500 kb/s, 29.97 tbr, 1k tbn, 1k tbc How can I figure out which video stream is Main ? Thank you, Svetlana -------------- next part -------------- An HTML attachment was scrubbed... URL: From rjvbertin at gmail.com Sun Oct 21 14:19:51 2012 From: rjvbertin at gmail.com (=?iso-8859-1?Q?=22Ren=E9_J=2EV=2E_Bertin=22?=) Date: Sun, 21 Oct 2012 14:19:51 +0200 Subject: [Libav-user] parsing in-memory MP4 fragment Message-ID: Hello list, I'm working on a QuickTime importer plugin to read video recordings in a proprietary format by Brigade Electronics ('VOD' files, nothing to do with video on demand). These files contain 1s MP4 fragments interspersed with other data. FFmpeg succeeds in extracting these fragments and from the original combining them into a transcoded video file, even better so when I concatenate the fragments first. Looking at the code of the Perian importer component, it is clear that it will be possible to use libavformat to retrieve the relevant info for the individual frames in the MP4 fragments, and construct a so-called QuickTime reference movie (i.e. a movie that contains something like a track with pointers to the frames in the original file). However, the Perian code is conceived for standard video containers, not for the kind of stream I'm working with. My question therefore is: is it possible to hand off an MP4 sequence that resides in a memory buffer to libavformat, and retrieve the offsets and byte lengths of the individual frames making up that fragment. Alternatively, is there a file (pointer) based approach where I can specify the offset in the file where the MP4 data starts? I'm completely new to the FFmeg project, so a few pointers to relevant examples or tutorials would be appreciated greatly! Thanks in advance, Ren? From andrey.krieger.utkin at gmail.com Sun Oct 21 16:03:31 2012 From: andrey.krieger.utkin at gmail.com (Andrey Utkin) Date: Sun, 21 Oct 2012 17:03:31 +0300 Subject: [Libav-user] reading video with multiple video streams In-Reply-To: References: Message-ID: 2012/10/21 Svetlana Olonetsky : > Hi, > > I am reading video files using ffmpeg in C++. > I have some videos from users with multiple video streams. > > For example, running ffmpeg directly gives stream info: > Stream #0:0: Video: mjpeg, yuvj420p, 640x480, 90k tbr, 90k tbn, 90k tbc > Metadata: > comment : Movie/video screen capture > Stream #0:1(eng): Audio: wmav2 (a[1][0][0] / 0x0161), 48000 Hz, stereo, > s16, 192 kb/s > Stream #0:2(eng): Video: wmv3 (Main) (WMV3 / 0x33564D57), yuv420p, > 640x480, 5500 kb/s, 29.97 tbr, 1k tbn, 1k tbc > > How can I figure out which video stream is Main ? You are contradicting yourself. You show example with one audio and one video stream. For analyzing elementary streams, look at AVFormatContext.streams array of AVStream structs; AVStream also has entry 'codec' of AVCodecContext type, where you can find all properties of certain elementary stream. -- Andrey Utkin From svetlana.olonetsky at gmail.com Sun Oct 21 16:29:16 2012 From: svetlana.olonetsky at gmail.com (Svetlana Olonetsky) Date: Sun, 21 Oct 2012 16:29:16 +0200 Subject: [Libav-user] reading video with multiple video streams In-Reply-To: References: Message-ID: Sorry, I do not understand. How can I see that Stream #0:0: Video: mjpeg, yuvj420p, 640x480, 90k tbr, 90k tbn, 90k tbc is BAD and Stream #0:2(eng): Video: wmv3 (Main) (WMV3 / 0x33564D57), yuv420p, 640x480, 5500 kb/s, 29.97 tbr, 1k tbn, 1k tbc is GOOD ? Thank you, Svetlana On Sun, Oct 21, 2012 at 4:03 PM, Andrey Utkin < andrey.krieger.utkin at gmail.com> wrote: > 2012/10/21 Svetlana Olonetsky : > > Hi, > > > > I am reading video files using ffmpeg in C++. > > I have some videos from users with multiple video streams. > > > > For example, running ffmpeg directly gives stream info: > > Stream #0:0: Video: mjpeg, yuvj420p, 640x480, 90k tbr, 90k tbn, 90k tbc > > Metadata: > > comment : Movie/video screen capture > > Stream #0:1(eng): Audio: wmav2 (a[1][0][0] / 0x0161), 48000 Hz, > stereo, > > s16, 192 kb/s > > Stream #0:2(eng): Video: wmv3 (Main) (WMV3 / 0x33564D57), yuv420p, > > 640x480, 5500 kb/s, 29.97 tbr, 1k tbn, 1k tbc > > > > How can I figure out which video stream is Main ? > > You are contradicting yourself. You show example with one audio and > one video stream. > For analyzing elementary streams, look at AVFormatContext.streams > array of AVStream structs; AVStream also has entry 'codec' of > AVCodecContext type, where you can find all properties of certain > elementary stream. > > -- > Andrey Utkin > _______________________________________________ > 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 andrey.krieger.utkin at gmail.com Sun Oct 21 17:31:27 2012 From: andrey.krieger.utkin at gmail.com (Andrey Utkin) Date: Sun, 21 Oct 2012 18:31:27 +0300 Subject: [Libav-user] reading video with multiple video streams In-Reply-To: References: Message-ID: 2012/10/21 Svetlana Olonetsky : > Sorry, I do not understand. > > How can I see that > > Stream #0:0: Video: mjpeg, yuvj420p, 640x480, 90k tbr, 90k tbn, 90k tbc is > BAD > > and > > Stream #0:2(eng): Video: wmv3 (Main) (WMV3 / 0x33564D57), yuv420p, 640x480, > 5500 kb/s, 29.97 tbr, 1k tbn, 1k tbc is GOOD ? Sorry, i did not notice #0:0 line. Both video streams you have seem good - codec type and information are recognized well. Which substream to choose is denendant decision. You should know something about file you get, and choose by some logic. Or you can choose one with highest resolution, or just first in the list. -- Andrey Utkin From mbradshaw at sorensonmedia.com Sun Oct 21 21:18:56 2012 From: mbradshaw at sorensonmedia.com (Michael Bradshaw) Date: Sun, 21 Oct 2012 13:18:56 -0600 Subject: [Libav-user] reading video with multiple video streams In-Reply-To: References: Message-ID: On Sun, Oct 21, 2012 at 2:24 AM, Svetlana Olonetsky wrote: > Hi, > > I am reading video files using ffmpeg in C++. > I have some videos from users with multiple video streams. > > For example, running ffmpeg directly gives stream info: > Stream #0:0: Video: mjpeg, yuvj420p, 640x480, 90k tbr, 90k tbn, 90k tbc > Metadata: > comment : Movie/video screen capture > Stream #0:1(eng): Audio: wmav2 (a[1][0][0] / 0x0161), 48000 Hz, stereo, > s16, 192 kb/s > Stream #0:2(eng): Video: wmv3 (Main) (WMV3 / 0x33564D57), yuv420p, > 640x480, 5500 kb/s, 29.97 tbr, 1k tbn, 1k tbc > > How can I figure out which video stream is Main ? I'm not sure what the most appropriate method is, but I would probably pick the stream with the longest duration. Stream 0:0 is probably just a thumbnail/single frame, whereas stream 0:2 is probably an actual video. Check AVStream.duration (if it's set). From svetlana.olonetsky at gmail.com Mon Oct 22 10:01:12 2012 From: svetlana.olonetsky at gmail.com (Svetlana Olonetsky) Date: Mon, 22 Oct 2012 10:01:12 +0200 Subject: [Libav-user] reading video with multiple video streams In-Reply-To: References: Message-ID: Thank you ! In our example we decided to go with codec_info_nb_frames != 1 in case 2 video streams exist. Svetlana On Sun, Oct 21, 2012 at 9:18 PM, Michael Bradshaw < mbradshaw at sorensonmedia.com> wrote: > On Sun, Oct 21, 2012 at 2:24 AM, Svetlana Olonetsky > wrote: > > Hi, > > > > I am reading video files using ffmpeg in C++. > > I have some videos from users with multiple video streams. > > > > For example, running ffmpeg directly gives stream info: > > Stream #0:0: Video: mjpeg, yuvj420p, 640x480, 90k tbr, 90k tbn, 90k tbc > > Metadata: > > comment : Movie/video screen capture > > Stream #0:1(eng): Audio: wmav2 (a[1][0][0] / 0x0161), 48000 Hz, > stereo, > > s16, 192 kb/s > > Stream #0:2(eng): Video: wmv3 (Main) (WMV3 / 0x33564D57), yuv420p, > > 640x480, 5500 kb/s, 29.97 tbr, 1k tbn, 1k tbc > > > > How can I figure out which video stream is Main ? > > I'm not sure what the most appropriate method is, but I would probably > pick the stream with the longest duration. Stream 0:0 is probably just > a thumbnail/single frame, whereas stream 0:2 is probably an actual > video. Check AVStream.duration (if it's set). > _______________________________________________ > 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 litvss at gmail.com Mon Oct 22 11:22:24 2012 From: litvss at gmail.com (Litvinenko Stanislav) Date: Mon, 22 Oct 2012 13:22:24 +0400 Subject: [Libav-user] Encoding to G.723_1 Message-ID: <50851050.9010301@gmail.com> Good day I need to transcoding RTP-stream. Having trouble encoding G.723_1. At the end of each packet G.723_1 obtained attenuation. Code used for the encoding to G.723_1 function is on github: https://github.com/dolk13/G723_1/blob/master/g723.c In the repository are examples to transcode: beforer - g711_2.g711 after - g711.g723 What's wrong i doing? P.S. Sorry for my English. Best regards, Stanislav Litvinenko From zhou.wenpeng at rdnet.fi Mon Oct 22 12:44:54 2012 From: zhou.wenpeng at rdnet.fi (Wenpeng Zhou) Date: Mon, 22 Oct 2012 13:44:54 +0300 Subject: [Libav-user] How can we convert command to the C++ code Message-ID: <003b01cdb042$4614a2a0$d23de7e0$@rdnet.fi> Hi, I plan to implement some application with ffmpeg and VC++. I do not know how to convert this command to C++ code. ffmpeg -f dshow -r 25 -s 640x480 -i video="USB2.0_Camera":audio="Microphone (USB Audio Device)" output.avi Please help me. Thanks! -------------- next part -------------- An HTML attachment was scrubbed... URL: From zhou.wenpeng at rdnet.fi Mon Oct 22 14:43:06 2012 From: zhou.wenpeng at rdnet.fi (Wenpeng Zhou) Date: Mon, 22 Oct 2012 15:43:06 +0300 Subject: [Libav-user] I need some C++ example how ffmpeg grabs frames from a usb camera Message-ID: <005d01cdb052$c8c31f50$5a495df0$@rdnet.fi> Hi, I need some C++ example how ffmpeg grabs frames from a usb camera. I searched from the Internet. But did not find anyting. Thanks! -------------- next part -------------- An HTML attachment was scrubbed... URL: From mbradshaw at sorensonmedia.com Mon Oct 22 20:20:16 2012 From: mbradshaw at sorensonmedia.com (Michael Bradshaw) Date: Mon, 22 Oct 2012 12:20:16 -0600 Subject: [Libav-user] reading video with multiple video streams In-Reply-To: References: Message-ID: On Mon, Oct 22, 2012 at 2:01 AM, Svetlana Olonetsky wrote: > Thank you ! > > In our example we decided to go with codec_info_nb_frames != 1 in case 2 > video streams exist. I just found the function av_find_best_stream() which can find the "best" audio/video stream, which may be useful and/or more reliable. From info at denisgottardello.it Mon Oct 22 21:30:08 2012 From: info at denisgottardello.it (Denis) Date: Mon, 22 Oct 2012 21:30:08 +0200 Subject: [Libav-user] muxing.c example Message-ID: <201210222130.08979.info@denisgottardello.it> Using muxing.c example, I obtain this error: "Unable to find a suitable output format for 'a.mpg" The problem is at row "avformat_alloc_output_context2(&oc, NULL, NULL, filename);" of the muxing.c example. Does muxing.c work well? I tried: a.mpg a.avi a.mpeg a.ogg but nothing. -- www.denisgottardello.it Skype: mrdebug Videosurveillance and home automation! http://www.denisgottardello.it/DomusBoss/DomusBossIndice.php -------------- next part -------------- An HTML attachment was scrubbed... URL: From daniel.sakuma at voicetechnology.com.br Mon Oct 22 20:20:17 2012 From: daniel.sakuma at voicetechnology.com.br (Daniel Sakuma) Date: Mon, 22 Oct 2012 16:20:17 -0200 Subject: [Libav-user] Converting .264 to .avi (audio is out of sync) Message-ID: I am converting a .264 with its .wav file to .avi and the duration of the generated file is smaller than it should be. This is a problem for me because the video is not synchronized with the audio. I've tested several parameters (-async,-vsync, sync_file_id) and did not notice any change in the file. For example: avconv -r 15 -i input.264 -i input.wav -c:a copy -map 0:a -map 1:v output.avi Anyone have any ideas? ps: The .264 and .wav files were extracted from a pcap file using the program Videosnarf Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: From cehoyos at ag.or.at Mon Oct 22 23:27:24 2012 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Mon, 22 Oct 2012 21:27:24 +0000 (UTC) Subject: [Libav-user] Converting .264 to .avi (audio is out of sync) References: Message-ID: Daniel Sakuma writes: > avconv -r 15 -i input.264 -i input.wav -c:a copy -map 0:a > -map 1:v output.avi This application is known to contain several hundred individual regressions over ffmpeg, some of them security relevant, please understand that we therefore cannot support it. Please test current FFmpeg git head, if the problem is reproducible, please provide (command line and) complete, uncut console output. (Note that forcing an input frame rate only works for raw video, not for raw h.264.) Carl Eugen From wseemann at gmail.com Tue Oct 23 04:21:40 2012 From: wseemann at gmail.com (William Seemann) Date: Mon, 22 Oct 2012 21:21:40 -0500 Subject: [Libav-user] FFmpeg components needed to extract audio/video metadata In-Reply-To: References: <507645C1.5010404@gmail.com> Message-ID: <5085FF34.9060102@gmail.com> Thanks Carl, that was a very helpful response. I ended up using the following compiler flags: FLAGS="$FLAGS --enable-shared --disable-symver" FLAGS="$FLAGS --enable-small --optimization-flags=-O2" FLAGS="$FLAGS --disable-doc" FLAGS="$FLAGS --disable-ffmpeg" FLAGS="$FLAGS --disable-ffplay" FLAGS="$FLAGS --disable-ffprobe" FLAGS="$FLAGS --disable-ffserver" FLAGS="$FLAGS --disable-avdevice" FLAGS="$FLAGS --disable-swresample" FLAGS="$FLAGS --disable-swscale" FLAGS="$FLAGS --disable-postproc" FLAGS="$FLAGS --disable-avfilter" FLAGS="$FLAGS --disable-everything" FLAGS="$FLAGS --disable-gpl" FLAGS="$FLAGS --enable-demuxer=acc,flac,h263,h264,m4v,matroska,mp3,mpegvideo,ogg,pcm_alaw,pcm_f32be,pcm_f32le,pcm_f64be,pcm_f64le,pcm_mulaw,pcm_s16be,pcm_s16le,pcm_s24be" FLAGS="$FLAGS --enable-demuxer=pcm_s24le,pcm_s32be,pcm_s32le,pcm_s8,pcm_u16be,pcm_u16le,pcm_u24be,pcm_u24le,pcm_u32be,pcm_u32le,pcm_u8,rtp,rtsp,sdp,wav" FLAGS="$FLAGS --enable-parser=aac,aac_latm,flac,h263,h264,mpeg4video,mpegaudio,mpegvideo,vorbis,vp8" FLAGS="$FLAGS --enable-decoder=mp3" FLAGS="$FLAGS --enable-protocol=http,https,mmsh,mmst" FLAGS="$FLAGS --disable-debug" Interestingly enough, if I leave off "--enable-decoder=mp3" then I'm unable to extract metadata from mp3 files. It would appear the decoder is also required even though I enabled the demuxer and parser. Any thoughts? I'm still trying to understand how these components work together. On 10/11/2012 09:42 AM, Carl Eugen Hoyos wrote: > William Seemann writes: > >> FLAGS="$FLAGS --enable-shared --disable-symver" > (You could add --disable-debug although it is not > default for shared anyway iirc.) > >> FLAGS="$FLAGS --enable-small --optimization-flags=-O2" > There are two possibilities: > Either "-O2" is good (be it for all use cases, or only for > --enable-small), then it should be made default (either in > all cases, or if --enable-small was selected) = please > report that it should be made default (and why), so other > users profit from your experience! > Or it is bad, then don't use it ;-) > >> FLAGS="$FLAGS --disable-doc" >> FLAGS="$FLAGS --disable-ffmpeg" >> FLAGS="$FLAGS --disable-ffplay" >> FLAGS="$FLAGS --disable-ffprobe" >> FLAGS="$FLAGS --disable-ffserver" >> FLAGS="$FLAGS --disable-avdevice" >> FLAGS="$FLAGS --disable-swresample" >> FLAGS="$FLAGS --disable-swscale" >> FLAGS="$FLAGS --disable-postproc" >> FLAGS="$FLAGS --disable-avfilter" >> FLAGS="$FLAGS --disable-everything" > Doesn't --disable-everything make the others > unneeded (at least some of them)? > >> FLAGS="$FLAGS --disable-gpl" > This is unneded (disable-gpl is the default). > >> FLAGS="$FLAGS --enable-parsers" > I suspect this enables a very large part of the > software you disabled above. Try to enable > only the parsers you need. > >> FLAGS="$FLAGS --enable-protocol=http" >> FLAGS="$FLAGS --enable-demuxers" >> >> For instance, if I only need to extract metadata >> for mp3, ogg, and flac what specifically needs to >> be enabled? > Did you try --enable-demuxer=mp3,ogg,flac instead of > --enable-demuxers? > > Carl Eugen > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user From ian at yospace.com Tue Oct 23 13:18:16 2012 From: ian at yospace.com (Ian Holbrough) Date: Tue, 23 Oct 2012 12:18:16 +0100 Subject: [Libav-user] audio filter chain clicks Message-ID: <50867CF8.4040205@yospace.com> Hi, I'm in the process of migrating to libavfilter based resampling using ffmpeg/libav 1.0 and the audio filter chain seems to be introducing audio clicks. Setting up a passthrough chain with... AVFilterContext* last = NULL; filterAudGraph = avfilter_graph_alloc(); char args[255]; snprintf(args, 255, "time_base=%d/%d:sample_rate=%d:sample_fmt=%s:channel_layout=0x%llx", 1, inpAudioCodec->sample_rate, inpAudioCodec->sample_rate, av_get_sample_fmt_name(inpAudioCodec->sample_fmt), inpAudioCodec->channel_layout); filterAudInp = tsUtilsInitFilter("abuffer", "audInput", args, NULL, filterAudGraph); last = filterAudInp; const enum AVSampleFormat formats[] = { AV_SAMPLE_FMT_S16, -1 }; AVABufferSinkParams* params = av_abuffersink_params_alloc(); params->sample_fmts = formats; filterAudOut = tsUtilsInitFilter("ffabuffersink", "audOutput", NULL, params, filterAudGraph); av_free(params); avfilter_link(last, 0, filterAudOut, 0); avfilter_graph_config(filterAudGraph, NULL); ...where... AVFilterContext* tsUtilsInitFilter(const char * filterName, const char* name, const char* arguments, void* opaque, AVFilterGraph* graph) { AVFilter* filter = avfilter_get_by_name(filterName); AVFilterContext* context = NULL; int ret = avfilter_graph_create_filter(&context, filter, name, arguments, opaque, graph); if (ret < 0) { die("tsUtilsInitFilter - failed to create filter context <%s>", name); } return context; } ...however, when a frame is added (I believe the input sample format, rate and channel layout is compatible with the required output) who's first few samples look like this... 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 ffffffff 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000001 00000000 00000001 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 ffffffff 00000000 ffffffff 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 ...upon retrieving the same frame from the chain the first 4 samples look somewhat different... *000063f0 ffffb628 00002ff8 000008d9* 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 ffffffff 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000001 00000000 00000001 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 ffffffff 00000000 ffffffff 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 ...the remainder of the frame is identical. These sample dumps are produced by... short* a = frame->data[0]; for (int i = 0; i != frame->nb_samples; i++) { printf("%08x ", *(a++)); if ((i % 16) == 15) printf("\n"); } ....removing the filter chain and passing the decoded frames straight through to the encoder does not produce clicking. Any suggestions as to the cause would be gratefully received. Regards Ian -------------- next part -------------- An HTML attachment was scrubbed... URL: From mbradshaw at sorensonmedia.com Tue Oct 23 21:03:27 2012 From: mbradshaw at sorensonmedia.com (Michael Bradshaw) Date: Tue, 23 Oct 2012 13:03:27 -0600 Subject: [Libav-user] Is it possible to dynamically reconfigure a filter graph? Message-ID: I'm using avfilter to rescale video (and convert it to the right pixel format) and convert audio (to the right sample format, sample rate, and channel_layout) (I'm also buffering audio using asetnsamples to fill frames with a consistent number of samples). While reading the source video and source audio, it's possible they change in the stream. If the source audio stream changes (i.e. sample rate, sample format, channel_layout), or if the source video stream changes (width, height, or pixel format), do I have to completely destroy and rebuild the filter graph? Or is there a way to "update" the source filters to the new formats and update (without destroying) the filter graph? My primary concern is that asetnsamples may have some samples buffered, and destroying and recreating the filter graph would lose these buffered samples. Also, if it's possible to update the filters without destroying the graph and recreating it, would it be possible to change the number of samples set for asetnsamples? I'm not seeing anything that makes it look like this is possible, but it's worth double checking. Thanks, Michael From stefasab at gmail.com Tue Oct 23 22:26:10 2012 From: stefasab at gmail.com (Stefano Sabatini) Date: Tue, 23 Oct 2012 22:26:10 +0200 Subject: [Libav-user] muxing.c example In-Reply-To: <201210222130.08979.info@denisgottardello.it> References: <201210222130.08979.info@denisgottardello.it> Message-ID: <20121023202610.GT13824@arborea> On date Monday 2012-10-22 21:30:08 +0200, Denis encoded: > > Using muxing.c example, I obtain this error: > > "Unable to find a suitable output format for 'a.mpg" > > The problem is at row "avformat_alloc_output_context2(&oc, NULL, NULL, > filename);" of the muxing.c example. > > Does muxing.c work well? > I tried: > a.mpg > a.avi > a.mpeg > a.ogg > but nothing. Can't reproduce here. Check that: - you are running an updated copy of muxing.c - output formats are enabled in your linked libavformat From stefasab at gmail.com Tue Oct 23 22:31:09 2012 From: stefasab at gmail.com (Stefano Sabatini) Date: Tue, 23 Oct 2012 22:31:09 +0200 Subject: [Libav-user] I need some C++ example how ffmpeg grabs frames from a usb camera In-Reply-To: <005d01cdb052$c8c31f50$5a495df0$@rdnet.fi> References: <005d01cdb052$c8c31f50$5a495df0$@rdnet.fi> Message-ID: <20121023203109.GU13824@arborea> On date Monday 2012-10-22 15:43:06 +0300, Wenpeng Zhou encoded: > Hi, > > > > I need some C++ example how ffmpeg grabs frames from a usb camera. In Linux you can use the video4linux and video4linux2 device, in Windows there is Vfw and dshow, you just read it as a normal input format (check also the private options in the Input Device section of the manual), and the doc/examples/demuxing.c example. For C++ integration, see: https://ffmpeg.org/trac/ffmpeg/wiki/Including%20FFmpeg%20headers%20in%20a%20C%2B%2B%20application From stefasab at gmail.com Tue Oct 23 22:38:37 2012 From: stefasab at gmail.com (Stefano Sabatini) Date: Tue, 23 Oct 2012 22:38:37 +0200 Subject: [Libav-user] Is it possible to dynamically reconfigure a filter graph? In-Reply-To: References: Message-ID: <20121023203837.GO2713@arborea> On date Tuesday 2012-10-23 13:03:27 -0600, Michael Bradshaw encoded: > I'm using avfilter to rescale video (and convert it to the right pixel > format) and convert audio (to the right sample format, sample rate, > and channel_layout) (I'm also buffering audio using asetnsamples to > fill frames with a consistent number of samples). While reading the > source video and source audio, it's possible they change in the > stream. > If the source audio stream changes (i.e. sample rate, sample > format, channel_layout), or if the source video stream changes (width, > height, or pixel format), do I have to completely destroy and rebuild > the filter graph? Or is there a way to "update" the source filters to > the new formats and update (without destroying) the filter graph? Some filters do, others won't, so in general the best way is to "normalize" the input media before injecting it in the filtergraph, a consistent and robust way to deal with that will require some (re)design at the framework level. > My primary concern is that asetnsamples may have some samples > buffered, and destroying and recreating the filter graph would lose > these buffered samples. > > Also, if it's possible to update the filters without destroying the > graph and recreating it, would it be possible to change the number of > samples set for asetnsamples? I'm not seeing anything that makes it > look like this is possible, but it's worth double checking. This should be easily feasible by implementing a process_command() callback in asetnsamples, also have a look at the asendcmd filter, patches (or alternatively a feature request) are welcome. From mbradshaw at sorensonmedia.com Tue Oct 23 22:45:53 2012 From: mbradshaw at sorensonmedia.com (Michael Bradshaw) Date: Tue, 23 Oct 2012 14:45:53 -0600 Subject: [Libav-user] Is it possible to dynamically reconfigure a filter graph? In-Reply-To: <20121023203837.GO2713@arborea> References: <20121023203837.GO2713@arborea> Message-ID: On Tue, Oct 23, 2012 at 2:38 PM, Stefano Sabatini wrote: > On date Tuesday 2012-10-23 13:03:27 -0600, Michael Bradshaw encoded: >> I'm using avfilter to rescale video (and convert it to the right pixel >> format) and convert audio (to the right sample format, sample rate, >> and channel_layout) (I'm also buffering audio using asetnsamples to >> fill frames with a consistent number of samples). While reading the >> source video and source audio, it's possible they change in the >> stream. > >> If the source audio stream changes (i.e. sample rate, sample >> format, channel_layout), or if the source video stream changes (width, >> height, or pixel format), do I have to completely destroy and rebuild >> the filter graph? Or is there a way to "update" the source filters to >> the new formats and update (without destroying) the filter graph? > > Some filters do, others won't, so in general the best way is to > "normalize" the input media before injecting it in the filtergraph, a > consistent and robust way to deal with that will require some > (re)design at the framework level. How would you suggest to "normalize" the input media? Because that's exactly what I'm (ab)using libavfilter for: given "unormalized" source media, produce "normalized" output with consistent picture size/format and audio format. If there's currently a preferred or better solution to do this, I'd love to know. Right now I'm thinking of abandoning libavfilter and just using swscale and swresample directly, and dynamically reconfiguring the swscale and swresample contexts as necessary, but I'm exploring alternatives. >> My primary concern is that asetnsamples may have some samples >> buffered, and destroying and recreating the filter graph would lose >> these buffered samples. >> > >> Also, if it's possible to update the filters without destroying the >> graph and recreating it, would it be possible to change the number of >> samples set for asetnsamples? I'm not seeing anything that makes it >> look like this is possible, but it's worth double checking. > > This should be easily feasible by implementing a process_command() > callback in asetnsamples, also have a look at the asendcmd filter, > patches (or alternatively a feature request) are welcome. Cool. I guess this can be added to the "On libavfilter: A summary of issues" thread. I'll work on it if I have time, though I doubt I will for a while. Thanks! --Michael From stefasab at gmail.com Tue Oct 23 23:08:59 2012 From: stefasab at gmail.com (Stefano Sabatini) Date: Tue, 23 Oct 2012 23:08:59 +0200 Subject: [Libav-user] Is it possible to dynamically reconfigure a filter graph? In-Reply-To: References: <20121023203837.GO2713@arborea> Message-ID: <20121023210859.GA27161@arborea> On date Tuesday 2012-10-23 14:45:53 -0600, Michael Bradshaw encoded: > On Tue, Oct 23, 2012 at 2:38 PM, Stefano Sabatini wrote: > > On date Tuesday 2012-10-23 13:03:27 -0600, Michael Bradshaw encoded: > >> I'm using avfilter to rescale video (and convert it to the right pixel > >> format) and convert audio (to the right sample format, sample rate, > >> and channel_layout) (I'm also buffering audio using asetnsamples to > >> fill frames with a consistent number of samples). While reading the > >> source video and source audio, it's possible they change in the > >> stream. > > > >> If the source audio stream changes (i.e. sample rate, sample > >> format, channel_layout), or if the source video stream changes (width, > >> height, or pixel format), do I have to completely destroy and rebuild > >> the filter graph? Or is there a way to "update" the source filters to > >> the new formats and update (without destroying) the filter graph? > > > > Some filters do, others won't, so in general the best way is to > > "normalize" the input media before injecting it in the filtergraph, a > > consistent and robust way to deal with that will require some > > (re)design at the framework level. > > How would you suggest to "normalize" the input media? Because that's > exactly what I'm (ab)using libavfilter for: given "unormalized" source > media, produce "normalized" output with consistent picture size/format > and audio format. If there's currently a preferred or better solution > to do this, I'd love to know. Well, do you need to normalize the input or the output? Old versions of buffer/abuffer supported input normalization, before the libav changes discarding that feature were merged in. In general it should not be hard to implement a normalization input buffer source. Dealing with that in a generic way (some filters can support mid-stream changes, other can't, so the framework should automatically auto-add format normalizers in the latter case). Alternatively you could just have a scaler/resampler just before the filtergraph input, if you need to perform further filtering. > Right now I'm thinking of abandoning libavfilter and just using > swscale and swresample directly, and dynamically reconfiguring the > swscale and swresample contexts as necessary, but I'm exploring > alternatives. > > >> My primary concern is that asetnsamples may have some samples > >> buffered, and destroying and recreating the filter graph would lose > >> these buffered samples. > >> > > > >> Also, if it's possible to update the filters without destroying the > >> graph and recreating it, would it be possible to change the number of > >> samples set for asetnsamples? I'm not seeing anything that makes it > >> look like this is possible, but it's worth double checking. > > > > This should be easily feasible by implementing a process_command() > > callback in asetnsamples, also have a look at the asendcmd filter, > > patches (or alternatively a feature request) are welcome. > > Cool. I guess this can be added to the "On libavfilter: A summary of > issues" thread. I'll work on it if I have time, though I doubt I will > for a while. Well libavfilter dynamic reconfiguration can be considered a framework limitation (and I don't think there are many filtering frameworks which can deal with it), the lack of contributions or lack of time of the FFmpeg slav^H^H^H^Hdevelopers is hardly a problem specific of libavfilter. From tapitman11 at gmail.com Wed Oct 24 00:42:55 2012 From: tapitman11 at gmail.com (Tim Pitman) Date: Tue, 23 Oct 2012 15:42:55 -0700 Subject: [Libav-user] Best way to provide avcodec_decode_video2 with h264 data? Message-ID: I'm encoding a low latency stream using x264 with intra-refresh and decoding using libavcodec. I'm trying to understand the best way to pass data to libavcodec because it's giving me some error messages ("no frame", etc), even though the stream mostly plays ok. I thought that I was passing it one NALU at a time, but it turns out I was only passing it all the data between consecutive SPS and PPS. So it seems like the most correct thing to do is get one complete frame and then hand that to libavcodec. Is this true or is it ok to pass it one NALU at a time or use some other method? Thanks, Tim From tapitman11 at gmail.com Wed Oct 24 00:46:06 2012 From: tapitman11 at gmail.com (Tim Pitman) Date: Tue, 23 Oct 2012 15:46:06 -0700 Subject: [Libav-user] Can we get two live streams with one USB camera (C++) In-Reply-To: <006001cdacaf$791d25a0$6b5770e0$@rdnet.fi> References: <006001cdacaf$791d25a0$6b5770e0$@rdnet.fi> Message-ID: Do you already have the code working to read the camera and stream? If so it should be a simple matter to also copy that data into a buffer at the same time you stream it... On Wed, Oct 17, 2012 at 2:36 PM, Wenpeng Zhou wrote: > Hi, > > I am wondering if we can get two live streams with one USB camera. > So, we can stream one of live streams, and save the other stream frames to > memory buffer that has a fixed length. for example, the buffer can contain > 200 frames. at some point, I can save these 200 frames to an AVI file. > > I will implement with C++ windows, please give me some code example. > > Thanks in advance! > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > From tapitman11 at gmail.com Wed Oct 24 07:00:41 2012 From: tapitman11 at gmail.com (Tim Pitman) Date: Tue, 23 Oct 2012 22:00:41 -0700 Subject: [Libav-user] Video buffer padding Message-ID: The documentation for avcodec_decode_video2() states that the input buffer should be FF_INPUT_BUFFER_PADDING_SIZE longer than the actual data. My question is whether the size should include those bytes or not. For example if my buffer was 4096 bytes of data, should I set size to 4096 and then pad with FF_INPUT_BUFFER_PADDING_SIZE, or should I pad with FF_INPUT_BUFFER_PADDING_SIZE and then set size to 4096 + FF_INPUT_BUFFER_PADDING_SIZE? Thanks, Tim From phamsyquybk at gmail.com Wed Oct 24 08:23:43 2012 From: phamsyquybk at gmail.com (Quy Pham Sy) Date: Wed, 24 Oct 2012 15:23:43 +0900 Subject: [Libav-user] [libav-user] what difference between AVCodec's decode function and avcodec_decode_video2 function Message-ID: Hi, There two version of decode video function with exactly same interface, one defined as a function pointer in AVCodec struct, and avcodec_decode_video2. What is the difference? is there any reason to use one over the other? Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: From T.Glover at nottingham.ac.uk Wed Oct 24 11:46:56 2012 From: T.Glover at nottingham.ac.uk (Tony Glover) Date: Wed, 24 Oct 2012 10:46:56 +0100 Subject: [Libav-user] Best way to provide avcodec_decode_video2 with h264 data? In-Reply-To: References: Message-ID: <8824AAED239A0A48AE135277DC2B79B43EF5DA38FC@EXCHANGE1.ad.nottingham.ac.uk> Hi Tim, I've also been using intra-refresh to stream h264 video. The encoder expects NAL units and, after encoding, the data is streamed in packets. Your frame may or may not fit your encoded frame into a single packet, depending on its size. At the receiving end, you should wait until you receive all the data corresponding to a frame which you can then send to your decoder. I use x264 to do the encoding, live555 to do the streaming and ffmpeg to do the decoding. There are a lot of examples in the live555 codebase so you shouldn't have a problem in seeing an example of what you are intending to do. Hope this helps, Tony. This message and any attachment are intended solely for the addressee and may contain confidential information. If you have received this message in error, please send it back to me, and immediately delete it. Please do not use, copy or disclose the information contained in this message or in any attachment. Any views or opinions expressed by the author of this email do not necessarily reflect the views of the University of Nottingham. This message has been checked for viruses but the contents of an attachment may still contain software viruses which could damage your computer system: you are advised to perform your own checks. Email communications with the University of Nottingham may be monitored as permitted by UK legislation. From T.Glover at nottingham.ac.uk Wed Oct 24 11:53:27 2012 From: T.Glover at nottingham.ac.uk (Tony Glover) Date: Wed, 24 Oct 2012 10:53:27 +0100 Subject: [Libav-user] Video buffer padding In-Reply-To: References: Message-ID: <8824AAED239A0A48AE135277DC2B79B43EF5DA3902@EXCHANGE1.ad.nottingham.ac.uk> Hi Tim, You should set aside enough buffer space to hold your data AND the extra padding to it and ensure that the extra padding is set to zero. Something like this would suffice :- If you have copied the incoming data to your buffer, e.g memcpy(mPkt->data, data, dataSize); Then you should pad it thus - memset(mPkt->data + mPkt->size, 0, FF_INPUT_BUFFER_PADDING_SIZE); Or something similar depending on how you copy your incoming data to your own buffer, just ensure that the size of your buffer is big enough to hold your incoming data as well as the padding. Cheers, Tony. This message and any attachment are intended solely for the addressee and may contain confidential information. If you have received this message in error, please send it back to me, and immediately delete it. Please do not use, copy or disclose the information contained in this message or in any attachment. Any views or opinions expressed by the author of this email do not necessarily reflect the views of the University of Nottingham. This message has been checked for viruses but the contents of an attachment may still contain software viruses which could damage your computer system: you are advised to perform your own checks. Email communications with the University of Nottingham may be monitored as permitted by UK legislation. From ian at yospace.com Wed Oct 24 13:24:57 2012 From: ian at yospace.com (Ian Holbrough) Date: Wed, 24 Oct 2012 12:24:57 +0100 Subject: [Libav-user] audio filter chain clicks In-Reply-To: <50867CF8.4040205@yospace.com> References: <50867CF8.4040205@yospace.com> Message-ID: <5087D009.6020704@yospace.com> Found it, of course the problem is memory management. It would seem that avfilter_copy_buf_props reuses the buffer, allocating it to the target frame rather than copying it. Unfortunately if you then call avfilter_unref_buffer before encoding frame the front of the buffer gets trampled on, introducing the clicks. Ian On 10/23/12 12:18, Ian Holbrough wrote: > Hi, > > I'm in the process of migrating to libavfilter based resampling using > ffmpeg/libav 1.0 and the audio filter chain seems to be introducing > audio clicks. Setting up a passthrough chain with... > > AVFilterContext* last = NULL; > filterAudGraph = avfilter_graph_alloc(); > > char args[255]; > snprintf(args, 255, > "time_base=%d/%d:sample_rate=%d:sample_fmt=%s:channel_layout=0x%llx", > 1, inpAudioCodec->sample_rate, inpAudioCodec->sample_rate, > av_get_sample_fmt_name(inpAudioCodec->sample_fmt), > inpAudioCodec->channel_layout); > > filterAudInp = tsUtilsInitFilter("abuffer", "audInput", args, > NULL, filterAudGraph); > last = filterAudInp; > > const enum AVSampleFormat formats[] = { AV_SAMPLE_FMT_S16, -1 }; > AVABufferSinkParams* params = av_abuffersink_params_alloc(); > params->sample_fmts = formats; > > filterAudOut = tsUtilsInitFilter("ffabuffersink", "audOutput", > NULL, params, filterAudGraph); > av_free(params); > > avfilter_link(last, 0, filterAudOut, 0); > > avfilter_graph_config(filterAudGraph, NULL); > > ...where... > > AVFilterContext* tsUtilsInitFilter(const char * filterName, const > char* name, > const char* arguments, void* opaque, AVFilterGraph* graph) { > > AVFilter* filter = avfilter_get_by_name(filterName); > > AVFilterContext* context = NULL; > int ret = avfilter_graph_create_filter(&context, filter, name, > arguments, opaque, graph); > if (ret < 0) { > die("tsUtilsInitFilter - failed to create filter context > <%s>", name); > } > > return context; > > } > > ...however, when a frame is added (I believe the input sample format, > rate and channel layout is compatible with the required output) who's > first few samples look like this... > > 00000000 00000000 00000000 00000000 00000000 00000000 00000000 > 00000000 00000000 00000000 00000000 00000000 00000000 00000000 > 00000000 00000000 > 00000000 00000000 00000000 00000000 00000000 00000000 00000000 > 00000000 ffffffff 00000000 00000000 00000000 00000000 00000000 > 00000000 00000000 > 00000000 00000000 00000000 00000000 00000000 00000000 00000000 > 00000000 00000001 00000000 00000001 00000000 00000000 00000000 > 00000000 00000000 > 00000000 00000000 00000000 00000000 00000000 00000000 00000000 > 00000000 00000000 00000000 00000000 00000000 00000000 00000000 > ffffffff 00000000 > ffffffff 00000000 00000000 00000000 00000000 00000000 00000000 > 00000000 00000000 00000000 00000000 00000000 00000000 00000000 > 00000000 00000000 > 00000000 00000000 00000000 00000000 00000000 00000000 00000000 > 00000000 00000000 00000000 00000000 00000000 00000000 00000000 > 00000000 00000000 > > ...upon retrieving the same frame from the chain the first 4 samples > look somewhat different... > > *000063f0 ffffb628 00002ff8 000008d9* 00000000 00000000 00000000 > 00000000 00000000 00000000 00000000 00000000 00000000 00000000 > 00000000 00000000 > 00000000 00000000 00000000 00000000 00000000 00000000 00000000 > 00000000 ffffffff 00000000 00000000 00000000 00000000 00000000 > 00000000 00000000 > 00000000 00000000 00000000 00000000 00000000 00000000 00000000 > 00000000 00000001 00000000 00000001 00000000 00000000 00000000 > 00000000 00000000 > 00000000 00000000 00000000 00000000 00000000 00000000 00000000 > 00000000 00000000 00000000 00000000 00000000 00000000 00000000 > ffffffff 00000000 > ffffffff 00000000 00000000 00000000 00000000 00000000 00000000 > 00000000 00000000 00000000 00000000 00000000 00000000 00000000 > 00000000 00000000 > 00000000 00000000 00000000 00000000 00000000 00000000 00000000 > 00000000 00000000 00000000 00000000 00000000 00000000 00000000 > 00000000 00000000 > > ...the remainder of the frame is identical. These sample dumps are > produced by... > > short* a = frame->data[0]; > for (int i = 0; i != frame->nb_samples; i++) { > printf("%08x ", *(a++)); > if ((i % 16) == 15) printf("\n"); > } > > ....removing the filter chain and passing the decoded frames straight > through to the encoder does not produce clicking. Any suggestions as > to the cause would be gratefully received. > > > Regards > > Ian -- Ian Holbrough, Software Engineer Yospace - Mobile Video Made Easy Centurion House, London Road, Staines TW18 4AX Switchboard: +44 (0)1784 466388 Fax: +44 (0)1784 466387 http://www.yospace.com This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. Any unauthorised dissemination or copying of this email or its attachments, and any use or disclosure of any information contained in them, is strictly prohibited and may be illegal. If you have received the email in error please notify contracts at yospace.com and delete it from your system. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dhenry at movenetworks.com Wed Oct 24 19:31:29 2012 From: dhenry at movenetworks.com (David Henry) Date: Wed, 24 Oct 2012 11:31:29 -0600 Subject: [Libav-user] IGMPv3 source-specific multicast: what is the purpose of multiple sources? Message-ID: <62E9C7E658EC5A4BB68AB867D3A22FB501C39D43892A@slcexchsrv04.movenetworks.com> While using the relatively new feature of source-specific multicast (patched with http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=75d339e044f9b87dd9aa4bdaee73b1a8323d4a15) I tried giving 2 sources, instead of a single source. e.g. udp://eth1 at 239.19.5.189:3100?sources=172.31.1.21,172.31.2.21 I assumed (incorrectly) that the linux kernel would fail-over to the 2nd source if there was an interruption or some other error with the first source. Instead, I'm just getting packets from both sources simultaneously, which is not useful for me. So the question is: 1) for streaming video, why would one want this sort of behavior? (packets delivered simultaneously from >1 source) 2) is there any way to dynamically implement fail-over at the receiver with ffmpeg & source-specific multicast? Thanks, David From andrewk at vbrick.com Wed Oct 24 20:28:56 2012 From: andrewk at vbrick.com (Andrew Krupiczka) Date: Wed, 24 Oct 2012 18:28:56 +0000 Subject: [Libav-user] IGMPv3 source-specific multicast: what is the purpose of multiple sources? In-Reply-To: <62E9C7E658EC5A4BB68AB867D3A22FB501C39D43892A@slcexchsrv04.movenetworks.com> References: <62E9C7E658EC5A4BB68AB867D3A22FB501C39D43892A@slcexchsrv04.movenetworks.com> Message-ID: <14DEDC03E591D14DAC395C318D9783B40126C0FA@EX2K10MB2.vb.loc> You probably recognize that for IPv4 SSM your multicast must use a destination address like 232.x.y.z Per RFC4607 The benefits of source-specific multicast include: Elimination of cross-delivery of traffic when two sources simultaneously use the same source-specific destination address. The simultaneous use of an SSM destination address by multiple sources and different applications is explicitly supported. Avoidance of the need for inter-host coordination when choosing source-specific addresses, as a consequence of the above. Avoidance of many of the router protocols and algorithms that are needed to provide the ASM service model. Also: SSM is particularly well-suited to dissemination-style applications with one or more senders whose identities are known before the application begins. For instance, a data dissemination application that desires to provide a secondary data source in case the primary source fails over might implement this by using one channel for each source and advertising both of them to receivers. Regards, Andrew -----Original Message----- From: libav-user-bounces at ffmpeg.org [mailto:libav-user-bounces at ffmpeg.org] On Behalf Of David Henry Sent: Wednesday, October 24, 2012 1:31 PM To: libav-user at ffmpeg.org Subject: [Libav-user] IGMPv3 source-specific multicast: what is the purpose of multiple sources? While using the relatively new feature of source-specific multicast (patched with http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=75d339e044f9b87dd9aa4bdaee73b1a8323d4a15) I tried giving 2 sources, instead of a single source. e.g. udp://eth1 at 239.19.5.189:3100?sources=172.31.1.21,172.31.2.21 I assumed (incorrectly) that the linux kernel would fail-over to the 2nd source if there was an interruption or some other error with the first source. Instead, I'm just getting packets from both sources simultaneously, which is not useful for me. So the question is: 1) for streaming video, why would one want this sort of behavior? (packets delivered simultaneously from >1 source) 2) is there any way to dynamically implement fail-over at the receiver with ffmpeg & source-specific multicast? Thanks, David _______________________________________________ Libav-user mailing list Libav-user at ffmpeg.org http://ffmpeg.org/mailman/listinfo/libav-user From info at denisgottardello.it Wed Oct 24 22:46:49 2012 From: info at denisgottardello.it (Denis) Date: Wed, 24 Oct 2012 22:46:49 +0200 Subject: [Libav-user] muxing.c example In-Reply-To: <20121023202610.GT13824@arborea> References: <201210222130.08979.info@denisgottardello.it> <20121023202610.GT13824@arborea> Message-ID: <201210242246.49615.info@denisgottardello.it> In data marted? 23 ottobre 2012 22:26:10, Stefano Sabatini ha scritto: > > Does muxing.c work well? > > I tried: > > a.mpg > > a.avi > > a.mpeg > > a.ogg > > but nothing. > > Can't reproduce here. ffmpeg 1.0 works well. -- www.denisgottardello.it Skype: mrdebug Videosurveillance and home automation! http://www.denisgottardello.it/DomusBoss/DomusBossIndice.php From tapitman11 at gmail.com Thu Oct 25 00:07:41 2012 From: tapitman11 at gmail.com (Tim Pitman) Date: Wed, 24 Oct 2012 15:07:41 -0700 Subject: [Libav-user] Video buffer padding In-Reply-To: <8824AAED239A0A48AE135277DC2B79B43EF5DA3902@EXCHANGE1.ad.nottingham.ac.uk> References: <8824AAED239A0A48AE135277DC2B79B43EF5DA3902@EXCHANGE1.ad.nottingham.ac.uk> Message-ID: Thanks Tony On Wed, Oct 24, 2012 at 2:53 AM, Tony Glover wrote: > Hi Tim, > You should set aside enough buffer space to hold your data AND the extra padding to it and ensure that the extra padding is set to zero. Something like this would suffice :- > > If you have copied the incoming data to your buffer, e.g memcpy(mPkt->data, data, dataSize); > Then you should pad it thus - memset(mPkt->data + mPkt->size, 0, FF_INPUT_BUFFER_PADDING_SIZE); > > Or something similar depending on how you copy your incoming data to your own buffer, just ensure that the size of your buffer is big enough to hold your incoming data as well as the padding. > > Cheers, > > Tony. > > This message and any attachment are intended solely for the addressee and may contain confidential information. If you have received this message in error, please send it back to me, and immediately delete it. Please do not use, copy or disclose the information contained in this message or in any attachment. Any views or opinions expressed by the author of this email do not necessarily reflect the views of the University of Nottingham. > > This message has been checked for viruses but the contents of an attachment > may still contain software viruses which could damage your computer system: > you are advised to perform your own checks. Email communications with the > University of Nottingham may be monitored as permitted by UK legislation. > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user From tapitman11 at gmail.com Thu Oct 25 00:14:53 2012 From: tapitman11 at gmail.com (Tim Pitman) Date: Wed, 24 Oct 2012 15:14:53 -0700 Subject: [Libav-user] Best way to provide avcodec_decode_video2 with h264 data? In-Reply-To: <8824AAED239A0A48AE135277DC2B79B43EF5DA38FC@EXCHANGE1.ad.nottingham.ac.uk> References: <8824AAED239A0A48AE135277DC2B79B43EF5DA38FC@EXCHANGE1.ad.nottingham.ac.uk> Message-ID: Yeah I finally got the decoder working on a frame to frame basis and got rid of the constant errors, at least as long as the stream is good. I'm confused what you mean by "The encoder expects NAL units". I'm piping raw video data (via ffmpeg using yuv4mpegpipe format) into x264 which seems to work. Two questions for you? 1) Is live555 suitable for lossy physical layer transmissions or only for situations with a working UDP or TCP network? 2) Sometimes the video gets so corrupted over the wireless channel that the decoder seems to get stuck printing a constant series of errors and doesn't recover, even if the channel improves. Do you know of a way to restart or flush the decoder some way, or another way to get around this? Thanks, Tim On Wed, Oct 24, 2012 at 2:46 AM, Tony Glover wrote: > Hi Tim, > I've also been using intra-refresh to stream h264 video. The encoder expects NAL units and, after encoding, the data is streamed in packets. Your frame may or may not fit your encoded frame into a single packet, depending on its size. At the receiving end, you should wait until you receive all the data corresponding to a frame which you can then send to your decoder. > > I use x264 to do the encoding, live555 to do the streaming and ffmpeg to do the decoding. There are a lot of examples in the live555 codebase so you shouldn't have a problem in seeing an example of what you are intending to do. > > Hope this helps, > > Tony. > > This message and any attachment are intended solely for the addressee and may contain confidential information. If you have received this message in error, please send it back to me, and immediately delete it. Please do not use, copy or disclose the information contained in this message or in any attachment. Any views or opinions expressed by the author of this email do not necessarily reflect the views of the University of Nottingham. > > This message has been checked for viruses but the contents of an attachment > may still contain software viruses which could damage your computer system: > you are advised to perform your own checks. Email communications with the > University of Nottingham may be monitored as permitted by UK legislation. > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user From cehoyos at ag.or.at Thu Oct 25 01:23:27 2012 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Wed, 24 Oct 2012 23:23:27 +0000 (UTC) Subject: [Libav-user] Video buffer padding References: <8824AAED239A0A48AE135277DC2B79B43EF5DA3902@EXCHANGE1.ad.nottingham.ac.uk> Message-ID: Tony Glover writes: > You should set aside enough buffer space to hold > your data AND the extra padding to it and ensure that > the extra padding is set to zero. Something like this > would suffice :- > > If you have copied the incoming data to your buffer, > e.g memcpy(mPkt->data, data, dataSize); > Then you should pad it thus - memset(mPkt->data + > mPkt->size, 0, FF_INPUT_BUFFER_PADDING_SIZE); I don't think this is correct / accurate. The point of the padding is not that you add 0's to the pkt->size number of bytes of your input data, but that you make sure that the buffer that contains the number of bytes is FF_INPUT_BUFFER_PADDING_SIZE larger than pkt->size (ie was allocated with at least pkt->size + FF_INPUT_BUFFER_PADDING_SIZE). Please do not top-post here, Carl Eugen From tapitman11 at gmail.com Thu Oct 25 01:58:36 2012 From: tapitman11 at gmail.com (Tim Pitman) Date: Wed, 24 Oct 2012 16:58:36 -0700 Subject: [Libav-user] Repeating frames Message-ID: I'm using avcodec_decode_video2() to decode h264 frames encoded by x264 one frame at a time. The stream is being transmitted over a lossy physical layer wireless channel prior to decoding. I'm trying to implement logic to re-display the last good picture if the current picture fails to decode for whatever reason. The logic I tried was to simply memcpy(lastGoodFrame, currFrame, sizeof(AVFrame)) each time got_picture_ptr is true and if got_picture_ptr is false then I display lastGoodFrame instead of currFrame. However, I'm getting unexpected behavior and blocking patterns. I suspect that this is due to libav doing interframe prediction decoding. Is this the case? Is there a way to do what I'm trying to accomplish? From cehoyos at ag.or.at Thu Oct 25 02:30:39 2012 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Thu, 25 Oct 2012 00:30:39 +0000 (UTC) Subject: [Libav-user] Repeating frames References: Message-ID: Tim Pitman writes: > Is there a way to do what I'm trying to accomplish? If you believe that FFmpeg's error concealment is not optimal (it isn't for h264), you should try to improve it, not work-around it. And without knowing the theory, I am quite sure that repeating the previous picture should in nearly all cases multiply the effect of a broken macroblock (that may not be visible) into something that is very, very visible if the image contains any motion. Carl Eugen From bputrycz at gmail.com Thu Oct 25 10:58:38 2012 From: bputrycz at gmail.com (Bartosz Putrycz) Date: Thu, 25 Oct 2012 10:58:38 +0200 Subject: [Libav-user] multiple flushes, extended_data is not set, streamable mp4 Message-ID: <5088FF3E.9070202@gmail.com> Hi, I have a few questions. It would be a little difficult to provide a short piece of example of my code, so, some initial data: I am trying to use ffmpeg libraries to encode/mux to a few formats, but for questions 1-2 below, it is enough to say it is mp3 (libmp3lame). I use my own non-seekable AVIO. Version of ffmpeg: 0.11.1. 1) It happens that when samples are finished, I have to "flush" (by sending an empty frame to avcodec_encode_audio2() ) _more than once_. I am doing it a few times until I don't get return packet. Is it a standard behaviour or am I doing something wrong? 2) Looking into avcodec.h it says that AVFrame.extended_data is unused in encoding. But without touching it, I am getting a lot of annoying warnings "extended_data is not set". Could I / Should I handle it with something like: frame->extended_data = frame->data; ? 3) About: mp4 does not support not seakable output. Here is some discussion: http://ffmpeg.org/pipermail/ffmpeg-user/2012-September/009963.html The workaround is something implemented only in ffmpeg, or is it a feature specified in standard? Is here an another thread or some site with more explanation of this issue? Is somewhere an example of code with implementation of fragmentation and/or streaming of mp4 using libav libraries. Bartosz From T.Glover at nottingham.ac.uk Thu Oct 25 11:28:00 2012 From: T.Glover at nottingham.ac.uk (Tony Glover) Date: Thu, 25 Oct 2012 10:28:00 +0100 Subject: [Libav-user] Video buffer padding In-Reply-To: References: <8824AAED239A0A48AE135277DC2B79B43EF5DA3902@EXCHANGE1.ad.nottingham.ac.uk> Message-ID: <8824AAED239A0A48AE135277DC2B79B43EF5DA3B37@EXCHANGE1.ad.nottingham.ac.uk> Hi, The point is to have the padding as you say, but it certainly doesn't do any harm to fill the extra padding with something sensible, even if it will ultimately get written over, it certainly hasn't done any harm in my code - note I'm only zero'ing out the padded data, not anything else. Cheers, Tony. This message and any attachment are intended solely for the addressee and may contain confidential information. If you have received this message in error, please send it back to me, and immediately delete it. Please do not use, copy or disclose the information contained in this message or in any attachment. Any views or opinions expressed by the author of this email do not necessarily reflect the views of the University of Nottingham. This message has been checked for viruses but the contents of an attachment may still contain software viruses which could damage your computer system: you are advised to perform your own checks. Email communications with the University of Nottingham may be monitored as permitted by UK legislation. From T.Glover at nottingham.ac.uk Thu Oct 25 11:43:51 2012 From: T.Glover at nottingham.ac.uk (Tony Glover) Date: Thu, 25 Oct 2012 10:43:51 +0100 Subject: [Libav-user] Best way to provide avcodec_decode_video2 with h264 data? In-Reply-To: References: <8824AAED239A0A48AE135277DC2B79B43EF5DA38FC@EXCHANGE1.ad.nottingham.ac.uk> Message-ID: <8824AAED239A0A48AE135277DC2B79B43EF5DA3B49@EXCHANGE1.ad.nottingham.ac.uk> Hi Tim, Feeding raw video data into the decoder is fine, I was referring to live555's video framer (that is ultimately responsible for sending the data) that expects NAL units. Live555 is good for streaming in a vast majority of cases, software such as VLC player uses live555. You're always at the mercy of networks and they will drop packets over UDP, there is nothing you can do if the data is ultimately lost. What you can do is compensate for it as best you can. Ensure that the packets are sent to the decoder in the correct order - so if you receive a packet out of order you can wait for a small specified time for the correct one to arrive. If packets get dropped then so be it - just send the next one to the decoder. I have had very similar issues to yourself - we installed some software at a customer site and their network was pretty terrible, installing the latest version of ffmpeg is always a good idea and helped me. The decoder should recover from a series of errors, if not then you need to look at your data to see just exactly how much data you are losing and if it really is that bad then it's a symptom of your network and not your software. I would also look at bitrates and framerates. The x264 encoder can specify a maximum bitrate and tolerance so that you aren't hogging all the bandwidth. Ensure that your camera captures frames at the lowest, but still acceptable, rate. Even apps such as skype struggle when the network is poor. Cheers, Tony. This message and any attachment are intended solely for the addressee and may contain confidential information. If you have received this message in error, please send it back to me, and immediately delete it. Please do not use, copy or disclose the information contained in this message or in any attachment. Any views or opinions expressed by the author of this email do not necessarily reflect the views of the University of Nottingham. This message has been checked for viruses but the contents of an attachment may still contain software viruses which could damage your computer system: you are advised to perform your own checks. Email communications with the University of Nottingham may be monitored as permitted by UK legislation. From T.Glover at nottingham.ac.uk Thu Oct 25 11:50:56 2012 From: T.Glover at nottingham.ac.uk (Tony Glover) Date: Thu, 25 Oct 2012 10:50:56 +0100 Subject: [Libav-user] Repeating frames In-Reply-To: References: Message-ID: <8824AAED239A0A48AE135277DC2B79B43EF5DA3B5A@EXCHANGE1.ad.nottingham.ac.uk> I'm using avcodec_decode_video2() to decode h264 frames encoded by x264 one frame at a time. The stream is being transmitted over a lossy physical layer wireless channel prior to decoding. I'm trying to implement logic to re-display the last good picture if the current picture fails to decode for whatever reason. The logic I tried was to simply memcpy(lastGoodFrame, currFrame, sizeof(AVFrame)) each time got_picture_ptr is true and if got_picture_ptr is false then I display lastGoodFrame instead of currFrame. However, I'm getting unexpected behavior and blocking patterns. I suspect that this is due to libav doing interframe prediction decoding. Is this the case? Is there a way to do what I'm trying to accomplish? _______________________________________________ Hi Tim, Re-displaying the last picture is probably not what you want to do - at best your stream will appear frozen with the last good image while the successive ones are not displayed, and then jump about when correctly decoded images arrive. I would ascertain just how much data is being lost and where it happens, if you can, and potentially follow some of the options I previously posted. Try your software over your own internal network, i.e. plug all the computers into their own switch/router. This will then give you an idea if there are inherent issues with your software, or the network really is a factor, or your software is not coping too well with a lossy network, or indeed something else. Good luck with it! Cheers, Tony. This message and any attachment are intended solely for the addressee and may contain confidential information. If you have received this message in error, please send it back to me, and immediately delete it. Please do not use, copy or disclose the information contained in this message or in any attachment. Any views or opinions expressed by the author of this email do not necessarily reflect the views of the University of Nottingham. This message has been checked for viruses but the contents of an attachment may still contain software viruses which could damage your computer system: you are advised to perform your own checks. Email communications with the University of Nottingham may be monitored as permitted by UK legislation. From zhou.wenpeng at rdnet.fi Thu Oct 25 13:37:14 2012 From: zhou.wenpeng at rdnet.fi (Wenpeng Zhou) Date: Thu, 25 Oct 2012 14:37:14 +0300 Subject: [Libav-user] fatal error C1083: Cannot open include file: 'inttypes.h': No such file or directory Message-ID: <00e601cdb2a5$16b28a80$44179f80$@rdnet.fi> Hi, I tried to compile one simple ffmpeg C++ example with VC++ 2010 But the error is: fatal error C1083: Cannot open include file: 'inttypes.h': No such file or directory #include int main (int argc, char **argv) { av_register_all(); return 0; } Where can we find the header file inttypes.h for VC++ 2010? Thanks! -------------- next part -------------- An HTML attachment was scrubbed... URL: From cbhattac at adobe.com Thu Oct 25 14:10:36 2012 From: cbhattac at adobe.com (Chandranath Bhattacharyya) Date: Thu, 25 Oct 2012 17:40:36 +0530 Subject: [Libav-user] fatal error C1083: Cannot open include file: 'inttypes.h': No such file or directory In-Reply-To: <00e601cdb2a5$16b28a80$44179f80$@rdnet.fi> References: <00e601cdb2a5$16b28a80$44179f80$@rdnet.fi> Message-ID: <5DA090DC8DCD3549BE9DF08C5074509E01606E95E4@indiambx01.corp.adobe.com> > Where can we find the header file inttypes.h for VC++ 2010? You can try this link: http://code.google.com/p/msinttypes/downloads/list Regards, Chandranath -------------- next part -------------- An HTML attachment was scrubbed... URL: From supretsonu99 at gmail.com Thu Oct 25 15:59:19 2012 From: supretsonu99 at gmail.com (sujith sudhakaran) Date: Thu, 25 Oct 2012 19:29:19 +0530 Subject: [Libav-user] How to implement seek functionality Message-ID: Hi All, I wanted to get some brief idea about the how could be "Seek functionality" be implemented for ffserver. Any help would be highly appreciated. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mbradshaw at sorensonmedia.com Thu Oct 25 22:02:49 2012 From: mbradshaw at sorensonmedia.com (Michael Bradshaw) Date: Thu, 25 Oct 2012 14:02:49 -0600 Subject: [Libav-user] Seeking causes the demuxer to skip some packets (after the seek)... why? Bug? Message-ID: I have a weird issue that I'm trying to figure out, and I'm not sure if I'm doing something wrong or if it's a bug in FFmpeg's code, and I'm hoping someone can help me determine which. If I demux a file by simply repeatedly calling av_read_frame(), I get the same output packets as ffprobe -show_packets[1]. However, if I seek using av_seek_frame() to go back to the very beginning, and then start demuxing with av_read_frame(), I get the same output audio packets as before, but for some reason it skips the first two video packets (video packets with timesamps (pts=0, dts=-6006) and (pts=3003, dts=-3003)). This throws off the decoder and I end up missing the first few seconds of video because of this. This happens when I specify a stream_index of 1 (the audio stream, which I do since its packets are first in the file) or -1 (default stream) (-1 only fails for certain timestamps, namely very large negative timestamps), but not when I call it with a stream_index of 0 (the video stream). I get the same results if using avformat_seek_file() too. What is the result of calling av_seek_frame() on the other streams? That is, if I call av_seek_frame() with a stream_index of 1, how are the other streams affected? The documentation is lacking, and it's possible I've assumed wrong. Is this possibly a bug? Or is this kind of behavior acceptable (you might argue my stream_index wasn't the video stream, so exactly where it is not specified, in which case I'd argue the documentation certainly should warn of that)? I've never had the demuxer skip packets... It starts reading packets from the beginning just fine, but for some reason skips two video packets. I've also included [1] Here is the output of ffprobe -show_packets (I've cut the trailing packets that aren't relevant): ffprobe version N-45279-g1a104bf Copyright (c) 2007-2012 the FFmpeg developers built on Oct 10 2012 19:19:16 with gcc 4.7.2 (GCC) configuration: --enable-gpl --enable-version3 --disable-pthreads --enable-runtime-cpudetect --enable-avisynth --enable-bzlib --enable-frei0r --enable-libass --enable-libcelt --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libfreetype --enable-libgsm --enable-libmp3lame --enable-libnut --enable-libopenjpeg --enable-librtmp --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libutvideo --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxavs --enable-libxvid --enable-zlib libavutil 51. 74.100 / 51. 74.100 libavcodec 54. 65.100 / 54. 65.100 libavformat 54. 31.100 / 54. 31.100 libavdevice 54. 3.100 / 54. 3.100 libavfilter 3. 19.102 / 3. 19.102 libswscale 2. 1.101 / 2. 1.101 libswresample 0. 16.100 / 0. 16.100 libpostproc 52. 1.100 / 52. 1.100 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'SIMPSONS_D2-CallOfTheSimpsons.m4v': Metadata: major_brand : mp42 minor_version : 0 compatible_brands: mp42isomavc1 encoder : HandBrake 0.9.5 2011010300 Duration: 00:23:06.51, start: 0.000000, bitrate: 1944 kb/s Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 720x480 [SAR 118:135 DAR 59:45], 1774 kb/s, 25.50 fps, 29.97 tbr, 90k tbn, 180k tbc Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, s16, 164 kb/s Stream #0:2(und): Subtitle: mov_text (text / 0x74786574) [PACKET] codec_type=audio stream_index=1 pts=0 pts_time=0.000000 dts=0 dts_time=0.000000 duration=1024 duration_time=0.021333 convergence_duration=N/A convergence_duration_time=N/A size=6 pos=168 flags=K [/PACKET] [PACKET] codec_type=audio stream_index=1 pts=1024 pts_time=0.021333 dts=1024 dts_time=0.021333 duration=1024 duration_time=0.021333 convergence_duration=N/A convergence_duration_time=N/A size=21 pos=174 flags=K [/PACKET] [PACKET] codec_type=audio stream_index=1 pts=2048 pts_time=0.042667 dts=2048 dts_time=0.042667 duration=1024 duration_time=0.021333 convergence_duration=N/A convergence_duration_time=N/A size=10 pos=195 flags=K [/PACKET] [PACKET] codec_type=audio stream_index=1 pts=3072 pts_time=0.064000 dts=3072 dts_time=0.064000 duration=1024 duration_time=0.021333 convergence_duration=N/A convergence_duration_time=N/A size=10 pos=205 flags=K [/PACKET] [PACKET] codec_type=audio stream_index=1 pts=4096 pts_time=0.085333 dts=4096 dts_time=0.085333 duration=1024 duration_time=0.021333 convergence_duration=N/A convergence_duration_time=N/A size=10 pos=215 flags=K [/PACKET] [PACKET] codec_type=audio stream_index=1 pts=5120 pts_time=0.106667 dts=5120 dts_time=0.106667 duration=1024 duration_time=0.021333 convergence_duration=N/A convergence_duration_time=N/A size=10 pos=225 flags=K [/PACKET] [PACKET] codec_type=audio stream_index=1 pts=6144 pts_time=0.128000 dts=6144 dts_time=0.128000 duration=1024 duration_time=0.021333 convergence_duration=N/A convergence_duration_time=N/A size=10 pos=235 flags=K [/PACKET] [PACKET] codec_type=video stream_index=0 pts=0 pts_time=0.000000 dts=-6006 dts_time=-0.066733 duration=N/A duration_time=N/A convergence_duration=N/A convergence_duration_time=N/A size=36509 pos=245 flags=K [/PACKET] [PACKET] codec_type=video stream_index=0 pts=3003 pts_time=0.033367 dts=-3003 dts_time=-0.033367 duration=N/A duration_time=N/A convergence_duration=N/A convergence_duration_time=N/A size=35 pos=36754 flags=_ [/PACKET] [PACKET] codec_type=video stream_index=0 pts=9009 pts_time=0.100100 dts=0 dts_time=0.000000 duration=N/A duration_time=N/A convergence_duration=N/A convergence_duration_time=N/A size=32245 pos=36789 flags=_ [/PACKET] From mbradshaw at sorensonmedia.com Thu Oct 25 22:10:19 2012 From: mbradshaw at sorensonmedia.com (Michael Bradshaw) Date: Thu, 25 Oct 2012 14:10:19 -0600 Subject: [Libav-user] Seeking causes the demuxer to skip some packets (after the seek)... why? Bug? In-Reply-To: References: Message-ID: On Thu, Oct 25, 2012 at 2:02 PM, Michael Bradshaw < mbradshaw at sorensonmedia.com> wrote: > I've also included Sorry, I meant to say that should you be interested, the source video file can be found at: https://docs.google.com/uc?export=download&id=0BxWx_dIBnyRoSnMyTFNGOHR1c2c The source I'm using, should you also be interested, is (remove the 'extern "C"' part to compile as C): #include extern "C" { #include #include #include } int main(int argc, char** argv) { AVFrame* frame; AVFormatContext* formatContext; AVStream* videoStream; AVCodecContext* codecContext; AVPacket packet; int frameFinished; int result; av_register_all(); frame = avcodec_alloc_frame(); if (!frame) { printf("Error allocating the frame\n"); return 1; } formatContext = NULL; if (avformat_open_input(&formatContext, "C:/Users/mbradshaw/Desktop/b/c/SIMPSONS_D2-CallOfTheSimpsons.m4v", NULL, NULL) != 0) { av_free(frame); printf("Error opening the file\n"); return 1; } if (avformat_find_stream_info(formatContext, NULL) < 0) { av_free(frame); avformat_close_input(&formatContext); printf("Error finding the stream info\n"); return 1; } videoStream = NULL; for (unsigned int i = 0; i < formatContext->nb_streams; ++i) { if (formatContext->streams[i]->codec->codec_type == AVMEDIA_TYPE_VIDEO) { videoStream = formatContext->streams[i]; break; } } if (videoStream == NULL) { av_free(frame); avformat_close_input(&formatContext); printf("Could not find any video stream in the file\n"); return 1; } codecContext = videoStream->codec; codecContext->codec = avcodec_find_decoder(codecContext->codec_id); if (codecContext->codec == NULL) { av_free(frame); avformat_close_input(&formatContext); printf("Couldn't find a proper decoder\n"); return 1; } else if (avcodec_open2(codecContext, codecContext->codec, NULL) != 0) { av_free(frame); avformat_close_input(&formatContext); printf("Couldn't open the context with the decoder\n"); return 1; } av_init_packet(&packet); while (av_read_frame(formatContext, &packet) == 0) { if (packet.stream_index == videoStream->index) { printf("packet.dts = %d\n", packet.dts); frameFinished = 0; result = avcodec_decode_video2(codecContext, frame, &frameFinished, &packet); if (result >= 0 && frameFinished) { break; av_free_packet(&packet); } } av_free_packet(&packet); } avcodec_flush_buffers(codecContext); printf("seek result: %d\n", av_seek_frame(formatContext, 1, -2000000000, AVSEEK_FLAG_BACKWARD | AVSEEK_FLAG_ANY)); while (av_read_frame(formatContext, &packet) == 0) { if (packet.stream_index == videoStream->index) { printf("packet.dts = %d\n", packet.dts); frameFinished = 0; result = avcodec_decode_video2(codecContext, frame, &frameFinished, &packet); if (result >= 0 && frameFinished) { break; av_free_packet(&packet); } } av_free_packet(&packet); } av_free(frame); avcodec_close(codecContext); avformat_close_input(&formatContext); return 0; } -------------- next part -------------- An HTML attachment was scrubbed... URL: From ryaowe at gmail.com Thu Oct 25 19:59:31 2012 From: ryaowe at gmail.com (Ryan Owen) Date: Thu, 25 Oct 2012 11:59:31 -0600 Subject: [Libav-user] How to enable chapter info Message-ID: I recently updated my libav* libraries to the latest from git (revisoin d8245c3bcdd162891825a52cf55e4e8173d85a18) in order to take advantage of new features/bug fixes. Since updating, I'm no longer able to get chapter information from m4v or mov files. Everything else continues to work as expected, but my AVFormatContext's nb_chapters is always 0. Is there something I need to do to enable parsing of chapter information? The same behavior can be observed from the ffmpeg command: With current revision (d8245c3bcdd162891825a52cf55e4e8173d85a18): ./ffmpeg -i chapters.m4v ffmpeg version N-46017-gd8245c3 Copyright (c) 2000-2012 the FFmpeg developers built on Oct 25 2012 11:30:53 with llvm-gcc 4.2.1 (LLVM build 2336.11.00) configuration: --enable-shared --disable-static --enable-memalign-hack --disable-outdevs --disable-ffplay --enable-pic --enable-debug=3 --disable-optimizations --disable-mmx --disable-stripping --enable-debug libavutil 52. 0.100 / 52. 0.100 libavcodec 54. 69.100 / 54. 69.100 libavformat 54. 34.100 / 54. 34.100 libavdevice 54. 3.100 / 54. 3.100 libavfilter 3. 20.105 / 3. 20.105 libswscale 2. 1.101 / 2. 1.101 libswresample 0. 16.100 / 0. 16.100 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'chapters.m4v': Metadata: major_brand : mp42 minor_version : 0 compatible_brands: mp42isomavc1 creation_time : 2012-10-24 22:41:46 encoder : HandBrake 0.9.6 2012022800 Duration: 00:20:22.29, start: 0.000000, bitrate: 1982 kb/s Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 960x544, 1817 kb/s, 23.98 fps, 23.98 tbr, 90k tbn, 180k tbc Metadata: creation_time : 2012-10-24 22:41:46 Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, s16, 159 kb/s Metadata: creation_time : 2012-10-24 22:41:46 Stream #0:2(und): Subtitle: mov_text (text / 0x74786574) Metadata: creation_time : 2012-10-24 22:41:46 Note no chapters are listed. With my old revision (7028c9f42168e704db74e0fc37b0ba029ab127b4): ./ffmpeg -i chapters.m4v ffmpeg version N-36033-g7028c9f, Copyright (c) 2000-2011 the FFmpeg developers built on Jul 2 2012 17:47:29 with llvm_gcc 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.9.00) configuration: --enable-shared --disable-static --enable-memalign-hack --disable-outdevs --disable-ffplay --enable-pic libavutil 51. 32. 0 / 51. 32. 0 libavcodec 53. 46. 1 / 53. 46. 1 libavformat 53. 27. 0 / 53. 27. 0 libavdevice 53. 4. 0 / 53. 4. 0 libavfilter 2. 53. 0 / 2. 53. 0 libswscale 2. 1. 0 / 2. 1. 0 Seems stream 0 codec frame rate differs from container frame rate: 180000.00 (180000/1) -> 23.98 (24000/1001) Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'chapters.m4v': Metadata: major_brand : mp42 minor_version : 0 compatible_brands: mp42isomavc1 creation_time : 2012-10-24 22:41:46 encoder : HandBrake 0.9.6 2012022800 Duration: 00:20:22.29, start: 0.000000, bitrate: 1982 kb/s Chapter #0.0: start -0.083000, end 380.547000 Metadata: title : Chapter 1 Chapter #0.1: start 380.547000, end 735.360000 Metadata: title : Chapter 2 Chapter #0.2: start 735.360000, end 986.068000 Metadata: title : Chapter 3 Chapter #0.3: start 986.068000, end 1182.807000 Metadata: title : Chapter 4 Chapter #0.4: start 1182.807000, end 1222.262700 Metadata: title : Chapter 5 Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 960x544, 1817 kb/s, 23.98 fps, 23.98 tbr, 90k tbn, 180k tbc Metadata: creation_time : 2012-10-24 22:41:46 handler_name : Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, s16, 159 kb/s Metadata: creation_time : 2012-10-24 22:41:46 handler_name : Stream #0:2(und): Subtitle: mov_text (text / 0x74786574) Metadata: creation_time : 2012-10-24 22:41:46 handler_name : I tried searching the mailing lists, bug tracker, and revision history, but I couldn't find anything that seemed to address my question. My apologies if I'm missing something obvious. Thanks in advance for your help! -- Ryan -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2925 bytes Desc: not available URL: From nehaljw.kkd1 at gmail.com Thu Oct 25 10:31:42 2012 From: nehaljw.kkd1 at gmail.com (nehaljwani) Date: Thu, 25 Oct 2012 01:31:42 -0700 (PDT) Subject: [Libav-user] Using FFMpeg for Screen Capture In-Reply-To: References: Message-ID: <1351153902574-4655901.post@n4.nabble.com> Check this tutorial on how to use ffmpeg on windows for screen recording. -- View this message in context: http://libav-users.943685.n4.nabble.com/Using-FFMpeg-for-Screen-Capture-tp2303334p4655901.html Sent from the libav-users mailing list archive at Nabble.com. From steve.hart at rtsw.co.uk Fri Oct 26 12:23:46 2012 From: steve.hart at rtsw.co.uk (Steve Hart) Date: Fri, 26 Oct 2012 11:23:46 +0100 Subject: [Libav-user] Seeking causes the demuxer to skip some packets (after the seek)... why? Bug? In-Reply-To: References: Message-ID: On 25 October 2012 21:10, Michael Bradshaw wrote: > On Thu, Oct 25, 2012 at 2:02 PM, Michael Bradshaw < > mbradshaw at sorensonmedia.com> wrote: > > I've also included > > Sorry, I meant to say that should you be interested, the source video file > can be found at: > https://docs.google.com/uc?export=download&id=0BxWx_dIBnyRoSnMyTFNGOHR1c2c > > The source I'm using, should you also be interested, is (remove the > 'extern "C"' part to compile as C): > > #include > > extern "C" > { > #include > #include > #include > } > > int main(int argc, char** argv) > { > AVFrame* frame; > AVFormatContext* formatContext; > AVStream* videoStream; > AVCodecContext* codecContext; > AVPacket packet; > int frameFinished; > int result; > > av_register_all(); > > frame = avcodec_alloc_frame(); > if (!frame) > { > printf("Error allocating the frame\n"); > return 1; > } > > formatContext = NULL; > if (avformat_open_input(&formatContext, > "C:/Users/mbradshaw/Desktop/b/c/SIMPSONS_D2-CallOfTheSimpsons.m4v", NULL, > NULL) != 0) > { > av_free(frame); > printf("Error opening the file\n"); > return 1; > } > > if (avformat_find_stream_info(formatContext, NULL) < 0) > { > av_free(frame); > avformat_close_input(&formatContext); > printf("Error finding the stream info\n"); > return 1; > } > > videoStream = NULL; > for (unsigned int i = 0; i < formatContext->nb_streams; ++i) > { > if (formatContext->streams[i]->codec->codec_type == > AVMEDIA_TYPE_VIDEO) > { > videoStream = formatContext->streams[i]; > break; > } > } > > if (videoStream == NULL) > { > av_free(frame); > avformat_close_input(&formatContext); > printf("Could not find any video stream in the file\n"); > return 1; > } > > codecContext = videoStream->codec; > codecContext->codec = avcodec_find_decoder(codecContext->codec_id); > if (codecContext->codec == NULL) > { > av_free(frame); > avformat_close_input(&formatContext); > printf("Couldn't find a proper decoder\n"); > return 1; > } > else if (avcodec_open2(codecContext, codecContext->codec, NULL) != 0) > { > av_free(frame); > avformat_close_input(&formatContext); > printf("Couldn't open the context with the decoder\n"); > return 1; > } > > av_init_packet(&packet); > while (av_read_frame(formatContext, &packet) == 0) > { > if (packet.stream_index == videoStream->index) > { > printf("packet.dts = %d\n", packet.dts); > > frameFinished = 0; > result = avcodec_decode_video2(codecContext, frame, > &frameFinished, &packet); > > if (result >= 0 && frameFinished) > { > break; > av_free_packet(&packet); > } > } > > av_free_packet(&packet); > } > > avcodec_flush_buffers(codecContext); > printf("seek result: %d\n", > av_seek_frame(formatContext, 1, -2000000000, > AVSEEK_FLAG_BACKWARD | AVSEEK_FLAG_ANY)); > > while (av_read_frame(formatContext, &packet) == 0) > { > if (packet.stream_index == videoStream->index) > { > printf("packet.dts = %d\n", packet.dts); > > frameFinished = 0; > result = avcodec_decode_video2(codecContext, frame, > &frameFinished, &packet); > > if (result >= 0 && frameFinished) > { > break; > av_free_packet(&packet); > } > } > > av_free_packet(&packet); > } > > av_free(frame); > avcodec_close(codecContext); > avformat_close_input(&formatContext); > return 0; > } > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > > I too have seen this behaviour. If the timestamp is negative the seek ignores it and always starts at first 0/positive timestamp. This happens regardless of whether I use -1 or 1 I cannot check audio seeking in my case since I have no audio streams. I would be very interested to know why this is. Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: From mpupilli at gmail.com Sat Oct 27 16:06:02 2012 From: mpupilli at gmail.com (Mark Pupilli) Date: Sat, 27 Oct 2012 15:06:02 +0100 Subject: [Libav-user] How to use rawvideo conatiner format with mpeg4 Message-ID: I am having problems sending mpeg4 (FMP4) in the the rawvideo container format. I am setting up the muxer as follows: m_outputFormat = av_guess_format( "rawvideo", 0, 0 ); m_formatContext->oformat = m_outputFormat; // ... then later: int err = avio_open( &m_formatContext->pb, m_formatContext->filename, AVIO_FLAG_WRITE ); avformat_write_header( m_formatContext, 0 ); (I am using custom IO - which works for me when using avi as the container format). The problem appears when demuxing which I do as follows: AVInputFormat* inputFormat = av_find_input_format( "rawvideo" ); AVDictionary *options = 0; av_dict_set( &options, "video_size", "320x240", 0 ); av_dict_set( &options, "pixel_format", "yuv420p", 0 ); m_open = ( avformat_open_input( &m_formatContext, streamName, inputFormat, &options ) >= 0 ); av_dict_free(&options); if ( m_open == false ) { return; } int foundStreamInfo = avformat_find_stream_info( m_formatContext, 0 ); if ( foundStreamInfo == -1) { m_open = false; return; } This results in an incorrect detection of a rawvideo bytestream instead of mpeg4: [rawvideo @ 0x1303140] Estimating duration from bitrate, this may be inaccurate Input #0, rawvideo, from 'puppypc': Duration: N/A, start: 0.000000, bitrate: N/A Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 320x240, 25 tbr, 25 tbn, 25 tbc As you can see it has correctly determined the container format, but not the codec. Is there a dictionary option to force the codec to mpeg4? I tried "codec", and "video_codec", but I can't find where valid options are documented. thanks, Mark From cehoyos at ag.or.at Sat Oct 27 16:15:54 2012 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Sat, 27 Oct 2012 14:15:54 +0000 (UTC) Subject: [Libav-user] How to use rawvideo conatiner format with mpeg4 References: Message-ID: Mark Pupilli writes: > I am having problems sending mpeg4 (FMP4) in the the > rawvideo container format. I suspect you are searching for the output format "m4v". Carl Eugen From mpupilli at gmail.com Sat Oct 27 16:53:27 2012 From: mpupilli at gmail.com (Mark Pupilli) Date: Sat, 27 Oct 2012 15:53:27 +0100 Subject: [Libav-user] How to use rawvideo conatiner format with mpeg4 In-Reply-To: References: Message-ID: I am sending the video over network using a custom protocol so was trying to avoid the overhead of a container format. Is it not possible to transport mpeg4 in a rawvideo container? On Oct 27, 2012 3:16 PM, "Carl Eugen Hoyos" wrote: > Mark Pupilli writes: > > > I am having problems sending mpeg4 (FMP4) in the the > > rawvideo container format. > > I suspect you are searching for the output format "m4v". > > 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 Sat Oct 27 18:49:10 2012 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Sat, 27 Oct 2012 16:49:10 +0000 (UTC) Subject: [Libav-user] How to use rawvideo conatiner format with mpeg4 References: Message-ID: Mark Pupilli writes: > I am sending the video over network using a custom > protocol so was trying to avoid the overhead of a > container format. Do you mean size overhead or performance overhead? The m4v container has no size overhead and I suspect the performance overhead is (very, very slightly) bigger with rawvideo (it has more special-cases). > Is it not possible to transport mpeg4 in a rawvideo > container? The container called "rawvideo" is for rawvideo (yuv, rgb), raw codecs have specific containers. Please do not top-post here, Carl Eugen From mpupilli at gmail.com Sat Oct 27 18:53:17 2012 From: mpupilli at gmail.com (Mark Pupilli) Date: Sat, 27 Oct 2012 17:53:17 +0100 Subject: [Libav-user] How to use rawvideo conatiner format with mpeg4 In-Reply-To: References: Message-ID: I was thinking of size overhead, so it seems m4v is the correct choice. Thank you. On Oct 27, 2012 5:49 PM, "Carl Eugen Hoyos" wrote: > Mark Pupilli writes: > > > I am sending the video over network using a custom > > protocol so was trying to avoid the overhead of a > > container format. > > Do you mean size overhead or performance overhead? > The m4v container has no size overhead and I suspect > the performance overhead is (very, very slightly) > bigger with rawvideo (it has more special-cases). > > > Is it not possible to transport mpeg4 in a rawvideo > > container? > > The container called "rawvideo" is for rawvideo (yuv, > rgb), raw codecs have specific containers. > > Please do not top-post here, Carl Eugen > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mpupilli at gmail.com Sat Oct 27 20:37:00 2012 From: mpupilli at gmail.com (Mark Pupilli) Date: Sat, 27 Oct 2012 19:37:00 +0100 Subject: [Libav-user] How to use rawvideo conatiner format with mpeg4 In-Reply-To: References: Message-ID: On Oct 27, 2012 5:53 PM, "Mark Pupilli" wrote: > > I was thinking of size overhead, so it seems m4v is the correct choice. Thank you. > > On Oct 27, 2012 5:49 PM, "Carl Eugen Hoyos" wrote: >> >> Mark Pupilli writes: >> >> > I am sending the video over network using a custom >> > protocol so was trying to avoid the overhead of a >> > container format. >> >> Do you mean size overhead or performance overhead? >> The m4v container has no size overhead and I suspect >> the performance overhead is (very, very slightly) >> bigger with rawvideo (it has more special-cases). >> >> > Is it not possible to transport mpeg4 in a rawvideo >> > container? >> >> The container called "rawvideo" is for rawvideo (yuv, >> rgb), raw codecs have specific containers. >> >> Please do not top-post here, Carl Eugen >> >> _______________________________________________ >> Libav-user mailing list >> Libav-user at ffmpeg.org >> http://ffmpeg.org/mailman/listinfo/libav-user Ooops, sorry for top posting. Haven't used a mailing list since the 90's! -------------- next part -------------- An HTML attachment was scrubbed... URL: From info at denisgottardello.it Sun Oct 28 08:56:02 2012 From: info at denisgottardello.it (Denis) Date: Sun, 28 Oct 2012 09:56:02 +0200 Subject: [Libav-user] muxing.c, memory leak Message-ID: <201210280856.02282.info@denisgottardello.it> Using valgrind I obtain a memory leak in this row: "pAVStream= add_video_stream(pAVFormatContext, &pAVCodec, pAVOutputFormat->video_codec);" if (posix_memalign(&ptr,ALIGN,size)) av_mallocz in mem.c:95 Can anybody verifies if is true? I have an application that uses ffmpeg. In 2 weeks the application uses all the memory and now I suspect that the problem is in the wrong use of ffmpeg libraries. -- www.denisgottardello.it Skype: mrdebug Videosurveillance and home automation! http://www.denisgottardello.it/DomusBoss/DomusBossIndice.php -------------- next part -------------- An HTML attachment was scrubbed... URL: From PixStaMP at gmx.net Sun Oct 28 12:48:19 2012 From: PixStaMP at gmx.net (Peter Staab) Date: Sun, 28 Oct 2012 12:48:19 +0100 Subject: [Libav-user] Efficient way of sampling compressed audio Message-ID: <20121028114819.105460@gmx.net> Hi, I am interested in using libav to create a graphical representation of audio data (simple graph with left/right channel at the moment). I have used a sliding window approach where the maximum of each window is used for plotting. This works well but is quite slow because the whole audio data has to be decoded using avcodec_decode_audio*. It would be sufficient to have an approximate representation where only every x-th audio frame is decoded. I tried to "jump" to the next position using "av_seek_frame" but this slows down the whole process even more. Are there means to sample a decoded audio file only every x-th position? Or are there other (better) means to get the data for the graph? Regards, From cehoyos at ag.or.at Sun Oct 28 13:34:27 2012 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Sun, 28 Oct 2012 12:34:27 +0000 (UTC) Subject: [Libav-user] Efficient way of sampling compressed audio References: <20121028114819.105460@gmx.net> Message-ID: Peter Staab writes: > I am interested in using libav to create a > graphical representation of audio data Did you test the showspectrum and showwaves filters? Carl Eugen From pixstamp at gmx.net Sun Oct 28 16:44:40 2012 From: pixstamp at gmx.net (Peter Staab) Date: Sun, 28 Oct 2012 16:44:40 +0100 Subject: [Libav-user] Efficient way of sampling compressed audio In-Reply-To: References: <20121028114819.105460@gmx.net> Message-ID: <508D52E8.8090907@gmx.net> Hi, Thanks for pointing out these two filters. But both filters require frames as input and actually my problem is not to create the graph but to get these frames. The frames should not be read from begin to end (this is what I am currently doing) because the whole audio file has to be decoded. Instead, I am looking for a way to "sample" the decoded file with an interval x. Regards, On 28.10.2012 13:34, Carl Eugen Hoyos wrote: > Peter Staab writes: > >> I am interested in using libav to create a >> graphical representation of audio data > Did you test the showspectrum and showwaves filters? > > Carl Eugen > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > From cehoyos at ag.or.at Sun Oct 28 16:58:59 2012 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Sun, 28 Oct 2012 15:58:59 +0000 (UTC) Subject: [Libav-user] Efficient way of sampling compressed audio References: <20121028114819.105460@gmx.net> <508D52E8.8090907@gmx.net> Message-ID: Peter Staab writes: > The frames should not be read from begin to end > (this is what I am currently doing) because the > whole audio file has to be decoded. Instead, I > am looking for a way to "sample" the decoded file > with an interval x. Isn't all you need seeking by x? Please do not top-post here, Carl Eugen From alexcohn at netvision.net.il Sun Oct 28 20:04:24 2012 From: alexcohn at netvision.net.il (Alex Cohn) Date: Sun, 28 Oct 2012 21:04:24 +0200 Subject: [Libav-user] Best way to provide avcodec_decode_video2 with h264 data? In-Reply-To: References: <8824AAED239A0A48AE135277DC2B79B43EF5DA38FC@EXCHANGE1.ad.nottingham.ac.uk> Message-ID: On Thu, Oct 25, 2012 at 12:14 AM, Tim Pitman wrote: > Yeah I finally got the decoder working on a frame to frame basis and > got rid of the constant errors, at least as long as the stream is > good. > > I'm confused what you mean by "The encoder expects NAL units". I'm > piping raw video data (via ffmpeg using yuv4mpegpipe format) into x264 > which seems to work. > > > Two questions for you? > > 1) Is live555 suitable for lossy physical layer transmissions or only > for situations with a working UDP or TCP network? > > 2) Sometimes the video gets so corrupted over the wireless channel > that the decoder seems to get stuck printing a constant series of > errors and doesn't recover, even if the channel improves. Do you know > of a way to restart or flush the decoder some way, or another way to > get around this? > > Thanks, > Tim One typical case for decoder not being able to recover is when statistically no key frames (which are naturally much bigger than the average P-frames) can arrive correctly. We were experiencing this effect even when on the average UDP packet loss was reasonable. We ended with kind of custom FCC which improves the situation in general, but especially for I-frames. BR, Alex From zhou.wenpeng at rdnet.fi Mon Oct 29 13:42:38 2012 From: zhou.wenpeng at rdnet.fi (Wenpeng Zhou) Date: Mon, 29 Oct 2012 14:42:38 +0200 Subject: [Libav-user] fatal error C1083: Cannot open include file: 'inttypes.h': No such file or directory In-Reply-To: <5DA090DC8DCD3549BE9DF08C5074509E01606E95E4@indiambx01.corp.adobe.com> References: <00e601cdb2a5$16b28a80$44179f80$@rdnet.fi> <5DA090DC8DCD3549BE9DF08C5074509E01606E95E4@indiambx01.corp.adobe.com> Message-ID: <007101cdb5d2$e189b370$a49d1a50$@rdnet.fi> Hi Chandranath Thanks! I downloaded and it works. From: libav-user-bounces at ffmpeg.org [mailto:libav-user-bounces at ffmpeg.org] On Behalf Of Chandranath Bhattacharyya Sent: 25. lokakuuta 2012 15:11 To: This list is about using libavcodec, libavformat, libavutil, libavdevice and libavfilter. Subject: Re: [Libav-user] fatal error C1083: Cannot open include file: 'inttypes.h': No such file or directory > Where can we find the header file inttypes.h for VC++ 2010? You can try this link: http://code.google.com/p/msinttypes/downloads/list Regards, Chandranath -------------- next part -------------- An HTML attachment was scrubbed... URL: From abalk at avail-tvn.com Mon Oct 29 16:47:32 2012 From: abalk at avail-tvn.com (Alex Balk) Date: Mon, 29 Oct 2012 08:47:32 -0700 Subject: [Libav-user] soft telecine 29.97 fps Message-ID: Hello, When i use ffmpeg to encode an h264 input into mpeg2 video, I notice that even though my h264 file has some frames with pic_struct = 8 indicating frame doubling for soft telecined video, the mpeg2 output has the repeat_first_field set to 0 on all frames. Does the ffmpeg mpeg2 encoder support soft telecine output with 24 physical frames and repeat field set to get the fps to 29.97 ? Any info would be great, thanks. AB From mark.kenna at sureviewsystems.com Mon Oct 29 17:48:58 2012 From: mark.kenna at sureviewsystems.com (Mark Kenna) Date: Mon, 29 Oct 2012 16:48:58 +0000 Subject: [Libav-user] JPEG over RTSP Message-ID: Hi Guys Two things: 1. I have been trying to get JPEG over RTSP working through FFMpeg but get a bunch of errors. I've tried various command parameters but I cannot get the stream playing properly. I have included a trace of the output just in case someone can see what the issue could be: C:\ffmpeg-20120608-git-718607b-win32-shared\bin>ffplay -loglevel debug >> "rtsp://root:Roseb8d at 81.138.238.97:554/profile0=r" -rtsp_transport tcp > > ffplay version N-41416-g718607b Copyright (c) 2003-2012 the FFmpeg >> developers > > built on Jun 8 2012 12:47:57 with gcc 4.6.3 > > configuration: --disable-static --enable-shared --enable-gpl >> --enable-version3 --disable-w32threads --enable-runtime-cpudetect >> --enable-avisynth --enable-bzlib --enable-frei0r --enable-libass >> --enable-libcelt --enable-libopencore-amrnb -- > > enc --enabl libavutil 51. 56.100 / 51. 56.100 > > libavcodec 54. 25.100 / 54. 25.100 > > libavformat 54. 6.101 / 54. 6.101 > > libavdevice 54. 0.100 / 54. 0.100 > > libavfilter 2. 78.101 / 2. 78.101 > > libswscale 2. 1.100 / 2. 1.100 > > libswresample 0. 15.100 / 0. 15.100 > > libpostproc 52. 0.100 / 52. 0.100 > > [rtsp @ 00692fa0] SDP: > > v=0 > > o=- 0 0 IN IP4 81.138.238.97 > > s=rtsp://81.138.238.97/profile0 > > c=IN IP4 0.0.0.0 > > t=0 0 > > m=application 0 RTP/AVP 122 > > a=rtpmap:122 vnd.onvif.metadata/90000 > > a=control:rtsp://81.138.238.97/profile0/METAEnc > > m=audio 0 RTP/AVP 0 > > a=rtpmap:0 PCMU/8000/1 > > a=control:rtsp://81.138.238.97/profile0/G711Enc > > m=video 0 RTP/AVP 26 > > a=rtpmap:26 JPEG/90000 > > a=control:rtsp://81.138.238.97/profile0/JPEGEnc > > >> [rtsp @ 00692fa0] audio codec set to: pcm_mulaw > > [rtsp @ 00692fa0] audio samplerate set to: 8000 > > [rtsp @ 00692fa0] audio channels set to: 1 > > [rtsp @ 00692fa0] video codec set to: mjpeg > > [rtsp @ 00692fa0] hello state=0 > > [mjpeg @ 006a8c00] mjpeg decode frame unused 0 bytes > > Last message repeated 22 times > > [mjpeg @ 006a8c00] marker=d9 avail_size_in_buf=0 > > [mjpeg @ 006a8c00] Found EOI before any SOF, ignoring > > [mjpeg @ 006a8c00] marker parser used 0 bytes (0 bits) > > [mjpeg @ 006a8c00] No JPEG data found in image > > [mjpeg @ 006a8c00] mjpeg decode frame unused 0 bytes > > Last message repeated 4 times > > [mjpeg @ 006a8c00] marker=d9 avail_size_in_buf=0 > > [mjpeg @ 006a8c00] Found EOI before any SOF, ignoring > > [mjpeg @ 006a8c00] marker parser used 0 bytes (0 bits) > > [mjpeg @ 006a8c00] No JPEG data found in image > > [mjpeg @ 006a8c00] mjpeg decode frame unused 0 bytes > > Last message repeated 18 times > > [mjpeg @ 006a8c00] marker=d9 avail_size_in_buf=0 > > [mjpeg @ 006a8c00] Found EOI before any SOF, ignoring > > [mjpeg @ 006a8c00] marker parser used 0 bytes (0 bits) > > [mjpeg @ 006a8c00] No JPEG data found in image > > [mjpeg @ 006a8c00] mjpeg decode frame unused 0 bytes > > Last message repeated 14 times > > [mjpeg @ 006a8c00] marker=d9 avail_size_in_buf=0 > > [mjpeg @ 006a8c00] Found EOI before any SOF, ignoring > > [mjpeg @ 006a8c00] marker parser used 0 bytes (0 bits) > > [mjpeg @ 006a8c00] No JPEG data found in image > > [mjpeg @ 006a8c00] mjpeg decode frame unused 0 bytes > > Last message repeated 4 times > > [mjpeg @ 006a8c00] marker=d9 avail_size_in_buf=0 > > [mjpeg @ 006a8c00] Found EOI before any SOF, ignoring > > [mjpeg @ 006a8c00] marker parser used 0 bytes (0 bits) > > [mjpeg @ 006a8c00] No JPEG data found in image > > [mjpeg @ 006a8c00] mjpeg decode frame unused 0 bytes > > Last message repeated 13 times > > [mjpeg @ 006a8c00] marker=d9 avail_size_in_buf=0 > > [mjpeg @ 006a8c00] Found EOI before any SOF, ignoring > > [mjpeg @ 006a8c00] marker parser used 0 bytes (0 bits) > > [mjpeg @ 006a8c00] No JPEG data found in image > > [mjpeg @ 006a8c00] mjpeg decode frame unused 0 bytes > > Last message repeated 18 times > > [mjpeg @ 006a8c00] marker=d9 avail_size_in_buf=0 > > [mjpeg @ 006a8c00] Found EOI before any SOF, ignoring > > [mjpeg @ 006a8c00] marker parser used 0 bytes (0 bits) > > [mjpeg @ 006a8c00] No JPEG data found in image > > [mjpeg @ 006a8c00] mjpeg decode frame unused 0 bytes > > Last message repeated 4 times > > [mjpeg @ 006a8c00] marker=d9 avail_size_in_buf=0 > > [mjpeg @ 006a8c00] Found EOI before any SOF, ignoring > > [mjpeg @ 006a8c00] marker parser used 0 bytes (0 bits) > > [mjpeg @ 006a8c00] No JPEG data found in image > > [mjpeg @ 006a8c00] mjpeg decode frame unused 0 bytes > > 2. I have been trying to implement the manual decoding of RTP encoded JPEG packets provided from the RTSP demuxer (as FFMpeg itself cannot decode the frames). My question is whether there is any way to read the *entire* RTP packet from an av_read_* call as the data that's currently being provided by av_read_frame is the contents of the RTP packet without the headers (which is no good for me as I need access to the RTP markers to determine when a frame is ready for decoding). I have tried using extra flags like so: AVFormatContext *context = avformat_alloc_context(); > context->flags = AVFMT_FLAG_NOPARSE | AVFMT_FLAG_NOFILLIN; > int err = avformat_open_input(&context, cUrl, NULL, &inputOptions); But it still outputs just the packet contents. I would really like to avoid having to re-implement an RTSP client is possible as FFMpeg works so well normally. NB. I have purposefully left the RTSP uri in the FFMpeg command call in case somebody wants to connect to the RTSP server and check for yourselves :) Thanks guys, Mark. -------------- next part -------------- An HTML attachment was scrubbed... URL: From wseemann at gmail.com Mon Oct 29 18:09:23 2012 From: wseemann at gmail.com (William Seemann) Date: Mon, 29 Oct 2012 12:09:23 -0500 Subject: [Libav-user] Album art retrieval Message-ID: Hello, Is it possible to retrieve album art from a track programmatically (i.e NOT using the ffmpeg command, using actual code) with FFmpeg? -------------- next part -------------- An HTML attachment was scrubbed... URL: From mbradshaw at sorensonmedia.com Mon Oct 29 18:24:17 2012 From: mbradshaw at sorensonmedia.com (Michael Bradshaw) Date: Mon, 29 Oct 2012 11:24:17 -0600 Subject: [Libav-user] Album art retrieval In-Reply-To: References: Message-ID: On Mon, Oct 29, 2012 at 11:09 AM, William Seemann wrote: > Hello, Is it possible to retrieve album art from a track programmatically > (i.e NOT using the ffmpeg command, using actual code) with FFmpeg? Possibly (it depends on what the file is and how the album art is embedded in the track). Try opening and reading the file and look for a video stream that has one frame. From cehoyos at ag.or.at Mon Oct 29 18:24:00 2012 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Mon, 29 Oct 2012 17:24:00 +0000 (UTC) Subject: [Libav-user] JPEG over RTSP References: Message-ID: Mark Kenna writes: > 1. I have been trying to get JPEG over RTSP working > through FFMpeg but get a bunch of errors. It's working fine here. (Or am I missing something?) $ ffplay rtsp://root:Roseb8d at 81.138.238.97:554/profile0=r ffplay version N-46127-g7d1e003 Copyright (c) 2003-2012 the FFmpeg developers built on Oct 29 2012 12:28:53 with gcc 4.7 (SUSE Linux) configuration: --enable-gpl libavutil 52. 1.100 / 52. 1.100 libavcodec 54. 69.100 / 54. 69.100 libavformat 54. 35.100 / 54. 35.100 libavdevice 54. 3.100 / 54. 3.100 libavfilter 3. 20.106 / 3. 20.106 libswscale 2. 1.101 / 2. 1.101 libswresample 0. 16.100 / 0. 16.100 libpostproc 52. 1.100 / 52. 1.100 [rtsp @ 0x7f53cc0008c0] Estimating duration from bitrate, this may be inaccurate Input #0, rtsp, from 'rtsp://root:Roseb8d at 81.138.238.97:554/profile0=r': Metadata: title : rtsp://81.138.238.97/profile0 Duration: N/A, start: 0.057000, bitrate: 64 kb/s Stream #0:0: Data: none Stream #0:1: Audio: pcm_mulaw, 8000 Hz, 1 channels, s16, 64 kb/s Stream #0:2: Video: mjpeg, yuvj422p, 160x120 [SAR 1:1 DAR 4:3], 10 tbr, 90k tbn, 90k tbc Frame changed from size:0x0 to size:160x120 10.29 A-V: 0.012 fd= 1 aq= 19KB vq= 122KB sq= 0B f=0/0 From cehoyos at ag.or.at Mon Oct 29 18:25:46 2012 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Mon, 29 Oct 2012 17:25:46 +0000 (UTC) Subject: [Libav-user] Album art retrieval References: Message-ID: William Seemann writes: > Hello, Is it possible to retrieve album art from a track programmatically I suspect so. > (i.e NOT using the ffmpeg command, using actual code) with FFmpeg? The easiest way to find out for sure is trying with the ffmpeg application (which is using the libraries, so if it works with ffmpeg, you know that it can be done). Carl Eugen From donmoir at comcast.net Mon Oct 29 18:39:24 2012 From: donmoir at comcast.net (Don Moir) Date: Mon, 29 Oct 2012 13:39:24 -0400 Subject: [Libav-user] Album art retrieval References: Message-ID: <5D933750DD9544A784F1863D31A2FD76@MANLAP> ----- Original Message ----- From: "Michael Bradshaw" To: "This list is about using libavcodec, libavformat, libavutil,libavdevice and libavfilter." Sent: Monday, October 29, 2012 1:24 PM Subject: Re: [Libav-user] Album art retrieval > On Mon, Oct 29, 2012 at 11:09 AM, William Seemann wrote: >> Hello, Is it possible to retrieve album art from a track programmatically >> (i.e NOT using the ffmpeg command, using actual code) with FFmpeg? > > Possibly (it depends on what the file is and how the album art is > embedded in the track). Try opening and reading the file and look for > a video stream that has one frame. Check for video stream and then check if (pVideoStream->disposition & AV_DISPOSITION_ATTACHED_PIC) From wseemann at gmail.com Mon Oct 29 18:43:25 2012 From: wseemann at gmail.com (William Seemann) Date: Mon, 29 Oct 2012 12:43:25 -0500 Subject: [Libav-user] Album art retrieval In-Reply-To: <5D933750DD9544A784F1863D31A2FD76@MANLAP> References: <5D933750DD9544A784F1863D31A2FD76@MANLAP> Message-ID: Great, I'll try that. Thank you for the responses. On Mon, Oct 29, 2012 at 12:39 PM, Don Moir wrote: > ----- Original Message ----- From: "Michael Bradshaw" < > mbradshaw at sorensonmedia.com> > To: "This list is about using libavcodec, libavformat, > libavutil,libavdevice and libavfilter." > Sent: Monday, October 29, 2012 1:24 PM > Subject: Re: [Libav-user] Album art retrieval > > > > On Mon, Oct 29, 2012 at 11:09 AM, William Seemann >> wrote: >> >>> Hello, Is it possible to retrieve album art from a track programmatically >>> (i.e NOT using the ffmpeg command, using actual code) with FFmpeg? >>> >> >> Possibly (it depends on what the file is and how the album art is >> embedded in the track). Try opening and reading the file and look for >> a video stream that has one frame. >> > > Check for video stream and then check if (pVideoStream->disposition & > AV_DISPOSITION_ATTACHED_PIC) > > ______________________________**_________________ > 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 mark.kenna at sureviewsystems.com Mon Oct 29 19:03:54 2012 From: mark.kenna at sureviewsystems.com (Mark Kenna) Date: Mon, 29 Oct 2012 18:03:54 +0000 Subject: [Libav-user] JPEG over RTSP In-Reply-To: References: Message-ID: <2098938695051358903@unknownmsgid> On 29 Oct 2012, at 17:24, Carl Eugen Hoyos wrote: > Mark Kenna writes: > >> 1. I have been trying to get JPEG over RTSP working >> through FFMpeg but get a bunch of errors. > > It's working fine here. (Or am I missing something?) > > $ ffplay rtsp://root:Roseb8d at 81.138.238.97:554/profile0=r > ffplay version N-46127-g7d1e003 Copyright (c) 2003-2012 the FFmpeg developers > built on Oct 29 2012 12:28:53 with gcc 4.7 (SUSE Linux) > configuration: --enable-gpl > libavutil 52. 1.100 / 52. 1.100 > libavcodec 54. 69.100 / 54. 69.100 > libavformat 54. 35.100 / 54. 35.100 > libavdevice 54. 3.100 / 54. 3.100 > libavfilter 3. 20.106 / 3. 20.106 > libswscale 2. 1.101 / 2. 1.101 > libswresample 0. 16.100 / 0. 16.100 > libpostproc 52. 1.100 / 52. 1.100 > [rtsp @ 0x7f53cc0008c0] Estimating duration from bitrate, this may be inaccurate > Input #0, rtsp, from 'rtsp://root:Roseb8d at 81.138.238.97:554/profile0=r': > Metadata: > title : rtsp://81.138.238.97/profile0 > Duration: N/A, start: 0.057000, bitrate: 64 kb/s > Stream #0:0: Data: none > Stream #0:1: Audio: pcm_mulaw, 8000 Hz, 1 channels, s16, 64 kb/s > Stream #0:2: Video: mjpeg, yuvj422p, 160x120 [SAR 1:1 DAR 4:3], 10 tbr, 90k > tbn, 90k tbc > Frame changed from size:0x0 to size:160x120 > 10.29 A-V: 0.012 fd= 1 aq= 19KB vq= 122KB sq= 0B f=0/0 > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user The latest version works perfectly. Note the specific version that I am using in my provided trace. I don't really have the option to switch to the latest version currently hence why I am trying to decode the packets myself. Thanks, Mark. From wseemann at gmail.com Mon Oct 29 20:24:32 2012 From: wseemann at gmail.com (William Seemann) Date: Mon, 29 Oct 2012 14:24:32 -0500 Subject: [Libav-user] Album art retrieval In-Reply-To: References: <5D933750DD9544A784F1863D31A2FD76@MANLAP> Message-ID: I have a follow up question. Once I've obtained the AVPacket with the associated album art how to I actually generate an image from the packet? I'm using the commit found here as a guide, FYI: https://lists.ffmpeg.org/pipermail/ffmpeg-cvslog/2012-March/047616.html On Mon, Oct 29, 2012 at 12:43 PM, William Seemann wrote: > Great, I'll try that. Thank you for the responses. > > > On Mon, Oct 29, 2012 at 12:39 PM, Don Moir wrote: > >> ----- Original Message ----- From: "Michael Bradshaw" < >> mbradshaw at sorensonmedia.com> >> To: "This list is about using libavcodec, libavformat, >> libavutil,libavdevice and libavfilter." >> Sent: Monday, October 29, 2012 1:24 PM >> Subject: Re: [Libav-user] Album art retrieval >> >> >> >> On Mon, Oct 29, 2012 at 11:09 AM, William Seemann >>> wrote: >>> >>>> Hello, Is it possible to retrieve album art from a track >>>> programmatically >>>> (i.e NOT using the ffmpeg command, using actual code) with FFmpeg? >>>> >>> >>> Possibly (it depends on what the file is and how the album art is >>> embedded in the track). Try opening and reading the file and look for >>> a video stream that has one frame. >>> >> >> Check for video stream and then check if (pVideoStream->disposition & >> AV_DISPOSITION_ATTACHED_PIC) >> >> ______________________________**_________________ >> 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 mbradshaw at sorensonmedia.com Mon Oct 29 20:52:16 2012 From: mbradshaw at sorensonmedia.com (Michael Bradshaw) Date: Mon, 29 Oct 2012 13:52:16 -0600 Subject: [Libav-user] Album art retrieval In-Reply-To: References: <5D933750DD9544A784F1863D31A2FD76@MANLAP> Message-ID: On Mon, Oct 29, 2012 at 1:24 PM, William Seemann wrote: > I have a follow up question. Once I've obtained the AVPacket with the > associated album art how to I actually generate an image from the packet? Try looking at doc/examples/encoded_decoding.c for a decent example of decoding video (example starts at line 475). See: http://git.videolan.org/?p=ffmpeg.git;a=blob;f=doc/examples/decoding_encoding.c;h=cc5953f4af01e1f1e1f9025f6a5243827a441c8d;hb=HEAD Also, please bottom-post instead of top-post (google it if you need). From wseemann at gmail.com Mon Oct 29 21:10:46 2012 From: wseemann at gmail.com (William Seemann) Date: Mon, 29 Oct 2012 15:10:46 -0500 Subject: [Libav-user] Album art retrieval In-Reply-To: References: <5D933750DD9544A784F1863D31A2FD76@MANLAP> Message-ID: On Mon, Oct 29, 2012 at 2:52 PM, Michael Bradshaw < mbradshaw at sorensonmedia.com> wrote: > On Mon, Oct 29, 2012 at 1:24 PM, William Seemann > wrote: > > I have a follow up question. Once I've obtained the AVPacket with the > > associated album art how to I actually generate an image from the packet? > > Try looking at doc/examples/encoded_decoding.c for a decent example of > decoding video (example starts at line 475). See: > > http://git.videolan.org/?p=ffmpeg.git;a=blob;f=doc/examples/decoding_encoding.c;h=cc5953f4af01e1f1e1f9025f6a5243827a441c8d;hb=HEAD > > Also, please bottom-post instead of top-post (google it if you need). > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > I'm already familiar with encoding/decoding, so, are you saying I need to decode the packet the same way I would for a normal audio/video stream and then do something with the decoded output (in this case, render an image)? -------------- next part -------------- An HTML attachment was scrubbed... URL: From zhou.wenpeng at rdnet.fi Mon Oct 29 23:26:12 2012 From: zhou.wenpeng at rdnet.fi (Wenpeng Zhou) Date: Tue, 30 Oct 2012 00:26:12 +0200 Subject: [Libav-user] I need some C++ source code example for MJpeg streaming Message-ID: <00a201cdb624$6731b080$35951180$@rdnet.fi> Hi, I just made a simple VC++ application with ffmpeg. I hope to MJpeg stream the live videos captured from dshow. But I do not know how to program MJpeg stream with C++. Who can provide some examples? Thanks! -------------- next part -------------- An HTML attachment was scrubbed... URL: From cehoyos at ag.or.at Mon Oct 29 23:56:18 2012 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Mon, 29 Oct 2012 22:56:18 +0000 (UTC) Subject: [Libav-user] Album art retrieval References: <5D933750DD9544A784F1863D31A2FD76@MANLAP> Message-ID: William Seemann writes: > I'm already familiar with encoding/decoding, so, > are you saying I need to decode the packet the > same way I would for a normal audio/video stream > and then do something with the decoded output (in > this case, render an image)? You have to decode (and encode) the image if you don't like the codec it is encoded when you receive it. Or in other words: It depends on your use case. Carl Eugen From adrozdoff at gmail.com Tue Oct 30 08:07:56 2012 From: adrozdoff at gmail.com (hatred) Date: Tue, 30 Oct 2012 18:07:56 +1100 Subject: [Libav-user] RTSP muxer: how to use it? Message-ID: Hi guys! I looked into ffmpeg --help full and found RTSP muxer in list. So how can I use it? Can I use it for RTSP streaming? I try next command (take source from live camera): ffmpeg -i rtsp://guest:password at 188.128.18.207/mpeg4/media.amp -f rtsp -re "rtsp://0.0.0.0:8544/cam0" -rtsp_flags listen but I take next error: ~~~~~~ ffmpeg version 1.0 Copyright (c) 2000-2012 the FFmpeg developers built on Oct 1 2012 18:45:36 with gcc 4.7.1 (GCC) 20120721 (prerelease) configuration: --prefix=/usr --enable-libmp3lame --enable-libvorbis --enable-libxvid --enable-libx264 --enable-libvpx --enable-libtheora --enable-libgsm --enable-libspeex --enable-postproc --enable-shared --enable-x11grab --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libschroedinger --enable-libopenjpeg --enable-librtmp --enable-libpulse --enable-libv4l2 --enable-gpl --enable-version3 --enable-runtime-cpudetect --enable-debug=gdb3 --enable-static --disable-stripping libavutil 51. 73.101 / 51. 73.101 libavcodec 54. 59.100 / 54. 59.100 libavformat 54. 29.104 / 54. 29.104 libavdevice 54. 2.101 / 54. 2.101 libavfilter 3. 17.100 / 3. 17.100 libswscale 2. 1.101 / 2. 1.101 libswresample 0. 15.100 / 0. 15.100 libpostproc 52. 0.100 / 52. 0.100 [rtsp @ 0x75e240] Estimating duration from bitrate, this may be inaccurate Input #0, rtsp, from 'rtsp://guest:password at 188.128.18.207/mpeg4/media.amp': Metadata: title : Media Presentation Duration: N/A, start: 0.029989, bitrate: N/A Stream #0:0: Video: mpeg4 (Advanced Simple Profile), yuv420p, 704x576 [SAR 12:11 DAR 4:3], 100 tbr, 90k tbn, 100 tbc [tcp @ 0x871200] TCP connection to 0.0.0.0:8544 failed: Connection refused Output #0, rtsp, to 'rtsp://0.0.0.0:8544/cam0': Metadata: title : Media Presentation encoder : Lavf54.29.104 Stream #0:0: Video: mpeg4, yuv420p, 704x576 [SAR 12:11 DAR 4:3], q=2-31, 200 kb/s, 90k tbn, 100 tbc Stream mapping: Stream #0:0 -> #0:0 (mpeg4 -> mpeg4) Could not write header for output file #0 (incorrect codec parameters ?): Input/output error ~~~~~~ -------------- next part -------------- An HTML attachment was scrubbed... URL: From info at denisgottardello.it Tue Oct 30 08:41:58 2012 From: info at denisgottardello.it (Denis) Date: Tue, 30 Oct 2012 08:41:58 +0100 Subject: [Libav-user] I need some C++ source code example for MJpeg streaming In-Reply-To: <00a201cdb624$6731b080$35951180$@rdnet.fi> References: <00a201cdb624$6731b080$35951180$@rdnet.fi> Message-ID: <201210300841.58753.info@denisgottardello.it> In data luned? 29 ottobre 2012 23:26:12, Wenpeng Zhou ha scritto: > But I do not know how to program MJpeg stream with C++. > Who can provide some examples? If you want to send a stream across the network in mjpeg format is not necessary to use ffmpeg. The only thing that you must do is send jpg images in sequence. You can watch the stream with firefox for example. -- www.denisgottardello.it Skype: mrdebug Videosurveillance and home automation! http://www.denisgottardello.it/DomusBoss/DomusBossIndice.php From mark.kenna at sureviewsystems.com Tue Oct 30 11:48:57 2012 From: mark.kenna at sureviewsystems.com (Mark Kenna) Date: Tue, 30 Oct 2012 10:48:57 +0000 Subject: [Libav-user] Dll Versioning Message-ID: Hi Guys I am trying to find a way of allowing my application to be able to load multiple versions of the FFMpeg DLL's at the same time. I understand that I need to segregate the releases so that they do not conflict. Currently my idea is to rename the .dll files for one particular release to *.v123.dll". I understand that you cannot just rename the files and some work would have to go into the re-creation of the .lib files using DUMPBIN but I was wondering if there is an easier way as I can see that the dll files all seem to reference each other internally. Thanks, Mark. -------------- next part -------------- An HTML attachment was scrubbed... URL: From h.leppkes at gmail.com Tue Oct 30 11:50:53 2012 From: h.leppkes at gmail.com (Hendrik Leppkes) Date: Tue, 30 Oct 2012 11:50:53 +0100 Subject: [Libav-user] Dll Versioning In-Reply-To: References: Message-ID: On Tue, Oct 30, 2012 at 11:48 AM, Mark Kenna wrote: > Hi Guys > > I am trying to find a way of allowing my application to be able to load > multiple versions of the FFMpeg DLL's at the same time. > > I understand that I need to segregate the releases so that they do not > conflict. Currently my idea is to rename the .dll files for one particular > release to *.v123.dll". I understand that you cannot just rename the files > and some work would have to go into the re-creation of the .lib files using > DUMPBIN but I was wondering if there is an easier way as I can see that the > dll files all seem to reference each other internally. > You can specify a suffix when building ffmpeg, which is appended to all libraries and the lib import files. Check the --build-suffix option. - Hendrik From nicolas.george at normalesup.org Tue Oct 30 11:51:50 2012 From: nicolas.george at normalesup.org (Nicolas George) Date: Tue, 30 Oct 2012 11:51:50 +0100 Subject: [Libav-user] Dll Versioning In-Reply-To: References: Message-ID: <20121030105150.GA29133@phare.normalesup.org> Le nonidi 9 brumaire, an CCXXI, Mark Kenna a ?crit?: > I am trying to find a way of allowing my application to be able to load > multiple versions of the FFMpeg DLL's at the same time. Why would you want to do that? The simplest solution to your problem is probably to find out how not to need it. Regards, -- Nicolas George -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: Digital signature URL: From mark.kenna at sureviewsystems.com Tue Oct 30 11:51:56 2012 From: mark.kenna at sureviewsystems.com (Mark Kenna) Date: Tue, 30 Oct 2012 10:51:56 +0000 Subject: [Libav-user] Dll Versioning In-Reply-To: References: Message-ID: On 30 October 2012 10:50, Hendrik Leppkes wrote: > On Tue, Oct 30, 2012 at 11:48 AM, Mark Kenna > wrote: > > Hi Guys > > > > I am trying to find a way of allowing my application to be able to load > > multiple versions of the FFMpeg DLL's at the same time. > > > > I understand that I need to segregate the releases so that they do not > > conflict. Currently my idea is to rename the .dll files for one > particular > > release to *.v123.dll". I understand that you cannot just rename the > files > > and some work would have to go into the re-creation of the .lib files > using > > DUMPBIN but I was wondering if there is an easier way as I can see that > the > > dll files all seem to reference each other internally. > > > > You can specify a suffix when building ffmpeg, which is appended to > all libraries and the lib import files. > Check the --build-suffix option. > > - Hendrik > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > Hi Hendrik Unfortunately I am stuck with using a pre-compiled binary (old version). Thanks, Mark. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mark.kenna at sureviewsystems.com Tue Oct 30 11:55:08 2012 From: mark.kenna at sureviewsystems.com (Mark Kenna) Date: Tue, 30 Oct 2012 10:55:08 +0000 Subject: [Libav-user] Dll Versioning In-Reply-To: <20121030105150.GA29133@phare.normalesup.org> References: <20121030105150.GA29133@phare.normalesup.org> Message-ID: On 30 October 2012 10:51, Nicolas George wrote: > Le nonidi 9 brumaire, an CCXXI, Mark Kenna a ?crit : > > I am trying to find a way of allowing my application to be able to load > > multiple versions of the FFMpeg DLL's at the same time. > > Why would you want to do that? > > The simplest solution to your problem is probably to find out how not to > need it. > > Regards, > > -- > Nicolas George > > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.12 (GNU/Linux) > > iEYEARECAAYFAlCPsUYACgkQsGPZlzblTJOwnwCfT+lnhjDNCSK/zzpnvzWwPwz6 > 2w4AoMK7j0HXl7hdQb6NIaUTricZhVJ9 > =1+7I > -----END PGP SIGNATURE----- > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > > I need to do that because we constantly find ourselves having FFMpeg-based modules which overwrite our .dll files with older versions causing serious crashing. I just need to be able to stop "drop-ins" from interfering with the version that we are running. Thanks, Mark. -------------- next part -------------- An HTML attachment was scrubbed... URL: From zhou.wenpeng at rdnet.fi Tue Oct 30 12:05:02 2012 From: zhou.wenpeng at rdnet.fi (Wenpeng Zhou) Date: Tue, 30 Oct 2012 13:05:02 +0200 Subject: [Libav-user] (AVStream *)av_malloc(sizeof(AVStream)) crashed the application Message-ID: <010801cdb68e$68ed5d10$3ac81730$@rdnet.fi> Hi, I use AVFormatContext *ic_enc_mjpeg; ic_enc_mjpeg = (AVFormatContext *)av_malloc(sizeof(AVFormatContext)); ic_enc_mjpeg->streams[0] = (AVStream *)av_malloc(sizeof(AVStream)); But ic_enc_mjpeg->streams[0] = (AVStream *)av_malloc(sizeof(AVStream)); crashed the application. I use VC++ 2010. What is the reason? Thanks! -------------- next part -------------- An HTML attachment was scrubbed... URL: From cbhattac at adobe.com Tue Oct 30 12:11:40 2012 From: cbhattac at adobe.com (Chandranath Bhattacharyya) Date: Tue, 30 Oct 2012 16:41:40 +0530 Subject: [Libav-user] (AVStream *)av_malloc(sizeof(AVStream)) crashed the application In-Reply-To: <010801cdb68e$68ed5d10$3ac81730$@rdnet.fi> References: <010801cdb68e$68ed5d10$3ac81730$@rdnet.fi> Message-ID: <5DA090DC8DCD3549BE9DF08C5074509E01606E988B@indiambx01.corp.adobe.com> > AVFormatContext *ic_enc_mjpeg; > ic_enc_mjpeg = (AVFormatContext *)av_malloc(sizeof(AVFormatContext)); > ic_enc_mjpeg->streams[0] = (AVStream *)av_malloc(sizeof(AVStream)); > But > ic_enc_mjpeg->streams[0] = (AVStream *)av_malloc(sizeof(AVStream)); > crashed the application. AVFormatContext *ic_enc_mjpeg; //==> Here ic_enc_mjpeg is uninitialized. ic_enc_mjpeg->streams[0] = (AVStream *)av_malloc(sizeof(AVStream)); => ic_enc_mjpeg->stream[0] accesses uninitialized pointer ic_enc_mjpeg causing crash. Situation is same as the following: struct A { int a; }; A *pa; pA->a = 1; // crash Regards, Chandranath From: libav-user-bounces at ffmpeg.org [mailto:libav-user-bounces at ffmpeg.org] On Behalf Of Wenpeng Zhou Sent: 30 October 2012 16:35 To: 'This list is about using libavcodec, libavformat, libavutil, libavdevice and libavfilter.' Subject: [Libav-user] (AVStream *)av_malloc(sizeof(AVStream)) crashed the application Hi, I use AVFormatContext *ic_enc_mjpeg; ic_enc_mjpeg = (AVFormatContext *)av_malloc(sizeof(AVFormatContext)); ic_enc_mjpeg->streams[0] = (AVStream *)av_malloc(sizeof(AVStream)); But ic_enc_mjpeg->streams[0] = (AVStream *)av_malloc(sizeof(AVStream)); crashed the application. I use VC++ 2010. What is the reason? Thanks! -------------- next part -------------- An HTML attachment was scrubbed... URL: From zhou.wenpeng at rdnet.fi Tue Oct 30 12:18:54 2012 From: zhou.wenpeng at rdnet.fi (Wenpeng Zhou) Date: Tue, 30 Oct 2012 13:18:54 +0200 Subject: [Libav-user] (AVStream *)av_malloc(sizeof(AVStream)) crashed the application In-Reply-To: <5DA090DC8DCD3549BE9DF08C5074509E01606E988B@indiambx01.corp.adobe.com> References: <010801cdb68e$68ed5d10$3ac81730$@rdnet.fi> <5DA090DC8DCD3549BE9DF08C5074509E01606E988B@indiambx01.corp.adobe.com> Message-ID: <012101cdb690$593a20e0$0bae62a0$@rdnet.fi> Hi Chandranath Thanks! But I already allocated memory for the pointer *ic_enc_mjpeg AVFormatContext *ic_enc_mjpeg; ic_enc_mjpeg = (AVFormatContext *)av_malloc(sizeof(AVFormatContext)); Then I tried to allocate the memory for ic_enc_mjpeg->streams[0], then it crashed. From: libav-user-bounces at ffmpeg.org [mailto:libav-user-bounces at ffmpeg.org] On Behalf Of Chandranath Bhattacharyya Sent: 30. lokakuuta 2012 13:12 To: This list is about using libavcodec, libavformat, libavutil, libavdevice and libavfilter. Subject: Re: [Libav-user] (AVStream *)av_malloc(sizeof(AVStream)) crashed the application > AVFormatContext *ic_enc_mjpeg; > ic_enc_mjpeg = (AVFormatContext *)av_malloc(sizeof(AVFormatContext)); > ic_enc_mjpeg->streams[0] = (AVStream *)av_malloc(sizeof(AVStream)); > But > ic_enc_mjpeg->streams[0] = (AVStream *)av_malloc(sizeof(AVStream)); > crashed the application. AVFormatContext *ic_enc_mjpeg; //? Here ic_enc_mjpeg is uninitialized. ic_enc_mjpeg->streams[0] = (AVStream *)av_malloc(sizeof(AVStream)); => ic_enc_mjpeg->stream[0] accesses uninitialized pointer ic_enc_mjpeg causing crash. Situation is same as the following: struct A { int a; }; A *pa; pA->a = 1; // crash Regards, Chandranath From: libav-user-bounces at ffmpeg.org [mailto:libav-user-bounces at ffmpeg.org] On Behalf Of Wenpeng Zhou Sent: 30 October 2012 16:35 To: 'This list is about using libavcodec, libavformat, libavutil, libavdevice and libavfilter.' Subject: [Libav-user] (AVStream *)av_malloc(sizeof(AVStream)) crashed the application Hi, I use AVFormatContext *ic_enc_mjpeg; ic_enc_mjpeg = (AVFormatContext *)av_malloc(sizeof(AVFormatContext)); ic_enc_mjpeg->streams[0] = (AVStream *)av_malloc(sizeof(AVStream)); But ic_enc_mjpeg->streams[0] = (AVStream *)av_malloc(sizeof(AVStream)); crashed the application. I use VC++ 2010. What is the reason? Thanks! -------------- next part -------------- An HTML attachment was scrubbed... URL: From ffmpeg at gmail.com Tue Oct 30 12:28:53 2012 From: ffmpeg at gmail.com (Geek.Song) Date: Tue, 30 Oct 2012 19:28:53 +0800 Subject: [Libav-user] (AVStream *)av_malloc(sizeof(AVStream)) crashed the application In-Reply-To: <012101cdb690$593a20e0$0bae62a0$@rdnet.fi> References: <010801cdb68e$68ed5d10$3ac81730$@rdnet.fi> <5DA090DC8DCD3549BE9DF08C5074509E01606E988B@indiambx01.corp.adobe.com> <012101cdb690$593a20e0$0bae62a0$@rdnet.fi> Message-ID: On Tue, Oct 30, 2012 at 7:18 PM, Wenpeng Zhou wrote: > Hi Chandranath > > > > Thanks! > > > > But I already allocated memory for the pointer *ic_enc_mjpeg > > > > AVFormatContext *ic_enc_mjpeg; > > ic_enc_mjpeg = (AVFormatContext *)av_malloc(sizeof(AVFormatContext)); > > > > Then I tried to allocate the memory for ic_enc_mjpeg->streams[0], then it > crashed. > ic_enc_mjpeg->streams is uninitialized after av_malloc(sizeof(AVFormatContext)); it is a double pointer which could be assigned with 0xdeadbeef, you can not use ic_enc_mjpeg[0] as left value directly. -- ----------------------------------------------------------------------------------------- My key fingerprint: d1:03:f5:32:26:ff:d7:3c:e4:42:e3:51:ec:92:78:b2 From cbhattac at adobe.com Tue Oct 30 12:28:06 2012 From: cbhattac at adobe.com (Chandranath Bhattacharyya) Date: Tue, 30 Oct 2012 16:58:06 +0530 Subject: [Libav-user] (AVStream *)av_malloc(sizeof(AVStream)) crashed the application In-Reply-To: <012101cdb690$593a20e0$0bae62a0$@rdnet.fi> References: <010801cdb68e$68ed5d10$3ac81730$@rdnet.fi> <5DA090DC8DCD3549BE9DF08C5074509E01606E988B@indiambx01.corp.adobe.com> <012101cdb690$593a20e0$0bae62a0$@rdnet.fi> Message-ID: <5DA090DC8DCD3549BE9DF08C5074509E01606E9890@indiambx01.corp.adobe.com> >> Hi Chandranath >> Thanks! >> But I already allocated memory for the pointer *ic_enc_mjpeg OK. Sorry. I did not realize you meant the crash occurred even after allocation. >> AVFormatContext *ic_enc_mjpeg; >> ic_enc_mjpeg = (AVFormatContext *)av_malloc(sizeof(AVFormatContext)); >> Then I tried to allocate the memory for ic_enc_mjpeg->streams[0], then it crashed. streams variable inside AVFormatContext is AVStream **. So the allocation of AVFormatContext using av_malloc is not supposed to initialize/allocate it. Hence the crash. Check the documentation in header avformat.h for more info. The crash can be fixed by the following code. AVFormatContext *ic_enc_mjpeg; ic_enc_mjpeg = (AVFormatContext *)av_malloc(sizeof(AVFormatContext)); ic_enc_mjpeg->streams = (AVStream **)av_malloc(sizeof(AVStream *)); // <== DO THIS. ic_enc_mjpeg->nb_streams = 1; // OR WHATEVER. ic_enc_mjpeg->streams[0] = (AVStream *)av_malloc(sizeof(AVStream)); Regards, Chandranath -------------- next part -------------- An HTML attachment was scrubbed... URL: From h.leppkes at gmail.com Tue Oct 30 12:34:22 2012 From: h.leppkes at gmail.com (Hendrik Leppkes) Date: Tue, 30 Oct 2012 12:34:22 +0100 Subject: [Libav-user] (AVStream *)av_malloc(sizeof(AVStream)) crashed the application In-Reply-To: <5DA090DC8DCD3549BE9DF08C5074509E01606E9890@indiambx01.corp.adobe.com> References: <010801cdb68e$68ed5d10$3ac81730$@rdnet.fi> <5DA090DC8DCD3549BE9DF08C5074509E01606E988B@indiambx01.corp.adobe.com> <012101cdb690$593a20e0$0bae62a0$@rdnet.fi> <5DA090DC8DCD3549BE9DF08C5074509E01606E9890@indiambx01.corp.adobe.com> Message-ID: On Tue, Oct 30, 2012 at 12:28 PM, Chandranath Bhattacharyya wrote: >>> Hi Chandranath > > > >>> Thanks! > > > >>> But I already allocated memory for the pointer *ic_enc_mjpeg > > OK. Sorry. I did not realize you meant the crash occurred > even after allocation. > > > >>> AVFormatContext *ic_enc_mjpeg; > >>> ic_enc_mjpeg = (AVFormatContext *)av_malloc(sizeof(AVFormatContext)); > > > >>> Then I tried to allocate the memory for ic_enc_mjpeg->streams[0], then it >>> crashed. > > > > streams variable inside AVFormatContext is AVStream **. So the allocation of > AVFormatContext using av_malloc is not supposed to initialize/allocate it. > Hence the crash. > > > > Check the documentation in header avformat.h for more info. > > > > The crash can be fixed by the following code. > > > > AVFormatContext *ic_enc_mjpeg; > > ic_enc_mjpeg = (AVFormatContext *)av_malloc(sizeof(AVFormatContext)); > > ic_enc_mjpeg->streams = (AVStream **)av_malloc(sizeof(AVStream *)); // ? DO > THIS. > > ic_enc_mjpeg->nb_streams = 1; // OR WHATEVER. > > ic_enc_mjpeg->streams[0] = (AVStream *)av_malloc(sizeof(AVStream)); > > > Hi, you should not manually allocate such structures, use the appropriate functions for this. AVFormatContext *ic_enc_mjpeg; ic_enc_mjpeg = avformat_alloc_context(); AVStream *st = avformat_new_stream(ic_enc_mjpeg, NULL); .. and then do your work with the "st" object. Ideally, also pass an AVCodec object to avformat_new_stream instead of NULL, appropriate for the codec that you want to use. - Hendrik From zhou.wenpeng at rdnet.fi Tue Oct 30 12:34:58 2012 From: zhou.wenpeng at rdnet.fi (Wenpeng Zhou) Date: Tue, 30 Oct 2012 13:34:58 +0200 Subject: [Libav-user] (AVStream *)av_malloc(sizeof(AVStream)) crashed the application In-Reply-To: <5DA090DC8DCD3549BE9DF08C5074509E01606E9890@indiambx01.corp.adobe.com> References: <010801cdb68e$68ed5d10$3ac81730$@rdnet.fi> <5DA090DC8DCD3549BE9DF08C5074509E01606E988B@indiambx01.corp.adobe.com> <012101cdb690$593a20e0$0bae62a0$@rdnet.fi> <5DA090DC8DCD3549BE9DF08C5074509E01606E9890@indiambx01.corp.adobe.com> Message-ID: <013a01cdb692$980383a0$c80a8ae0$@rdnet.fi> Hi Chandranath and Geek.Song Thanks! I see. I fixed as your suggested. From: libav-user-bounces at ffmpeg.org [mailto:libav-user-bounces at ffmpeg.org] On Behalf Of Chandranath Bhattacharyya Sent: 30. lokakuuta 2012 13:28 To: This list is about using libavcodec, libavformat, libavutil, libavdevice and libavfilter. Subject: Re: [Libav-user] (AVStream *)av_malloc(sizeof(AVStream)) crashed the application >> Hi Chandranath >> Thanks! >> But I already allocated memory for the pointer *ic_enc_mjpeg OK. Sorry. I did not realize you meant the crash occurred even after allocation. >> AVFormatContext *ic_enc_mjpeg; >> ic_enc_mjpeg = (AVFormatContext *)av_malloc(sizeof(AVFormatContext)); >> Then I tried to allocate the memory for ic_enc_mjpeg->streams[0], then it crashed. streams variable inside AVFormatContext is AVStream **. So the allocation of AVFormatContext using av_malloc is not supposed to initialize/allocate it. Hence the crash. Check the documentation in header avformat.h for more info. The crash can be fixed by the following code. AVFormatContext *ic_enc_mjpeg; ic_enc_mjpeg = (AVFormatContext *)av_malloc(sizeof(AVFormatContext)); ic_enc_mjpeg->streams = (AVStream **)av_malloc(sizeof(AVStream *)); // ? DO THIS. ic_enc_mjpeg->nb_streams = 1; // OR WHATEVER. ic_enc_mjpeg->streams[0] = (AVStream *)av_malloc(sizeof(AVStream)); Regards, Chandranath -------------- next part -------------- An HTML attachment was scrubbed... URL: From zhou.wenpeng at rdnet.fi Tue Oct 30 12:43:28 2012 From: zhou.wenpeng at rdnet.fi (Wenpeng Zhou) Date: Tue, 30 Oct 2012 13:43:28 +0200 Subject: [Libav-user] (AVStream *)av_malloc(sizeof(AVStream)) crashed the application In-Reply-To: References: <010801cdb68e$68ed5d10$3ac81730$@rdnet.fi> <5DA090DC8DCD3549BE9DF08C5074509E01606E988B@indiambx01.corp.adobe.com> <012101cdb690$593a20e0$0bae62a0$@rdnet.fi> <5DA090DC8DCD3549BE9DF08C5074509E01606E9890@indiambx01.corp.adobe.com> Message-ID: <014d01cdb693$c7a094d0$56e1be70$@rdnet.fi> Hi Hendrik Thanks! -----Original Message----- From: libav-user-bounces at ffmpeg.org [mailto:libav-user-bounces at ffmpeg.org] On Behalf Of Hendrik Leppkes Sent: 30. lokakuuta 2012 13:34 To: This list is about using libavcodec, libavformat, libavutil, libavdevice and libavfilter. Subject: Re: [Libav-user] (AVStream *)av_malloc(sizeof(AVStream)) crashed the application On Tue, Oct 30, 2012 at 12:28 PM, Chandranath Bhattacharyya wrote: >>> Hi Chandranath > > > >>> Thanks! > > > >>> But I already allocated memory for the pointer *ic_enc_mjpeg > > OK. Sorry. I did not realize you meant the crash > occurred even after allocation. > > > >>> AVFormatContext *ic_enc_mjpeg; > >>> ic_enc_mjpeg = (AVFormatContext >>> *)av_malloc(sizeof(AVFormatContext)); > > > >>> Then I tried to allocate the memory for ic_enc_mjpeg->streams[0], >>> then it crashed. > > > > streams variable inside AVFormatContext is AVStream **. So the > allocation of AVFormatContext using av_malloc is not supposed to initialize/allocate it. > Hence the crash. > > > > Check the documentation in header avformat.h for more info. > > > > The crash can be fixed by the following code. > > > > AVFormatContext *ic_enc_mjpeg; > > ic_enc_mjpeg = (AVFormatContext *)av_malloc(sizeof(AVFormatContext)); > > ic_enc_mjpeg->streams = (AVStream **)av_malloc(sizeof(AVStream *)); // > ? DO THIS. > > ic_enc_mjpeg->nb_streams = 1; // OR WHATEVER. > > ic_enc_mjpeg->streams[0] = (AVStream *)av_malloc(sizeof(AVStream)); > > > Hi, you should not manually allocate such structures, use the appropriate functions for this. AVFormatContext *ic_enc_mjpeg; ic_enc_mjpeg = avformat_alloc_context(); AVStream *st = avformat_new_stream(ic_enc_mjpeg, NULL); .. and then do your work with the "st" object. Ideally, also pass an AVCodec object to avformat_new_stream instead of NULL, appropriate for the codec that you want to use. - Hendrik _______________________________________________ Libav-user mailing list Libav-user at ffmpeg.org http://ffmpeg.org/mailman/listinfo/libav-user From zhou.wenpeng at rdnet.fi Tue Oct 30 12:58:29 2012 From: zhou.wenpeng at rdnet.fi (Wenpeng Zhou) Date: Tue, 30 Oct 2012 13:58:29 +0200 Subject: [Libav-user] Can not open dshow usb camera by avformat_open_input() Message-ID: <014f01cdb695$e0d54cf0$a27fe6d0$@rdnet.fi> Hi, I try to use the USB camera with windows. But I failed. { AVFormatContext *pFormatCtx; av_register_all(); AVInputFormat * a= av_find_input_format("dshow"); avformat_open_input(&pFormatCtx, "video=Mercury USB2.0 Camera", a, NULL); } The function avformat_open_input() crashed. Please help me. Thanks! From mark.kenna at sureviewsystems.com Tue Oct 30 14:01:15 2012 From: mark.kenna at sureviewsystems.com (Mark Kenna) Date: Tue, 30 Oct 2012 13:01:15 +0000 Subject: [Libav-user] Dll Versioning In-Reply-To: References: <20121030105150.GA29133@phare.normalesup.org> Message-ID: On 30 October 2012 10:55, Mark Kenna wrote: > On 30 October 2012 10:51, Nicolas George wrote: > >> Le nonidi 9 brumaire, an CCXXI, Mark Kenna a ?crit : >> > I am trying to find a way of allowing my application to be able to load >> > multiple versions of the FFMpeg DLL's at the same time. >> >> Why would you want to do that? >> >> The simplest solution to your problem is probably to find out how not to >> need it. >> >> Regards, >> >> -- >> Nicolas George >> >> -----BEGIN PGP SIGNATURE----- >> Version: GnuPG v1.4.12 (GNU/Linux) >> >> iEYEARECAAYFAlCPsUYACgkQsGPZlzblTJOwnwCfT+lnhjDNCSK/zzpnvzWwPwz6 >> 2w4AoMK7j0HXl7hdQb6NIaUTricZhVJ9 >> =1+7I >> -----END PGP SIGNATURE----- >> >> >> _______________________________________________ >> Libav-user mailing list >> Libav-user at ffmpeg.org >> http://ffmpeg.org/mailman/listinfo/libav-user >> >> > I need to do that because we constantly find ourselves having FFMpeg-based > modules which overwrite our .dll files with older versions causing serious > crashing. I just need to be able to stop "drop-ins" from interfering with > the version that we are running. > > Thanks, > Mark. > > I have also explored the option of statically linking the libraries but this is not possible in MSVC++ right? Surely there has to be a way to do this! Mark. -------------- next part -------------- An HTML attachment was scrubbed... URL: From alexcohn at netvision.net.il Tue Oct 30 14:21:36 2012 From: alexcohn at netvision.net.il (Alex Cohn) Date: Tue, 30 Oct 2012 15:21:36 +0200 Subject: [Libav-user] Dll Versioning In-Reply-To: References: <20121030105150.GA29133@phare.normalesup.org> Message-ID: On 30 Oct 2012 15:01, "Mark Kenna" wrote: > > On 30 October 2012 10:55, Mark Kenna wrote: >> >> On 30 October 2012 10:51, Nicolas George wrote: >>> >>> Le nonidi 9 brumaire, an CCXXI, Mark Kenna a ?crit : >>> > I am trying to find a way of allowing my application to be able to load >>> > multiple versions of the FFMpeg DLL's at the same time. >>> >>> Why would you want to do that? >>> >>> The simplest solution to your problem is probably to find out how not to >>> need it. >>> >>> Regards, >>> >>> -- >>> Nicolas George >> >> I need to do that because we constantly find ourselves having FFMpeg-based modules which overwrite our .dll files with older versions causing serious crashing. I just need to be able to stop "drop-ins" from interfering with the version that we are running. >> >> Thanks, >> Mark. >> > > I have also explored the option of statically linking the libraries but this is not possible in MSVC++ right? Surely there has to be a way to do this! > > Mark. Have you read a similar recent discussion on stackoverflow( http://stackoverflow.com/questions/11701635/use-ffmpeg-in-visual-studio)? Today zeranoe archives include version number in the dll names. Are you using a different source of precompiled Windows binaries? Anyway, it's good practise to install the DLLs in your app directory, next to the executable that will load them, and not in a shared directory where other applications could override them or be hit because your installation overwrought the files they relied upon. BR, Alex -------------- next part -------------- An HTML attachment was scrubbed... URL: From mark.kenna at sureviewsystems.com Tue Oct 30 14:27:44 2012 From: mark.kenna at sureviewsystems.com (Mark Kenna) Date: Tue, 30 Oct 2012 13:27:44 +0000 Subject: [Libav-user] Dll Versioning In-Reply-To: References: <20121030105150.GA29133@phare.normalesup.org> Message-ID: On 30 October 2012 13:21, Alex Cohn wrote: > On 30 Oct 2012 15:01, "Mark Kenna" wrote: > > > > On 30 October 2012 10:55, Mark Kenna > wrote: > >> > >> On 30 October 2012 10:51, Nicolas George > wrote: > >>> > >>> Le nonidi 9 brumaire, an CCXXI, Mark Kenna a ?crit : > >>> > I am trying to find a way of allowing my application to be able to > load > >>> > multiple versions of the FFMpeg DLL's at the same time. > >>> > >>> Why would you want to do that? > >>> > >>> The simplest solution to your problem is probably to find out how not > to > >>> need it. > >>> > >>> Regards, > >>> > >>> -- > >>> Nicolas George > >> > >> I need to do that because we constantly find ourselves having > FFMpeg-based modules which overwrite our .dll files with older versions > causing serious crashing. I just need to be able to stop "drop-ins" from > interfering with the version that we are running. > >> > >> Thanks, > >> Mark. > >> > > > > I have also explored the option of statically linking the libraries but > this is not possible in MSVC++ right? Surely there has to be a way to do > this! > > > > Mark. > > Have you read a similar recent discussion on stackoverflow( > http://stackoverflow.com/questions/11701635/use-ffmpeg-in-visual-studio)? > > Today zeranoe archives include version number in the dll names. Are you > using a different source of precompiled Windows binaries? > > Anyway, it's good practise to install the DLLs in your app directory, next > to the executable that will load them, and not in a shared directory where > other applications could override them or be hit because your installation > overwrought the files they relied upon. > > BR, > Alex > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > > I've seen that link, it describes how to dynamically link rather than statically link. Also, some of the file name's in the automated builds are not incremented so older version will break them (swscale for example). Statically linking so that I no longer require the .dll files at runtime would solve my issue, the other alternative is to try and change the PE to reference modified filenames (which is crazy). Thanks, Mark. -------------- next part -------------- An HTML attachment was scrubbed... URL: From zhou.wenpeng at rdnet.fi Tue Oct 30 14:28:28 2012 From: zhou.wenpeng at rdnet.fi (Wenpeng Zhou) Date: Tue, 30 Oct 2012 15:28:28 +0200 Subject: [Libav-user] Can not open dshow usb camera by avformat_open_input() In-Reply-To: <014f01cdb695$e0d54cf0$a27fe6d0$@rdnet.fi> References: <014f01cdb695$e0d54cf0$a27fe6d0$@rdnet.fi> Message-ID: <015d01cdb6a2$72a5fb50$57f1f1f0$@rdnet.fi> Hi The problem was resolved. -----Original Message----- From: libav-user-bounces at ffmpeg.org [mailto:libav-user-bounces at ffmpeg.org] On Behalf Of Wenpeng Zhou Sent: 30. lokakuuta 2012 13:58 To: 'This list is about using libavcodec, libavformat, libavutil, libavdevice and libavfilter.' Subject: [Libav-user] Can not open dshow usb camera by avformat_open_input() Hi, I try to use the USB camera with windows. But I failed. { AVFormatContext *pFormatCtx; av_register_all(); AVInputFormat * a= av_find_input_format("dshow"); avformat_open_input(&pFormatCtx, "video=Mercury USB2.0 Camera", a, NULL); } The function avformat_open_input() crashed. Please help me. Thanks! _______________________________________________ Libav-user mailing list Libav-user at ffmpeg.org http://ffmpeg.org/mailman/listinfo/libav-user From rogerdpack2 at gmail.com Tue Oct 30 14:45:58 2012 From: rogerdpack2 at gmail.com (Roger Pack) Date: Tue, 30 Oct 2012 07:45:58 -0600 Subject: [Libav-user] soft telecine 29.97 fps In-Reply-To: References: Message-ID: > When i use ffmpeg to encode an h264 input into mpeg2 video, I notice that even though my h264 file has some frames with pic_struct = 8 indicating frame doubling for soft telecined video, the mpeg2 output has the repeat_first_field set to 0 on all frames. > > Does the ffmpeg mpeg2 encoder support soft telecine output with 24 physical frames and repeat field set to get the fps to 29.97 ? does yaddif help? From pradeep.kumarche at gmail.com Tue Oct 30 10:47:30 2012 From: pradeep.kumarche at gmail.com (pradeep) Date: Tue, 30 Oct 2012 02:47:30 -0700 (PDT) Subject: [Libav-user] AVFilter abuffer Buffering limit reached In-Reply-To: <4F7DADF0.5000808@ais-sim.com> References: <4F7DADF0.5000808@ais-sim.com> Message-ID: <1351590450311-4655942.post@n4.nabble.com> I am trying to merge two amr files using the similar procedure. Can u help me by giving the complete sample code to do amerge filter. -- View this message in context: http://libav-users.943685.n4.nabble.com/Libav-user-AVFilter-abuffer-Buffering-limit-reached-tp4535931p4655942.html Sent from the libav-users mailing list archive at Nabble.com. From alexcohn at netvision.net.il Tue Oct 30 21:02:12 2012 From: alexcohn at netvision.net.il (Alex Cohn) Date: Tue, 30 Oct 2012 22:02:12 +0200 Subject: [Libav-user] Dll Versioning In-Reply-To: References: <20121030105150.GA29133@phare.normalesup.org> Message-ID: On Tue, Oct 30, 2012 at 3:27 PM, Mark Kenna wrote: > On 30 October 2012 13:21, Alex Cohn wrote: >> >> On 30 Oct 2012 15:01, "Mark Kenna" wrote: >> > >> > On 30 October 2012 10:55, Mark Kenna >> > wrote: >> >> >> >> On 30 October 2012 10:51, Nicolas George >> >> wrote: >> >>> >> >>> Le nonidi 9 brumaire, an CCXXI, Mark Kenna a ?crit : >> >>> > I am trying to find a way of allowing my application to be able to >> >>> > load >> >>> > multiple versions of the FFMpeg DLL's at the same time. >> >>> >> >>> Why would you want to do that? >> >>> >> >>> The simplest solution to your problem is probably to find out how not >> >>> to >> >>> need it. >> >>> >> >>> Regards, >> >>> >> >>> -- >> >>> Nicolas George >> >> >> >> I need to do that because we constantly find ourselves having >> >> FFMpeg-based modules which overwrite our .dll files with older versions >> >> causing serious crashing. I just need to be able to stop "drop-ins" from >> >> interfering with the version that we are running. >> >> >> >> Thanks, >> >> Mark. >> >> >> > >> > I have also explored the option of statically linking the libraries but >> > this is not possible in MSVC++ right? Surely there has to be a way to do >> > this! >> > >> > Mark. >> >> Have you read a similar recent discussion on stackoverflow( >> http://stackoverflow.com/questions/11701635/use-ffmpeg-in-visual-studio)? >> >> Today zeranoe archives include version number in the dll names. Are you >> using a different source of precompiled Windows binaries? >> >> Anyway, it's good practise to install the DLLs in your app directory, next >> to the executable that will load them, and not in a shared directory where >> other applications could override them or be hit because your installation >> overwrought the files they relied upon. >> >> BR, >> Alex > > I've seen that link, it describes how to dynamically link rather than > statically link. Also, some of the file name's in the automated builds are > not incremented so older version will break them (swscale for example). Fair enough. > Statically linking so that I no longer require the .dll files at runtime > would solve my issue, the other alternative is to try and change the PE to > reference modified filenames (which is crazy). The other alternative is to deploy your preferred versions of the dynamic libraries to a private directory of your application. Unlike Unix, you are guaranteed that the system loader will prefer to pick up the DLL files that are in the same directory as the executable that needs them. BR, Alex > > Thanks, > Mark. From zhou.wenpeng at rdnet.fi Tue Oct 30 22:02:59 2012 From: zhou.wenpeng at rdnet.fi (Wenpeng Zhou) Date: Tue, 30 Oct 2012 23:02:59 +0200 Subject: [Libav-user] How can we parse the command to C++ code? Message-ID: <000001cdb6e1$f226ac50$d67404f0$@rdnet.fi> Hi, I need to parse the following command to C++ code. ffmpeg -f dshow -r 25 -s 640x480 -i video="USB2.0_Camera":audio="Microphone (USB Audio Device)" output.avi Who can provide help? Thanks! From donmoir at comcast.net Tue Oct 30 22:04:32 2012 From: donmoir at comcast.net (Don Moir) Date: Tue, 30 Oct 2012 17:04:32 -0400 Subject: [Libav-user] Dll Versioning References: <20121030105150.GA29133@phare.normalesup.org> Message-ID: >>> Have you read a similar recent discussion on stackoverflow( >>> http://stackoverflow.com/questions/11701635/use-ffmpeg-in-visual-studio)? >>> >>> Today zeranoe archives include version number in the dll names. Are you >>> using a different source of precompiled Windows binaries? >>> >>> Anyway, it's good practise to install the DLLs in your app directory, next >>> to the executable that will load them, and not in a shared directory where >>> other applications could override them or be hit because your installation >>> overwrought the files they relied upon. >>> >>> BR, >>> Alex >> >> I've seen that link, it describes how to dynamically link rather than >> statically link. Also, some of the file name's in the automated builds are >> not incremented so older version will break them (swscale for example). >Fair enough. >> Statically linking so that I no longer require the .dll files at runtime >>would solve my issue, the other alternative is to try and change the PE to >> reference modified filenames (which is crazy). >The other alternative is to deploy your preferred versions of the >dynamic libraries to a private directory of your application. Unlike >Unix, you are guaranteed that the system loader will prefer to pick up >the DLL files that are in the same directory as the executable that >needs them. I had to go round and round with this a few times. A static link would be best but as I undertand it, it may not work. I have not tried it personally and you can find some info about that on zeranoe. Outside of ffmpeg I static link other libraries. If someone is successful static linking using ffmpeg under windows and using MSVC please let us know. o - it's not always possible to put the dlls in the same place as the application. This has to do with the application might be a dll and being used as a plugin. Then the calling application will also think the ffmpeg dlls should also be listed as plugins. o - I created a utility that will rename the dll's and all refereneces in the lib and dll's. Beware of the rules for renaming the ffmpeg dll's. This is useful if the names of ffmpeg dlls change and you don't want to build acummulation of old dlls. Also useful if you want to indentify the ffmpeg dlls are part of your app. The utility is something thats a raw development tool and not intended to hand out but email me on it if interested. o - If you can't put the dll's in the same directory as the application for some reason, then use a subdirectory or some specific application directory. In this case you can use LoadLibrary but beware loading all the ffmpeg functions can eat memory and so best to use some kind of thunk for it. An alternative is to use an interface dll which you do a LoadLibrary on that links to the ffmpeg dlls. Now before you to do LoadLibrary on interface DLL, add to the DLL search order by calling SetDLLDirectory. You can also try using delay loading which gives you the oportunity to change on the fly, where to look for your dlls. http://msdn.microsoft.com/en-us/library/151kt790.aspx From alexcohn at netvision.net.il Tue Oct 30 22:25:03 2012 From: alexcohn at netvision.net.il (Alex Cohn) Date: Tue, 30 Oct 2012 23:25:03 +0200 Subject: [Libav-user] Dll Versioning In-Reply-To: References: <20121030105150.GA29133@phare.normalesup.org> Message-ID: On Tue, Oct 30, 2012 at 11:04 PM, Don Moir wrote: >>>> Have you read a similar recent discussion on stackoverflow( >>>> >>>> http://stackoverflow.com/questions/11701635/use-ffmpeg-in-visual-studio)? >>>> >>>> Today zeranoe archives include version number in the dll names. Are you >>>> using a different source of precompiled Windows binaries? >>>> >>>> Anyway, it's good practise to install the DLLs in your app directory, >>>> next >>>> to the executable that will load them, and not in a shared directory >>>> where >>>> other applications could override them or be hit because your >>>> installation >>>> overwrought the files they relied upon. >>>> >>>> BR, >>>> Alex >>> >>> >>> I've seen that link, it describes how to dynamically link rather than >>> statically link. Also, some of the file name's in the automated builds >>> are >>> not incremented so older version will break them (swscale for example). > > >> Fair enough. > > >>> Statically linking so that I no longer require the .dll files at runtime >>> would solve my issue, the other alternative is to try and change the PE >>> to >>> reference modified filenames (which is crazy). > > >> The other alternative is to deploy your preferred versions of the >> dynamic libraries to a private directory of your application. Unlike >> Unix, you are guaranteed that the system loader will prefer to pick up >> the DLL files that are in the same directory as the executable that >> needs them. > > > I had to go round and round with this a few times. A static link would be > best but as I undertand it, it may not work. I have not tried it personally > and you can find some info about that on zeranoe. Outside of ffmpeg I static > link other libraries. If someone is successful static linking using ffmpeg > under windows and using MSVC please let us know. > > o - it's not always possible to put the dlls in the same place as the > application. This has to do with the application might be a dll and being > used as a plugin. Then the calling application will also think the ffmpeg > dlls should also be listed as plugins. > > o - I created a utility that will rename the dll's and all refereneces in > the lib and dll's. Beware of the rules for renaming the ffmpeg dll's. This > is useful if the names of ffmpeg dlls change and you don't want to build > acummulation of old dlls. Also useful if you want to indentify the ffmpeg > dlls are part of your app. The utility is something thats a raw development > tool and not intended to hand out but email me on it if interested. > > o - If you can't put the dll's in the same directory as the application for > some reason, then use a subdirectory or some specific application directory. > In this case you can use LoadLibrary but beware loading all the ffmpeg > functions can eat memory and so best to use some kind of thunk for it. An > alternative is to use an interface dll which you do a LoadLibrary on that > links to the ffmpeg dlls. Now before you to do LoadLibrary on interface DLL, > add to the DLL search order by calling SetDLLDirectory. > > You can also try using delay loading which gives you the oportunity to > change on the fly, where to look for your dlls. Thanks for mentioning delay loading, this is probably the most reliable and clean technique if putting the dlls near executable is not possible for one of the reasons you mentioned above, or for any other reason. Sincerely, Alex From mark.kenna at sureviewsystems.com Tue Oct 30 23:03:05 2012 From: mark.kenna at sureviewsystems.com (Mark Kenna) Date: Tue, 30 Oct 2012 22:03:05 +0000 Subject: [Libav-user] Dll Versioning In-Reply-To: References: <20121030105150.GA29133@phare.normalesup.org> Message-ID: <6707676127905794168@unknownmsgid> On 30 Oct 2012, at 21:25, Alex Cohn wrote: > On Tue, Oct 30, 2012 at 11:04 PM, Don Moir wrote: >>>>> Have you read a similar recent discussion on stackoverflow( >>>>> >>>>> http://stackoverflow.com/questions/11701635/use-ffmpeg-in-visual-studio)? >>>>> >>>>> Today zeranoe archives include version number in the dll names. Are you >>>>> using a different source of precompiled Windows binaries? >>>>> >>>>> Anyway, it's good practise to install the DLLs in your app directory, >>>>> next >>>>> to the executable that will load them, and not in a shared directory >>>>> where >>>>> other applications could override them or be hit because your >>>>> installation >>>>> overwrought the files they relied upon. >>>>> >>>>> BR, >>>>> Alex >>>> >>>> >>>> I've seen that link, it describes how to dynamically link rather than >>>> statically link. Also, some of the file name's in the automated builds >>>> are >>>> not incremented so older version will break them (swscale for example). >> >> >>> Fair enough. >> >> >>>> Statically linking so that I no longer require the .dll files at runtime >>>> would solve my issue, the other alternative is to try and change the PE >>>> to >>>> reference modified filenames (which is crazy). >> >> >>> The other alternative is to deploy your preferred versions of the >>> dynamic libraries to a private directory of your application. Unlike >>> Unix, you are guaranteed that the system loader will prefer to pick up >>> the DLL files that are in the same directory as the executable that >>> needs them. >> >> >> I had to go round and round with this a few times. A static link would be >> best but as I undertand it, it may not work. I have not tried it personally >> and you can find some info about that on zeranoe. Outside of ffmpeg I static >> link other libraries. If someone is successful static linking using ffmpeg >> under windows and using MSVC please let us know. >> >> o - it's not always possible to put the dlls in the same place as the >> application. This has to do with the application might be a dll and being >> used as a plugin. Then the calling application will also think the ffmpeg >> dlls should also be listed as plugins. >> >> o - I created a utility that will rename the dll's and all refereneces in >> the lib and dll's. Beware of the rules for renaming the ffmpeg dll's. This >> is useful if the names of ffmpeg dlls change and you don't want to build >> acummulation of old dlls. Also useful if you want to indentify the ffmpeg >> dlls are part of your app. The utility is something thats a raw development >> tool and not intended to hand out but email me on it if interested. >> >> o - If you can't put the dll's in the same directory as the application for >> some reason, then use a subdirectory or some specific application directory. >> In this case you can use LoadLibrary but beware loading all the ffmpeg >> functions can eat memory and so best to use some kind of thunk for it. An >> alternative is to use an interface dll which you do a LoadLibrary on that >> links to the ffmpeg dlls. Now before you to do LoadLibrary on interface DLL, >> add to the DLL search order by calling SetDLLDirectory. >> >> You can also try using delay loading which gives you the oportunity to >> change on the fly, where to look for your dlls. > > Thanks for mentioning delay loading, this is probably the most > reliable and clean technique if putting the dlls near executable is > not possible for one of the reasons you mentioned above, or for any > other reason. > > Sincerely, > Alex > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user I am currently working on a method of renaming the dll's by adding a version identifier. This involves changing the dll imports and lib files though. I am very interested in the tool you created to accomplish this. Maybe I could obtain a copy to see if I'm on the right track? Mark. From rjvbertin at gmail.com Tue Oct 30 23:15:12 2012 From: rjvbertin at gmail.com (=?iso-8859-1?Q?=22Ren=E9_J=2EV=2E_Bertin=22?=) Date: Tue, 30 Oct 2012 23:15:12 +0100 Subject: [Libav-user] pass-through "re-containering" with libavXXXX Message-ID: <47F362FE-27D7-4798-ACCD-A3EB0C69FE69@gmail.com> Hello list, Can someone point me to a bare-bones (possibly pseudo-code) implementation using libavformat, libavcodec etc. of a command like ffmpeg -i somekindofIncomplete.mp4 -vcodec copy wellFormed.m4v that takes an incomplete mp4 file (that doesn't play back in most players) and repackages the content without transcoding in a well formed m4v container? Thanks in advance, Ren? From zhou.wenpeng at rdnet.fi Wed Oct 31 08:48:18 2012 From: zhou.wenpeng at rdnet.fi (Wenpeng Zhou) Date: Wed, 31 Oct 2012 09:48:18 +0200 Subject: [Libav-user] avformat_open_input can not open input file (example code) Message-ID: <005301cdb73c$17fa41d0$47eec570$@rdnet.fi> Hi, I try to use USB camera to capture live stream with FFMpeg. But I cannot open dshow USB camera. What is wrong with my code? Thanks! #include #include using namespace std; int main (int argc, char **argv) { int frame_width = 640; int frame_height = 480; int frame_rate = 30; int video_bit_rate = 100*1000; av_register_all(); avformat_network_init(); AVCodec *encoder_mjpeg; encoder_mjpeg=avcodec_find_encoder(CODEC_ID_MJPEG); AVFormatContext *pFormatCtx = avformat_alloc_context(); AVStream *st = avformat_new_stream(pFormatCtx, encoder_mjpeg); st->codec = avcodec_alloc_context(); st->codec->bit_rate = video_bit_rate; st->codec->width = frame_width; st->codec->height = frame_height; st->codec->pix_fmt = PIX_FMT_YUVJ420P; st->codec->time_base.den = frame_rate; st->codec->time_base.num = 1; if (!encoder_mjpeg || avcodec_open(st->codec, encoder_mjpeg) < 0){ av_log(NULL, AV_LOG_ERROR, "Unable to open mjpeg encoder!\n"); } AVInputFormat * a= av_find_input_format("dshow"); int r = avformat_open_input(&pFormatCtx, "video=Mercury USB2.0 Camera", a, NULL); if(r < 0){ av_log(NULL, AV_LOG_ERROR, "Cannot open input file\n"); cout<<"The returned value is:"< References: <005301cdb73c$17fa41d0$47eec570$@rdnet.fi> Message-ID: <005501cdb749$ec09e720$c41db560$@rdnet.fi> Hi, The problem was resolved! -----Original Message----- From: libav-user-bounces at ffmpeg.org [mailto:libav-user-bounces at ffmpeg.org] On Behalf Of Wenpeng Zhou Sent: 31. lokakuuta 2012 9:48 To: 'This list is about using libavcodec, libavformat, libavutil, libavdevice and libavfilter.' Subject: [Libav-user] avformat_open_input can not open input file (example code) Hi, I try to use USB camera to capture live stream with FFMpeg. But I cannot open dshow USB camera. What is wrong with my code? Thanks! #include #include using namespace std; int main (int argc, char **argv) { int frame_width = 640; int frame_height = 480; int frame_rate = 30; int video_bit_rate = 100*1000; av_register_all(); avformat_network_init(); AVCodec *encoder_mjpeg; encoder_mjpeg=avcodec_find_encoder(CODEC_ID_MJPEG); AVFormatContext *pFormatCtx = avformat_alloc_context(); AVStream *st = avformat_new_stream(pFormatCtx, encoder_mjpeg); st->codec = avcodec_alloc_context(); st->codec->bit_rate = video_bit_rate; st->codec->width = frame_width; st->codec->height = frame_height; st->codec->pix_fmt = PIX_FMT_YUVJ420P; st->codec->time_base.den = frame_rate; st->codec->time_base.num = 1; if (!encoder_mjpeg || avcodec_open(st->codec, encoder_mjpeg) < 0){ av_log(NULL, AV_LOG_ERROR, "Unable to open mjpeg encoder!\n"); } AVInputFormat * a= av_find_input_format("dshow"); int r = avformat_open_input(&pFormatCtx, "video=Mercury USB2.0 Camera", a, NULL); if(r < 0){ av_log(NULL, AV_LOG_ERROR, "Cannot open input file\n"); cout<<"The returned value is:"< hi guy's, i'new in libav and have a little problem. i have a thread which read frames from a usb-camera. this is happening in a thread, which i made pauseable. but when i pause the thread the real time buffer stil get filled with frames from the camera until it is full. so when i continue the thread, first i see the old frames. question: how do i flush the relatime buffer. i tried to free the packet buffers (seen in utils). flush_packet_queue(AVFormatContext *s) or ff_read_frame_flush(AVFormatContext *s) (which is also calling flush_packet_queue()). but no effect. when i take a video as input, everything goes fine. thanks for every inspiration. pete -- View this message in context: http://libav-users.943685.n4.nabble.com/usb-camera-fill-realtime-buffer-tp4655970.html Sent from the libav-users mailing list archive at Nabble.com. From zhou.wenpeng at rdnet.fi Wed Oct 31 13:22:40 2012 From: zhou.wenpeng at rdnet.fi (Wenpeng Zhou) Date: Wed, 31 Oct 2012 14:22:40 +0200 Subject: [Libav-user] How can we set frame size for live stream? Message-ID: <005a01cdb762$6c9981d0$45cc8570$@rdnet.fi> Hi, I use the USB camera to capture live video. The default codec context is: Input #0, dshow, from 'video=Mercury USB2.0 Camera': Duration: N/A, start: 58890.453000, bitrate: N/A Stream #0:0: Video: mjpeg, yuvj422p, 1280x720, 30 tbr, 10000k tbn, 30 tbc I hope to change frame size from 1280x720 to 640x480. I tried AVCodecContext pCodecCtx->width = 640; pCodecCtx->height = 480; But this did not work. Thanks! From cehoyos at ag.or.at Wed Oct 31 13:34:22 2012 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Wed, 31 Oct 2012 12:34:22 +0000 (UTC) Subject: [Libav-user] How can we set frame size for live stream? References: <005a01cdb762$6c9981d0$45cc8570$@rdnet.fi> Message-ID: Wenpeng Zhou writes: > Input #0, dshow, from 'video=Mercury USB2.0 Camera': > Duration: N/A, start: 58890.453000, bitrate: N/A > Stream #0:0: Video: mjpeg, yuvj422p, 1280x720, > 30 tbr, 10000k tbn, 30 tbc > > I hope to change frame size from 1280x720 to 640x480. If your question is: "How can I convince the decoder to output the frames that where originally encoded with a size of 1280x720 as 640x480, ie how can the decoder do a resize?" Then the answer is: This is generally impossible, a decoder outputs the frame that was encoded, there is libswscale (or the scale filter that uses libswscale) to do the resizing. There is an exception though: You can use -lowres 1 with some decoders (for example mjpeg iirc) to decode with lower resolution (and quality!) and faster speed to "half" (actually quarter) resolution, in your case that would be 640x360. (I don't think this is what you are searching for, but it is useful on very low-end hardware.) Carl Eugen From zhou.wenpeng at rdnet.fi Wed Oct 31 13:48:04 2012 From: zhou.wenpeng at rdnet.fi (Wenpeng Zhou) Date: Wed, 31 Oct 2012 14:48:04 +0200 Subject: [Libav-user] How can we set frame size for live stream? In-Reply-To: References: <005a01cdb762$6c9981d0$45cc8570$@rdnet.fi> Message-ID: <006901cdb765$f878f930$e96aeb90$@rdnet.fi> Hi Carl, Thanks for your reply! I mean this command. ffplay -f dshow -i video="Mercury USB2.0 Camera" -s 640x480 How can we set 640x480 in C++ code? -----Original Message----- From: libav-user-bounces at ffmpeg.org [mailto:libav-user-bounces at ffmpeg.org] On Behalf Of Carl Eugen Hoyos Sent: 31. lokakuuta 2012 14:34 To: libav-user at ffmpeg.org Subject: Re: [Libav-user] How can we set frame size for live stream? Wenpeng Zhou writes: > Input #0, dshow, from 'video=Mercury USB2.0 Camera': > Duration: N/A, start: 58890.453000, bitrate: N/A > Stream #0:0: Video: mjpeg, yuvj422p, 1280x720, > 30 tbr, 10000k tbn, 30 tbc > > I hope to change frame size from 1280x720 to 640x480. If your question is: "How can I convince the decoder to output the frames that where originally encoded with a size of 1280x720 as 640x480, ie how can the decoder do a resize?" Then the answer is: This is generally impossible, a decoder outputs the frame that was encoded, there is libswscale (or the scale filter that uses libswscale) to do the resizing. There is an exception though: You can use -lowres 1 with some decoders (for example mjpeg iirc) to decode with lower resolution (and quality!) and faster speed to "half" (actually quarter) resolution, in your case that would be 640x360. (I don't think this is what you are searching for, but it is useful on very low-end hardware.) 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 Oct 31 13:57:32 2012 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Wed, 31 Oct 2012 12:57:32 +0000 (UTC) Subject: [Libav-user] How can we set frame size for live stream? References: <005a01cdb762$6c9981d0$45cc8570$@rdnet.fi> <006901cdb765$f878f930$e96aeb90$@rdnet.fi> Message-ID: Wenpeng Zhou writes: > I mean this command. > ffplay -f dshow -i video="Mercury USB2.0 Camera" -s 640x480 > > How can we set 640x480 in C++ code? To quote my original answer: > > there is libswscale (or the scale filter that uses > > libswscale) to do the resizing. See doc/examples/filtering_video.c for an example for on how to use video filters, doc/examples/scaling_video.c for an example on how to use libswscale. Please do not top-post here, it is considered rude, Carl Eugen From cehoyos at ag.or.at Wed Oct 31 14:03:37 2012 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Wed, 31 Oct 2012 13:03:37 +0000 (UTC) Subject: [Libav-user] soft telecine 29.97 fps References: Message-ID: Alex Balk writes: > When i use ffmpeg to encode an h264 input into mpeg2 video, > I notice that even though my h264 file has some frames with > pic_struct = 8 indicating frame doubling for soft telecined > video, the mpeg2 output has the repeat_first_field set to 0 > on all frames. I am mildly interested in this, but since I live in PAL-country, I don't know enough about it. Could you explain how the flag is useful for you? (I simply don't understand why you don't want to output the 24fps video with 24fps, but I am obviously missing something. Or is the original mixed telecine-progressive material? Then the next sentence is even more important, because I don't think we have such a sample for h264.) Please provide a sample. Carl Eugen From konglingshan at duoku.com Wed Oct 31 03:10:29 2012 From: konglingshan at duoku.com (lingshan kong) Date: Wed, 31 Oct 2012 10:10:29 +0800 Subject: [Libav-user] Need help for decoding AAC with ffmpeg and separated AVCodecContex Message-ID: hi I need some help with decoding AAC stream of audio. I get audio data via socket. It is neccessary to create AVCodecContext separately, not from AVFormatContext->streams[...]->codec; First i create AVCodec, AVCOdecContext and encode PCM data to AAC packet: avcodec_init(); avcodec_register_all(); AVCodec *encode = avcodec_find_encoder(CODEC_ID_AAC); if (!encode) { DBLog("codec not found codec\n"); //exit(1); } AVCodecContext *encodeContext= avcodec_alloc_context(); /* put sample parameters*/ encodeContext->sample_fmt = AV_SAMPLE_FMT_S16; encodeContext->bit_rate = 128000; encodeContext->sample_rate = 44100.00; encodeContext->channels = 2; if (avcodec_open(encodeContext, encode) < 0) { DBLog("could not open codec\n"); //exit(1); } char buffer[2048]; int size = 0; size = avcodec_encode_audio(encodeContext, (uint8_t*)buffer, 2048, (short*)pcm_buffer); This step works well, I can encode audio data successfully, then I send the data in buffer and it's size to remote device via socket, at the other side, I try to decode audio data to PCM: avcodec_init(); avcodec_register_all(); AVCodec *decode = avcodec_find_decoder(CODEC_ID_AAC); AVCodecContext *decodeContext = avcodec_alloc_context(); decodeContext->sample_fmt = AV_SAMPLE_FMT_S16; decodeContext->bit_rate = 128000; decodeContext->sample_rate = 44100.00; decodeContext->channels = 2; av_init_packet(&avpkt); ?? AudioData* data = [receivedAudioDataArray objectAtIndex:index];//received AAC data is in receivedAudioDataArray avpkt.data = (uint8_t*)[data.audioData bytes];// avpkt.size = data.bytes; if (avcodec_open(decodeContext, decode) < 0) { DBLog("could not open decodec\n"); assert(0); } int len = avcodec_decode_audio3(decodeContext, (short *)pcm_buffer, &out_size, &avpkt); When decode received data to PCM, I always get ?1, and get console log: channel element -1073948900.-1073948920 is not allocated I have been confused for one week, I want to know if my way is correct or not? Is something wrong with decodeContext's parameter? How can I decode audio data correctly? It is very appreciate to have your help, thank you. ---- Best Regards Kong -------------- next part -------------- An HTML attachment was scrubbed... URL: From mbradshaw at sorensonmedia.com Wed Oct 31 19:47:34 2012 From: mbradshaw at sorensonmedia.com (Michael Bradshaw) Date: Wed, 31 Oct 2012 12:47:34 -0600 Subject: [Libav-user] Need help for decoding AAC with ffmpeg and separated AVCodecContex In-Reply-To: References: Message-ID: On Tue, Oct 30, 2012 at 8:10 PM, lingshan kong wrote: > hi > > I need some help with decoding AAC stream of audio. What version of FFmpeg libraries are you using? There are some old functions you're using (like avcodec_open()). Also, try following the Audio Decoding (starts at line 236) example in doc/examples/decodeing_encoding.c, it does exactly what you want. Link to current file: http://git.videolan.org/?p=ffmpeg.git;a=blob;f=doc/examples/decoding_encoding.c;h=cc5953f4af01e1f1e1f9025f6a5243827a441c8d;hb=HEAD From zhou.wenpeng at rdnet.fi Wed Oct 31 23:06:32 2012 From: zhou.wenpeng at rdnet.fi (Wenpeng Zhou) Date: Thu, 1 Nov 2012 00:06:32 +0200 Subject: [Libav-user] How can we set frame size for live stream? In-Reply-To: References: <005a01cdb762$6c9981d0$45cc8570$@rdnet.fi> <006901cdb765$f878f930$e96aeb90$@rdnet.fi> Message-ID: <000f01cdb7b3$fdaf8560$f90e9020$@rdnet.fi> > I mean this command. > ffplay -f dshow -i video="Mercury USB2.0 Camera" -s 640x480 > > How can we set 640x480 in C++ code? To quote my original answer: > > there is libswscale (or the scale filter that uses > > libswscale) to do the resizing. See doc/examples/filtering_video.c for an example for on how to use video filters, doc/examples/scaling_video.c for an example on how to use libswscale. Please do not top-post here, it is considered rude, Carl Eugen ------------------------------------------------- Hi Carl, Thanks! But when I use the command ffmpeg -f dshow -list_options true -i video="Mercury USB2.0 Camera" It has the option [dshow @ 00a9eb00] vcodec=mjpeg min s=640x480 fps=30 max s=640x480 fps=30 Because I am newbie to ffmpeg, I suppose we can take the frame with size 640x480 directly. ffmpeg -f dshow -list_options true -i video="Mercury USB2.0 Camera" [dshow @ 00a9eb00] DirectShow video device options [dshow @ 00a9eb00] Pin "Capture" [dshow @ 00a9eb00] vcodec=mjpeg min s=1280x720 fps=30 max s=1280x720 fps=30 [dshow @ 00a9eb00] vcodec=mjpeg min s=1280x720 fps=30 max s=1280x720 fps=30 [dshow @ 00a9eb00] vcodec=mjpeg min s=640x480 fps=30 max s=640x480 fps=30 [dshow @ 00a9eb00] vcodec=mjpeg min s=640x480 fps=30 max s=640x480 fps=30 [dshow @ 00a9eb00] vcodec=mjpeg min s=1600x1200 fps=15 max s=1600x1200 fps=15 [dshow @ 00a9eb00] vcodec=mjpeg min s=1600x1200 fps=15 max s=1600x1200 fps=15 [dshow @ 00a9eb00] vcodec=mjpeg min s=800x600 fps=30 max s=800x600 fps=30 [dshow @ 00a9eb00] vcodec=mjpeg min s=800x600 fps=30 max s=800x600 fps=30 [dshow @ 00a9eb00] vcodec=mjpeg min s=1920x1080 fps=15 max s=1920x1080 fps=15 [dshow @ 00a9eb00] vcodec=mjpeg min s=1920x1080 fps=15 max s=1920x1080 fps=15 [dshow @ 00a9eb00] pixel_format=yuyv422 min s=1280x720 fps=10 max s=1280x720 fps=10 [dshow @ 00a9eb00] pixel_format=yuyv422 min s=1280x720 fps=10 max s=1280x720 fps=10 [dshow @ 00a9eb00] pixel_format=yuyv422 min s=640x480 fps=30 max s=640x480 fps=30 [dshow @ 00a9eb00] pixel_format=yuyv422 min s=640x480 fps=30 max s=640x480 fps=30 [dshow @ 00a9eb00] pixel_format=yuyv422 min s=352x288 fps=30 max s=352x288 fps=30 [dshow @ 00a9eb00] pixel_format=yuyv422 min s=352x288 fps=30 max s=352x288 fps=30 [dshow @ 00a9eb00] pixel_format=yuyv422 min s=320x240 fps=30 max s=320x240 fps=30 [dshow @ 00a9eb00] pixel_format=yuyv422 min s=320x240 fps=30 max s=320x240 fps=30 [dshow @ 00a9eb00] pixel_format=yuyv422 min s=160x120 fps=30 max s=160x120 fps=30 [dshow @ 00a9eb00] pixel_format=yuyv422 min s=160x120 fps=30 max s=160x120 fps=30 [dshow @ 00a9eb00] pixel_format=yuyv422 min s=1600x1200 fps=5 max s=1600x1200 fps=5 [dshow @ 00a9eb00] pixel_format=yuyv422 min s=1600x1200 fps=5 max s=1600x1200 fps=5 [dshow @ 00a9eb00] pixel_format=yuyv422 min s=1920x1080 fps=7.5 max s=1920x1080 fps=7.5 [dshow @ 00a9eb00] pixel_format=yuyv422 min s=1920x1080 fps=7.5 max s=1920x1080 fps=7.5 _______________________________________________ Libav-user mailing list Libav-user at ffmpeg.org http://ffmpeg.org/mailman/listinfo/libav-user