From ggarra13 at gmail.com Mon Jul 1 16:08:03 2013 From: ggarra13 at gmail.com (Gonzalo Garramuno) Date: Mon, 01 Jul 2013 11:08:03 -0300 Subject: [Libav-user] Slightly OT: playing DVDs Message-ID: <51D18D43.1060209@gmail.com> I've gotten to the point in my player in that I want to add support to play DVDs. However, I don't know where to begin. ffplay plays /dev/sr0 (scene menu) and VOBs, but more is needed. I was hoping I could borrow a couple of calls from dvdread and be on my way. However, dvdread seems to return blocks of information (which I don't know how to interpret). I was wondering if someone who has done this could provide some general help. Thanks in advance. From p.tushar99 at gmail.com Mon Jul 1 17:58:59 2013 From: p.tushar99 at gmail.com (Tushar Paithankar) Date: Mon, 1 Jul 2013 21:28:59 +0530 Subject: [Libav-user] libfaac Message-ID: Hi in Libfaac lib i oberved in encoder call there is flush upto 4 frame....? What is the need of flush....? Regards Tushar -------------- next part -------------- An HTML attachment was scrubbed... URL: From bersac_1 at hotmail.fr Tue Jul 2 10:08:53 2013 From: bersac_1 at hotmail.fr (... ...) Date: Tue, 2 Jul 2013 08:08:53 +0000 Subject: [Libav-user] Error while linking ffmpeg Message-ID: Hi, I am working on a project using ffmpeg and when I compiled, i get the following error : g++ -o test Capture.o EnregistrerVideo.o ffmpegTools.o FluxVideoModifie.o main_stream_vlc.o test.o Transcodage.o vizILogger.o VLCStreamer.o -lavformat -lavcodec -lavutil -lswscale -lopencv_core -lopencv_highgui -lvlc -lvlccore -lboost_filesystem -lboost_log_setup -lboost_log -lboost_chrono -lz -lpthread -ldl -lm /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../lib/libavcodec.so: undefined reference to `avpriv_update_lls at LIBAVUTIL_52'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../lib/libavcodec.so: undefined reference to `avpriv_evaluate_lls at LIBAVUTIL_52'collect2: ld returned 1 exit statusmake: *** [test] Error 1 I use the ffmpeg version I downloaded yersteday on git. Can you bhelp me fix this bug ? Any help would be appreciate,Cordially,Guillaume Bersac237bis rue de Pessac33000 Bordeaux06.65.30.89.43 -------------- next part -------------- An HTML attachment was scrubbed... URL: From wbsecg1 at gmail.com Tue Jul 2 10:53:40 2013 From: wbsecg1 at gmail.com (Wang Bin) Date: Tue, 2 Jul 2013 16:53:40 +0800 Subject: [Libav-user] Error while linking ffmpeg In-Reply-To: References: Message-ID: > Hi, > > I am working on a project using ffmpeg and when I compiled, i get the > following error : > > g++ -o test Capture.o EnregistrerVideo.o ffmpegTools.o FluxVideoModifie.o > main_stream_vlc.o test.o Transcodage.o vizILogger.o VLCStreamer.o > -lavformat -lavcodec -lavutil -lswscale -lopencv_core -lopencv_highgui > -lvlc -lvlccore -lboost_filesystem -lboost_log_setup -lboost_log > -lboost_chrono -lz -lpthread -ldl -lm > /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../lib/libavcodec.so: undefined > reference to `avpriv_update_lls at LIBAVUTIL_52' > /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../lib/libavcodec.so: undefined > reference to `avpriv_evaluate_lls at LIBAVUTIL_52' > collect2: ld returned 1 exit status > make: *** [test] Error 1 > > I use the ffmpeg version I downloaded yersteday on git. Can you bhelp me > fix this bug ? > > > Any help would be appreciate, > Cordially, > Guillaume Bersac > 237bis rue de Pessac > 33000 Bordeaux > 06.65.30.89.43 > > you may link to the wrong libavcodec -------------- next part -------------- An HTML attachment was scrubbed... URL: From bersac_1 at hotmail.fr Tue Jul 2 11:03:09 2013 From: bersac_1 at hotmail.fr (... ...) Date: Tue, 2 Jul 2013 09:03:09 +0000 Subject: [Libav-user] Error while linking ffmpeg In-Reply-To: References: , Message-ID: hi, Thanks for your response,>you may link to the wrong libavcodec How could I know that ?I only have one livavutil installed on my computer, here is the response to the command ldconfig -p|grep libav (command which list all the libraries installed on my computer and filter it :libavutil.so.52 (libc6,x86-64) => /usr/local/lib/libavutil.so.52 libavutil.so (libc6,x86-64) => /usr/local/lib/libavutil.so libavformat.so.55 (libc6,x86-64) => /usr/local/lib/libavformat.so.55 libavformat.so (libc6,x86-64) => /usr/local/lib/libavformat.so libavfilter.so.3 (libc6,x86-64) => /usr/local/lib/libavfilter.so.3 libavfilter.so (libc6,x86-64) => /usr/local/lib/libavfilter.so libavdevice.so.55 (libc6,x86-64) => /usr/local/lib/libavdevice.so.55 libavdevice.so (libc6,x86-64) => /usr/local/lib/libavdevice.so libavc1394.so.0 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libavc1394.so.0 libavc1394.so (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libavc1394.so libavcodec.so.55 (libc6,x86-64) => /usr/local/lib/libavcodec.so.55 libavcodec.so.55 (libc6,x86-64) => /usr/lib/libavcodec.so.55 libavcodec.so (libc6,x86-64) => /usr/local/lib/libavcodec.so libavcodec.so (libc6,x86-64) => /usr/lib/libavcodec.so The message error is still :g++ -o test Capture.o EnregistrerVideo.o ffmpegTools.o FluxVideoModifie.o main_stream_vlc.o test.o Transcodage.o vizILogger.o VLCStreamer.o -lavformat -lavcodec -lavutil -lswscale -lopencv_core -lopencv_highgui -lvlc -lvlccore -lboost_filesystem -lboost_log_setup -lboost_log -lboost_chrono -lz -lpthread -ldl -lm /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../lib/libavcodec.so: undefined reference to `avpriv_update_lls at LIBAVUTIL_52'/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../lib/libavcodec.so: undefined reference to `avpriv_evaluate_lls at LIBAVUTIL_52'collect2: ld returned 1 exit statusmake: *** [test] Error 1 Cordialement,Guillaume Bersac237bis rue de Pessac33000 Bordeaux06.65.30.89.43 -------------- next part -------------- An HTML attachment was scrubbed... URL: From wbsecg1 at gmail.com Tue Jul 2 11:28:23 2013 From: wbsecg1 at gmail.com (Wang Bin) Date: Tue, 2 Jul 2013 17:28:23 +0800 Subject: [Libav-user] Error while linking ffmpeg In-Reply-To: References: Message-ID: you must make sure the libav* match the header when compiling your code. you may add "-v" option to see details 2013/7/2 ... ... > hi, > > Thanks for your response, > >you may link to the wrong libavcodec > How could I know that ? > I only have one livavutil installed on my computer, here is the response > to the command ldconfig -p|grep libav (command which list all the libraries > installed on my computer and filter it : > > libavutil.so.52 (libc6,x86-64) => /usr/local/lib/libavutil.so.52 > > libavutil.so (libc6,x86-64) => /usr/local/lib/libavutil.so > libavformat.so.55 (libc6,x86-64) => /usr/local/lib/libavformat.so.55 > libavformat.so (libc6,x86-64) => /usr/local/lib/libavformat.so > libavfilter.so.3 (libc6,x86-64) => /usr/local/lib/libavfilter.so.3 > libavfilter.so (libc6,x86-64) => /usr/local/lib/libavfilter.so > libavdevice.so.55 (libc6,x86-64) => /usr/local/lib/libavdevice.so.55 > libavdevice.so (libc6,x86-64) => /usr/local/lib/libavdevice.so > libavc1394.so.0 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libavc1394.so.0 > libavc1394.so (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libavc1394.so > libavcodec.so.55 (libc6,x86-64) => /usr/local/lib/libavcodec.so.55 > libavcodec.so.55 (libc6,x86-64) => /usr/lib/libavcodec.so.55 > libavcodec.so (libc6,x86-64) => /usr/local/lib/libavcodec.so > libavcodec.so (libc6,x86-64) => /usr/lib/libavcodec.so > > The message error is still : > > g++ -o test Capture.o EnregistrerVideo.o ffmpegTools.o FluxVideoModifie.o > main_stream_vlc.o test.o Transcodage.o vizILogger.o VLCStreamer.o > -lavformat -lavcodec -lavutil -lswscale -lopencv_core -lopencv_highgui > -lvlc -lvlccore -lboost_filesystem -lboost_log_setup -lboost_log > -lboost_chrono -lz -lpthread -ldl -lm > /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../lib/libavcodec.so: undefined > reference to `avpriv_update_lls at LIBAVUTIL_52' > /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../lib/libavcodec.so: undefined > reference to `avpriv_evaluate_lls at LIBAVUTIL_52' > collect2: ld returned 1 exit status > make: *** [test] Error 1 > > > Cordialement, > Guillaume Bersac > 237bis rue de Pessac > 33000 Bordeaux > 06.65.30.89.43 > > _______________________________________________ > 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 bersac_1 at hotmail.fr Tue Jul 2 11:35:17 2013 From: bersac_1 at hotmail.fr (... ...) Date: Tue, 2 Jul 2013 09:35:17 +0000 Subject: [Libav-user] Error while linking ffmpeg In-Reply-To: References: , , , Message-ID: Hi,> you must make sure the libav* match the header when compiling your code. you may add "-v" option to see detailsI tryied the "ffmpeg -v" command and I get the following answerffmpeg version N-54345-ga35494c Copyright (c) 2000-2013 the FFmpeg developers built on Jul 2 2013 11:28:20 with gcc 4.6 (Ubuntu/Linaro 4.6.3-1ubuntu5) configuration: --enable-shared libavutil 52. 38.100 / 52. 38.100 libavcodec 55. 18.100 / 55. 18.100 libavformat 55. 10.101 / 55. 10.101 libavdevice 55. 2.100 / 55. 2.100 libavfilter 3. 77.101 / 3. 77.101 libswscale 2. 3.100 / 2. 3.100 libswresample 0. 17.102 / 0. 17.102Missing argument for option 'v'.Error splitting the argument list: Invalid argumentWhat am I suppose to do with that ? Cordialement,Guillaume Bersac237bis rue de Pessac33000 Bordeaux06.65.30.89.43 -------------- next part -------------- An HTML attachment was scrubbed... URL: From p.tushar99 at gmail.com Tue Jul 2 12:05:29 2013 From: p.tushar99 at gmail.com (Tushar Paithankar) Date: Tue, 2 Jul 2013 15:35:29 +0530 Subject: [Libav-user] LIBFAAC Message-ID: Hi, In libfaac library, in the Encode call of AAC (frame.c) there is if (hEncoder->frameNum <= 3) /* Still filling up the buffers */ return 0; What is the purpose of this buffer...? Can i work for single input frame and single output frame.....? -------------- next part -------------- An HTML attachment was scrubbed... URL: From onemda at gmail.com Tue Jul 2 13:41:14 2013 From: onemda at gmail.com (Paul B Mahol) Date: Tue, 2 Jul 2013 11:41:14 +0000 Subject: [Libav-user] LIBFAAC In-Reply-To: References: Message-ID: On 7/2/13, Tushar Paithankar wrote: > Hi, > > In libfaac library, in the Encode call of AAC (frame.c) there is > > if (hEncoder->frameNum <= 3) /* Still filling up the buffers */ > return 0; > > What is the purpose of this buffer...? > > Can i work for single input frame and single output frame.....? > Nope, you can not. From p.tushar99 at gmail.com Tue Jul 2 13:43:25 2013 From: p.tushar99 at gmail.com (Tushar Paithankar) Date: Tue, 02 Jul 2013 17:13:25 +0530 Subject: [Libav-user] LIBFAAC In-Reply-To: References: Message-ID: <51D2BCDD.5080900@gmail.com> On Tuesday 02 July 2013 05:11 PM, Paul B Mahol wrote: > On 7/2/13, Tushar Paithankar wrote: >> Hi, >> >> In libfaac library, in the Encode call of AAC (frame.c) there is >> >> if (hEncoder->frameNum <= 3) /* Still filling up the buffers */ >> return 0; >> >> What is the purpose of this buffer...? >> >> Can i work for single input frame and single output frame.....? >> > Nope, you can not. > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user Thank you for replay. can you please explain me why there is buffering of the input data ...? Regards Tushar Paithankar " "Success is the ability to go from one failure to another with no loss of enthusiasm." - Winston Churchill " Get this email app! Please consider your environmental responsibility. Before printing this e-mail message, ask yourself whether you really need a hard copy. Designed with WiseStamp - Get yours -------------- next part -------------- An HTML attachment was scrubbed... URL: From cehoyos at ag.or.at Tue Jul 2 13:49:11 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Tue, 2 Jul 2013 11:49:11 +0000 (UTC) Subject: [Libav-user] Slightly OT: playing DVDs References: <51D18D43.1060209@gmail.com> Message-ID: Gonzalo Garramuno writes: > I've gotten to the point in my player in that I want to > add support to play DVDs. > I was wondering if someone who has done this could > provide some general help. There is a patch that you could work on: http://thread.gmane.org/gmane.comp.video.ffmpeg.devel/93750 Carl Eugen From cehoyos at ag.or.at Tue Jul 2 13:52:13 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Tue, 2 Jul 2013 11:52:13 +0000 (UTC) Subject: [Libav-user] Error while linking ffmpeg References: Message-ID: ... ... writes: > I am working on a project using ffmpeg and when I compiled, > i get the following error : > /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../lib/libavcodec.so: > undefined reference to `avpriv_update_lls LIBAVUTIL_52' You are mixing versions of libavcodec and libavutil that are not compatible, please reinstall. This is a bug in FFmpeg that is unlikely to get fixed (especially because the workaround is trivial), see: http://thread.gmane.org/gmane.comp.video.ffmpeg.cvs/66227/focus=66238 Sorry, Carl Eugen From cehoyos at ag.or.at Tue Jul 2 13:55:15 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Tue, 2 Jul 2013 11:55:15 +0000 (UTC) Subject: [Libav-user] Error while linking ffmpeg References: , Message-ID: ... ... writes: > libavcodec.so.55 (libc6,x86-64) => /usr/local/lib/libavcodec.so.55 > libavcodec.so.55 (libc6,x86-64) => /usr/lib/libavcodec.so.55 As said, there is a bug in FFmpeg, but the way libavcodec libraries are installed on your system is guaranteed to fail (is also buggy). Carl Eugen From cpsmusic at yahoo.com Tue Jul 2 14:00:22 2013 From: cpsmusic at yahoo.com (Chris Share) Date: Tue, 2 Jul 2013 05:00:22 -0700 (PDT) Subject: [Libav-user] How to Convert AVPicture to AVFrame Message-ID: <1372766422.85654.YahooMailNeo@web161405.mail.bf1.yahoo.com> Hi, I'm resurrecting a project that I was working on a few months ago. The project involves converting a series of images (pngs) into a movie. So far I've managed to load the pngs and convert them from RGB24 to YUV420P using sws_scale(...). For each image sws_scale produces an AVPicture. What I'm not clear about is how to convert the AVPicture to an AVFrame as per the encoding_decoding.c example. Cheers, Chris -------------- next part -------------- An HTML attachment was scrubbed... URL: From cehoyos at ag.or.at Tue Jul 2 14:00:42 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Tue, 2 Jul 2013 12:00:42 +0000 (UTC) Subject: [Libav-user] Error while linking ffmpeg References: , , , Message-ID: ... ... writes: > > you must make sure the libav* match the header when compiling > > your code. you may add "-v" option to see details > > I tryied the "ffmpeg -v" command and I get the following answer (Unrelated: Note that -v is the option to set the verboseness of all FFmpeg binaries, it requires an argument.) > ?configuration: --enable-shared > What am I suppose to do with that ? This tells you that you installed the libraries into /usr/local/lib (this is the default location and you did not specify another location) while you already have (another version of) libavcodec installed in /usr/lib - this generally cannot work. Please understand that I do *not* generally recommend to install your self-compiled shared libraries into /usr/lib - I just want to explain the problem (why linking fails for you independently of the mentioned FFmpeg bug). Carl Eugen From bersac_1 at hotmail.fr Tue Jul 2 15:24:50 2013 From: bersac_1 at hotmail.fr (... ...) Date: Tue, 2 Jul 2013 13:24:50 +0000 Subject: [Libav-user] Error while linking ffmpeg : problem solve ! In-Reply-To: References: , , , , , , , , Message-ID: Hi, And thanks a lot for your responses and especially to Carl Eugen ! I just installed libvlc using apt-get and it installed avcodec in usr/lib. I deleted it and now it is compiling fine with both libvlc and ffmpeg. I would had never found that solution. Cordially,Guillaume Bersac237bis rue de Pessac33000 Bordeaux06.65.30.89.43 > To: libav-user at ffmpeg.org > From: cehoyos at ag.or.at > Date: Tue, 2 Jul 2013 12:00:42 +0000 > Subject: Re: [Libav-user] Error while linking ffmpeg > > ... ... writes: > > > > you must make sure the libav* match the header when compiling > > > your code. you may add "-v" option to see details > > > > I tryied the "ffmpeg -v" command and I get the following answer > > (Unrelated: Note that -v is the option to set the verboseness > of all FFmpeg binaries, it requires an argument.) > > > configuration: --enable-shared > > > What am I suppose to do with that ? > > This tells you that you installed the libraries into > /usr/local/lib (this is the default location and you > did not specify another location) while you already > have (another version of) libavcodec installed in > /usr/lib - this generally cannot work. > > Please understand that I do *not* generally recommend to > install your self-compiled shared libraries into /usr/lib > - I just want to explain the problem (why linking fails > for you independently of the mentioned FFmpeg bug). > > 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 zyvj at qq.com Tue Jul 2 15:36:35 2013 From: zyvj at qq.com (=?gb18030?B?VG9jeQ==?=) Date: Tue, 2 Jul 2013 21:36:35 +0800 Subject: [Libav-user] =?gb18030?b?u9i4tKO6IEhvdyB0byBDb252ZXJ0IEFWUGljdHVy?= =?gb18030?q?e_to_AVFrame?= Message-ID: You can see the definition of AVPicture and AVFrame, the starting parameters are the same. so just use type conversion. All things is ok. ------------------ ???? ------------------ ???: "Chris Share"; ????: 2013?7?2?(???) ??8:00 ???: "This list is about using libavco"; ??: [Libav-user] How to Convert AVPicture to AVFrame Hi, I'm resurrecting a project that I was working on a few months ago. The project involves converting a series of images (pngs) into a movie. So far I've managed to load the pngs and convert them from RGB24 to YUV420P using sws_scale(...). For each image sws_scale produces an AVPicture. What I'm not clear about is how to convert the AVPicture to an AVFrame as per the encoding_decoding.c example. Cheers, Chris -------------- next part -------------- An HTML attachment was scrubbed... URL: From pockethook at gmail.com Tue Jul 2 15:50:24 2013 From: pockethook at gmail.com (Cheehan) Date: Tue, 2 Jul 2013 14:50:24 +0100 Subject: [Libav-user] MPEG-TS muxrate example. Message-ID: I have been trying to create a MPEG-TS file using the the ffmpeg examples. I've been trying to specify a muxrate in the muxing.c example code: https://github.com/FFmpeg/FFmpeg/blob/master/doc/examples/muxing.c When I do so by adding: AVDictionary *dict = NULL; av_dict_set(&dict, "muxrate", "2000000", 0); before ret = avformat_write_header(oc, &dict); I get the following warning: dts < pcr, TS is invalid. The example code with my modifications is availiable here (line 471): http://pastebin.com/SxjP62iA Am I going about setting the muxrate correctly? Why do I get the warning? -------------- next part -------------- An HTML attachment was scrubbed... URL: From hatalyak.gyula at artklikk.hu Tue Jul 2 17:24:38 2013 From: hatalyak.gyula at artklikk.hu (=?ISO-8859-1?Q?Gyula_Hataly=E1k?=) Date: Tue, 2 Jul 2013 17:24:38 +0200 Subject: [Libav-user] Concat MOV files without re-encoding Message-ID: Hi, I would like to concat MOV files without re-encoding. I want to do it on iOS (iPhone). All the MOV files are recorded with the same settings, no difference in dimensions or encoding profiles. I have succeeded to do it with the command line ffmpeg: ffmpeg -re -f concat -i files.txt -c copy ... But I have difficulties using the libraries. I think the demuxing part is ok, I have the h.264+AAC packets. After demuxing I shift the PTS and DTS info of each packet to have ascending values in the joined MOV file. The hard part is the muxing. I have built the ffmpeg libs with x264 lib, so it can be used if necessary, but I am not sure whether I need the x264 codec since I don't want to re-encode the MOV files, I just want to join them. *Problems I have encountered:* * *1) In this case I do not use x264 codec, At muxing I create the stream with NULL codec parameter. I have successful writing of header, packets and trailer. All the function calls return with zero error code. However, the output can be opened, but black "screen" is displayed during playback. FFprobe report is attached. I have also examined the output with MediaInfo tool. I have attached that report as well (MediaInfo report - without x264 codec.txt). As you can see there is no h.264 profile or pixel info found that might be a problem. 2) In this case I use x264 codec with functions: avcodec_find_encoder, avformat_new_stream and avcodec_open2. Again: no decode-encode! In this case I have much more metadata in the output file like h.264 profile and pixel info (YUV), but the av_interleaved_write_frame call simply does nothing but returns success code (0). No packet is written to the file. :( I don't know how this could happen. fwrite works, but results in un-openable file. I have also attached the MediaInfo report of this output (MediaInfo report - with x264 codec.txt). *Questions:* - How should I process the demuxed packets to feed the muxer? - What format context and codec context setting should be done including AVOption settings? - Should I use the x264 codec to do this? I just vant to re-mux the chunks into a single joined file. - The chunks have their own header/trailer. Should I somehow filter the demuxed packets to skip them? - The final goal is creating a network stream (RTP or RTMP) - also with re-muxing and without re-encoding. It works with command line ffmpeg: ffmpeg -re -f concat -i files.txt -vcodec copy -an -f rtp rtp:// 127.0.0.1:20000 -vn -acodec copy -f rtp rtp://127.0.0.1:30000 Concatenating to MOV format is only an intermediate pilot. Is it recommended to work on the network format since it is so different task that there is no benefit of solving the MOV format muxing? Any help, advice, suggestion is greatly appreciated. I can reveal code to make deeper investigation possible. Regards, Gyula -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- imac-01s-imac:~ hatalyakgyula$ ffprobe -show_data -show_error -show_format -show_frames -show_packets -show_streams -count_frames -count_packets -show_private_data -loglevel debug ~/Desktop/output.mov ffprobe version 1.2.1-tessus Copyright (c) 2007-2013 the FFmpeg developers built on May 9 2013 21:58:14 with llvm-gcc 4.2.1 (LLVM build 2336.1.00) configuration: --prefix=/Users/tessus/data/ext/ffmpeg/sw --as=yasm --extra-version=tessus --disable-shared --enable-static --disable-ffplay --enable-gpl --enable-pthreads --enable-postproc --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --enable-libspeex --enable-bzlib --enable-zlib --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libxavs --enable-version3 --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvpx --enable-libgsm --enable-libopus --enable-fontconfig --enable-libfreetype --enable-libass --enable-filters --enable-runtime-cpudetect libavutil 52. 18.100 / 52. 18.100 libavcodec 54. 92.100 / 54. 92.100 libavformat 54. 63.104 / 54. 63.104 libavdevice 54. 3.103 / 54. 3.103 libavfilter 3. 42.103 / 3. 42.103 libswscale 2. 2.100 / 2. 2.100 libswresample 0. 17.102 / 0. 17.102 libpostproc 52. 2.100 / 52. 2.100 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x102009e00] Format mov,mp4,m4a,3gp,3g2,mj2 probed with size=2048 and score=100 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x102009e00] ISO: File Type Major Brand: qt [mov,mp4,m4a,3gp,3g2,mj2 @ 0x102009e00] File position before avformat_find_stream_info() is 1421539 [h264 @ 0x102012400] no frame! Last message repeated 47 times [h264 @ 0x102012400] Unknown NAL code: 29 (2277 bits) [h264 @ 0x102012400] no frame! Last message repeated 22 times [mov,mp4,m4a,3gp,3g2,mj2 @ 0x102009e00] max_analyze_duration 5000000 reached at 5040811 microseconds [mov,mp4,m4a,3gp,3g2,mj2 @ 0x102009e00] decoding for stream 0 failed [mov,mp4,m4a,3gp,3g2,mj2 @ 0x102009e00] Could not find codec parameters for stream 0 (Video: h264 (avc1 / 0x31637661), 352x288, 1/38400, 850 kb/s): unspecified pixel format Consider increasing the value for the 'analyzeduration' and 'probesize' options rfps: 14.833333 0.014196 Last message repeated 1 times rfps: 14.916667 0.007099 rfps: 30.000000 0.018272 rfps: 30.083333 0.009602 Last message repeated 1 times rfps: 44.916667 0.004858 rfps: 45.000000 0.003956 rfps: 59.833333 0.005642 Last message repeated 1 times rfps: 59.916667 0.012509 rfps: 59.940060 0.019782 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x102009e00] File position after avformat_find_stream_info() is 578526 /Users/hatalyakgyula/Desktop/output.mov: Operation not permitted [ERROR] code=-1 string=Operation not permitted [/ERROR] -------------- next part -------------- General Complete name : /Users/hatalyakgyula/Documents/Projects/Production projects/Broadcaster/2013 pilot/sandboxes/hu.artklikk.fullxsTrial 2013-07-02 14.29.56.553.xcappdata/AppData/Documents/output.mov Format : MPEG-4 Format profile : QuickTime Codec ID : qt File size : 1.36 MiB Duration : 13s 348ms Overall bit rate : 852 Kbps Writing application : Lavf54.63.104 Video ID : 1 Format : AVC Format/Info : Advanced Video Codec Codec ID : avc1 Codec ID/Info : Advanced Video Coding Duration : 13s 348ms Bit rate : 851 Kbps Width : 352 pixels Height : 288 pixels Display aspect ratio : 1.222 Frame rate mode : Variable Frame rate : 14.085 fps Minimum frame rate : 2.812 fps Maximum frame rate : 480.000 fps Standard : PAL Bits/(Pixel*Frame) : 0.596 Stream size : 1.35 MiB (100%) Language : English -------------- next part -------------- General Complete name : /Users/hatalyakgyula/Documents/Projects/Production projects/Broadcaster/2013 pilot/sandboxes/hu.artklikk.fullxsTrial 2013-07-02 16.03.25.221.xcappdata/AppData/Documents/output.mov Format : MPEG-4 Format profile : QuickTime Codec ID : qt File size : 961 Bytes Duration : 9s 925ms Overall bit rate mode : Constant Overall bit rate : 775 bps Writing application : Lavf54.63.104 Video ID : 1 Format : AVC Format/Info : Advanced Video Codec Format profile : Baseline at L5.2 Format settings, CABAC : No Format settings, ReFrames : 3 frames Codec ID : avc1 Codec ID/Info : Advanced Video Coding Duration : 9s 925ms Bit rate mode : Constant Bit rate : 114 bps Width : 352 pixels Height : 288 pixels Display aspect ratio : 1.222 Frame rate mode : Variable Frame rate : 14.208 fps Minimum frame rate : 2.798 fps Maximum frame rate : 480.000 fps Standard : PAL Color space : YUV Chroma subsampling : 4:2:0 Bit depth : 8 bits Scan type : Progressive Bits/(Pixel*Frame) : 0.000 Stream size : 141 Bytes (15%) Language : English From phpdev at ehrhardt.nl Tue Jul 2 18:48:20 2013 From: phpdev at ehrhardt.nl (Jan Ehrhardt) Date: Tue, 02 Jul 2013 18:48:20 +0200 Subject: [Libav-user] Concat MOV files without re-encoding References: Message-ID: Gyula Hataly?k in gmane.comp.video.ffmpeg.libav.user (Tue, 2 Jul 2013 17:24:38 +0200): >Any help, advice, suggestion is greatly appreciated. You might give MP4Box a try: http://gpac.wp.mines-telecom.fr/downloads/ Jan From stefasab at gmail.com Wed Jul 3 09:52:45 2013 From: stefasab at gmail.com (Stefano Sabatini) Date: Wed, 3 Jul 2013 09:52:45 +0200 Subject: [Libav-user] Remuxing from AAC to MP4, bitstream filtering and corrupted AAC Config Message-ID: <20130703075245.GD20658@barisone> Hi all, posting here in case someone can provide ideas. With the attached code I'm able to stream-copy and remux an AAC file to an MP4. $ remuxing in.AAC out.mp4 $ mp4info version 2.0.0 out.mp4: FindBytesProperty: no such property moov.trak[0].mdia.minf.stbl.stsd.*[0].*.esds.decConfigDescr.decSpecificInfo[0].info (src/mp4file.cpp,865) Track Type Info 1 audio MPEG-4 Unknown Profile(0), 38.150 secs, 149 kbps, 44100 Hz Encoded with: Lavf55.10.101 $ MP4Box -info out.mp4 * Movie Info * Timescale 1000 - Duration 00:00:38.151 1 track(s) Fragmented File: no File Brand isom - version 512 Created: UNKNOWN DATE File has no MPEG4 IOD/OD iTunes Info: Encoder Software: Lavf55.10.101 Track # 1 Info - TrackID 1 - TimeScale 44100 - Media Duration 00:00:38.150 Track has 1 edit lists: track duration is 00:00:38.151 Media Info: Language "Undetermined" - Type "soun:mp4a" - 1643 samples MPEG-4 Config: Audio Stream - ObjectTypeIndication 0x40 Corrupted AAC Config Self-synchronized Alternate Group ID 1 ... If I convert the file with the command: $ ffmpeg -i in.aac -c copy -bsf:a aac_adtstoasc -y out2.mp4 $ mp4info out2.mp4 mp4info version 2.0.0 out2.mp4: Track Type Info 1 audio MPEG-4 AAC LC, 38.150 secs, 149 kbps, 44100 Hz Encoded with: Lavf55.10.101 $ MP4Box -info out2.mp4 * Movie Info * Timescale 1000 - Duration 00:00:38.151 1 track(s) Fragmented File: no File Brand isom - version 512 Created: UNKNOWN DATE File has no MPEG4 IOD/OD iTunes Info: Encoder Software: Lavf55.10.101 Track # 1 Info - TrackID 1 - TimeScale 44100 - Media Duration 00:00:38.150 Track has 1 edit lists: track duration is 00:00:38.151 Media Info: Language "Undetermined" - Type "soun:mp4a" - 1643 samples MPEG-4 Config: Audio Stream - ObjectTypeIndication 0x40 MPEG-4 Audio AAC LC - 2 Channel(s) - SampleRate 44100 Self-synchronized Alternate Group ID 1 ... So the problem seems related to the missing profile information. Help with the issue is very welcome. I plan to send the example for inclusion once I spot the problem. -------------- next part -------------- A non-text attachment was scrubbed... Name: remuxing.c Type: text/x-csrc Size: 8538 bytes Desc: not available URL: From ggarra13 at gmail.com Wed Jul 3 17:51:52 2013 From: ggarra13 at gmail.com (Gonzalo Garramuno) Date: Wed, 03 Jul 2013 12:51:52 -0300 Subject: [Libav-user] Slightly OT: playing DVDs In-Reply-To: References: <51D18D43.1060209@gmail.com> Message-ID: <51D44898.4080501@gmail.com> On 02/07/13 08:49, Carl Eugen Hoyos wrote: > There is a patch that you could work on: > http://thread.gmane.org/gmane.comp.video.ffmpeg.devel/93750 > > Carl Eugen Carl, that set of patches is 3 years old and does not compile due to deprecation of URLContext. From stefasab at gmail.com Wed Jul 3 19:07:04 2013 From: stefasab at gmail.com (Stefano Sabatini) Date: Wed, 3 Jul 2013 19:07:04 +0200 Subject: [Libav-user] Slightly OT: playing DVDs In-Reply-To: <51D44898.4080501@gmail.com> References: <51D18D43.1060209@gmail.com> <51D44898.4080501@gmail.com> Message-ID: <20130703170704.GB8812@barisone> In data Wednesday 2013-07-03 12:51:52 -0300, Gonzalo Garramuno ha scritto: > On 02/07/13 08:49, Carl Eugen Hoyos wrote: > >There is a patch that you could work on: > >http://thread.gmane.org/gmane.comp.video.ffmpeg.devel/93750 > > > >Carl Eugen > Carl, that set of patches is 3 years old and does not compile due to > deprecation of URLContext. No if you see my more updated patches. That said, the code is still far from being "production-ready", so it may require a significant effort and a good understanding of involved libraries/standards. From stefasab at gmail.com Wed Jul 3 19:10:35 2013 From: stefasab at gmail.com (Stefano Sabatini) Date: Wed, 3 Jul 2013 19:10:35 +0200 Subject: [Libav-user] Remuxing from AAC to MP4, bitstream filtering and corrupted AAC Config In-Reply-To: <20130703075245.GD20658@barisone> References: <20130703075245.GD20658@barisone> Message-ID: <20130703171035.GC8812@barisone> In data Wednesday 2013-07-03 09:52:45 +0200, Stefano Sabatini ha scritto: > Hi all, > > posting here in case someone can provide ideas. > > With the attached code I'm able to stream-copy and remux an AAC file > to an MP4. > > $ remuxing in.AAC out.mp4 > > $ mp4info version 2.0.0 > out.mp4: > FindBytesProperty: no such property moov.trak[0].mdia.minf.stbl.stsd.*[0].*.esds.decConfigDescr.decSpecificInfo[0].info (src/mp4file.cpp,865) > Track Type Info > 1 audio MPEG-4 Unknown Profile(0), 38.150 secs, 149 kbps, 44100 Hz > Encoded with: Lavf55.10.101 > > $ MP4Box -info out.mp4 > * Movie Info * > Timescale 1000 - Duration 00:00:38.151 > 1 track(s) > Fragmented File: no > File Brand isom - version 512 > Created: UNKNOWN DATE > File has no MPEG4 IOD/OD > > iTunes Info: > Encoder Software: Lavf55.10.101 > > Track # 1 Info - TrackID 1 - TimeScale 44100 - Media Duration 00:00:38.150 > Track has 1 edit lists: track duration is 00:00:38.151 > Media Info: Language "Undetermined" - Type "soun:mp4a" - 1643 samples > MPEG-4 Config: Audio Stream - ObjectTypeIndication 0x40 > Corrupted AAC Config > Self-synchronized > Alternate Group ID 1 > > ... > > If I convert the file with the command: > $ ffmpeg -i in.aac -c copy -bsf:a aac_adtstoasc -y out2.mp4 > > $ mp4info out2.mp4 > mp4info version 2.0.0 > out2.mp4: > Track Type Info > 1 audio MPEG-4 AAC LC, 38.150 secs, 149 kbps, 44100 Hz > Encoded with: Lavf55.10.101 > > $ MP4Box -info out2.mp4 > * Movie Info * > Timescale 1000 - Duration 00:00:38.151 > 1 track(s) > Fragmented File: no > File Brand isom - version 512 > Created: UNKNOWN DATE > File has no MPEG4 IOD/OD > > iTunes Info: > Encoder Software: Lavf55.10.101 > > Track # 1 Info - TrackID 1 - TimeScale 44100 - Media Duration 00:00:38.150 > Track has 1 edit lists: track duration is 00:00:38.151 > Media Info: Language "Undetermined" - Type "soun:mp4a" - 1643 samples > MPEG-4 Config: Audio Stream - ObjectTypeIndication 0x40 > MPEG-4 Audio AAC LC - 2 Channel(s) - SampleRate 44100 > Self-synchronized > Alternate Group ID 1 > > ... > > So the problem seems related to the missing profile information. > > Help with the issue is very welcome. I plan to send the example for > inclusion once I spot the problem. And the problem is: [...] > ret = av_bitstream_filter_filter(absf_ctx, in_audio_stream->codec, NULL, > &new_inpkt.data, &new_inpkt.size, > inpkt.data, inpkt.size, > inpkt.flags & AV_PKT_FLAG_KEY); I need to change in_audio_stream to out_audio_stream, since the bitstream filter changes the *output stream* extradata, that is written in the packet. Changing this single line fixes the issue. From stefasab at gmail.com Wed Jul 3 19:24:04 2013 From: stefasab at gmail.com (Stefano Sabatini) Date: Wed, 3 Jul 2013 19:24:04 +0200 Subject: [Libav-user] Audio conversion from planar to non-planar formats In-Reply-To: References: Message-ID: <20130703172404.GD8812@barisone> In data Wednesday 2013-06-26 13:07:05 +0500, Taha Ansari ha scritto: > Hi everyone! > > >>It should be exactly the same as FLTP to S16. I'm not willing to play > >>guess games. Please provide source code you use for convert audio if you > >>expect someone will help you. > > @Paul: > > My code is similar to what I have been nagging since few days on the > mailing list, so sorry for not providing it (attached now near end of > email)! > > While experimenting, I have made significant progress: now, my conversions > from S16P to S16 are apparently fine (I was making a grave mistake while > calling swr_convert() function). So current status is: I am able to convert > between these two formats, but! only about 90% of audio is converted, and > any media player just jumps ahead after reaching this mark. > > Kindly review my updated code (note: I am also writing delayed frames in > end, but that does not help): [...] > int decode_packet() > { > int rv = 0; > int ret = 0; > > //audio stream? > if(input_packet.stream_index == audio_stream_index) > { > /* decode audio frame */ > rv = avcodec_decode_audio4(codec_ctx_audio, decoded_frame, > &got_frame, &input_packet); > if (rv < 0) > { > fprintf(stderr, "Error decoding audio frame\n"); > //return ret; > } > else > { > if (got_frame) > { > if ( audio_dst_data[0] == NULL ) > { > ret = av_samples_alloc(audio_dst_data, > &audio_dst_linesize, decoded_frame->channels, > decoded_frame->nb_samples, > (AVSampleFormat)decoded_frame->format, 1); > if (ret < 0) > { > fprintf(stderr, "Could not allocate audio > buffer\n"); > return AVERROR(ENOMEM); > } > /* TODO: extend return code of the av_samples_* > functions so that this call is not needed */ > audio_dst_bufsize = av_samples_get_buffer_size(NULL, > audio_st->codec->channels, > decoded_frame->nb_samples, > (AVSampleFormat)decoded_frame->format, 1); > > //int16_t* outputBuffer = ...; > swr_convert( swr, audio_dst_data, > out_frame->nb_samples, (const uint8_t**) decoded_frame->extended_data, > decoded_frame->nb_samples ); > } You may need to compute the output number of samples, indeed the resampler can not guarantee that the number of samples requested will be returned due to caching or missing input data (e.g. when downsampling). Check the logic in resampling_audio.c, and check the swr_convert() return value in order to understand how many samples have been converted in your buffer. A more high-level conversion function may help to simplify the code. [...] From pvazharov at abaltatech.com Wed Jul 3 20:19:22 2013 From: pvazharov at abaltatech.com (Pavel Vazharov) Date: Wed, 3 Jul 2013 11:19:22 -0700 Subject: [Libav-user] Build of ffmpeg library with libx264 support for QNX Message-ID: Hello, I'm trying to build the ffmpege library with libx264 support for QNX. I'm using the following configure script: ./configure \ --arch=x86 \ --disable-debug \ --enable-static \ --disable-shared \ --target-os=qnx \ --disable-programs \ --disable-ffplay \ --disable-ffprobe \ --disable-ffserver \ --disable-yasm \ --disable-altivec \ --disable-mmxext \ --disable-inline-asm \ --disable-doc \ --disable-postproc \ --prefix=./target/QNX/x86 \ --enable-gpl \ --disable-everything \ --enable-encoder=libx264 \ --enable-decoder=h264 \ --enable-muxer=h264 \ --enable-demuxer=h264 \ --enable-parser=h264 \ --disable-dxva2 \ --disable-vda \ --disable-vdpau \ --disable-protocols \ --disable-mipsfpu \ --enable-libx264 \ --extra-cflags="-I../x264 -Wno-deprecated -Wno-deprecated-declarations" \ --extra-ldflags="-L../x264" The library builds fine but the problem is that when I try to link again libavcodec.a in my application I get undefined references for symbols such as: libavcodec.a(h264.o): In function `ff_h264_decode_init': h264.c:(.text.unlikely+0xc6): undefined reference to `ff_h264dsp_init' h264.c:(.text.unlikely+0x109): undefined reference to `ff_h264chroma_init' h264.c:(.text.unlikely+0x119): undefined reference to `ff_h264qpel_init' h264.c:(.text.unlikely+0x12e): undefined reference to `ff_h264_pred_init' h264.c:(.text.unlikely+0x150): undefined reference to `ff_videodsp_init' C:\DataDisk\Project\AbaltaInternal\..\AbaltaInternal\WebLink/ThirdPartyTools/ffmpeg/lib/QNX/x86\libavcodec.a(h264_cavlc.o): In function `get_ue_golomb_31': h264_cavlc.c:(.text+0x151c): undefined reference to `ff_golomb_vlc_len' h264_cavlc.c:(.text+0x152a): undefined reference to `ff_ue_golomb_vlc_code' I don't know how to force the .c files with these functions to be build and to be added in the final library. I mean I don't know the configure options that breaks this. Can anyone help me with this. Thanks in advance. Best regards, Pavel. -------------- next part -------------- An HTML attachment was scrubbed... URL: From c.kummer at noa-audio.com Wed Jul 3 18:45:45 2013 From: c.kummer at noa-audio.com (Christophe Kummer) Date: Wed, 3 Jul 2013 16:45:45 +0000 Subject: [Libav-user] YADIF converted to LGPL Message-ID: <0000595A.51D47144@chello062178076009.26.11.vie.surfer.at> Dear Mr. Kr?ger, After a discussion with my colleague Tobias Rapp, I am getting back to you regarding the "ongoing efforts of re-issueing Yadif under LGPL" - Michael Niedermayer has recommended to turn to you, as you might have the best overview on the efforts there. We would like to use the YADIF deinterlacing filters - but as long as they are under GPL we do have a legal problem with it. Right now we have made use of the old "deprecated" LGPL deinterlacer, but there might soon be a need for Yadif. Is there a chance how we can get to an agreement with FFMPEG - in case that the efforts might take even longer ? kind Regards Jean-Christophe Kummer Managing Partner NOA Audio Solutions VertriebsgesmbH Johannagasse 42/4 A - 1050 Wien tel.: +43 -1-5452700 fax: +43-1-545270014 mob: +43-699-14003861 c.kummer at noa-audio.com www.noa-audio.com NOA is member of the www.leitbetriebe.at group, the top 100 companies of Austria, which are nominated due to their excellency in work and success. To: libav-user at ffmpeg.org Cc: t.rapp at noa-audio.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From krueger at lesspain.de Wed Jul 3 22:31:09 2013 From: krueger at lesspain.de (=?UTF-8?Q?Robert_Kr=C3=BCger?=) Date: Wed, 3 Jul 2013 22:31:09 +0200 Subject: [Libav-user] YADIF converted to LGPL In-Reply-To: <0000595A.51D47144@chello062178076009.26.11.vie.surfer.at> References: <0000595A.51D47144@chello062178076009.26.11.vie.surfer.at> Message-ID: On Wed, Jul 3, 2013 at 6:45 PM, Christophe Kummer wrote: > ** ** > Dear Mr. Kr?ger, > > After a discussion with my colleague Tobias Rapp, I am getting back to you > regarding the "ongoing efforts of re-issueing Yadif under LGPL" - Michael > Niedermayer has recommended to turn to you, as you might have the best > overview on the efforts there. > > We would like to use the YADIF deinterlacing filters - but as long as they > are under GPL we do have a legal problem with it. > Right now we have made use of the old "deprecated" LGPL deinterlacer, but > there might soon be a need for Yadif. > > > Is there a chance how we can get to an agreement with FFMPEG - in case > that the efforts might take even longer ? > > kind Regards > > > Jean-Christophe Kummer > > > Managing Partner > NOA Audio Solutions VertriebsgesmbH > Johannagasse 42/4 > A - 1050 Wien > tel.: +43 -1-5452700 > fax: +43-1-545270014 > mob: +43-699-14003861 > c.kummer at noa-audio.com > www.noa-audio.com > > NOA is member of the www.leitbetriebe.at group, the top 100 companies of > Austria, > which are nominated due to their excellency in work and success. > > just a quick reply now, a longer one later. No, there is no easy quick way to get an agreement with "ffmpeg" as legally there is no entity that can represent all copyright holders. You would have to negotiate with all individual contributors, sorry! The best advice I can give you is to offer some money for the pot for the relicensing (that might make it more likely that it happens) and wait for my next posting regarding that topic on the ffmpeg-devel list. I haven't had time in the past few days to compile what the current status is and write about options that exist as I wanted to do that thoroughly. Best regards, Robert -------------- next part -------------- An HTML attachment was scrubbed... URL: From ggarra13 at gmail.com Thu Jul 4 01:37:17 2013 From: ggarra13 at gmail.com (Gonzalo Garramuno) Date: Wed, 03 Jul 2013 20:37:17 -0300 Subject: [Libav-user] Slightly OT: playing DVDs In-Reply-To: <20130703170704.GB8812@barisone> References: <51D18D43.1060209@gmail.com> <51D44898.4080501@gmail.com> <20130703170704.GB8812@barisone> Message-ID: <51D4B5AD.5090802@gmail.com> On 03/07/13 14:07, Stefano Sabatini wrote: > No if you see my more updated patches. That said, the code is still > far from being "production-ready", so it may require a significant > effort and a good understanding of involved libraries/standards. > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user Do you have a git repository I could clone? The patches are out of date with ffmpeg. Also, isn't there a blueray protocol which would be similar to the DVD one? From mtaha.ansari at gmail.com Thu Jul 4 06:07:46 2013 From: mtaha.ansari at gmail.com (Taha Ansari) Date: Thu, 4 Jul 2013 09:07:46 +0500 Subject: [Libav-user] Audio conversion from planar to non-planar formats In-Reply-To: <20130703172404.GD8812@barisone> References: <20130703172404.GD8812@barisone> Message-ID: You may need to compute the output number of samples, indeed the > resampler can not guarantee that the number of samples requested will > be returned due to caching or missing input data (e.g. when > downsampling). Check the logic in resampling_audio.c, and check the > swr_convert() return value in order to understand how many samples > have been converted in your buffer. > > A more high-level conversion function may help to simplify the code. > Hi Stefano, You are right, because I was actually downsampling (1152 bytes per frame to 1024), swr was holding back internal buffers, somehow. In resampling_audio.c example, I can see repeated calls to swr_convert function... I tried something different: flushing all swr buffers at the end of conversion process, and it worked just fine. The only downside is, it adds up to RAM - for smaller files, it is no problem, but for large files (just for example 05 hours file), it will be something like: 1152 -1024= 128 bytes per frame 128 * 60 = 7680 bytes per second (approx) 7680 * 60 = 460800 bytes per minute 460800 * 60 = 27648000 bytes per hour 27648000 * 5 = 138240000 bytes for five hour recording = 131.83 MB added up inside RAM And that is, assuming I have 60 audio frames per second (I'm sure this figure is not correct, because I need to evaluate how sampling rate effects above formula, as well). So although I got it to work somehow, I am not really sure if this is the most elegant way of doing it. What do you advice? p.s. During test process I tried using av_rescale_rnd(swr_get_delay(swr_ctx, src_rate) + src_nb_samples, dst_rate, src_rate, AV_ROUND_UP); function, but noticed artifacts in destination audio file: plays faster, data seems to be 'packed' inside each audio frame, giving me audible artifacts in destination mp4. -------------- next part -------------- An HTML attachment was scrubbed... URL: From boys21century at gmail.com Thu Jul 4 07:25:19 2013 From: boys21century at gmail.com (Ramu Chakravadhanula) Date: Thu, 4 Jul 2013 10:55:19 +0530 Subject: [Libav-user] Build of ffmpeg library with libx264 support for QNX In-Reply-To: References: Message-ID: i guess it could be linker problem. can you post the command line statement, so that anyone can help if you are not pointing to right libraries. /R On 3 July 2013 23:49, Pavel Vazharov wrote: > Hello, > > I'm trying to build the ffmpege library with libx264 support for QNX. > > I'm using the following configure script: > > ./configure \ > --arch=x86 \ > --disable-debug \ > --enable-static \ > --disable-shared \ > --target-os=qnx \ > --disable-programs \ > --disable-ffplay \ > --disable-ffprobe \ > --disable-ffserver \ > --disable-yasm \ > --disable-altivec \ > --disable-mmxext \ > --disable-inline-asm \ > --disable-doc \ > --disable-postproc \ > --prefix=./target/QNX/x86 \ > --enable-gpl \ > --disable-everything \ > --enable-encoder=libx264 \ > --enable-decoder=h264 \ > --enable-muxer=h264 \ > --enable-demuxer=h264 \ > --enable-parser=h264 \ > --disable-dxva2 \ > --disable-vda \ > --disable-vdpau \ > --disable-protocols \ > --disable-mipsfpu \ > --enable-libx264 \ > --extra-cflags="-I../x264 -Wno-deprecated > -Wno-deprecated-declarations" \ > --extra-ldflags="-L../x264" > > The library builds fine but the problem is that when I try to link again > libavcodec.a in my application I get undefined references for symbols such > as: > > libavcodec.a(h264.o): In function `ff_h264_decode_init': > h264.c:(.text.unlikely+0xc6): undefined reference to `ff_h264dsp_init' > h264.c:(.text.unlikely+0x109): undefined reference to `ff_h264chroma_init' > h264.c:(.text.unlikely+0x119): undefined reference to `ff_h264qpel_init' > h264.c:(.text.unlikely+0x12e): undefined reference to `ff_h264_pred_init' > h264.c:(.text.unlikely+0x150): undefined reference to `ff_videodsp_init' > C:\DataDisk\Project\AbaltaInternal\..\AbaltaInternal\WebLink/ThirdPartyTools/ffmpeg/lib/QNX/x86\libavcodec.a(h264_cavlc.o): > In function `get_ue_golomb_31': > h264_cavlc.c:(.text+0x151c): undefined reference to `ff_golomb_vlc_len' > h264_cavlc.c:(.text+0x152a): undefined reference to `ff_ue_golomb_vlc_code' > > I don't know how to force the .c files with these functions to be build > and to be added in the final library. I mean I don't know the configure > options that breaks this. > > Can anyone help me with this. Thanks in advance. > > Best regards, > Pavel. > > > _______________________________________________ > 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 cnelson at ina.fr Thu Jul 4 09:35:40 2013 From: cnelson at ina.fr (Christophe Nelson) Date: Thu, 4 Jul 2013 07:35:40 +0000 Subject: [Libav-user] Support for HEVC / H.265 in libavformat In-Reply-To: <1371747189.55921.YahooMailNeo@web122304.mail.ne1.yahoo.com> References: <1371747189.55921.YahooMailNeo@web122304.mail.ne1.yahoo.com> Message-ID: <853FB49B5740B24B965337850CCA7E15432F0490@AMSPRD0410MB375.eurprd04.prod.outlook.com> Hi I up this message In Gpac they use openHEVC. They have a libavformat with hevc. I really don't know how to use it, if you find, please help ! https://github.com/OpenHEVC/libav In the x265 project there is a ffmpeg patched but it's an old one (they use HM7.1, we are now at HM11) https://code.google.com/p/x265/downloads/list Christophe Nelson -----Message d'origine----- De?: libav-user-bounces at ffmpeg.org [mailto:libav-user-bounces at ffmpeg.org] De la part de Arvind Raman Envoy??: jeudi 20 juin 2013 18:53 ??: libav-user Objet?: [Libav-user] Support for HEVC / H.265 in libavformat Could you please let me know if there is any experimental branch of libavformat that supports muxing / demuxing HEVC ES? If not, any pointers on what this might entail if I were to implement such a support would be highly appreciated. I understand the gpac libraries support HEVC and therefore wanted to check if a similar effort had already been put on the libavformat library as well. Best regards Arvind _______________________________________________ Libav-user mailing list Libav-user at ffmpeg.org http://ffmpeg.org/mailman/listinfo/libav-user From cehoyos at ag.or.at Thu Jul 4 11:20:01 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Thu, 4 Jul 2013 09:20:01 +0000 (UTC) Subject: [Libav-user] Build of ffmpeg library with libx264 support for QNX References: Message-ID: Pavel Vazharov writes: > ./configure A few unrelated comments (your explanations may help improving the configure script): > --arch=x86 > --target-os=qnx Is this really needed? > --enable-static > --disable-shared This is the default (unneeded). > --disable-everything > --disable-programs > --disable-postproc > --disable-vdpau You may want to use --disable-all > --disable-ffplay > --disable-ffprobe > --disable-ffserver Does --disable-programs not work? > --disable-protocols Does --disable-everything not work? > --disable-dxva2 > --disable-mipsfpu > --disable-altivec > --disable-vda These look useless. > --disable-yasm > --disable-mmxext > --disable-inline-asm Since you also used --disable-debug I have to ask if you try to produce a useless library (no debug information, but no optimizations either)? If you have a good reason, --disable-asm is probably simpler. > The library builds fine but the problem is that when > I try to link again libavcodec.a in my application I > get undefined references for symbols What does git log say about the version you are testing? Carl Eugen From a12a12a12a122001 at yahoo.com.hk Thu Jul 4 15:05:57 2013 From: a12a12a12a122001 at yahoo.com.hk (a a) Date: Thu, 4 Jul 2013 21:05:57 +0800 (SGT) Subject: [Libav-user] MPEG TS subtitle without pts Message-ID: <1372943157.83575.YahooMailNeo@web193105.mail.sg3.yahoo.com> Hi, I've been trying to get the decoded subtitle data from the MPEG Transport Stream file with a subtitle data stream that has no pts. I tried to call av_parser_parse2 with pts field set to AV_NOPTS_VALUE, but it couldn't locate the subtitle frames. Even if I tried to generate sequential pts when calling av_parser_parse2 and located the subtitle frames, the following avcodec_decode_subtitle2 call never returned with a non-zero got_sub_ptr. Is there another way to get the decoded subtitle data without PTS? Thank you -------------- next part -------------- An HTML attachment was scrubbed... URL: From cehoyos at ag.or.at Thu Jul 4 23:25:10 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Thu, 4 Jul 2013 21:25:10 +0000 (UTC) Subject: [Libav-user] HW decoding on Android References: <51C4D7BB.5090904@gmail.com> <7aab384f-bf81-44d8-8c9e-224c85bd948e@email.android.com> Message-ID: Abel Alonso writes: > I've checkout the current git head and > libstagefright.cpp doesn't compile. Could you test again? This may have been fixed. Carl Eugen From jerome.salayet at hymatom.fr Thu Jul 4 16:37:18 2013 From: jerome.salayet at hymatom.fr (=?iso-8859-1?Q?J=E9r=F4me_SALAYET?=) Date: Thu, 4 Jul 2013 16:37:18 +0200 Subject: [Libav-user] Pb H264 avcodec_decode_video2 avcodec54 to avcodec55 Message-ID: <79C91ED810DD8A49B375C899D0034D27099472@mail.hymatom.fr> Hi to All. I use FFMPEG 1.2 in my software to decompress H264 video packet from IP camera. I have on some error in the log like Frame Num Gap or concealing 3600 DC, 3600 AC, 3600 MV errors in P frame,top block unavailable for requested intra mode at 35 2, error while decoding MB 35 2, concealing 3600 DC, 3600 AC, 3600 MV errors in I frame "..... I see there is a new version of FFMPEG, with avcodec55.dll, ... which fix somes bugs on h264 But my code work perfect with FFMPEG1.2 and doesn"t work with the last dll files of FFMPEG ,I get them on Latest Zeranoe FFmpeg Build Version: git-e0be3cb (2013-07-03). it seems with the last avcodec file, the function avcodec_decode_video2 return me 0 and in the log I have "no frame" ... If someone can explain me what' s the major difference between the version 1.2 and the lastest one, beacsue I'm looking for the major changes, but I can't understand why my code below doesn't work. Thanks for yours answers Variables: AVPixelFormat m_AVPixelFormat; AVCodecContext* m_lpCodecCtx; AVCodec* m_lpCodec; AVFrame* m_lpFrame; AVPacket m_lpPacket; AVPicture m_lpPict; SwsContext* m_lpSwsContext; INT m_iThreadCount; LPBYTE m_lpFFMPEGBuffer; INT iImageWidth, iImageHeigh; Of course I before init libraries : av_register_all(); av_lockmgr_register(&ff_lockmgr); with static int ff_lockmgr(void **mutex, enum AVLockOp op) ////////////////////////////////////////////////////////////////////////////////////////////////////// { CRITICAL_SECTION **cSec = (CRITICAL_SECTION **)mutex; switch (op) { case AV_LOCK_CREATE: { *cSec = new CRITICAL_SECTION(); if (*cSec == NULL) return 1; InitializeCriticalSection(*cSec); return 0; } case AV_LOCK_OBTAIN: { if (*cSec == NULL) return 1; EnterCriticalSection(*cSec); return 0; } case AV_LOCK_RELEASE: { if (*cSec == NULL) return 1; LeaveCriticalSection(*cSec); return 0; } case AV_LOCK_DESTROY: { if (*cSec == NULL) return 1; DeleteCriticalSection(*cSec); delete *cSec; *cSec = NULL; return 0; } } return 0; } The lpImageData and dwImageSize I decode is a whole frame I receive from RTP packet from the camera and I ? format ? to send to FFMPEG decoder I also ahve verify the iImageWidth and iImageHeight are well set too. BOOL FFMpegDecompress( LPBYTE lpImageData, DWORD dwImageSize) { if (m_lpCodec==NULL) { // find_decoder m_lpCodec = avcodec_find_decoder(CODEC_ID_H264); } if ((m_lpCodec != NULL)&&(m_lpCodecCtx == NULL)) { // Alloc codecContext m_lpCodecCtx = avcodec_alloc_context3(m_lpCodec); if (m_lpCodecCtx != NULL) { // Init CodecContext if (m_lpCodecCtx->width == 0) { m_lpCodecCtx->pix_fmt = AV_PIX_FMT_YUV420P; m_lpCodecCtx->codec_type = AVMEDIA_TYPE_VIDEO; m_lpCodecCtx->codec_id = CODEC_ID_H264; m_lpCodecCtx->coded_width = iImageWidth; m_lpCodecCtx->coded_height = iImageHeight; m_lpCodecCtx->width = iImageWidth; m_lpCodecCtx->height = iImageHeight; m_lpCodecCtx->thread_count = 3; m_lpCodecCtx->thread_type = FF_THREAD_SLICE; m_lpCodecCtx->err_recognition = AV_EF_EXPLODE; } } } dwWidth = iImageWidth; dwHeight = iImageHeight; // open decoder if not... if ((m_lpCodecCtx!=NULL) && (m_lpCodec!=NULL)&&(!lpfnavcodec_is_open(m_lpCodecCtx))) { if ( m_lpCodec != NULL) { if(m_lpCodec->capabilities&CODEC_CAP_TRUNCATED) m_lpCodecCtx->flags|= CODEC_FLAG_TRUNCATED; iResult = avcodec_open2( m_lpCodecCtx, m_lpCodec, &optionsDict); // if error if (iResult < 0) { avcodec_close(m_lpCodecCtx); av_free(m_lpCodecCtx); m_lpCodecCtx = NULL; m_lpCodec = NULL; } } } if ((m_lpCodecCtx!=NULL) && (m_lpCodec!=NULL)) { // Allouer la frame video if (m_lpFrame == NULL) { m_lpFrame = avcodec_alloc_frame(); } // Si l'allocation ? r?ussi if (m_lpFrame!=NULL) { // Affecter les dimensions m_lpFrame->width = m_lpCodecCtx->width; m_lpFrame->height = m_lpCodecCtx->height; } if ((m_lpCodecCtx != NULL) && ( m_lpCodec != NULL) &&(m_lpFrame != NULL) && (pddsDesc != NULL)) if ((dwWidth>0)&&(dwHeight>0)) { int iRes = 0; // init packet av_init_packet(&m_lpPacket); if (m_lpFFMPEGBuffer == NULL) { m_lpFFMPEGBuffer = new BYTE[MAX_MPEG4VIDEO_FRAMESIZE+FF_INPUT_BUFFER_PADDING_SIZE]; } if (m_lpFFMPEGBuffer !=NULL) { ZeroMemory( m_lpFFMPEGBuffer, MAX_MPEG4VIDEO_FRAMESIZE+FF_INPUT_BUFFER_PADDING_SIZE); CopyMemory(m_lpFFMPEGBuffer, lpImageData, dwImageSize); } // set data m_lpPacket.data = m_lpFFMPEGBuffer; // Set size m_lpPacket.size = dwImageSize; // Decode H264 if ((m_lpFrame!=NULL)&&(m_lpPacket.size>0)) { while (m_lpPacket.size>0) { iRes = navcodec_decode_video2( m_lpCodecCtx, m_lpFrame, &iFrameFinished, &m_lpPacket); if (iRes<=0) { break; } if (iRes>0) { m_lpPacket.data+=iRes; m_lpPacket.size-=iRes; } } } // free Packet av_free_packet(&m_lpPacket); } } -------------- next part -------------- An HTML attachment was scrubbed... URL: From abelalon at gmail.com Fri Jul 5 11:51:14 2013 From: abelalon at gmail.com (Abel Alonso) Date: Fri, 5 Jul 2013 11:51:14 +0200 Subject: [Libav-user] HW decoding on Android In-Reply-To: References: <51C4D7BB.5090904@gmail.com> <7aab384f-bf81-44d8-8c9e-224c85bd948e@email.android.com> Message-ID: 2013/7/4 Carl Eugen Hoyos > > > Could you test again? > This may have been fixed. Hi Carl, libstagefright.cpp compiles now, but I'm still getting the posix_memalign error when compiling libavutil/mem.c, but I guess that is something related with my environment configuration. However, I was able to decode h264 videos using libstagefright from outside ffmpeg. I mean, I compiled ffmpeg without libstagefright and, from my app, I read the frames using FFmpeg and decoded the packets using libstagefright. So I won't need more help on this, but if you need more information to reproduce this issue, please let me know. Despite the compilation issue, after being working with stagefright these days, I think (because I didn't test it), that the FFmpeg libstagefright_h264 decoder will have problems when the libstagefright decoder returns a buffer in QOMX_COLOR_FormatYUV420PackedSemiPlanar64x32Tile2m8ka format. This weird format is a tiled NV12 one and, as far as I know, FFmpeg libstagefright_h264 decoder does not handle it properly. Reading the code in "libstagefright.cpp", you can see that this format is treated as AV_PIX_FMT_YUV420P (this is done in Stagefright_init function). To treat this format properly, you should "untile" the buffer returned by the stagefright decoder and treat the result as an AV_PIX_FMT_NV12 buffer. Thanks!! Abel. -------------- next part -------------- An HTML attachment was scrubbed... URL: From cehoyos at ag.or.at Fri Jul 5 12:49:31 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Fri, 5 Jul 2013 10:49:31 +0000 (UTC) Subject: [Libav-user] HW decoding on Android References: <51C4D7BB.5090904@gmail.com> <7aab384f-bf81-44d8-8c9e-224c85bd948e@email.android.com> Message-ID: Abel Alonso writes: > > Could you test again? > > libstagefright.cpp compiles now, but I'm still getting > the posix_memalign error when compiling libavutil/mem.c, > but I guess that is something related with my > environment configuration. Iirc, you were able to work-around that problem: Does libstagefright decoding with ffmpeg work now or not? [...] > Despite the compilation issue, after being working with > stagefright these days, I think (because I didn't test it), > that the FFmpeg libstagefright_h264 decoder will have > problems when the libstagefright decoder returns a buffer in? > QOMX_COLOR_FormatYUV420PackedSemiPlanar64x32Tile2m8ka format. Why is this used sometimes and sometimes not? (iiuc) Carl Eugen From abelalon at gmail.com Fri Jul 5 13:04:25 2013 From: abelalon at gmail.com (Abel Alonso) Date: Fri, 5 Jul 2013 13:04:25 +0200 Subject: [Libav-user] HW decoding on Android In-Reply-To: References: <51C4D7BB.5090904@gmail.com> <7aab384f-bf81-44d8-8c9e-224c85bd948e@email.android.com> Message-ID: 2013/7/5 Carl Eugen Hoyos Iirc, you were able to work-around that problem: > Does libstagefright decoding with ffmpeg work now or not? > Yes, I can work-around this problem. Will do it when I have time. > Why is this used sometimes and sometimes not? > (iiuc) > This format is a Qualcomm one, so I guess that some Qualcomm devices uses it. I test my app on LG Nexus 4 and Sony Xperia Tablet Z and both of them uses that format. So, I think that when I compile FFmpeg with libstagefright support, it won't work. Once I have free time, I will test this. -------------- next part -------------- An HTML attachment was scrubbed... URL: From pvazharov at abaltatech.com Fri Jul 5 23:09:52 2013 From: pvazharov at abaltatech.com (Pavel Vazharov) Date: Fri, 5 Jul 2013 14:09:52 -0700 Subject: [Libav-user] Build of ffmpeg library with libx264 support for QNX In-Reply-To: References: Message-ID: Hi Ramu, I'm pretty sure that the symbols aren't present in the static libraries. objdump and nm tools shows them as undefined: # nm libavcodec/libavcodec.a | grep ff_h264dsp_init U ff_h264dsp_init # objdump -t libavcodec/libavcodec.a | grep ff_h264dsp_init 00000000 *UND* 00000000 ff_h264dsp_init # objdump -t libavcodec/libavcodec.a | grep ff_golomb_vlc_len 00000000 *UND* 00000000 ff_golomb_vlc_len 00000000 *UND* 00000000 ff_golomb_vlc_len 00000000 *UND* 00000000 ff_golomb_vlc_len 00000000 *UND* 00000000 ff_golomb_vlc_len 00000000 *UND* 00000000 ff_golomb_vlc_len 00000000 *UND* 00000000 ff_golomb_vlc_len # nm libavcodec/libavcodec.a | grep ff_golomb_vlc_len U ff_golomb_vlc_len U ff_golomb_vlc_len U ff_golomb_vlc_len U ff_golomb_vlc_len U ff_golomb_vlc_len U ff_golomb_vlc_len Besides, for exampe ff_h264dsp_init is defined in h264dsp.c, but I never saw it to be build to .o file. The above is true for all undefined symbols. Their files aren't built in the process and I can see the symbols as undefined in the libavcodec library. Regards, Pavel. On Thu, Jul 4, 2013 at 2:20 AM, Carl Eugen Hoyos wrote: > Pavel Vazharov writes: > > > ./configure > > A few unrelated comments (your explanations may > help improving the configure script): > > > --arch=x86 > > --target-os=qnx > > Is this really needed? > > > --enable-static > > --disable-shared > > This is the default (unneeded). > > > --disable-everything > > --disable-programs > > --disable-postproc > > --disable-vdpau > > You may want to use --disable-all > > > --disable-ffplay > > --disable-ffprobe > > --disable-ffserver > > Does --disable-programs not work? > > > --disable-protocols > > Does --disable-everything not work? > > > --disable-dxva2 > > --disable-mipsfpu > > --disable-altivec > > --disable-vda > > These look useless. > > > --disable-yasm > > --disable-mmxext > > --disable-inline-asm > > Since you also used --disable-debug I > have to ask if you try to produce a > useless library (no debug information, > but no optimizations either)? > If you have a good reason, --disable-asm > is probably simpler. > > > The library builds fine but the problem is that when > > I try to link again libavcodec.a in my application I > > get undefined references for symbols > > What does git log say about the version you are testing? > > 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 attila.sukosd at gmail.com Sat Jul 6 15:49:20 2013 From: attila.sukosd at gmail.com (Attila Sukosd) Date: Sat, 6 Jul 2013 15:49:20 +0200 Subject: [Libav-user] Decoding single NALUs from x264 programmatically (no luck even with parser), works fine with concatenated NALUs Message-ID: Hi guys, There was this thread about decoding NALUs one-by-one with parser2/decode2 and I'm having exactly the same issue. I have x264 creating a bunch of NALUs, in annex_b and repeate_headers, and trying to decode them one by one on the client side. When I concatenate all the NALUs per frame into one large packet, and feed that directly into avcodec_decode_video2, everything is fine, the decode is successful. However, when I try to feed single NALs directly to avcodec_decode_video2, it spits out a bunch of errors. After searching for a while on the net, I read some place that certain types of NALs affect the rest of the data stream, and they need to be group together. I've tried to run the NALs through av_parser_parse2 and tried to decode the output buffer when the output size was larger than zero, however, after looking at the output buffer contents, it seems like while the output size seems reasonable (around the size of the NALs or a combination of a number of previous NALs), the output buffer content contains 3-4 bytes, and the rest is zero. The decoding looks like this: ret = av_parser_parse2(decoder->pParserCtx, decoder->pCodecCtx, decoder->tmp_data, &outsize, buff, size, 0, 0, AV_NOPTS_VALUE); printf("%p buff, %p outdata, consumed %d, %d bufsize, %d outsize\n", buff, decoder->tmp_data,ret, size, outsize); disp_buff(decoder->tmp_data, 50); if (outsize <= 0) return 0; decoder->avpkt.flags = AV_PKT_FLAG_KEY; decoder->avpkt.data = decoder->tmp_data; decoder->avpkt.size = outsize; got_picture = 0; if ((ret = avcodec_decode_video2(decoder->pCodecCtx, decoder->pFrame, &got_picture, &decoder->avpkt)) < 0) { LOGE(__FUNCTION__, "H264 decoding failed!\n"); return -1; } Could someone shed some light on if I'm really off the right track? or am I just missing something very trivial? Best Regards, Attila -------------- next part -------------- An HTML attachment was scrubbed... URL: From faraz at screenhero.com Sat Jul 6 18:35:52 2013 From: faraz at screenhero.com (Faraz Khan) Date: Sat, 6 Jul 2013 09:35:52 -0700 Subject: [Libav-user] Decoding single NALUs from x264 programmatically (no luck even with parser), works fine with concatenated NALUs In-Reply-To: References: Message-ID: Atilla, We tried this and came to the conclusion that ffmpeg is probably not designed to handle a single NALU at a time. You can get the parser to work in a sort of unreliable fashion if you turn on Annex-b headers in your encoder (we were using x264). However the parser may still be unable to read frames. The only reliable way is to not use the parser and feed the entire frame (directly) to ffmpeg decode. For this to work you would need some rtp magic / a jitterbuffer to accumulate these NALUs back into the entire frame. This works just fine with annex-b headers/repeat headers using x264. On Sat, Jul 6, 2013 at 6:49 AM, Attila Sukosd wrote: > Hi guys, > > There was this thread about decoding NALUs one-by-one with parser2/decode2 > and I'm having exactly the same issue. > > I have x264 creating a bunch of NALUs, in annex_b and repeate_headers, and > trying to decode them one by one on the client side. When I concatenate all > the NALUs per frame into one large packet, and feed that directly into > avcodec_decode_video2, everything is fine, the decode is successful. > However, when I try to feed single NALs directly to avcodec_decode_video2, > it spits out a bunch of errors. After searching for a while on the net, I > read some place that certain types of NALs affect the rest of the data > stream, and they need to be group together. > I've tried to run the NALs through av_parser_parse2 and tried to decode > the output buffer when the output size was larger than zero, however, after > looking at the output buffer contents, it seems like while the output size > seems reasonable (around the size of the NALs or a combination of a number > of previous NALs), the output buffer content contains 3-4 bytes, and the > rest is zero. > > The decoding looks like this: > > ret = av_parser_parse2(decoder->pParserCtx, decoder->pCodecCtx, > decoder->tmp_data, &outsize, buff, size, 0, 0, AV_NOPTS_VALUE); > printf("%p buff, %p outdata, consumed %d, %d bufsize, %d outsize\n", > buff, decoder->tmp_data,ret, size, outsize); > disp_buff(decoder->tmp_data, 50); > > if (outsize <= 0) return 0; > > decoder->avpkt.flags = AV_PKT_FLAG_KEY; > decoder->avpkt.data = decoder->tmp_data; > decoder->avpkt.size = outsize; > > got_picture = 0; > if ((ret = avcodec_decode_video2(decoder->pCodecCtx, decoder->pFrame, > &got_picture, &decoder->avpkt)) < 0) { > LOGE(__FUNCTION__, "H264 decoding failed!\n"); > return -1; > } > > > Could someone shed some light on if I'm really off the right track? or am > I just missing something very trivial? > > > Best Regards, > > Attila > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > > -- -- Faraz Khan Simple Collaboration Screensharing www.screenhero.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From attila.sukosd at gmail.com Sat Jul 6 18:42:48 2013 From: attila.sukosd at gmail.com (Attila Sukosd) Date: Sat, 6 Jul 2013 18:42:48 +0200 Subject: [Libav-user] Decoding single NALUs from x264 programmatically (no luck even with parser), works fine with concatenated NALUs In-Reply-To: References: Message-ID: Hi Faraz, Thanks a lot for your fast reply! I guess I will try to do it as you say, reconstruct the frame out of the arrived NALUs and feed that to the decoder at once. Did you run some tests on what happens in case some of the NALUs get lost due to packet loss? Best, Attila ----------------------------------------- DTU Computing Center - www.cc.dtu.dk attila at cc.dtu.dk, gbaras at student.dtu.dk, s070600 at student.dtu.dk On Sat, Jul 6, 2013 at 6:35 PM, Faraz Khan wrote: > Atilla, > We tried this and came to the conclusion that ffmpeg is probably not > designed to handle a single NALU at a time. You can get the parser to work > in a sort of unreliable fashion if you turn on Annex-b headers in your > encoder (we were using x264). However the parser may still be unable to > read frames. The only reliable way is to not use the parser and feed the > entire frame (directly) to ffmpeg decode. For this to work you would need > some rtp magic / a jitterbuffer to accumulate these NALUs back into the > entire frame. This works just fine with annex-b headers/repeat headers > using x264. > > > > > > On Sat, Jul 6, 2013 at 6:49 AM, Attila Sukosd wrote: > >> Hi guys, >> >> There was this thread about decoding NALUs one-by-one with >> parser2/decode2 and I'm having exactly the same issue. >> >> I have x264 creating a bunch of NALUs, in annex_b and repeate_headers, >> and trying to decode them one by one on the client side. When I concatenate >> all the NALUs per frame into one large packet, and feed that directly into >> avcodec_decode_video2, everything is fine, the decode is successful. >> However, when I try to feed single NALs directly to >> avcodec_decode_video2, it spits out a bunch of errors. After searching for >> a while on the net, I read some place that certain types of NALs affect the >> rest of the data stream, and they need to be group together. >> I've tried to run the NALs through av_parser_parse2 and tried to decode >> the output buffer when the output size was larger than zero, however, after >> looking at the output buffer contents, it seems like while the output size >> seems reasonable (around the size of the NALs or a combination of a number >> of previous NALs), the output buffer content contains 3-4 bytes, and the >> rest is zero. >> >> The decoding looks like this: >> >> ret = av_parser_parse2(decoder->pParserCtx, decoder->pCodecCtx, >> decoder->tmp_data, &outsize, buff, size, 0, 0, AV_NOPTS_VALUE); >> printf("%p buff, %p outdata, consumed %d, %d bufsize, %d outsize\n", >> buff, decoder->tmp_data,ret, size, outsize); >> disp_buff(decoder->tmp_data, 50); >> >> if (outsize <= 0) return 0; >> >> decoder->avpkt.flags = AV_PKT_FLAG_KEY; >> decoder->avpkt.data = decoder->tmp_data; >> decoder->avpkt.size = outsize; >> >> got_picture = 0; >> if ((ret = avcodec_decode_video2(decoder->pCodecCtx, decoder->pFrame, >> &got_picture, &decoder->avpkt)) < 0) { >> LOGE(__FUNCTION__, "H264 decoding failed!\n"); >> return -1; >> } >> >> >> Could someone shed some light on if I'm really off the right track? or am >> I just missing something very trivial? >> >> >> Best Regards, >> >> Attila >> >> _______________________________________________ >> Libav-user mailing list >> Libav-user at ffmpeg.org >> http://ffmpeg.org/mailman/listinfo/libav-user >> >> > > > -- > > -- > Faraz Khan > Simple Collaboration Screensharing > www.screenhero.com > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From faraz at screenhero.com Sat Jul 6 18:46:08 2013 From: faraz at screenhero.com (Faraz Khan) Date: Sat, 6 Jul 2013 09:46:08 -0700 Subject: [Libav-user] Decoding single NALUs from x264 programmatically (no luck even with parser), works fine with concatenated NALUs In-Reply-To: References: Message-ID: Are you using x264? x264 has this awesome option called intra_refresh - set that to one and use the keyint_max stuff to specify how quickly you want a intra refresh. It can be as quick as 2-3 times the framerate. With that, the decoder would magically recover even if you have 100% packet loss :) On Sat, Jul 6, 2013 at 9:42 AM, Attila Sukosd wrote: > Hi Faraz, > > Thanks a lot for your fast reply! I guess I will try to do it as you say, > reconstruct the frame out of the arrived NALUs and feed that to the decoder > at once. > Did you run some tests on what happens in case some of the NALUs get lost > due to packet loss? > > Best, > > Attila > > > ----------------------------------------- > DTU Computing Center - www.cc.dtu.dk > attila at cc.dtu.dk, gbaras at student.dtu.dk, s070600 at student.dtu.dk > > > > On Sat, Jul 6, 2013 at 6:35 PM, Faraz Khan wrote: > >> Atilla, >> We tried this and came to the conclusion that ffmpeg is probably not >> designed to handle a single NALU at a time. You can get the parser to work >> in a sort of unreliable fashion if you turn on Annex-b headers in your >> encoder (we were using x264). However the parser may still be unable to >> read frames. The only reliable way is to not use the parser and feed the >> entire frame (directly) to ffmpeg decode. For this to work you would need >> some rtp magic / a jitterbuffer to accumulate these NALUs back into the >> entire frame. This works just fine with annex-b headers/repeat headers >> using x264. >> >> >> >> >> >> On Sat, Jul 6, 2013 at 6:49 AM, Attila Sukosd wrote: >> >>> Hi guys, >>> >>> There was this thread about decoding NALUs one-by-one with >>> parser2/decode2 and I'm having exactly the same issue. >>> >>> I have x264 creating a bunch of NALUs, in annex_b and repeate_headers, >>> and trying to decode them one by one on the client side. When I concatenate >>> all the NALUs per frame into one large packet, and feed that directly into >>> avcodec_decode_video2, everything is fine, the decode is successful. >>> However, when I try to feed single NALs directly to >>> avcodec_decode_video2, it spits out a bunch of errors. After searching for >>> a while on the net, I read some place that certain types of NALs affect the >>> rest of the data stream, and they need to be group together. >>> I've tried to run the NALs through av_parser_parse2 and tried to decode >>> the output buffer when the output size was larger than zero, however, after >>> looking at the output buffer contents, it seems like while the output size >>> seems reasonable (around the size of the NALs or a combination of a number >>> of previous NALs), the output buffer content contains 3-4 bytes, and the >>> rest is zero. >>> >>> The decoding looks like this: >>> >>> ret = av_parser_parse2(decoder->pParserCtx, decoder->pCodecCtx, >>> decoder->tmp_data, &outsize, buff, size, 0, 0, AV_NOPTS_VALUE); >>> printf("%p buff, %p outdata, consumed %d, %d bufsize, %d outsize\n", >>> buff, decoder->tmp_data,ret, size, outsize); >>> disp_buff(decoder->tmp_data, 50); >>> >>> if (outsize <= 0) return 0; >>> >>> decoder->avpkt.flags = AV_PKT_FLAG_KEY; >>> decoder->avpkt.data = decoder->tmp_data; >>> decoder->avpkt.size = outsize; >>> >>> got_picture = 0; >>> if ((ret = avcodec_decode_video2(decoder->pCodecCtx, decoder->pFrame, >>> &got_picture, &decoder->avpkt)) < 0) { >>> LOGE(__FUNCTION__, "H264 decoding failed!\n"); >>> return -1; >>> } >>> >>> >>> Could someone shed some light on if I'm really off the right track? or >>> am I just missing something very trivial? >>> >>> >>> Best Regards, >>> >>> Attila >>> >>> _______________________________________________ >>> Libav-user mailing list >>> Libav-user at ffmpeg.org >>> http://ffmpeg.org/mailman/listinfo/libav-user >>> >>> >> >> >> -- >> >> -- >> Faraz Khan >> Simple Collaboration Screensharing >> www.screenhero.com >> >> _______________________________________________ >> Libav-user mailing list >> Libav-user at ffmpeg.org >> http://ffmpeg.org/mailman/listinfo/libav-user >> >> > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > > -- -- Faraz Khan Simple Collaboration Screensharing www.screenhero.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From nicolas at twinsview.fr Sat Jul 6 01:25:03 2013 From: nicolas at twinsview.fr (BrokenMo) Date: Fri, 5 Jul 2013 16:25:03 -0700 (PDT) Subject: [Libav-user] C++ send h264/AAC on youtube or wowza Message-ID: <1373066703356-4658096.post@n4.nabble.com> Hello everyone, I have problem for send h264/AAC on youtube or wowza. If I save on file, that work, il y send just video or just audio, that work. But when I send both not. I think that is PTS/DTS, because I have wowza log. When that work, just audio or video : pts:0>125 || rt:1373046703342>1373046703387 pts:40>125 || rt:1373046703342>1373046703387 pts:80>125 || rt:1373046703343>1373046703387 pts:120>125 || rt:1373046703398>1373046703387 pts:160>245 || rt:1373046703415>1373046703523 pts:200>245 || rt:1373046703477>1373046703523 pts:240>245 || rt:1373046703507>1373046703523 pts:280>245 || rt:1373046703572>1373046703523 pts:320>405 || rt:1373046703597>1373046703697 when I send both : pts:0>125 || rt:1373040316873>1373040316955 pts:40>125 || rt:1373040316873>1373040316955 pts:80>125 || rt:1373040316944>1373040316955 pts:120>125 || rt:1373040316944>1373040316955 pts:2284>125 || rt:1373040316945>1373040316955 pts:4294965172>2409 || rt:1373040317013>1373040317070 pts:4294967319>4294965297 || rt:1373040317015>1373040317138 pts:4294967319>4294967444 || rt:1373040317021>1373040317140 pts:4294967340>4294967444 || rt:1373040317021>1373040317140 I don't know why pts up like this my code : if (inputNode->outData.stream_index == 0) { inputNode->outData.duration = formatCtx->streams[0]->time_base.den / 25; if (inputNode->outData.pts != AV_NOPTS_VALUE) inputNode->outData.pts = av_rescale_q(inputNode->outData.pts, (AVRational){1,25}, formatCtx->streams[0]->time_base); if (inputNode->outData.dts != AV_NOPTS_VALUE) inputNode->outData.dts = av_rescale_q(inputNode->outData.dts, (AVRational){1,25}, formatCtx->streams[0]->time_base); //inputNode->outData.dts = inputNode->outData.pts = inputNode->outData.dts * 40; std::cerr << inputNode->outData.dts << " " << inputNode->outData.duration << " " << inputNode->outData.pts << " video" << std::endl; } else { inputNode->outData.duration = formatCtx->streams[1]->time_base.den / 25; inputNode->outData.pts = inputNode->outData.dts = audioCount; audioCount += inputNode->outData.duration; std::cerr << inputNode->outData.dts << " " << inputNode->outData.duration << " " << inputNode->outData.pts << " audio" << std::endl; } av_write_frame( formatCtx, &(inputNode->outData) ) ; My log is good : 0 40 0 video 40 40 40 video 80 40 80 video 120 40 120 video 0 40 0 audio 160 40 160 video 40 40 40 audio 200 40 200 video 80 40 80 audio 240 40 240 video 120 40 120 audio 280 40 280 video 160 40 160 audio 320 40 320 video 200 40 200 audio 360 40 360 video 240 40 240 audio 400 40 400 video 280 40 280 audio 440 40 440 video 320 40 320 audio thank for your help ! -- View this message in context: http://libav-users.943685.n4.nabble.com/C-send-h264-AAC-on-youtube-or-wowza-tp4658096.html Sent from the libav-users mailing list archive at Nabble.com. From attila.sukosd at gmail.com Sat Jul 6 19:53:31 2013 From: attila.sukosd at gmail.com (Attila Sukosd) Date: Sat, 6 Jul 2013 19:53:31 +0200 Subject: [Libav-user] Decoding single NALUs from x264 programmatically (no luck even with parser), works fine with concatenated NALUs In-Reply-To: References: Message-ID: Ye, x264. Thanks for the advice, seem to work much better now :) Cheers, Attila ----------------------------------------- DTU Computing Center - www.cc.dtu.dk attila at cc.dtu.dk, gbaras at student.dtu.dk, s070600 at student.dtu.dk On Sat, Jul 6, 2013 at 6:46 PM, Faraz Khan wrote: > Are you using x264? x264 has this awesome option called intra_refresh - > set that to one and use the keyint_max stuff to specify how quickly you > want a intra refresh. It can be as quick as 2-3 times the framerate. With > that, the decoder would magically recover even if you have 100% packet loss > :) > > > > On Sat, Jul 6, 2013 at 9:42 AM, Attila Sukosd wrote: > >> Hi Faraz, >> >> Thanks a lot for your fast reply! I guess I will try to do it as you say, >> reconstruct the frame out of the arrived NALUs and feed that to the decoder >> at once. >> Did you run some tests on what happens in case some of the NALUs get lost >> due to packet loss? >> >> Best, >> >> Attila >> >> >> ----------------------------------------- >> DTU Computing Center - www.cc.dtu.dk >> attila at cc.dtu.dk, gbaras at student.dtu.dk, s070600 at student.dtu.dk >> >> >> >> On Sat, Jul 6, 2013 at 6:35 PM, Faraz Khan wrote: >> >>> Atilla, >>> We tried this and came to the conclusion that ffmpeg is probably not >>> designed to handle a single NALU at a time. You can get the parser to work >>> in a sort of unreliable fashion if you turn on Annex-b headers in your >>> encoder (we were using x264). However the parser may still be unable to >>> read frames. The only reliable way is to not use the parser and feed the >>> entire frame (directly) to ffmpeg decode. For this to work you would need >>> some rtp magic / a jitterbuffer to accumulate these NALUs back into the >>> entire frame. This works just fine with annex-b headers/repeat headers >>> using x264. >>> >>> >>> >>> >>> >>> On Sat, Jul 6, 2013 at 6:49 AM, Attila Sukosd wrote: >>> >>>> Hi guys, >>>> >>>> There was this thread about decoding NALUs one-by-one with >>>> parser2/decode2 and I'm having exactly the same issue. >>>> >>>> I have x264 creating a bunch of NALUs, in annex_b and repeate_headers, >>>> and trying to decode them one by one on the client side. When I concatenate >>>> all the NALUs per frame into one large packet, and feed that directly into >>>> avcodec_decode_video2, everything is fine, the decode is successful. >>>> However, when I try to feed single NALs directly to >>>> avcodec_decode_video2, it spits out a bunch of errors. After searching for >>>> a while on the net, I read some place that certain types of NALs affect the >>>> rest of the data stream, and they need to be group together. >>>> I've tried to run the NALs through av_parser_parse2 and tried to decode >>>> the output buffer when the output size was larger than zero, however, after >>>> looking at the output buffer contents, it seems like while the output size >>>> seems reasonable (around the size of the NALs or a combination of a number >>>> of previous NALs), the output buffer content contains 3-4 bytes, and the >>>> rest is zero. >>>> >>>> The decoding looks like this: >>>> >>>> ret = av_parser_parse2(decoder->pParserCtx, decoder->pCodecCtx, >>>> decoder->tmp_data, &outsize, buff, size, 0, 0, AV_NOPTS_VALUE); >>>> printf("%p buff, %p outdata, consumed %d, %d bufsize, %d outsize\n", >>>> buff, decoder->tmp_data,ret, size, outsize); >>>> disp_buff(decoder->tmp_data, 50); >>>> >>>> if (outsize <= 0) return 0; >>>> >>>> decoder->avpkt.flags = AV_PKT_FLAG_KEY; >>>> decoder->avpkt.data = decoder->tmp_data; >>>> decoder->avpkt.size = outsize; >>>> >>>> got_picture = 0; >>>> if ((ret = avcodec_decode_video2(decoder->pCodecCtx, decoder->pFrame, >>>> &got_picture, &decoder->avpkt)) < 0) { >>>> LOGE(__FUNCTION__, "H264 decoding failed!\n"); >>>> return -1; >>>> } >>>> >>>> >>>> Could someone shed some light on if I'm really off the right track? or >>>> am I just missing something very trivial? >>>> >>>> >>>> Best Regards, >>>> >>>> Attila >>>> >>>> _______________________________________________ >>>> Libav-user mailing list >>>> Libav-user at ffmpeg.org >>>> http://ffmpeg.org/mailman/listinfo/libav-user >>>> >>>> >>> >>> >>> -- >>> >>> -- >>> Faraz Khan >>> Simple Collaboration Screensharing >>> www.screenhero.com >>> >>> _______________________________________________ >>> Libav-user mailing list >>> Libav-user at ffmpeg.org >>> http://ffmpeg.org/mailman/listinfo/libav-user >>> >>> >> >> _______________________________________________ >> Libav-user mailing list >> Libav-user at ffmpeg.org >> http://ffmpeg.org/mailman/listinfo/libav-user >> >> > > > -- > > -- > Faraz Khan > Simple Collaboration Screensharing > www.screenhero.com > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From night.rain.whisper at gmail.com Sun Jul 7 09:13:13 2013 From: night.rain.whisper at gmail.com (Sergey Fedorov) Date: Sun, 7 Jul 2013 11:13:13 +0400 Subject: [Libav-user] Decoding single NALUs from x264 programmatically (no luck even with parser), works fine with concatenated NALUs In-Reply-To: References: Message-ID: Did you try using CODEC_FLAG2_CHUNKS? 2013/7/6 Attila Sukosd > Hi guys, > > There was this thread about decoding NALUs one-by-one with parser2/decode2 > and I'm having exactly the same issue. > > I have x264 creating a bunch of NALUs, in annex_b and repeate_headers, and > trying to decode them one by one on the client side. When I concatenate all > the NALUs per frame into one large packet, and feed that directly into > avcodec_decode_video2, everything is fine, the decode is successful. > However, when I try to feed single NALs directly to avcodec_decode_video2, > it spits out a bunch of errors. After searching for a while on the net, I > read some place that certain types of NALs affect the rest of the data > stream, and they need to be group together. > I've tried to run the NALs through av_parser_parse2 and tried to decode > the output buffer when the output size was larger than zero, however, after > looking at the output buffer contents, it seems like while the output size > seems reasonable (around the size of the NALs or a combination of a number > of previous NALs), the output buffer content contains 3-4 bytes, and the > rest is zero. > > The decoding looks like this: > > ret = av_parser_parse2(decoder->pParserCtx, decoder->pCodecCtx, > decoder->tmp_data, &outsize, buff, size, 0, 0, AV_NOPTS_VALUE); > printf("%p buff, %p outdata, consumed %d, %d bufsize, %d outsize\n", > buff, decoder->tmp_data,ret, size, outsize); > disp_buff(decoder->tmp_data, 50); > > if (outsize <= 0) return 0; > > decoder->avpkt.flags = AV_PKT_FLAG_KEY; > decoder->avpkt.data = decoder->tmp_data; > decoder->avpkt.size = outsize; > > got_picture = 0; > if ((ret = avcodec_decode_video2(decoder->pCodecCtx, decoder->pFrame, > &got_picture, &decoder->avpkt)) < 0) { > LOGE(__FUNCTION__, "H264 decoding failed!\n"); > return -1; > } > > > Could someone shed some light on if I'm really off the right track? or am > I just missing something very trivial? > > > Best Regards, > > Attila > > _______________________________________________ > 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 pvazharov at abaltatech.com Sun Jul 7 19:14:44 2013 From: pvazharov at abaltatech.com (Pavel Vazharov) Date: Sun, 7 Jul 2013 10:14:44 -0700 Subject: [Libav-user] Build of ffmpeg library with libx264 support for QNX In-Reply-To: References: Message-ID: Hi Ramu, I'm pretty sure that the symbols aren't present in the static libraries. objdump tool shows them as undefined: # objdump -t libavcodec/libavcodec.a | grep ff_h264dsp_init 00000000 *UND* 00000000 ff_h264dsp_init # objdump -t libavcodec/libavcodec.a | grep ff_golomb_vlc_len 00000000 *UND* 00000000 ff_golomb_vlc_len 00000000 *UND* 00000000 ff_golomb_vlc_len 00000000 *UND* 00000000 ff_golomb_vlc_len 00000000 *UND* 00000000 ff_golomb_vlc_len 00000000 *UND* 00000000 ff_golomb_vlc_len 00000000 *UND* 00000000 ff_golomb_vlc_len Besides, for exampe ff_h264dsp_init is defined in h264dsp.c, but I never saw it to be build to .o file. The above is true for all undefined symbols. Their files aren't built in the process and I can see the symbols as undefined in the libavcodec library. However, I managed to build ffmpeg with needed symbols with a hack (I'm not proud of it). The configure script produces comfig.mak file and there is config generated options such as: !CONFIG_H264CHROMA=yes !CONFIG_H264DSP=yes !CONFIG_H264PRED=yes !CONFIG_H264QPEL=yes .... .... The symbols from these object files - h264dsp, h264chroma. etc. were missing. So I manually removed the '!' before each of these and then the produced library has all needed symbols. There is the following section in the configure script # options emitted with CONFIG_ prefix but not available on the command line CONFIG_EXTRA=" ... ... golomb gplv3 h264chroma h264dsp h264pred h264qpel ... ... Can someone tell me how to enable these options without hacking? Thanks in advance. Hi Carl, I'm going to go through the my experiments again and to explain how I got this configure script. The steps are shown in the attached file because the system rejects my e-mail as too long otherwise. On Thu, Jul 4, 2013 at 2:20 AM, Carl Eugen Hoyos wrote: > Pavel Vazharov writes: > > > ./configure > > A few unrelated comments (your explanations may > help improving the configure script): > > > --arch=x86 > > --target-os=qnx > > Is this really needed? > > > --enable-static > > --disable-shared > > This is the default (unneeded). > > > --disable-everything > > --disable-programs > > --disable-postproc > > --disable-vdpau > > You may want to use --disable-all > > > --disable-ffplay > > --disable-ffprobe > > --disable-ffserver > > Does --disable-programs not work? > > > --disable-protocols > > Does --disable-everything not work? > > > --disable-dxva2 > > --disable-mipsfpu > > --disable-altivec > > --disable-vda > > These look useless. > > > --disable-yasm > > --disable-mmxext > > --disable-inline-asm > > Since you also used --disable-debug I > have to ask if you try to produce a > useless library (no debug information, > but no optimizations either)? > If you have a good reason, --disable-asm > is probably simpler. > > > The library builds fine but the problem is that when > > I try to link again libavcodec.a in my application I > > get undefined references for symbols > > What does git log say about the version you are testing? > > Carl Eugen > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: configure_steps.zip Type: application/zip Size: 2350 bytes Desc: not available URL: From cehoyos at ag.or.at Sun Jul 7 19:33:35 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Sun, 7 Jul 2013 17:33:35 +0000 (UTC) Subject: [Libav-user] Build of ffmpeg library with libx264 support for QNX References: Message-ID: Pavel Vazharov writes: > I don't think that the optimizations are disabled. You misunderstood: I did not ask you if you disabled optimizations, I asked you if you disabled them intentionally because you also disabled debugging and debugging normally is the only reason why developers want to disable optimizations. [...] > I commented the row > > do_check_deps "$@" LOL Thank you for wasting our time! Many people are willing to help you here on this mailing list but the minimum requirement is that you are using an unpatched version of FFmpeg, please use current git head if you are not a distributor. Please start with ./configure && make (after installing yasm, it is a small standalone binary), then ask here if you have any questions / problems. Please do not top-post on this mailing list and please do not attach small text files as zips, I cannot imagine that this is welcome anywhere. Sorry, Carl Eugen From pvazharov at abaltatech.com Sun Jul 7 19:50:41 2013 From: pvazharov at abaltatech.com (Pavel Vazharov) Date: Sun, 7 Jul 2013 10:50:41 -0700 Subject: [Libav-user] Build of ffmpeg library with libx264 support for QNX In-Reply-To: References: Message-ID: Ok. Thanks. On Sun, Jul 7, 2013 at 10:33 AM, Carl Eugen Hoyos wrote: > Pavel Vazharov writes: > > > I don't think that the optimizations are disabled. > > You misunderstood: > I did not ask you if you disabled optimizations, I > asked you if you disabled them intentionally > because you also disabled debugging and debugging > normally is the only reason why developers want > to disable optimizations. > > [...] > > > I commented the row > > > > do_check_deps "$@" > > LOL > Thank you for wasting our time! > > Many people are willing to help you here on this > mailing list but the minimum requirement is that > you are using an unpatched version of FFmpeg, > please use current git head if you are not a > distributor. Please start with ./configure && > make (after installing yasm, it is a small > standalone binary), then ask here if you have > any questions / problems. > > Please do not top-post on this mailing list > and please do not attach small text files as > zips, I cannot imagine that this is welcome > anywhere. > > Sorry, 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 faraz at screenhero.com Sun Jul 7 22:15:13 2013 From: faraz at screenhero.com (Faraz Khan) Date: Sun, 7 Jul 2013 13:15:13 -0700 Subject: [Libav-user] Decoding single NALUs from x264 programmatically (no luck even with parser), works fine with concatenated NALUs In-Reply-To: References: Message-ID: Sergey, I did not - is that supposed to do the trick? Would we need a parser in that scenario? On Sun, Jul 7, 2013 at 12:13 AM, Sergey Fedorov < night.rain.whisper at gmail.com> wrote: > Did you try using CODEC_FLAG2_CHUNKS? > > > 2013/7/6 Attila Sukosd > >> Hi guys, >> >> There was this thread about decoding NALUs one-by-one with >> parser2/decode2 and I'm having exactly the same issue. >> >> I have x264 creating a bunch of NALUs, in annex_b and repeate_headers, >> and trying to decode them one by one on the client side. When I concatenate >> all the NALUs per frame into one large packet, and feed that directly into >> avcodec_decode_video2, everything is fine, the decode is successful. >> However, when I try to feed single NALs directly to >> avcodec_decode_video2, it spits out a bunch of errors. After searching for >> a while on the net, I read some place that certain types of NALs affect the >> rest of the data stream, and they need to be group together. >> I've tried to run the NALs through av_parser_parse2 and tried to decode >> the output buffer when the output size was larger than zero, however, after >> looking at the output buffer contents, it seems like while the output size >> seems reasonable (around the size of the NALs or a combination of a number >> of previous NALs), the output buffer content contains 3-4 bytes, and the >> rest is zero. >> >> The decoding looks like this: >> >> ret = av_parser_parse2(decoder->pParserCtx, decoder->pCodecCtx, >> decoder->tmp_data, &outsize, buff, size, 0, 0, AV_NOPTS_VALUE); >> printf("%p buff, %p outdata, consumed %d, %d bufsize, %d outsize\n", >> buff, decoder->tmp_data,ret, size, outsize); >> disp_buff(decoder->tmp_data, 50); >> >> if (outsize <= 0) return 0; >> >> decoder->avpkt.flags = AV_PKT_FLAG_KEY; >> decoder->avpkt.data = decoder->tmp_data; >> decoder->avpkt.size = outsize; >> >> got_picture = 0; >> if ((ret = avcodec_decode_video2(decoder->pCodecCtx, decoder->pFrame, >> &got_picture, &decoder->avpkt)) < 0) { >> LOGE(__FUNCTION__, "H264 decoding failed!\n"); >> return -1; >> } >> >> >> Could someone shed some light on if I'm really off the right track? or am >> I just missing something very trivial? >> >> >> Best Regards, >> >> Attila >> >> _______________________________________________ >> Libav-user mailing list >> Libav-user at ffmpeg.org >> http://ffmpeg.org/mailman/listinfo/libav-user >> >> > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > > -- -- Faraz Khan Simple Collaboration Screensharing www.screenhero.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From faraz at screenhero.com Sun Jul 7 22:50:48 2013 From: faraz at screenhero.com (Faraz Khan) Date: Sun, 7 Jul 2013 13:50:48 -0700 Subject: [Libav-user] Decoding single NALUs from x264 programmatically (no luck even with parser), works fine with concatenated NALUs In-Reply-To: References: Message-ID: Sergey, Just tried - setting decoderContext->flags2 to CODEC_FLAG2_CHUNKS also doesnt work (with or without parser!) Is there something special that needs to be done? Decoder keeps saying: *Screenhero[45392:13803] Current profile doesn't provide more RBSP data in PPS, skipping* *2013-07-07 13:47:38.105 Screenhero[45392:13803] Frame size received is 8476 * *2013-07-07 13:47:38.107 Screenhero[45392:13803] out of range intra chroma pred mode at 67358720 -1583242847* *2013-07-07 13:47:38.107 Screenhero[45392:13803] error while decoding MB 67358720 -1583242847* *2013-07-07 13:47:38.108 Screenhero[45392:13803] out of range intra chroma pred mode at 67358720 -1583242847* *2013-07-07 13:47:38.108 Screenhero[45392:13803] error while decoding MB 67358720 -1583242847* *2013-07-07 13:47:38.119 Screenhero[45392:13803] Frame size received is 6464 * *2013-07-07 13:47:38.120 Screenhero[45392:13803] Frame size received is 1287 * *2013-07-07 13:47:38.126 Screenhero[45392:13803] Frame size received is 9938 * *2013-07-07 13:47:38.127 Screenhero[45392:13803] cbp too large (67358720) at -1583242847 67358792* *2013-07-07 13:47:38.127 Screenhero[45392:13803] error while decoding MB 67358720 -1583242847* *2013-07-07 13:47:38.127 Screenhero[45392:13803] negative number of zero coeffs at 67358720 -1583242847* *2013-07-07 13:47:38.128 Screenhero[45392:13803] error while decoding MB 67358720 -1583242847* *2013-07-07 13:47:38.134 Screenhero[45392:13803] Frame size received is 2574 * * * *Thanks!* * * On Sun, Jul 7, 2013 at 1:15 PM, Faraz Khan wrote: > Sergey, > I did not - is that supposed to do the trick? Would we need a parser in > that scenario? > > > > On Sun, Jul 7, 2013 at 12:13 AM, Sergey Fedorov < > night.rain.whisper at gmail.com> wrote: > >> Did you try using CODEC_FLAG2_CHUNKS? >> >> >> 2013/7/6 Attila Sukosd >> >>> Hi guys, >>> >>> There was this thread about decoding NALUs one-by-one with >>> parser2/decode2 and I'm having exactly the same issue. >>> >>> I have x264 creating a bunch of NALUs, in annex_b and repeate_headers, >>> and trying to decode them one by one on the client side. When I concatenate >>> all the NALUs per frame into one large packet, and feed that directly into >>> avcodec_decode_video2, everything is fine, the decode is successful. >>> However, when I try to feed single NALs directly to >>> avcodec_decode_video2, it spits out a bunch of errors. After searching for >>> a while on the net, I read some place that certain types of NALs affect the >>> rest of the data stream, and they need to be group together. >>> I've tried to run the NALs through av_parser_parse2 and tried to decode >>> the output buffer when the output size was larger than zero, however, after >>> looking at the output buffer contents, it seems like while the output size >>> seems reasonable (around the size of the NALs or a combination of a number >>> of previous NALs), the output buffer content contains 3-4 bytes, and the >>> rest is zero. >>> >>> The decoding looks like this: >>> >>> ret = av_parser_parse2(decoder->pParserCtx, decoder->pCodecCtx, >>> decoder->tmp_data, &outsize, buff, size, 0, 0, AV_NOPTS_VALUE); >>> printf("%p buff, %p outdata, consumed %d, %d bufsize, %d outsize\n", >>> buff, decoder->tmp_data,ret, size, outsize); >>> disp_buff(decoder->tmp_data, 50); >>> >>> if (outsize <= 0) return 0; >>> >>> decoder->avpkt.flags = AV_PKT_FLAG_KEY; >>> decoder->avpkt.data = decoder->tmp_data; >>> decoder->avpkt.size = outsize; >>> >>> got_picture = 0; >>> if ((ret = avcodec_decode_video2(decoder->pCodecCtx, decoder->pFrame, >>> &got_picture, &decoder->avpkt)) < 0) { >>> LOGE(__FUNCTION__, "H264 decoding failed!\n"); >>> return -1; >>> } >>> >>> >>> Could someone shed some light on if I'm really off the right track? or >>> am I just missing something very trivial? >>> >>> >>> Best Regards, >>> >>> Attila >>> >>> _______________________________________________ >>> Libav-user mailing list >>> Libav-user at ffmpeg.org >>> http://ffmpeg.org/mailman/listinfo/libav-user >>> >>> >> >> _______________________________________________ >> Libav-user mailing list >> Libav-user at ffmpeg.org >> http://ffmpeg.org/mailman/listinfo/libav-user >> >> > > > -- > > -- > Faraz Khan > Simple Collaboration Screensharing > www.screenhero.com > -- -- Faraz Khan Simple Collaboration Screensharing www.screenhero.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From vahid at kowsari.com Mon Jul 8 01:02:17 2013 From: vahid at kowsari.com (Vahid Kowsari) Date: Sun, 7 Jul 2013 16:02:17 -0700 Subject: [Libav-user] Getting frame duration when decoding Message-ID: Hi All, I am decoding some MPEG-2 and H264 streams from file and have a problem getting the correct duration of a frame. Some files are MPEG2 transport streams while other are wrapped in mp4 or MOV container. I use the following section of code pFrame is the input AVFrame after decoding AVStream *pStream = pCtx->pFormatCtx->streams[pCtx->activeVideoStream]; double time_base = av_q2d(pStream->time_base); double duration = time_base * av_frame_get_pkt_duration(pFrame); duration += duration * (pFrame->repeat_pict / 2); My problem is that for alot of streams this works while for others streams the duration needs to be multipled by 2 for the timing to work correctly...even though repeat_pic is 0. I checked interlace flag but in the files that I had the problem, they are both interlaced. What timebase is the correct timebase to use? The codec timebase or the stream timebase? How do I correctly get the duration of a frame regardless of the type of file and the encoding parameters that were used? Thanks much for your help! -------------- next part -------------- An HTML attachment was scrubbed... URL: From aaronmgoldstein at gmail.com Mon Jul 8 09:48:44 2013 From: aaronmgoldstein at gmail.com (Aaron Goldstein) Date: Mon, 8 Jul 2013 00:48:44 -0700 Subject: [Libav-user] Using Libav to Create an RTSP Stream Message-ID: Hi Everyone, I apologize if this is a dumb question, but I've been looking around for a couple days now for an example of using the libav* libraries to stream a video file across a network via the RTSP protocol. I've had this capability working by using ffmpeg to stream to an ffserver (which then would stream to anyone who requested), but I'd like to 1.) do this in a single application, and more importantly to me 2.) learn how to do it. I know I can just look in the ffmpeg source code, but it's my last resort - does anyone have any recommendations for how to do this? or any learning material you've come across on this topic? Thank you for your time. Regards, Aaron -------------- next part -------------- An HTML attachment was scrubbed... URL: From hatalyak.gyula at artklikk.hu Mon Jul 8 10:23:27 2013 From: hatalyak.gyula at artklikk.hu (=?ISO-8859-1?Q?Gyula_Hataly=E1k?=) Date: Mon, 8 Jul 2013 10:23:27 +0200 Subject: [Libav-user] Using Libav to Create an RTSP Stream In-Reply-To: References: Message-ID: I am also interested! On Mon, Jul 8, 2013 at 9:48 AM, Aaron Goldstein wrote: > Hi Everyone, > > I apologize if this is a dumb question, but I've been looking around for a > couple days now for an example of using the libav* libraries to stream a > video file across a network via the RTSP protocol. I've had this capability > working by using ffmpeg to stream to an ffserver (which then would stream > to anyone who requested), but I'd like to 1.) do this in a single > application, and more importantly to me 2.) learn how to do it. > > I know I can just look in the ffmpeg source code, but it's my last resort > - does anyone have any recommendations for how to do this? or any learning > material you've come across on this topic? > > Thank you for your time. > > Regards, > > Aaron > > > _______________________________________________ > 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 steve.hart at rtsw.co.uk Mon Jul 8 11:09:01 2013 From: steve.hart at rtsw.co.uk (Steve Hart) Date: Mon, 8 Jul 2013 10:09:01 +0100 Subject: [Libav-user] Using Libav to Create an RTSP Stream In-Reply-To: References: Message-ID: On 8 July 2013 09:23, Gyula Hataly?k wrote: > I am also interested! > > > On Mon, Jul 8, 2013 at 9:48 AM, Aaron Goldstein > wrote: > >> Hi Everyone, >> >> I apologize if this is a dumb question, but I've been looking around for >> a couple days now for an example of using the libav* libraries to stream a >> video file across a network via the RTSP protocol. I've had this capability >> working by using ffmpeg to stream to an ffserver (which then would stream >> to anyone who requested), but I'd like to 1.) do this in a single >> application, and more importantly to me 2.) learn how to do it. >> >> I know I can just look in the ffmpeg source code, but it's my last resort >> - does anyone have any recommendations for how to do this? or any learning >> material you've come across on this topic? >> >> Thank you for your time. >> >> Regards, >> >> Aaron >> >> >> _______________________________________________ >> Libav-user mailing list >> Libav-user at ffmpeg.org >> http://ffmpeg.org/mailman/listinfo/libav-user >> >> > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > > Me too! I am particularly interested in low latency..... -------------- next part -------------- An HTML attachment was scrubbed... URL: From abelalon at gmail.com Mon Jul 8 11:13:09 2013 From: abelalon at gmail.com (Abel Alonso) Date: Mon, 8 Jul 2013 11:13:09 +0200 Subject: [Libav-user] HW decoding on Android In-Reply-To: References: <51C4D7BB.5090904@gmail.com> <7aab384f-bf81-44d8-8c9e-224c85bd948e@email.android.com> Message-ID: > > Iirc, you were able to work-around that problem: > Does libstagefright decoding with ffmpeg work now or not? > > I've just tested it and it doesn't work. It continues crashing. I think that is related with the format issue I've commented before. -------------- next part -------------- An HTML attachment was scrubbed... URL: From satyagowtham.k at gmail.com Mon Jul 8 12:10:34 2013 From: satyagowtham.k at gmail.com (satya gowtham kudupudi) Date: Mon, 8 Jul 2013 15:40:34 +0530 Subject: [Libav-user] can we start streaming in middle of recording with out exiting current process? Message-ID: i am recording a video with webcam, is there a facility to start streaming to an url without stopping current process? -- *- Gowtham* -------------- next part -------------- An HTML attachment was scrubbed... URL: From lyon at digispot.ru Mon Jul 8 13:20:35 2013 From: lyon at digispot.ru (Leonid Mokruschin) Date: Mon, 8 Jul 2013 15:20:35 +0400 Subject: [Libav-user] Getting frame duration when decoding In-Reply-To: References: Message-ID: <009b01ce7bcd$2afa6c50$80ef44f0$@ru> Hi Vahid: perhaps you need to take into account pStream->codec.time_base and pStream->codec.ticks_per_frame. I believe that pStream->time_base matches to frame rate for interleaved video streams, whereas pStream->codec.time_base matches to field rate. E.g. for 25fps interleaved stream you will get time_base=1/25 but codec.time_base=1/50 and codec.ticks_per_frame==2. Sincerely, LM From: libav-user-bounces at ffmpeg.org [mailto:libav-user-bounces at ffmpeg.org] On Behalf Of Vahid Kowsari Sent: Monday, July 08, 2013 3:02 AM To: libav-user at ffmpeg.org Subject: [Libav-user] Getting frame duration when decoding Hi All, I am decoding some MPEG-2 and H264 streams from file and have a problem getting the correct duration of a frame. Some files are MPEG2 transport streams while other are wrapped in mp4 or MOV container. I use the following section of code pFrame is the input AVFrame after decoding AVStream *pStream = pCtx->pFormatCtx->streams[pCtx->activeVideoStream]; double time_base = av_q2d(pStream->time_base); double duration = time_base * av_frame_get_pkt_duration(pFrame); duration += duration * (pFrame->repeat_pict / 2); My problem is that for alot of streams this works while for others streams the duration needs to be multipled by 2 for the timing to work correctly...even though repeat_pic is 0. I checked interlace flag but in the files that I had the problem, they are both interlaced. What timebase is the correct timebase to use? The codec timebase or the stream timebase? How do I correctly get the duration of a frame regardless of the type of file and the encoding parameters that were used? Thanks much for your help! -------------- next part -------------- An HTML attachment was scrubbed... URL: From krueger at lesspain.de Mon Jul 8 14:04:26 2013 From: krueger at lesspain.de (=?UTF-8?Q?Robert_Kr=C3=BCger?=) Date: Mon, 8 Jul 2013 14:04:26 +0200 Subject: [Libav-user] Getting frame duration when decoding In-Reply-To: <009b01ce7bcd$2afa6c50$80ef44f0$@ru> References: <009b01ce7bcd$2afa6c50$80ef44f0$@ru> Message-ID: On Mon, Jul 8, 2013 at 1:20 PM, Leonid Mokruschin wrote: > Hi Vahid: > > > > perhaps you need to take into account pStream->codec.time_base and > pStream->codec.ticks_per_frame. I believe that pStream->time_base matches to > frame rate for interleaved video streams, whereas pStream->codec.time_base > matches to field rate. E.g. for 25fps interleaved stream you will get > time_base=1/25 but codec.time_base=1/50 and codec.ticks_per_frame==2. No, there are cases where it is this way but there are many where the stream time base is not the inverse of the frame rate. If your code needs to deal with more or less arbitrary input files, this will not work. Vahid, the best IMHO would be if you documented cases where the formula above did not work and maybe add the output of ffprobe -i -show_format -show_streams and then maybe the first few frames/packets of ffprobe -i -show_packets -show_frames (best only include video by using -select_streams 0, if video is stream 0 in your case). That should give people here a better chance to see if something is wrong with the values or if you are could do something better. Maybe you have to resort to some sort of heuristics based on statistics you put together. From robypomper at gmail.com Mon Jul 8 17:23:44 2013 From: robypomper at gmail.com (Secort) Date: Mon, 8 Jul 2013 08:23:44 -0700 (PDT) Subject: [Libav-user] Properly initializing AVFormatContext for an mpeg-ts rtp stream? In-Reply-To: References: Message-ID: <1373297024412-4658116.post@n4.nabble.com> Hi, you can find a sort of solution on this post . -- View this message in context: http://libav-users.943685.n4.nabble.com/Properly-initializing-AVFormatContext-for-an-mpeg-ts-rtp-stream-tp3331208p4658116.html Sent from the libav-users mailing list archive at Nabble.com. From praks411 at gmail.com Tue Jul 9 10:55:26 2013 From: praks411 at gmail.com (Pradeep Karosiya) Date: Tue, 9 Jul 2013 01:55:26 -0700 (PDT) Subject: [Libav-user] Raw video encoding using AV_CODEC_ID_RAWVIDEO Message-ID: <1373360126528-4658117.post@n4.nabble.com> Hi, I'm trying to encoding images into raw video using codec id as av_codec_id_rawvideo. The encoding works fine till the video size is less than 2GB. However when video size exceed 2GB I'm getting weird video sometime just blank or sometime stitched images repeating continously. Sometime I see b/w frames. Also I'm not able to play this video in vlc media player, it just plays on windows media player and that too only for few seconds. Can some one suggest me what could be going wrong. Thanks Pradeep -- View this message in context: http://libav-users.943685.n4.nabble.com/Raw-video-encoding-using-AV-CODEC-ID-RAWVIDEO-tp4658117.html Sent from the libav-users mailing list archive at Nabble.com. From onemda at gmail.com Tue Jul 9 11:49:31 2013 From: onemda at gmail.com (Paul B Mahol) Date: Tue, 9 Jul 2013 09:49:31 +0000 Subject: [Libav-user] Raw video encoding using AV_CODEC_ID_RAWVIDEO In-Reply-To: <1373360126528-4658117.post@n4.nabble.com> References: <1373360126528-4658117.post@n4.nabble.com> Message-ID: On 7/9/13, Pradeep Karosiya wrote: > Hi, > > I'm trying to encoding images into raw video using codec id as > av_codec_id_rawvideo. > The encoding works fine till the video size is less than 2GB. However when > video size exceed 2GB > I'm getting weird video sometime just blank or sometime stitched images > repeating continously. Sometime I see b/w frames. Also I'm not able to play > this video in vlc media player, it just plays on windows media player and > that too only for few seconds. > Can some one suggest me what could be going wrong. What api you use for encoding? What ffmpeg version? > > Thanks > Pradeep > > > > > > -- > View this message in context: > http://libav-users.943685.n4.nabble.com/Raw-video-encoding-using-AV-CODEC-ID-RAWVIDEO-tp4658117.html > Sent from the libav-users mailing list archive at Nabble.com. > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > From praks411 at gmail.com Tue Jul 9 13:18:32 2013 From: praks411 at gmail.com (Pradeep Karosiya) Date: Tue, 9 Jul 2013 04:18:32 -0700 (PDT) Subject: [Libav-user] Raw video encoding using AV_CODEC_ID_RAWVIDEO In-Reply-To: References: <1373360126528-4658117.post@n4.nabble.com> Message-ID: <1373368712801-4658119.post@n4.nabble.com> Hi Paul, I'm using FFmpeg 1.2.1 and api which I used avcodec2_encode_video(). I'm following muxing.c example. The container format of my file is .avi. I'm using it with Visual Studio 2012 on Windows 7 32bits. I think there was a limit on avi file size of <2GB long ago. But I don't think this is still valid. Thanks Pradeep -- View this message in context: http://libav-users.943685.n4.nabble.com/Raw-video-encoding-using-AV-CODEC-ID-RAWVIDEO-tp4658117p4658119.html Sent from the libav-users mailing list archive at Nabble.com. From onemda at gmail.com Tue Jul 9 13:44:07 2013 From: onemda at gmail.com (Paul B Mahol) Date: Tue, 9 Jul 2013 11:44:07 +0000 Subject: [Libav-user] Raw video encoding using AV_CODEC_ID_RAWVIDEO In-Reply-To: <1373368712801-4658119.post@n4.nabble.com> References: <1373360126528-4658117.post@n4.nabble.com> <1373368712801-4658119.post@n4.nabble.com> Message-ID: On 7/9/13, Pradeep Karosiya wrote: > Hi Paul, > > I'm using FFmpeg 1.2.1 and api which I used avcodec2_encode_video(). I'm > following muxing.c example. > The container format of my file is .avi. I'm using it with Visual Studio > 2012 on Windows 7 32bits. > I think there was a limit on avi file size of <2GB long ago. But I don't > think this is still valid. What you use to write .avi ? > > Thanks > Pradeep > > > > -- > View this message in context: > http://libav-users.943685.n4.nabble.com/Raw-video-encoding-using-AV-CODEC-ID-RAWVIDEO-tp4658117p4658119.html > Sent from the libav-users mailing list archive at Nabble.com. > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > From praks411 at gmail.com Tue Jul 9 14:21:37 2013 From: praks411 at gmail.com (Pradeep Karosiya) Date: Tue, 9 Jul 2013 05:21:37 -0700 (PDT) Subject: [Libav-user] Raw video encoding using AV_CODEC_ID_RAWVIDEO In-Reply-To: References: <1373360126528-4658117.post@n4.nabble.com> <1373368712801-4658119.post@n4.nabble.com> Message-ID: <1373372497585-4658121.post@n4.nabble.com> I've used av_interleaved_write_frame() for writing to .avi file. I'm facing this problem only for raw video. For AV_CODEC_ID_MPEG4 it works fine. Here are the two functions which I'm using for writing video and audio frames. //Member function to video frame void FfmpegEncoder::WriteFrameInt(void) { static int num_call = 0; static int64_t vid_pts = -1; AVCodecContext * c = video_st->codec; int ret = 0; AVPacket pkt = {0}; av_init_packet(&pkt); int got_frame = 0; ret = avcodec_encode_video2(c, &pkt, m_pic_frame, &got_frame); if (got_frame > 0 && ret == 0) { pkt.stream_index= video_st->index; vid_pts++; pkt.pts = vid_pts; std::cout<<"Video Pts "<codec; static int64_t aud_pts_in = -1; if((audS != NULL) && (audS->GetSampleLength() > 0) ) { AVFrame *frame = avcodec_alloc_frame(); int byte_per_sample = av_get_bytes_per_sample(c->sample_fmt); PRINT_VAL("Byte Per Sample ", byte_per_sample) frame->nb_samples = (audS->GetSampleLength())/(c->channels*av_get_bytes_per_sample(c->sample_fmt)); frame->channel_layout = c->channel_layout; frame->format = c->sample_fmt; assert(frame->nb_samples == c->frame_size); if(frame->nb_samples == c->frame_size) { assert(audS->GetSampleLength() == m_buffer_size); memcpy(m_samples,(const uint8_t*)audS->GetAudioSampleData(), m_buffer_size); ret = avcodec_fill_audio_frame(frame, m_out_aud_strm->codec->channels, m_out_aud_strm->codec->sample_fmt, (const uint8_t*)m_samples,m_buffer_size, 0); if(ret != 0) { PRINT_MSG("Avcodec Fill Audio Failed ") } else { got_packet = 0; if(frame->pts == AV_NOPTS_VALUE) { frame->pts = m_syn_opts; } m_syn_opts = frame->pts + frame->nb_samples; ret = avcodec_encode_audio2(c, &pkt, frame, &got_packet); if(ret < 0 || got_packet == 0) { PRINT_MSG("FAILED to ENCODE audio ") } else { PRINT_MSG("Audio Packet Encoded "); #if 1 aud_pts_in++; pkt.pts = aud_pts_in; std::cout<<"Audio Pts "<index; fwrite(pkt.data, 1, pkt.size, m_fp); ret = av_interleaved_write_frame(oc, &pkt); if(ret != 0) { PRINT_MSG("FAILED to WRITE Audio PKT ") } else { PRINT_MSG("Audio PKT Writen ") } } avcodec_free_frame(&frame); } } } av_free_packet(&pkt); } Thanks, Pradeep -- View this message in context: http://libav-users.943685.n4.nabble.com/Raw-video-encoding-using-AV-CODEC-ID-RAWVIDEO-tp4658117p4658121.html Sent from the libav-users mailing list archive at Nabble.com. From pvazharov at abaltatech.com Wed Jul 10 03:30:45 2013 From: pvazharov at abaltatech.com (Pavel Vazharov) Date: Tue, 9 Jul 2013 18:30:45 -0700 Subject: [Libav-user] Build of ffmpeg library with libx264 support for QNX In-Reply-To: References: Message-ID: Ok. I'm trying again as I was advised. Baby steps. I downloaded and built yasm on my QNX virtual machine. Then I make - "git clone git://source.ffmpeg.org/ffmpeg.git ffmpeg" on my physical machine and then copied the whole ffmpeg folder to my QNX virtual machine (I don't want to build Git for QNX, too). Then I entered in the ffmpeg directory and executed "./configure" without any switches. This is the result. ======================================================================== # ./configure gcc is unable to create an executable file. If gcc is a cross-compiler, use the --enable-cross-compile option. Only do this if you know what cross compiling means. C compiler test failed. If you think configure made a mistake, make sure you are using the latest version from Git. If the latest version fails, report the problem to the ffmpeg-user at ffmpeg.org mailing list or IRC #ffmpeg on irc.freenode.net. Include the log file "config.log" produced by configure as this will help solving the problem. ========================================================================= How to proceed from here? I know what I did the first two times in order to deal with this and all of the next errors but according to the information in this mail queue my actions were wrong. What switch should I add in order to continue with the configure? Thanks in advance. On Sun, Jul 7, 2013 at 10:50 AM, Pavel Vazharov wrote: > Ok. Thanks. > > > On Sun, Jul 7, 2013 at 10:33 AM, Carl Eugen Hoyos wrote: > >> Pavel Vazharov writes: >> >> > I don't think that the optimizations are disabled. >> >> You misunderstood: >> I did not ask you if you disabled optimizations, I >> asked you if you disabled them intentionally >> because you also disabled debugging and debugging >> normally is the only reason why developers want >> to disable optimizations. >> >> [...] >> >> > I commented the row >> > >> > do_check_deps "$@" >> >> LOL >> Thank you for wasting our time! >> >> Many people are willing to help you here on this >> mailing list but the minimum requirement is that >> you are using an unpatched version of FFmpeg, >> please use current git head if you are not a >> distributor. Please start with ./configure && >> make (after installing yasm, it is a small >> standalone binary), then ask here if you have >> any questions / problems. >> >> Please do not top-post on this mailing list >> and please do not attach small text files as >> zips, I cannot imagine that this is welcome >> anywhere. >> >> Sorry, 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 Wed Jul 10 11:07:28 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Wed, 10 Jul 2013 09:07:28 +0000 (UTC) Subject: [Libav-user] Build of ffmpeg library with libx264 support for QNX References: Message-ID: Pavel Vazharov writes: > Include the log file "config.log" produced by configure > as this will help solving the problem The last 25 lines should be enough. Please stop top-posting, it is considered rude here, Carl Eugen From cehoyos at ag.or.at Wed Jul 10 14:51:56 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Wed, 10 Jul 2013 12:51:56 +0000 (UTC) Subject: [Libav-user] Build of ffmpeg library with libx264 support for QNX References: Message-ID: Carl Eugen Hoyos writes: > > --arch=x86 > > --target-os=qnx > > Is this really needed? To rephrase this question: What do "uname -m" and "uname -s" report? Carl Eugen From pvazharov at abaltatech.com Wed Jul 10 18:16:01 2013 From: pvazharov at abaltatech.com (Pavel Vazharov) Date: Wed, 10 Jul 2013 09:16:01 -0700 Subject: [Libav-user] Build of ffmpeg library with libx264 support for QNX In-Reply-To: References: Message-ID: Hi, Sorry about top posting. I didn't noticed that gmail does this by default. Is it ok in this way or I should do bottom posting? ========================================= # uname -m x86pc # uname -s QNX ========================================= Last 25 lines from the config.log. yuv4mpegpipe_muxer=yes zero12v_decoder=yes zerocodec_decoder=yes zerocodec_decoder_select=zlib zlib_decoder=yes zlib_decoder_select=zlib zlib_encoder=yes zlib_encoder_select=zlib zmbv_decoder=yes zmbv_decoder_select=zlib zmbv_encoder=yes zmbv_encoder_select=zlib zmq_filter=yes zmq_filter_deps=libzmq WARNING: pkg-config not found, library detection may fail. mktemp -u XXXXXX ./configure[2609]: mktemp: cannot execute - No such file or directory check_ld cc check_cc BEGIN /tmp/ffconf..localhost..22065188.c 1 int main(void){ return 0; } END /tmp/ffconf..localhost..22065188.c gcc -c -o /tmp/ffconf..localhost..22065188.c gcc: no input files C compiler test failed. In my opinion the problem is in the line gcc -c -o /tmp/ffconf..localhost..22065188.c which should be something like gcc -c /tmp/ffconf..localhost..22065188.c -o ... -------------- next part -------------- An HTML attachment was scrubbed... URL: From mohzhang at gmail.com Wed Jul 10 21:45:27 2013 From: mohzhang at gmail.com (Jie Zhang) Date: Wed, 10 Jul 2013 15:45:27 -0400 Subject: [Libav-user] what part of ffmpeg lib use GPL Message-ID: Hi Folks, Any one knows what part of ffmpeg lib use GPL instead of LGPL? Thanks, -------------- next part -------------- An HTML attachment was scrubbed... URL: From cehoyos at ag.or.at Wed Jul 10 22:07:26 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Wed, 10 Jul 2013 20:07:26 +0000 (UTC) Subject: [Libav-user] what part of ffmpeg lib use GPL References: Message-ID: Jie Zhang writes: > Any one knows what part of ffmpeg lib use > GPL instead of LGPL? Please see the LICENSE file in your checkout. Carl Eugen From cehoyos at ag.or.at Wed Jul 10 22:34:36 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Wed, 10 Jul 2013 20:34:36 +0000 (UTC) Subject: [Libav-user] Build of ffmpeg library with libx264 support for QNX References: Message-ID: Pavel Vazharov writes: > check_ld cc > check_cc > BEGIN /tmp/ffconf..localhost..22065188.c >??? 1??? int main(void){ return 0; } > END /tmp/ffconf..localhost..22065188.c > gcc -c -o /tmp/ffconf..localhost..22065188.c > gcc: no input files Please find the following line in the function "check_cc" in the file configure (around line 764): check_cmd $cc $CPPFLAGS $CFLAGS "$@" -c $(cc_o $TMPO) $TMPC Change it to the following and report back: check_cmd $cc $CPPFLAGS $CFLAGS "$@" -c -o $TMPO $TMPC ("-o $TMPO" instead of "$(cc_o $TMPO)") Thank you for the report! Please understand that without such reports, it is impossible to fix these bugs. Carl Eugen From cehoyos at ag.or.at Wed Jul 10 22:37:26 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Wed, 10 Jul 2013 20:37:26 +0000 (UTC) Subject: [Libav-user] Build of ffmpeg library with libx264 support for QNX References: Message-ID: Pavel Vazharov writes: > # uname -m > x86pc > # uname -s > QNX Both are supported, so it should not be necessary to set --arch or --target-os Carl Eugen From pvazharov at abaltatech.com Wed Jul 10 23:05:56 2013 From: pvazharov at abaltatech.com (Pavel Vazharov) Date: Wed, 10 Jul 2013 14:05:56 -0700 Subject: [Libav-user] Build of ffmpeg library with libx264 support for QNX In-Reply-To: References: Message-ID: Hi, I understand the situation. No problem. I changed the line as you suggested. Here is the console output. ============================================== # ./configure gcc is unable to create an executable file. If gcc is a cross-compiler, use the --enable-cross-compile option. Only do this if you know what cross compiling means. C compiler test failed. If you think configure made a mistake, make sure you are using the latest version from Git. If the latest version fails, report the problem to the ffmpeg-user at ffmpeg.org mailing list or IRC #ffmpeg on irc.freenode.net. Include the log file "config.log" produced by configure as this will help solving the problem. Here are the last lines from the config.log file ============================================== zmbv_decoder_select=zlib zmbv_encoder=yes zmbv_encoder_select=zlib zmq_filter=yes zmq_filter_deps=libzmq WARNING: pkg-config not found, library detection may fail. mktemp -u XXXXXX ./configure[2610]: mktemp: cannot execute - No such file or directory check_ld cc check_cc BEGIN /tmp/ffconf..localhost..516131.c 1 int main(void){ return 0; } END /tmp/ffconf..localhost..516131.c gcc -c -o /tmp/ffconf..localhost..516131.o /tmp/ffconf..localhost..516131.c gcc -o /tmp/ffconf..localhost..516131.o gcc: no input files C compiler test failed. I suppose that the problem is similar and it is in the function check_ld and the line 830 check_cmd $ld $LDFLAGS $flags $(ld_o $TMPE) $TMPO $libs $extralibs should become check_cmd $ld $LDFLAGS $flags -o $TMPE $TMPO $libs $extralibs. Should I change it or the problem is different? Thanks for the help. -------------- next part -------------- An HTML attachment was scrubbed... URL: From cehoyos at ag.or.at Wed Jul 10 23:12:17 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Wed, 10 Jul 2013 21:12:17 +0000 (UTC) Subject: [Libav-user] Build of ffmpeg library with libx264 support for QNX References: Message-ID: Pavel Vazharov writes: > check_cmd $ld $LDFLAGS $flags $(ld_o $TMPE) $TMPO $libs $extralibs > > should become > > check_cmd $ld $LDFLAGS $flags -o $TMPE $TMPO $libs $extralibs. You are correct, the same problem (but another commit). Carl Eugen From pvazharov at abaltatech.com Wed Jul 10 23:23:28 2013 From: pvazharov at abaltatech.com (Pavel Vazharov) Date: Wed, 10 Jul 2013 14:23:28 -0700 Subject: [Libav-user] Build of ffmpeg library with libx264 support for QNX In-Reply-To: References: Message-ID: Hi, The big problem. I made the change and run configure ================================= # ./configure Memory fault (core dumped) Last lines from the config log. ================================= BEGIN /tmp/ffconf..localhost..16134179.c 1 int x; END /tmp/ffconf..localhost..16134179.c gcc -D_ISOC99_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_QNX_SOURCE -std=c99 -fomit-frame-pointer -g -Wdeclaration-after-statement -Wall -Wno-parentheses -Wno-switch -Wno-format-zero-length -Wdisabled-optimization -Wpointer-arith -Wredundant-decls -Wno-pointer-sign -Wwrite-strings -Wtype-limits -Wundef -Wmissing-prototypes -Wno-pointer-to-int-cast -Wstrict-prototypes -O3 -fno-math-errno -fno-signed-zeros -fno-tree-vectorize -Werror=implicit-function-declaration -Werror=missing-prototypes -c -o /tmp/ffconf..localhost..16134179.o /tmp/ffconf..localhost..16134179.c check_cflags -Werror=return-type check_cc -Werror=return-type BEGIN /tmp/ffconf..localhost..16134179.c 1 int x; END /tmp/ffconf..localhost..16134179.c gcc -D_ISOC99_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_QNX_SOURCE -std=c99 -fomit-frame-pointer -g -Wdeclaration-after-statement -Wall -Wno-parentheses -Wno-switch -Wno-format-zero-length -Wdisabled-optimization -Wpointer-arith -Wredundant-decls -Wno-pointer-sign -Wwrite-strings -Wtype-limits -Wundef -Wmissing-prototypes -Wno-pointer-to-int-cast -Wstrict-prototypes -O3 -fno-math-errno -fno-signed-zeros -fno-tree-vectorize -Werror=implicit-function-declaration -Werror=missing-prototypes -Werror=return-type -c -o /tmp/ffconf..localhost..16134179.o /tmp/ffconf..localhost..16134179.c check_cflags -Werror=vla check_cc -Werror=vla BEGIN /tmp/ffconf..localhost..16134179.c 1 int x; END /tmp/ffconf..localhost..16134179.c gcc -D_ISOC99_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_QNX_SOURCE -std=c99 -fomit-frame-pointer -g -Wdeclaration-after-statement -Wall -Wno-parentheses -Wno-switch -Wno-format-zero-length -Wdisabled-optimization -Wpointer-arith -Wredundant-decls -Wno-pointer-sign -Wwrite-strings -Wtype-limits -Wundef -Wmissing-prototypes -Wno-pointer-to-int-cast -Wstrict-prototypes -O3 -fno-math-errno -fno-signed-zeros -fno-tree-vectorize -Werror=implicit-function-declaration -Werror=missing-prototypes -Werror=return-type -Werror=vla -c -o /tmp/ffconf..localhost..16134179.o /tmp/ffconf..localhost..16134179.c The info is probably not very helpful. I'm not sure. Please, tell me what other information could be useful in order to debug this issue. I could attach the whole config.log file. I could post the parameters of my QNX virtual machine. I could try to debug what is happening if you tell me how. Thanks for the help. -------------- next part -------------- An HTML attachment was scrubbed... URL: From cehoyos at ag.or.at Wed Jul 10 23:38:25 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Wed, 10 Jul 2013 21:38:25 +0000 (UTC) Subject: [Libav-user] Build of ffmpeg library with libx264 support for QNX References: Message-ID: Pavel Vazharov writes: > # ./configure > Memory fault (core dumped) Is this the whole output? Or are you possibly not waiting for the rest to come? [...] > -Werror=vla -c -o /tmp/ffconf..localhost..16134179.o > /tmp/ffconf..localhost..16134179.c The reason I ask is that my config.log also ends with the -Werror=vla test and this indicates that the script succeeded, the rest is visual output on the console. Carl Eugen From pvazharov at abaltatech.com Wed Jul 10 23:55:38 2013 From: pvazharov at abaltatech.com (Pavel Vazharov) Date: Wed, 10 Jul 2013 14:55:38 -0700 Subject: [Libav-user] Build of ffmpeg library with libx264 support for QNX In-Reply-To: References: Message-ID: Hi, I hope that this date time and tail information proves that I've waited enough for the configure to end. =============================================================================== # date ; ./configure Wed Jul 10 07:44:53 PDT 2013 Memory fault (core dumped) # date Wed Jul 10 07:47:43 PDT 2013 # tail config.log BEGIN /tmp/ffconf..localhost..44941347.c 1 int x; END /tmp/ffconf..localhost..44941347.c gcc -D_ISOC99_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_QNX_SOURCE -std=c99 -fomit-frame-pointer -g -Wdeclaration-after-statement -Wall -Wno-parentheses -Wno-switch -Wno-format-zero-length -Wdisabled-optimization -Wpointer-arith -Wredundant-decls -Wno-pointer-sign -Wwrit e-strings -Wtype-limits -Wundef -Wmissing-prototypes -Wno-pointer-to-int-cast -Wstrict-prototypes -O3 -fno-math-errno -fno-signed-zeros -fno- tree-vectorize -Werror=implicit-function-declaration -Werror=missing-prototypes -Werror=return-type -c -o /tmp/ffconf..localhost..44941347.o /tmp/ffconf..localhost..44941347.c check_cflags -Werror=vla check_cc -Werror=vla BEGIN /tmp/ffconf..localhost..44941347.c 1 int x; END /tmp/ffconf..localhost..44941347.c gcc -D_ISOC99_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_QNX_SOURCE -std=c99 -fomit-frame-pointer -g -Wdeclaration-after-statement -Wall -Wno-parentheses -Wno-switch -Wno-format-zero-length -Wdisabled-optimization -Wpointer-arith -Wredundant-decls -Wno-pointer-sign -Wwrit e-strings -Wtype-limits -Wundef -Wmissing-prototypes -Wno-pointer-to-int-cast -Wstrict-prototypes -O3 -fno-math-errno -fno-signed-zeros -fno- tree-vectorize -Werror=implicit-function-declaration -Werror=missing-prototypes -Werror=return-type -Werror=vla -c -o /tmp/ffconf..localhost. .44941347.o /tmp/ffconf..localhost..44941347.c # =============================================================================== As you could see I waited about 3 minutes and there was no other visual output on the screen and the config.log ending was the same. I could provide screen shots as a prove of my words, too. Regards. -------------- next part -------------- An HTML attachment was scrubbed... URL: From cehoyos at ag.or.at Thu Jul 11 00:28:27 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Wed, 10 Jul 2013 22:28:27 +0000 (UTC) Subject: [Libav-user] Build of ffmpeg library with libx264 support for QNX References: Message-ID: Pavel Vazharov writes: > As you could see I waited about 3 minutes and there > was no other visual output on the screen and the > config.log ending was the same. I could provide > screen shots as a prove of my words, too. That wasn't what I meant, sorry. (There just was no prompt in your original output.) >From your config.log output, we know that everything works fine until line 4462 ("fi" after "check_cflags -Werror=vla"), since you see no output, line 4520 is apparently never executed successfully. I suggest you add some 'echo "here123"' lines between these lines (before and after check_deps) to find the crashing command. Is oom possible? Carl Eugen From cehoyos at ag.or.at Thu Jul 11 08:53:48 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Thu, 11 Jul 2013 06:53:48 +0000 (UTC) Subject: [Libav-user] Build of ffmpeg library with libx264 support for QNX References: Message-ID: Pavel Vazharov writes: > # ./configure > Memory fault (core dumped) What does the following command show? # sh --version Carl Eugen From wenbin.ma at leediancn.com Thu Jul 11 09:20:16 2013 From: wenbin.ma at leediancn.com (Wenbin Ma) Date: Thu, 11 Jul 2013 15:20:16 +0800 Subject: [Libav-user] is possible to hack av_write_trailer to write moov atom at the beginning? Message-ID: <51DE5CB0.6090507@leediancn.com> Hi, I want to use ffmpeg library to encode a h264 mp4 for http progressive streaming. However ffmpeg added the moov atom at the end when calling api: av_write_trailer. My basic idea is override the API: av_write_trailer to write moove atom at the beginning. For example, I have a 5 second video, the frame rate is 25, I have these basic information of the encoded video here before I really add each frame to an AVStream. so is it possible write these information at the beginning? Can you give me some clue about how to write this function? BTW, even I build ffmpeg with --enable-debug=3, I still cannot debug into ffmpeg code in Qt Creator, how do you debug ffmpeg code? Thanks, Wenbin From andrey.krieger.utkin at gmail.com Thu Jul 11 09:26:14 2013 From: andrey.krieger.utkin at gmail.com (Andrey Utkin) Date: Thu, 11 Jul 2013 10:26:14 +0300 Subject: [Libav-user] is possible to hack av_write_trailer to write moov atom at the beginning? In-Reply-To: <51DE5CB0.6090507@leediancn.com> References: <51DE5CB0.6090507@leediancn.com> Message-ID: Maybe you want to use "quickstart" option of mp4 muxer. -- Andrey Utkin From er.anshul.maheshwari at gmail.com Thu Jul 11 09:39:37 2013 From: er.anshul.maheshwari at gmail.com (Anshul) Date: Thu, 11 Jul 2013 13:09:37 +0530 Subject: [Libav-user] is possible to hack av_write_trailer to write moov atom at the beginning? In-Reply-To: <51DE5CB0.6090507@leediancn.com> References: <51DE5CB0.6090507@leediancn.com> Message-ID: <51DE6139.2010006@gmail.com> On 07/11/2013 12:50 PM, Wenbin Ma wrote: > Hi, > > I want to use ffmpeg library to encode a h264 mp4 for http progressive > streaming. However ffmpeg added the moov atom at the end when calling > api: av_write_trailer. My basic idea is override the API: > av_write_trailer to write moove atom at the beginning. For example, I > have a 5 second video, the frame rate is 25, I have these basic > information of the encoded video here before I really add each frame > to an AVStream. so is it possible write these information at the > beginning? Can you give me some clue about how to write this function? > > BTW, even I build ffmpeg with --enable-debug=3, I still cannot debug > into ffmpeg code in Qt Creator, how do you debug ffmpeg code? > > Thanks, > Wenbin > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > hi please debug ffmpeg_g not ffmpeg thanks anshul From wenbin.ma at leediancn.com Thu Jul 11 09:53:52 2013 From: wenbin.ma at leediancn.com (Wenbin Ma) Date: Thu, 11 Jul 2013 15:53:52 +0800 Subject: [Libav-user] is possible to hack av_write_trailer to write moov atom at the beginning? In-Reply-To: <51DE6139.2010006@gmail.com> References: <51DE5CB0.6090507@leediancn.com> <51DE6139.2010006@gmail.com> Message-ID: <51DE6490.3090409@leediancn.com> Thanks for your reply. I'm build an application linked with libavcodec.so, libavformat.so, libswscale.so, libavutil.so. how to debug into the code of these shared objects? Thanks, Wenbin On 07/11/2013 03:39 PM, Anshul wrote: > On 07/11/2013 12:50 PM, Wenbin Ma wrote: >> Hi, >> >> I want to use ffmpeg library to encode a h264 mp4 for http >> progressive streaming. However ffmpeg added the moov atom at the end >> when calling api: av_write_trailer. My basic idea is override the >> API: av_write_trailer to write moove atom at the beginning. For >> example, I have a 5 second video, the frame rate is 25, I have these >> basic information of the encoded video here before I really add each >> frame to an AVStream. so is it possible write these information at >> the beginning? Can you give me some clue about how to write this >> function? >> >> BTW, even I build ffmpeg with --enable-debug=3, I still cannot debug >> into ffmpeg code in Qt Creator, how do you debug ffmpeg code? >> >> Thanks, >> Wenbin >> >> _______________________________________________ >> Libav-user mailing list >> Libav-user at ffmpeg.org >> http://ffmpeg.org/mailman/listinfo/libav-user >> > > hi > > please debug ffmpeg_g not ffmpeg > > thanks > anshul > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > > > From cehoyos at ag.or.at Thu Jul 11 12:29:09 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Thu, 11 Jul 2013 10:29:09 +0000 (UTC) Subject: [Libav-user] =?utf-8?q?is_possible_to_hack_av=5Fwrite=5Ftrailer_t?= =?utf-8?q?o_write_moov_atom_at_the_beginning=3F?= References: <51DE5CB0.6090507@leediancn.com> <51DE6139.2010006@gmail.com> <51DE6490.3090409@leediancn.com> Message-ID: Wenbin Ma writes: > I'm build an application linked with libavcodec.so, > libavformat.so, libswscale.so, libavutil.so. how > to debug into the code of these shared objects? configure with --disable-stripping Please do not top-post here, it is considered rude. Carl Eugen From pvazharov at abaltatech.com Thu Jul 11 17:47:19 2013 From: pvazharov at abaltatech.com (Pavel Vazharov) Date: Thu, 11 Jul 2013 08:47:19 -0700 Subject: [Libav-user] Build of ffmpeg library with libx264 support for QNX In-Reply-To: References: Message-ID: Hi, #sh --version sh: sh --: unknown option I think that the shell in QNX is in fact kshell because the /bin/sh file is a link to /bin/ksh and there is no bash on the system. #echo $BASH_VERSION #echo $KSH_VERSION @(#)PD KSH v5.2.14 99/07/13.2 I hope I'll find a little time today to do the debugging with echo in the configure script. Please, let me know if you need some other info in the mean time. Regards. -------------- next part -------------- An HTML attachment was scrubbed... URL: From cehoyos at ag.or.at Thu Jul 11 17:58:38 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Thu, 11 Jul 2013 15:58:38 +0000 (UTC) Subject: [Libav-user] Build of ffmpeg library with libx264 support for QNX References: Message-ID: Pavel Vazharov writes: > #sh --version > sh: sh --: unknown option > I think that the shell in QNX is in fact kshell > because the /bin/sh file is a link to /bin/ksh > and there is no bash on the system. > > #echo $BASH_VERSION > > #echo $KSH_VERSION > @(#)PD KSH v5.2.14 99/07/13.2 (prehistoric?) configure works fine on ksh (thanks to you, I found out that it is actually twice as fast as bash), I see the following here: $ echo $KSH_VERSION Version JM 93u+ 2012-02-29 $ ksh --version version sh (AT&T Research) 93u+ 2012-02-29 Google claims that there is a binary distribution of bash for qnx, perhaps you can test it. (The first problem apparently is related to a broken shell.) Carl Eugen From pvazharov at abaltatech.com Thu Jul 11 18:05:30 2013 From: pvazharov at abaltatech.com (Pavel Vazharov) Date: Thu, 11 Jul 2013 09:05:30 -0700 Subject: [Libav-user] Build of ffmpeg library with libx264 support for QNX In-Reply-To: References: Message-ID: Hi, I did the debug with the echo commands but the results are probably not so important because, as you said, the problem is very likely to be a broken shell. I'll try to update it or to install bash. Thanks. On Thu, Jul 11, 2013 at 8:58 AM, Carl Eugen Hoyos wrote: > Pavel Vazharov writes: > > > #sh --version > > sh: sh --: unknown option > > I think that the shell in QNX is in fact kshell > > because the /bin/sh file is a link to /bin/ksh > > and there is no bash on the system. > > > > #echo $BASH_VERSION > > > > #echo $KSH_VERSION > > @(#)PD KSH v5.2.14 99/07/13.2 > > (prehistoric?) > > configure works fine on ksh (thanks to you, > I found out that it is actually twice as > fast as bash), I see the following here: > $ echo $KSH_VERSION > Version JM 93u+ 2012-02-29 > $ ksh --version > version sh (AT&T Research) 93u+ 2012-02-29 > > Google claims that there is a binary distribution > of bash for qnx, perhaps you can test it. > (The first problem apparently is related to a > broken shell.) > > 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 pvazharov at abaltatech.com Thu Jul 11 22:00:13 2013 From: pvazharov at abaltatech.com (Pavel Vazharov) Date: Thu, 11 Jul 2013 13:00:13 -0700 Subject: [Libav-user] Build of ffmpeg library with libx264 support for QNX In-Reply-To: References: Message-ID: Hi, You were right. Thanks very much. I managed to install a bash and then the "./configure" ran fine. However, the "make all" command gave this error. (Here are the last lines from the console output). CC libavutil/timecode.o CC libavutil/tree.o CC libavutil/utils.o CC libavutil/x86/cpu.o YASM libavutil/x86/cpuid.o YASM libavutil/x86/emms.o YASM libavutil/x86/float_dsp.o CC libavutil/x86/float_dsp_init.o YASM libavutil/x86/lls.o CC libavutil/x86/lls_init.o CC libavutil/xga_font_data.o CC libavutil/xtea.o AR libavutil/libavutil.a CC ffmpeg.o ffmpeg.c: In function 'write_frame': ffmpeg.c:576: warning: 'destruct' is deprecated (declared at ./libavcodec/avcodec.h:1095) CC ffmpeg_opt.o ffmpeg_opt.c: In function 'init_output_filter': ffmpeg_opt.c:1520: warning: 'ost' may be used uninitialized in this function ffmpeg_opt.c: In function 'open_output_file': ffmpeg_opt.c:1953: warning: 'm' may be used uninitialized in this function CC ffmpeg_filter.o CC cmdutils.o cmdutils.c:51:21: error: version.h: No such file or directory cmdutils.c: In function 'print_program_info': cmdutils.c:1058: error: expected ')' before 'FFMPEG_VERSION' cmdutils.c:1058: warning: too few arguments for format make: *** [cmdutils.o] Error 1 This error is probably related to the programs build? I don't need the programs to be build so I could disable them? Or we could investigate the issue in the sake of the full QNX build? Regards. -------------- next part -------------- An HTML attachment was scrubbed... URL: From cehoyos at ag.or.at Thu Jul 11 22:51:41 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Thu, 11 Jul 2013 20:51:41 +0000 (UTC) Subject: [Libav-user] Build of ffmpeg library with libx264 support for QNX References: Message-ID: Pavel Vazharov writes: > I managed to install a bash and then the > "./configure" ran fine. Thank you for testing! > CC????? cmdutils.o > cmdutils.c:51:21: error: version.h: No such file or directory What does "make V=1 version.h" show? I suspect you copied the git checkout together with the .git information, this is probably not a good idea (there should be an option to checkout only the source files). Carl Eugen From pvazharov at abaltatech.com Thu Jul 11 23:44:25 2013 From: pvazharov at abaltatech.com (Pavel Vazharov) Date: Thu, 11 Jul 2013 14:44:25 -0700 Subject: [Libav-user] Build of ffmpeg library with libx264 support for QNX In-Reply-To: References: Message-ID: Hi, This time I forgot to save the exact information, but still. make V=1 version.h gave an error that version.sh has no permissions to be executed. I changed the permissions of version.sh and then the above command ran fine. I started the whole build again and it gave the following error later in the build, on a different place: CC ffserver.o ffserver.c: In function 'main': ffserver.c:4728: error: 'SA_RESTART' undeclared (first use in this function) ffserver.c:4728: error: (Each undeclared identifier is reported only once ffserver.c:4728: error: for each function it appears in.) make: *** [ffserver.o] Error 1 I removed the .git folder after I copied the folder to QNX. Regards. -------------- next part -------------- An HTML attachment was scrubbed... URL: From cehoyos at ag.or.at Fri Jul 12 00:28:12 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Thu, 11 Jul 2013 22:28:12 +0000 (UTC) Subject: [Libav-user] Build of ffmpeg library with libx264 support for QNX References: Message-ID: Pavel Vazharov writes: > CC????? ffserver.o > ffserver.c: In function 'main': > ffserver.c:4728: error: 'SA_RESTART' undeclared /usr/include/signal.h includes /usr/include/bits/sigaction.h here which defines SA_RESTART. Is SA_RESTART defined somewhere in /usr/include/* ? (You can of course use --disable-ffserver or --disable-programs, SA_RESTART is used for over ten years in ffserver.c) Consider running fate if you have enough time, Carl Eugen From cehoyos at ag.or.at Fri Jul 12 00:33:39 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Thu, 11 Jul 2013 22:33:39 +0000 (UTC) Subject: [Libav-user] Build of ffmpeg library with libx264 support for QNX References: Message-ID: Carl Eugen Hoyos writes: > Is SA_RESTART defined somewhere in /usr/include/* ? It appears the definition was removed from qnx because it is not implemented. You will have to add --disable-ffserver until a configure check exists. Carl Eugen From cehoyos at ag.or.at Thu Jul 11 20:34:32 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Thu, 11 Jul 2013 20:34:32 +0200 Subject: [Libav-user] HW decoding on Android Message-ID: <201307112034.32601.cehoyos@ag.or.at> On Monday 08 July 2013 11:13:09 am Abel Alonso wrote: > > Iirc, you were able to work-around that problem: > > Does libstagefright decoding with ffmpeg work now or not? > > I've just tested it and it doesn't work. It continues crashing. I think > that is related with the format issue I've commented before. Could you test attached patch? I can't even test compilation here. Thank you, Carl Eugen -------------- next part -------------- diff --git a/libavcodec/libstagefright.cpp b/libavcodec/libstagefright.cpp index bb49d8a..63f7aef 100644 --- a/libavcodec/libstagefright.cpp +++ b/libavcodec/libstagefright.cpp @@ -330,7 +330,12 @@ static av_cold int Stagefright_init(AVCodecContext *avctx) avctx->pix_fmt = AV_PIX_FMT_YUYV422; else if (colorFormat == OMX_COLOR_FormatCbYCrY) avctx->pix_fmt = AV_PIX_FMT_UYVY422; - else + else if (colorFormat == QOMX_COLOR_FormatYUV420PackedSemiPlanar64x32Tile2m8ka) { + av_log(avctx, AV_LOG_ERROR, "YUV420PackedSemiPlanar64x32Tile2m8ka not supported\n"); + ret = AVERROR_PATCHWELCOME; + s->client->disconnect(); + goto fail; + } else avctx->pix_fmt = AV_PIX_FMT_YUV420P; outFormat->findCString(kKeyDecoderComponent, &s->decoder_component); From pvazharov at abaltatech.com Fri Jul 12 18:14:00 2013 From: pvazharov at abaltatech.com (Pavel Vazharov) Date: Fri, 12 Jul 2013 09:14:00 -0700 Subject: [Libav-user] Build of ffmpeg library with libx264 support for QNX In-Reply-To: References: Message-ID: Hi, Everything builds fine with --disable-ffserver switch. Thanks again. -------------- next part -------------- An HTML attachment was scrubbed... URL: From cehoyos at ag.or.at Fri Jul 12 18:30:59 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Fri, 12 Jul 2013 16:30:59 +0000 (UTC) Subject: [Libav-user] Build of ffmpeg library with libx264 support for QNX References: Message-ID: Pavel Vazharov writes: > Everything builds fine with --disable-ffserver switch. Consider running fate now, you need rsync installed, then run: $ make SAMPLES=fate-suite fate-rsync $ make SAMPLES=fate-suite fate Or, if you don't feel like downloading the samples: $ make fate Carl Eugen From john.orr at scala.com Fri Jul 12 19:30:49 2013 From: john.orr at scala.com (John Orr) Date: Fri, 12 Jul 2013 13:30:49 -0400 Subject: [Libav-user] ffmpeg 2.0 aacdec.c depends on ape? Message-ID: <51E03D49.3000309@scala.com> The ffmpeg 2.0 version of libavformat\aacdec.c now contains some reference to APE. In includes apetag.h and calls ff_ape_parse_tag(). It did not do that in ffmpeg 1.2. When I tried to upgrade from 1.2 to 2.0, I found I had a link failure. When I compile ffmpeg for my own purposes, I usally disable most demuxers and decoders. In particular, I disable APE, but enable AAC. With FFMPEG 1.2, that worked fine. With FFMPEG 2.0, ffmpeg fails to link unless I enable the APE demuxer. For the time being I can use --enable-demuxer=ape when I configure. I wasn't sure if this was intentional and now aacdec formally depends on APE, or if it was an oversite. --Johno From onemda at gmail.com Fri Jul 12 20:20:45 2013 From: onemda at gmail.com (Paul B Mahol) Date: Fri, 12 Jul 2013 18:20:45 +0000 Subject: [Libav-user] ffmpeg 2.0 aacdec.c depends on ape? In-Reply-To: <51E03D49.3000309@scala.com> References: <51E03D49.3000309@scala.com> Message-ID: On 7/12/13, John Orr wrote: > The ffmpeg 2.0 version of libavformat\aacdec.c now contains some > reference to APE. In includes apetag.h and calls ff_ape_parse_tag(). > It did not do that in ffmpeg 1.2. > > When I tried to upgrade from 1.2 to 2.0, I found I had a link failure. > When I compile ffmpeg for my own purposes, I usally disable most > demuxers and decoders. In particular, I disable APE, but enable AAC. > With FFMPEG 1.2, that worked fine. With FFMPEG 2.0, ffmpeg fails to > link unless I enable the APE demuxer. Proof or it did not happen. > > For the time being I can use --enable-demuxer=ape when I configure. > > I wasn't sure if this was intentional and now aacdec formally depends on > APE, or if it was an oversite. aacdec demuxer does not depend on ape demuxer. > > --Johno > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > From cehoyos at ag.or.at Fri Jul 12 20:44:24 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Fri, 12 Jul 2013 18:44:24 +0000 (UTC) Subject: [Libav-user] ffmpeg 2.0 aacdec.c depends on ape? References: <51E03D49.3000309@scala.com> Message-ID: John Orr writes: > The ffmpeg 2.0 version of libavformat\aacdec.c now > contains some reference to APE. In includes apetag.h > and calls ff_ape_parse_tag(). > It did not do that in ffmpeg 1.2. Yes, we do try to improve FFmpeg between releases;-)) > When I tried to upgrade from 1.2 to 2.0, I found I > had a link failure. > When I compile ffmpeg for my own purposes, I usally > disable most demuxers and decoders. Please at least provide your configure line. Additionally, run make ffmpeg several times and provide the complete, uncut console output of the last call. Unrelated: Your description sounds as if you are not a distributor, if you are not a distributor, please do not use a release, but try a current version from git. Carl Eugen From john.orr at scala.com Fri Jul 12 21:19:18 2013 From: john.orr at scala.com (John Orr) Date: Fri, 12 Jul 2013 15:19:18 -0400 Subject: [Libav-user] ffmpeg 2.0 aacdec.c depends on ape? In-Reply-To: References: <51E03D49.3000309@scala.com> Message-ID: <51E056B6.7000400@scala.com> On 7/12/2013 2:44 PM, Carl Eugen Hoyos wrote: > Please at least provide your configure line. OK, but it's large: --cpu=i686 --enable-shared --disable-iconv --disable-zlib --disable-bzlib --disable-swscale --disable-avfilter --disable-everything --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-programs --disable-avdevice --disable-swresample --disable-postproc --build-suffix=mm --enable-dxva2 --enable-hwaccel=mpeg2_dxva2 --enable-hwaccel=h264_dxva2 --enable-hwaccel=vc1_dxva2 --enable-hwaccel=wmv3_dxva2 --enable-protocol=file --enable-decoder=dvvideo --enable-decoder=h261 --enable-decoder=h264 --enable-decoder=mjpeg --enable-decoder=mjpegb --enable-decoder=mpeg1video --enable-decoder=mpeg2video --enable-decoder=mpegvideo --enable-decoder=vc1 --enable-decoder=wmv1 --enable-decoder=wmv2 --enable-decoder=wmv3 --enable-decoder=aac --enable-decoder=aac_latm --enable-decoder=mp1 --enable-decoder=mp1float --enable-decoder=mp2 --enable-decoder=mp2float --enable-decoder=mp3 --enable-decoder=mp3float --enable-decoder=mp3adu --enable-decoder=mp3adufloat --enable-decoder=mp3on4 --enable-decoder=mp3on4float --enable-decoder=wmalossless --enable-decoder=wmapro --enable-decoder=wmav1 --enable-decoder=wmav2 --enable-decoder=wmavoice --enable-decoder=pcm_alaw --enable-decoder=pcm_bluray --enable-decoder=pcm_dvd --enable-decoder=pcm_f32be --enable-decoder=pcm_f32le --enable-decoder=pcm_f64be --enable-decoder=pcm_f64le --enable-decoder=pcm_lxf --enable-decoder=pcm_mulaw --enable-decoder=pcm_s8 --enable-decoder=pcm_s8_planar --enable-decoder=pcm_s16be --enable-decoder=pcm_s16le --enable-decoder=pcm_s16le_planar --enable-decoder=pcm_s24be --enable-decoder=pcm_s24daud --enable-decoder=pcm_s24le --enable-decoder=pcm_s32be --enable-decoder=pcm_s32le --enable-decoder=pcm_u8 --enable-decoder=pcm_u16be --enable-decoder=pcm_u16le --enable-decoder=pcm_u24be --enable-decoder=pcm_u24le --enable-decoder=pcm_u32be --enable-decoder=pcm_u32le --enable-decoder=adpcm_g722 --enable-decoder=adpcm_g726 --enable-decoder=adpcm_ima_amv --enable-decoder=adpcm_ima_apc --enable-decoder=adpcm_ima_dk3 --enable-decoder=adpcm_ima_dk4 --enable-decoder=adpcm_ima_iss --enable-decoder=adpcm_ima_qt --enable-decoder=adpcm_ima_smjpeg --enable-decoder=adpcm_ima_wav --enable-decoder=adpcm_ima_ws --enable-decoder=adpcm_ms --enable-parser=aac --enable-parser=aac_latm --enable-parser=dvbsub --enable-parser=dvdsub --enable-parser=h261 --enable-parser=h264 --enable-parser=mjpeg --enable-parser=mpeg4video --enable-parser=mpegaudio --enable-parser=mpegvideo --enable-parser=vc1 --enable-demuxer=mp3 --enable-demuxer=aac --enable-demuxer=asf --enable-demuxer=avi --enable-demuxer=dv --enable-demuxer=g722 --enable-demuxer=h261 --enable-demuxer=h264 --enable-demuxer=m4v --enable-demuxer=mjpeg --enable-demuxer=mov --enable-demuxer=mpegps --enable-demuxer=mpegts --enable-demuxer=mpegtsraw --enable-demuxer=mpegvideo --enable-demuxer=pcm_alaw --enable-demuxer=pcm_mulaw --enable-demuxer=pcm_f64be --enable-demuxer=pcm_f64le --enable-demuxer=pcm_f32be --enable-demuxer=pcm_f32le --enable-demuxer=pcm_s32be --enable-demuxer=pcm_s32le --enable-demuxer=pcm_s24be --enable-demuxer=pcm_s24le --enable-demuxer=pcm_s16be --enable-demuxer=pcm_s16le --enable-demuxer=pcm_s8 --enable-demuxer=pcm_u32be --enable-demuxer=pcm_u32le --enable-demuxer=pcm_u24be --enable-demuxer=pcm_u24le --enable-demuxer=pcm_u16be --enable-demuxer=pcm_u16le --enable-demuxer=pcm_u8 --enable-demuxer=vc1 --enable-demuxer=vc1t --enable-demuxer=wav --enable-demuxer=xwma > Additionally, run make ffmpeg several times > and provide the complete, uncut console output > of the last call. $ make LD libavformat/avformatmm-55.dll Creating library file: libavformat/libavformatmm.dll.a libavformat/apetag.o: In function `ape_tag_read_field': h:\src\ffmpeg2_0/libavformat/apetag.c:73: undefined reference to `_ff_guess_imag e2_codec' collect2.exe: error: ld returned 1 exit status make: *** [libavformat/avformatmm-55.dll] Error 1 --Johno From cehoyos at ag.or.at Fri Jul 12 21:31:38 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Fri, 12 Jul 2013 19:31:38 +0000 (UTC) Subject: [Libav-user] ffmpeg 2.0 aacdec.c depends on ape? References: <51E03D49.3000309@scala.com> <51E056B6.7000400@scala.com> Message-ID: John Orr writes: > LD libavformat/avformatmm-55.dll > Creating library file: libavformat/libavformatmm.dll.a > libavformat/apetag.o: In function `ape_tag_read_field': > h:\src\ffmpeg2_0/libavformat/apetag.c:73: undefined reference to > `_ff_guess_image2_codec' Should be fixed, thank you for the report! You can use things like the following in configure: ./configure --disable-decoders --enable-decoder=pcm*,h261 And note that --disable-everything disables most (all) of the things that you disable explicitely. Carl Eugen From john.orr at scala.com Fri Jul 12 21:58:59 2013 From: john.orr at scala.com (John Orr) Date: Fri, 12 Jul 2013 15:58:59 -0400 Subject: [Libav-user] ffmpeg 2.0 aacdec.c depends on ape? In-Reply-To: References: <51E03D49.3000309@scala.com> <51E056B6.7000400@scala.com> Message-ID: <51E06003.4020701@scala.com> On 7/12/2013 3:31 PM, Carl Eugen Hoyos wrote: > John Orr writes: > >> LD libavformat/avformatmm-55.dll >> Creating library file: libavformat/libavformatmm.dll.a >> libavformat/apetag.o: In function `ape_tag_read_field': >> h:\src\ffmpeg2_0/libavformat/apetag.c:73: undefined reference to >> `_ff_guess_image2_codec' > Should be fixed, thank you for the report! > > You can use things like the following in configure: > ./configure --disable-decoders --enable-decoder=pcm*,h261 Ah, cool, that's a lot easier to read, thanks! > > And note that --disable-everything disables most (all) > of the things that you disable explicitely. At one point I had trouble with some component being enabled that I didn't expect and I went overkill and added those extra disable directives. I haven't tried to tweak my "known good" config line because its not pain free. I'm using mingw and visual studio (which uses the c99to89 conversion tool), so it takes like 30 minutes to configure, compile. and link (that's with an SSD). --Johno From cehoyos at ag.or.at Fri Jul 12 22:03:40 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Fri, 12 Jul 2013 20:03:40 +0000 (UTC) Subject: [Libav-user] ffmpeg 2.0 aacdec.c depends on ape? References: <51E03D49.3000309@scala.com> <51E056B6.7000400@scala.com> <51E06003.4020701@scala.com> Message-ID: John Orr writes: > > And note that --disable-everything disables most (all) > > of the things that you disable explicitely. > > At one point I had trouble with some component being > enabled that I didn't expect and I went overkill and > added those extra disable directives. I suspect that you actually want to use --disable-all. --disable-everything - contrary to its name - only disables some components, it is mostly useful for regression tests and if you want small programs (as opposed to small libraries that you want). Carl Eugen From night.rain.whisper at gmail.com Sat Jul 13 11:30:46 2013 From: night.rain.whisper at gmail.com (Sergey Fedorov) Date: Sat, 13 Jul 2013 13:30:46 +0400 Subject: [Libav-user] Decoding single NALUs from x264 programmatically (no luck even with parser), works fine with concatenated NALUs In-Reply-To: References: Message-ID: You should split the stream to NAL units anyway before passing to decoder. That's what I know about it ) 2013/7/8 Faraz Khan > Sergey, > Just tried - setting decoderContext->flags2 to CODEC_FLAG2_CHUNKS also > doesnt work (with or without parser!) Is there something special that needs > to be done? > > Decoder keeps saying: > > *Screenhero[45392:13803] Current profile doesn't provide more RBSP data > in PPS, skipping* > > *2013-07-07 13:47:38.105 Screenhero[45392:13803] Frame size received is > 8476* > > *2013-07-07 13:47:38.107 Screenhero[45392:13803] out of range intra > chroma pred mode at 67358720 -1583242847* > > *2013-07-07 13:47:38.107 Screenhero[45392:13803] error while decoding MB > 67358720 -1583242847* > > *2013-07-07 13:47:38.108 Screenhero[45392:13803] out of range intra > chroma pred mode at 67358720 -1583242847* > > *2013-07-07 13:47:38.108 Screenhero[45392:13803] error while decoding MB > 67358720 -1583242847* > > *2013-07-07 13:47:38.119 Screenhero[45392:13803] Frame size received is > 6464* > > *2013-07-07 13:47:38.120 Screenhero[45392:13803] Frame size received is > 1287* > > *2013-07-07 13:47:38.126 Screenhero[45392:13803] Frame size received is > 9938* > > *2013-07-07 13:47:38.127 Screenhero[45392:13803] cbp too large (67358720) > at -1583242847 67358792* > > *2013-07-07 13:47:38.127 Screenhero[45392:13803] error while decoding MB > 67358720 -1583242847* > > *2013-07-07 13:47:38.127 Screenhero[45392:13803] negative number of zero > coeffs at 67358720 -1583242847* > > *2013-07-07 13:47:38.128 Screenhero[45392:13803] error while decoding MB > 67358720 -1583242847* > > *2013-07-07 13:47:38.134 Screenhero[45392:13803] Frame size received is > 2574* > > * > * > > *Thanks!* > > * > * > > > On Sun, Jul 7, 2013 at 1:15 PM, Faraz Khan wrote: > >> Sergey, >> I did not - is that supposed to do the trick? Would we need a parser in >> that scenario? >> >> >> >> On Sun, Jul 7, 2013 at 12:13 AM, Sergey Fedorov < >> night.rain.whisper at gmail.com> wrote: >> >>> Did you try using CODEC_FLAG2_CHUNKS? >>> >>> >>> 2013/7/6 Attila Sukosd >>> >>>> Hi guys, >>>> >>>> There was this thread about decoding NALUs one-by-one with >>>> parser2/decode2 and I'm having exactly the same issue. >>>> >>>> I have x264 creating a bunch of NALUs, in annex_b and repeate_headers, >>>> and trying to decode them one by one on the client side. When I concatenate >>>> all the NALUs per frame into one large packet, and feed that directly into >>>> avcodec_decode_video2, everything is fine, the decode is successful. >>>> However, when I try to feed single NALs directly to >>>> avcodec_decode_video2, it spits out a bunch of errors. After searching for >>>> a while on the net, I read some place that certain types of NALs affect the >>>> rest of the data stream, and they need to be group together. >>>> I've tried to run the NALs through av_parser_parse2 and tried to decode >>>> the output buffer when the output size was larger than zero, however, after >>>> looking at the output buffer contents, it seems like while the output size >>>> seems reasonable (around the size of the NALs or a combination of a number >>>> of previous NALs), the output buffer content contains 3-4 bytes, and the >>>> rest is zero. >>>> >>>> The decoding looks like this: >>>> >>>> ret = av_parser_parse2(decoder->pParserCtx, decoder->pCodecCtx, >>>> decoder->tmp_data, &outsize, buff, size, 0, 0, AV_NOPTS_VALUE); >>>> printf("%p buff, %p outdata, consumed %d, %d bufsize, %d outsize\n", >>>> buff, decoder->tmp_data,ret, size, outsize); >>>> disp_buff(decoder->tmp_data, 50); >>>> >>>> if (outsize <= 0) return 0; >>>> >>>> decoder->avpkt.flags = AV_PKT_FLAG_KEY; >>>> decoder->avpkt.data = decoder->tmp_data; >>>> decoder->avpkt.size = outsize; >>>> >>>> got_picture = 0; >>>> if ((ret = avcodec_decode_video2(decoder->pCodecCtx, decoder->pFrame, >>>> &got_picture, &decoder->avpkt)) < 0) { >>>> LOGE(__FUNCTION__, "H264 decoding failed!\n"); >>>> return -1; >>>> } >>>> >>>> >>>> Could someone shed some light on if I'm really off the right track? or >>>> am I just missing something very trivial? >>>> >>>> >>>> Best Regards, >>>> >>>> Attila >>>> >>>> _______________________________________________ >>>> Libav-user mailing list >>>> Libav-user at ffmpeg.org >>>> http://ffmpeg.org/mailman/listinfo/libav-user >>>> >>>> >>> >>> _______________________________________________ >>> Libav-user mailing list >>> Libav-user at ffmpeg.org >>> http://ffmpeg.org/mailman/listinfo/libav-user >>> >>> >> >> >> -- >> >> -- >> Faraz Khan >> Simple Collaboration Screensharing >> www.screenhero.com >> > > > > -- > > -- > Faraz Khan > Simple Collaboration Screensharing > www.screenhero.com > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From cehoyos at ag.or.at Sat Jul 13 18:15:57 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Sat, 13 Jul 2013 16:15:57 +0000 (UTC) Subject: [Libav-user] Build of ffmpeg library with libx264 support for QNX References: Message-ID: Pavel Vazharov writes: > I started the whole build again and it gave the > following error later in the build, on a different place: > CC????? ffserver.o > ffserver.c: In function 'main': > ffserver.c:4728: error: 'SA_RESTART' undeclared > (first use in this function) This is now fixed in git head, thank you for testing! Carl Eugen From faraz at screenhero.com Sat Jul 13 21:54:08 2013 From: faraz at screenhero.com (Faraz Khan) Date: Sat, 13 Jul 2013 12:54:08 -0700 Subject: [Libav-user] Decoding single NALUs from x264 programmatically (no luck even with parser), works fine with concatenated NALUs In-Reply-To: References: Message-ID: Sergey, Passing individual nal units to the decoder does not work (produces errors I provided you with). Setting CODEC_FLAG2_CHUNKS changes the errors. This is the same with or without the parser. Maybe that behavior has changed. If anyone has information regarding this it'll be awesome! Btw- if you assemble the frame yourself you can feed it into the decoder without the parser and its completely happy. This is the way we are currently doing it. On Sat, Jul 13, 2013 at 2:30 AM, Sergey Fedorov < night.rain.whisper at gmail.com> wrote: > You should split the stream to NAL units anyway before passing to decoder. > That's what I know about it ) > > > 2013/7/8 Faraz Khan > >> Sergey, >> Just tried - setting decoderContext->flags2 to CODEC_FLAG2_CHUNKS also >> doesnt work (with or without parser!) Is there something special that needs >> to be done? >> >> Decoder keeps saying: >> >> *Screenhero[45392:13803] Current profile doesn't provide more RBSP data >> in PPS, skipping* >> >> *2013-07-07 13:47:38.105 Screenhero[45392:13803] Frame size received is >> 8476* >> >> *2013-07-07 13:47:38.107 Screenhero[45392:13803] out of range intra >> chroma pred mode at 67358720 -1583242847* >> >> *2013-07-07 13:47:38.107 Screenhero[45392:13803] error while decoding MB >> 67358720 -1583242847* >> >> *2013-07-07 13:47:38.108 Screenhero[45392:13803] out of range intra >> chroma pred mode at 67358720 -1583242847* >> >> *2013-07-07 13:47:38.108 Screenhero[45392:13803] error while decoding MB >> 67358720 -1583242847* >> >> *2013-07-07 13:47:38.119 Screenhero[45392:13803] Frame size received is >> 6464* >> >> *2013-07-07 13:47:38.120 Screenhero[45392:13803] Frame size received is >> 1287* >> >> *2013-07-07 13:47:38.126 Screenhero[45392:13803] Frame size received is >> 9938* >> >> *2013-07-07 13:47:38.127 Screenhero[45392:13803] cbp too large >> (67358720) at -1583242847 67358792* >> >> *2013-07-07 13:47:38.127 Screenhero[45392:13803] error while decoding MB >> 67358720 -1583242847* >> >> *2013-07-07 13:47:38.127 Screenhero[45392:13803] negative number of zero >> coeffs at 67358720 -1583242847* >> >> *2013-07-07 13:47:38.128 Screenhero[45392:13803] error while decoding MB >> 67358720 -1583242847* >> >> *2013-07-07 13:47:38.134 Screenhero[45392:13803] Frame size received is >> 2574* >> >> * >> * >> >> *Thanks!* >> >> * >> * >> >> >> On Sun, Jul 7, 2013 at 1:15 PM, Faraz Khan wrote: >> >>> Sergey, >>> I did not - is that supposed to do the trick? Would we need a parser in >>> that scenario? >>> >>> >>> >>> On Sun, Jul 7, 2013 at 12:13 AM, Sergey Fedorov < >>> night.rain.whisper at gmail.com> wrote: >>> >>>> Did you try using CODEC_FLAG2_CHUNKS? >>>> >>>> >>>> 2013/7/6 Attila Sukosd >>>> >>>>> Hi guys, >>>>> >>>>> There was this thread about decoding NALUs one-by-one with >>>>> parser2/decode2 and I'm having exactly the same issue. >>>>> >>>>> I have x264 creating a bunch of NALUs, in annex_b and repeate_headers, >>>>> and trying to decode them one by one on the client side. When I concatenate >>>>> all the NALUs per frame into one large packet, and feed that directly into >>>>> avcodec_decode_video2, everything is fine, the decode is successful. >>>>> However, when I try to feed single NALs directly to >>>>> avcodec_decode_video2, it spits out a bunch of errors. After searching for >>>>> a while on the net, I read some place that certain types of NALs affect the >>>>> rest of the data stream, and they need to be group together. >>>>> I've tried to run the NALs through av_parser_parse2 and tried to >>>>> decode the output buffer when the output size was larger than zero, >>>>> however, after looking at the output buffer contents, it seems like while >>>>> the output size seems reasonable (around the size of the NALs or a >>>>> combination of a number of previous NALs), the output buffer content >>>>> contains 3-4 bytes, and the rest is zero. >>>>> >>>>> The decoding looks like this: >>>>> >>>>> ret = av_parser_parse2(decoder->pParserCtx, decoder->pCodecCtx, >>>>> decoder->tmp_data, &outsize, buff, size, 0, 0, AV_NOPTS_VALUE); >>>>> printf("%p buff, %p outdata, consumed %d, %d bufsize, %d outsize\n", >>>>> buff, decoder->tmp_data,ret, size, outsize); >>>>> disp_buff(decoder->tmp_data, 50); >>>>> >>>>> if (outsize <= 0) return 0; >>>>> >>>>> decoder->avpkt.flags = AV_PKT_FLAG_KEY; >>>>> decoder->avpkt.data = decoder->tmp_data; >>>>> decoder->avpkt.size = outsize; >>>>> >>>>> got_picture = 0; >>>>> if ((ret = avcodec_decode_video2(decoder->pCodecCtx, >>>>> decoder->pFrame, &got_picture, &decoder->avpkt)) < 0) { >>>>> LOGE(__FUNCTION__, "H264 decoding failed!\n"); >>>>> return -1; >>>>> } >>>>> >>>>> >>>>> Could someone shed some light on if I'm really off the right track? or >>>>> am I just missing something very trivial? >>>>> >>>>> >>>>> Best Regards, >>>>> >>>>> Attila >>>>> >>>>> _______________________________________________ >>>>> Libav-user mailing list >>>>> Libav-user at ffmpeg.org >>>>> http://ffmpeg.org/mailman/listinfo/libav-user >>>>> >>>>> >>>> >>>> _______________________________________________ >>>> Libav-user mailing list >>>> Libav-user at ffmpeg.org >>>> http://ffmpeg.org/mailman/listinfo/libav-user >>>> >>>> >>> >>> >>> -- >>> >>> -- >>> Faraz Khan >>> Simple Collaboration Screensharing >>> www.screenhero.com >>> >> >> >> >> -- >> >> -- >> Faraz Khan >> Simple Collaboration Screensharing >> www.screenhero.com >> >> _______________________________________________ >> Libav-user mailing list >> Libav-user at ffmpeg.org >> http://ffmpeg.org/mailman/listinfo/libav-user >> >> > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > > -- -- Faraz Khan Simple Collaboration Screensharing www.screenhero.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From tanjimhossainsifat at gmail.com Sun Jul 14 14:11:11 2013 From: tanjimhossainsifat at gmail.com (Tanjim Hossain Sifat) Date: Sun, 14 Jul 2013 18:11:11 +0600 Subject: [Libav-user] C code for capturing video from webcam using ffmpeg Message-ID: Hi to all. I am a new user of ffmpeg. I like to write C code that would capture video stream from webcam. Please, help me out. Thanks in advance. -- MD. Tanjim Hossain Sifat Bangladesh University of Engineering and Technology, Dhaka -------------- next part -------------- An HTML attachment was scrubbed... URL: From ggarra13 at gmail.com Sun Jul 14 21:33:48 2013 From: ggarra13 at gmail.com (Gonzalo Garramuno) Date: Sun, 14 Jul 2013 16:33:48 -0300 Subject: [Libav-user] Clarification on error message Message-ID: <51E2FD1C.9060000@gmail.com> I have an application that creates a movie file with sound. However, when the video is played in my application I get a bunch of errors like: [ffmpeg] freeing incomplete packet size 3224, new 9738 and the audio is wrong. I am wondering what does the above error mean. From soho123.2012 at gmail.com Mon Jul 15 15:15:57 2013 From: soho123.2012 at gmail.com (Soho Soho123) Date: Mon, 15 Jul 2013 21:15:57 +0800 Subject: [Libav-user] Help please !!!!! asf stream abort by ffserver Message-ID: hi all, When I try to do mux h264 video + pcm_s16le audio, ffserver abort since the error: Mon Jul 15 21:07:40 2013 Assertion asf->packet_timestamp_end >= asf->packet_timestamp_start failed at l ibavformat/asfenc.c:643 Does anyone have ideas? ========================================== ffserver.conf: Feed feed1.ffm Format asf AVOptionVideo flags +global_header VideoSize 640x480 VideoFrameRate 30 VideoCodec libx264 AVOptionAudio flags +global_header AudioCodec pcm_s16le AudioChannels 2 AudioSampleRate 44100 ffmpeg command : ffmpeg -f alsa -ar 44100 -ac 2 -i hw:0 -f video4linux2 -r 30 -s 640x480 -input_format h264 -i /dev/video1 -vcodec copy -acodec copy http://localhost:8090/feed1.ffm ======================================================================== when I try to play by ffplay, the log from ffplay : Input #0, asf, from 'mmsh://192.168.1.254:8090/test.asf':0B f=0/0 Metadata: encoder : Lavf55.12.100 Duration: N/A, start: 3827889.346000, bitrate: 1411 kb/s Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, 2 channels, s16, 1411 kb/s Stream #0:1: Video: h264 (Constrained Baseline) (H264 / 0x34363248), yuv420p , 640x480, 100 tbr, 1k tbn, 2k tbc Read data packet header failed!aq= 0KB vq= 21KB sq= 0B f=0/0 Recv other type packet -5 Read data packet header failed! Recv other type packet -5 Read data packet header failed! Recv other type packet -5 Read data packet header failed! Recv other type packet -5 Read data packet header failed! Recv other type packet -5 3827898.56 A-V: 0.068 fd= 44 aq= 0KB vq= 0KB sq= 0B f=0/0 Does any one have ides!! -------------- next part -------------- An HTML attachment was scrubbed... URL: From soho123.2012 at gmail.com Tue Jul 16 03:51:05 2013 From: soho123.2012 at gmail.com (Soho Soho123) Date: Tue, 16 Jul 2013 09:51:05 +0800 Subject: [Libav-user] HELP!HELP!Please!!!ffplay can not receive the rtp stream from udp socket Message-ID: Hi all, I got the big trouble about : ffplay can not play play h264 video + pcm_S16LE audio rtp stream. originally, ffplay can play video stream if no audio. after add audio part , then ffplay can not play. It seems ffplay is wait rtp data arrived, but ffserver is sending rtp data continuous to the udp port that rtsp negotiate Does anyone have ideas? the configuration of ffserver.conf: ============================== ======================== Port 8090 RTSPPort 5554 File /tmp/feed1.ffm FileMaxSize 5M ACL allow 127.0.0.1 Feed feed1.ffm Format rtp AVOptionVideo flags +global_header VideoSize 1280x720 VideoFrameRate 30 VideoCodec libx264 AVOptionAudio flags +global_header AudioCodec pcm_s16le AudioChannels 2 AudioSampleRate 48000 ====================================================== the detail log : ====================================================== ffserver version 1.2 Copyright (c) 2000-2013 the FFmpeg developers built on Jul 9 2013 15:51:03 with gcc 4.4.5-1.5.5p4 (GCC) configuration: --enable-cross-compile --cross-prefix=sdk-linux- --arch=mips --target-os=linux --disable -doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-mips32r2 --dis able-ffplay --disable-postproc --disable-runtime-cpudetect --disable-swscale-alpha --disable-mipsdspr1 --d isable-mipsdspr2 --disable-mipsfpu --enable-small --prefix=/ffmpeg/romfs --bindir=/ffmpeg/romfs --disable-bsfs --disable-filters --enable-gpl --enable-libx2 64 --extra-cflags=-I/ShareLib_Install/bin/../include --extra-libs='-L/ShareLib_Install/bin/../lib -lx264' --enable-filter='aformat,aresample,copy,format,fps ,framestep,resample' --disable-encoders --enable-encoder='mjpeg,h264, libavutil 52. 18.100 / 52. 18. 100 libavcodec 54. 92.100 / 54. 92.100 libavformat 54. 63.104 / 54. 63.104 libavdevice 54. 3.103 / 54. 3.103 libavfilter 3. 42.103 / 3. 42.103 libswscale 2. 2.100 / 2. 2.100 libswresample 0. 17.102 / 0. 17.102 Tue Jul 9 20:57:52 2013 FFserver started. ffmpeg version 1.2 Copyright (c) 2000-2013 the FFmpeg developers built on Jul 9 2013 15:51:03 with gcc 4.4.5-1.5.5p4 (GCC) configuration: --enable-cross-compile --cross-prefix=sdk-linux- --arch=mips --target-os=linux --disable -doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-mips32r2 --dis able-ffplay --disable-postproc --disable-runtime-cpudetect --disable-swscale-alpha --disable-mipsdspr1 --d isable-mipsdspr2 --disable-mipsfpu --enable-small --prefix=/ffmpeg/romfs --bindir=/ffmpeg/romfs --disable-bsfs --disable-filters --enable-gpl --enable-libx2 64 --extra-cflags=-I/ShareLib_Install/bin/../include --extra-libs='-L/ShareLib_Install/bin/../lib -lx264' --enable-filter='aformat,aresample,copy,format,fps ,framestep,resample' --disable-encoders --enable-encoder='mjpeg,h264, libavutil 52. 18.100 / 52. 18. 100 libavcodec 54. 92.100 / 54. 92.100 libavformat 54. 63.104 / 54. 63.104 libavdevice 54. 3.103 / 54. 3.103 libavfilter 3. 42.103 / 3. 42.103 libswscale 2. 2.100 / 2. 2.100 libswresample 0. 17.102 / 0. 17.102 Splitting the commandline. Reading option '-loglevel' ... matched as option 'loglevel' (set libav* logging level) with argument 'debu g'. Reading option '-f' ... matched as option 'f' (force format) with argument 'video4linux2'. Reading option '-r' ... matched as option 'r' (set frame rate (Hz value, fraction or abbreviation)) with a rgument '30'. Reading option '-s' ... matched as option 's' (set frame size (WxH or abbreviation)) with argument '1280x7 20'. Reading option '-input_format' ... matched as AVOption 'input_format' with argument 'h264'. Reading option '-i' ... matched as input file with argument '/dev/video1'. Reading option '-f' ... matched as option 'f' (force format) with argument 'alsa'. Reading option '-i' ... matched as input file with argument 'hw:0'. Reading option '-ar' ... matched as option 'ar' (set audio sampling rate (in Hz)) with argument '48000'. Reading option '-ac' ... matched as option 'ac' (set number of audio channels) with argument '2'. Reading option '-acodec' ... matched as option 'acodec' (force audio codec ('copy' to copy stream)) with a rgument 'copy'. Reading option '-vcodec' ... matched as option 'vcodec' (force video codec ('copy' to copy stream)) with a rgument 'copy'. Reading option 'http://localhost:8090/feed1.ffm' ... matched as output file. Finished splitting the commandline. Parsing a group of options: global . Applying option loglevel (set libav* logging level) with argument debug. Successfully parsed a group of options. Parsing a group of options: input file /dev/video1. Applying option f (force format) with argument video4linux2. Applying option r (set frame rate (Hz value, fraction or abbreviation)) with argument 30. Applying option s (set frame size (WxH or abbreviation)) with argument 1280x720. Successfully parsed a group of options. Opening an input file: /dev/video1. [video4linux2,v4l2 @ 0x69e240] fd:3 capabilities:4000001 [video4linux2,v4l2 @ 0x69e240] Selecting input_channel: 0 [video4linux2,v4l2 @ 0x69e240] input_channel: 0, input_name: Camera 1 [video4linux2,v4l2 @ 0x69e240] Setting time per frame to 1/30 [h264 @ 0x69ede0] Using externally provided dimensions [h264 @ 0x69ede0] Frame num gap 18 16 [h264 @ 0x69ede0] Frame num gap 21 19 [h264 @ 0x69ede0] Frame num gap 27 25 [video4linux2,v4l2 @ 0x69e240] All info found [video4linux2,v4l2 @ 0x69e240] Estimating duration from bitrate, this may be inaccurate Input #0, video4linux2,v4l2, from '/dev/video1': Duration: N/A, start: 24.690000, bitrate: N/A Stream #0:0, 8, 1/1000000: Video: h264, yuv420p, 1280x720, 1/2000000, -5 kb/s, 30 fps, 30 tbr, 1000k t bn, 2000k tbc Successfully opened the file. Parsing a group of options: input file hw:0. Applying option f (force format) with argument alsa. Successfully parsed a group of options. Opening an input file: hw:0. [alsa @ 0x837ba0] codec_id ==NONE [alsa @ 0x837ba0] All info found [alsa @ 0x837ba0] Estimating duration from bitrate, this may be inaccurate Guessed Channel Layout for Input Stream #1.0 : stereo Input #1, alsa, from 'hw:0': Duration: N/A, start: 1373403477.887958, bitrate: 1536 kb/s Stream #1:0, 1, 1/1000000: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s Successfully opened the file. Parsing a group of options: output file http://localhost:8090/feed1.ffm. Applying option ar (set audio sampling rate (in Hz)) with argument 48000. Applying option ac (set number of audio channels) with argument 2. Applying option acodec (force audio codec ('copy' to copy stream)) with argument copy. Applying option vcodec (force video codec ('copy' to copy stream)) with argument copy. Successfully parsed a group of options. Opening an output file: http://localhost:8090/feed1.ffm. [ffm @ 0x842e40] Format ffm probed with size=2048 and score=101 [AVIOContext @ 0x842700] Statistics: 4096 bytes read, 0 seeks Tue Jul 9 20:57:57 2013 127.0.0.1 - - [GET] "/feed1.ffm HTTP/1.1" 200 4175 Successfully opened the file. Output #0, ffm, to 'http://localhost:8090/feed1.ffm': Metadata: creation_time : now encoder : Lavf54.63.104 Stream #0:0, 0, 1/1000000: Audio: pcm_s16le, 48000 Hz, stereo, 1536 kb/s Stream #0:1, 0, 1/1000000: Video: h264, yuv420p, 1280x720, 1/1000000, q=2-31, -5 kb/s, 30 fps, 1000k t bn, 1000k tbc Stream mapping: Stream #1:0 -> #0:0 (copy) Stream #0:0 -> #0:1 (copy) Press [q] to stop, [?] for help frame= 23 fps=0.0 q=-1.0 size= 136kB time=00:00:02.37 bitrate= 470.1kbits/s frame= 38 fps= 37 q=-1.0 size= 272kB time=00:00:02.87 bitrate= 776.4kbits/s frame= 53 fps= 35 q=-1.0 size= 388kB time=00:00:03.37 bitrate= 943.2kbits/s frame= 68 fps= 34 q=-1.0 size= 532kB time=00:00:03.87 bitrate=1126.1kbits/s frame= 83 fps= 33 q=-1.0 size= 740kB time=00:00:04.37 bitrate=1387.2kbits/s frame= 98 fps= 32 q=-1.0 size= 972kB time=00:00:04.87 bitrate=1635.0kbits/s frame= 113 fps= 32 q=-1.0 size= 1192kB time=00:00:05.37 bitrate=1818.4kbits/s frame= 128 fps= 32 q=-1.0 size= 1416kB time=00:00:05.87 bitrate=1976.1kbits/s frame= 143 fps= 32 q=-1.0 size= 1632kB time=00:00:06.37 bitrate=2098.8kbits/s frame= 158 fps= 31 q=-1.0 size= 1864kB time=00:00:06.87 bitrate=2222.7kbits/s frame= 173 fps= 31 q=-1.0 size= 2068kB time=00:00:07.37 bitrate=2298.7kbits/s frame= 188 fps= 31 q=-1.0 size= 2276kB time=00:00:07.87 bitrate=2369.1kbits/s frame= 203 fps= 31 q=-1.0 size= 2484kB time=00:00:08.37 bitrate=2431.2kbits/s frame= 218 fps= 31 q=-1.0 size= 2692kB time=00:00:08.87 bitrate=2486.2kbits/s frame= 233 fps= 31 q=-1.0 size= 2904kB time=00:00:09.37 bitrate=2538.9kbits/s frame= 248 fps= 31 q=-1.0 size= 3116kB time=00:00:09.87 bitrate=2586.2kbits/s frame= 263 fps= 31 q=-1.0 size= 3328kB time=00:00:10.37 bitrate=2629.0kbits/s frame= 278 fps= 31 q=-1.0 size= 3544kB time=00:00:10.87 bitrate=2670.9kbits/s frame= 293 fps= 31 q=-1.0 size= 3756kB time=00:00:11.37 bitrate=2706.2kbits/s frame= 308 fps= 31 q=-1.0 size= 3968kB time=00:00:11.87 bitrate=2738.5kbits/s frame= 323 fps= 31 q=-1.0 size= 4180kB time=00:00:12.37 bitrate=2768.2kbits/s Tue Jul 9 20:58:08 2013 192.168.1.3:34550 - - "PLAY test1-rtsp.mpg/streamid=0 RTP/UDP" Tue Jul 9 20:58:08 2013 192.168.1.3:34552 - - "PLAY test1-rtsp.mpg/streamid=1 RTP/UDP" frame= 338 fps= 31 q=-1.0 size= 4308kB time=00:00:12.87 bitrate=2742.1kbits/s frame= 353 fps= 31 q=-1.0 size= 4424kB time=00:00:13.37 bitrate=2710.7kbits/s frame= 368 fps= 31 q=-1.0 size= 4536kB time=00:00:13.87 bitrate=2679.1kbits/s frame= 383 fps= 31 q=-1.0 size= 4652kB time=00:00:14.37 bitrate=2652.0kbits/s frame= 398 fps= 31 q=-1.0 size= 4764kB time=00:00:14.87 bitrate=2624.5kbits/s frame= 413 fps= 31 q=-1.0 size= 4876kB time=00:00:15.37 bitrate=2598.8kbits/s ALSA buffer xrun. Tue Jul 9 20:58:11 2013 [ffm @ 0x679a80]resyncing Tue Jul 9 20:58:11 2013 [ffm @ 0x679a80]cannot find FFM syncword Tue Jul 9 20:58:11 2013 [ffm @ 0x679a80]resyncing frame= 428 fps= 31 q=-1.0 size= 5280kB time=00:00:15.87 bitrate=2725.5kbits/s frame= 443 fps= 30 q=-1.0 size= 5396kB time=00:00:16.37 bitrate=2700.3kbits/s frame= 458 fps= 30 q=-1.0 size= 5512kB time=00:00:16.87 bitrate=2676.6kbits/s frame= 473 fps= 30 q=-1.0 size= 5624kB time=00:00:17.37 bitrate=2652.4kbits/s find Key frame= 488 fps= 30 q=-1.0 size= 5748kB time=00:00:17.87 bitrate=2635.0kbits/s ALSA buffer xrun. frame= 503 fps= 30 q=-1.0 size= 6196kB time=00:00:18.37 bitrate=2763.1kbits/s ALSA buffer xrun. frame= 509 fps= 26 q=-1.0 size= 6224kB time=00:00:18.57 bitrate=2745.7kbits/s frame= 520 fps= 23 q=-1.0 size= 6776kB time=00:00:21.37 bitrate=2597.5kbits/s ALSA buffer xrun. frame= 537 fps= 22 q=-1.0 size= 6856kB time=00:00:24.47 bitrate=2295.2kbits/s ALSA buffer xrun. frame= 561 fps= 22 q=-1.0 size= 7040kB time=00:00:27.30 bitrate=2112.5kbits/s frame= 576 fps= 22 q=-1.0 size= 7092kB time=00:00:27.80 bitrate=2089.8kbits/s frame= 591 fps= 22 q=-1.0 size= 7144kB time=00:00:28.30 bitrate=2068.0kbits/s frame= 606 fps= 22 q=-1.0 size= 7200kB time=00:00:28.80 bitrate=2048.0kbits/s frame= 621 fps= 23 q=-1.0 size= 7252kB time=00:00:29.30 bitrate=2027.6kbits/s ALSA buffer xrun. frame= 636 fps= 23 q=-1.0 size= 7572kB time=00:00:29.80 bitrate=2081.5kbits/s frame= 652 fps= 23 q=-1.0 size= 7808kB time=00:00:30.34 bitrate=2108.2kbits/s frame= 667 fps= 23 q=-1.0 size= 8020kB time=00:00:30.84 bitrate=2130.3kbits/s frame= 682 fps= 23 q=-1.0 size= 8132kB time=00:00:31.34 bitrate=2125.6kbits/s frame= 697 fps= 23 q=-1.0 size= 8244kB time=00:00:31.84 bitrate=2121.1kbits/s frame= 712 fps= 23 q=-1.0 size= 8360kB time=00:00:32.34 bitrate=2117.7kbits/s frame= 726 fps= 23 q=-1.0 size= 8472kB time=00:00:32.80 bitrate=2115.9kbits/s frame= 741 fps= 24 q=-1.0 size= 8584kB time=00:00:33.30 bitrate=2111.7kbits/s ALSA buffer xrun. frame= 756 fps= 24 q=-1.0 size= 8996kB time=00:00:33.80 bitrate=2180.3kbits/s frame= 771 fps= 24 q=-1.0 size= 9108kB time=00:00:34.30 bitrate=2175.3kbits/s frame= 786 fps= 24 q=-1.0 size= 9220kB time=00:00:34.80 bitrate=2170.4kbits/s frame= 802 fps= 24 q=-1.0 size= 9352kB time=00:00:35.34 bitrate=2167.8kbits/s frame= 816 fps= 24 q=-1.0 size= 9460kB time=00:00:35.80 bitrate=2164.7kbits/s frame= 831 fps= 24 q=-1.0 size= 9576kB time=00:00:36.30 bitrate=2161.1kbits/s ALSA buffer xrun. frame= 846 fps= 24 q=-1.0 size= 10008kB time=00:00:36.80 bitrate=2227.9kbits/s frame= 861 fps= 24 q=-1.0 size= 10120kB time=00:00:37.30 bitrate=2222.6kbits/s frame= 876 fps= 24 q=-1.0 size= 10232kB time=00:00:37.80 bitrate=2217.5kbits/s frame= 891 fps= 24 q=-1.0 size= 10348kB time=00:00:38.30 bitrate=2213.3kbits/s Tue Jul 9 20:58:34 2013 192.168.1.3 - - [PLAY] "rtsp:// 192.168.1.254:5554/test1-rtsp.mpg/ RTSP/1.0" 200 1 030 frame= 907 fps= 25 q=-1.0 size= 10460kB time=00:00:38.84 bitrate=2206.2kbits/s frame= 922 fps= 25 q=-1.0 size= 10572kB time=00:00:39.34 bitrate=2201.5kbits/s ALSA buffer xrun. [ffm @ 0x842940] st:0 PTS: 37891681 DTS: 37891681 < 37892211 invalid, clipping frame= 937 fps= 25 q=-1.0 size= 10984kB time=00:00:39.84 bitrate=2258.6kbits/s frame= 952 fps= 25 q=-1.0 size= 11096kB time=00:00:40.34 bitrate=2253.3kbits/s qframe= 967 fps= 25 q=-1.0 size= 11208kB time=00:00:40.84 bitrate=2248.2kbits/s frame= 982 fps= 25 q=-1.0 size= 11324kB time=00:00:41.34 bitrate=2244.0kbits/s frame= 997 fps= 25 q=-1.0 size= 11444kB time=00:00:41.84 bitrate=2240.7kbits/s frame= 1012 fps= 25 q=-1.0 size= 11560kB time=00:00:42.34 bitrate=2236.6kbits/s ALSA buffer xrun. frame= 1027 fps= 25 q=-1.0 size= 11988kB time=00:00:42.84 bitrate=2292.4kbits/s ALSA buffer xrun. frame= 1029 fps= 23 q=-1.0 size= 12004kB time=00:00:42.90 bitrate=2292.2kbits/s frame= 1052 fps= 23 q=-1.0 size= 12572kB time=00:00:46.90 bitrate=2195.9kbits/s frame= 1067 fps= 23 q=-1.0 size= 12624kB time=00:00:47.40 bitrate=2181.8kbits/s ============================================================================= ffplay log: ffplay -loglevel debug rtsp://192.168.1.254:5554/test1-rtsp.mpg ffplay version N-54362-ge0be3cb Copyright (c) 2003-2013 the FFmpeg developers built on Jul 2 2013 22:15:59 with gcc 4.7.3 (GCC) configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-av isynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enab le-iconv --enable-libass --enable-libbluray --enable-libcaca --enable-libfreetyp e --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --ena ble-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-l ibopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libsp eex --enable-libtheora --enable-libtwolame --enable-libvo-aacenc --enable-libvo- amrwbenc --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxavs -- enable-libxvid --enable-zlib libavutil 52. 38.100 / 52. 38.100 libavcodec 55. 18.100 / 55. 18.100 libavformat 55. 11.100 / 55. 11.100 libavdevice 55. 2.100 / 55. 2.100 libavfilter 3. 77.101 / 3. 77.101 libswscale 2. 3.100 / 2. 3.100 libswresample 0. 17.102 / 0. 17.102 libpostproc 52. 3.100 / 52. 3.100 SDP:nan : 0.000 fd= 0 aq= 0KB vq= 0KB sq= 0B f=0/0 v=0 o=- 0 0 IN IP4 127.0.0.1 s=No Title c=IN IP4 0.0.0.0 t=0 0 a=tool:libavformat 54.63.104 m=audio 0 RTP/AVP 96 b=AS:1536 a=control:streamid=0 m=video 0 RTP/AVP 97 b=AS:-5 a=rtpmap:97 H264/90000 a=fmtp:97 packetization-mode=1; sprop-parameter-sets=Z0JAH5ZUAoAtyA==,aM44gA==; profile-level-id=42401F a=control:streamid=1 [rtsp @ 02a64500] video codec set to: h264 [NULL @ 02a679e0] RTP Packetization Mode: 1 [NULL @ 02a679e0] Extradata set to 02a67ea0 (size: 22)! [NULL @ 02a679e0] RTP Profile IDC: 42 Profile IOP: 40 Level: 1f hello state=0 0.000 fd= 0 aq= 0KB vq= 0KB sq= 0B f=0/0 nan : 0.000 fd= 0 aq= 0KB vq= 0KB sq= 0B f=0/0 -------------- next part -------------- An HTML attachment was scrubbed... URL: From liazhang2000 at gmail.com Tue Jul 16 18:00:34 2013 From: liazhang2000 at gmail.com (Liang Zhang) Date: Tue, 16 Jul 2013 12:00:34 -0400 Subject: [Libav-user] missing function timestamp.h and libswresample Message-ID: Dear Experts, I am new to this ffmpeg community and start to learn how to use ffmpeg libav* libraries under Linux ubuntu 3.2.0-24-generic. For learning, I tried to compile the example codes (demuxing.c) which was provided in ffmpeg web page. I have a compile bugger that said libavutil/timestamp.h: No such file or directory Then, I checked the libavutil under /usr/include/ and did not find timestamp.h. Can someone help me where to find this function? In addition, I was unable to install libswresample using sudo apt-get install command. Is this library still available? Thank for your kind help. Liang -------------- next part -------------- An HTML attachment was scrubbed... URL: From jpboard2 at yahoo.com Tue Jul 16 18:11:53 2013 From: jpboard2 at yahoo.com (James Board) Date: Tue, 16 Jul 2013 09:11:53 -0700 (PDT) Subject: [Libav-user] libavcodec documentation and usage Message-ID: <1373991113.30380.YahooMailNeo@web163905.mail.gq1.yahoo.com> I'd like to write a C or C++ program which uses libavcodec to retrieve individual frames of an AVI file.? I can't find much documentation on the WWW.? But there are examples in the ffmpeg source distribution.? I tried to compile them, but that failed because there is no file: channel_layout.h. Any ideas how I can get the xamples in ffmpeg source to compile? -------------- next part -------------- An HTML attachment was scrubbed... URL: From ggarra13 at gmail.com Tue Jul 16 18:18:02 2013 From: ggarra13 at gmail.com (Gonzalo Garramuno) Date: Tue, 16 Jul 2013 13:18:02 -0300 Subject: [Libav-user] missing function timestamp.h and libswresample In-Reply-To: References: Message-ID: <51E5723A.70604@gmail.com> On 16/07/13 13:00, Liang Zhang wrote: > > Dear Experts, > > I am new to this ffmpeg community and start to learn how to use ffmpeg > libav* libraries under Linux ubuntu 3.2.0-24-generic. > > For learning, I tried to compile the example codes (demuxing.c) which > was provided in ffmpeg web page. I have a compile bugger that said > > libavutil/timestamp.h: No such file or directory > > Then, I checked the libavutil under /usr/include/ and did not find > timestamp.h. Can someone help me where to find this function? > The file is under libavutil from the ffmpeg original source. When installed, from compilation, you will find it in /usr/local/include. If you are playing with libav* you should download the ffmpeg source distribution rather than rely on the apt-get packages. From stefasab at gmail.com Tue Jul 16 20:26:12 2013 From: stefasab at gmail.com (Stefano Sabatini) Date: Tue, 16 Jul 2013 20:26:12 +0200 Subject: [Libav-user] libavcodec documentation and usage In-Reply-To: <1373991113.30380.YahooMailNeo@web163905.mail.gq1.yahoo.com> References: <1373991113.30380.YahooMailNeo@web163905.mail.gq1.yahoo.com> Message-ID: <20130716182612.GB3431@barisone> On date Tuesday 2013-07-16 09:11:53 -0700, James Board encoded: > I'd like to write a C or C++ program which uses libavcodec to retrieve > individual frames of an AVI file.? I can't find much documentation on > the WWW.? But there are examples in the ffmpeg source distribution.? I tried > to compile them, but that failed because there is no file: channel_layout.h. > > Any ideas how I can get the xamples in ffmpeg source to compile? You need updated headers and pkg-config installed in your system. Also read the README file for further instructions. -- FFmpeg = Funny and Fanciful Mythic Perfectionist Ecumenical Guru From francesco.damato7 at gmail.com Tue Jul 16 17:22:42 2013 From: francesco.damato7 at gmail.com (Francesco Damato) Date: Tue, 16 Jul 2013 17:22:42 +0200 Subject: [Libav-user] decoding_encoding.c example Message-ID: <51E56542.4050900@gmail.com> I am writing a program to encode to mpeg2 video read from file, send it to a stream and then decode it. I saw the example decoding_encoding.c that generates a video from pictures fictitious ... but how do I replace this part and read and encode my video? anyone can help me, there are other examples available? Thanks!!! Francesco From francesco.damato7 at gmail.com Tue Jul 16 17:20:52 2013 From: francesco.damato7 at gmail.com (Francesco Damato) Date: Tue, 16 Jul 2013 17:20:52 +0200 Subject: [Libav-user] encode_decode with libavcodec Message-ID: <51E564D4.4030505@gmail.com> Hi, I am writing a program to encode to mpeg2 video read from file, send it to a stream and then decode it. I saw the example decoding_encoding.c that generates a video from dummy pictures... but how do I replace this part and read and encode my video? anyone can help me, there are other examples available? From bogdan_rad2004 at yahoo.com Tue Jul 16 15:27:45 2013 From: bogdan_rad2004 at yahoo.com (rad bogdan) Date: Tue, 16 Jul 2013 06:27:45 -0700 (PDT) Subject: [Libav-user] ffmpeg resize Message-ID: <1373981265.8557.YahooMailNeo@web164504.mail.gq1.yahoo.com> Hi everyone, I intend to use libav* for an embedded project in order to generate thumbnails for common image formats ( jpg, bmp, png, gif, tiff ). I know that ffmpeg is designated for processing mostly video/audio files but I chose it because in my case the libraries are approximately of 1.4MB ( the build was configured only with the necessary components ) and because of the possibility to use custom read/write/seek functions. The problem I'm facing now is about the processing speed. I have a dataset of 20 jpeg files aprox 300KB each and the time it takes for a bash script to call for 20 times "ffmpeg -i .. -s.. .. " is of 26 seconds ( 700MHz CPU ) while with enlightenment library it takes 6 seconds. Most of the time is spent in output_packet() function in ffmpeg. Is there any chance that by implementing my custom resize application using libav* I'll improve the processing speed to be close to 6 seconds ? I'm not used yet with the API and your response could save several days of needless work. Thank you, Bogdan -------------- next part -------------- An HTML attachment was scrubbed... URL: From jpboard2 at yahoo.com Tue Jul 16 22:04:42 2013 From: jpboard2 at yahoo.com (James Board) Date: Tue, 16 Jul 2013 13:04:42 -0700 (PDT) Subject: [Libav-user] libavcodec documentation and usage In-Reply-To: <20130716182612.GB3431@barisone> References: <1373991113.30380.YahooMailNeo@web163905.mail.gq1.yahoo.com> <20130716182612.GB3431@barisone> Message-ID: <1374005082.54193.YahooMailNeo@web163904.mail.gq1.yahoo.com> >On date Tuesday 2013-07-16 09:11:53 -0700, James Board encoded: >> I'd like to write a C or C++ program which uses libavcodec to retrieve >> individual frames of an AVI file.? I can't find much documentation on >> the WWW.? But there are examples in the ffmpeg source distribution.? I tried >> to compile them, but that failed because there is no file: channel_layout.h. >> >> Any ideas how I can get the xamples in ffmpeg source to compile? > >You need updated headers and pkg-config installed in your system. Also >read the README file for further instructions. Thanks for your reply, but in this case, it isn't true.? The pkg-config is okay.??But there? is no file named 'channel_layout.h' in my system. The other header files are in the example programs don't produce any problems. ? So is 'channel_layout.h'? obsolete?? Or did my ffmpeg build not compile correctly? -------------- next part -------------- An HTML attachment was scrubbed... URL: From liazhang2000 at gmail.com Wed Jul 17 00:26:56 2013 From: liazhang2000 at gmail.com (Liang Zhang) Date: Tue, 16 Jul 2013 18:26:56 -0400 Subject: [Libav-user] missing function timestamp.h and libswresample In-Reply-To: <51E5723A.70604@gmail.com> References: <51E5723A.70604@gmail.com> Message-ID: Thanks a lot for the response and the solution. It works now. On Tue, Jul 16, 2013 at 12:18 PM, Gonzalo Garramuno wrote: > On 16/07/13 13:00, Liang Zhang wrote: > >> >> Dear Experts, >> >> I am new to this ffmpeg community and start to learn how to use ffmpeg >> libav* libraries under Linux ubuntu 3.2.0-24-generic. >> >> For learning, I tried to compile the example codes (demuxing.c) which was >> provided in ffmpeg web page. I have a compile bugger that said >> >> libavutil/timestamp.h: No such file or directory >> >> Then, I checked the libavutil under /usr/include/ and did not find >> timestamp.h. Can someone help me where to find this function? >> >> The file is under libavutil from the ffmpeg original source. When > installed, from compilation, you will find it in /usr/local/include. If > you are playing with libav* you should download the ffmpeg source > distribution rather than rely on the apt-get packages. > > ______________________________**_________________ > 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 nicolas.george at normalesup.org Wed Jul 17 00:35:36 2013 From: nicolas.george at normalesup.org (Nicolas George) Date: Wed, 17 Jul 2013 00:35:36 +0200 Subject: [Libav-user] ffmpeg resize In-Reply-To: <1373981265.8557.YahooMailNeo@web164504.mail.gq1.yahoo.com> References: <1373981265.8557.YahooMailNeo@web164504.mail.gq1.yahoo.com> Message-ID: <20130716223536.GA10735@phare.normalesup.org> L'octidi 28 messidor, an CCXXI, rad bogdan a ?crit?: > Hi everyone, > > I intend to use libav* for an embedded project in order to generate > thumbnails for common image formats ( jpg, bmp, png, gif, tiff ). > I know that ffmpeg is designated for processing mostly video/audio > files but I chose it because in my case the libraries are approximately of > 1.4MB ( the build was configured only with the necessary components ) > and because of the possibility to use custom read/write/seek functions. > > The problem I'm facing now is about the processing speed. > I have a dataset of 20 jpeg files aprox 300KB each and the time it > takes for a bash script to call for 20 times "ffmpeg -i .. -s.. .. " is > of 26 seconds ( 700MHz CPU ) while with enlightenment library it takes > 6 seconds. Most of the time is spent in output_packet() function in ffmpeg. > > Is there any chance that by implementing my custom resize application > using libav* I'll improve the processing speed to be close to 6 > seconds ? I'm not used yet with the API and your response could save > several days of needless work. I believe so. Most of the time is spent in the library and application initialization, options parsing, format probing, information dump, etc. The actual processing is very fast: remember it is designed for video, it needs to be able to process frames in real time. You can get an idea by running a single ffmpeg command to process a bunch of images: you need the images to all have the same source and target size and be numbered in a logical way. I just ran the test and it went from 29?seconds to 4.6, for 100 images. Loading images in different formats and scaling from/to different sizes will take a little more time, but not much. If you write a small clean app to resize and convert a bunch of images, it could be even considered to be adopted as an example or an extra tool. 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 jpboard2 at yahoo.com Wed Jul 17 01:28:23 2013 From: jpboard2 at yahoo.com (James Board) Date: Tue, 16 Jul 2013 16:28:23 -0700 (PDT) Subject: [Libav-user] libavcodec documentation and usage In-Reply-To: <20130716182612.GB3431@barisone> References: <1373991113.30380.YahooMailNeo@web163905.mail.gq1.yahoo.com> <20130716182612.GB3431@barisone> Message-ID: <1374017303.46521.YahooMailNeo@web163906.mail.gq1.yahoo.com> >You need updated headers and pkg-config installed in your system. Also >read the README file for further instructions. I did a 'make install' of ffmpeg, and after that, I tried to build the libavcodec examples in doc/examples.? I received lots of 'undefined reference' errors after running 'make' for these subroutines: ??? av_get_channel_layout_nb_channels avcodec_alloc_context3 ??? av_get_sample_fmt_name av_get_channel_layout_nb_channels avcodec_open2 ??? av_samples_get_buffer_size avcodec_fill_audio_frame avcodec_encode_audio2 ??? avcodec_encode_audio2 avcodec_free_frame avcodec_alloc_context3 avcodec_open2 ??? avcodec_decode_audio4 av_samples_get_buffer_size avcodec_free_frame ??? avcodec_alloc_context3 av_opt_set avcodec_open2 av_image_alloc ??? avcodec_encode_video2 avcodec_encode_video2 avcodec_free_frame ??? avcodec_alloc_context3 avcodec_open2 avcodec_free_frame I'm able to fix that.? The compiler didn't know where to look for the libraries so I added -L/usr/local/lib to the compile command line. However, after that, I received about 100 additional 'undefined reference' error messages for these subroutines: ??? compress compress2 crc32 deflate deflateBound deflateEnd deflateInit2_ ??? deflateInit_ deflateReset inflate inflateEnd inflateInit_ inflateReset ??? inflateSync pthread_create pthread_join uncompress I don't know how to fix that.? Do you know what I must do to get the examples in doc/examples in the ffmpeg source code to compile? -------------- next part -------------- An HTML attachment was scrubbed... URL: From stefasab at gmail.com Wed Jul 17 01:31:02 2013 From: stefasab at gmail.com (Stefano Sabatini) Date: Wed, 17 Jul 2013 01:31:02 +0200 Subject: [Libav-user] libavcodec documentation and usage In-Reply-To: <1374005082.54193.YahooMailNeo@web163904.mail.gq1.yahoo.com> References: <1373991113.30380.YahooMailNeo@web163905.mail.gq1.yahoo.com> <20130716182612.GB3431@barisone> <1374005082.54193.YahooMailNeo@web163904.mail.gq1.yahoo.com> Message-ID: <20130716233102.GC3431@barisone> On date Tuesday 2013-07-16 13:04:42 -0700, James Board encoded: > >On date Tuesday 2013-07-16 09:11:53 -0700, James Board encoded: > >> I'd like to write a C or C++ program which uses libavcodec to retrieve > >> individual frames of an AVI file.? I can't find much documentation on > >> the WWW.? But there are examples in the ffmpeg source distribution.? I tried > >> to compile them, but that failed because there is no file: channel_layout.h. > >> > >> Any ideas how I can get the xamples in ffmpeg source to compile? > > > >You need updated headers and pkg-config installed in your system. Also > >read the README file for further instructions. > > Thanks for your reply, but in this case, it isn't true.? The pkg-config is > okay.??But there? is no file named 'channel_layout.h' in my system. > The other header files are in the example programs don't produce any > problems. > ? > So is 'channel_layout.h'? obsolete?? Or did my ffmpeg build not compile > correctly? The channel_layout.h file was added recently. Note that you *need* a recent ffmpeg installation of FFmpeg in your system, accessed throuhg pkg-config, since the examples make use of the recent API. Also read the README file in doc/examples. -- FFmpeg = Frightening and Formidable Most Programmable Eager Geisha From jpboard2 at yahoo.com Wed Jul 17 01:37:00 2013 From: jpboard2 at yahoo.com (James Board) Date: Tue, 16 Jul 2013 16:37:00 -0700 (PDT) Subject: [Libav-user] libavcodec documentation and usage In-Reply-To: <1374017303.46521.YahooMailNeo@web163906.mail.gq1.yahoo.com> References: <1373991113.30380.YahooMailNeo@web163905.mail.gq1.yahoo.com> <20130716182612.GB3431@barisone> <1374017303.46521.YahooMailNeo@web163906.mail.gq1.yahoo.com> Message-ID: <1374017820.19417.YahooMailNeo@web163902.mail.gq1.yahoo.com> >I don't know how to fix that.? Do you know what I must do to get >the examples in doc/examples in the ffmpeg source code to compile? Never mind.? I did the following and then the examples compiled: ??? setenv PKG_CONFIG_PATH /usr/local/lib/pkgconfig -------------- next part -------------- An HTML attachment was scrubbed... URL: From francesco.damato7 at gmail.com Wed Jul 17 11:57:54 2013 From: francesco.damato7 at gmail.com (Francesco Damato) Date: Wed, 17 Jul 2013 11:57:54 +0200 Subject: [Libav-user] decoding_encoding.c example Message-ID: <51E66AA2.1020109@gmail.com> Hi, I am an engineering student and i am writing a C program to encode to mpeg2 video read from file, send it to a stream and then decode it. I saw the example decoding_encoding.c that generates a video from dummy pictures... but how do I replace this part and read and encode my video? Can you help me, there are other examples or books available? Thanks!!! -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: cleardot.gif Type: image/gif Size: 43 bytes Desc: not available URL: From er.anshul.maheshwari at gmail.com Wed Jul 17 12:32:30 2013 From: er.anshul.maheshwari at gmail.com (Anshul) Date: Wed, 17 Jul 2013 16:02:30 +0530 Subject: [Libav-user] decoding_encoding.c example In-Reply-To: <51E66AA2.1020109@gmail.com> References: <51E66AA2.1020109@gmail.com> Message-ID: <51E672BE.4040705@gmail.com> On 07/17/2013 03:27 PM, Francesco Damato wrote: > Hi, > > I am an engineering student and i am writing a C program to encode to > mpeg2 video read from file, send it to a stream and then decode it. > > I saw the example decoding_encoding.c that generates a video from > dummy pictures... but how do I replace this part and read and encode > my video? > > Can you help me, there are other examples or books available? > > > Thanks!!! > > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user hi Francesco Damato Please look avformat_open_input api and avformat_find_stream_info u may need to comment out auto generate video part from that code. Thanks Anshul Maheshwari -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/gif Size: 43 bytes Desc: not available URL: From pvazharov at abaltatech.com Wed Jul 17 19:00:00 2013 From: pvazharov at abaltatech.com (Pavel Vazharov) Date: Wed, 17 Jul 2013 10:00:00 -0700 Subject: [Libav-user] non-existing PPS referenced console message on QNX Message-ID: Hi, I'm using the ffmpeg libraries in a QNX x86 application. A data stream is encoded, with ffmpeg (x264), on a server running on Windows and is decoded, with ffmpeg (x264), on the client running on QNX. The application generally works, the client shows the video data, but when the client starts decoding it writes in the console "non-existing PPS referenced" all the time. [NULL @ 936a900] non-existing PPS referenced [NULL @ 936a900] non-existing PPS referenced [NULL @ 936a900] non-existing PPS referenced [NULL @ 936a900] non-existing PPS referenced [NULL @ 936a900] non-existing PPS referenced I saw that this message is printed from h264_parser.c static inline int parse_nal_units(AVCodecParserContext *s, AVCodecContext *avctx, const uint8_t *buf, int buf_size) ... ... av_log(h->s.avctx, AV_LOG_ERROR, "non-existing PPS referenced\n"); My questions are: What this message means? How can I fix this error? Regards, Pavel. -------------- next part -------------- An HTML attachment was scrubbed... URL: From chaitanyag at gopalsystems.com Wed Jul 17 13:11:17 2013 From: chaitanyag at gopalsystems.com (Chaitanya Gopathi) Date: Wed, 17 Jul 2013 16:41:17 +0530 Subject: [Libav-user] New OGG is not playing In-Reply-To: References: Message-ID: Also, The production server is running under linux. so i used the above statement. But, at our machine it is windows and i could able to run shell_exec("ffmpeg2theora -o output.ogg Jul_03.mp4"); and i can get output.ogg, which playing very well at browsers. It is the problem at our production server, for which i'm using shell_exec("ffmpeg -i Jul_03.mp4 output.ogg &"); and litheora enabled. Do i need to ask the hosting provider anything on this? I already talked to them and i think everything is there in place. What else i'm missing. Please let me know. Thanks On Wed, Jul 17, 2013 at 3:50 PM, Chaitanya Gopathi < chaitanyag at gopalsystems.com> wrote: > Hi, > > I am working on ffmpeg very first time. I could able to convert an ogg > file from a mp4. But it is not playing in the browser. All other videos are > playing fine. Related add-ons are installed to the browser. > > I used following: > > shell_exec("ffmpeg -i Jul_03.mp4 output.ogg &"); > ?> > > I followed the archived records and googled on it, but could not find the > solution. > Which one i missed? Please help me. > > Thanks in advance, > > Chaitanya. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From chaitanyag at gopalsystems.com Wed Jul 17 12:20:08 2013 From: chaitanyag at gopalsystems.com (Chaitanya Gopathi) Date: Wed, 17 Jul 2013 15:50:08 +0530 Subject: [Libav-user] New OGG is not playing Message-ID: Hi, I am working on ffmpeg very first time. I could able to convert an ogg file from a mp4. But it is not playing in the browser. All other videos are playing fine. Related add-ons are installed to the browser. I used following: I followed the archived records and googled on it, but could not find the solution. Which one i missed? Please help me. Thanks in advance, Chaitanya. -------------- next part -------------- An HTML attachment was scrubbed... URL: From cehoyos at ag.or.at Wed Jul 17 23:19:10 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Wed, 17 Jul 2013 21:19:10 +0000 (UTC) Subject: [Libav-user] non-existing PPS referenced console message on QNX References: Message-ID: Pavel Vazharov writes: > I'm using the ffmpeg libraries in a QNX x86 application. > A data stream is encoded, with ffmpeg (x264), on a server > running on Windows and is decoded, with ffmpeg (x264), (note that x264 does not decode h264) > on the client running on QNX. The application generally > works, the client shows the video data, but when the > client starts decoding it writes in the console > "non-existing PPS referenced" all the time. Please provide the failing command line together with the complete, uncut console output. Also include the encoding command line please. Carl Eugen From cehoyos at ag.or.at Wed Jul 17 23:20:15 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Wed, 17 Jul 2013 21:20:15 +0000 (UTC) Subject: [Libav-user] New OGG is not playing References: Message-ID: Chaitanya Gopathi writes: > I am working on ffmpeg very first time. I could > able to convert an ogg file from a mp4. But it > is not playing in the browser. Please test your command line from the console and provide the complete, uncut console output. Carl Eugen From pvazharov at abaltatech.com Wed Jul 17 23:35:02 2013 From: pvazharov at abaltatech.com (Pavel Vazharov) Date: Wed, 17 Jul 2013 14:35:02 -0700 Subject: [Libav-user] non-existing PPS referenced console message on QNX In-Reply-To: References: Message-ID: Hi, You are right, I'm wrong about the decoding part. What do you mean with "failing command line" and "encoding command line"? We are using library functions, such as - sws_scale, avcodec_encode_video2 for encoding and avcodec_decode_video2, sws_scale for decoding. I think I can provide the parts of the code around the ffmpeg API invocations. Or you mean something different? Regards, Pavel. -------------- next part -------------- An HTML attachment was scrubbed... URL: From pvazharov at abaltatech.com Wed Jul 17 23:37:39 2013 From: pvazharov at abaltatech.com (Pavel Vazharov) Date: Wed, 17 Jul 2013 14:37:39 -0700 Subject: [Libav-user] non-existing PPS referenced console message on QNX In-Reply-To: References: Message-ID: I mentioned console message because I can see the messages in my debugging console and in the original QNX console after the application ends. Sorry if I misled you. -------------- next part -------------- An HTML attachment was scrubbed... URL: From agolub at earthlink.net Thu Jul 18 02:14:00 2013 From: agolub at earthlink.net (Aaron Golub) Date: Wed, 17 Jul 2013 17:14:00 -0700 Subject: [Libav-user] Issue installing ffmpeg-php on Ubuntu 12.04 Message-ID: I'm attempting to use your ffmpeg installation for Ubuntu 12.04 and I'm having trouble getting ffmpeg-php installed. I successfully installed ffmpeg, but now I'm trying to install ffmpeg-php. First I tried using using apt-get install php5-ffmpeg, but I'm met with this error: "The following packages have unmet dependencies: php5-ffmpeg : Depends: phpapi-20090626" I then attempted to install phpapi-20090626, which throws up this error: Package phpapi-20090626 is a virtual package provided by: php5-fpm 5.3.10-1ubuntu3.7 [Not candidate version] libapache2-mod-php5filter 5.3.10-1ubuntu3.7 [Not candidate version] php5-cli 5.3.10-1ubuntu3.7 [Not candidate version] php5-cgi 5.3.10-1ubuntu3.7 [Not candidate version] libapache2-mod-php5 5.3.10-1ubuntu3.7 [Not candidate version] php5-fpm 5.3.10-1ubuntu3 [Not candidate version] libapache2-mod-php5filter 5.3.10-1ubuntu3 [Not candidate version] php5-cli 5.3.10-1ubuntu3 [Not candidate version] php5-cgi 5.3.10-1ubuntu3 [Not candidate version] libapache2-mod-php5 5.3.10-1ubuntu3 [Not candidate version] E: Package 'phpapi-20090626' has no installation candidate The thing is, I'm using PHP 5.4.17-1. So then I attempted to use these directions: http://mysql-apache-php.com/ffmpeg-install. When I attempt to compile and install I run into an error saying "configure: error: ffmpeg headers not found. Make sure ffmpeg is compiled as shared libraries using the --enable-shared option" The suggested course of action is to install php-devel, but there is no such thing for Ubuntu 12. Does anyone have any ideas on how I should proceed? Any help would be greatly appreciated. Thanks! -- Aaron Golub agolub at earthlink.net 415-260-7857 -------------- next part -------------- An HTML attachment was scrubbed... URL: From cehoyos at ag.or.at Thu Jul 18 10:04:26 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Thu, 18 Jul 2013 08:04:26 +0000 (UTC) Subject: [Libav-user] non-existing PPS referenced console message on QNX References: Message-ID: Pavel Vazharov writes: > You are right, I'm wrong about the decoding part. > What do you mean with "failing command line" and > "encoding command line"? > We are using library functions You could test if the problem is also reproducible if you use the ffmpeg executable. Carl Eugen From cehoyos at ag.or.at Thu Jul 18 10:03:13 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Thu, 18 Jul 2013 08:03:13 +0000 (UTC) Subject: [Libav-user] Issue installing ffmpeg-php on Ubuntu 12.04 References: Message-ID: Aaron Golub writes: > I'm attempting to use your ffmpeg installation > for Ubuntu 12.04 and I'm having trouble getting > ffmpeg-php installed. ffmpeg-php is an independent software project that is not supported here. Additionally, it is not developed since a very long time, so it is probably not what you need. See also: http://ffmpeg.org/trac/ffmpeg/wiki/Using%20FFmpeg%20from%20PHP%20scripts Carl Eugen From pfischer at como.com Thu Jul 18 11:09:16 2013 From: pfischer at como.com (=?utf-8?Q?Patrick_Fischer?=) Date: Thu, 18 Jul 2013 11:09:16 +0200 Subject: [Libav-user] how to handle missing pts values to keep audio sync (mpegts->mp4) Message-ID: > Hello! ? This is my first mail on this list. So i hope i didn't got the wrong mailinglist. ? Im writing an program which received a mpeg ts udp stream and convert it to mp4 on the fly. Sometimes i have a problem with async audio. ? [mpegts @ 0x35fd580] PES packet size mismatch [mpeg2video @ 0x3604200] skipped MB in I frame at 25 32 [mpeg2video @ 0x3604200] skipped MB in I frame at 1 33 [mpeg2video @ 0x3604200] ac-tex damaged at 0 34 [mpeg2video @ 0x3604200] ac-tex damaged at 0 35 [mpeg2video @ 0x3604200] Warning MVs not available [mpeg2video @ 0x3604200] concealing 176 DC, 176 AC, 176 MV errors in I frame [mp2 @ 0x3649fa0] Header missing [err]failed to decode audio packet ? I use udp so it is possible to loose a packages. I have to handle it. ? my video_push and audio_push are appended. I dump out the PTS before i push it to the encoder. So you can see that 67 PTS Values are missing. With a 25fps video it is a delay of 2,68 sec. That's exactly what i see if i play the mp4 file via vlc. I have tried to skip some video frames, but din't have any effect. How to bring back sync audio? skip audio or video frames? recalc pts values? add dummy frames? all together? ? push audio frame to 689152 (673) push audio frame to 690176 (674) [mpegts @ 0x2163580] PES packet size mismatch push video frame to 392 [mpeg2video @ 0x216a200] skipped MB in I frame at 25 32 [mpeg2video @ 0x216a200] skipped MB in I frame at 1 33 [mpeg2video @ 0x216a200] ac-tex damaged at 0 34 [mpeg2video @ 0x216a200] ac-tex damaged at 0 35 [mpeg2video @ 0x216a200] Warning MVs not available [mpeg2video @ 0x216a200] concealing 176 DC, 176 AC, 176 MV errors in I frame push video frame to 393 push video frame to 394<----------------------------- 1 PTS Values is missing!!!!!!! push video frame to 396 push video frame to 397 [mp2 @ 0x21affa0] Header missing [err]failed to decode audio packet push audio frame to 691200 (675) push audio frame to 692224 (676) push audio frame to 693248 (677) push audio frame to 694272 (678) push audio frame to 695296 (679) push audio frame to 696320 (680) push audio frame to 697344 (681) push audio frame to 698368 (682) push audio frame to 699392 (683) push audio frame to 700416 (684) push audio frame to 701440 (685) push audio frame to 702464 (686) push audio frame to 703488 (687) push audio frame to 704512 (688) push audio frame to 705536 (689) push audio frame to 706560 (690) push audio frame to 707584 (691) push audio frame to 708608 (692) push video frame to 398 push video frame to 465?????????????????????????? <----------------------------- 67 PTS Values are missing!!!!!!! push video frame to 466 ? ? ? ? my video_push look something like that: int enc_audio_frame (my_enc_t *enc,AVFrame *audio_frame){ ? if ( enc->first_video_pts == AV_NOPTS_VALUE) ??????? return 0; ? if (enc->first_audio_pts == AV_NOPTS_VALUE) { ??????? enc->first_audio_pts = audio_frame->pts; ? } ? if (audio_frame->pts != AV_NOPTS_VALUE) { ????? audio_frame->pts = av_rescale_q(audio_frame->pts - enc->first_audio_pts, my_decoder_output.a_time_base, enc->conf.a_time_base); ? } ? AVPacket *enc_packet = (AVPacket *) malloc (sizeof (AVPacket)); ? av_init_packet(enc_packet); ? enc_packet->size = 0; ? enc_packet->data=NULL; ? int packet_done = 0; ? if ( avcodec_encode_audio2 (enc->audio_codec_ctx,enc_packet,audio_frame,&packet_done) < 0) { ????? fprintf (stderr,"[err]%s failed to encode audio samples\n", __FUNCTION__); ????? return -1; ? } ? if ( packet_done ) { ??? enc_packet->stream_index= 1; ??? fprintf (stderr,"push audio frame to %"PRId64" (%"PRId64")\n", audio_frame->pts, audio_frame->pts/1024); ??? enc->push(enc->push_priv,enc_packet); ? } ? av_free_packet(enc_packet); ? av_free (enc_packet); ? return 0; } ? my audio_push look something like that: int enc_audio_frame (my_enc_t *enc,AVFrame *audio_frame){ ? if ( enc->first_video_pts == AV_NOPTS_VALUE) ??????? return 0; ? if (enc->first_audio_pts == AV_NOPTS_VALUE) { ??????? enc->first_audio_pts = audio_frame->pts; ? } ? if (audio_frame->pts != AV_NOPTS_VALUE) { ????? audio_frame->pts = av_rescale_q(audio_frame->pts - enc->first_audio_pts, my_decoder_output.a_time_base, enc->conf.a_time_base); ? } ? AVPacket *enc_packet = (AVPacket *) malloc (sizeof (AVPacket)); ? av_init_packet(enc_packet); ? enc_packet->size = 0; ? enc_packet->data=NULL; ? int packet_done = 0; ? if ( avcodec_encode_audio2 (enc->audio_codec_ctx,enc_packet,audio_frame,&packet_done) < 0) { ????? fprintf (stderr,"[err]%s failed to encode audio samples\n", __FUNCTION__); ????? return -1; ? } ? if ( packet_done ) { ??? enc_packet->stream_index= 1; ??? fprintf (stderr,"push audio frame to %"PRId64" (%"PRId64")\n", audio_frame->pts, audio_frame->pts/1024); ??? enc->push(enc->push_priv,enc_packet); ? } ? av_free_packet(enc_packet); ? av_free (enc_packet); ? return 0; ? ? ? ? ? If i use the application ffmpeg i got also an async mp4: ? ffmpeg -i? ~/Videos/defekte_streams/asyncron_1.ts?? test.mp4 ffmpeg version 0.8.6-6:0.8.6-0ubuntu0.12.10.1, Copyright (c) 2000-2013 the Libav developers ? built on Apr? 2 2013 17:02:16 with gcc 4.7.2 *** THIS PROGRAM IS DEPRECATED *** This program is only provided for compatibility and will be removed in a future release. Please use avconv instead. [mp3 @ 0xe71700] Header missing [mpegts @ 0xe6a180] max_analyze_duration reached [NULL @ 0xe8dbc0] start time is not set in estimate_timings_from_pts [NULL @ 0xe8fbe0] start time is not set in estimate_timings_from_pts [mpegts @ 0xe6a180] PES packet size mismatch Input #0, mpegts, from '/home/patrick/Videos/defekte_streams/asyncron_1.ts': ? Duration: 00:03:53.69, start: 94926.112233, bitrate: 3423 kb/s ? Program 130 ??? Stream #0.0[0x1411]: Video: mpeg2video (Main), yuv420p, 704x576 [PAR 16:11 DAR 16:9], 10000 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc ??? Stream #0.1[0x1412](deu): Audio: mp2, 48000 Hz, stereo, s16, 192 kb/s ??? Stream #0.2[0x1414](deu): Subtitle: [6][0][0][0] / 0x0006 ??? Stream #0.3[0x87c]: Data: [11][0][0][0] / 0x000B ??? Stream #0.4[0xa6e]: Data: [5][0][0][0] / 0x0005 File 'test.mp4' already exists. Overwrite ? [y/N] y [buffer @ 0xe9c480] w:704 h:576 pixfmt:yuv420p [libx264 @ 0xe70560] using SAR=16/11 [libx264 @ 0xe70560] using cpu capabilities: MMX2 SSE2Fast SSSE3 FastShuffle SSE4.2 [libx264 @ 0xe70560] profile Main, level 3.0 [libx264 @ 0xe70560] 264 - core 123 r2189 35cf912 - H.264/MPEG-4 AVC codec - Copyleft 2003-2012 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x1:0x111 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=0 me_range=16 chroma_me=1 trellis=1 8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=0 b_adapt=1 b_bias=0 direct=1 weightb=0 open_gop=1 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.25 aq=1:1.00 Output #0, mp4, to 'test.mp4': ? Metadata: ??? encoder???????? : Lavf53.21.1 ??? Stream #0.0: Video: libx264, yuv420p, 704x576 [PAR 16:11 DAR 16:9], q=-1--1, 25 tbn, 25 tbc ??? Stream #0.1(deu): Audio: libvo_aacenc, 48000 Hz, stereo, s16, 200 kb/s Stream mapping: ? Stream #0.0 -> #0.0 ? Stream #0.1 -> #0.1 Press ctrl-c to stop encoding [mp2 @ 0xe71700] Header missing Error while decoding stream #0.1 [mpegts @ 0xe6a180] Continuity check failed for pid 5137 expected 6 got 8/s dup=21 drop=0?? ? [mpegts @ 0xe6a180] Continuity check failed for pid 18 expected 15 got 7 [mpegts @ 0xe6a180] Continuity check failed for pid 5138 expected 7 got 1 [mpegts @ 0xe6a180] PES packet size mismatch [mpegts @ 0xe6a180] Continuity check failed for pid 2670 expected 15 got 12 [mpegts @ 0xe6a180] Continuity check failed for pid 2172 expected 6 got 9 [mpegts @ 0xe6a180] Continuity check failed for pid 0 expected 15 got 3 [mpeg2video @ 0xe6f6a0] skipped MB in I frame at 25 32 [mpeg2video @ 0xe6f6a0] skipped MB in I frame at 1 33 [mpeg2video @ 0xe6f6a0] ac-tex damaged at 0 34 [mpeg2video @ 0xe6f6a0] ac-tex damaged at 0 35 [mpeg2video @ 0xe6f6a0] Warning MVs not available [mpeg2video @ 0xe6f6a0] concealing 176 DC, 176 AC, 176 MV errors [mp2 @ 0xe71700] Header missing=??? 1410kB time=14.92 bitrate= 774.4kbits/s dup=21 drop=0?? ? Error while decoding stream #0.1 [mpegts @ 0xe6a180] PES packet size mismatchime=230.12 bitrate=1401.1kbits/s dup=88 drop=0?? ? [mpeg2video @ 0xe6f6a0] ac-tex damaged at 36 13 [mpeg2video @ 0xe6f6a0] Warning MVs not available [mpeg2video @ 0xe6f6a0] concealing 1012 DC, 1012 AC, 1012 MV errors [mp2 @ 0xe71700] incomplete frame Error while decoding stream #0.1 frame= 5851 fps= 28 q=28.0 Lsize=?? 40194kB time=230.66 bitrate=1427.5kbits/s dup=88 drop=0?? ? video:34406kB audio:5631kB global headers:0kB muxing overhead 0.391637% frame I:58??? Avg QP:21.87? size: 27346 [libx264 @ 0xe70560] frame P:3250? Avg QP:24.10? size:? 8797 [libx264 @ 0xe70560] frame B:2543? Avg QP:26.71? size:? 1988 [libx264 @ 0xe70560] consecutive B-frames: 31.4% 26.7% 15.4% 26.5% [libx264 @ 0xe70560] mb I? I16..4: 44.1%? 0.0% 55.9% [libx264 @ 0xe70560] mb P? I16..4: 11.1%? 0.0%? 5.9%? P16..4: 45.6%? 9.3%? 4.3%? 0.0%? 0.0%??? skip:23.7% [libx264 @ 0xe70560] mb B? I16..4:? 0.6%? 0.0%? 0.4%? B16..8: 32.4%? 2.8%? 0.6%? direct: 1.9%? skip:61.3%? L0:36.1% L1:56.3% BI: 7.6% [libx264 @ 0xe70560] coded y,uvDC,uvAC intra: 38.9% 54.4% 16.7% inter: 16.6% 20.4% 1.4% [libx264 @ 0xe70560] i16 v,h,dc,p: 45% 28% 12% 14% [libx264 @ 0xe70560] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 25% 19% 21%? 5%? 6%? 7%? 5%? 6%? 5% [libx264 @ 0xe70560] i8c dc,h,v,p: 51% 24% 20%? 4% [libx264 @ 0xe70560] Weighted P-Frames: Y:10.6% UV:6.0% [libx264 @ 0xe70560] ref P L0: 65.7% 11.6% 15.1%? 7.2%? 0.4% [libx264 @ 0xe70560] ref B L0: 84.6% 15.4% [libx264 @ 0xe70560] kb/s:1204.27 -------------- next part -------------- An HTML attachment was scrubbed... URL: From cehoyos at ag.or.at Thu Jul 18 11:15:12 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Thu, 18 Jul 2013 09:15:12 +0000 (UTC) Subject: [Libav-user] how to handle missing pts values to keep audio sync (mpegts->mp4) References: Message-ID: Patrick Fischer writes: > If i use the application ffmpeg i got also an async mp4: > ? > ffmpeg -i? ~/Videos/defekte_streams/asyncron_1.ts?test.mp4 > ffmpeg version 0.8.6-6:0.8.6-0ubuntu0.12.10.1 You did not test FFmpeg but an intentionally broken version that contains several hundred known bugs and regressions not reproducible with FFmpeg, including some issues that are security-relevant. Please understand that we cannot support such versions here. Please test current FFmpeg from http://ffmpeg.org/download.html and report back. If you want more information on why you are forced by your distribution to use a known to be broken version of FFmpeg, please read http://blog.pkh.me/p/13-the-ffmpeg-libav-situation.html Carl Eugen From nfxjfg at googlemail.com Thu Jul 18 11:23:07 2013 From: nfxjfg at googlemail.com (wm4) Date: Thu, 18 Jul 2013 11:23:07 +0200 Subject: [Libav-user] how to handle missing pts values to keep audio sync (mpegts->mp4) In-Reply-To: References: Message-ID: <20130718112307.084cb3ca@debian> On Thu, 18 Jul 2013 09:15:12 +0000 (UTC) Carl Eugen Hoyos wrote: > Patrick Fischer writes: > > > If i use the application ffmpeg i got also an async mp4: > > ? > > ffmpeg -i? ~/Videos/defekte_streams/asyncron_1.ts?test.mp4 > > ffmpeg version 0.8.6-6:0.8.6-0ubuntu0.12.10.1 > > You did not test FFmpeg but an intentionally > broken version that contains several hundred > known bugs and regressions not reproducible Then why is ffmpeg merging from it on a daily basis? From cehoyos at ag.or.at Thu Jul 18 11:29:00 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Thu, 18 Jul 2013 09:29:00 +0000 (UTC) Subject: [Libav-user] how to handle missing pts values to keep audio sync (mpegts->mp4) References: <20130718112307.084cb3ca@debian> Message-ID: wm4 writes: > > You did not test FFmpeg but an intentionally > > broken version that contains several hundred > > known bugs and regressions not reproducible > > Then why is ffmpeg merging from it on a daily basis? You cut the important part;-( Although FFmpeg is merging on a daily basis, the mentioned bugs in avconv are bugs that are not reproducible with FFmpeg. Are you against merging on a daily basis? Carl Eugen From pfischer at como.com Thu Jul 18 11:29:19 2013 From: pfischer at como.com (=?utf-8?Q?Patrick_Fischer?=) Date: Thu, 18 Jul 2013 11:29:19 +0200 Subject: [Libav-user] how to handle missing pts values to keep audio sync (mpegts->mp4) In-Reply-To: References: Message-ID: > Hello ? I have tested a newer Version of the application ffmpeg. ? Now it is in sync! But not fix my problem. I need sync with my application. ? Now I have to take a look what i did different then the application ffmpeg. Update the ffmpeg libs for my application will be the next step. ? Regards Patrick ? ? /tmp/ffmpeg -i? ~/Videos/defekte_streams/asyncron_1.ts?? test.mp4 ffmpeg version N-54234-gef90639 Copyright (c) 2000-2013 the FFmpeg developers ? built on Jun 28 2013 05:26:06 with gcc 4.6 (Debian 4.6.3-1) ? configuration: --prefix=/root/ffmpeg-static/64bit --extra-cflags='-I/root/ffmpeg-static/64bit/include -static' --extra-ldflags='-L/root/ffmpeg-static/64bit/lib -static' --extra-libs='-lxml2 -lexpat -lfreetype' --enable-static --disable-shared --disable-ffserver --disable-doc --enable-bzlib --enable-zlib --enable-postproc --enable-runtime-cpudetect --enable-libx264 --enable-gpl --enable-libtheora --enable-libvorbis --enable-libmp3lame --enable-gray --enable-libass --enable-libfreetype --enable-libopenjpeg --enable-libspeex --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-version3 --enable-libvpx ? libavutil????? 52. 37.101 / 52. 37.101 ? libavcodec???? 55. 17.100 / 55. 17.100 ? libavformat??? 55. 10.100 / 55. 10.100 ? libavdevice??? 55.? 2.100 / 55.? 2.100 ? libavfilter???? 3. 77.101 /? 3. 77.101 ? libswscale????? 2.? 3.100 /? 2.? 3.100 ? libswresample?? 0. 17.102 /? 0. 17.102 ? libpostproc??? 52.? 3.100 / 52.? 3.100 [mp3 @ 0x323e980] Header missing [mpegts @ 0x3239ec0] Could not find codec parameters for stream 3 (Unknown: none ([11][0][0][0] / 0x000B)): unknown codec Consider increasing the value for the 'analyzeduration' and 'probesize' options [mpegts @ 0x3239ec0] Could not find codec parameters for stream 4 (Unknown: none ([5][0][0][0] / 0x0005)): unknown codec Consider increasing the value for the 'analyzeduration' and 'probesize' options [NULL @ 0x323ff00] start time is not set in estimate_timings_from_pts [NULL @ 0x3240940] start time is not set in estimate_timings_from_pts [mpegts @ 0x3239ec0] PES packet size mismatch Input #0, mpegts, from '/home/patrick/Videos/defekte_streams/asyncron_1.ts': ? Duration: 00:03:53.70, start: 94926.112233, bitrate: 3423 kb/s ? Program 130 ??? Stream #0:0[0x1411]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002), yuv420p, 704x576 [SAR 16:11 DAR 16:9], 25 fps, 25 tbr, 90k tbn, 50 tbc ??? Stream #0:1[0x1412](deu): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, s16p, 192 kb/s ??? Stream #0:2[0x1414](deu): Subtitle: dvb_teletext ([6][0][0][0] / 0x0006) ??? Stream #0:3[0x87c]: Unknown: none ([11][0][0][0] / 0x000B) ??? Stream #0:4[0xa6e]: Unknown: none ([5][0][0][0] / 0x0005) File 'test.mp4' already exists. Overwrite ? [y/N] y [libx264 @ 0x325c920] using SAR=16/11 [libx264 @ 0x325c920] using cpu capabilities: MMX2 SSE2Fast SSSE3 FastShuffle SSE4.2 [libx264 @ 0x325c920] profile High, level 3.0 [libx264 @ 0x325c920] 264 - core 129 r2230 1cffe9f - H.264/MPEG-4 AVC codec - Copyleft 2003-2012 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=6 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00 Output #0, mp4, to 'test.mp4': ? Metadata: ??? encoder???????? : Lavf55.10.100 ??? Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 704x576 [SAR 16:11 DAR 16:9], q=-1--1, 12800 tbn, 25 tbc ??? Stream #0:1(deu): Audio: aac (libvo_aacenc) ([64][0][0][0] / 0x0040), 48000 Hz, stereo, s16, 128 kb/s Stream mapping: ? Stream #0:0 -> #0:0 (mpeg2video -> libx264) ? Stream #0:1 -> #0:1 (mp2 -> libvo_aacenc) Press [q] to stop, [?] for help [mp2 @ 0x323e980] Header missing Error while decoding stream #0:1: Invalid data found when processing input skipped MB in I frame at 25 32e=??? 1350kB time=00:00:15.58 bitrate= 709.6kbits/s dup=22 drop=0?? ? [mpeg2video @ 0x323df40] skipped MB in I frame at 1 33 [mpeg2video @ 0x323df40] ac-tex damaged at 0 34 [mpeg2video @ 0x323df40] ac-tex damaged at 0 35 [mpeg2video @ 0x323df40] Warning MVs not available [mpeg2video @ 0x323df40] concealing 176 DC, 176 AC, 176 MV errors in I frame [mp2 @ 0x323e980] Header missing Error while decoding stream #0:1: Invalid data found when processing input PES packet size mismatch.0 size=?? 39788kB time=00:03:51.63 bitrate=1407.2kbits/s dup=89 drop=0?? ? [mpeg2video @ 0x323df40] ac-tex damaged at 36 13 [mpeg2video @ 0x323df40] Warning MVs not available [mpeg2video @ 0x323df40] concealing 1012 DC, 1012 AC, 1012 MV errors in B frame [mp2 @ 0x323e980] incomplete frame Error while decoding stream #0:1: Invalid data found when processing input frame= 5852 fps= 77 q=-1.0 Lsize=?? 40659kB time=00:03:54.00 bitrate=1423.4kbits/s dup=89 drop=0?? ? video:36892kB audio:3605kB subtitle:0 global headers:0kB muxing overhead 0.400476% [libx264 @ 0x325c920] frame I:58??? Avg QP:21.03? size: 27793 [libx264 @ 0x325c920] frame P:3257? Avg QP:23.95? size:? 9350 [libx264 @ 0x325c920] frame B:2537? Avg QP:25.95? size:? 2251 [libx264 @ 0x325c920] consecutive B-frames: 31.6% 26.6% 15.3% 26.5% [libx264 @ 0x325c920] mb I? I16..4: 22.1% 72.5%? 5.4% [libx264 @ 0x325c920] mb P? I16..4:? 5.5% 15.2%? 0.7%? P16..4: 37.8% 11.1%? 5.8%? 0.0%? 0.0%??? skip:23.8% [libx264 @ 0x325c920] mb B? I16..4:? 0.4%? 0.9%? 0.0%? B16..8: 31.4%? 3.1%? 0.6%? direct: 1.6%? skip:61.9%? L0:39.0% L1:52.0% BI: 9.0% [libx264 @ 0x325c920] 8x8 transform intra:70.9% inter:81.6% [libx264 @ 0x325c920] coded y,uvDC,uvAC intra: 51.5% 55.1% 15.8% inter: 19.8% 18.9% 1.4% [libx264 @ 0x325c920] i16 v,h,dc,p: 45% 32%? 9% 14% [libx264 @ 0x325c920] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 23% 19% 33%? 3%? 4%? 5%? 3%? 5%? 4% [libx264 @ 0x325c920] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 26% 23% 16%? 4%? 7%? 9%? 5%? 6%? 4% [libx264 @ 0x325c920] i8c dc,h,v,p: 51% 24% 21%? 4% [libx264 @ 0x325c920] Weighted P-Frames: Y:10.6% UV:6.0% [libx264 @ 0x325c920] ref P L0: 62.0% 14.9% 16.2%? 6.5%? 0.4% [libx264 @ 0x325c920] ref B L0: 79.9% 18.3%? 1.8% [libx264 @ 0x325c920] ref B L1: 92.7%? 7.3% [libx264 @ 0x325c920] kb/s:1291.07 ? -----Urspr?ngliche Nachricht----- An:libav-user at ffmpeg.org; Von:Carl Eugen Hoyos Gesendet:Do 18.07.2013 11:15 Betreff:Re: [Libav-user] how to handle missing pts values to keep audio sync (mpegts->mp4) Patrick Fischer writes: > If i use the application ffmpeg i got also an async mp4: > ? > ffmpeg -i? ~/Videos/defekte_streams/asyncron_1.ts?test.mp4 > ffmpeg version 0.8.6-6:0.8.6-0ubuntu0.12.10.1 You did not test FFmpeg but an intentionally broken version that contains several hundred known bugs and regressions not reproducible with FFmpeg, including some issues that are security-relevant. Please understand that we cannot support such versions here. Please test current FFmpeg from http://ffmpeg.org/download.html and report back. If you want more information on why you are forced by your distribution to use a known to be broken version of FFmpeg, please read http://blog.pkh.me/p/13-the-ffmpeg-libav-situation.html Carl Eugen _______________________________________________ Libav-user mailing list Libav-user at ffmpeg.org http://ffmpeg.org/mailman/listinfo/libav-user -------------- next part -------------- An HTML attachment was scrubbed... URL: From julian.herrera at tvgenius.net Thu Jul 18 13:22:54 2013 From: julian.herrera at tvgenius.net (Julian Herrera) Date: Thu, 18 Jul 2013 12:22:54 +0100 Subject: [Libav-user] "Internal error, slice end before start" may cause a crash Message-ID: <51E7D00E.5080107@tvgenius.net> Hello, I've developed a MPEG2-TS video player for iPad using ffmpeg and sometimes I get the following error message whilst performing a seek operation: "internal error, slice end before start" Most of times the video keeps playing normally after the operation is finished, but a few times (actually rarely) the app crashes (without outputting that message) inside avcodec_decode_video2() function. This is the lldb backtrace of the crash: * thread #12: tid = 0x2903, 0x00315576 astra`ff_thread_report_progress(f=0x00000000, n=0, field=0) + 10 at pthread.c:682, stop reason = EXC_BAD_ACCESS (code=1,address=0x144) frame #0: 0x00315576 astra`ff_thread_report_progress(f=0x00000000, n=0, field=0) + 10 at pthread.c:682 frame #1: 0x002f8f6c astra`ff_MPV_report_decode_progress() + 52 at mpegvideo.c:3104 frame #2: 0x002dd6e6 astra`mpeg_decode_slice(s=0x0f9eaa00, buf=0x03985a14) + 7854 at mpeg12.c:1813 frame #3: 0x002db046 astra`decode_chunks(avctx=0x0f9e1a00, picture=0x1083b840, got_output=0x03985d60, buf=0x0fa03000) + 7302 at mpeg12.c:2511 frame #4: 0x002d9378 astra`mpeg_decode_frame(avctx=0x0f9e1a00, data=0x1083b840, got_output=0x03985d60) + 816 at mpeg12.c:2580 frame #5: 0x0035ee0c astra`avcodec_decode_video2(avctx=0x0f9e1a00, picture=0x1083b840, got_picture_ptr=0x03985d60, avpkt=0x10894500) + 292 at utils.c:1624 frame #6: 0x0010fe20 astra`-[RBVideoDecoder decodeVideoPacket](self=0x00e20b60, _cmd=0x00444bcf) + 1768 at RBVideoDecoder.m:1087 frame #7: 0x3509da80 Foundation`-[NSThread main] + 72 frame #8: 0x35131590 Foundation`__NSThread__main__ + 1048 frame #9: 0x34f21734 libsystem_c.dylib`_pthread_start + 320 The line where it crashes (pthread.c:682) from the function (void ff_thread_report_progress(AVFrame *f, int n, int field)) is the following: volatile int *progress = f->thread_opaque; That is, the AVFrame * f passed to that function is null. Is this a known error? Could you guys suggest a starting point to investigate this issue? Thanks in advance. Julian From cehoyos at ag.or.at Thu Jul 18 13:34:42 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Thu, 18 Jul 2013 11:34:42 +0000 (UTC) Subject: [Libav-user] "Internal error, slice end before start" may cause a crash References: <51E7D00E.5080107@tvgenius.net> Message-ID: Julian Herrera writes: > frame #2: 0x002dd6e6 astra`mpeg_decode_slice(s=0x0f9eaa00, > buf=0x03985a14) + 7854 at mpeg12.c:1813 This looks outdated. Is the problem also reproducible with current git head? Carl Eugen From julian.herrera at tvgenius.net Thu Jul 18 13:51:16 2013 From: julian.herrera at tvgenius.net (Julian Herrera) Date: Thu, 18 Jul 2013 12:51:16 +0100 Subject: [Libav-user] "Internal error, slice end before start" may cause a crash In-Reply-To: References: <51E7D00E.5080107@tvgenius.net> Message-ID: <51E7D6B4.4090801@tvgenius.net> On 18/07/2013 12:34, Carl Eugen Hoyos wrote: > Julian Herrera writes: > >> frame #2: 0x002dd6e6 astra`mpeg_decode_slice(s=0x0f9eaa00, >> buf=0x03985a14) + 7854 at mpeg12.c:1813 > This looks outdated. > Is the problem also reproducible with current > git head? > It's been a long time since I last updated ffmpeg, mostly because the app has already been tested thoroughly with the version I'm using, which is 1.1.2. I was afraid to introduce new bugs with the update but of course I will try the latest ffmpeg version. Thanks, Julian From jpboard2 at yahoo.com Thu Jul 18 14:42:33 2013 From: jpboard2 at yahoo.com (James Board) Date: Thu, 18 Jul 2013 05:42:33 -0700 (PDT) Subject: [Libav-user] How to decode arbitrary frame Message-ID: <1374151353.85762.YahooMailNeo@web163902.mail.gq1.yahoo.com> I have the doc/examples programs compiled and running.? I use the program demuxing.c to decode an AVI file.? From the source code, it looks it calls its own subroutine decode_packet() to decode the next video or audio packet, and that subroutine calls avcodec_ecode_video2()to decode the next frame.? But they all decode sequential frames.? How can I decode an arbitrary frame in the video stream? -------------- next part -------------- An HTML attachment was scrubbed... URL: From zengaja at gmx.de Thu Jul 18 14:55:25 2013 From: zengaja at gmx.de (Thomas) Date: Thu, 18 Jul 2013 14:55:25 +0200 Subject: [Libav-user] How to decode arbitrary frame In-Reply-To: <1374151353.85762.YahooMailNeo@web163902.mail.gq1.yahoo.com> References: <1374151353.85762.YahooMailNeo@web163902.mail.gq1.yahoo.com> Message-ID: <51E7E5BD.9010601@gmx.de> Am 18.07.2013 14:42, schrieb James Board: > I have the doc/examples programs compiled and running. I use > the program demuxing.c to decode an AVI file. From the source > code, it looks it calls its own subroutine decode_packet() to decode > the next video or audio packet, and that subroutine calls > avcodec_ecode_video2()to decode the next frame. But they all decode > sequential frames. How can I decode an arbitrary frame in the > video stream? You can use avformat_seek_file() followed by avcodec_flush_buffers() before av_read_frame() to jump to an arbitrary position in the Stream. > > > _______________________________________________ > 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 diego.cdomingos2010 at gmail.com Thu Jul 18 16:10:09 2013 From: diego.cdomingos2010 at gmail.com (Diego Carvalho) Date: Thu, 18 Jul 2013 11:10:09 -0300 Subject: [Libav-user] RTP Packetization/Depacketization using libavformat Message-ID: Hi all, Could someone give me an example on how to packetize an encoded frame that is in the memory into RTP packets using libavformat. I saw that the code uses AvFormatContext but the only example I saw that uses this structure is when reading from a file. In this case, the start point is a in memory encoded frame. Also, I would like to do the opposite way, that is receive RTP packets and depacketizing them into a frame in the memory. I'm interested in H.263, H.264 and VP8 codecs and saw that libavformat supports all them. I appreciate any help. Thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jpboard2 at yahoo.com Fri Jul 19 02:26:18 2013 From: jpboard2 at yahoo.com (James Board) Date: Thu, 18 Jul 2013 17:26:18 -0700 (PDT) Subject: [Libav-user] How to decode arbitrary frame In-Reply-To: <51E7E5BD.9010601@gmx.de> References: <1374151353.85762.YahooMailNeo@web163902.mail.gq1.yahoo.com> <51E7E5BD.9010601@gmx.de> Message-ID: <1374193578.37761.YahooMailNeo@web163905.mail.gq1.yahoo.com> ________________________________ From: Thomas To: "This list is about using libavcodec, libavformat, libavutil, libavdevice and libavfilter." Sent: Thursday, July 18, 2013 8:55 AM Subject: Re: [Libav-user] How to decode arbitrary frame >You can use avformat_seek_file() followed by avcodec_flush_buffers() before av_read_frame() to jump to an arbitrary position in the Stream. Thank you.? That works.? But I have an question.? Will avformat_seek_file() seek to the exact frame, or merely to the nearest key frame?? I'm coding a video editor and I need to seek to exact frames.? My input format, for now, are raw formats where all frames are stored in full such as rawuyvy, or raw422P.? Will avformat_seek_file() seek to the exact frame in those raw formats, and will it also seek to the exact frame if I use it on MPEG-type formats? Thank you. -------------- next part -------------- An HTML attachment was scrubbed... URL: From zengaja at gmx.de Fri Jul 19 09:18:03 2013 From: zengaja at gmx.de (Thomas) Date: Fri, 19 Jul 2013 09:18:03 +0200 Subject: [Libav-user] How to decode arbitrary frame In-Reply-To: <1374193578.37761.YahooMailNeo@web163905.mail.gq1.yahoo.com> References: <1374151353.85762.YahooMailNeo@web163902.mail.gq1.yahoo.com> <51E7E5BD.9010601@gmx.de> <1374193578.37761.YahooMailNeo@web163905.mail.gq1.yahoo.com> Message-ID: <51E8E82B.9010901@gmx.de> Am 19.07.2013 02:26, schrieb James Board: > > > ------------------------------------------------------------------------ > *From:* Thomas > *To:* "This list is about using libavcodec, libavformat, libavutil, > libavdevice and libavfilter." > *Sent:* Thursday, July 18, 2013 8:55 AM > *Subject:* Re: [Libav-user] How to decode arbitrary frame > > >You can use avformat_seek_file() followed by avcodec_flush_buffers() > before av_read_frame() to jump to an arbitrary position in the Stream. > > Thank you. That works. But I have an question. Will > avformat_seek_file() > seek to the exact frame, or merely to the nearest key frame? I'm coding a > video editor and I need to seek to exact frames. My input > format, for now, are raw formats where all frames are stored in > full such as rawuyvy, or raw422P. Will avformat_seek_file() > seek to the exact frame in those raw formats I'm reading raw rgb and uncompressed v210 in avi container. Here it finds the correct frames when setting min_ts ts and max_ts to the same value. With mov files avformat_seek_file() doesn't seem to work. > , and will it also seek to the exact frame if I use it on MPEG-type > formats? I Diddnt try with interframe coded material, but i guess you can only search for I-frames and you will need to decode the whole GOP to process get to the frames inbetween. > > Thank you. > > > > _______________________________________________ > 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 stefasab at gmail.com Fri Jul 19 12:27:14 2013 From: stefasab at gmail.com (Stefano Sabatini) Date: Fri, 19 Jul 2013 12:27:14 +0200 Subject: [Libav-user] decoding_encoding.c example In-Reply-To: <51E66AA2.1020109@gmail.com> References: <51E66AA2.1020109@gmail.com> Message-ID: <20130719102714.GE3817@barisone> On date Wednesday 2013-07-17 11:57:54 +0200, Francesco Damato encoded: > Hi, > > I am an engineering student and i am writing a C program to encode > to mpeg2 video read from file, send it to a stream and then decode > it. > > I saw the example decoding_encoding.c that generates a video from > dummy pictures... but how do I replace this part and read and encode > my video? So you need to read from a movie or something? In that case you can use the code in demuxing.c. Also note that decoding_encoding.c is useful only for the encoding/decoding API, you may need to do muxing/demuxing as well. From julian.herrera at tvgenius.net Fri Jul 19 15:29:24 2013 From: julian.herrera at tvgenius.net (Julian Diego Herrera Braga) Date: Fri, 19 Jul 2013 14:29:24 +0100 Subject: [Libav-user] "Internal error, slice end before start" may cause a crash In-Reply-To: References: <51E7D00E.5080107@tvgenius.net> Message-ID: <51E93F34.8020406@tvgenius.net> On 18/07/2013 12:34, Carl Eugen Hoyos wrote: > Julian Herrera writes: > >> frame #2: 0x002dd6e6 astra`mpeg_decode_slice(s=0x0f9eaa00, >> buf=0x03985a14) + 7854 at mpeg12.c:1813 > This looks outdated. > Is the problem also reproducible with current > git head? > > Carl Eugen > > I've updated the project to link against ffmpeg-2.0 and now the issue seems to be worse. FFmpeg now crashes more often during a seek operation. This is the new backtrace: * thread #14: tid = 0x3303, 0x001d133c astra`ff_put_pixels16_neon, stop reason = EXC_BAD_ACCESS (code=1, address=0x0) frame #0: 0x001d133c astra`ff_put_pixels16_neon frame #1: 0x0033e6c0 astra`mpeg_motion [inlined] mpeg_motion_internal(s=0x1d473200, field_based=0, bottom_field=0, is_mpeg12=1, dest_y=0x068ca000, dest_cb=0x068ca000, dest_cr=0x068ca000) + 138 at mpegvideo_motion.c:322 frame #2: 0x0033e636 astra`mpeg_motion(s=0x1d473200, dest_y=0x068ca000, dest_cb=0x068ca000, dest_cr=0x068ca000) + 254 at mpegvideo_motion.c:344 frame #3: 0x0033e0e4 astra`ff_MPV_motion [inlined] MPV_motion_internal(is_mpeg12=0, dest_cr=0x068ca000, dest_cb=0x068ca000, dest_y=0x068ca000) + 8520 at mpegvideo_motion.c:834 frame #4: 0x0033e0e0 astra`ff_MPV_motion(, dest_y=0x068ca000, dest_cb=0x068ca000, dest_cr=0x068ca000) + 8516 at mpegvideo_motion.c:893 frame #5: 0x00338c4a astra`ff_MPV_decode_mb [inlined] MPV_decode_mb_internal(is_mpeg12=1, lowres_flag=0) + 212 at mpegvideo.c:2775 frame #6: 0x00338b76 astra`ff_MPV_decode_mb(s=0x1d473200, block=0x1dc24000) + 8890 at mpegvideo.c:2903 frame #7: 0x0031df6c astra`mpeg_decode_slice(s=0x1d473200, buf=0x05bb7f68) + 8488 at mpeg12dec.c:1716 frame #8: 0x0031bd48 astra`slice_decode_thread(c=0x1d453400) + 124 at mpeg12dec.c:1831 frame #9: 0x003579e4 astra`worker(v=0x1d453400) + 120 at pthread.c:177 frame #10: 0x3ad62310 libsystem_c.dylib`_pthread_start + 308 frame #11: 0x3ad621d8 libsystem_c.dylib`thread_start + 8 Any ideas? Thanks, Julian From cehoyos at ag.or.at Fri Jul 19 15:45:21 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Fri, 19 Jul 2013 13:45:21 +0000 (UTC) Subject: [Libav-user] "Internal error, slice end before start" may cause a crash References: <51E7D00E.5080107@tvgenius.net> <51E93F34.8020406@tvgenius.net> Message-ID: Julian Diego Herrera Braga writes: > I've updated the project to link against ffmpeg-2.0 and > now the issue seems to be worse. FFmpeg now crashes > more often during a seek operation. This is the new > backtrace: > > * thread #14: tid = 0x3303, 0x001d133c astra > `ff_put_pixels16_neon, stop reason = EXC_BAD_ACCESS > (code=1, address=0x0) > frame #0: 0x001d133c astra`ff_put_pixels16_neon > frame #1: 0x0033e6c0 astra`mpeg_motion [inlined] Please provide a complete backtrace including disassembly and register dump, as explained on http://ffmpeg.org/bugreports.html No way to reproduce the problem with the ffmpeg executable? Carl Eugen From julian.herrera at tvgenius.net Fri Jul 19 15:50:41 2013 From: julian.herrera at tvgenius.net (Julian Diego Herrera Braga) Date: Fri, 19 Jul 2013 14:50:41 +0100 Subject: [Libav-user] "Internal error, slice end before start" may cause a crash In-Reply-To: References: <51E7D00E.5080107@tvgenius.net> <51E93F34.8020406@tvgenius.net> Message-ID: <51E94431.4050002@tvgenius.net> On 19/07/2013 14:45, Carl Eugen Hoyos wrote: > Julian Diego Herrera Braga writes: > >> I've updated the project to link against ffmpeg-2.0 and >> now the issue seems to be worse. FFmpeg now crashes >> more often during a seek operation. This is the new >> backtrace: >> >> * thread #14: tid = 0x3303, 0x001d133c astra >> `ff_put_pixels16_neon, stop reason = EXC_BAD_ACCESS >> (code=1, address=0x0) >> frame #0: 0x001d133c astra`ff_put_pixels16_neon >> frame #1: 0x0033e6c0 astra`mpeg_motion [inlined] > Please provide a complete backtrace including > disassembly and register dump, as explained on > http://ffmpeg.org/bugreports.html > > No way to reproduce the problem with the > ffmpeg executable? > Can I run the ffmpeg executable on an iOS device? I don't think so, but I'll look into it. The crash now seems to be related to neon support. I'll test without neon support and then send a bug report. Julian From cehoyos at ag.or.at Fri Jul 19 16:06:52 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Fri, 19 Jul 2013 14:06:52 +0000 (UTC) Subject: [Libav-user] "Internal error, slice end before start" may cause a crash References: <51E7D00E.5080107@tvgenius.net> <51E93F34.8020406@tvgenius.net> <51E94431.4050002@tvgenius.net> Message-ID: Julian Diego Herrera Braga writes: > > Please provide a complete backtrace including > > disassembly and register dump, as explained on > > http://ffmpeg.org/bugreports.html > > > > No way to reproduce the problem with the > > ffmpeg executable? > > > Can I run the ffmpeg executable on an iOS device? I did it once, so it should work, yes. Please confirm that you are using the latest gas-preprocessor from https://github.com/yuvi/gas-preprocessor and please post your configure line. Complete gdb information will be useful, even more so from ffmpeg. Carl Eugen From hatalyak.gyula at artklikk.hu Fri Jul 19 18:20:34 2013 From: hatalyak.gyula at artklikk.hu (=?ISO-8859-1?Q?Gyula_Hataly=E1k?=) Date: Fri, 19 Jul 2013 18:20:34 +0200 Subject: [Libav-user] How to implement "-re" option with avformat? Message-ID: Hi, I am streaming out packets with RTMP output format to Wowza media server. I have a packet buffer as the input of the RTMP muxer. I can send the packets faster than their duration - by av_interleaved_write_frame calls. I send all the packets in the buffer until it is empty, and then wait for new packets to come. The problem is: During playback from Wowza the frames are displayed in the same timing as they were sent with av_interleaved_write_frame calls resulting fast playback and pause/still until the next bunch of packets. With command line ffmpeg I can use "-re" option to make the flow real-time. Is there a lib counterpart of this option? Or must I implement manually this "real-time" option? Why aren't PTS/DTS used by muxer/wowza/player? Thanks for any help in advance. Gyula -------------- next part -------------- An HTML attachment was scrubbed... URL: From mybrokenbeat at gmail.com Fri Jul 19 18:54:22 2013 From: mybrokenbeat at gmail.com (Oleg) Date: Fri, 19 Jul 2013 19:54:22 +0300 Subject: [Libav-user] How to implement "-re" option with avformat? In-Reply-To: References: Message-ID: <86FAB627-EA4E-42DF-A8DA-74EA1BD42AA5@gmail.com> Player should use PTS value anyway for correct and smooth playback. Are you sure that you're filling PTS correct? 19.07.2013, ? 19:20, Gyula Hataly?k ???????(?): > Hi, > > I am streaming out packets with RTMP output format to Wowza media server. > I have a packet buffer as the input of the RTMP muxer. > I can send the packets faster than their duration - by av_interleaved_write_frame calls. > I send all the packets in the buffer until it is empty, and then wait for new packets to come. > The problem is: > During playback from Wowza the frames are displayed in the same timing as they were sent with av_interleaved_write_frame calls resulting fast playback and pause/still until the next bunch of packets. > > With command line ffmpeg I can use "-re" option to make the flow real-time. > Is there a lib counterpart of this option? > Or must I implement manually this "real-time" option? > Why aren't PTS/DTS used by muxer/wowza/player? > > Thanks for any help in advance. > Gyula > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user From battistel at gmail.com Fri Jul 19 19:02:11 2013 From: battistel at gmail.com (Massimo Battistel) Date: Fri, 19 Jul 2013 19:02:11 +0200 Subject: [Libav-user] How to implement "-re" option with avformat? In-Reply-To: <86FAB627-EA4E-42DF-A8DA-74EA1BD42AA5@gmail.com> References: <86FAB627-EA4E-42DF-A8DA-74EA1BD42AA5@gmail.com> Message-ID: Hello, I have a similar problem. I need to stream some videos through udp/mpegts. Without flow control memory grows continuously. I solved comparing stream time with absolute time a making some Sleep(...) to slow down packet sending. I would like to know if a more elegant solution is available. thanks 2013/7/19 Oleg > Player should use PTS value anyway for correct and smooth playback. Are > you sure that you're filling PTS correct? > 19.07.2013, ? 19:20, Gyula Hataly?k ???????(?): > > > Hi, > > > > I am streaming out packets with RTMP output format to Wowza media server. > > I have a packet buffer as the input of the RTMP muxer. > > I can send the packets faster than their duration - by > av_interleaved_write_frame calls. > > I send all the packets in the buffer until it is empty, and then wait > for new packets to come. > > The problem is: > > During playback from Wowza the frames are displayed in the same timing > as they were sent with av_interleaved_write_frame calls resulting fast > playback and pause/still until the next bunch of packets. > > > > With command line ffmpeg I can use "-re" option to make the flow > real-time. > > Is there a lib counterpart of this option? > > Or must I implement manually this "real-time" option? > > Why aren't PTS/DTS used by muxer/wowza/player? > > > > Thanks for any help in advance. > > Gyula > > _______________________________________________ > > Libav-user mailing list > > Libav-user at ffmpeg.org > > http://ffmpeg.org/mailman/listinfo/libav-user > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > -- Massimo Battistel. -------------- next part -------------- An HTML attachment was scrubbed... URL: From hatalyak.gyula at artklikk.hu Fri Jul 19 19:09:39 2013 From: hatalyak.gyula at artklikk.hu (=?ISO-8859-1?Q?Gyula_Hataly=E1k?=) Date: Fri, 19 Jul 2013 19:09:39 +0200 Subject: [Libav-user] How to implement "-re" option with avformat? In-Reply-To: <86FAB627-EA4E-42DF-A8DA-74EA1BD42AA5@gmail.com> References: <86FAB627-EA4E-42DF-A8DA-74EA1BD42AA5@gmail.com> Message-ID: I am quite sure. BTW: If I omit the "-re" flag from the command line, it also runs and finishes as quick as it can - processing and sending the packets regardless PTS/DTS. On the server side (Wowza) there is no slow-down to make it real-time. It is strange for me. On Fri, Jul 19, 2013 at 6:54 PM, Oleg wrote: > Player should use PTS value anyway for correct and smooth playback. Are > you sure that you're filling PTS correct? > 19.07.2013, ? 19:20, Gyula Hataly?k ???????(?): > > > Hi, > > > > I am streaming out packets with RTMP output format to Wowza media server. > > I have a packet buffer as the input of the RTMP muxer. > > I can send the packets faster than their duration - by > av_interleaved_write_frame calls. > > I send all the packets in the buffer until it is empty, and then wait > for new packets to come. > > The problem is: > > During playback from Wowza the frames are displayed in the same timing > as they were sent with av_interleaved_write_frame calls resulting fast > playback and pause/still until the next bunch of packets. > > > > With command line ffmpeg I can use "-re" option to make the flow > real-time. > > Is there a lib counterpart of this option? > > Or must I implement manually this "real-time" option? > > Why aren't PTS/DTS used by muxer/wowza/player? > > > > Thanks for any help in advance. > > Gyula > > _______________________________________________ > > Libav-user mailing list > > Libav-user at ffmpeg.org > > http://ffmpeg.org/mailman/listinfo/libav-user > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mybrokenbeat at gmail.com Fri Jul 19 19:11:32 2013 From: mybrokenbeat at gmail.com (Oleg) Date: Fri, 19 Jul 2013 20:11:32 +0300 Subject: [Libav-user] How to implement "-re" option with avformat? In-Reply-To: References: <86FAB627-EA4E-42DF-A8DA-74EA1BD42AA5@gmail.com> Message-ID: <1BE58369-ABEF-489E-926B-7FF0A40732CA@gmail.com> Hello Massimo, I'm using PTS values and 1 second timer and have no problems at all. Also it's possible to sleep in thread by (cur_pts - prev_pts) value to get the most accurate timing, but of course it consumes more CPU. But these methods works only for streams where packets ordered by PTS. If it's not a truth, you should respect format's order and use, for example, DTS if it's suitable or reorder packets by PTS. Also when using duration value I didn't get accurate timing for most streams. 19.07.2013, ? 20:02, Massimo Battistel ???????(?): > Hello, > I have a similar problem. I need to stream some videos through udp/mpegts. Without flow control memory grows continuously. > I solved comparing stream time with absolute time a making some Sleep(...) to slow down packet sending. > > I would like to know if a more elegant solution is available. > > thanks > > > > > 2013/7/19 Oleg > Player should use PTS value anyway for correct and smooth playback. Are you sure that you're filling PTS correct? > 19.07.2013, ? 19:20, Gyula Hataly?k ???????(?): > > > Hi, > > > > I am streaming out packets with RTMP output format to Wowza media server. > > I have a packet buffer as the input of the RTMP muxer. > > I can send the packets faster than their duration - by av_interleaved_write_frame calls. > > I send all the packets in the buffer until it is empty, and then wait for new packets to come. > > The problem is: > > During playback from Wowza the frames are displayed in the same timing as they were sent with av_interleaved_write_frame calls resulting fast playback and pause/still until the next bunch of packets. > > > > With command line ffmpeg I can use "-re" option to make the flow real-time. > > Is there a lib counterpart of this option? > > Or must I implement manually this "real-time" option? > > Why aren't PTS/DTS used by muxer/wowza/player? > > > > Thanks for any help in advance. > > Gyula > > _______________________________________________ > > Libav-user mailing list > > Libav-user at ffmpeg.org > > http://ffmpeg.org/mailman/listinfo/libav-user > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > > > > -- > Massimo Battistel. > _______________________________________________ > 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 mybrokenbeat at gmail.com Fri Jul 19 19:23:06 2013 From: mybrokenbeat at gmail.com (Oleg) Date: Fri, 19 Jul 2013 20:23:06 +0300 Subject: [Libav-user] How to implement "-re" option with avformat? In-Reply-To: References: <86FAB627-EA4E-42DF-A8DA-74EA1BD42AA5@gmail.com> Message-ID: <9B9569CB-C20F-424B-9451-6DDB472C9E6F@gmail.com> If you're sure, then trouble exists in player, because it should do synchronizing of audio and video, and for this thing it needs PTS values. Otherwise player can't play smoothly. If you don't have these values playback will not be synchronized as CPU burst\network trouble or OS lag would suddenly make streams unsynchronized. If you don't have PTS values then player(depends on implementation) either respect video and audio codec constants such as frame rate and sample rate, or assumes that it should play frames\samples as fast as possible (just your case) as all PTSs are zeros. So you should look at your player. Also try it with ffplay. 19.07.2013, ? 20:09, Gyula Hataly?k ???????(?): > I am quite sure. > BTW: If I omit the "-re" flag from the command line, it also runs and finishes as quick as it can - processing and sending the packets regardless PTS/DTS. On the server side (Wowza) there is no slow-down to make it real-time. > It is strange for me. > > > On Fri, Jul 19, 2013 at 6:54 PM, Oleg wrote: > Player should use PTS value anyway for correct and smooth playback. Are you sure that you're filling PTS correct? > 19.07.2013, ? 19:20, Gyula Hataly?k ???????(?): > > > Hi, > > > > I am streaming out packets with RTMP output format to Wowza media server. > > I have a packet buffer as the input of the RTMP muxer. > > I can send the packets faster than their duration - by av_interleaved_write_frame calls. > > I send all the packets in the buffer until it is empty, and then wait for new packets to come. > > The problem is: > > During playback from Wowza the frames are displayed in the same timing as they were sent with av_interleaved_write_frame calls resulting fast playback and pause/still until the next bunch of packets. > > > > With command line ffmpeg I can use "-re" option to make the flow real-time. > > Is there a lib counterpart of this option? > > Or must I implement manually this "real-time" option? > > Why aren't PTS/DTS used by muxer/wowza/player? > > > > Thanks for any help in advance. > > Gyula > > _______________________________________________ > > Libav-user mailing list > > Libav-user at ffmpeg.org > > http://ffmpeg.org/mailman/listinfo/libav-user > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user -------------- next part -------------- An HTML attachment was scrubbed... URL: From hatalyak.gyula at artklikk.hu Fri Jul 19 19:45:59 2013 From: hatalyak.gyula at artklikk.hu (=?ISO-8859-1?Q?Gyula_Hataly=E1k?=) Date: Fri, 19 Jul 2013 19:45:59 +0200 Subject: [Libav-user] How to implement "-re" option with avformat? In-Reply-To: <9B9569CB-C20F-424B-9451-6DDB472C9E6F@gmail.com> References: <86FAB627-EA4E-42DF-A8DA-74EA1BD42AA5@gmail.com> <9B9569CB-C20F-424B-9451-6DDB472C9E6F@gmail.com> Message-ID: Ok, thanks, I will check wowza / player properties, and will check again PTS fields of the packets. On Fri, Jul 19, 2013 at 7:23 PM, Oleg wrote: > If you're sure, then trouble exists in player, because it should do > synchronizing of audio and video, and for this thing it needs PTS values. > Otherwise player can't play smoothly. If you don't have these values > playback will not be synchronized as CPU burst\network trouble or OS lag > would suddenly make streams unsynchronized. > > If you don't have PTS values then player(depends on implementation) either > respect video and audio codec constants such as frame rate and sample rate, > or assumes that it should play frames\samples as fast as possible (just > your case) as all PTSs are zeros. > > So you should look at your player. Also try it with ffplay. > > 19.07.2013, ? 20:09, Gyula Hataly?k ???????(?): > > I am quite sure. > BTW: If I omit the "-re" flag from the command line, it also runs and > finishes as quick as it can - processing and sending the packets regardless > PTS/DTS. On the server side (Wowza) there is no slow-down to make it > real-time. > It is strange for me. > > > On Fri, Jul 19, 2013 at 6:54 PM, Oleg wrote: > >> Player should use PTS value anyway for correct and smooth playback. Are >> you sure that you're filling PTS correct? >> 19.07.2013, ? 19:20, Gyula Hataly?k ???????(?): >> >> > Hi, >> > >> > I am streaming out packets with RTMP output format to Wowza media >> server. >> > I have a packet buffer as the input of the RTMP muxer. >> > I can send the packets faster than their duration - by >> av_interleaved_write_frame calls. >> > I send all the packets in the buffer until it is empty, and then wait >> for new packets to come. >> > The problem is: >> > During playback from Wowza the frames are displayed in the same timing >> as they were sent with av_interleaved_write_frame calls resulting fast >> playback and pause/still until the next bunch of packets. >> > >> > With command line ffmpeg I can use "-re" option to make the flow >> real-time. >> > Is there a lib counterpart of this option? >> > Or must I implement manually this "real-time" option? >> > Why aren't PTS/DTS used by muxer/wowza/player? >> > >> > Thanks for any help in advance. >> > Gyula >> > _______________________________________________ >> > Libav-user mailing list >> > Libav-user at ffmpeg.org >> > http://ffmpeg.org/mailman/listinfo/libav-user >> >> _______________________________________________ >> Libav-user mailing list >> Libav-user at ffmpeg.org >> http://ffmpeg.org/mailman/listinfo/libav-user >> > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > > > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From xukaijun at hikvision.com Sat Jul 20 12:03:44 2013 From: xukaijun at hikvision.com (=?gb2312?B?0O2/rb78?=) Date: Sat, 20 Jul 2013 10:03:44 +0000 Subject: [Libav-user] PCMU - avcodec_open2 return -22 Unknow Error Message-ID: <038C312AE7DA414D8456337AF41CEE78A83386@Hik-MBX01.hikvision.com> Hi! When I try to open AV_CODEC_ID_PCM_MULAW by the code below: Open_satus = -22. AVCodec* codec = avcodec_find_decoder(codec_id); if (!codec) { return -1; } m_ffmpeg_codec_context = avcodec_alloc_context3(codec); if (!m_ffmpeg_codec_context) { return -1; } int open_status = avcodec_open2(m_ffmpeg_codec_context, codec, NULL); if (open_status < 0) { CString formater; formater.Format("avcodec_open2 failed :%d\r\n", open_status); OutputDebugString(formater); } Did I make any mistakes? xukaijun -------------- next part -------------- An HTML attachment was scrubbed... URL: From xukaijun at hikvision.com Sat Jul 20 12:06:47 2013 From: xukaijun at hikvision.com (=?gb2312?B?0O2/rb78?=) Date: Sat, 20 Jul 2013 10:06:47 +0000 Subject: [Libav-user] =?gb2312?b?tPC4tDogUENNVSAtIGF2Y29kZWNfb3BlbjIgcmV0?= =?gb2312?b?dXJuIC0yMiBVbmtub3cgRXJyb3I=?= In-Reply-To: <038C312AE7DA414D8456337AF41CEE78A83386@Hik-MBX01.hikvision.com> References: <038C312AE7DA414D8456337AF41CEE78A83386@Hik-MBX01.hikvision.com> Message-ID: <038C312AE7DA414D8456337AF41CEE78A83394@Hik-MBX01.hikvision.com> PS: I have invoke before avcodec_open2: av_register_all(); avcodec_register_all(); xukaijun ???: libav-user-bounces at ffmpeg.org [mailto:libav-user-bounces at ffmpeg.org] ?? ??? ????: 2013?7?20? 18:04 ???: libav-user at ffmpeg.org ??: [Libav-user] PCMU - avcodec_open2 return -22 Unknow Error Hi! When I try to open AV_CODEC_ID_PCM_MULAW by the code below: Open_satus = -22. AVCodec* codec = avcodec_find_decoder(codec_id); if (!codec) { return -1; } m_ffmpeg_codec_context = avcodec_alloc_context3(codec); if (!m_ffmpeg_codec_context) { return -1; } int open_status = avcodec_open2(m_ffmpeg_codec_context, codec, NULL); if (open_status < 0) { CString formater; formater.Format("avcodec_open2 failed :%d\r\n", open_status); OutputDebugString(formater); } Did I make any mistakes? xukaijun -------------- next part -------------- An HTML attachment was scrubbed... URL: From battistel at gmail.com Sat Jul 20 18:00:10 2013 From: battistel at gmail.com (Massimo Battistel) Date: Sat, 20 Jul 2013 18:00:10 +0200 Subject: [Libav-user] Allocate and free audio frame Message-ID: hello, to allocate video frame buffers I use "avpicture_alloc" and to free it I use "avpicture_free". to allocate audio frame buffers I first have to allocate a buffer using "av_malloc" and then use "avcodec_fill_audio_frame". Is there a specific method to free audio frames? Now I'm using "avpicture_free" and it works, but is this the proper way? thanks, M -------------- next part -------------- An HTML attachment was scrubbed... URL: From onemda at gmail.com Sat Jul 20 20:27:40 2013 From: onemda at gmail.com (Paul B Mahol) Date: Sat, 20 Jul 2013 18:27:40 +0000 Subject: [Libav-user] Allocate and free audio frame In-Reply-To: References: Message-ID: On 7/20/13, Massimo Battistel wrote: > hello, > to allocate video frame buffers I use "avpicture_alloc" and to free it I > use "avpicture_free". > > to allocate audio frame buffers I first have to allocate a buffer using > "av_malloc" and then use "avcodec_fill_audio_frame". Is there a specific > method to free audio frames? Now I'm using "avpicture_free" and it works, > but is this the proper way? You can use av_samples_alloc_array_and_samples() to allocate samples for specific sample format and av_free(p) to free array and array that holds pointers to that same array. Note this is just most elegant why to handle both planar and packed sample formats: see doc/examples/resampling_audio.c > > thanks, > M > From jason.cipriani at gmail.com Mon Jul 22 12:12:37 2013 From: jason.cipriani at gmail.com (Jason Cipriani) Date: Mon, 22 Jul 2013 14:12:37 +0400 Subject: [Libav-user] Getting started with libavcodec Message-ID: I am looking for a library to decode video files in various formats and give me access the frame buffer for further processing. Is libavcodec what I want? If so, where can I find the documentation for it? The "Documentation -> libavcodec" link on the ffmpeg site (http://ffmpeg.org/libavcodec.html) doesn't actually seem to be documentation, although I did eventually find the doxygen docs for avcodec.h. However, it is only a raw API reference, I could not find a usage guide anywhere. Thanks! Jason -------------- next part -------------- An HTML attachment was scrubbed... URL: From er.anshul.maheshwari at gmail.com Mon Jul 22 12:47:32 2013 From: er.anshul.maheshwari at gmail.com (Anshul) Date: Mon, 22 Jul 2013 16:17:32 +0530 Subject: [Libav-user] Getting started with libavcodec In-Reply-To: References: Message-ID: <51ED0DC4.3020306@gmail.com> On 07/22/2013 03:42 PM, Jason Cipriani wrote: > I am looking for a library to decode video files in various formats > and give me access the frame buffer for further processing. Is > libavcodec what I want? > > If so, where can I find the documentation for it? The "Documentation > -> libavcodec" link on the ffmpeg site > (http://ffmpeg.org/libavcodec.html) doesn't actually seem to be > documentation, although I did eventually find the doxygen docs for > avcodec.h. However, it is only a raw API reference, I could not find a > usage guide anywhere. > > Thanks! > Jason > > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user Hi Jason Even I Don't Know where is The Perfect Documentation, but eventually you can start with decoding_encoding.c example. There is also an good Tutorial by Dranger (*dranger*.com/*ffmpeg*/). For Doxygen doc I would say Why dont You Write good comments on each API after doing above 2 exersize. Or much easier way report bug about each api you don't get... Thanks Anshul -------------- next part -------------- An HTML attachment was scrubbed... URL: From mark.kenna at sureviewsystems.com Mon Jul 22 15:10:53 2013 From: mark.kenna at sureviewsystems.com (Mark Kenna) Date: Mon, 22 Jul 2013 14:10:53 +0100 Subject: [Libav-user] ADPCM Codec Message-ID: All I am getting a return value of -22 when calling avcodec_open2 with a CodecId of 'AV_CODEC_ID_ADPCM_G726' (and the same for any other PCM based codecs). Could anyone indicate why this would be the case? Thanks, Mark. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mark.kenna at sureviewsystems.com Mon Jul 22 17:30:24 2013 From: mark.kenna at sureviewsystems.com (Mark Kenna) Date: Mon, 22 Jul 2013 16:30:24 +0100 Subject: [Libav-user] G726 Message-ID: I am trying to decode raw G726 from file. I am however unsure of how to configure the AVCodecContext before opening the codec. Could someone please explain what is required? Thanks, Mark. -------------- next part -------------- An HTML attachment was scrubbed... URL: From xukaijun at hikvision.com Tue Jul 23 02:46:18 2013 From: xukaijun at hikvision.com (=?gb2312?B?0O2/rb78?=) Date: Tue, 23 Jul 2013 00:46:18 +0000 Subject: [Libav-user] =?gb2312?b?tPC4tDogIEFEUENNIENvZGVj?= In-Reply-To: References: Message-ID: <038C312AE7DA414D8456337AF41CEE78A833E9@Hik-MBX01.hikvision.com> If you cannot figure out the reason why, by setting av_log_setcallback to get the detail info. I have encountered last week: PCMU - avcodec_open2 return -22 Unknow Error Now, I have solved it. xukaijun ???: libav-user-bounces at ffmpeg.org [mailto:libav-user-bounces at ffmpeg.org] ?? Mark Kenna ????: 2013?7?22? 21:11 ???: This list is about using libavcodec, libavformat, libavutil, libavdevice and libavfilter. ??: [Libav-user] ADPCM Codec All I am getting a return value of -22 when calling avcodec_open2 with a CodecId of 'AV_CODEC_ID_ADPCM_G726' (and the same for any other PCM based codecs). Could anyone indicate why this would be the case? Thanks, Mark. -------------- next part -------------- An HTML attachment was scrubbed... URL: From marikaner at gmail.com Tue Jul 23 10:54:38 2013 From: marikaner at gmail.com (Marika Marszalkowski) Date: Tue, 23 Jul 2013 10:54:38 +0200 Subject: [Libav-user] Problem Encoding H264 Video In-Reply-To: References: Message-ID: I should have added that oformat->video_codec is AV_CODEC_ID_H264, of course. Best, Marika On Mon, Jul 22, 2013 at 8:00 PM, Marika Marszalkowski wrote: > Hello everyone, > > I have been trying to create an encoded h264 Video from multiple images > (QImage), but I can't really achieve this. > > This list is my last resort and I totally hope there is someone out there > who can help me with this not as complicated problem. I am not sure what > the exact problem is - the video is created, but it is kind of jumpy, so > that an image is shown and it stays there for two second and then there is > a very short sequence (like half a second) and it's not moving again. Also > the first 40 encoded frames, return 0 (SUCCESS) but got_packet_ptr is 0. > > So this is how I create the video with its header: > > AVCodec *codec = avcodec_find_encoder(oformat->video_codec); > > > m_codecContext = avcodec_alloc_context3(codec); > > m_codecContext->gop_size = 30; > > m_codecContext->sample_fmt = AV_SAMPLE_FMT_NONE; > > m_codecContext->bit_rate = width * height; > > m_codecContext->width = width; > > m_codecContext->height = height; > > m_codecContext->time_base = (AVRational){1,frameRate}; > > m_codecContext->pix_fmt = AV_PIX_FMT_YUV420P; > > > formatCtx = avformat_alloc_context(); > > if(!formatCtx) > > { > > printf("Error allocating format context\n"); > > } > > formatCtx->oformat = oformat; > > formatCtx->video_codec_id = oformat->video_codec; > > snprintf(formatCtx->filename, sizeof(formatCtx->filename), "%s", outputFileName.toStdString().c_str()); > > > AVStream *videoStream = av_new_stream(formatCtx, 0); > > if(!videoStream) > > { > > printf("Could not allocate stream\n"); > > } > > videoStream->codec = m_codecContext; > > > if(formatCtx->oformat->flags & AVFMT_GLOBALHEADER) > > { > > m_codecContext->flags |= CODEC_FLAG_GLOBAL_HEADER; > > } > > > avcodec_open2(m_codecContext, codec, NULL); > > avio_open(&formatCtx->pb, outputFileName.toStdString().c_str(), AVIO_FLAG_WRITE); > > avformat_write_header(formatCtx, NULL); > > > > and this is how I add the frames: > > > > AVFrame *frame = avcodec_alloc_frame(); > > int size = m_codecContext->width * m_codecContext->height; > > int numBytes = avpicture_get_size(m_codecContext->pix_fmt, m_codecContext->width, m_codecContext->height); > > > QSharedPointer img = imageData; > > uint8_t *outbuf = (uint8_t *)malloc(numBytes); > > uint8_t *picture_buf = (uint8_t *)av_malloc(numBytes); > > if (true) > > { > > int ret = av_image_fill_arrays(frame->data, frame->linesize, picture_buf, m_codecContext->pix_fmt, m_codecContext->width, m_codecContext->height, 1); > > > frame->data[0] = picture_buf; > > frame->data[1] = frame->data[0] + size; > > frame->data[2] = frame->data[1] + size/4; > > frame->linesize[0] = m_codecContext->width; > > frame->linesize[1] = m_codecContext->width/2; > > frame->linesize[2] = m_codecContext->width/2; > > > fflush(stdout); > > for (int y = 0; y < m_codecContext->height; y++) > > { > > for (int x = 0; x < m_codecContext->width; x++) > > { > > unsigned char b = img->bits()[(y * m_codecContext->width + x) * 4 + 0]; > > unsigned char g = img->bits()[(y * m_codecContext->width + x) * 4 + 1]; > > unsigned char r = img->bits()[(y * m_codecContext->width + x) * 4 + 2]; > > unsigned char Y = (0.257 * r) + (0.504 * g) + (0.098 * b) + 16; > > frame->data[0][y * frame->linesize[0] + x] = Y; > > > if (y % 2 == 0 && x % 2 == 0) > > { > > unsigned char V = (0.439 * r) - (0.368 * g) - (0.071 * b) + 128; > > unsigned char U = -(0.148 * r) - (0.291 * g) + (0.439 * b) + 128; > > > frame->data[1][y/2 * frame->linesize[1] + x/2] = U; > > frame->data[2][y/2 * frame->linesize[2] + x/2] = V; > > } > > } > > } > > int pts = (1.0 / 30.0) * 9000.0 * frameIndex; > > frame->pts = pts; > > > int got_packet_ptr; > > AVPacket packet; > > av_init_packet(&packet); > > packet.data = outbuf; > > packet.size = numBytes; > > packet.stream_index = formatCtx->streams[0]->index; > > packet.flags |= AV_PKT_FLAG_KEY; > > packet.pts = packet.dts = pts; > > m_codecContext->coded_frame->pts = pts; > > > ret = avcodec_encode_video2(m_codecContext, &packet, frame, &got_packet_ptr); > > > if (got_packet_ptr != 0) > > { > > m_codecContext->coded_frame->pts = pts; > > > if (m_codecContext->coded_frame->pts != (0x8000000000000000LL)) > > pts = av_rescale_q(m_codecContext->coded_frame->pts, m_codecContext->time_base, formatCtx->streams[0]->time_base); > > packet.pts = pts; > > if(m_codecContext->coded_frame->key_frame) > > { > > packet.flags |= AV_PKT_FLAG_KEY; > > } > > > std::cout << "pts: " << packet.pts << ", dts: " << packet.dts << std::endl; > > av_interleaved_write_frame(formatCtx, &packet); > > av_free_packet(&packet); > > } > > } > > free(picture_buf); > > free(outbuf); > > av_free(frame); > > > > and of course in the end: > > > av_write_trailer(formatCtx); > > fclose(m_file); > > avcodec_close(m_codecContext); > > av_free(m_codecContext); > > > > I think this has something to do with the PTS/DTS values. PTS values start at 120 (as the first 40 frames are omitted) and are increased by 3 ((1.0 / 30.0) * 9000.0 * frameIndex) and the DTS values start at -6 also being increased by 3 per frame. But it might also be the settings or anything else. I feel like I have tried everything I was able to find on the internet and it's still wrong. I am desperate, help would be soooo appreciated! > > > Cheers, > > Marika > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From battistel at gmail.com Tue Jul 23 17:08:26 2013 From: battistel at gmail.com (Massimo Battistel) Date: Tue, 23 Jul 2013 17:08:26 +0200 Subject: [Libav-user] Info about lock manager Message-ID: Hello, I would like to have more info about lock manager provided by libav*. 1. Which funtions if libav* use it and when is it recommended to use? 2. Is the following implementation correct (it uses pthread)? int myLockManager(void** mutex, AVLockOp op) { pthread_mutex_t** pmutex = (pthread_mutex_t**)mutex; switch (op) { case AV_LOCK_CREATE: *pmutex = (pthread_mutex_t*)av_malloc(sizeof(pthread_mutex_t)); pthread_mutex_init(*pmutex, NULL); break; case AV_LOCK_OBTAIN: pthread_mutex_lock(*pmutex); break; case AV_LOCK_RELEASE: pthread_mutex_unlock(*pmutex); break; case AV_LOCK_DESTROY: pthread_mutex_destroy(*pmutex); av_free(*pmutex); break; } return 0; } ...somewhere in main... av_lockmgr_register(myLockManager); Thanks, M -------------- next part -------------- An HTML attachment was scrubbed... URL: From jason.cipriani at gmail.com Tue Jul 23 18:44:29 2013 From: jason.cipriani at gmail.com (Jason Cipriani) Date: Tue, 23 Jul 2013 20:44:29 +0400 Subject: [Libav-user] Getting started with libavcodec In-Reply-To: <51ED0DC4.3020306@gmail.com> References: <51ED0DC4.3020306@gmail.com> Message-ID: On Mon, Jul 22, 2013 at 2:47 PM, Anshul wrote: > On 07/22/2013 03:42 PM, Jason Cipriani wrote: > > I am looking for a library to decode video files in various formats and > give me access the frame buffer for further processing. Is libavcodec what > I want? > > If so, where can I find the documentation for it? The "Documentation -> > libavcodec" link on the ffmpeg site (http://ffmpeg.org/libavcodec.html) > doesn't actually seem to be documentation, although I did eventually find > the doxygen docs for avcodec.h. However, it is only a raw API reference, I > could not find a usage guide anywhere. > > Thanks! > Jason > > Hi Jason > > Even I Don't Know where is The Perfect Documentation, but eventually you > can start with decoding_encoding.c example. > There is also an good Tutorial by Dranger (* > dranger*.com/*ffmpeg*/). > For Doxygen doc I would say Why dont You Write good comments on each API > after doing above 2 exersize. > Or much easier way report bug about each api you don't get... > > Thanks > Anshul > Thank you Anshul, the Dranger tutorial (along with some Googling to figure out how to use sws_scale instead of img_convert) was enough to show me exactly what I needed to do. Great! Jason -------------- next part -------------- An HTML attachment was scrubbed... URL: From jason.cipriani at gmail.com Tue Jul 23 18:52:10 2013 From: jason.cipriani at gmail.com (Jason Cipriani) Date: Tue, 23 Jul 2013 20:52:10 +0400 Subject: [Libav-user] Some input files decoded upside down. Message-ID: Hello, I'm learning how to use libav. I'm following the tutorial at http://dranger.com/ffmpeg/tutorial01.html and have been able to read files, decode them, and save each frame to an image just fine. However, certain input files lead to the frames being decoded upside down (the input files play correctly in, say, mplayer). I have one input file that uses a rawvideo codec. This is decoded upside down. I have another input file that uses h264, this is decoded in the correct orientation. My question is, is there a flag in some *Context somewhere that indicates that the video frames are bottom-up, so that I can flip vertically if necessary when processing the frames after decoding? Also, then, it's easy enough for me to process an image upside down if necessary, but can sws_scale (or something similar) flip an image vertically so I can do the flip and RGB conversion all in one step? Thanks! Jason -------------- next part -------------- An HTML attachment was scrubbed... URL: From liazhang2000 at gmail.com Tue Jul 23 19:48:16 2013 From: liazhang2000 at gmail.com (Liang Zhang) Date: Tue, 23 Jul 2013 13:48:16 -0400 Subject: [Libav-user] Different decoded frame number from ffmpeg commend line and the example demuxing Message-ID: Hello, I'm learning how to use libav to decode the video data into YUV. I try to use ffmpeg commend line and also use the example program "demuxing" which is provided in ffmpeg documentation. It surprised me that both resulted in different frame number. I use the following ffmpeg commend line ffmpeg -y -i sample.mp4 -an -r 24 -pix_fmt rgb24 -vcodec tiff tif/%06d.tif to decode one video data file and get, e.g., 1460 frames. Then, I used the example program "demuxing" demuxing sample.mp4 out_video out_audio to decode the same file and I got 1821 frames. Can someone help me explain why the frame number is different with these two methods? FYI, I run the program in Ubuntu operating system. Thanks, liang -------------- next part -------------- An HTML attachment was scrubbed... URL: From cehoyos at ag.or.at Tue Jul 23 22:07:06 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Tue, 23 Jul 2013 20:07:06 +0000 (UTC) Subject: [Libav-user] Getting started with libavcodec References: Message-ID: Jason Cipriani writes: > If so, where can I find the documentation for it? > The "Documentation -> libavcodec" link on the ffmpeg > site (http://ffmpeg.org/libavcodec.html) doesn't actually > seem to be documentation, although I did eventually find > the doxygen docs for avcodec.h. However, it is only a raw > API reference, I could not find a usage guide anywhere. Please see the sample files in doc/examples Carl Eugen From abelalon at gmail.com Tue Jul 23 23:05:47 2013 From: abelalon at gmail.com (Abel Alonso) Date: Tue, 23 Jul 2013 23:05:47 +0200 Subject: [Libav-user] HW decoding on Android In-Reply-To: <201307112034.32601.cehoyos@ag.or.at> References: <201307112034.32601.cehoyos@ag.or.at> Message-ID: Hi Carl, Sorry for the delay in the response. I have no access to the development system where I test FFmpeg compilation for Android, so I cannot test it. However, just looking to the code, it wouldn't compile, because you are no defining de type. To make that compile yo need to add the following line. #define QOMX_COLOR_FormatYUV420PackedSemiPlanar64x32Tile2m8ka 0x7FA30C03 2013/7/11 Carl Eugen Hoyos > On Monday 08 July 2013 11:13:09 am Abel Alonso wrote: > > > Iirc, you were able to work-around that problem: > > > Does libstagefright decoding with ffmpeg work now or not? > > > > I've just tested it and it doesn't work. It continues crashing. I think > > that is related with the format issue I've commented before. > > Could you test attached patch? > I can't even test compilation here. > > Thank you, 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 Wed Jul 24 00:13:53 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Tue, 23 Jul 2013 22:13:53 +0000 (UTC) Subject: [Libav-user] HW decoding on Android References: <201307112034.32601.cehoyos@ag.or.at> Message-ID: Abel Alonso writes: > I have no access to the development system where I > test FFmpeg compilation for Android, so I cannot test > it. However, just looking to the code, it wouldn't > compile, because you are no defining de type. To make > that compile yo need to add the following line. > #define QOMX_COLOR_FormatYUV420PackedSemiPlanar64x32Tile2m8ka 0x7FA30C03 Thank you! Please report back if you have a chance to test. (I unfortunately cannot.) Carl Eugen From satyagowtham.k at gmail.com Wed Jul 24 09:10:18 2013 From: satyagowtham.k at gmail.com (satya gowtham kudupudi) Date: Wed, 24 Jul 2013 12:40:18 +0530 Subject: [Libav-user] Why ffmpeg is writing to stderr instead of stdout? Message-ID: $ ffmpeg -f v4l2 -r 15 -s 40x30 -i /dev/video0 -f flv rtmp:// 192.168.2.125:25333/venkat/test0 ffmpeg version git-2013-07-17-a0b7e73 Copyright (c) 2000-2013 the FFmpeg developers built on Jul 17 2013 17:20:26 with gcc 4.7 (Ubuntu/Linaro 4.7.3-1ubuntu1) configuration: --prefix=/usr/local/ffmpeg_build --extra-cflags=-I/usr/local/ffmpeg_build/include --extra-ldflags=-L/usr/local/ffmpeg_build/lib --bindir=/usr/local/bin --extra-libs=-ldl --enable-gpl --enable-libass --enable-libfdk-aac --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-nonfree --enable-x11grab libavutil 52. 40.100 / 52. 40.100 libavcodec 55. 18.102 / 55. 18.102 libavformat 55. 12.102 / 55. 12.102 libavdevice 55. 3.100 / 55. 3.100 libavfilter 3. 81.101 / 3. 81.101 libswscale 2. 4.100 / 2. 4.100 libswresample 0. 17.102 / 0. 17.102 libpostproc 52. 3.100 / 52. 3.100 [video4linux2,v4l2 @ 0xf0ce40] The V4L2 driver changed the video from 40x30 to 160x120 Input #0, video4linux2,v4l2, from '/dev/video0': Duration: N/A, start: 8718.480573, bitrate: 4608 kb/s Stream #0:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 160x120, 4608 kb/s, 15 fps, 15 tbr, 1000k tbn, 1000k tbc [tcp @ 0xf0cd40] Connection to tcp://192.168.2.125:25333 failed: No route to host [rtmp @ 0xf0e060] Cannot open connection tcp://192.168.2.125:25333 rtmp://192.168.2.125:25333/venkat/test0: No route to host I am making system call to above command and i want to extract only error message but unfortunately ffmpeg is writing non error messages to stderr. -- *Gowtham* -------------- next part -------------- An HTML attachment was scrubbed... URL: From mike at mikeversteeg.com Wed Jul 24 10:50:04 2013 From: mike at mikeversteeg.com (Mike Versteeg) Date: Wed, 24 Jul 2013 10:50:04 +0200 Subject: [Libav-user] can't decode RTMP stream from FMS Message-ID: Same stream from Wowza server works fine, but when using Adobe FMS I keep getting the same error (note it works fine in a flash player). Here's the output of the latest git, anyone have an idea? ffmpeg version N-54901-g55db06a Copyright (c) 2000-2013 the FFmpeg developers built on Jul 23 2013 18:01:29 with gcc 4.7.3 (GCC) configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-av isynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enab le-iconv --enable-libass --enable-libbluray --enable-libcaca --enable-libfreetyp e --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --ena ble-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-l ibopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libsp eex --enable-libtheora --enable-libtwolame --enable-libvo-aacenc --enable-libvo- amrwbenc --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxavs -- enable-libxvid --enable-zlib libavutil 52. 40.100 / 52. 40.100 libavcodec 55. 19.100 / 55. 19.100 libavformat 55. 12.102 / 55. 12.102 libavdevice 55. 3.100 / 55. 3.100 libavfilter 3. 81.102 / 3. 81.102 libswscale 2. 4.100 / 2. 4.100 libswresample 0. 17.103 / 0. 17.103 libpostproc 52. 3.100 / 52. 3.100 Parsing... Parsed protocol: 0 Parsed host : [removed for privacy reasons] Parsed app : vidlivestream/_definst_/stream RTMP_Connect1, ... connected, handshaking HandShake: Type Answer : 03 HandShake: Server Uptime : 506058230 HandShake: FMS Version : 4.5.5.1 HandShake: Handshaking finished.... RTMP_Connect1, handshaked Invoking connect HandleServerBW: server BW = 1250000 HandleClientBW: client BW = 1250000 2 HandleChangeChunkSize, received: chunk size change to 1024 HandleCtrl, received ctrl. type: 6, len: 6 HandleCtrl, Ping 506058630 sending ctrl. type: 0x0007 RTMP_ClientPacket, received: invoke 242 bytes (object begin) Property: Property: Property: (object begin) Property: Property: Property: (object end) Property: (object begin) Property: Property: Property: Property: Property: (object begin) Property: (object end) (object end) (object end) HandleInvoke, server invoking <_result> HandleInvoke, received result for method call sending ctrl. type: 0x0003 Invoking createStream RTMP_ClientPacket, received: invoke 21 bytes (object begin) Property: Property: Property: NULL (object end) HandleInvoke, server invoking Invoking _checkbw RTMP_ClientPacket, received: invoke 29 bytes (object begin) Property: Property: Property: NULL Property: (object end) HandleInvoke, server invoking <_result> HandleInvoke, received result for method call SendPlay, seekTime=0, stopTime=0, sending play: test Invoking play sending ctrl. type: 0x0003 RTMP_ClientPacket, received: invoke 16419 bytes (object begin) Property: Property: Property: NULL Property: K H 7 ~ + $ K Z # ! v 1 < m N % h 9 n G t % J M p 1 f # t % ^ u ( I ^ ) < 5 : ? @ a V O < S n [ * y N y T e * 3 P 1 F ! 6 # + ( w > W \ - : = ` _ 6 q $ - 0 e x G . ' 4 [ * / 0 / & _ l ] @ k 8 )v> Property: (object end) HandleInvoke, server invoking <_onbwcheck> Invoking _result HandleChangeChunkSize, received: chunk size change to 1024 RTMP_ClientPacket, received: invoke 142 bytes (object begin) Property: Property: Property: NULL Property: (object begin) Property: Property: Property: Property: (object end) (object end) HandleInvoke, server invoking HandleInvoke, onStatus: NetStream.Play.Failed Closing connection: NetStream.Play.Failed Mike From nicolas.george at normalesup.org Wed Jul 24 11:08:09 2013 From: nicolas.george at normalesup.org (Nicolas George) Date: Wed, 24 Jul 2013 11:08:09 +0200 Subject: [Libav-user] Why ffmpeg is writing to stderr instead of stdout? In-Reply-To: References: Message-ID: <20130724090809.GA11090@phare.normalesup.org> Le sextidi 6 thermidor, an CCXXI, satya gowtham kudupudi a ?crit?: > I am making system call to above command and i want to extract only error > message but unfortunately ffmpeg is writing non error messages to stderr. Well, errors are *supposed* to go to stderr, it means "standard *error* stream", after all; other diagnostics messages belong there as well. ffmpeg can produce actual output to stdout, for further processing in a pipeline, you would not want a Matroska stream mixed with error messages. Redirecting stderr to stdout is pretty easy from the calling shell. 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 cehoyos at ag.or.at Wed Jul 24 11:14:40 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Wed, 24 Jul 2013 09:14:40 +0000 (UTC) Subject: [Libav-user] Why ffmpeg is writing to stderr instead of stdout? References: Message-ID: satya gowtham kudupudi writes: > I am making system call to above command and i want > to extract only error message but unfortunately > ffmpeg is writing non error messages to stderr. I may absolutely misunderstand your mail but are you searching for -loglevel error ? Carl Eugen From satyagowtham.k at gmail.com Thu Jul 25 06:21:09 2013 From: satyagowtham.k at gmail.com (satya gowtham kudupudi) Date: Thu, 25 Jul 2013 09:51:09 +0530 Subject: [Libav-user] Why ffmpeg is writing to stderr instead of stdout? In-Reply-To: References: Message-ID: thanq. my required option is -loglevel error On Wed, Jul 24, 2013 at 2:44 PM, Carl Eugen Hoyos wrote: > satya gowtham kudupudi writes: > > > I am making system call to above command and i want > > to extract only error message but unfortunately > > ffmpeg is writing non error messages to stderr. > > I may absolutely misunderstand your mail but are you > searching for -loglevel error ? > > Carl Eugen > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > -- *Gowtham* -------------- next part -------------- An HTML attachment was scrubbed... URL: From mike at mikeversteeg.com Thu Jul 25 10:25:59 2013 From: mike at mikeversteeg.com (Mike Versteeg) Date: Thu, 25 Jul 2013 10:25:59 +0200 Subject: [Libav-user] can't decode RTMP stream from FMS In-Reply-To: References: Message-ID: Has anyone ever made ffmpeg decode an RTMP stream from FMS at all? Mike Versteeg mikeversteeg.com On Wed, Jul 24, 2013 at 10:50 AM, Mike Versteeg wrote: > Same stream from Wowza server works fine, but when using Adobe FMS I > keep getting the same error (note it works fine in a flash player). > > Here's the output of the latest git, anyone have an idea? > > ffmpeg version N-54901-g55db06a Copyright (c) 2000-2013 the FFmpeg developers > built on Jul 23 2013 18:01:29 with gcc 4.7.3 (GCC) > configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-av > isynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enab > le-iconv --enable-libass --enable-libbluray --enable-libcaca --enable-libfreetyp > e --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --ena > ble-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-l > ibopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libsp > eex --enable-libtheora --enable-libtwolame --enable-libvo-aacenc --enable-libvo- > amrwbenc --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxavs -- > enable-libxvid --enable-zlib > libavutil 52. 40.100 / 52. 40.100 > libavcodec 55. 19.100 / 55. 19.100 > libavformat 55. 12.102 / 55. 12.102 > libavdevice 55. 3.100 / 55. 3.100 > libavfilter 3. 81.102 / 3. 81.102 > libswscale 2. 4.100 / 2. 4.100 > libswresample 0. 17.103 / 0. 17.103 > libpostproc 52. 3.100 / 52. 3.100 > Parsing... > Parsed protocol: 0 > Parsed host : [removed for privacy reasons] > Parsed app : vidlivestream/_definst_/stream > RTMP_Connect1, ... connected, handshaking > HandShake: Type Answer : 03 > HandShake: Server Uptime : 506058230 > HandShake: FMS Version : 4.5.5.1 > HandShake: Handshaking finished.... > RTMP_Connect1, handshaked > Invoking connect > HandleServerBW: server BW = 1250000 > HandleClientBW: client BW = 1250000 2 > HandleChangeChunkSize, received: chunk size change to 1024 > HandleCtrl, received ctrl. type: 6, len: 6 > HandleCtrl, Ping 506058630 > sending ctrl. type: 0x0007 > RTMP_ClientPacket, received: invoke 242 bytes > (object begin) > Property: > Property: > Property: > (object begin) > Property: > Property: > Property: > (object end) > Property: > (object begin) > Property: > Property: > Property: > Property: > Property: > (object begin) > Property: > (object end) > (object end) > (object end) > HandleInvoke, server invoking <_result> > HandleInvoke, received result for method call > sending ctrl. type: 0x0003 > Invoking createStream > RTMP_ClientPacket, received: invoke 21 bytes > (object begin) > Property: > Property: > Property: NULL > (object end) > HandleInvoke, server invoking > Invoking _checkbw > RTMP_ClientPacket, received: invoke 29 bytes > (object begin) > Property: > Property: > Property: NULL > Property: > (object end) > HandleInvoke, server invoking <_result> > HandleInvoke, received result for method call > SendPlay, seekTime=0, stopTime=0, sending play: test > Invoking play > sending ctrl. type: 0x0003 > RTMP_ClientPacket, received: invoke 16419 bytes > (object begin) > Property: > Property: > Property: NULL > Property: j s 2 O < ? T = > K H 7 ~ + $ K Z # ! v 1 < m N % h 9 n G t % J M p 1 f # t % > ^ u ( I ^ ) < 5 : ? @ a V O < S n [ * y N y T e * 3 P 1 F ! 6 # + ( w > W \ - > : = ` _ 6 q $ - 0 e x G . ' 4 [ * / 0 / & _ l ] @ k 8 )v> > Property: > (object end) > HandleInvoke, server invoking <_onbwcheck> > Invoking _result > HandleChangeChunkSize, received: chunk size change to 1024 > RTMP_ClientPacket, received: invoke 142 bytes > (object begin) > Property: > Property: > Property: NULL > Property: > (object begin) > Property: > Property: > Property: st.> > Property: > (object end) > (object end) > HandleInvoke, server invoking > HandleInvoke, onStatus: NetStream.Play.Failed > Closing connection: NetStream.Play.Failed > > Mike From adishavit at gmail.com Thu Jul 25 10:36:17 2013 From: adishavit at gmail.com (Adi Shavit) Date: Thu, 25 Jul 2013 11:36:17 +0300 Subject: [Libav-user] Using libav to demux multiple programs from multi-program stream Message-ID: Hi, I have a udp feed with a multi-program stream. I need to demux all the streams simultaneously. Can avlib do this? If so, is there somewhere I can see an example of how to do this? Can anyone point me in the right direction? Thanks, Adi -------------- next part -------------- An HTML attachment was scrubbed... URL: From cehoyos at ag.or.at Thu Jul 25 10:49:29 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Thu, 25 Jul 2013 08:49:29 +0000 (UTC) Subject: [Libav-user] Using libav to demux multiple programs from multi-program stream References: Message-ID: Adi Shavit writes: > I have a udp feed with?a multi-program stream. > I need to demux all the streams simultaneously. > Can avlib do this? I may misunderstand your question but I believe FFmpeg can only demux all streams of a transport stream (you can of course ignore the streams that you don't need). Carl Eugen From adishavit at gmail.com Thu Jul 25 11:16:18 2013 From: adishavit at gmail.com (Adi Shavit) Date: Thu, 25 Jul 2013 12:16:18 +0300 Subject: [Libav-user] Using libav to demux multiple programs from multi-program stream In-Reply-To: References: Message-ID: Hi Carl, Thanks for the quick reply. What I'm asking is if it is possible to demux and the decode all (desired) streams independently. I guess the answer is yes. If so, how can I get the "program name" in a named stream to know which one I'm processing? Thanks, Adi >* I have a udp feed with a multi-program stream. > *>* I need to demux all the streams simultaneously. > *>* Can avlib do this? > * > * * I may misunderstand your question but I believe > FFmpeg can only demux all streams of a transport > stream (you can of course ignore the streams > that you don't need). > Carl Eugen -------------- next part -------------- An HTML attachment was scrubbed... URL: From cehoyos at ag.or.at Thu Jul 25 12:12:53 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Thu, 25 Jul 2013 10:12:53 +0000 (UTC) Subject: [Libav-user] Using libav to demux multiple programs from multi-program stream References: Message-ID: Adi Shavit writes: > What I'm asking is if it is possible to demux > and the decode all (desired) streams independently. Again, I may misunderstand, but I suspect you cannot demux the streams of a transport stream independently but you can only decode the resulting video and audio streams independently (FFmpeg does not support mvc yet). > If so, how can I get the "program name" in a > named stream to know which one I'm processing? See AVFormatContext->programs[] and av_find_program_from_stream() and friends. Please do not top-post here, it is considered rude, and if possible, please set your mailer to text-only. Carl Eugen From adishavit at gmail.com Thu Jul 25 12:54:56 2013 From: adishavit at gmail.com (Adi Shavit) Date: Thu, 25 Jul 2013 13:54:56 +0300 Subject: [Libav-user] Using libav to demux multiple programs from multi-program stream In-Reply-To: References: Message-ID: Hi Carl, > > > What I'm asking is if it is possible to demux > > and the decode all (desired) streams independently. > > Again, I may misunderstand, but I suspect you cannot > demux the streams of a transport stream independently > but you can only decode the resulting video and audio > streams independently (FFmpeg does not support mvc yet). Sorry for the confusion. I think I am starting to figure out what I want/need to do. Basically, I can use av_find_best_stream() with multiple stream indexes and save the proper codec for each such (desired) stream. Then when grabbing the frames with av_read_frame, I can check the packet.stream_index and for those indexes that I want to decode, I can call the appropriate decoder. I think this should work. > > > > If so, how can I get the "program name" in a > > named stream to know which one I'm processing? > > See AVFormatContext->programs[] and > av_find_program_from_stream() and friends. What's the relationship between "programs" and streams? I can see av_find_program_from_stream() in my header file, but I can't seem to find it in the docs here: http://libav.org/doxygen/master/avformat_8h_source.html > > Please do not top-post here, it is considered > rude, and if possible, please set your mailer > to text-only. I apologize, for the non-threaded reply. I didn't get the reply email and had to paste your reply (from the web archive) into my question email. Thanks, Adi From cehoyos at ag.or.at Thu Jul 25 13:03:34 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Thu, 25 Jul 2013 11:03:34 +0000 (UTC) Subject: [Libav-user] Using libav to demux multiple programs from multi-program stream References: Message-ID: Adi Shavit writes: > > > If so, how can I get the "program name" in a > > > named stream to know which one I'm processing? > > > > See AVFormatContext->programs[] and > > av_find_program_from_stream() and friends. > > What's the relationship between "programs" and streams? (You mentioned programs, as said, I may have misunderstand.) In transport streams, audio and video streams typically belong to a program, see ffmpeg -i file.ts for an example. > I can see av_find_program_from_stream() in my header > file, but I can't seem to find it in the docs here: > http://libav.org/doxygen/master/avformat_8h_source.html avconv contains several hundred known bugs not present in FFmpeg, some of them security-relevant, please understand that we cannot support it here. See http://blog.pkh.me/p/13-the-ffmpeg-libav-situation.html for more information. See http://ffmpeg.org/doxygen/trunk/avformat_8h_source.html for the sources in question. Carl Eugen From adishavit at gmail.com Thu Jul 25 13:12:53 2013 From: adishavit at gmail.com (Adi Shavit) Date: Thu, 25 Jul 2013 14:12:53 +0300 Subject: [Libav-user] Using libav to demux multiple programs from multi-program stream In-Reply-To: References: Message-ID: >> >> What's the relationship between "programs" and streams? > > (You mentioned programs, as said, I may have > misunderstand.) > In transport streams, audio and video streams > typically belong to a program, see ffmpeg -i file.ts for > an example. Ah, ok, I get it. I used the term "program" since that's what VLC calls selection the "channel" in a multi-program stream. I think this may be the same thing and the variable identifies which stream(s) belongs to which channel. Correct? > >> I can see av_find_program_from_stream() in my header >> file, but I can't seem to find it in the docs here: >> http://libav.org/doxygen/master/avformat_8h_source.html > > avconv contains several hundred known bugs not present in > FFmpeg, some of them security-relevant, please understand > that we cannot support it here. > See http://blog.pkh.me/p/13-the-ffmpeg-libav-situation.html > for more information. > > See http://ffmpeg.org/doxygen/trunk/avformat_8h_source.html > for the sources in question. Thanks for the correct link. In any case, I'm using ffmpeg, just had the wrong doc link. Thanks, Adi From mike at mikeversteeg.com Thu Jul 25 13:18:59 2013 From: mike at mikeversteeg.com (Mike Versteeg) Date: Thu, 25 Jul 2013 13:18:59 +0200 Subject: [Libav-user] can't decode RTMP stream from FMS In-Reply-To: References: Message-ID: I just got permission to publish the stream details for testing, so if anyone wants to have a look it is rtmp://185.13.90.110/vidlivestream/_definst_/stream/test As you can see it works fine in normal flash players, but not in ffmpeg/ffplay/ffprobe. Mike From cehoyos at ag.or.at Thu Jul 25 14:02:22 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Thu, 25 Jul 2013 12:02:22 +0000 (UTC) Subject: [Libav-user] can't decode RTMP stream from FMS References: Message-ID: Mike Versteeg writes: > rtmp://185.13.90.110/vidlivestream/_definst_/stream/test Works fine here, Carl Eugen $ ffmpeg -i rtmp://185.13.90.110/vidlivestream/_definst_/stream/test ffmpeg version N-54924-g5156d48 Copyright (c) 2000-2013 the FFmpeg developers built on Jul 25 2013 09:01:09 with gcc 4.7 (SUSE Linux) configuration: --enable-gpl --disable-indev=jack libavutil 52. 40.100 / 52. 40.100 libavcodec 55. 19.100 / 55. 19.100 libavformat 55. 12.102 / 55. 12.102 libavdevice 55. 3.100 / 55. 3.100 libavfilter 3. 81.103 / 3. 81.103 libswscale 2. 4.100 / 2. 4.100 libswresample 0. 17.103 / 0. 17.103 libpostproc 52. 3.100 / 52. 3.100 Input #0, flv, from 'rtmp://185.13.90.110/vidlivestream/_definst_/stream/test': Duration: N/A, start: 0.000000, bitrate: 128 kb/s Stream #0:0: Video: flv1, yuv420p, 320x176, 25 tbr, 1k tbn, 1k tbc Stream #0:1: Audio: mp3, 44100 Hz, stereo, s16p, 128 kb/s At least one output file must be specified From cehoyos at ag.or.at Thu Jul 25 14:03:11 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Thu, 25 Jul 2013 12:03:11 +0000 (UTC) Subject: [Libav-user] Using libav to demux multiple programs from multi-program stream References: Message-ID: Adi Shavit writes: > I used the term "program" since that's what VLC calls > selection the "channel" in a multi-program stream. > I think this may be the same thing and the variable > identifies which stream(s) belongs to which channel. > Correct? Sounds correct. (But I have never selected channels with vlc.) Carl Eugen From adishavit at gmail.com Thu Jul 25 14:05:44 2013 From: adishavit at gmail.com (Adi Shavit) Date: Thu, 25 Jul 2013 15:05:44 +0300 Subject: [Libav-user] Using libav to demux multiple programs from multi-program stream In-Reply-To: References: Message-ID: Thanks. :-) Adi On Thu, Jul 25, 2013 at 3:03 PM, Carl Eugen Hoyos wrote: > Adi Shavit writes: > >> I used the term "program" since that's what VLC calls >> selection the "channel" in a multi-program stream. >> I think this may be the same thing and the variable >> identifies which stream(s) belongs to which channel. >> Correct? > > Sounds correct. > (But I have never selected channels with vlc.) > > Carl Eugen > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user From mike at mikeversteeg.com Thu Jul 25 18:15:55 2013 From: mike at mikeversteeg.com (mikeversteeg) Date: Thu, 25 Jul 2013 09:15:55 -0700 (PDT) Subject: [Libav-user] can't decode RTMP stream from FMS In-Reply-To: References: Message-ID: <1374768955943-4658250.post@n4.nabble.com> Carl Eugen Hoyos wrote > Works fine here, Carl Eugen Thanks, interesting! So unless they fixed it in the past 24 hours, how is this possible? -- View this message in context: http://libav-users.943685.n4.nabble.com/Libav-user-can-t-decode-RTMP-stream-from-FMS-tp4658233p4658250.html Sent from the libav-users mailing list archive at Nabble.com. From cehoyos at ag.or.at Thu Jul 25 19:14:01 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Thu, 25 Jul 2013 17:14:01 +0000 (UTC) Subject: [Libav-user] can't decode RTMP stream from FMS References: <1374768955943-4658250.post@n4.nabble.com> Message-ID: mikeversteeg writes: > Carl Eugen Hoyos wrote > > Works fine here, Carl Eugen > > Thanks, interesting! > So unless they fixed it in the past 24 hours, (They?) > how is this possible? I suggest you look at the configure lines. (This is not only the reason why you are required to always send command lines together with complete, uncut console output - and a good indication how much other possibly similar projects care about their users - but also why I often suggest to test ./configure && make before reporting problems.) Carl Eugen From tariqul.isha at gmail.com Thu Jul 25 13:48:50 2013 From: tariqul.isha at gmail.com (Tariqul Islam) Date: Thu, 25 Jul 2013 17:48:50 +0600 Subject: [Libav-user] Encoding from file Message-ID: Hello I am new to ffmpeg coding. In ffmpeg source code, encoding decoding example is given in encoding_decoding.c. In this file while working with audio, a raw audio is created, then encoded, then decoded into a c file. What i am trying to do is to read from that C file, encode and thus reconstruct the previous audio file. But i am getting noise. Can anyone tell me how to read from that C file and encode? Tariqul Islam -------------- next part -------------- An HTML attachment was scrubbed... URL: From jeanporcherot at yahoo.fr Thu Jul 25 21:48:39 2013 From: jeanporcherot at yahoo.fr (Jean Porcherot) Date: Thu, 25 Jul 2013 21:48:39 +0200 Subject: [Libav-user] Fwd: mp3 file size inconsistency In-Reply-To: References: Message-ID: Hi, I am using ffmpeg 2.0 to read audio files from (Visual) C++ code. I had a hard time finding how to achieve this but it now works smartly for WAV files. However, for MP3 files, I am unable to read all samples: when opening the mp3 file in a mp3 editor (like Audicity), it reports me a number of samples available. Now, if I read the file from ffmpeg, I cannot read as many samples as reported. I could isolate the problem in a very simple sample program (source below). This code: - computes the number of samples expected (via frequency and file size attributes), this is always (tested 3 different files) the same value as the one reported by Audicity. - does a while loop to read all samples incrementing a counter. This gives the actual number of samples "readable". If given a WAV file as parameter, the two computed values are the same. If given a MP3 file as parameter, we read less samples than expected (difference is between 0 and packet.size). As if last packet reading failed.... If somebody can help, this would be greatly appreciated! Thanks in advance, Jean PS: I posted the question on the forumbut were recommended to use this list... extern "C" { #include "libavformat/avformat.h" } #include #include void check_size( char* filename ) { av_register_all(); AVFormatContext* container = avformat_alloc_context(); int stream_id = 0; if ( avformat_open_input(&container,filename,NULL,NULL) < 0 || av_find_stream_info(container) < 0 || (stream_id = av_find_best_stream(container, AVMEDIA_TYPE_AUDIO, -1, -1, NULL, 0)) < 0 ) { std::cout << "Unable to open file \"" << filename << "\"" << std::endl; } else { av_dump_format(container,0,filename,false); AVCodecContext *ctx = container->streams[stream_id]->codec; AVCodec *codec = avcodec_find_decoder(ctx->codec_id); if ( codec == NULL || avcodec_open2( ctx, codec, NULL ) < 0 ) { std::cout << "Codec cannot be found or inited" << std::endl; } else { // this code works for both wav and mp3 double sample_rate = ctx->sample_rate; int64_t durationUS = container->duration; double periodUS = AV_TIME_BASE / sample_rate; // this gives the theoretical number of samples // it's consitent with the number of samples displayed by Audicity audio file editor int64_t numberOfSamplesExpected = static_cast( durationUS / periodUS ); // let's read and see how many samples we can get! AVPacket packet; av_init_packet( &packet ); packet.pos = 0; packet.data = NULL; packet.size = 0; AVFrame *frame = avcodec_alloc_frame(); int64_t samplesFound = 0; int frameFinished = 0; while ( av_read_frame( container, &packet ) >= 0 ) { if ( packet.stream_index == stream_id ) { if ( avcodec_decode_audio4( ctx, frame, &frameFinished, &packet ) >= 0 ) { samplesFound += frame->nb_samples; } } } avcodec_free_frame( &frame ); if ( samplesFound == numberOfSamplesExpected ) { std::cout << "OK, found all " << samplesFound << " sample(s)" << std::endl; } else { std::cout << "FAILED, only got " << samplesFound << " sample(s), out of " << numberOfSamplesExpected << std::endl; std::cout << (numberOfSamplesExpected-samplesFound) << " samples could not be extracted!" << std::endl; } } } av_close_input_file(container); } int main(int argc, char **argv) { if ( argc == 2 ) { check_size(argv[1]); return 0; } else { printf("usage: %s input_file\n", argv[0]); return 1; } } -------------- next part -------------- An HTML attachment was scrubbed... URL: From p.tushar99 at gmail.com Fri Jul 26 06:35:52 2013 From: p.tushar99 at gmail.com (Tushar Paithankar) Date: Fri, 26 Jul 2013 10:05:52 +0530 Subject: [Libav-user] Encoding from file In-Reply-To: References: Message-ID: Hi Tariqul Islam, Have to played the raw audio data...? Please just check that you are getting correct audio data (you can check with Audacity tool). Second question is r u giving data to encoder and decoder on frame basic means frame by frame...? If yes have you writing any parser to decide MP3 or AAC frame by reading its header...? Regards Tushar On 25 July 2013 17:18, Tariqul Islam wrote: > Hello > > I am new to ffmpeg coding. In ffmpeg source code, encoding decoding > example is given in encoding_decoding.c. In this file while working with > audio, a raw audio is created, then encoded, then decoded into a c file. > What i am trying to do is to read from that C file, encode and thus > reconstruct the previous audio file. But i am getting noise. Can anyone > tell me how to read from that C file and encode? > > Tariqul Islam > > > > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mike at mikeversteeg.com Fri Jul 26 09:37:44 2013 From: mike at mikeversteeg.com (mikeversteeg) Date: Fri, 26 Jul 2013 00:37:44 -0700 (PDT) Subject: [Libav-user] can't decode RTMP stream from FMS In-Reply-To: References: <1374768955943-4658250.post@n4.nabble.com> Message-ID: <1374824264375-4658255.post@n4.nabble.com> Sorry, you lost me. AFAIK I followed all the rules: to exclude bugs in my code I downloaded the latest version of ffmpeg, reproduced the problem and included the console output. What did I do wrong? As far as I can see Zeranoe adds all libraries required to make this work. My code in fact uses an LGPL version so uses much less libraries and still works with all streams, except when it is coming from this Adobe server. Anyway, hope I get it right this time. So I went over to Zeranoe, downloaded the latest static 32 bit build and run the exact command you did (obviously now there is no debugging info). Here is the complete uncut console output: ffmpeg -i rtmp://185.13.90.110/vidlivestream/_definst_/stream/test ffmpeg version N-54933-g1af9211 Copyright (c) 2000-2013 the FFmpeg developers built on Jul 25 2013 18:01:26 with gcc 4.7.3 (GCC) configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-av isynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enab le-iconv --enable-libass --enable-libbluray --enable-libcaca --enable-libfreetyp e --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --ena ble-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-l ibopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libsp eex --enable-libtheora --enable-libtwolame --enable-libvo-aacenc --enable-libvo- amrwbenc --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxavs -- enable-libxvid --enable-zlib libavutil 52. 40.100 / 52. 40.100 libavcodec 55. 19.100 / 55. 19.100 libavformat 55. 12.102 / 55. 12.102 libavdevice 55. 3.100 / 55. 3.100 libavfilter 3. 81.103 / 3. 81.103 libswscale 2. 4.100 / 2. 4.100 libswresample 0. 17.103 / 0. 17.103 libpostproc 52. 3.100 / 52. 3.100 Closing connection: NetStream.Play.Failed rtmp://185.13.90.110/vidlivestream/_definst_/stream/test: Unknown error occurred -- View this message in context: http://libav-users.943685.n4.nabble.com/Libav-user-can-t-decode-RTMP-stream-from-FMS-tp4658233p4658255.html Sent from the libav-users mailing list archive at Nabble.com. From cehoyos at ag.or.at Fri Jul 26 10:56:13 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Fri, 26 Jul 2013 08:56:13 +0000 (UTC) Subject: [Libav-user] can't decode RTMP stream from FMS References: <1374768955943-4658250.post@n4.nabble.com> <1374824264375-4658255.post@n4.nabble.com> Message-ID: mikeversteeg writes: > > I suggest you look at the configure lines. > Sorry, you lost me. Sorry, what is unclear about that? (Especially since the exact same question was asked - and answered - at the same time on ffmpeg-user) Please compare my configure line with the one you used. (Sorry if you felt offended by the rant I added, it was not meant specifically, but I am very often told that complete, uncut console output is unneeded and that I shouldn't care about other people's configure lines.) Carl Eugen From mike at mikeversteeg.com Fri Jul 26 13:55:38 2013 From: mike at mikeversteeg.com (mikeversteeg) Date: Fri, 26 Jul 2013 04:55:38 -0700 (PDT) Subject: [Libav-user] can't decode RTMP stream from FMS In-Reply-To: References: <1374768955943-4658250.post@n4.nabble.com> <1374824264375-4658255.post@n4.nabble.com> Message-ID: <1374839738808-4658257.post@n4.nabble.com> With 'configure" I assume you mean the build configuration? If so, I do not see how disabling inputs will help me solve the problem, nor do I want this as I use the libav* libraries for much more than this. So you still have not answered my question, while apparently you know the answer. This is a bit frustrating especially as I have no idea what it is you expect from me. I'll gladly pay you for assisting me in this. Please note to help you help me I am using a generic ffmpeg with all options enabled as made available through Zeranoe. I thought I also made all console output available to you, yet you insist on telling me I am forgetting these. Please explain to me what further I need to send you. You still lost me in this, possibly things are lost (no pun intended) in translation. I have been googling for days trying to find an answer to this but other than more people having the same problem, I have found nothing. If the answer is out there in this 'ffmpeg-user' can you at least provide a link? I'm pretty user you will be doing others a favour as well. Thanks. -- View this message in context: http://libav-users.943685.n4.nabble.com/Libav-user-can-t-decode-RTMP-stream-from-FMS-tp4658233p4658257.html Sent from the libav-users mailing list archive at Nabble.com. From cehoyos at ag.or.at Fri Jul 26 15:07:16 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Fri, 26 Jul 2013 13:07:16 +0000 (UTC) Subject: [Libav-user] can't decode RTMP stream from FMS References: <1374768955943-4658250.post@n4.nabble.com> <1374824264375-4658255.post@n4.nabble.com> <1374839738808-4658257.post@n4.nabble.com> Message-ID: mikeversteeg writes: > With 'configure" I assume you mean the build > configuration? If so, I do not see how disabling > inputs will help me solve the problem Then I really, really honestly cannot help you. Note that I did not want to imply at any point that you haven't given all necessary information (on the contrary). As said, I just wanted to point out how important this information was (while I am repeatedly asked why such information is necessary). [...] > If the answer is out there in this 'ffmpeg-user' > can you at least provide a link? http://thread.gmane.org/gmane.comp.video.ffmpeg.user/46779/focus=46824 Carl Eugen From cehoyos at ag.or.at Fri Jul 26 15:09:01 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Fri, 26 Jul 2013 13:09:01 +0000 (UTC) Subject: [Libav-user] can't decode RTMP stream from FMS References: <1374768955943-4658250.post@n4.nabble.com> <1374824264375-4658255.post@n4.nabble.com> <1374839738808-4658257.post@n4.nabble.com> Message-ID: Carl Eugen Hoyos writes: > > If the answer is out there in this 'ffmpeg-user' > > can you at least provide a link? > > http://thread.gmane.org/gmane.comp.video.ffmpeg.user/46779/focus=46824 Sorry, I apparently misread this message, it is probably unrelated. Sorry for the noise, Carl Eugen From jeanporcherot at yahoo.fr Fri Jul 26 15:59:07 2013 From: jeanporcherot at yahoo.fr (Jean Porcherot) Date: Fri, 26 Jul 2013 15:59:07 +0200 Subject: [Libav-user] Unable to correctly rewind a stream Message-ID: Hi everyone, Not sure I will be using this list correctly. Pardon me if I'm not (first time I try it). I'm working on a program to simply read a mp3 file. For some reason (optimization), I want to read the file by blocks (possibly non consecutive and I often move forward and backward). But I am unable to safely navigate through the file, I try to call av_seek_frame, but then, extracted data are incorrect. I could isolate the problem in a very basic sample program. This program opens a file, reads the audio stream (saves it to a vector of doubles), then calls av_seek_frame to move back to the beginning of the file and finally try to read it a second time (saving it to a new vector of doubles). The resulting two vectors of double are slighlty different..... If anyone sees what's wrong, this would help!!! Thanks Jean Here is the program: extern "C" { #include "libavformat/avformat.h" #include "libavutil/samplefmt.h" #include #include } #include #include #include #include AVFormatContext* container = NULL; AVCodecContext *ctx = NULL; int audio_stream = 0; bool open_audio_stream( char* file ) { bool bRes = false; av_register_all(); container = avformat_alloc_context(); AVCodec *codec = NULL; if ( avformat_open_input(&container,file,NULL,NULL) < 0 || av_find_stream_info(container) < 0 || (audio_stream = av_find_best_stream(container, AVMEDIA_TYPE_AUDIO, -1, -1, NULL, 0)) < 0 || (ctx = container->streams[audio_stream]->codec) == NULL || (codec = avcodec_find_decoder(ctx->codec_id)) == NULL || avcodec_open2( ctx, codec, NULL ) < 0 ) { std::cout << "Failed to open audio stream" << std::endl; return false; } else { return true; } } bool read_audio_stream( std::vector>& extracted ) { bool bRes = false; extracted.resize( ctx->channels ); // prepare container // read to read the file! AVPacket packet; av_init_packet( &packet ); packet.pos = 0; packet.data = NULL; packet.size = 0; AVFrame *frame = avcodec_alloc_frame(); int tempdatabuffer_size = 0; double* tempdatabuffer = NULL; struct SwrContext *swr_ctx; swr_ctx = swr_alloc(); if ( swr_ctx ) { // prepare object used for data conversion av_opt_set_int(swr_ctx, "in_channel_count", ctx->channels, 0); av_opt_set_int(swr_ctx, "in_channel_layout", ctx->channel_layout, 0); av_opt_set_int(swr_ctx, "in_sample_rate", ctx->sample_rate, 0); av_opt_set_sample_fmt(swr_ctx, "in_sample_fmt", ctx->sample_fmt, 0); av_opt_set_int(swr_ctx, "out_channel_layout", ctx->channel_layout, 0); av_opt_set_int(swr_ctx, "out_channel_count", ctx->channels, 0); av_opt_set_int(swr_ctx, "out_sample_rate", ctx->sample_rate, 0); av_opt_set_sample_fmt(swr_ctx, "out_sample_fmt", AV_SAMPLE_FMT_DBL, 0); if ( swr_init(swr_ctx) >= 0 ) { int tempdatabuffer_size = 0; double* tempdatabuffer = NULL; bRes = true; int frameFinished = 0; int sample = 0; while ( av_read_frame( container, &packet ) >= 0 && packet.stream_index == audio_stream ) { if ( avcodec_decode_audio4( ctx, frame, &frameFinished, &packet ) >= 0 ) { if ( frame->nb_samples*ctx->channels > tempdatabuffer_size ) { // update temp buffer, it's actually too small!! tempdatabuffer_size = frame->nb_samples*ctx->channels; if ( tempdatabuffer ) delete [] tempdatabuffer; tempdatabuffer = new double[tempdatabuffer_size]; } if ( swr_convert(swr_ctx, (uint8_t **)&tempdatabuffer, tempdatabuffer_size, (const uint8_t **)&(frame->data[0]), frame->nb_samples) ) { for ( sample = 0; sample != frame->nb_samples; ++sample ) { for ( int chan = 0; chan != ctx->channels; ++chan ) { extracted[chan].push_back( tempdatabuffer[sample*ctx->channels + chan] ); } } } } } if ( tempdatabuffer ) delete [] tempdatabuffer; } } swr_free(&swr_ctx); avcodec_free_frame( &frame ); return bRes; } int main(int argc, char **argv) { if ( argc == 2 ) { if ( open_audio_stream( argv[1] ) ) { std::vector> first_read; std::vector> second_read; if ( read_audio_stream( first_read ) ) { // rewind! av_seek_frame( container, audio_stream, 0, AVSEEK_FLAG_FRAME ); if ( read_audio_stream( second_read ) ) { if ( first_read.size() == second_read.size() ) { std::cout << "Comparing " << first_read.size() << " channels" << std::endl; for ( unsigned int chan = 0; chan != first_read.size(); ++chan ) { if ( first_read[chan].size() == second_read[chan].size() ) { std::cout << "Comparing " << first_read[chan].size() << " samples for channel " << chan << std::endl; for ( unsigned int sample = 0; sample != first_read[chan].size(); ++sample ) { if ( first_read[chan][sample] != second_read[chan][sample] ) { std::cout << "Different data found for sample " << sample << " of channel " << chan << std::endl; return 1; } } std::cout << "Results are equivalent!!!" << std::endl; return 0; } else { std::cout << "Did not find the same number of samples" << std::endl; } } } else { std::cout << "Did not find the same number of channels" << std::endl; } } av_close_input_file(container); } } return 1; } else { printf("usage: %s file\n", argv[0]); return 1; } } -------------- next part -------------- An HTML attachment was scrubbed... URL: From mike at mikeversteeg.com Fri Jul 26 18:02:55 2013 From: mike at mikeversteeg.com (mikeversteeg) Date: Fri, 26 Jul 2013 09:02:55 -0700 (PDT) Subject: [Libav-user] can't decode RTMP stream from FMS In-Reply-To: References: <1374768955943-4658250.post@n4.nabble.com> <1374824264375-4658255.post@n4.nabble.com> <1374839738808-4658257.post@n4.nabble.com> Message-ID: <1374854575216-4658261.post@n4.nabble.com> Carl Eugen Hoyos wrote > mikeversteeg <mike at ...> writes: > Then I really, really honestly cannot help you. OK, well thanks for trying. You did help a little bit in demonstrating there is apparently a bug in ffmpeg, where your specific build works and "full" builds don't. I hope whoever wrote the rtmp code reads this and is willing to fix it. This is beyond my scope, but I'm happy to make a donation for the team. Meanwhile if anyone else has a clue as to what's going on, and even better if there is a way around this bug, I'd be most grateful for your help. -- View this message in context: http://libav-users.943685.n4.nabble.com/Libav-user-can-t-decode-RTMP-stream-from-FMS-tp4658233p4658261.html Sent from the libav-users mailing list archive at Nabble.com. From onemda at gmail.com Fri Jul 26 18:33:35 2013 From: onemda at gmail.com (Paul B Mahol) Date: Fri, 26 Jul 2013 16:33:35 +0000 Subject: [Libav-user] can't decode RTMP stream from FMS In-Reply-To: <1374854575216-4658261.post@n4.nabble.com> References: <1374768955943-4658250.post@n4.nabble.com> <1374824264375-4658255.post@n4.nabble.com> <1374839738808-4658257.post@n4.nabble.com> <1374854575216-4658261.post@n4.nabble.com> Message-ID: On 7/26/13, mikeversteeg wrote: > Carl Eugen Hoyos wrote >> mikeversteeg <mike at ...> writes: >> Then I really, really honestly cannot help you. > > OK, well thanks for trying. You did help a little bit in demonstrating > there > is apparently a bug in ffmpeg, where your specific build works and "full" > builds don't. I hope whoever wrote the rtmp code reads this and is willing > to fix it. This is beyond my scope, but I'm happy to make a donation for > the > team. > > Meanwhile if anyone else has a clue as to what's going on, and even better > if there is a way around this bug, I'd be most grateful for your help. What about disabling native FFmpeg rtmp code? Assuming librtmp one works fine. From cehoyos at ag.or.at Fri Jul 26 19:50:49 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Fri, 26 Jul 2013 17:50:49 +0000 (UTC) Subject: [Libav-user] can't decode RTMP stream from FMS References: <1374768955943-4658250.post@n4.nabble.com> <1374824264375-4658255.post@n4.nabble.com> <1374839738808-4658257.post@n4.nabble.com> <1374854575216-4658261.post@n4.nabble.com> Message-ID: Paul B Mahol writes: > What about disabling native FFmpeg rtmp code? > Assuming librtmp one works fine. It's the other way 'round... Carl Eugen From cehoyos at ag.or.at Fri Jul 26 19:54:06 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Fri, 26 Jul 2013 17:54:06 +0000 (UTC) Subject: [Libav-user] can't decode RTMP stream from FMS References: <1374768955943-4658250.post@n4.nabble.com> <1374824264375-4658255.post@n4.nabble.com> <1374839738808-4658257.post@n4.nabble.com> <1374854575216-4658261.post@n4.nabble.com> Message-ID: mikeversteeg writes: > You did help a little bit in demonstrating there > is apparently a bug in ffmpeg, where your specific > build works and "full" builds don't. Why do you think so? Please test "./configure && make ffmpeg" or "./configure --enable-gpl && make ffmpeg" and report back. If it does not work for you, I will compile on Windows myself and test again but so far, you have only written that you "do not see how this helps" and sorry for my ignorance but that does not motivate me to boot Windows. Carl Eugen From night.rain.whisper at gmail.com Fri Jul 26 19:56:55 2013 From: night.rain.whisper at gmail.com (Sergey Fedorov) Date: Fri, 26 Jul 2013 21:56:55 +0400 Subject: [Libav-user] Different decoded frame number from ffmpeg commend line and the example demuxing In-Reply-To: References: Message-ID: ?-r[:stream_specifier] fps (input/output,per-stream)? Set frame rate (Hz value, fraction or abbreviation). As an input option, ignore any timestamps stored in the file and instead generate timestamps assuming constant frame rate fps. As an output option, duplicate or drop input frames to achieve constant output frame rate fps. 2013/7/23 Liang Zhang : > Hello, > > I'm learning how to use libav to decode the video data into YUV. I try to > use ffmpeg commend line and also use the example program "demuxing" which is > provided in ffmpeg documentation. It surprised me that both resulted in > different frame number. > > I use the following ffmpeg commend line > > ffmpeg -y -i sample.mp4 -an -r 24 -pix_fmt rgb24 -vcodec tiff tif/%06d.tif > > to decode one video data file and get, e.g., 1460 frames. > > Then, I used the example program "demuxing" > > demuxing sample.mp4 out_video out_audio > > to decode the same file and I got 1821 frames. > > Can someone help me explain why the frame number is different with these two > methods? > > FYI, I run the program in Ubuntu operating system. > > Thanks, > > > > liang > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > From liazhang2000 at gmail.com Fri Jul 26 20:09:35 2013 From: liazhang2000 at gmail.com (Liang Zhang) Date: Fri, 26 Jul 2013 14:09:35 -0400 Subject: [Libav-user] Different decoded frame number from ffmpeg commend line and the example demuxing In-Reply-To: References: Message-ID: Thanks a lot, Sergey! I got it. On Fri, Jul 26, 2013 at 1:56 PM, Sergey Fedorov < night.rain.whisper at gmail.com> wrote: > ?-r[:stream_specifier] fps (input/output,per-stream)? > > Set frame rate (Hz value, fraction or abbreviation). > > As an input option, ignore any timestamps stored in the file and > instead generate timestamps assuming constant frame rate fps. > > As an output option, duplicate or drop input frames to achieve > constant output frame rate fps. > > > 2013/7/23 Liang Zhang : > > Hello, > > > > I'm learning how to use libav to decode the video data into YUV. I try to > > use ffmpeg commend line and also use the example program "demuxing" > which is > > provided in ffmpeg documentation. It surprised me that both resulted in > > different frame number. > > > > I use the following ffmpeg commend line > > > > ffmpeg -y -i sample.mp4 -an -r 24 -pix_fmt rgb24 -vcodec tiff > tif/%06d.tif > > > > to decode one video data file and get, e.g., 1460 frames. > > > > Then, I used the example program "demuxing" > > > > demuxing sample.mp4 out_video out_audio > > > > to decode the same file and I got 1821 frames. > > > > Can someone help me explain why the frame number is different with these > two > > methods? > > > > FYI, I run the program in Ubuntu operating system. > > > > Thanks, > > > > > > > > liang > > > > _______________________________________________ > > Libav-user mailing list > > Libav-user at ffmpeg.org > > http://ffmpeg.org/mailman/listinfo/libav-user > > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jason.cipriani at gmail.com Fri Jul 26 20:13:53 2013 From: jason.cipriani at gmail.com (Jason Cipriani) Date: Fri, 26 Jul 2013 14:13:53 -0400 Subject: [Libav-user] Some input files decoded upside down. In-Reply-To: References: Message-ID: On Tue, Jul 23, 2013 at 12:52 PM, Jason Cipriani wrote: > Hello, > > I'm learning how to use libav. I'm following the tutorial at > http://dranger.com/ffmpeg/tutorial01.html and have been able to read > files, decode them, and save each frame to an image just fine. However, > certain input files lead to the frames being decoded upside down (the input > files play correctly in, say, mplayer). > > I have one input file that uses a rawvideo codec. This is decoded upside > down. I have another input file that uses h264, this is decoded in the > correct orientation. > > My question is, is there a flag in some *Context somewhere that indicates > that the video frames are bottom-up, so that I can flip vertically if > necessary when processing the frames after decoding? > > Also, then, it's easy enough for me to process an image upside down if > necessary, but can sws_scale (or something similar) flip an image > vertically so I can do the flip and RGB conversion all in one step? > > Thanks! > Jason > Sorry to be a bother, but does anybody have any insight into this? Thanks! Jason -------------- next part -------------- An HTML attachment was scrubbed... URL: From alexcohn at netvision.net.il Fri Jul 26 20:40:25 2013 From: alexcohn at netvision.net.il (Alex Cohn) Date: Fri, 26 Jul 2013 21:40:25 +0300 Subject: [Libav-user] Some input files decoded upside down. In-Reply-To: References: Message-ID: On Jul 23, 2013 7:52 PM, "Jason Cipriani" wrote: > > Hello, > > I'm learning how to use libav. I'm following the tutorial at http://dranger.com/ffmpeg/tutorial01.html and have been able to read files, decode them, and save each frame to an image just fine. However, certain input files lead to the frames being decoded upside down (the input files play correctly in, say, mplayer). > > I have one input file that uses a rawvideo codec. This is decoded upside down. I have another input file that uses h264, this is decoded in the correct orientation. > > My question is, is there a flag in some *Context somewhere that indicates that the video frames are bottom-up, so that I can flip vertically if necessary when processing the frames after decoding? > > Also, then, it's easy enough for me to process an image upside down if necessary, but can sws_scale (or something similar) flip an image vertically so I can do the flip and RGB conversion all in one step? > > Thanks! > Jason Yes, you can perform flip and color conversion in one step with sws_scale. You can find the answer in this thread: http://ffmpeg-users.933282.n4.nabble.com/Flip-in-sws-scale-td939665.html BR, Alex -------------- next part -------------- An HTML attachment was scrubbed... URL: From jason.cipriani at gmail.com Fri Jul 26 20:52:45 2013 From: jason.cipriani at gmail.com (Jason Cipriani) Date: Fri, 26 Jul 2013 14:52:45 -0400 Subject: [Libav-user] Some input files decoded upside down. In-Reply-To: References: Message-ID: On Fri, Jul 26, 2013 at 2:40 PM, Alex Cohn wrote: > On Jul 23, 2013 7:52 PM, "Jason Cipriani" > wrote: > > > > Hello, > > > > I'm learning how to use libav. I'm following the tutorial at > http://dranger.com/ffmpeg/tutorial01.html and have been able to read > files, decode them, and save each frame to an image just fine. However, > certain input files lead to the frames being decoded upside down (the input > files play correctly in, say, mplayer). > > > > I have one input file that uses a rawvideo codec. This is decoded upside > down. I have another input file that uses h264, this is decoded in the > correct orientation. > > > > My question is, is there a flag in some *Context somewhere that > indicates that the video frames are bottom-up, so that I can flip > vertically if necessary when processing the frames after decoding? > > > > Also, then, it's easy enough for me to process an image upside down if > necessary, but can sws_scale (or something similar) flip an image > vertically so I can do the flip and RGB conversion all in one step? > > > > Thanks! > > Jason > > Yes, you can perform flip and color conversion in one step with sws_scale. > You can find the answer in this thread: > http://ffmpeg-users.933282.n4.nabble.com/Flip-in-sws-scale-td939665.html > > BR, > Alex > > Thanks! That answers my sws_scale question. My remaining problem is: How can I tell if the video needs to be flipped vertically or not? Is there a flag in one of the context structures somewhere? I have some input files that end up vertically flipped, and some that do not, but I'm sure the information exists somewhere because when I play those files in media players, the players are able to play them all in the correct orientation. Thanks again for your time, Jason -------------- next part -------------- An HTML attachment was scrubbed... URL: From alexcohn at netvision.net.il Fri Jul 26 21:01:58 2013 From: alexcohn at netvision.net.il (Alex Cohn) Date: Fri, 26 Jul 2013 22:01:58 +0300 Subject: [Libav-user] Some input files decoded upside down. In-Reply-To: References: Message-ID: On Jul 26, 2013 9:53 PM, "Jason Cipriani" wrote: > > On Fri, Jul 26, 2013 at 2:40 PM, Alex Cohn wrote: >> >> On Jul 23, 2013 7:52 PM, "Jason Cipriani" wrote: >> > >> > Hello, >> > >> > I'm learning how to use libav. I'm following the tutorial at http://dranger.com/ffmpeg/tutorial01.html and have been able to read files, decode them, and save each frame to an image just fine. However, certain input files lead to the frames being decoded upside down (the input files play correctly in, say, mplayer). >> > >> > I have one input file that uses a rawvideo codec. This is decoded upside down. I have another input file that uses h264, this is decoded in the correct orientation. >> > >> > My question is, is there a flag in some *Context somewhere that indicates that the video frames are bottom-up, so that I can flip vertically if necessary when processing the frames after decoding? >> > >> > Also, then, it's easy enough for me to process an image upside down if necessary, but can sws_scale (or something similar) flip an image vertically so I can do the flip and RGB conversion all in one step? >> > >> > Thanks! >> > Jason >> >> Yes, you can perform flip and color conversion in one step with sws_scale. You can find the answer in this thread: http://ffmpeg-users.933282.n4.nabble.com/Flip-in-sws-scale-td939665.html >> >> BR, >> Alex >> >> > > > Thanks! That answers my sws_scale question. > > My remaining problem is: How can I tell if the video needs to be flipped vertically or not? Is there a flag in one of the context structures somewhere? I have some input files that end up vertically flipped, and some that do not, but I'm sure the information exists somewhere because when I play those files in media players, the players are able to play them all in the correct orientation. > > Thanks again for your time, > Jason I don't think there may be such info for rawvideo codec. I bet you don't really need to worry about this for "true" codecs. As for players that handle this file correctly - please check if there are dome command line parameters that control the flip, but maybe the player applies some heuristics to row video. BR, Alex -------------- next part -------------- An HTML attachment was scrubbed... URL: From aaronmgoldstein at gmail.com Fri Jul 26 21:52:31 2013 From: aaronmgoldstein at gmail.com (Aaron Goldstein) Date: Fri, 26 Jul 2013 12:52:31 -0700 Subject: [Libav-user] Using Libav to Create an RTSP Stream In-Reply-To: References: Message-ID: I don't mean to be a bother to everyone, but does anyone have a recommendation for this? Thank you, Aaron On Mon, Jul 8, 2013 at 2:09 AM, Steve Hart wrote: > > > On 8 July 2013 09:23, Gyula Hataly?k wrote: > >> I am also interested! >> >> >> On Mon, Jul 8, 2013 at 9:48 AM, Aaron Goldstein < >> aaronmgoldstein at gmail.com> wrote: >> >>> Hi Everyone, >>> >>> I apologize if this is a dumb question, but I've been looking around for >>> a couple days now for an example of using the libav* libraries to stream a >>> video file across a network via the RTSP protocol. I've had this capability >>> working by using ffmpeg to stream to an ffserver (which then would stream >>> to anyone who requested), but I'd like to 1.) do this in a single >>> application, and more importantly to me 2.) learn how to do it. >>> >>> I know I can just look in the ffmpeg source code, but it's my last >>> resort - does anyone have any recommendations for how to do this? or any >>> learning material you've come across on this topic? >>> >>> Thank you for your time. >>> >>> Regards, >>> >>> Aaron >>> >>> >>> _______________________________________________ >>> Libav-user mailing list >>> Libav-user at ffmpeg.org >>> http://ffmpeg.org/mailman/listinfo/libav-user >>> >>> >> >> _______________________________________________ >> Libav-user mailing list >> Libav-user at ffmpeg.org >> http://ffmpeg.org/mailman/listinfo/libav-user >> >> > Me too! > I am particularly interested in low latency..... > > > _______________________________________________ > 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 donmoir at comcast.net Sat Jul 27 00:22:57 2013 From: donmoir at comcast.net (Don Moir) Date: Fri, 26 Jul 2013 18:22:57 -0400 Subject: [Libav-user] Some input files decoded upside down. References: Message-ID: <69B8E2DFCCD14301B8E35DAC656B8AAB@MANLAP> ----- Original Message ----- From: Alex Cohn To: This list is about using libavcodec, libavformat,libavutil libavdevice and libavfilter. Sent: Friday, July 26, 2013 3:01 PM Subject: Re: [Libav-user] Some input files decoded upside down. On Jul 26, 2013 9:53 PM, "Jason Cipriani" wrote: > > On Fri, Jul 26, 2013 at 2:40 PM, Alex Cohn wrote: >> >> On Jul 23, 2013 7:52 PM, "Jason Cipriani" wrote: >> > >> > Hello, >> > >> > I'm learning how to use libav. I'm following the tutorial at http://dranger.com/ffmpeg/tutorial01.html and have been able to read files, decode them, and save each frame to an image just fine. However, certain input files lead to the frames being decoded upside down (the input files play correctly in, say, mplayer). >> > >> > I have one input file that uses a rawvideo codec. This is decoded upside down. I have another input file that uses h264, this is decoded in the correct orientation. >> > >> > My question is, is there a flag in some *Context somewhere that indicates that the video frames are bottom-up, so that I can flip vertically if necessary when processing the frames after decoding? >> > >> > Also, then, it's easy enough for me to process an image upside down if necessary, but can sws_scale (or something similar) flip an image vertically so I can do the flip and RGB conversion all in one step? >> > >> > Thanks! >> > Jason >> >> Yes, you can perform flip and color conversion in one step with sws_scale. You can find the answer in this thread: http://ffmpeg-users.933282.n4.nabble.com/Flip-in-sws-scale-td939665.html >> >> BR, >> Alex >> >> > > > Thanks! That answers my sws_scale question. > > My remaining problem is: How can I tell if the video needs to be flipped vertically or not? Is there a flag in one of the context structures somewhere? I have some input files that end up vertically flipped, and some that do not, but I'm sure the information exists somewhere because when I play those files in media players, the players are able to play them all in the correct orientation. > > Thanks again for your time, > Jason The linesize [] parameter should contain a negative value indicating image is flipped -------------- next part -------------- An HTML attachment was scrubbed... URL: From ggarra13 at gmail.com Sat Jul 27 00:44:15 2013 From: ggarra13 at gmail.com (Gonzalo Garramuno) Date: Fri, 26 Jul 2013 19:44:15 -0300 Subject: [Libav-user] AC3 encoding not in sync with video, PCM_16LE works okay Message-ID: <51F2FBBF.7080600@gmail.com> I have coded an encoder in my viewer that writes out new movie files. My problem is trying to use AC3 as the audio codec. When I use it, the files created are out of sync (audio plays much faster). When I write out the movie using the PCM_16LE codec, all is fine (but of course, I don't have a float output). The problem is not present in ffmpeg, only in my viewer. My guess is that I need to set the pts/dts of the encoded audio frames and I am failing to do so. Any help is appreciated. From mike at mikeversteeg.com Sat Jul 27 13:58:04 2013 From: mike at mikeversteeg.com (mikeversteeg) Date: Sat, 27 Jul 2013 04:58:04 -0700 (PDT) Subject: [Libav-user] can't decode RTMP stream from FMS In-Reply-To: References: <1374768955943-4658250.post@n4.nabble.com> <1374824264375-4658255.post@n4.nabble.com> <1374839738808-4658257.post@n4.nabble.com> <1374854575216-4658261.post@n4.nabble.com> Message-ID: <1374926284041-4658274.post@n4.nabble.com> Paul B Mahol wrote > What about disabling native FFmpeg rtmp code? Assuming librtmp one works > fine. Thanks for helping Paul. It looks like it is the other way around (unless it's a Windows only bug), but I cannot simply remove librtmp as a lot of other code depends on it. Do you know if it is possible to use both side by side? I.e. have one function use the default decoder (librtmp in my case) and another the internal? I could then use the internal decoder for FMS only, provided it works well. Frankly I am at a complete loss why two pieces of code exist doing the same stuff, you'd expect they'd be merged into one that does everything well. -- View this message in context: http://libav-users.943685.n4.nabble.com/Libav-user-can-t-decode-RTMP-stream-from-FMS-tp4658233p4658274.html Sent from the libav-users mailing list archive at Nabble.com. From onemda at gmail.com Sat Jul 27 14:48:41 2013 From: onemda at gmail.com (Paul B Mahol) Date: Sat, 27 Jul 2013 12:48:41 +0000 Subject: [Libav-user] can't decode RTMP stream from FMS In-Reply-To: References: <1374768955943-4658250.post@n4.nabble.com> <1374824264375-4658255.post@n4.nabble.com> <1374839738808-4658257.post@n4.nabble.com> <1374854575216-4658261.post@n4.nabble.com> Message-ID: On 7/26/13, Carl Eugen Hoyos wrote: > Paul B Mahol writes: > >> What about disabling native FFmpeg rtmp code? >> Assuming librtmp one works fine. > > It's the other way 'round... Really? AFAIK currently if you have librtmp protocols enabled at same time as native ones, only native ones can be used. > > Carl Eugen > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > From cehoyos at ag.or.at Sat Jul 27 15:20:33 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Sat, 27 Jul 2013 13:20:33 +0000 (UTC) Subject: [Libav-user] can't decode RTMP stream from FMS References: <1374768955943-4658250.post@n4.nabble.com> <1374824264375-4658255.post@n4.nabble.com> <1374839738808-4658257.post@n4.nabble.com> <1374854575216-4658261.post@n4.nabble.com> Message-ID: Paul B Mahol writes: > On 7/26/13, Carl Eugen Hoyos wrote: > > Paul B Mahol ...> writes: > > > >> What about disabling native FFmpeg rtmp code? > >> Assuming librtmp one works fine. > > > > It's the other way 'round... > > Really? This is what I suspect. If Mike started actual testing, we would all know for sure. Carl Eugen From liazhang2000 at gmail.com Sat Jul 27 18:35:36 2013 From: liazhang2000 at gmail.com (Liang Zhang) Date: Sat, 27 Jul 2013 12:35:36 -0400 Subject: [Libav-user] sample_fmt_entry Message-ID: Hello, I tested the example program of demuxing for decoding audio signals and have received the information regarding "unsupported audio format for ftlp" when the input data has the extension of mp4. I checked the program and found that the example function (int get_format_from_sample_fmt ) only declare the sample format as follows: struct sample_fmt_entry { enum AVSampleFormat sample_fmt; const char *fmt_be, *fmt_le; } sample_fmt_entries[] = { { AV_SAMPLE_FMT_U8, "u8", "u8" }, { AV_SAMPLE_FMT_S16, "s16be", "s16le" }, { AV_SAMPLE_FMT_S32, "s32be", "s32le" }, { AV_SAMPLE_FMT_FLT, "f32be", "f32le" }, { AV_SAMPLE_FMT_DBL, "f64be", "f64le" }, } However, ffmpeg also support other sample type that I listed as follows: { AV_SAMPLE_FMT_S16, "s16be", "s16le" }, { AV_SAMPLE_FMT_S32, "s32be", "s32le" }, { AV_SAMPLE_FMT_FLT, "f32be", "f32le" }, { AV_SAMPLE_FMT_DBL, "f64be", "f64le" }, { AV_SAMPLE_FMT_U8P, "?", "?" }, { AV_SAMPLE_FMT_S16P, "?", "?" }, { AV_SAMPLE_FMT_S32P, "?", "?" }, { AV_SAMPLE_FMT_FLTP, "?", "?" }, { AV_SAMPLE_FMT_DBLP, "?", "?" }, { AV_SAMPLE_FMT_NB, "?", "?" }, To extend the sample_fmt_entries[] in the function (int get_format_from_sample_fmt ) to include other sample ypes, what should I fill in for the items of fmt_be and fmt_le as indicated using question marks? As my understand, the information fmt_be and fmt_le are needed for ffplay command line to replay the decoded audio samples. Thanks for the help in advance, Liang -------------- next part -------------- An HTML attachment was scrubbed... URL: From adishavit at gmail.com Sun Jul 28 12:55:50 2013 From: adishavit at gmail.com (Adi Shavit) Date: Sun, 28 Jul 2013 13:55:50 +0300 Subject: [Libav-user] Reducing the Frame-Rate of a Network Video Stream Message-ID: Hi, I have a network video stream that I am decoding with the ffmpeg C library. I'd like to reduce the maximal frame rate to some maximum, say 15 fps. I used the filter fps=fps=15, but even on a 25 fps video stream this caused frame duplication. I presume this was due to network delays. Is there some way to reduce the maximal frame-rate but avoid frame duplication and just get delays instead? Thanks, Adi PS. reposted from here: From tariqul.isha at gmail.com Sun Jul 28 13:05:52 2013 From: tariqul.isha at gmail.com (Tariqul Islam) Date: Sun, 28 Jul 2013 17:05:52 +0600 Subject: [Libav-user] Encoding from file Message-ID: Hello, I am new to ffmpeg coding. In ffmpeg source code, encoding decoding example is given in encoding_decoding.c. In this file while working with audio, a raw audio is created, then encoded, then decoded into a c file. What i am trying to do is to read from that C file, encode and thus reconstruct the previous audio file. But i am getting noise. Following Mr. Tusher's advice, i used exact code of encoding_decoding.c and decoded a mp2 file (Could not answer to that thread because subscribed after he answered. Sorry Mr. Tusher). But playing that decoded file, i am getting previous sound with heavy noise. Can anybody tell me what is the reason of it? To decode an audio file (mp2), is there any tutorial that i can follow??? Regrads, Tariqul islam -------------- next part -------------- An HTML attachment was scrubbed... URL: From alexcohn at netvision.net.il Sun Jul 28 14:09:11 2013 From: alexcohn at netvision.net.il (Alex Cohn) Date: Sun, 28 Jul 2013 15:09:11 +0300 Subject: [Libav-user] Reducing the Frame-Rate of a Network Video Stream In-Reply-To: References: Message-ID: On Jul 28, 2013 1:56 PM, "Adi Shavit" wrote: > > Hi, > > I have a network video stream that I am decoding with the ffmpeg C library. > I'd like to reduce the maximal frame rate to some maximum, say 15 fps. > I used the filter fps=fps=15, but even on a 25 fps video stream this > caused frame duplication. I presume this was due to network delays. > > Is there some way to reduce the maximal frame-rate but avoid frame > duplication and just get delays instead? > > Thanks, > Adi > > PS. reposted from here: Are you using the libraries in your own program, or looking for the correct parameters for ffmpeg executable? In the latter case, the ffmpeg-user list should be the preferred choice. Alex Cohn -------------- next part -------------- An HTML attachment was scrubbed... URL: From adishavit at gmail.com Sun Jul 28 15:28:10 2013 From: adishavit at gmail.com (Adi Shavit) Date: Sun, 28 Jul 2013 16:28:10 +0300 Subject: [Libav-user] Reducing the Frame-Rate of a Network Video Stream In-Reply-To: References: Message-ID: In my program. I'm passing the resizing string as an argument to avfilter_graph_parse. On Sun, Jul 28, 2013 at 3:09 PM, Alex Cohn wrote: > On Jul 28, 2013 1:56 PM, "Adi Shavit" wrote: >> >> Hi, >> >> I have a network video stream that I am decoding with the ffmpeg C >> library. >> I'd like to reduce the maximal frame rate to some maximum, say 15 fps. >> I used the filter fps=fps=15, but even on a 25 fps video stream this >> caused frame duplication. I presume this was due to network delays. >> >> Is there some way to reduce the maximal frame-rate but avoid frame >> duplication and just get delays instead? >> >> Thanks, >> Adi >> >> PS. reposted from here: >> > > Are you using the libraries in your own program, or looking for the correct > parameters for ffmpeg executable? In the latter case, the ffmpeg-user list > should be the preferred choice. > > Alex Cohn > > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > From alexcohn at netvision.net.il Sun Jul 28 16:03:26 2013 From: alexcohn at netvision.net.il (Alex Cohn) Date: Sun, 28 Jul 2013 17:03:26 +0300 Subject: [Libav-user] Reducing the Frame-Rate of a Network Video Stream In-Reply-To: References: Message-ID: On Sun, Jul 28, 2013 at 4:28 PM, Adi Shavit wrote: > On Sun, Jul 28, 2013 at 3:09 PM, Alex Cohn wrote: >> On Jul 28, 2013 1:56 PM, "Adi Shavit" wrote: >>> >>> Hi, >>> >>> I have a network video stream that I am decoding with the ffmpeg C >>> library. >>> I'd like to reduce the maximal frame rate to some maximum, say 15 fps. >>> I used the filter fps=fps=15, but even on a 25 fps video stream this >>> caused frame duplication. I presume this was due to network delays. >>> >>> Is there some way to reduce the maximal frame-rate but avoid frame >>> duplication and just get delays instead? >>> >>> Thanks, >>> Adi >>> >>> PS. reposted from here: >>> >> >> Are you using the libraries in your own program, or looking for the correct >> parameters for ffmpeg executable? In the latter case, the ffmpeg-user list >> should be the preferred choice. >> >> Alex Cohn > In my program. > I'm passing the resizing string as an argument to avfilter_graph_parse. Then you don't need avfilter, IMHO. When you receive a decoded frame from avcodec, simply check if the last frame was received more than 40 ms ago. BR, Alex Cohn From adishavit at gmail.com Sun Jul 28 16:57:07 2013 From: adishavit at gmail.com (Adi Shavit) Date: Sun, 28 Jul 2013 17:57:07 +0300 Subject: [Libav-user] "Circular buffer overrun" error when reading UDP stream Message-ID: Hi, I'm decoding a UDP stream and getting "Circular buffer overrun. To avoid, increase fifo_size URL option. To survive in such case, use overrun_nonfatal option". How exactly do I : 1. "increase fifo_size URL option. " 2. "use overrun_nonfatal option". I couldn't find this is the docs. Thanks, Adi From adishavit at gmail.com Sun Jul 28 17:16:16 2013 From: adishavit at gmail.com (Adi Shavit) Date: Sun, 28 Jul 2013 18:16:16 +0300 Subject: [Libav-user] Reducing the Frame-Rate of a Network Video Stream In-Reply-To: References: Message-ID: >>>> I have a network video stream that I am decoding with the ffmpeg C >>>> library. >>>> I'd like to reduce the maximal frame rate to some maximum, say 15 fps. >>>> I used the filter fps=fps=15, but even on a 25 fps video stream this >>>> caused frame duplication. I presume this was due to network delays. >>>> >>>> Is there some way to reduce the maximal frame-rate but avoid frame >>>> duplication and just get delays instead? >>>> > >> In my program. >> I'm passing the resizing string as an argument to avfilter_graph_parse. > > Then you don't need avfilter, IMHO. When you receive a decoded frame > from avcodec, simply check if the last frame was received more than 40 > ms ago. > OK. I'll try it this way. Thanks, Adi From alexcohn at netvision.net.il Sun Jul 28 19:39:23 2013 From: alexcohn at netvision.net.il (Alex Cohn) Date: Sun, 28 Jul 2013 20:39:23 +0300 Subject: [Libav-user] "Circular buffer overrun" error when reading UDP stream In-Reply-To: References: Message-ID: On Sun, Jul 28, 2013 at 5:57 PM, Adi Shavit wrote: > Hi, > > I'm decoding a UDP stream and getting "Circular buffer overrun. To > avoid, increase fifo_size URL option. To survive in such case, use > overrun_nonfatal option". > How exactly do I : > > 1. "increase fifo_size URL option. " > 2. "use overrun_nonfatal option". > > I couldn't find this is the docs. > Thanks, > Adi See http://ffmpeg.gusari.org/viewtopic.php?f=12&t=624. For ffmpeg command line, you can specify the UDP buffer size in the URL, e.g. udp://localhost:5002?fifo_size=1000000. Buy if you get this message because you followed my advice about max 15 FPS, you are doing something wrong on your side: you should pull the buffers faster. Did you add a sleep in the decoder loop? If your client is at 100% CPU utilization, faster settings for h264 decoder may help. The only "legitimate" case when increase of the fifo size may really be the correct solution, is a slow, unreliable network. In such case, UDP packets may arrive significantly out of order, and nothing but fifo size will compensate that. Note that overrun_nonfatal will break the video output. If the network is very bad, and you have IDR frames sent often enough, or if you use an intra-refresh stream. BR, Alex Cohn From alexcohn at netvision.net.il Sun Jul 28 23:08:49 2013 From: alexcohn at netvision.net.il (Alex Cohn) Date: Mon, 29 Jul 2013 00:08:49 +0300 Subject: [Libav-user] Problem Encoding H264 Video In-Reply-To: References: Message-ID: On Jul 23, 2013 11:54 AM, "Marika Marszalkowski" wrote: > > I should have added that oformat->video_codec is AV_CODEC_ID_H264, of course. > > Best, > Marika > > > On Mon, Jul 22, 2013 at 8:00 PM, Marika Marszalkowski wrote: >> >> Hello everyone, >> >> I have been trying to create an encoded h264 Video from multiple images (QImage), but I can't really achieve this. >> >> This list is my last resort and I totally hope there is someone out there who can help me with this not as complicated problem. I am not sure what the exact problem is - the video is created, but it is kind of jumpy, so that an image is shown and it stays there for two second and then there is a very short sequence (like half a second) and it's not moving again. Also the first 40 encoded frames, return 0 (SUCCESS) but got_packet_ptr is 0. >> >> So this is how I create the video with its header: >> >> AVCodec *codec = avcodec_find_encoder(oformat->video_codec); >> >> >> m_codecContext = avcodec_alloc_context3(codec); >> >> m_codecContext->gop_size = 30; >> >> m_codecContext->sample_fmt = AV_SAMPLE_FMT_NONE; >> >> m_codecContext->bit_rate = width * height; >> >> m_codecContext->width = width; >> >> m_codecContext->height = height; >> >> m_codecContext->time_base = (AVRational){1,frameRate}; >> >> m_codecContext->pix_fmt = AV_PIX_FMT_YUV420P; >> >> >> formatCtx = avformat_alloc_context(); >> >> if(!formatCtx) >> >> { >> >> printf("Error allocating format context\n"); >> >> } >> >> formatCtx->oformat = oformat; >> >> formatCtx->video_codec_id = oformat->video_codec; >> >> snprintf(formatCtx->filename, sizeof(formatCtx->filename), "%s", outputFileName.toStdString().c_str()); >> >> >> AVStream *videoStream = av_new_stream(formatCtx, 0); >> >> if(!videoStream) >> >> { >> >> printf("Could not allocate stream\n"); >> >> } >> >> videoStream->codec = m_codecContext; >> >> >> if(formatCtx->oformat->flags & AVFMT_GLOBALHEADER) >> >> { >> >> m_codecContext->flags |= CODEC_FLAG_GLOBAL_HEADER; >> >> } >> >> >> avcodec_open2(m_codecContext, codec, NULL); >> >> avio_open(&formatCtx->pb, outputFileName.toStdString().c_str(), AVIO_FLAG_WRITE); >> >> avformat_write_header(formatCtx, NULL); >> >> >> >> and this is how I add the frames: >> >> >> >> >> AVFrame *frame = avcodec_alloc_frame(); >> >> int size = m_codecContext->width * m_codecContext->height; >> >> int numBytes = avpicture_get_size(m_codecContext->pix_fmt, m_codecContext->width, m_codecContext->height); >> >> >> QSharedPointer img = imageData; >> >> >> uint8_t *outbuf = (uint8_t *)malloc(numBytes); >> >> uint8_t *picture_buf = (uint8_t *)av_malloc(numBytes); >> >> >> if (true) >> >> { >> >> int ret = av_image_fill_arrays(frame->data, frame->linesize, picture_buf, m_codecContext->pix_fmt, m_codecContext->width, m_codecContext->height, 1); >> >> >> frame->data[0] = picture_buf; >> >> frame->data[1] = frame->data[0] + size; >> >> frame->data[2] = frame->data[1] + size/4; >> >> frame->linesize[0] = m_codecContext->width; >> >> frame->linesize[1] = m_codecContext->width/2; >> >> frame->linesize[2] = m_codecContext->width/2; >> >> >> fflush(stdout); >> >> for (int y = 0; y < m_codecContext->height; y++) >> >> { >> >> for (int x = 0; x < m_codecContext->width; x++) >> >> { >> >> unsigned char b = img->bits()[(y * m_codecContext->width + x) * 4 + 0]; >> >> unsigned char g = img->bits()[(y * m_codecContext->width + x) * 4 + 1]; >> >> unsigned char r = img->bits()[(y * m_codecContext->width + x) * 4 + 2]; >> >> >> unsigned char Y = (0.257 * r) + (0.504 * g) + (0.098 * b) + 16; >> >> >> frame->data[0][y * frame->linesize[0] + x] = Y; >> >> >> if (y % 2 == 0 && x % 2 == 0) >> >> { >> >> unsigned char V = (0.439 * r) - (0.368 * g) - (0.071 * b) + 128; >> >> unsigned char U = -(0.148 * r) - (0.291 * g) + (0.439 * b) + 128; >> >> >> frame->data[1][y/2 * frame->linesize[1] + x/2] = U; >> >> frame->data[2][y/2 * frame->linesize[2] + x/2] = V; >> >> } >> >> } >> >> } >> >> int pts = (1.0 / 30.0) * 9000.0 * frameIndex; >> >> frame->pts = pts; >> >> >> int got_packet_ptr; >> >> >> AVPacket packet; >> >> av_init_packet(&packet); >> >> packet.data = outbuf; >> >> packet.size = numBytes; >> >> packet.stream_index = formatCtx->streams[0]->index; >> >> packet.flags |= AV_PKT_FLAG_KEY; >> >> packet.pts = packet.dts = pts; >> >> >> m_codecContext->coded_frame->pts = pts; >> >> >> ret = avcodec_encode_video2(m_codecContext, &packet, frame, &got_packet_ptr); >> >> >> >> if (got_packet_ptr != 0) >> >> { >> >> m_codecContext->coded_frame->pts = pts; >> >> >> if (m_codecContext->coded_frame->pts != (0x8000000000000000LL)) >> >> pts = av_rescale_q(m_codecContext->coded_frame->pts, m_codecContext->time_base, formatCtx->streams[0]->time_base); >> >> >> packet.pts = pts; >> >> >> if(m_codecContext->coded_frame->key_frame) >> >> { >> >> packet.flags |= AV_PKT_FLAG_KEY; >> >> } >> >> >> >> std::cout << "pts: " << packet.pts << ", dts: " << packet.dts << std::endl; >> >> >> av_interleaved_write_frame(formatCtx, &packet); >> >> av_free_packet(&packet); >> >> } >> >> } >> >> >> free(picture_buf); >> >> free(outbuf); >> >> av_free(frame); >> >> >> >> and of course in the end: >> >> >> av_write_trailer(formatCtx); >> >> fclose(m_file); >> >> avcodec_close(m_codecContext); >> >> av_free(m_codecContext); >> >> >> >> I think this has something to do with the PTS/DTS values. PTS values start at 120 (as the first 40 frames are omitted) and are increased by 3 ((1.0 / 30.0) * 9000.0 * frameIndex) and the DTS values start at -6 also being increased by 3 per frame. But it might also be the settings or anything else. I feel like I have tried everything I was able to find on the internet and it's still wrong. I am desperate, help would be soooo appreciated! >> >> >> Cheers, >> >> Marika What is your output format? Alex -------------- next part -------------- An HTML attachment was scrubbed... URL: From marikaner at gmail.com Mon Jul 29 08:53:48 2013 From: marikaner at gmail.com (Marika Marszalkowski) Date: Mon, 29 Jul 2013 08:53:48 +0200 Subject: [Libav-user] Problem Encoding H264 Video In-Reply-To: References: Message-ID: It is .mkv. Sent from my iPhone On 28.07.2013, at 23:08, Alex Cohn wrote: > On Jul 23, 2013 11:54 AM, "Marika Marszalkowski" wrote: > > > > I should have added that oformat->video_codec is AV_CODEC_ID_H264, of course. > > > > Best, > > Marika > > > > > > On Mon, Jul 22, 2013 at 8:00 PM, Marika Marszalkowski wrote: > >> > >> Hello everyone, > >> > >> I have been trying to create an encoded h264 Video from multiple images (QImage), but I can't really achieve this. > >> > >> This list is my last resort and I totally hope there is someone out there who can help me with this not as complicated problem. I am not sure what the exact problem is - the video is created, but it is kind of jumpy, so that an image is shown and it stays there for two second and then there is a very short sequence (like half a second) and it's not moving again. Also the first 40 encoded frames, return 0 (SUCCESS) but got_packet_ptr is 0. > >> > >> So this is how I create the video with its header: > >> > >> AVCodec *codec = avcodec_find_encoder(oformat->video_codec); > >> > >> > >> m_codecContext = avcodec_alloc_context3(codec); > >> > >> m_codecContext->gop_size = 30; > >> > >> m_codecContext->sample_fmt = AV_SAMPLE_FMT_NONE; > >> > >> m_codecContext->bit_rate = width * height; > >> > >> m_codecContext->width = width; > >> > >> m_codecContext->height = height; > >> > >> m_codecContext->time_base = (AVRational){1,frameRate}; > >> > >> m_codecContext->pix_fmt = AV_PIX_FMT_YUV420P; > >> > >> > >> formatCtx = avformat_alloc_context(); > >> > >> if(!formatCtx) > >> > >> { > >> > >> printf("Error allocating format context\n"); > >> > >> } > >> > >> formatCtx->oformat = oformat; > >> > >> formatCtx->video_codec_id = oformat->video_codec; > >> > >> snprintf(formatCtx->filename, sizeof(formatCtx->filename), "%s", outputFileName.toStdString().c_str()); > >> > >> > >> AVStream *videoStream = av_new_stream(formatCtx, 0); > >> > >> if(!videoStream) > >> > >> { > >> > >> printf("Could not allocate stream\n"); > >> > >> } > >> > >> videoStream->codec = m_codecContext; > >> > >> > >> if(formatCtx->oformat->flags & AVFMT_GLOBALHEADER) > >> > >> { > >> > >> m_codecContext->flags |= CODEC_FLAG_GLOBAL_HEADER; > >> > >> } > >> > >> > >> avcodec_open2(m_codecContext, codec, NULL); > >> > >> avio_open(&formatCtx->pb, outputFileName.toStdString().c_str(), AVIO_FLAG_WRITE); > >> > >> avformat_write_header(formatCtx, NULL); > >> > >> > >> > >> and this is how I add the frames: > >> > >> > >> > >> > >> AVFrame *frame = avcodec_alloc_frame(); > >> > >> int size = m_codecContext->width * m_codecContext->height; > >> > >> int numBytes = avpicture_get_size(m_codecContext->pix_fmt, m_codecContext->width, m_codecContext->height); > >> > >> > >> QSharedPointer img = imageData; > >> > >> > >> uint8_t *outbuf = (uint8_t *)malloc(numBytes); > >> > >> uint8_t *picture_buf = (uint8_t *)av_malloc(numBytes); > >> > >> > >> if (true) > >> > >> { > >> > >> int ret = av_image_fill_arrays(frame->data, frame->linesize, picture_buf, m_codecContext->pix_fmt, m_codecContext->width, m_codecContext->height, 1); > >> > >> > >> frame->data[0] = picture_buf; > >> > >> frame->data[1] = frame->data[0] + size; > >> > >> frame->data[2] = frame->data[1] + size/4; > >> > >> frame->linesize[0] = m_codecContext->width; > >> > >> frame->linesize[1] = m_codecContext->width/2; > >> > >> frame->linesize[2] = m_codecContext->width/2; > >> > >> > >> fflush(stdout); > >> > >> for (int y = 0; y < m_codecContext->height; y++) > >> > >> { > >> > >> for (int x = 0; x < m_codecContext->width; x++) > >> > >> { > >> > >> unsigned char b = img->bits()[(y * m_codecContext->width + x) * 4 + 0]; > >> > >> unsigned char g = img->bits()[(y * m_codecContext->width + x) * 4 + 1]; > >> > >> unsigned char r = img->bits()[(y * m_codecContext->width + x) * 4 + 2]; > >> > >> > >> unsigned char Y = (0.257 * r) + (0.504 * g) + (0.098 * b) + 16; > >> > >> > >> frame->data[0][y * frame->linesize[0] + x] = Y; > >> > >> > >> if (y % 2 == 0 && x % 2 == 0) > >> > >> { > >> > >> unsigned char V = (0.439 * r) - (0.368 * g) - (0.071 * b) + 128; > >> > >> unsigned char U = -(0.148 * r) - (0.291 * g) + (0.439 * b) + 128; > >> > >> > >> frame->data[1][y/2 * frame->linesize[1] + x/2] = U; > >> > >> frame->data[2][y/2 * frame->linesize[2] + x/2] = V; > >> > >> } > >> > >> } > >> > >> } > >> > >> int pts = (1.0 / 30.0) * 9000.0 * frameIndex; > >> > >> frame->pts = pts; > >> > >> > >> int got_packet_ptr; > >> > >> > >> AVPacket packet; > >> > >> av_init_packet(&packet); > >> > >> packet.data = outbuf; > >> > >> packet.size = numBytes; > >> > >> packet.stream_index = formatCtx->streams[0]->index; > >> > >> packet.flags |= AV_PKT_FLAG_KEY; > >> > >> packet.pts = packet.dts = pts; > >> > >> > >> m_codecContext->coded_frame->pts = pts; > >> > >> > >> ret = avcodec_encode_video2(m_codecContext, &packet, frame, &got_packet_ptr); > >> > >> > >> > >> if (got_packet_ptr != 0) > >> > >> { > >> > >> m_codecContext->coded_frame->pts = pts; > >> > >> > >> if (m_codecContext->coded_frame->pts != (0x8000000000000000LL)) > >> > >> pts = av_rescale_q(m_codecContext->coded_frame->pts, m_codecContext->time_base, formatCtx->streams[0]->time_base); > >> > >> > >> packet.pts = pts; > >> > >> > >> if(m_codecContext->coded_frame->key_frame) > >> > >> { > >> > >> packet.flags |= AV_PKT_FLAG_KEY; > >> > >> } > >> > >> > >> > >> std::cout << "pts: " << packet.pts << ", dts: " << packet.dts << std::endl; > >> > >> > >> av_interleaved_write_frame(formatCtx, &packet); > >> > >> av_free_packet(&packet); > >> > >> } > >> > >> } > >> > >> > >> free(picture_buf); > >> > >> free(outbuf); > >> > >> av_free(frame); > >> > >> > >> > >> and of course in the end: > >> > >> > >> av_write_trailer(formatCtx); > >> > >> fclose(m_file); > >> > >> avcodec_close(m_codecContext); > >> > >> av_free(m_codecContext); > >> > >> > >> > >> I think this has something to do with the PTS/DTS values. PTS values start at 120 (as the first 40 frames are omitted) and are increased by 3 ((1.0 / 30.0) * 9000.0 * frameIndex) and the DTS values start at -6 also being increased by 3 per frame. But it might also be the settings or anything else. I feel like I have tried everything I was able to find on the internet and it's still wrong. I am desperate, help would be soooo appreciated! > >> > >> > >> Cheers, > >> > >> Marika > > What is your output format? > Alex > _______________________________________________ > 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 p.tushar99 at gmail.com Mon Jul 29 12:19:56 2013 From: p.tushar99 at gmail.com (Tushar Paithankar) Date: Mon, 29 Jul 2013 15:49:56 +0530 Subject: [Libav-user] Encoding from file In-Reply-To: References: Message-ID: On Sunday, 28 July 2013, Tariqul Islam wrote: > Hello, > I am new to ffmpeg coding. In ffmpeg source code, encoding decoding example is given in encoding_decoding.c. In this file while working with audio, a raw audio is created, then encoded, then decoded into a c file. What i am trying to do is to read from that C file, encode and thus reconstruct the previous audio file. But i am getting noise. > > Following Mr. Tusher's advice, i used exact code of encoding_decoding.c and decoded a mp2 file (Could not answer to that thread because subscribed after he answered. Sorry Mr. Tusher). But playing that decoded file, i am getting previous sound with heavy noise. Can anybody tell me what is the reason of it? To decode an audio file (mp2), is there any tutorial that i can follow??? > Regrads, > Tariqul islam > Hi tariqul islam, You first try to use mono clip for your encoding and decoding purpose, as per your description I thnk your making mistake while reading data from the buffers. In example they hv given for single channel mono audio. Plz let me know. Regards Tushar -- Sent from blackberry reliance -------------- next part -------------- An HTML attachment was scrubbed... URL: From cehoyos at ag.or.at Mon Jul 29 12:26:17 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Mon, 29 Jul 2013 10:26:17 +0000 (UTC) Subject: [Libav-user] G726 References: Message-ID: Mark Kenna writes: > I am trying to decode raw G726 from file. Does it work with ffmpeg (the executable)? If not, I would be very interested in a sample. Thank you, Carl Eugen From ggarra13 at gmail.com Mon Jul 29 16:20:11 2013 From: ggarra13 at gmail.com (Gonzalo Garramuno) Date: Mon, 29 Jul 2013 11:20:11 -0300 Subject: [Libav-user] sample_fmt_entry In-Reply-To: References: Message-ID: <51F67A1B.3010408@gmail.com> On 27/07/13 13:35, Liang Zhang wrote: > Hello, > > I tested the example program of demuxing for decoding audio signals > and have received the information regarding "unsupported audio format > for ftlp" when the input data has the extension of mp4. I checked the > program and found that the example function (int > get_format_from_sample_fmt ) only declare the sample format as follows: You don't need to change anything in the format list. The format list lists the available formats for the codec you are using. If the audio format is not supported, you need to feed in another format. You can change the format using the swresample part of ffmpeg. From adishavit at gmail.com Tue Jul 30 08:37:50 2013 From: adishavit at gmail.com (Adi Shavit) Date: Tue, 30 Jul 2013 09:37:50 +0300 Subject: [Libav-user] "Circular buffer overrun" error when reading UDP stream In-Reply-To: References: Message-ID: Hi Alex, > See http://ffmpeg.gusari.org/viewtopic.php?f=12&t=624. For ffmpeg > command line, you can specify the UDP buffer size in the URL, e.g. > udp://localhost:5002?fifo_size=1000000. Thanks. I did actually see this post, though I get errors from the overrun_nonfatal argument. > > Buy if you get this message because you followed my advice about max > 15 FPS, you are doing something wrong on your side: you should pull > the buffers faster. Yes, I'm dropping frames where I can to decrease fps (though not as you suggested (yet)). But I'm decoding multiple streams simultaneously so my CPU is pretty stressed. I don't use any sleep because I actually prefer processing frames early. I also don't mind dropped frames in case of processing lag. > Did you add a sleep in the decoder loop? If your > client is at 100% CPU utilization, faster settings for h264 decoder > may help. What settings are those? > > The only "legitimate" case when increase of the fifo size may really > be the correct solution, is a slow, unreliable network. In such case, > UDP packets may arrive significantly out of order, and nothing but > fifo size will compensate that. ok... > > Note that overrun_nonfatal will break the video output. If the network > is very bad, and you have IDR frames sent often enough, or if you use > an intra-refresh stream. Sorry, I don't understand what this means. Basically, my requirements are as follows: 1. Decode multiple video streams simultaneously from a single MTP stream. 2. I do not display the frames, only process the pixels. 3. I'm not very sensitive about dropped frames. 4. I prefer to process the frames as early as possible, even before they would have been displayed in "playing-time". If the UDP network stream is bad, then just wait until you get some proper packets/frames. Thanks, Adi From adishavit at gmail.com Tue Jul 30 09:20:20 2013 From: adishavit at gmail.com (Adi Shavit) Date: Tue, 30 Jul 2013 10:20:20 +0300 Subject: [Libav-user] Reducing the Frame-Rate of a Network Video Stream In-Reply-To: References: Message-ID: > > Then you don't need avfilter, IMHO. When you receive a decoded frame > from avcodec, simply check if the last frame was received more than 40 > ms ago. > Actually, I'm not sure how to do this for the following reason: I prefer to decode and process frames even before they would have been displayed in normal "playing-time". Thus, ideally I'd get ALL frames (encoded) before they should actually be displayed, and maybe wait for another chunk later. In this case checking the time delay between frames will actually drop more frames than I need (since I got a whole bunch ahead of time), or force me to decode in real play-time, both things I'd like to avoid. Adi From mike at mikeversteeg.com Tue Jul 30 10:13:23 2013 From: mike at mikeversteeg.com (mikeversteeg) Date: Tue, 30 Jul 2013 01:13:23 -0700 (PDT) Subject: [Libav-user] Reducing the Frame-Rate of a Network Video Stream In-Reply-To: References: Message-ID: <1375172003820-4658293.post@n4.nabble.com> Check the PTS of each frame and use that to decide whether to throw it out or not. That way there is no need to decode frames you won't be using. -- View this message in context: http://libav-users.943685.n4.nabble.com/Libav-user-Reducing-the-Frame-Rate-of-a-Network-Video-Stream-tp4658278p4658293.html Sent from the libav-users mailing list archive at Nabble.com. From adishavit at gmail.com Tue Jul 30 11:35:19 2013 From: adishavit at gmail.com (Adi Shavit) Date: Tue, 30 Jul 2013 12:35:19 +0300 Subject: [Libav-user] Reducing the Frame-Rate of a Network Video Stream In-Reply-To: <1375172003820-4658293.post@n4.nabble.com> References: <1375172003820-4658293.post@n4.nabble.com> Message-ID: Hi Mike, On Tue, Jul 30, 2013 at 11:13 AM, mikeversteeg wrote: > Check the PTS of each frame and use that to decide whether to throw it out or > not. Ah, thanks. These will give me the play-timestamps, right? > That way there is no need to decode frames you won't be using. Do you mean, no need to PROCESS, not decode. Don't I have to decode all frames? If I could not-decode (via the decoder) some of the frames that would be great and further save cpu. Can I do that, just skip some encoded frames? Wouldn't that mess up the following frames? Thanks, Adi From ivaylo.pif at gmail.com Tue Jul 30 12:19:04 2013 From: ivaylo.pif at gmail.com (Ivaylo Spasov) Date: Tue, 30 Jul 2013 13:19:04 +0300 Subject: [Libav-user] High bitrate in AVCONV converted MPG file causes DVD reading problem Message-ID: I convert AVI to MPEG with folowing command: avconv -i file.avi -c:v mpeg2video -b:v 6000k -c:a mp2 -b:a 384k file.mpg When the MPG file has been burned to DVD it is hard to read afterthat. The DVD on the computer starts to make noise and to read slow the DVD. Also it is hard to watch directly - it is like there is no buffer in the VLC player. The Windows media player doesn't even play the MPG file. I checked with avprobe the MPG file and another MPG file made with EDIUS program. Here are the resuts: MY MPG FILE avprobe my-file.mpg avprobe version 0.8.6-4:0.8.6-0ubuntu0.12.04.1, Copyright (c) 2007-2013 the Libav developers built on Apr 2 2013 17:00:59 with gcc 4.6.3 [mpeg @ 0x9b6f240] max_analyze_duration reached Input #0, mpeg, from 'my-file.mpg': Duration: 00:34:56.47, start: 1.000000, bitrate: 6411 kb/s Stream #0.0[0x1e0]: Video: mpeg2video (Main), yuv420p, 720x576 [PAR 16:15 DAR 4:3], 104857 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc Stream #0.1[0x1c0]: Audio: mp2, 48000 Hz, stereo, s16, 384 kb/s EDIUS CREATED MPG FILE avprobe edius.mpg avprobe version 0.8.6-4:0.8.6-0ubuntu0.12.04.1, Copyright (c) 2007-2013 the Libav developers built on Apr 2 2013 17:00:59 with gcc 4.6.3 [mpeg @ 0x8449240] max_analyze_duration reached Input #0, mpeg, from 'edius.mpg': Duration: 00:34:56.47, start: 0.346411, bitrate: 2290 kb/s Stream #0.0[0x1e0]: Video: mpeg2video (Main), yuv420p, 720x576 [PAR 16:15 DAR 4:3], 6000 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc Stream #0.1[0x1c0]: Audio: mp2, 48000 Hz, stereo, s16, 256 kb/s The two files are with great quality but I am questioning myself how to achieve two things: What to change in my command line to reach edius bitrate on that line: Duration: 00:34:56.47, start: 0.346411, bitrate: 2290 kb/s instead of: Duration: 00:34:56.47, start: 1.000000, bitrate: 6411 kb/s And how to reach this 6000kb in Edius STREAM line: Stream #0.0[0x1e0]: Video: mpeg2video (Main), yuv420p, 720x576 [PAR 16:15 DAR 4:3], 6000 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc instead of mine 104857kb : Stream #0.0[0x1e0]: Video: mpeg2video (Main), yuv420p, 720x576 [PAR 16:15 DAR 4:3], 104857 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc I think that will resolve my problem with burning and reading DVDs. ALso whe I am converting the yellow sigh appears: [mpeg @ 0x8e75f40] VBV buffer size not set, muxing may fail Is this a part of the problem? Thanks in advance! From brocanhu86 at gmail.com Tue Jul 30 12:21:25 2013 From: brocanhu86 at gmail.com (Luis Brocan Broki) Date: Tue, 30 Jul 2013 12:21:25 +0200 Subject: [Libav-user] Problem reading motion vectors Message-ID: Hi everyone! I'm currently developing a program that reads the motion_val table in each frame for doing some computations. The problem if since i've upgraded to ffmpeg 2.0 (i come from avcodec-53 version), the second level of motion_val table is always null, and m_pFrame->motion_subsample_log2 is always 0. I've tested agains mp4 (h264) videos, xvid videos, mpeg2 videos, without sucess. Any ideas? what i'm doing wrong? it's now necessary to activate some kind of flag? or use a filter? or how? Thanks in advance!! -------------- next part -------------- An HTML attachment was scrubbed... URL: From krueger at lesspain.de Tue Jul 30 12:24:47 2013 From: krueger at lesspain.de (=?UTF-8?Q?Robert_Kr=C3=BCger?=) Date: Tue, 30 Jul 2013 12:24:47 +0200 Subject: [Libav-user] High bitrate in AVCONV converted MPG file causes DVD reading problem In-Reply-To: References: Message-ID: Hi, On Tue, Jul 30, 2013 at 12:19 PM, Ivaylo Spasov wrote: > I convert AVI to MPEG with folowing command: > > avconv -i file.avi -c:v mpeg2video -b:v 6000k -c:a mp2 -b:a 384k file.mpg > I know it's confusing but this is the wrong mailing list for the software you use. You should probably subscribe to libav-tools at libav.org. Libav is a fork of ffmpeg and not supported on this mailing list. HTH, Robert From ivaylo.pif at gmail.com Tue Jul 30 12:26:01 2013 From: ivaylo.pif at gmail.com (Ivaylo Spasov) Date: Tue, 30 Jul 2013 13:26:01 +0300 Subject: [Libav-user] High bitrate in AVCONV converted MPG file causes DVD reading problem In-Reply-To: References: Message-ID: Thanks! On Tue, Jul 30, 2013 at 1:24 PM, Robert Kr?ger wrote: > Hi, > > On Tue, Jul 30, 2013 at 12:19 PM, Ivaylo Spasov wrote: >> I convert AVI to MPEG with folowing command: >> >> avconv -i file.avi -c:v mpeg2video -b:v 6000k -c:a mp2 -b:a 384k file.mpg >> > > I know it's confusing but this is the wrong mailing list for the > software you use. You should probably subscribe to > libav-tools at libav.org. Libav is a fork of ffmpeg and not supported on > this mailing list. > > HTH, > > Robert > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user From alexcohn at netvision.net.il Tue Jul 30 12:34:18 2013 From: alexcohn at netvision.net.il (Alex Cohn) Date: Tue, 30 Jul 2013 13:34:18 +0300 Subject: [Libav-user] Reducing the Frame-Rate of a Network Video Stream In-Reply-To: References: <1375172003820-4658293.post@n4.nabble.com> Message-ID: On Tue, Jul 30, 2013 at 12:35 PM, Adi Shavit wrote: > Hi Mike, > > > On Tue, Jul 30, 2013 at 11:13 AM, mikeversteeg wrote: >> Check the PTS of each frame and use that to decide whether to throw it out or >> not. > > Ah, thanks. > These will give me the play-timestamps, right? > >> That way there is no need to decode frames you won't be using. > Do you mean, no need to PROCESS, not decode. > Don't I have to decode all frames? > If I could not-decode (via the decoder) some of the frames that would > be great and further save cpu. Can I do that, just skip some encoded > frames? Wouldn't that mess up the following frames? > > Thanks, > Adi You must decode all frames, or skip to the next IDR frame, if you want to avoid artiifacts. Yes PTS is play timestamp. The units may depend on your stream format, and are generally expressed in terms of the timebase. BR, Alex Cohn From alexcohn at netvision.net.il Tue Jul 30 12:37:16 2013 From: alexcohn at netvision.net.il (Alex Cohn) Date: Tue, 30 Jul 2013 13:37:16 +0300 Subject: [Libav-user] Reducing the Frame-Rate of a Network Video Stream In-Reply-To: References: Message-ID: On Tue, Jul 30, 2013 at 10:20 AM, Adi Shavit wrote: >> >> Then you don't need avfilter, IMHO. When you receive a decoded frame >> from avcodec, simply check if the last frame was received more than 40 >> ms ago. >> > > Actually, I'm not sure how to do this for the following reason: > > I prefer to decode and process frames even before they would have been > displayed in normal "playing-time". > Thus, ideally I'd get ALL frames (encoded) before they should actually > be displayed, and maybe wait for another chunk later. > In this case checking the time delay between frames will actually drop > more frames than I need (since I got a whole bunch ahead of time), or > force me to decode in real play-time, both things I'd like to avoid. > > Adi Well, when I wrote "40 ms ago" I actually mean 40 ms after the previous frame. Often, you can use PTS for that measurement. But it may also be not bad to register time of arrival of each frame, and base your processing strategy on these timestamps. Regards, Alex From adishavit at gmail.com Tue Jul 30 12:44:03 2013 From: adishavit at gmail.com (Adi Shavit) Date: Tue, 30 Jul 2013 13:44:03 +0300 Subject: [Libav-user] Reducing the Frame-Rate of a Network Video Stream In-Reply-To: References: <1375172003820-4658293.post@n4.nabble.com> Message-ID: Hi Alex, > You must decode all frames, or skip to the next IDR frame, if you want > to avoid artifacts. Yes PTS is play timestamp. The units may depend > on your stream format, and are generally expressed in terms of the > timebase. That's what I thought. How do I detect an IDR (or non-IDR) frame? Can I safely skip non-IDR frames without decoding them at all? Thanks, Adi From adishavit at gmail.com Tue Jul 30 12:45:06 2013 From: adishavit at gmail.com (Adi Shavit) Date: Tue, 30 Jul 2013 13:45:06 +0300 Subject: [Libav-user] Reducing the Frame-Rate of a Network Video Stream In-Reply-To: References: Message-ID: Yes, I understand now. Thanks. Adi > Well, when I wrote "40 ms ago" I actually mean 40 ms after the > previous frame. Often, you can use PTS for that measurement. But it > may also be not bad to register time of arrival of each frame, and > base your processing strategy on these timestamps. > > Regards, > Alex > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user From marikaner at gmail.com Tue Jul 30 12:52:31 2013 From: marikaner at gmail.com (Marika Marszalkowski) Date: Tue, 30 Jul 2013 12:52:31 +0200 Subject: [Libav-user] Creating a .mkv with H.264 Message-ID: Hello people, could anyone provide a minimal example of how to encode a .mkv video using H.264 Encoding from QImages? I have tried a lot of different settings and can not make it work. This would be great! Thanks in advance! -------------- next part -------------- An HTML attachment was scrubbed... URL: From alexcohn at netvision.net.il Tue Jul 30 12:56:08 2013 From: alexcohn at netvision.net.il (Alex Cohn) Date: Tue, 30 Jul 2013 13:56:08 +0300 Subject: [Libav-user] "Circular buffer overrun" error when reading UDP stream In-Reply-To: References: Message-ID: On Tue, Jul 30, 2013 at 9:37 AM, Adi Shavit wrote: >> Note that overrun_nonfatal will break the video output. If the network >> is very bad, and you have IDR frames sent often enough, or if you use >> an intra-refresh stream. > > Sorry, I don't understand what this means. > > > Basically, my requirements are as follows: > > 1. Decode multiple video streams simultaneously from a single MTP stream. > 2. I do not display the frames, only process the pixels. > 3. I'm not very sensitive about dropped frames. > 4. I prefer to process the frames as early as possible, even before > they would have been displayed in "playing-time". > > If the UDP network stream is bad, then just wait until you get some > proper packets/frames. > > Thanks, > Adi My bad. Few words got dropped from the last mail. Nevermind, let us address your scenario. If your processing consistently fall behind the input stream(s), then overrun_nonfatal or increasing the cyclic buffer will not really help. You can skip h264 post-processing to save decoding time. Other than that, if you detect that your process takes too long, you should apply it only when the decoder catches up with the stream. In the worst case, if an IDR frame arrives, you can discard all frames up to IDR, and essentially start again. If you cannot configure the encoder, the latter option depends totally on the nature of your incoming stream. If you can configure the source, you should be very careful about forcing IDR frames too often: first of all, these frames take much more bandwidth, and second, they take longer to decode. Sincerely, Alex Cohn From onemda at gmail.com Tue Jul 30 13:00:19 2013 From: onemda at gmail.com (Paul B Mahol) Date: Tue, 30 Jul 2013 11:00:19 +0000 Subject: [Libav-user] Problem reading motion vectors In-Reply-To: References: Message-ID: On 7/30/13, Luis Brocan Broki wrote: > Hi everyone! > > I'm currently developing a program that reads the motion_val table in each > frame for doing some computations. The problem if since i've upgraded to > ffmpeg 2.0 (i come from avcodec-53 version), the second level of motion_val > table is always null, and m_pFrame->motion_subsample_log2 is always 0. > I've tested agains mp4 (h264) videos, xvid videos, mpeg2 videos, without > sucess. > > Any ideas? what i'm doing wrong? it's now necessary to activate some kind > of flag? or use a filter? or how? > > Thanks in advance!! > I can't find motion_subsample_log2 anywhere in codebase. From brocanhu86 at gmail.com Tue Jul 30 13:04:23 2013 From: brocanhu86 at gmail.com (Luis Brocan Broki) Date: Tue, 30 Jul 2013 13:04:23 +0200 Subject: [Libav-user] Problem reading motion vectors In-Reply-To: References: Message-ID: It's a deprecated parameter in AVFrame structure (as well as motion val 3-dimensional array), which i use to compute motion vectors in old versions of ffmpeg. If these parameteres has gone from codebase, how i can get now the motion vectors? Thanks in advance! 2013/7/30 Paul B Mahol > On 7/30/13, Luis Brocan Broki wrote: > > Hi everyone! > > > > I'm currently developing a program that reads the motion_val table in > each > > frame for doing some computations. The problem if since i've upgraded to > > ffmpeg 2.0 (i come from avcodec-53 version), the second level of > motion_val > > table is always null, and m_pFrame->motion_subsample_log2 is always 0. > > I've tested agains mp4 (h264) videos, xvid videos, mpeg2 videos, without > > sucess. > > > > Any ideas? what i'm doing wrong? it's now necessary to activate some kind > > of flag? or use a filter? or how? > > > > Thanks in advance!! > > > > I can't find motion_subsample_log2 anywhere in codebase. > _______________________________________________ > 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 adishavit at gmail.com Tue Jul 30 13:16:44 2013 From: adishavit at gmail.com (Adi Shavit) Date: Tue, 30 Jul 2013 14:16:44 +0300 Subject: [Libav-user] "Circular buffer overrun" error when reading UDP stream In-Reply-To: References: Message-ID: > You can skip h264 post-processing to save decoding time. How do I do this programatically? I didn't actually configure and codec explicitly, it was automatically selected. I don't even know when the stream will be H.264. > Other than that, if you detect that your process takes too long, you should apply > it only when the decoder catches up with the stream. In the worst > case, if an IDR frame arrives, you can discard all frames up to IDR, > and essentially start again. How do I detect an IDR (or non-IDR frame)? Can I freely discard non-IDR frames without decoding them? > > If you cannot configure the encoder, the latter option depends totally > on the nature of your incoming stream. If you can configure the > source, you should be very careful about forcing IDR frames too often: > first of all, these frames take much more bandwidth, and second, they > take longer to decode. Thank! Adi From tariqul.isha at gmail.com Tue Jul 30 13:17:19 2013 From: tariqul.isha at gmail.com (Tariqul Islam) Date: Tue, 30 Jul 2013 17:17:19 +0600 Subject: [Libav-user] Encoding from file In-Reply-To: References: Message-ID: Hi Tushar Paithankar Used mono clip(produced by audacity) for decoding purpose and again getting noise. My code is exact of the decoding_encoding.c except the main function. Can you provide me any tutorial? Regards Tariqul Islam On Mon, Jul 29, 2013 at 4:19 PM, Tushar Paithankar wrote: > > > On Sunday, 28 July 2013, Tariqul Islam wrote: > > Hello, > > I am new to ffmpeg coding. In ffmpeg source code, encoding decoding > example is given in encoding_decoding.c. In this file while working with > audio, a raw audio is created, then encoded, then decoded into a c file. > What i am trying to do is to read from that C file, encode and thus > reconstruct the previous audio file. But i am getting noise. > > > > Following Mr. Tusher's advice, i used exact code of encoding_decoding.c > and decoded a mp2 file (Could not answer to that thread because subscribed > after he answered. Sorry Mr. Tusher). But playing that decoded file, i am > getting previous sound with heavy noise. Can anybody tell me what is the > reason of it? To decode an audio file (mp2), is there any tutorial that i > can follow??? > > Regrads, > > Tariqul islam > > > > > Hi tariqul islam, > > You first try to use mono clip for your encoding and decoding purpose, as > per your description I thnk your making mistake while reading data from the > buffers. In example they hv given for single channel mono audio. Plz let > me know. > > > > Regards > Tushar > > -- > Sent from blackberry reliance > > _______________________________________________ > 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 tariqul.isha at gmail.com Tue Jul 30 14:38:21 2013 From: tariqul.isha at gmail.com (Tariqul Islam) Date: Tue, 30 Jul 2013 18:38:21 +0600 Subject: [Libav-user] Encoding from file In-Reply-To: References: Message-ID: Hi Mr. Tushar Decoding part is complete, fault was not removing header part from raw data. Audacity is giving clear sound for raw data of any mp2 file. But still working with encoding :( Regards, Tariqul Islam On Tue, Jul 30, 2013 at 5:17 PM, Tariqul Islam wrote: > Hi Tushar Paithankar > > Used mono clip(produced by audacity) for decoding purpose and again > getting noise. My code is exact of the decoding_encoding.c except the main > function. Can you provide me any tutorial? > > Regards > Tariqul Islam > > > On Mon, Jul 29, 2013 at 4:19 PM, Tushar Paithankar wrote: > >> >> >> On Sunday, 28 July 2013, Tariqul Islam wrote: >> > Hello, >> > I am new to ffmpeg coding. In ffmpeg source code, encoding decoding >> example is given in encoding_decoding.c. In this file while working with >> audio, a raw audio is created, then encoded, then decoded into a c file. >> What i am trying to do is to read from that C file, encode and thus >> reconstruct the previous audio file. But i am getting noise. >> > >> > Following Mr. Tusher's advice, i used exact code of encoding_decoding.c >> and decoded a mp2 file (Could not answer to that thread because subscribed >> after he answered. Sorry Mr. Tusher). But playing that decoded file, i am >> getting previous sound with heavy noise. Can anybody tell me what is the >> reason of it? To decode an audio file (mp2), is there any tutorial that i >> can follow??? >> > Regrads, >> > Tariqul islam >> > >> >> >> Hi tariqul islam, >> >> You first try to use mono clip for your encoding and decoding purpose, >> as per your description I thnk your making mistake while reading data from >> the buffers. In example they hv given for single channel mono audio. Plz >> let me know. >> >> >> >> Regards >> Tushar >> >> -- >> Sent from blackberry reliance >> >> _______________________________________________ >> Libav-user mailing list >> Libav-user at ffmpeg.org >> http://ffmpeg.org/mailman/listinfo/libav-user >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From alexcohn at netvision.net.il Tue Jul 30 16:12:25 2013 From: alexcohn at netvision.net.il (Alex Cohn) Date: Tue, 30 Jul 2013 17:12:25 +0300 Subject: [Libav-user] "Circular buffer overrun" error when reading UDP stream In-Reply-To: References: Message-ID: On Tue, Jul 30, 2013 at 2:16 PM, Adi Shavit wrote: >> You can skip h264 post-processing to save decoding time. > > How do I do this programatically? > I didn't actually configure and codec explicitly, it was automatically > selected. I don't even know when the stream will be H.264. See, for example, http://ffmpeg.org/pipermail/ffmpeg-devel/2011-October/115966.html. You can also try to use multithreaded decoder. But this is not going to help if you have more video streams in parallel than CPU cores. BTW, what is your platform? Good luck, Alex Cohn From alexcohn at netvision.net.il Tue Jul 30 16:15:28 2013 From: alexcohn at netvision.net.il (Alex Cohn) Date: Tue, 30 Jul 2013 17:15:28 +0300 Subject: [Libav-user] "Circular buffer overrun" error when reading UDP stream In-Reply-To: References: Message-ID: On Tue, Jul 30, 2013 at 2:16 PM, Adi Shavit wrote: > How do I detect an IDR (or non-IDR frame)? > Can I freely discard non-IDR frames without decoding them? Look for AV_PKT_FLAG_KEY in packet->flags Alex From adishavit at gmail.com Tue Jul 30 16:26:03 2013 From: adishavit at gmail.com (Adi Shavit) Date: Tue, 30 Jul 2013 17:26:03 +0300 Subject: [Libav-user] "Circular buffer overrun" error when reading UDP stream In-Reply-To: References: Message-ID: >> How do I do this programatically? >> I didn't actually configure and codec explicitly, it was automatically >> selected. I don't even know when the stream will be H.264. > > See, for example, > http://ffmpeg.org/pipermail/ffmpeg-devel/2011-October/115966.html. Thanks. > > You can also try to use multithreaded decoder. But this is not going > to help if you have more video streams in parallel than CPU cores. I can give it a shot. How do I set it up? > > BTW, what is your platform? I'm currently testing on Windows, but ultimately Linux. Adi From adishavit at gmail.com Tue Jul 30 16:31:26 2013 From: adishavit at gmail.com (Adi Shavit) Date: Tue, 30 Jul 2013 17:31:26 +0300 Subject: [Libav-user] "Circular buffer overrun" error when reading UDP stream In-Reply-To: References: Message-ID: Great! If I want to drop a particular frame, and (0 == AV_PKT_FLAG_KEY & packet->flags) then I can just skip the whole packet and no even decode it.Cool. On Tue, Jul 30, 2013 at 5:15 PM, Alex Cohn wrote: > On Tue, Jul 30, 2013 at 2:16 PM, Adi Shavit wrote: >> How do I detect an IDR (or non-IDR frame)? >> Can I freely discard non-IDR frames without decoding them? > > Look for AV_PKT_FLAG_KEY in packet->flags > > Alex > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user From alexcohn at netvision.net.il Tue Jul 30 16:39:49 2013 From: alexcohn at netvision.net.il (Alex Cohn) Date: Tue, 30 Jul 2013 17:39:49 +0300 Subject: [Libav-user] "Circular buffer overrun" error when reading UDP stream In-Reply-To: References: Message-ID: On Tue, Jul 30, 2013 at 5:31 PM, Adi Shavit wrote: > Great! > If I want to drop a particular frame, and (0 == AV_PKT_FLAG_KEY & > packet->flags) then I can just skip the whole packet and no even > decode it.Cool. Wrong. If you drop a frame, then you must drop all frames after it until you have (0 != AV_PKT_FLAG_KEY & packet->flags). Alex From kalileo at universalx.net Tue Jul 30 16:53:22 2013 From: kalileo at universalx.net (Kalileo) Date: Tue, 30 Jul 2013 21:53:22 +0700 Subject: [Libav-user] "Circular buffer overrun" error when reading UDP stream In-Reply-To: References: Message-ID: On Jul 30, 2013, at 21:26 , Adi Shavit wrote: >> >> You can also try to use multithreaded decoder. But this is not going >> to help if you have more video streams in parallel than CPU cores. > > I can give it a shot. > How do I set it up? I think Alex means something like this, here as an example with 2 threads: AVDictionary *opts = NULL; av_dict_set(&opts, "threads", "2", 0); if (avcodec_open2(pVideoCodecCtx, pVideoCodec, &opts) ? From adishavit at gmail.com Tue Jul 30 16:59:07 2013 From: adishavit at gmail.com (Adi Shavit) Date: Tue, 30 Jul 2013 17:59:07 +0300 Subject: [Libav-user] "Circular buffer overrun" error when reading UDP stream In-Reply-To: References: Message-ID: > > Wrong. If you drop a frame, then you must drop all frames after it > until you have (0 != AV_PKT_FLAG_KEY & packet->flags). > Aha, thanks for the clarification. Not as useful as I had hoped... Adi From vahid at kowsari.com Tue Jul 30 17:18:30 2013 From: vahid at kowsari.com (Vahid Kowsari) Date: Tue, 30 Jul 2013 08:18:30 -0700 Subject: [Libav-user] "Circular buffer overrun" error when reading UDP stream In-Reply-To: References: Message-ID: <51F7D946.9020003@kowsari.com> Doesnt the decoder do this as default? If I just use the API to decode a video it creates multiple threads automatically. Kalileo wrote: > On Jul 30, 2013, at 21:26 , Adi Shavit wrote: >>> You can also try to use multithreaded decoder. But this is not going >>> to help if you have more video streams in parallel than CPU cores. >> I can give it a shot. >> How do I set it up? > > > I think Alex means something like this, here as an example with 2 threads: > > AVDictionary *opts = NULL; > av_dict_set(&opts, "threads", "2", 0); > if (avcodec_open2(pVideoCodecCtx, pVideoCodec,&opts) > ? > > > > _______________________________________________ > 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 p.tushar99 at gmail.com Tue Jul 30 17:24:57 2013 From: p.tushar99 at gmail.com (tushar) Date: Tue, 30 Jul 2013 15:24:57 +0000 Subject: [Libav-user] Encoding from file In-Reply-To: References: Message-ID: <600484808-1375197898-cardhu_decombobulator_blackberry.rim.net-1943257219-@b25.c14.bise7.blackberry> Hi , Good now its very simple. You have to read a row frame. There is simple calculation for calculating raw frame size. For mono audio I.e pcm file frame size is 1024*2*1. (1024*bit depth*no of channels ). For 16 bit pcm bit depth is 2. So for mono input yor have to give (1024*2*1) bytes for frame to encode call. Plz check encode call api. I thnk it is simple in avpacket you have to give input buffer pointer and its size. Plz let me know further Regards Tushar Sent from my BlackBerry? on Reliance Mobile, India's No. 1 Network. Go for it! -----Original Message----- From: Tariqul Islam Sender: libav-user-bounces at ffmpeg.orgDate: Tue, 30 Jul 2013 18:38:21 To: This list is about using libavcodec, libavformat, libavutil, libavdevice and libavfilter. Reply-To: "This list is about using libavcodec, libavformat, libavutil, libavdevice and libavfilter." Subject: Re: [Libav-user] Encoding from file _______________________________________________ Libav-user mailing list Libav-user at ffmpeg.org http://ffmpeg.org/mailman/listinfo/libav-user From kalileo at universalx.net Tue Jul 30 17:32:36 2013 From: kalileo at universalx.net (Kalileo) Date: Tue, 30 Jul 2013 22:32:36 +0700 Subject: [Libav-user] "Circular buffer overrun" error when reading UDP stream In-Reply-To: <51F7D946.9020003@kowsari.com> References: <51F7D946.9020003@kowsari.com> Message-ID: On Jul 30, 2013, at 22:18 , Vahid Kowsari wrote: > Kalileo wrote: >> >> I think Alex means something like this, here as an example with 2 threads: >> >> AVDictionary *opts = NULL; >> av_dict_set(&opts, "threads", "2", 0); >> if (avcodec_open2(pVideoCodecCtx, pVideoCodec, &opts) >> ? >> > Doesnt the decoder do this as default? If I just use the API to decode a video it creates multiple threads automatically. > Yes, it does (at least libx264 does), but you can also specify exactly how many you want it to use. Useful if you have many decoders running and want to limit how many threads they take per encoder. From pvazharov at abaltatech.com Tue Jul 30 20:21:23 2013 From: pvazharov at abaltatech.com (Pavel Vazharov) Date: Tue, 30 Jul 2013 11:21:23 -0700 Subject: [Libav-user] SIGBUS when using ffmpeg on QNX armv7 Message-ID: Hi, I ported an application, with ffmpeg, which is working on QNX x86 to QNX armv7. I cross compiled the ffmpeg on a linux machine with the QNX momentics suite tools. I can't compile the library directly on the QNX armv7 device so I had to cross compile it. My configure was following: ./configure \ --enable-gpl \ --enable-nonfree \ --disable-bzlib \ --disable-ffserver \ --enable-cross-compile \ --target-os=qnx \ --arch=armv7 \ --cross-prefix=ntoarmv7- \ --enable-libx264 \ --extra-cflags="-I../x264 -Wno-deprecated -Wno-deprecated-declarations" \ --extra-ldflags="-L../x264" It gave one warning - "Compiler does not indicate floating-point ABI". I did "make all". When I started the application it gave - (Suspended: Signal 'SIGBUS' received. Description: Bus error.) 17 adts_aac_probe() libavutil\arm\intreadwrite.h:34 0x0028a284 16 av_probe_input_format3() libavformat\utils.c:339 0x00273da4 15 av_probe_input_buffer() libavformat\utils.c:361 0x002749cc 14 avformat_open_input() libavformat\utils.c:522 0x00276698 13 WLCommon::CFrameDecoder_H264_ffmpeg_impl::Startup() C:\DataDisk\Project\AbaltaInternal\WebLink\Source\WebLinkCore\FrameEncoding\FrameDecoder_H264_ffmpeg.cpp:281 0x0012406c .... This is the function that causes the SIGBUS. bool CFrameDecoder_H264_ffmpeg_impl::Startup() { bool result = false; if (m_initialized && !m_started) { int res; av_register_all(); m_videoStrmIdx = -1; m_formatCtx = avformat_alloc_context(); m_ioBuffer = (unsigned char*)av_malloc(8192); m_avioCtx = avio_alloc_context(m_ioBuffer, 8192, 0, this, ReadFunction, NULL, NULL); m_formatCtx->pb = m_avioCtx; ----> res = avformat_open_input(&m_formatCtx, "dummyFilename", NULL, NULL); ... As far as I know the SIGBUS means misaligned access. The reason could be in our code, but the same code works on Raspberry Pi device with Linux and armv7. Can you advise me how to approach to this problem? Should I try some --extra-cflags in the configure phase? Should I search the reason in our code? I can provide you with the information from config.log, config.mak or config.h, if needed. Thanks, Pavel. -------------- next part -------------- An HTML attachment was scrubbed... URL: From cehoyos at ag.or.at Wed Jul 31 01:54:32 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Tue, 30 Jul 2013 23:54:32 +0000 (UTC) Subject: [Libav-user] SIGBUS when using ffmpeg on QNX armv7 References: Message-ID: Pavel Vazharov writes: > ./configure --enable-gpl \ > --enable-nonfree Unrelated: The only effect that this option has in your configure line is that you are not allowed to distribute any binaries based on this compile, so please remove it. [...] > When I started the application it gave - > (Suspended: Signal 'SIGBUS' received. Does the crash happen with ffmpeg (the application) or only with your application linked against libavcodec? Did you ever run fate after compilation? Please provide backtrace etc, as explained on http://ffmpeg.org/bugreports.html Carl Eugen From cehoyos at ag.or.at Wed Jul 31 01:57:39 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Tue, 30 Jul 2013 23:57:39 +0000 (UTC) Subject: [Libav-user] High bitrate in AVCONV converted MPG file causes DVD reading problem References: Message-ID: Ivaylo Spasov writes: > I convert AVI to MPEG with folowing command: > > avconv To elaborate: avconv contains several hundred known bugs that are not reproducible with ffmpeg, some of them security relevant, please understand that we therefore cannot support it here. See http://blog.pkh.me/p/13-the-ffmpeg-libav-situation.html for more information. Carl Eugen From cehoyos at ag.or.at Wed Jul 31 01:55:24 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Tue, 30 Jul 2013 23:55:24 +0000 (UTC) Subject: [Libav-user] Creating a .mkv with H.264 References: Message-ID: Marika Marszalkowski writes: > I have tried a lot of different settings and can > not make it work. Command line including complete, uncut console output / source code missing. Carl Eugen From yellowy4321 at gmail.com Tue Jul 30 23:04:16 2013 From: yellowy4321 at gmail.com (sunswang) Date: Tue, 30 Jul 2013 14:04:16 -0700 (PDT) Subject: [Libav-user] What exactly is AVFilterPad and AVFilterInOut within libavfilter? Message-ID: <1375218256232-4658321.post@n4.nabble.com> Hi all, I am currently trying to figure out how to resolve the "output pad .... no source found" error from a modification of the ffmpeg audio filter example because I am using a filter that requires 2 or more inputs. However, I am having trouble understanding exactly what "AVFilterPad", "AVFilterInOut" are in playing a roll towards filtering. I could not find any examples or proper clarification from these objects (FFMPEG documentation its for "input and output", can anyone provide some context towards this? -- View this message in context: http://libav-users.943685.n4.nabble.com/What-exactly-is-AVFilterPad-and-AVFilterInOut-within-libavfilter-tp4658321.html Sent from the libav-users mailing list archive at Nabble.com. From soho123.2012 at gmail.com Wed Jul 31 09:43:31 2013 From: soho123.2012 at gmail.com (Soho Soho123) Date: Wed, 31 Jul 2013 15:43:31 +0800 Subject: [Libav-user] what is "fltp" for audio when using ffmpeg Message-ID: Hi All, I got the problem when I try to capture audio + video from USB web cam by ffmepg. the problem is audio can not play when I use VLC to play the stream that ffserver output. the question is : I use ffmepg the encode audio to "wmav1" but, I can see the log that is output by audio filter. the audio format is "fltp". What is "fltp"? Does anyone have idea? the log is : ffmpeg -loglevel debug -f video4linux2 -r 30 -s 640x480 -input_format h264 -i /dev/video1 -f alsa -ar 48000 -ac 2 -i hw:0 -vcodec copy -acodec wmav1 http://l ocalhost:8090/feed1.ffm ffmpeg version 2.0 Copyright (c) 2000-2013 the FFmpeg developers built on Jul 31 2013 14:26:37 with gcc 4.4.5-1.5.5p4 (GCC) configuration: --enable-cross-compile --cross-prefix=sdk-linux- --arch=mips --target-os=linux --disable -doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-mips32r2 --dis able-ffplay --disable-postproc --disable-runtime-cpudetect --disable-swscale-alpha --disable-mipsdspr1 --d isable-mipsdspr2 --disable-mipsfpu --enable-small --prefix=/ffmpeg-2.0/romfs --bindir=/ffmpeg-2.0/romfs --disable-bsfs --disable-filters --enable-gpl --enab le-libfaac --enable-nonfree --enable-libx264 --extra-cflags=-I/ShareLib_Install/bin/../include --extra-libs='-L/ShareLib_Install/bin/../lib -lx264' --enable -filter='aformat,aresample,copy,format,fps,framestep,resample' --disa libavutil 52. 38.100 / 52. 38. 100 libavcodec 55. 18.102 / 55. 18.102 libavformat 55. 12.100 / 55. 12.100 libavdevice 55. 3.100 / 55. 3.100 libavfilter 3. 79.101 / 3. 79.101 libswscale 2. 3.100 / 2. 3.100 libswresample 0. 17.102 / 0. 17.102 Splitting the commandline. Reading option '-loglevel' ... matched as option 'loglevel' (set logging level) with argument 'debug'. Reading option '-f' ... matched as option 'f' (force format) with argument 'video4linux2'. Reading option '-r' ... matched as option 'r' (set frame rate (Hz value, fraction or abbreviation)) with a rgument '30'. Reading option '-s' ... matched as option 's' (set frame size (WxH or abbreviation)) with argument '640x48 0'. Reading option '-input_format' ... matched as AVOption 'input_format' with argument 'h264'. Reading option '-i' ... matched as input file with argument '/dev/video1'. Reading option '-f' ... matched as option 'f' (force format) with argument 'alsa'. Reading option '-ar' ... matched as option 'ar' (set audio sampling rate (in Hz)) with argument '48000'. Reading option '-ac' ... matched as option 'ac' (set number of audio channels) with argument '2'. Reading option '-i' ... matched as input file with argument 'hw:0'. Reading option '-vcodec' ... matched as option 'vcodec' (force video codec ('copy' to copy stream)) with a rgument 'copy'. Reading option '-acodec' ... matched as option 'acodec' (force audio codec ('copy' to copy stream)) with a rgument 'wmav1'. Reading option 'http://localhost:8090/feed1.ffm' ... matched as output file. Finished splitting the commandline. Parsing a group of options: global . Applying option loglevel (set logging level) with argument debug. Successfully parsed a group of options. Parsing a group of options: input file /dev/video1. Applying option f (force format) with argument video4linux2. Applying option r (set frame rate (Hz value, fraction or abbreviation)) with argument 30. Applying option s (set frame size (WxH or abbreviation)) with argument 640x480. Successfully parsed a group of options. Opening an input file: /dev/video1. [video4linux2,v4l2 @ 0x71ed30] fd:3 capabilities:4000001 [video4linux2,v4l2 @ 0x71ed30] Current input_channel: 0, input_name: Camera 1 [video4linux2,v4l2 @ 0x71ed30] Setting time per frame to 1/30 [h264 @ 0x71f990] Frame num gap 9 7 [video4linux2,v4l2 @ 0x71ed30] All info found Input #0, video4linux2,v4l2, from '/dev/video1': Duration: N/A, start: 147.060000, bitrate: N/A Stream #0:0, 8, 1/1000000: Video: h264, yuv420p, 640x480, 1/2000000, -5 kb/s, 30 fps, 30 tbr, 1000k tb n, 2000k tbc Successfully opened the file. Parsing a group of options: input file hw:0. Applying option f (force format) with argument alsa. Applying option ar (set audio sampling rate (in Hz)) with argument 48000. Applying option ac (set number of audio channels) with argument 2. Successfully parsed a group of options. Opening an input file: hw:0. Guessed Channel Layout for Input Stream #1.0 : stereo Input #1, alsa, from 'hw:0': Duration: N/A, start: 1375284807.118875, bitrate: 1536 kb/s Stream #1:0, 1, 1/1000000: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s Successfully opened the file. Parsing a group of options: output file http://localhost:8090/feed1.ffm. Applying option vcodec (force video codec ('copy' to copy stream)) with argument copy. Applying option acodec (force audio codec ('copy' to copy stream)) with argument wmav1. Successfully parsed a group of options. Opening an output file: http://localhost:8090/feed1.ffm. [ffm @ 0x7f2ff0] Format ffm probed with size=2048 and score=101 [AVIOContext @ 0x7f7590] Statistics: 4096 bytes read, 0 seeks Wed Jul 31 15:33:27 2013 127.0.0.1 - - [GET] "/feed1.ffm HTTP/1.1" 200 4175 Successfully opened the file. detected 1 logical cores [graph 0 input from stream 1:0 @ 0x7f3440] Setting 'time_base' to value '1/48000' [graph 0 input from stream 1:0 @ 0x7f3440] Setting 'sample_rate' to value '48000' [graph 0 input from stream 1:0 @ 0x7f3440] Setting 'sample_fmt' to value 's16' [graph 0 input from stream 1:0 @ 0x7f3440] Setting 'channel_layout' to value '0x3' [graph 0 input from stream 1:0 @ 0x7f3440] tb:1/48000 samplefmt:s16 samplerate:48000 chlayout:0x3 [audio format for output stream 0:0 @ 0x79c700] Setting 'sample_fmts' to value 'fltp' [audio format for output stream 0:0 @ 0x79c700] Setting 'sample_rates' to value '48000' [audio format for output stream 0:0 @ 0x79c700] Setting 'channel_layouts' to value '0x3' [audio format for output stream 0:0 @ 0x79c700] auto-inserting filter 'auto-inserted resampler 0' between the filter 'Parsed_anull_0' and the filter 'audio format for output stream 0:0' [AVFilterGraph @ 0x812790] query_formats: 4 queried, 9 merged, 3 already done, 0 delayed [auto-inserted resampler 0 @ 0x811210] ch:2 chl:stereo fmt:s16 r:48000Hz -> ch:2 chl:stereo fmt:fltp r:480 00Hz Output #0, ffm, to 'http://localhost:8090/feed1.ffm': Metadata: creation_time : now encoder : Lavf55.12.100 Stream #0:0, 0, 1/1000000: Audio: wmav1, 48000 Hz, stereo, fltp, 128 kb/s Stream #0:1, 0, 1/1000000: Video: h264, yuv420p, 640x480, 1/30, q=2-31, -5 kb/s, 30 fps, 1000k tbn, 30 tbc Stream mapping: Stream #1:0 -> #0:0 (pcm_s16le -> wmav1) Stream #0:0 -> #0:1 (copy) Press [q] to stop, [?] for help [alsa @ 0x8174e0] ALSA buffer xrun. Last message repeated 1 times Last message repeated 2 times Last message repeated 3 times -------------- next part -------------- An HTML attachment was scrubbed... URL: From wang.xi at yoyosys.com Wed Jul 31 09:47:25 2013 From: wang.xi at yoyosys.com (=?UTF-8?B?546L5Zac?=) Date: Wed, 31 Jul 2013 15:47:25 +0800 Subject: [Libav-user] play rmvb video file not smooth In-Reply-To: References: Message-ID: <51F8C10D.5020702@yoyosys.com> I understand that must do the audio and video time sync? i'm a newer for ffmpeg, can someone give me some tips about the ffmpeg play rmvb? From brian at lorf.org Wed Jul 31 10:10:16 2013 From: brian at lorf.org (Brian Lewis) Date: Wed, 31 Jul 2013 04:10:16 -0400 Subject: [Libav-user] stubborn valgrind issue Message-ID: <20130731081016.GH1294@x> Hi, I'm getting some invalid reads and uses of uninitialized values in valgrind that I can't clear up. An archive with the test code and video is at http://code.haskell.org/~brian/test.tgz Or if you prefer to just look at the code, it's also up at http://pastebin.com/EGP9dehj The test code reads frames from test.mkv and writes PNGs to frame.png. It seems to be able to do this, but only with a bunch of scary warnings from valgrind. To see the problem, compile with $ gcc -W -Wall -g -o test test.c -lavcodec -lavformat -lavutil -lswscale or just run ./go from the archive. Then $ valgrind ./test You should see that frame.png has been written, and its contents seem OK. But there are warnings from valgrind. The problematic part of the code seems to be around line 95, probably the call to avcodec_encode_video2. Can anyone fix this code to get rid of the valgrind warnings? Thanks in advance. From waffe3waffe3 at gmail.com Wed Jul 31 10:39:57 2013 From: waffe3waffe3 at gmail.com (=?GB2312?B?0KG43w==?=) Date: Wed, 31 Jul 2013 16:39:57 +0800 Subject: [Libav-user] change the bit_rate without re-opening the codec Message-ID: Hi, all I am wondering whether it's possible to 'change the bit_rate without re-opening the codec'. I have googled many pages to implement it, and tried to change bit_rate, rc_min_rate, rc_max_rate, rc_buffer_size under AVCodecContext structure, but the output file size remains(fail to set bitrate?). However, if I retrieve the context and re-open the encoder after the changing, the file size will change normally. Additionally, in libx264, we need to call x264_encoder_reconfig() to enable the latest params, is there a need to call some ffmpeg api like it? How can I let the file size change as as the bitrate? Thanks Gao -------------- next part -------------- An HTML attachment was scrubbed... URL: From cehoyos at ag.or.at Wed Jul 31 11:15:22 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Wed, 31 Jul 2013 09:15:22 +0000 (UTC) Subject: [Libav-user] stubborn valgrind issue References: <20130731081016.GH1294@x> Message-ID: Brian Lewis writes: > Hi, I'm getting some invalid reads and uses of uninitialized > values in valgrind that I can't clear up. (valgrind output missing.) > int buf_size = avpicture_get_size(PIX_FMT_OUT, WIDTH, HEIGHT); > uint8_t *buf = malloc(buf_size); Does it get better if you allocate more memory? (FF_INPUT_BUFFER_PADDING_SIZE) Not necessarily related: On some (broken) platforms, you have to use av_malloc() to ensure sufficient alignment. Carl Eugen From tanjimhossainsifat at gmail.com Wed Jul 31 14:44:53 2013 From: tanjimhossainsifat at gmail.com (Tanjim Hossain Sifat) Date: Wed, 31 Jul 2013 18:44:53 +0600 Subject: [Libav-user] Encode in h264 Message-ID: Hello, I would like to decode a video file and then encode it in h264. I have gone through the Example: encoding_decoding.c, demuxing.c, muxing.c and examples from dranger.com. demuxing.c example was quite helpful, as using it i could decode a video from "file" into rawvideo. But, other examples only generated dummy data to encode these "dummy data" into a video file. So, please someone help me on this, so i can read data from a file (not generate some dummy data), decode it into rawvideo, then read rawvideo and encode it in a separate codec like h264. Flow: video in a specific codec ----------> rawvideo (decode) rawvideo ------------------------> video in h264 (encode) Thanks in advance -- MD. Tanjim Hossain Sifat Bangladesh University of Engineering and Technology, Dhaka -------------- next part -------------- An HTML attachment was scrubbed... URL: From tanjimhossainsifat at gmail.com Wed Jul 31 16:04:12 2013 From: tanjimhossainsifat at gmail.com (Tanjim Hossain Sifat) Date: Wed, 31 Jul 2013 20:04:12 +0600 Subject: [Libav-user] Encode RAW video into a specific Message-ID: Hello, In the given example "demuxing.c", a video file in a specific codec is decoded into a RAW video file. I want to do reverse, meaning I like to encode a RAW video file into a video file of specific code. Please someone help me with suggestion/code/resource. Thanks in advance. -- MD. Tanjim Hossain Sifat Bangladesh University of Engineering and Technology, Dhaka -------------- next part -------------- An HTML attachment was scrubbed... URL: From brian at lorf.org Wed Jul 31 18:50:30 2013 From: brian at lorf.org (Brian Lewis) Date: Wed, 31 Jul 2013 12:50:30 -0400 Subject: [Libav-user] stubborn valgrind issue In-Reply-To: References: <20130731081016.GH1294@x> Message-ID: <20130731165030.GJ1294@x> On 2013.07.31, at 09:15, Carl Eugen Hoyos wrote: > (valgrind output missing.) ==7895== Memcheck, a memory error detector ==7895== Copyright (C) 2002-2012, and GNU GPL'd, by Julian Seward et al. ==7895== Using Valgrind-3.8.1 and LibVEX; rerun with -h for copyright info ==7895== Command: ./test ==7895== ==7895== Use of uninitialised value of size 8 ==7895== at 0x839BDBC: crc32 (in /usr/lib/libz.so.1.2.8) ==7895== by 0x51B02B3: ??? (in /usr/lib/libavcodec.so.54.92.100) ==7895== by 0x51B0C6F: ??? (in /usr/lib/libavcodec.so.54.92.100) ==7895== by 0x525EC75: avcodec_encode_video2 (in /usr/lib/libavcodec.so.54.92.100) ==7895== by 0x40113A: main (test.c:98) ==7895== ==7895== Use of uninitialised value of size 8 ==7895== at 0x839BDCB: crc32 (in /usr/lib/libz.so.1.2.8) ==7895== by 0x51B02B3: ??? (in /usr/lib/libavcodec.so.54.92.100) ==7895== by 0x51B0C6F: ??? (in /usr/lib/libavcodec.so.54.92.100) ==7895== by 0x525EC75: avcodec_encode_video2 (in /usr/lib/libavcodec.so.54.92.100) ==7895== by 0x40113A: main (test.c:98) ==7895== ==7895== Use of uninitialised value of size 8 ==7895== at 0x839BDD2: crc32 (in /usr/lib/libz.so.1.2.8) ==7895== by 0x51B02B3: ??? (in /usr/lib/libavcodec.so.54.92.100) ==7895== by 0x51B0C6F: ??? (in /usr/lib/libavcodec.so.54.92.100) ==7895== by 0x525EC75: avcodec_encode_video2 (in /usr/lib/libavcodec.so.54.92.100) ==7895== by 0x40113A: main (test.c:98) ==7895== ==7895== Use of uninitialised value of size 8 ==7895== at 0x839BE0F: crc32 (in /usr/lib/libz.so.1.2.8) ==7895== by 0x51B02B3: ??? (in /usr/lib/libavcodec.so.54.92.100) ==7895== by 0x51B0C6F: ??? (in /usr/lib/libavcodec.so.54.92.100) ==7895== by 0x525EC75: avcodec_encode_video2 (in /usr/lib/libavcodec.so.54.92.100) ==7895== by 0x40113A: main (test.c:98) ==7895== ### packet size: 356047 ==7895== Syscall param write(buf) points to uninitialised byte(s) ==7895== at 0x65741D0: __write_nocancel (in /usr/lib/libc-2.17.so) ==7895== by 0x40119F: main (test.c:102) ==7895== Address 0xbef3efb is 356,027 bytes inside a block of size 356,063 alloc'd ==7895== at 0x4C29B66: memalign (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==7895== by 0x4C29C57: posix_memalign (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==7895== by 0x602C5AC: av_malloc (in /usr/lib/libavutil.so.52.18.100) ==7895== by 0x4F13AB8: ??? (in /usr/lib/libavcodec.so.54.92.100) ==7895== by 0x4F13EBC: av_dup_packet (in /usr/lib/libavcodec.so.54.92.100) ==7895== by 0x525EE2B: avcodec_encode_video2 (in /usr/lib/libavcodec.so.54.92.100) ==7895== by 0x40113A: main (test.c:98) > > int buf_size = avpicture_get_size(PIX_FMT_OUT, WIDTH, HEIGHT); > > uint8_t *buf = malloc(buf_size); > > Does it get better if you allocate more memory? > (FF_INPUT_BUFFER_PADDING_SIZE) No, same problem. I tried malloc'ing buf_size + {1,10,100,1000} * FF_INPUT_BUFFER_PADDING_SIZE. > On some (broken) platforms, you have to use av_malloc() to ensure > sufficient alignment. I replaced all my mallocs with av_mallocs, but it didn't seem to help. Thanks for getting back to me.