From parth.vshah at einfochips.com Mon Sep 1 10:43:18 2014 From: parth.vshah at einfochips.com (Parth V Shah) Date: Mon, 1 Sep 2014 08:43:18 +0000 Subject: [Libav-user] Redirecting MP4 muxed data to socket using movflags resets timestamp Message-ID: I am using FFMPEG library to mux H.264 and AAC frames to MP4 file. I do that C program. I store H.264 and AAC frame's timestamp in epoch format. I use ffprobe to check timestamps that stored in the MP4 file, ffprobe confirms that file is in MP4 format and timestamps are stored correctly. below is the output of ffprobe. * ffprobe -show_packets 20140805095931.mp4 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '20140805095931.mp4': Metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2avc1mp41 encoder : Lavf54.29.104 Duration: 00:01:39.70, start: 1407232771.984000, bitrate: 1063 kb/s Stream #0.0(und): Video: h264 (High), yuv420p, 960x540, 999 kb/s, 30 fps, 59.94 tbr, 1k tbn, 60 tbc Stream #0.1(und): Audio: aac, 48000 Hz, mono, s16, 53 kb/s [PACKET] codec_type=video stream_index=0 pts=1407232771984 pts_time=1407232771.984000 dts=1407232771984 dts_time=1407232771.984000 duration=34 duration_time=0.034000 size=24556.000000 pos=48 flags=K [/PACKET] [PACKET] codec_type=video stream_index=0 pts=1407232772018 pts_time=1407232772.018000 dts=1407232772018 dts_time=1407232772.018000 duration=33 duration_time=0.033000 size=3180.000000 pos=24604 flags=_ [/PACKET] [PACKET] codec_type=video stream_index=0 pts=1407232772051 pts_time=1407232772.051000 dts=1407232772051 dts_time=1407232772.051000 duration=33 duration_time=0.033000 size=3209.000000 pos=27784 flags=_ [/PACKET] My goal is reading this muxed MP4 data from MP4 file and send this muxed mp4 data to the client over socket without creating any temporary file. My actual goal is to write a C program though. I tried using protocols tcp and udp but they are not working with Mp4 format and gives error as below. ffmpeg -i 20140805095931.mp4 -f mp4 -vcodec copy tcp://10.99.19.163:8888 [mp4 @ 0xb1e1920] muxer does not support non seekable output Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument So, I read somewhere about moov atom and tried it with following command ffmpeg -i 20140805095931.mp4 -movflags isml+frag_keyframe -f mp4 -vcodec copy tcp://10.99.19.163:8888 using above commandline I am able to send mp4 file to the client using tcp protocol that ffmpeg supports. But when I apply ffprobe on the MP4 file timestamp resets to 0 , even starttime becomes 0.0000. Below is the output of ffmpeg. * ffprobe -show_packets out.mp4 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'out.mp4': Metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2avc1mp41 encoder : Lavf55.48.100 Duration: 00:01:39.71, start: 0.000000, bitrate: 1059 kb/s Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 960x540, 999 kb/s, 30 fps, 30 tbr, 16k tbn, 60 tbc (default) Metadata: handler_name : VideoHandler Stream #0:1(und): Audio: aac (mp4a / 0x6134706D), 48000 Hz, mono, fltp, 53 kb/s (default) Metadata: handler_name : SoundHandler [PACKET] codec_type=video stream_index=0 pts=0 pts_time=0.000000 dts=0 dts_time=0.000000 duration=533 duration_time=0.033313 convergence_duration=N/A convergence_duration_time=N/A size=24556 pos=3853 flags=K [/PACKET] [PACKET] codec_type=video stream_index=0 pts=544 pts_time=0.034000 dts=544 dts_time=0.034000 duration=533 duration_time=0.033313 convergence_duration=N/A convergence_duration_time=N/A size=3180 pos=28409 flags=_ [/PACKET] [PACKET] codec_type=video stream_index=0 pts=1072 pts_time=0.067000 dts=1072 dts_time=0.067000 duration=533 duration_time=0.033313 convergence_duration=N/A convergence_duration_time=N/A size=3209 pos=31589 flags=_ [/PACKET] Any help or advice? Thank you in advance. ************************************************************************************************************************************************************* eInfochips Business Disclaimer: This e-mail message and all attachments transmitted with it are intended solely for the use of the addressee and may contain legally privileged and confidential information. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution, copying, or other use of this message or its attachments is strictly prohibited. If you have received this message in error, please notify the sender immediately by replying to this message and please delete it from your computer. Any views expressed in this message are those of the individual sender unless otherwise stated. Company has taken enough precautions to prevent the spread of viruses. However the company accepts no liability for any damage caused by any virus transmitted by this email. ************************************************************************************************************************************************************* -------------- next part -------------- An HTML attachment was scrubbed... URL: From nicolas.derouineau at vitec.com Mon Sep 1 16:04:08 2014 From: nicolas.derouineau at vitec.com (Nicolas Derouineau) Date: Mon, 1 Sep 2014 14:04:08 +0000 Subject: [Libav-user] filter_mb_edge Message-ID: <1409580248308.36453@vitec.com> Hello, I would like to understand the prototype of this function: filter_mb_edgeh(uint8_t *pix, int stride, const int16_t bS[4], unsigned int qp, int a, int b, H264Context *h, int intra) Let's say I want to check the filtering condition on p0,1,2 and q0,1,2 . How am I supposed to read the pix buffer to get them ? Regards, Nicolas -------------- next part -------------- An HTML attachment was scrubbed... URL: From nicolas.derouineau at vitec.com Mon Sep 1 16:36:46 2014 From: nicolas.derouineau at vitec.com (Nicolas Derouineau) Date: Mon, 1 Sep 2014 14:36:46 +0000 Subject: [Libav-user] filter_mb_edge In-Reply-To: <1409580248308.36453@vitec.com> References: <1409580248308.36453@vitec.com> Message-ID: <1409582206567.61785@vitec.com> Correct me if I'm wrong: On a 16x16 macroblock, considering abcd are the vertical boundaries, and efgh are the horizontal one: /* Filtering a */ filter_mb_edgev( &img_y[4*0< de la part de Nicolas Derouineau Envoy? : lundi 1 septembre 2014 16:04 ? : libav-user at ffmpeg.org Objet : [Libav-user] filter_mb_edge Hello, I would like to understand the prototype of this function: filter_mb_edgeh(uint8_t *pix, int stride, const int16_t bS[4], unsigned int qp, int a, int b, H264Context *h, int intra) Let's say I want to check the filtering condition on p0,1,2 and q0,1,2 . How am I supposed to read the pix buffer to get them ? Regards, Nicolas -------------- next part -------------- An HTML attachment was scrubbed... URL: From nfxjfg at googlemail.com Mon Sep 1 17:07:52 2014 From: nfxjfg at googlemail.com (wm4) Date: Mon, 1 Sep 2014 17:07:52 +0200 Subject: [Libav-user] filter_mb_edge In-Reply-To: <1409580248308.36453@vitec.com> References: <1409580248308.36453@vitec.com> Message-ID: <20140901170752.6531b288@debian> On Mon, 1 Sep 2014 14:04:08 +0000 Nicolas Derouineau wrote: > Hello, > I would like to understand the prototype of this function: > > filter_mb_edgeh(uint8_t *pix, int stride, > const int16_t bS[4], > unsigned int qp, int a, int b, > H264Context *h, int intra) > > Let's say I want to check the filtering condition on p0,1,2 and q0,1,2 . How am I supposed to read the pix buffer to get them ? I think it's ok to ask such questions on ffmpeg-devel (all questions concerning the development _of_ ffmpeg and libraries are on topic there). From nicolas.derouineau at vitec.com Mon Sep 1 17:24:11 2014 From: nicolas.derouineau at vitec.com (Nicolas Derouineau) Date: Mon, 1 Sep 2014 15:24:11 +0000 Subject: [Libav-user] filter_mb_edge In-Reply-To: <20140901170752.6531b288@debian> References: <1409580248308.36453@vitec.com>,<20140901170752.6531b288@debian> Message-ID: <1409585050832.74640@vitec.com> Hi, I didn't know there was such a list. Thanks for your help ! Regards, Nicolas DEROUINEAU ________________________________________ De : libav-user-bounces at ffmpeg.org de la part de wm4 Envoy? : lundi 1 septembre 2014 17:07 ? : libav-user at ffmpeg.org Objet : Re: [Libav-user] filter_mb_edge On Mon, 1 Sep 2014 14:04:08 +0000 Nicolas Derouineau wrote: > Hello, > I would like to understand the prototype of this function: > > filter_mb_edgeh(uint8_t *pix, int stride, > const int16_t bS[4], > unsigned int qp, int a, int b, > H264Context *h, int intra) > > Let's say I want to check the filtering condition on p0,1,2 and q0,1,2 . How am I supposed to read the pix buffer to get them ? I think it's ok to ask such questions on ffmpeg-devel (all questions concerning the development _of_ ffmpeg and libraries are on topic there). _______________________________________________ Libav-user mailing list Libav-user at ffmpeg.org http://ffmpeg.org/mailman/listinfo/libav-user From soho123.2012 at gmail.com Tue Sep 2 11:48:57 2014 From: soho123.2012 at gmail.com (Diaz Soho) Date: Tue, 2 Sep 2014 17:48:57 +0800 Subject: [Libav-user] how to merge fixed point wma decoder from rockbox to libav 0.7.6 Message-ID: Hi All, Is there anyone have idea about how to merge fixed point wma decoder to libav 0.7.6? because my cpu does not include fpu, when use the wma decoder in libav , it take a lot of cpu time. Or is anyone have merge fixed point wma decoder to libav? Thanks for any input!! -------------- next part -------------- An HTML attachment was scrubbed... URL: From krish.rao.v at gmail.com Tue Sep 2 15:54:10 2014 From: krish.rao.v at gmail.com (Krishna) Date: Tue, 2 Sep 2014 09:54:10 -0400 Subject: [Libav-user] Problem using avcodec_decode_video2 for reading HEVC stream In-Reply-To: <20140829141957.44f00022@debian> References: <20140827233715.57d2e9d5@debian> <20140829141957.44f00022@debian> Message-ID: On Fri, Aug 29, 2014 at 8:19 AM, wm4 wrote: > On Thu, 28 Aug 2014 16:42:50 -0400 > Krishna wrote: > > > Thanks Markus and wm4. I gave your suggestion a shot and this is what I > > did. In my situation, I call the decoder() and expect a frame. However, > the > > decoder will buffer several packets right in the beginning. Since I need > a > > single frame per call, I now keep track of the number of times it read > > packets without decoding (in the beginning). I call this > "numInitPackets". > > > > In the end I flush out that many packets using a null packet. And it > > worked! Thank you so much for your help! > > ah thank you. didnt know that one. but makes sense yes. > > You don't need a counter. Once you have no more packets, you start > feeding the decoder null packets. And once the decoder doesn't return a > new picture, even though you fed it a null packet, you know there are no > more frames in the decoder. > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > [sorry for the late reply] You are spot-on wm4! I got back to work today and tried what you suggested. I examined the value of "gotFrame" in avcodec_decode_video2() and when it is longer "1", it means that the frames have been fully flushed. This works! Thanks everyone for your help on this! -- Regards, Krishna -------------- next part -------------- An HTML attachment was scrubbed... URL: From hpsheng2007 at 163.com Tue Sep 2 16:09:26 2014 From: hpsheng2007 at 163.com (PushengHe) Date: Tue, 02 Sep 2014 22:09:26 +0800 Subject: [Libav-user] how to put the two *.ts stream files multiplexed into a output.ts file? Message-ID: <5405CF96.7020405@163.com> Dear all: how to put the two *.ts stream files multiplexed into a output.ts file about ffmpeg? I have two files,like a.ts and b.ts, I want to multiplex the files to output.ts, so I can play the file of output.ts. Can ffmpeg do it? -- Regards, Simon Ho From treed at what4software.com Wed Sep 3 04:33:46 2014 From: treed at what4software.com (Timothy Reed) Date: Tue, 2 Sep 2014 22:33:46 -0400 Subject: [Libav-user] AV_CODEC_ID_SMPTE_KLV not recognized Message-ID: I?m attempting to do the exact same thing and I too am stuck on the next step. It appears to me that I will need to encode the KLV data into the packets but then how to mux them together? Have you guys made any progress that you can share? Thanks, Tim -------------- next part -------------- An HTML attachment was scrubbed... URL: From p.laponder at canaldigitaal.nl Wed Sep 3 18:30:06 2014 From: p.laponder at canaldigitaal.nl (Irene & Peter Laponder) Date: Wed, 3 Sep 2014 18:30:06 +0200 Subject: [Libav-user] Not all subtitles of video.ts file available In-Reply-To: References: <000301cfc4fd$1709c540$451d4fc0$@canaldigitaal.nl> <000001cfc50d$fc71b1f0$f55515d0$@canaldigitaal.nl> <000001cfc53b$c7cb8560$57629020$@canaldigitaal.nl> Message-ID: <000e01cfc794$5293f830$f7bbe890$@canaldigitaal.nl> >You can try -probesize 2G -analyzeduration 2G (smaller values if you are not just testing) or consider uploading a sample. > >Carl Eugen My reply was blocked because of the 3MB sample. Son ow without attachement: It looks like the extra subtitle streams are decoded as MP3 streams. ---------------------------------------------------- C:\ffmpeg\bin>ffmpeg -i sample.ts -probesize 2G -analyzeduration 2G ffmpeg version N-65991-g8c63a0d Copyright (c) 2000-2014 the FFmpeg developers built on Aug 30 2014 22:02:13 with gcc 4.8.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-libbs2b --enable-libcaca -- enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-lib modplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrw b --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinge r --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --en able-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable- libx265 --enable-libxavs --enable-libxvid --enable-decklink --enable-zlib libavutil 54. 7.100 / 54. 7.100 libavcodec 56. 1.100 / 56. 1.100 libavformat 56. 3.100 / 56. 3.100 libavdevice 56. 0.100 / 56. 0.100 libavfilter 5. 0.103 / 5. 0.103 libswscale 3. 0.100 / 3. 0.100 libswresample 1. 1.100 / 1. 1.100 libpostproc 53. 0.100 / 53. 0.100 Trailing options were found on the commandline. [mpeg2video @ 028fa880] Invalid frame dimensions 0x0. Last message repeated 10 times [mp3 @ 03c8f060] Header missing [mpegts @ 028fdfe0] probed stream 9 failed [mpegts @ 028fdfe0] decoding for stream 8 failed [NULL @ 03797120] start time for stream 7 is not set in estimate_timings_from_pt s [mpegts @ 028fdfe0] PES packet size mismatch [mpegts @ 028fdfe0] Could not find codec parameters for stream 7 (Audio: mp3, 0 channels): unspecified frame size Consider increasing the value for the 'analyzeduration' and 'probesize' options [mpegts @ 028fdfe0] Could not find codec parameters for stream 8 (Audio: mp3, 0 channels, s16p): unspecified frame size Consider increasing the value for the 'analyzeduration' and 'probesize' options [mpegts @ 028fdfe0] Could not find codec parameters for stream 9 (Unknown: none) : unknown codec Consider increasing the value for the 'analyzeduration' and 'probesize' options Input #0, mpegts, from 'sample.ts': Duration: 00:00:07.86, start: 10603.358822, bitrate: 3632 kb/s Program 1 Stream #0:0[0x267]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002), yuv420 p(tv), 720x576 [SAR 64:45 DAR 16:9], 3200 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc Stream #0:1[0x27b](fra): Audio: mp2 ([4][0][0][0] / 0x0004), 48000 Hz, stere o, s16p, 191 kb/s Stream #0:2[0x3a7](rus): Subtitle: dvb_subtitle ([6][0][0][0] / 0x0006) Stream #0:3[0x3a8](eng): Subtitle: dvb_subtitle ([6][0][0][0] / 0x0006) Stream #0:4[0x3ab](esl): Subtitle: dvb_subtitle ([6][0][0][0] / 0x0006) Stream #0:5[0x3a9](deu): Subtitle: dvb_subtitle ([6][0][0][0] / 0x0006) Stream #0:6[0x343](000): Subtitle: dvb_teletext ([6][0][0][0] / 0x0006) No Program Stream #0:7[0x3ac]: Audio: mp3, 0 channels Stream #0:8[0x3aa]: Audio: mp3, 0 channels, s16p Stream #0:9[0x3ae]: Unknown: none At least one output file must be specified ---------------------------------------- Peter Laponder From mrfun.china at gmail.com Fri Sep 5 05:40:15 2014 From: mrfun.china at gmail.com (YIRAN LI) Date: Fri, 5 Sep 2014 13:40:15 +1000 Subject: [Libav-user] what -f psp does Message-ID: Hi, I found in libavformat/movenc.h there's *#define MODE_PSP 0x08 // example working PSP command line:* *// ffmpeg -i testinput.avi -f psp -r 14.985 -s 320x240 -b 768 -ar 24000 -ab 32 M4V00001.MP4* As I know, ffmpeg -f is used to force output format, but if we still need to set frame rate, resolution, bit rate.etc when converting to a PSP compatible mp4, what -f psp does for us? Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: From ffmpeg at gmail.com Fri Sep 5 05:48:12 2014 From: ffmpeg at gmail.com (Geek.Song) Date: Fri, 5 Sep 2014 11:48:12 +0800 Subject: [Libav-user] what -f psp does In-Reply-To: References: Message-ID: On Fri, Sep 5, 2014 at 11:40 AM, YIRAN LI wrote: > Hi, > > I found in libavformat/movenc.h > > there's > > #define MODE_PSP 0x08 // example working PSP command line: > // ffmpeg -i testinput.avi -f psp -r 14.985 -s 320x240 -b 768 -ar 24000 -ab > 32 M4V00001.MP4 > > As I know, ffmpeg -f is used to force output format, but if we still need to > set frame rate, resolution, bit rate.etc when converting to a PSP compatible > mp4, what -f psp does for us? -f format specifies the output format, it would disable the automatic output format detection based on the suffix name. -- ----------------------------------------------------------------------------------------- My key fingerprint: d1:03:f5:32:26:ff:d7:3c:e4:42:e3:51:ec:92:78:b2 From mrfun.china at gmail.com Fri Sep 5 05:52:40 2014 From: mrfun.china at gmail.com (YIRAN LI) Date: Fri, 5 Sep 2014 13:52:40 +1000 Subject: [Libav-user] what -f psp does In-Reply-To: References: Message-ID: So it's not like target which I know automatically apply resolution, bitrate, framerate at least on DVD output. So with -f, you need to manually supply all needed arguments. 2014-09-05 13:48 GMT+10:00 Geek.Song : > On Fri, Sep 5, 2014 at 11:40 AM, YIRAN LI wrote: > > Hi, > > > > I found in libavformat/movenc.h > > > > there's > > > > #define MODE_PSP 0x08 // example working PSP command line: > > // ffmpeg -i testinput.avi -f psp -r 14.985 -s 320x240 -b 768 -ar 24000 > -ab > > 32 M4V00001.MP4 > > > > As I know, ffmpeg -f is used to force output format, but if we still > need to > > set frame rate, resolution, bit rate.etc when converting to a PSP > compatible > > mp4, what -f psp does for us? > > -f format specifies the output format, it would disable the automatic > output format detection based on the suffix name. > > -- > > ----------------------------------------------------------------------------------------- > My key fingerprint: d1:03:f5:32:26:ff:d7:3c:e4:42:e3:51:ec:92:78:b2 > _______________________________________________ > 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 ffmpeg at gmail.com Fri Sep 5 06:03:46 2014 From: ffmpeg at gmail.com (Geek.Song) Date: Fri, 5 Sep 2014 12:03:46 +0800 Subject: [Libav-user] what -f psp does In-Reply-To: References: Message-ID: On Fri, Sep 5, 2014 at 11:52 AM, YIRAN LI wrote: > So it's not like target which I know automatically apply resolution, > bitrate, framerate at least on DVD output. So with -f, you need to manually > supply all needed arguments. > Basically YES. -- ----------------------------------------------------------------------------------------- My key fingerprint: d1:03:f5:32:26:ff:d7:3c:e4:42:e3:51:ec:92:78:b2 From mrfun.china at gmail.com Fri Sep 5 06:07:32 2014 From: mrfun.china at gmail.com (YIRAN LI) Date: Fri, 5 Sep 2014 14:07:32 +1000 Subject: [Libav-user] what -f psp does In-Reply-To: References: Message-ID: Good, many thanks :D 2014-09-05 14:03 GMT+10:00 Geek.Song : > On Fri, Sep 5, 2014 at 11:52 AM, YIRAN LI wrote: > > So it's not like target which I know automatically apply resolution, > > bitrate, framerate at least on DVD output. So with -f, you need to > manually > > supply all needed arguments. > > > > Basically YES. > > -- > > ----------------------------------------------------------------------------------------- > My key fingerprint: d1:03:f5:32:26:ff:d7:3c:e4:42:e3:51:ec:92:78:b2 > _______________________________________________ > 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 Fri Sep 5 14:45:43 2014 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Fri, 5 Sep 2014 12:45:43 +0000 (UTC) Subject: [Libav-user] what -f psp does References: Message-ID: YIRAN LI writes: > So it's not like target which I know automatically > apply resolution, bitrate, framerate at least on > DVD output. So with -f, you need to manually supply > all needed arguments. -f only affects the muxer, ie it (automatically) sets some muxer options, target can affect both encoder and muxer (and it can force a muxer). If you look at the source (ffmpeg_opt.c opt_target()), you will see that target is a very simple thing and that you can add targets, one for psp may be welcome! Carl Eugen From pross at xvid.org Fri Sep 5 15:30:15 2014 From: pross at xvid.org (Peter Ross) Date: Fri, 5 Sep 2014 23:30:15 +1000 Subject: [Libav-user] AV_CODEC_ID_SMPTE_KLV not recognized In-Reply-To: References: Message-ID: <20140905133015.GA17346@7723b8eee3abb5bc88be408764d4e8f5> On Tue, Sep 02, 2014 at 10:33:46PM -0400, Timothy Reed wrote: > I?m attempting to do the exact same thing and I too am stuck on the next step. It appears to me that I will need to encode the KLV data into the packets but then how to mux them together? Correct. FFmpeg has no 'KLV encoder'. > > Have you guys made any progress that you can share? Before calling avformat_write_header(), you need to manually create a KLV stream. st = avformat_new_stream(s, NULL) st->id = _pick_a_number st->codec->codec_type = AVMEDIA_TYPE_DATA st->codec->codec_id = AV_CODEC_ID_SMPTE_KLV [...] avformat_write_header(s); Then to output klv frame, you need to create an AVPacket and call av_write_frame() AVPacket pkt av_new_packet(&pkt, _data_size_) pkt.stream_index = _pick_a_number_ // load klv data into pkt.data av_write_frame(s, &pkt) Note everything above is untested pseudo code. You probably also need to set stream and packet pts. -- Peter (A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B) -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 181 bytes Desc: Digital signature URL: From treed at what4software.com Fri Sep 5 15:47:09 2014 From: treed at what4software.com (Timothy Reed) Date: Fri, 5 Sep 2014 09:47:09 -0400 Subject: [Libav-user] AV_CODEC_ID_SMPTE_KLV not recognized In-Reply-To: <20140905133015.GA17346@7723b8eee3abb5bc88be408764d4e8f5> References: <20140905133015.GA17346@7723b8eee3abb5bc88be408764d4e8f5> Message-ID: <15011C5F-3A3F-4D00-8563-8A8D1F7F34AC@what4software.com> Great thanks. The first part was what I was missing regarding the header. I figured out the packet stuff yesterday. Now to carefully package the data in the packet for writing to the file. Sent from my iPhone > On Sep 5, 2014, at 9:30, Peter Ross wrote: > >> On Tue, Sep 02, 2014 at 10:33:46PM -0400, Timothy Reed wrote: >> I?m attempting to do the exact same thing and I too am stuck on the next step. It appears to me that I will need to encode the KLV data into the packets but then how to mux them together? > > Correct. FFmpeg has no 'KLV encoder'. >> >> Have you guys made any progress that you can share? > > Before calling avformat_write_header(), you need to manually create a KLV stream. > > st = avformat_new_stream(s, NULL) > st->id = _pick_a_number > st->codec->codec_type = AVMEDIA_TYPE_DATA > st->codec->codec_id = AV_CODEC_ID_SMPTE_KLV > [...] > avformat_write_header(s); > > Then to output klv frame, you need to create an AVPacket and call av_write_frame() > > AVPacket pkt > av_new_packet(&pkt, _data_size_) > pkt.stream_index = _pick_a_number_ > // load klv data into pkt.data > av_write_frame(s, &pkt) > > Note everything above is untested pseudo code. You probably also need to set stream and packet pts. > > -- Peter > (A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B) > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user From wadkes93 at gmail.com Sat Sep 6 08:27:04 2014 From: wadkes93 at gmail.com (Ankush) Date: Sat, 6 Sep 2014 11:57:04 +0530 Subject: [Libav-user] MTS Seeking Issue Message-ID: <540aa945.4689460a.7eba.ffffb568@mx.google.com> Hear is a file i have on which av_seek_frame updates the pos value to 768. no matter where i try to seek it seeks to this very position and there are series of files i have with which i am facing the same problem. Below i have added the media info of the file. Any help with this would be really helpful. Thankyou General ID : 0 (0x0) Complete name : K:\HDVideos\00045.MTS Format : BDAV Format/Info : Blu-ray Video File size : 1.98 GiB Duration : 12mn 44s Overall bit rate mode : Variable Overall bit rate : 22.2 Mbps Maximum Overall bit rate : 24.0 Mbps Video ID : 4113 (0x1011) Menu ID : 1 (0x1) Format : AVC Format/Info : Advanced Video Codec Format profile : High at L4.0 Format settings, CABAC : Yes Format settings, ReFrames : 2 frames Format settings, GOP : M=2, N=13 Codec ID : 27 Duration : 12mn 44s Bit rate mode : Variable Bit rate : 21.1 Mbps Maximum bit rate : 22.0 Mbps Width : 1 920 pixels Height : 1 080 pixels Display aspect ratio : 16:9 Frame rate : 25.000 fps Color space : YUV Chroma subsampling : 4:2:0 Bit depth : 8 bits Scan type : Interlaced Scan order : Top Field First Bits/(Pixel*Frame) : 0.407 Stream size : 1.88 GiB (95%) Audio ID : 4352 (0x1100) Menu ID : 1 (0x1) Format : AC-3 Format/Info : Audio Coding 3 Mode extension : CM (complete main) Format settings, Endianness : Big Codec ID : 129 Duration : 12mn 44s Bit rate mode : Constant Bit rate : 256 Kbps Channel(s) : 2 channels Channel positions : Front: L R Sampling rate : 48.0 KHz Bit depth : 16 bits Compression mode : Lossy Delay relative to video : -608ms Stream size : 23.3 MiB (1%) -------------- next part -------------- An HTML attachment was scrubbed... URL: From ranshalit at gmail.com Sat Sep 6 20:09:10 2014 From: ranshalit at gmail.com (Ran Shalit) Date: Sat, 6 Sep 2014 21:09:10 +0300 Subject: [Libav-user] SMPTE 336m Message-ID: Hello, Does libavformat supports SMPTE 336m for MPEG-TS or only for MXF ? Thanks, Ran From pross at xvid.org Sun Sep 7 02:23:40 2014 From: pross at xvid.org (Peter Ross) Date: Sun, 7 Sep 2014 10:23:40 +1000 Subject: [Libav-user] SMPTE 336m In-Reply-To: References: Message-ID: <20140907002340.GA3214@7723b8eee3abb5bc88be408764d4e8f5> On Sat, Sep 06, 2014 at 09:09:10PM +0300, Ran Shalit wrote: > Hello, > > Does libavformat supports SMPTE 336m for MPEG-TS or only for MXF ? 1. AV_CODEC_ID_SMPTE_KLV is supported by the MPEG-TS. libavformat can mux and demux SMPTE 336M *streams*. 2. There are no codecs for manipulating the AV_CODEC_ID_SMPTE_KLV packets. 3. The MXF format uses SMPTE 336M data structures. So when processing MXF files, libavformat also needs to read/write SMPTE 336M data structures. There are functions inside mxf*c for achieving this. -- Peter (A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B) -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 181 bytes Desc: Digital signature URL: From ranshalit at gmail.com Sun Sep 7 05:54:54 2014 From: ranshalit at gmail.com (Ran Shalit) Date: Sun, 7 Sep 2014 06:54:54 +0300 Subject: [Libav-user] SMPTE 336m In-Reply-To: <20140907002340.GA3214@7723b8eee3abb5bc88be408764d4e8f5> References: <20140907002340.GA3214@7723b8eee3abb5bc88be408764d4e8f5> Message-ID: >> >> Does libavformat supports SMPTE 336m for MPEG-TS or only for MXF ? > > 1. AV_CODEC_ID_SMPTE_KLV is supported by the MPEG-TS. libavformat can > mux and demux SMPTE 336M *streams*. > > 2. There are no codecs for manipulating the AV_CODEC_ID_SMPTE_KLV packets. > > 3. The MXF format uses SMPTE 336M data structures. So when processing MXF > files, libavformat also needs to read/write SMPTE 336M data structures. > There are functions inside mxf*c for achieving this. > How should I use libavformat to create the MXF with the KLV metadata and how should I use libavformat to parse the KLV metadata from the video file? Thanks, Ran From pross at xvid.org Sun Sep 7 07:38:27 2014 From: pross at xvid.org (Peter Ross) Date: Sun, 7 Sep 2014 15:38:27 +1000 Subject: [Libav-user] SMPTE 336m In-Reply-To: References: <20140907002340.GA3214@7723b8eee3abb5bc88be408764d4e8f5> Message-ID: <20140907053827.GA9749@7723b8eee3abb5bc88be408764d4e8f5> On Sun, Sep 07, 2014 at 06:54:54AM +0300, Ran Shalit wrote: > >> > >> Does libavformat supports SMPTE 336m for MPEG-TS or only for MXF ? > > > > 1. AV_CODEC_ID_SMPTE_KLV is supported by the MPEG-TS. libavformat can > > mux and demux SMPTE 336M *streams*. > > > > 2. There are no codecs for manipulating the AV_CODEC_ID_SMPTE_KLV packets. > > > > 3. The MXF format uses SMPTE 336M data structures. So when processing MXF > > files, libavformat also needs to read/write SMPTE 336M data structures. > > There are functions inside mxf*c for achieving this. > > > > How should I use libavformat to create the MXF with the KLV metadata > and how should I use libavformat to parse the KLV metadata from the > video file? Adding user metadata to MXF is not currently supported. KLV processing is _internal_ to mxfenc.c and mxfdec.c. -- Peter (A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B) -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 181 bytes Desc: Digital signature URL: From ranshalit at gmail.com Sun Sep 7 08:06:36 2014 From: ranshalit at gmail.com (Ran Shalit) Date: Sun, 7 Sep 2014 09:06:36 +0300 Subject: [Libav-user] SMPTE 336m In-Reply-To: <20140907053827.GA9749@7723b8eee3abb5bc88be408764d4e8f5> References: <20140907002340.GA3214@7723b8eee3abb5bc88be408764d4e8f5> <20140907053827.GA9749@7723b8eee3abb5bc88be408764d4e8f5> Message-ID: > > Adding user metadata to MXF is not currently supported. > > KLV processing is _internal_ to mxfenc.c and mxfdec.c. > Hi Peter, What is the internal metadata that MXF process ? Is there some way to modify it to use user metadata instead? Is KLV from user supported in any other formats (mpeg-ts) ? Are you familiar with other methods or libraries that support KLV from user ? Thanks, Ran From sam.verschueren at gmail.com Sun Sep 7 14:48:51 2014 From: sam.verschueren at gmail.com (Sam Verschueren) Date: Sun, 7 Sep 2014 14:48:51 +0200 Subject: [Libav-user] Convert mp4 to audio Message-ID: Hi devs I am working on an application that converts an mp4 file to an audio file. I want it to be converted to an mp3 file. At github I found this code: https://github.com/cpawelzik/libcpxvta and it works well, but only for ogg files. If I change the target format to mp3, it hangs at the avcodec_encode_audio2(). So the log line before avcodec_encode_audio2() is printed, but the log line after that is not printed. Anyone has an idea on why this is the case? Thanks in advance! -------------- next part -------------- An HTML attachment was scrubbed... URL: From ranshalit at gmail.com Sun Sep 7 16:57:34 2014 From: ranshalit at gmail.com (Ran Shalit) Date: Sun, 7 Sep 2014 17:57:34 +0300 Subject: [Libav-user] SMPTE 336m In-Reply-To: <20140907053827.GA9749@7723b8eee3abb5bc88be408764d4e8f5> References: <20140907002340.GA3214@7723b8eee3abb5bc88be408764d4e8f5> <20140907053827.GA9749@7723b8eee3abb5bc88be408764d4e8f5> Message-ID: > > KLV processing is _internal_ to mxfenc.c and mxfdec.c. > > -- Peter Hi , One more on this if I may. Are these internal KLV packets sent only once at the start of transcoding or can be sent during transcoding more than once ? Thanks! Ran From anmiodoherty at gmail.com Mon Sep 8 23:18:41 2014 From: anmiodoherty at gmail.com (Mick O'Doherty) Date: Mon, 8 Sep 2014 22:18:41 +0100 Subject: [Libav-user] Adding an audio track to a video Message-ID: Hi, I have tried searching the archive for this list (using google - if there is a better way, please let me know) and could not find an answer to my question, so I will post it here. I am trying to find some examples or guidelines that help show how to add an audio track to a video programatically using ffmpeg API's (i.e. the C API's not the command line). I did this a few years ago using the command line approach wrapped in a script - the command, which worked fine, was: fmpeg -y -i OriginalvideoFile.mp4 -vcodec copy -i Mp3AudioFile.mp3 -acodec copy resultVideoFile.mp4 I'd like to achieve the same thing but this time use the appropriate API calls from a C program. Any pointers gratefully appreciated. Mick -------------- next part -------------- An HTML attachment was scrubbed... URL: From pross at xvid.org Tue Sep 9 14:53:10 2014 From: pross at xvid.org (Peter Ross) Date: Tue, 9 Sep 2014 22:53:10 +1000 Subject: [Libav-user] SMPTE 336m In-Reply-To: References: <20140907002340.GA3214@7723b8eee3abb5bc88be408764d4e8f5> <20140907053827.GA9749@7723b8eee3abb5bc88be408764d4e8f5> Message-ID: <20140909125310.GA4400@7723b8eee3abb5bc88be408764d4e8f5> On Sun, Sep 07, 2014 at 09:06:36AM +0300, Ran Shalit wrote: > > > > Adding user metadata to MXF is not currently supported. > > > > KLV processing is _internal_ to mxfenc.c and mxfdec.c. > > > > Hi Peter, > > What is the internal metadata that MXF process ? Is there some way to > modify it to use user metadata instead? The MXF _file format_ is essentially a series of KLV packets. Yes it is possible to add additional KLV packets. You would need to modify libavformat/mxf*. However I am unware of any systems capable of processing such files. > Is KLV from user supported in any other formats (mpeg-ts) ? Yes FFmpeg mpegts muxer and demuxer supports this. Also samples here: http://samples.ffmpeg.org/MPEG2/mpegts-klv/ > Are you familiar with other methods or libraries that support KLV from user ? No. -- Peter (A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B) -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 181 bytes Desc: Digital signature URL: From pross at xvid.org Tue Sep 9 15:02:11 2014 From: pross at xvid.org (Peter Ross) Date: Tue, 9 Sep 2014 23:02:11 +1000 Subject: [Libav-user] SMPTE 336m In-Reply-To: References: <20140907002340.GA3214@7723b8eee3abb5bc88be408764d4e8f5> <20140907053827.GA9749@7723b8eee3abb5bc88be408764d4e8f5> Message-ID: <20140909130211.GB4400@7723b8eee3abb5bc88be408764d4e8f5> On Sun, Sep 07, 2014 at 05:57:34PM +0300, Ran Shalit wrote: > > > > KLV processing is _internal_ to mxfenc.c and mxfdec.c. > > > > -- Peter > > Hi , > One more on this if I may. Are these internal KLV packets sent only > once at the start of transcoding or can be sent during transcoding > more than once ? In MXF each *video frame* is stored within an individual KLV packet. So yes, 'more than once'! -- Peter (A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B) -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 181 bytes Desc: Digital signature URL: From ranshalit at gmail.com Tue Sep 9 15:23:24 2014 From: ranshalit at gmail.com (Ran Shalit) Date: Tue, 9 Sep 2014 16:23:24 +0300 Subject: [Libav-user] SMPTE 336m In-Reply-To: <20140909130211.GB4400@7723b8eee3abb5bc88be408764d4e8f5> References: <20140907002340.GA3214@7723b8eee3abb5bc88be408764d4e8f5> <20140907053827.GA9749@7723b8eee3abb5bc88be408764d4e8f5> <20140909130211.GB4400@7723b8eee3abb5bc88be408764d4e8f5> Message-ID: >> Are these internal KLV packets sent only >> once at the start of transcoding or can be sent during transcoding >> more than once ? >In MXF each *video frame* is stored within an individual KLV packet. >So yes, 'more than once'! Is it possible to retrieve or view the KLV metadata in ffplay ? i.e. I want to do some validation check on KLV with XMF, is that possible ? Thanks again, Ran From adrozdoff at gmail.com Wed Sep 10 03:37:19 2014 From: adrozdoff at gmail.com (Alexander Drozdov) Date: Wed, 10 Sep 2014 12:37:19 +1100 Subject: [Libav-user] RTMP Play file descriptor leak Message-ID: Hi! In our project we uses FFmpeg to demux RTMP streams. Input stream takes from Wowza/nginx-rtmp. Our application is a daemon that try to connect to source periodicaly if it does not present (does not published to Wowza, for example). We also use interrupt callback to break connection if timeout is occured. So in this situation: - Alive server - Alive streaming application - Configured inerrupt callback with timeout - Disalive stream TCP socket to server does not closes. I look into code with debugger and found place where error is occured: rtmpproto.c, rtmp_open() L:2672 Root couse: return from function without resources clean up Solution: replace return with 'goto fail' Path is attached. -- WBR, Alexander Drozdov http://htrd.su -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- --- old/libavformat/rtmpproto.c 2014-09-09 17:53:51.689708377 +1100 +++ orig/libavformat/rtmpproto.c 2014-09-09 17:54:05.833530565 +1100 @@ -2670,7 +2670,7 @@ // audio or video packet arrives. while (!rt->has_audio && !rt->has_video && !rt->received_metadata) { if ((ret = get_packet(s, 0)) < 0) - return ret; + goto fail; } // Either after we have read the metadata or (if there is none) the From arash.cordi at gmail.com Wed Sep 10 10:03:36 2014 From: arash.cordi at gmail.com (Arash Cordi) Date: Wed, 10 Sep 2014 12:33:36 +0430 Subject: [Libav-user] setting multicast options in avio_open() Message-ID: hi all, I know i can set IP_MULTICAST_TTL using ttl=x in avio_opn() uri but how about IP_MULTICAST_IF and IP_MULTICAST_LOOP? is there any reason why these options are not implemented? -- ArasH -------------- next part -------------- An HTML attachment was scrubbed... URL: From hawkwithwind at gmail.com Wed Sep 10 13:00:13 2014 From: hawkwithwind at gmail.com (Peter Pan) Date: Wed, 10 Sep 2014 19:00:13 +0800 Subject: [Libav-user] problem while creating sdp with h264/opus encoding Message-ID: Hi I'm trying to use libavformat as RTSP client for pushing stream to server. I'm using Darwin Streaming Server. I'm using h264/opus encoding. I find a problem that the sdp file always set audio sampling rate to 48000hz, no matter how I set the AVFormatContext before avformat_write_header() call. the sdp file looks like below: v=0 o=- 0 0 IN IP4 127.0.0.1 s=No Name c=IN IP4 121.***.***.*** t=0 0 a=tool:libavformat 55.48.100 m=video 0 RTP/AVP 96 b=AS:128 a=rtpmap:96 H264/90000 a=fmtp:96 packetization-mode=1 a=control:streamid=0 m=audio 0 RTP/AVP 97 b=AS:16 a=rtpmap:97 opus/48000 a=control:streamid=1 I find that in libavformat/sdp.c file, the 48000 is hard coded. Is this what meant to be? (I've masked out the real ip address) case AV_CODEC_ID_OPUS: av_strlcatf(buff, size, "a=rtpmap:%d opus/48000\r\n", payload_type); break; comparing to speex case branch: case AV_CODEC_ID_SPEEX: av_strlcatf(buff, size, "a=rtpmap:%d speex/%d\r\n", payload_type, c->sample_rate); it is using the real sample rate, what confused me. below is my code, if there's any mistake please tell me, I just learn to use avlibs recently. I referenced mostly from this link https://www.ffmpeg.org/doxygen/0.6/output-example_8c-source.html int live_rtsp_start(int fps){ AVOutputFormat *fmt; int ret; const int buffsize = 1024; char logbuff[buffsize]; char server[buffsize]; av_register_all(); avformat_network_init(); //oc = avformat_alloc_context(); snprintf(server, buffsize, "rtsp://%s/%s", "121.***.***.***", "live12.sdp"); avformat_alloc_output_context2(&oc, 0, "rtsp", server); if (!oc) { androidlog("memory error"); return -1; } androidlog(oc->filename); //create video stream AVStream * v_stream = avformat_new_stream(oc, NULL); if(!v_stream){ return -4; } v_stream->id = 0; AVCodecContext* codec = v_stream->codec; codec->codec_id = CODEC_ID_H264; codec->codec_type = AVMEDIA_TYPE_VIDEO; codec->width = out_width; codec->height = out_height; codec->time_base.den = 1; codec->time_base.num = fps; if(oc->oformat->flags & AVFMT_GLOBALHEADER){ codec->flags != CODEC_FLAG_GLOBAL_HEADER; } //create audio stream AVStream * a_stream = avformat_new_stream(oc, NULL); if(!a_stream){ return -5; } a_stream->id = 1; AVCodecContext* a_codec = a_stream->codec; a_codec->codec_type = AVMEDIA_TYPE_AUDIO; a_codec->codec_id = CODEC_ID_OPUS; a_codec->channels = 1; a_codec->sample_rate = 8000; a_codec->time_base = (AVRational){1, a_codec->sample_rate}; a_codec->frame_size = 320; a_codec->bit_rate = 16000; //a_codec->codec_tag = av_codec_get_tag(oc, CODEC_ID_OPUS); if(oc->oformat->flags & AVFMT_GLOBALHEADER){ a_codec->flags != CODEC_FLAG_GLOBAL_HEADER; } av_dump_format(oc, 0, server ,1); androidlog("write header\n"); ret = avformat_write_header(oc, NULL); if(ret < 0){ av_strerror(ret, logbuff, buffsize); androidlog("avformat_write_header err\n"); androidlog(logbuff); return ret; } } Thanks, Peter -------------- next part -------------- An HTML attachment was scrubbed... URL: From pross at xvid.org Wed Sep 10 13:44:26 2014 From: pross at xvid.org (Peter Ross) Date: Wed, 10 Sep 2014 21:44:26 +1000 Subject: [Libav-user] SMPTE 336m In-Reply-To: References: <20140907002340.GA3214@7723b8eee3abb5bc88be408764d4e8f5> <20140907053827.GA9749@7723b8eee3abb5bc88be408764d4e8f5> <20140909130211.GB4400@7723b8eee3abb5bc88be408764d4e8f5> Message-ID: <20140910114426.GA14974@7723b8eee3abb5bc88be408764d4e8f5> On Tue, Sep 09, 2014 at 04:23:24PM +0300, Ran Shalit wrote: > >> Are these internal KLV packets sent only > >> once at the start of transcoding or can be sent during transcoding > >> more than once ? > > >In MXF each *video frame* is stored within an individual KLV packet. > >So yes, 'more than once'! > > Is it possible to retrieve or view the KLV metadata in ffplay ? i.e. I > want to do some validation check on KLV with XMF, is that possible ? Nothing like that is implemented in ffplay. -- Peter (A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B) -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 181 bytes Desc: Digital signature URL: From ranshalit at gmail.com Wed Sep 10 14:11:25 2014 From: ranshalit at gmail.com (Ran Shalit) Date: Wed, 10 Sep 2014 15:11:25 +0300 Subject: [Libav-user] SMPTE 336m In-Reply-To: <20140910114426.GA14974@7723b8eee3abb5bc88be408764d4e8f5> References: <20140907002340.GA3214@7723b8eee3abb5bc88be408764d4e8f5> <20140907053827.GA9749@7723b8eee3abb5bc88be408764d4e8f5> <20140909130211.GB4400@7723b8eee3abb5bc88be408764d4e8f5> <20140910114426.GA14974@7723b8eee3abb5bc88be408764d4e8f5> Message-ID: On Wed, Sep 10, 2014 at 2:44 PM, Peter Ross wrote: > On Tue, Sep 09, 2014 at 04:23:24PM +0300, Ran Shalit wrote: >> >> Are these internal KLV packets sent only >> >> once at the start of transcoding or can be sent during transcoding >> >> more than once ? >> >> >In MXF each *video frame* is stored within an individual KLV packet. >> >So yes, 'more than once'! >> >> Is it possible to retrieve or view the KLV metadata in ffplay ? i.e. I >> want to do some validation check on KLV with XMF, is that possible ? > > Nothing like that is implemented in ffplay. > > -- Peter > (A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B) Hi Peter, Is there any way I can validate that the packets include KLV metadata ? Or is the only way to do it is by debugging/printing of ffmpeg MXF mux with KLV ,and demux on MXF video with supposed KLV info. Thanks, Ran From pross at xvid.org Wed Sep 10 15:15:25 2014 From: pross at xvid.org (Peter Ross) Date: Wed, 10 Sep 2014 23:15:25 +1000 Subject: [Libav-user] SMPTE 336m In-Reply-To: References: <20140907002340.GA3214@7723b8eee3abb5bc88be408764d4e8f5> <20140907053827.GA9749@7723b8eee3abb5bc88be408764d4e8f5> <20140909130211.GB4400@7723b8eee3abb5bc88be408764d4e8f5> <20140910114426.GA14974@7723b8eee3abb5bc88be408764d4e8f5> Message-ID: <20140910131525.GA19460@7723b8eee3abb5bc88be408764d4e8f5> On Wed, Sep 10, 2014 at 03:11:25PM +0300, Ran Shalit wrote: > On Wed, Sep 10, 2014 at 2:44 PM, Peter Ross wrote: > > On Tue, Sep 09, 2014 at 04:23:24PM +0300, Ran Shalit wrote: > >> >> Are these internal KLV packets sent only > >> >> once at the start of transcoding or can be sent during transcoding > >> >> more than once ? > >> > >> >In MXF each *video frame* is stored within an individual KLV packet. > >> >So yes, 'more than once'! > >> > >> Is it possible to retrieve or view the KLV metadata in ffplay ? i.e. I > >> want to do some validation check on KLV with XMF, is that possible ? > > > > Nothing like that is implemented in ffplay. > > > > -- Peter > > (A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B) > > Hi Peter, > > Is there any way I can validate that the packets include KLV metadata ? Nothing like that is implemented in FFmpeg. You need find a proper MXF validation tool. I can't recommend any, but searching the web for 'MXF validator' or 'MXF analyser' returns a lot of hits. > Or is the only way to do it is by debugging/printing of ffmpeg MXF mux > with KLV ,and demux on MXF video with supposed KLV info. That approach might work. Good luck. -- Peter (A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B) -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 181 bytes Desc: Digital signature URL: From ranshalit at gmail.com Wed Sep 10 16:52:51 2014 From: ranshalit at gmail.com (Ran Shalit) Date: Wed, 10 Sep 2014 17:52:51 +0300 Subject: [Libav-user] SMPTE 336m In-Reply-To: <20140910131525.GA19460@7723b8eee3abb5bc88be408764d4e8f5> References: <20140907002340.GA3214@7723b8eee3abb5bc88be408764d4e8f5> <20140907053827.GA9749@7723b8eee3abb5bc88be408764d4e8f5> <20140909130211.GB4400@7723b8eee3abb5bc88be408764d4e8f5> <20140910114426.GA14974@7723b8eee3abb5bc88be408764d4e8f5> <20140910131525.GA19460@7723b8eee3abb5bc88be408764d4e8f5> Message-ID: On Wed, Sep 10, 2014 at 4:15 PM, Peter Ross wrote: > On Wed, Sep 10, 2014 at 03:11:25PM +0300, Ran Shalit wrote: >> On Wed, Sep 10, 2014 at 2:44 PM, Peter Ross wrote: >> > On Tue, Sep 09, 2014 at 04:23:24PM +0300, Ran Shalit wrote: >> >> >> Are these internal KLV packets sent only >> >> >> once at the start of transcoding or can be sent during transcoding >> >> >> more than once ? >> >> >> >> >In MXF each *video frame* is stored within an individual KLV packet. >> >> >So yes, 'more than once'! >> >> >> >> Is it possible to retrieve or view the KLV metadata in ffplay ? i.e. I >> >> want to do some validation check on KLV with XMF, is that possible ? >> > >> > Nothing like that is implemented in ffplay. >> > >> > -- Peter >> > (A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B) >> >> Hi Peter, >> >> Is there any way I can validate that the packets include KLV metadata ? > > Nothing like that is implemented in FFmpeg. > > You need find a proper MXF validation tool. I can't recommend any, but searching > the web for 'MXF validator' or 'MXF analyser' returns a lot of hits. > >> Or is the only way to do it is by debugging/printing of ffmpeg MXF mux >> with KLV ,and demux on MXF video with supposed KLV info. > > That approach might work. Good luck. > > -- Peter > (A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B) Ok, Thanks, I'll go on from this point. I hope ffmpeg developers will add KLV capabilities to ffmpeg in the future. Thanks a lot. Ran From markuspfundstein86 at gmail.com Wed Sep 10 16:54:23 2014 From: markuspfundstein86 at gmail.com (Markus Pfundstein) Date: Wed, 10 Sep 2014 16:54:23 +0200 Subject: [Libav-user] SMPTE 336m In-Reply-To: References: <20140907002340.GA3214@7723b8eee3abb5bc88be408764d4e8f5> <20140907053827.GA9749@7723b8eee3abb5bc88be408764d4e8f5> <20140909130211.GB4400@7723b8eee3abb5bc88be408764d4e8f5> <20140910114426.GA14974@7723b8eee3abb5bc88be408764d4e8f5> <20140910131525.GA19460@7723b8eee3abb5bc88be408764d4e8f5> Message-ID: Maybe you could while you are at it :-) On 10 Sep 2014, at 16:52, Ran Shalit wrote: > On Wed, Sep 10, 2014 at 4:15 PM, Peter Ross wrote: >> On Wed, Sep 10, 2014 at 03:11:25PM +0300, Ran Shalit wrote: >>> On Wed, Sep 10, 2014 at 2:44 PM, Peter Ross wrote: >>>> On Tue, Sep 09, 2014 at 04:23:24PM +0300, Ran Shalit wrote: >>>>>>> Are these internal KLV packets sent only >>>>>>> once at the start of transcoding or can be sent during transcoding >>>>>>> more than once ? >>>>> >>>>>> In MXF each *video frame* is stored within an individual KLV packet. >>>>>> So yes, 'more than once'! >>>>> >>>>> Is it possible to retrieve or view the KLV metadata in ffplay ? i.e. I >>>>> want to do some validation check on KLV with XMF, is that possible ? >>>> >>>> Nothing like that is implemented in ffplay. >>>> >>>> -- Peter >>>> (A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B) >>> >>> Hi Peter, >>> >>> Is there any way I can validate that the packets include KLV metadata ? >> >> Nothing like that is implemented in FFmpeg. >> >> You need find a proper MXF validation tool. I can't recommend any, but searching >> the web for 'MXF validator' or 'MXF analyser' returns a lot of hits. >> >>> Or is the only way to do it is by debugging/printing of ffmpeg MXF mux >>> with KLV ,and demux on MXF video with supposed KLV info. >> >> That approach might work. Good luck. >> >> -- Peter >> (A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B) > > Ok, Thanks, I'll go on from this point. > I hope ffmpeg developers will add KLV capabilities to ffmpeg in the future. > > Thanks a lot. Ran > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user From ranshalit at gmail.com Wed Sep 10 18:06:05 2014 From: ranshalit at gmail.com (Ran Shalit) Date: Wed, 10 Sep 2014 19:06:05 +0300 Subject: [Libav-user] SMPTE 336m In-Reply-To: References: <20140907002340.GA3214@7723b8eee3abb5bc88be408764d4e8f5> <20140907053827.GA9749@7723b8eee3abb5bc88be408764d4e8f5> <20140909130211.GB4400@7723b8eee3abb5bc88be408764d4e8f5> <20140910114426.GA14974@7723b8eee3abb5bc88be408764d4e8f5> <20140910131525.GA19460@7723b8eee3abb5bc88be408764d4e8f5> Message-ID: On 10 ?Sep 2014 17:54, "Markus Pfundstein" wrote: > > Maybe you could while you are at it :-) If I get to something good... By the way, I saw that BBC group suggested ffmpeg to integrate BBCs libMXF and libKLV instead of nstive ffmpeg MXF. Sadly, it did not happen... > > On 10 Sep 2014, at 16:52, Ran Shalit wrote: > > > On Wed, Sep 10, 2014 at 4:15 PM, Peter Ross wrote: > >> On Wed, Sep 10, 2014 at 03:11:25PM +0300, Ran Shalit wrote: > >>> On Wed, Sep 10, 2014 at 2:44 PM, Peter Ross wrote: > >>>> On Tue, Sep 09, 2014 at 04:23:24PM +0300, Ran Shalit wrote: > >>>>>>> Are these internal KLV packets sent only > >>>>>>> once at the start of transcoding or can be sent during transcoding > >>>>>>> more than once ? > >>>>> > >>>>>> In MXF each *video frame* is stored within an individual KLV packet. > >>>>>> So yes, 'more than once'! > >>>>> > >>>>> Is it possible to retrieve or view the KLV metadata in ffplay ? i.e. I > >>>>> want to do some validation check on KLV with XMF, is that possible ? > >>>> > >>>> Nothing like that is implemented in ffplay. > >>>> > >>>> -- Peter > >>>> (A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B) > >>> > >>> Hi Peter, > >>> > >>> Is there any way I can validate that the packets include KLV metadata ? > >> > >> Nothing like that is implemented in FFmpeg. > >> > >> You need find a proper MXF validation tool. I can't recommend any, but searching > >> the web for 'MXF validator' or 'MXF analyser' returns a lot of hits. > >> > >>> Or is the only way to do it is by debugging/printing of ffmpeg MXF mux > >>> with KLV ,and demux on MXF video with supposed KLV info. > >> > >> That approach might work. Good luck. > >> > >> -- Peter > >> (A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B) > > > > Ok, Thanks, I'll go on from this point. > > I hope ffmpeg developers will add KLV capabilities to ffmpeg in the future. > > > > Thanks a lot. Ran > > _______________________________________________ > > Libav-user mailing list > > Libav-user at ffmpeg.org > > http://ffmpeg.org/mailman/listinfo/libav-user > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nfxjfg at googlemail.com Wed Sep 10 19:54:28 2014 From: nfxjfg at googlemail.com (wm4) Date: Wed, 10 Sep 2014 19:54:28 +0200 Subject: [Libav-user] RTMP Play file descriptor leak In-Reply-To: References: Message-ID: <20140910195428.4680553b@debian> On Wed, 10 Sep 2014 12:37:19 +1100 Alexander Drozdov wrote: > Hi! > > In our project we uses FFmpeg to demux RTMP streams. Input stream takes > from Wowza/nginx-rtmp. Our application is a daemon that try to connect to > source periodicaly if it does not present (does not published to Wowza, for > example). We also use interrupt callback to break connection if timeout is > occured. So in this situation: > - Alive server > - Alive streaming application > - Configured inerrupt callback with timeout > - Disalive stream > > TCP socket to server does not closes. > > I look into code with debugger and found place where error is occured: > rtmpproto.c, rtmp_open() L:2672 > > Root couse: return from function without resources clean up > > Solution: replace return with 'goto fail' > > Path is attached. > Not many developers read this list, so maybe you should post it to ffmpeg-devel. Your patch look ok; maybe using git format-patch would be slightly better. From adrozdoff at gmail.com Thu Sep 11 00:58:28 2014 From: adrozdoff at gmail.com (Alexander Drozdov) Date: Thu, 11 Sep 2014 09:58:28 +1100 Subject: [Libav-user] RTMP Play file descriptor leak In-Reply-To: <20140910195428.4680553b@debian> References: <20140910195428.4680553b@debian> Message-ID: Ughr... ffmpeg-devel: not for bug reports... It is evil that I can't simple send patch/report via mail :-( 2014-09-11 4:54 GMT+11:00 wm4 : > On Wed, 10 Sep 2014 12:37:19 +1100 > Alexander Drozdov wrote: > > > Hi! > > > > In our project we uses FFmpeg to demux RTMP streams. Input stream takes > > from Wowza/nginx-rtmp. Our application is a daemon that try to connect to > > source periodicaly if it does not present (does not published to Wowza, > for > > example). We also use interrupt callback to break connection if timeout > is > > occured. So in this situation: > > - Alive server > > - Alive streaming application > > - Configured inerrupt callback with timeout > > - Disalive stream > > > > TCP socket to server does not closes. > > > > I look into code with debugger and found place where error is occured: > > rtmpproto.c, rtmp_open() L:2672 > > > > Root couse: return from function without resources clean up > > > > Solution: replace return with 'goto fail' > > > > Path is attached. > > > > Not many developers read this list, so maybe you should post it to > ffmpeg-devel. Your patch look ok; maybe using git format-patch would be > slightly better. > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > -- WBR, Alexander Drozdov http://htrd.su -------------- next part -------------- An HTML attachment was scrubbed... URL: From cehoyos at ag.or.at Thu Sep 11 01:04:38 2014 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Wed, 10 Sep 2014 23:04:38 +0000 (UTC) Subject: [Libav-user] RTMP Play file descriptor leak References: <20140910195428.4680553b@debian> Message-ID: Alexander Drozdov writes: > Ughr... ffmpeg-devel: not for bug reports Yes, ffmpeg-devel is not for bug reports but for patches. Since you have a bug report with a patch, please send it (as a patch but including your report) to the ffmpeg-devel mailing list where it can be reviewed. To make things easier for the developers who want to review patches, review is (nearly) only done on the ffmpeg-devel mailing list. Please consider not to top-post on any FFmpeg- related mailing lists. Carl Eugen From adrozdoff at gmail.com Thu Sep 11 01:29:02 2014 From: adrozdoff at gmail.com (Alexander Drozdov) Date: Thu, 11 Sep 2014 10:29:02 +1100 Subject: [Libav-user] RTMP Play file descriptor leak In-Reply-To: References: <20140910195428.4680553b@debian> Message-ID: 2014-09-11 10:04 GMT+11:00 Carl Eugen Hoyos : > Alexander Drozdov writes: > > > Ughr... ffmpeg-devel: not for bug reports > > Yes, ffmpeg-devel is not for bug reports but > for patches. I think that good idea to point it at the ffmpeg-devel list description on the site. It looks like quest: I only subscribed on libav-user, I send report+patch here, I noticed that this list not for reports, I go to site and found that ffmpeg-devel not for reports (regard patches there is no info at all), I go to tracker register (!) and click New report... And I look: "Patches should be submitted to the ffmpeg-devel mailing list and not this bug tracker". Grief. I send report to ffmpeg-devel short later. > Please consider not to top-post on any FFmpeg- > related mailing lists. > Sorry, stupid GMail inteface. -- WBR, Alexander Drozdov http://htrd.su -------------- next part -------------- An HTML attachment was scrubbed... URL: From nfxjfg at googlemail.com Thu Sep 11 01:29:33 2014 From: nfxjfg at googlemail.com (wm4) Date: Thu, 11 Sep 2014 01:29:33 +0200 Subject: [Libav-user] RTMP Play file descriptor leak In-Reply-To: References: <20140910195428.4680553b@debian> Message-ID: <20140911012933.45b6b1c2@debian> On Thu, 11 Sep 2014 09:58:28 +1100 Alexander Drozdov wrote: > Ughr... ffmpeg-devel: not for bug reports... It is evil that I can't simple > send patch/report via mail :-( This is just so that ffmpeg-devel is not flooded with user questions or support requests. Sending a patch to ffmpeg-devel is always ok. From julia.shashkina at gmail.com Thu Sep 11 11:37:32 2014 From: julia.shashkina at gmail.com (=?UTF-8?B?0K7Qu9C40Y8g0KjQsNGI0LrQuNC90LA=?=) Date: Thu, 11 Sep 2014 13:37:32 +0400 Subject: [Libav-user] RTSP over TCP reading hangs Message-ID: Hi all, I'm trying to read RTSP stream over TCP with H264. But after a while (after the several frames were read, it depends on stream), the reading hangs. Code: AVFormatContext *context; AVDictionary *opts = 0; int ret; ... av_register_all(); avformat_network_init(); context = avformat_alloc_context(); av_dict_set(&opts, "rtsp_transport", "tcp", 0); ret = avformat_open_input(&context, "rtsp:// 10.125.248.169/720x480_frm_vlc_4mbs.264", NULL, &opts); ... ret = avformat_find_stream_info(context, NULL); ... while(true) { ret = av_read_frame(context, pkt); ... //do the video processing ... } It hangs also if I replace the video processing on, f.e., 0,5 sec of sleep. I use live555MediaServer for streaming. How can I get rid of hang? Thanks ahead. -------------- next part -------------- An HTML attachment was scrubbed... URL: From markuspfundstein86 at gmail.com Thu Sep 11 11:50:52 2014 From: markuspfundstein86 at gmail.com (Markus Pfundstein) Date: Thu, 11 Sep 2014 11:50:52 +0200 Subject: [Libav-user] RTSP over TCP reading hangs In-Reply-To: References: Message-ID: had the same issue. couldnt figure out a proper solution yet (just stumbled upon it yesterday). live555 rtsp client handles it better than the ffmpeg one. you might want to check it. You can do a test run using vlc which incorporates live555 for rtsp. -------------- next part -------------- An HTML attachment was scrubbed... URL: From diceydawg at gmail.com Thu Sep 11 19:14:34 2014 From: diceydawg at gmail.com (diceydawg .) Date: Thu, 11 Sep 2014 13:14:34 -0400 Subject: [Libav-user] AvcodecContext opaque field Message-ID: Hi, Just a quick question, does the user defined opaque field in AvcodexContext need to be deallocated manually, if we allocate our own memory after we are done using it or does the library take care of that? Daisuke -------------- next part -------------- An HTML attachment was scrubbed... URL: From nfxjfg at googlemail.com Thu Sep 11 21:59:58 2014 From: nfxjfg at googlemail.com (wm4) Date: Thu, 11 Sep 2014 21:59:58 +0200 Subject: [Libav-user] AvcodecContext opaque field In-Reply-To: References: Message-ID: <20140911215958.0fcb0fb2@debian> On Thu, 11 Sep 2014 13:14:34 -0400 "diceydawg ." wrote: > Hi, Just a quick question, does the user defined opaque field in > AvcodexContext need to be deallocated manually, if we allocate our own > memory after we are done using it or does the library take care of that? I don't think libavcodec touches this field at all, so it's up to you. From fedor_qd at mail.ru Thu Sep 11 22:03:41 2014 From: fedor_qd at mail.ru (=?UTF-8?B?0KTQtdC00L7RgA==?=) Date: Fri, 12 Sep 2014 00:03:41 +0400 Subject: [Libav-user] =?utf-8?q?Symbian_build?= Message-ID: <1410465821.165213131@f384.i.mail.ru> Hi! I try to build FFMPEG static libraries. My environment : WinXP x64, Msys shell, GCC 4.4.1 from Codesourcery for Symbian, self-builded GNU make 4.0 by MS visual studio 2010. For this I change Rasberry build script. It runs and produce right?config.mak and config.h. But when I run make I got error: $ make config.mak:5: *** Recursive variable `prefix' references itself (eventually). Stop. I try: $ make -d GNU Make 4.0 Built for Windows32 Copyright (C) 1988-2013 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. find_and_set_shell() path search set default_shell = D:/Symbian/CSL_Arm_Toolchain/msys/bin/sh.exe Reading makefiles... Reading makefile 'Makefile'... Reading makefile 'config.mak' (search path) (no ~ expansion)... Reading makefile 'common.mak' (search path) (no ~ expansion)... Reading makefile 'arch.mak' (search path) (no ~ expansion)... Reading makefile 'libavdevice/Makefile' (search path) (no ~ expansion)... Reading makefile 'libavdevice/../config.mak' (search path) (no ~ expansion)... Reading makefile 'libavdevice/arm/Makefile' (search path) (don't care) (no ~ expansion)... Reading makefile 'library.mak' (search path) (nconfig.mak:5: ***. Stop.o ~ expansion)... Reading makefile 'common.mak' (search path) (no ~ expansion)... Reading makefile 'arch.mak' (search path) (no ~ expansion)... FFMREG configure script already has Symbian support, I add search path to static and import libraries. Also add some extra static and import libraries. Send my configure and symbian.sh configuration and build script. config.log ?-? http://pastebin.com/DkfeTK8T ?,?config.mak -? http://pastebin.com/2vM2wZir Always yours, Fedor. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/zip Size: 47163 bytes Desc: not available URL: From anmiodoherty at gmail.com Thu Sep 11 22:13:16 2014 From: anmiodoherty at gmail.com (Mick O'Doherty) Date: Thu, 11 Sep 2014 22:13:16 +0200 Subject: [Libav-user] Adding an audio track to a video In-Reply-To: References: Message-ID: Hi, Any thoughts on this? The behaviour does not have to be without transcoding as with the command line example - the key thing is to be able to add an audio track to a video. If I am asking in the wrong place, let me know... Mick On Mon, Sep 8, 2014 at 11:18 PM, Mick O'Doherty wrote: > Hi, > > I have tried searching the archive for this list (using google - if there > is a better way, please let me know) and could not find an answer to my > question, so I will post it here. > > I am trying to find some examples or guidelines that help show how to add > an audio track to a video programatically using ffmpeg API's (i.e. the C > API's not the command line). > > I did this a few years ago using the command line approach wrapped in a > script - the command, which worked fine, was: > > fmpeg -y -i OriginalvideoFile.mp4 -vcodec copy -i Mp3AudioFile.mp3 -acodec > copy resultVideoFile.mp4 > > I'd like to achieve the same thing but this time use the appropriate API > calls from a C program. > > Any pointers gratefully appreciated. > > Mick > -------------- next part -------------- An HTML attachment was scrubbed... URL: From xtingray at gmail.com Thu Sep 11 22:29:59 2014 From: xtingray at gmail.com (=?UTF-8?Q?Gustav_Gonz=C3=A1lez?=) Date: Thu, 11 Sep 2014 15:29:59 -0500 Subject: [Libav-user] How to remove header from video file Message-ID: Hello there, Right now I have to deal with a little strange requirement: I need to handle a mp4 video to copy all the binary content from it but the header. I mean, the new file only must have the frames section. Is this possible? Thanks! -- ============================ Gustav Gonzalez xtingray at gmail.com ============================ From clarka193 at potsdam.edu Thu Sep 11 23:16:49 2014 From: clarka193 at potsdam.edu (Anthony Clark) Date: 11 Sep 2014 17:16:49 -0400 Subject: [Libav-user] avio raw yuv Message-ID: Hey all, I have a YUV file I created with something like `ffmpeg -i video.mp4 -c:v rawvideo -pix_fmt yuv420p out.yuv`. I want to use libav* to retrieve video frames from this raw file. Any clues? So far I just create an `av_file_map` and get the data that way - it's a little primitive. Does YUV have a demuxer? Decoder? I couldn't find anything in 2.2.4's source but maybe I looked at the wrong things. Oh, I should note that using the `avio_reading.c` example in 2.2.x fails on `avformat_open_input` - telling me YUV/raw is a little special. Any help is greatly appreciated! From anshul.ffmpeg at gmail.com Fri Sep 12 00:35:24 2014 From: anshul.ffmpeg at gmail.com (Anshul) Date: Fri, 12 Sep 2014 04:05:24 +0530 Subject: [Libav-user] avio raw yuv In-Reply-To: References: Message-ID: <5ae19d2c-9c1e-4a14-b599-8f7a4eedae45@email.android.com> On September 12, 2014 2:46:49 AM IST, Anthony Clark wrote: >Hey all, > >I have a YUV file I created with something like `ffmpeg -i video.mp4 >-c:v >rawvideo -pix_fmt yuv420p out.yuv`. I want to use libav* to retrieve >video >frames from this raw file. Any clues? So far I just create an >`av_file_map` and get the data that way - it's a little primitive. Does >YUV have a demuxer? Decoder? I couldn't find anything in 2.2.4's source >but maybe I looked at the wrong things. > >Oh, I should note that using the `avio_reading.c` example in 2.2.x >fails >on `avformat_open_input` - telling me YUV/raw is a little special. Any >help is greatly appreciated! > >_______________________________________________ >Libav-user mailing list >Libav-user at ffmpeg.org >http://ffmpeg.org/mailman/listinfo/libav-user You need to specify size through avoptions -Anshul -- Sent from my Android device with K-9 Mail. Please excuse my brevity. From clarka193 at potsdam.edu Fri Sep 12 00:52:27 2014 From: clarka193 at potsdam.edu (Anthony Clark) Date: 11 Sep 2014 18:52:27 -0400 Subject: [Libav-user] avio raw yuv In-Reply-To: <5ae19d2c-9c1e-4a14-b599-8f7a4eedae45@email.android.com> References: <5ae19d2c-9c1e-4a14-b599-8f7a4eedae45@email.android.com> Message-ID: > On September 12, 2014 2:46:49 AM IST, Anthony Clark > wrote: >>Hey all, >> >>I have a YUV file I created with something like `ffmpeg -i video.mp4 >>-c:v >>rawvideo -pix_fmt yuv420p out.yuv`. I want to use libav* to retrieve >>video >>frames from this raw file. Any clues? So far I just create an >>`av_file_map` and get the data that way - it's a little primitive. Does >>YUV have a demuxer? Decoder? I couldn't find anything in 2.2.4's source >>but maybe I looked at the wrong things. >> >>Oh, I should note that using the `avio_reading.c` example in 2.2.x >>fails >>on `avformat_open_input` - telling me YUV/raw is a little special. Any >>help is greatly appreciated! >> >>_______________________________________________ >>Libav-user mailing list >>Libav-user at ffmpeg.org >>http://ffmpeg.org/mailman/listinfo/libav-user > > You need to specify size through avoptions I think I know what you mean. So, I made these modification to `avio_reading.c` ... 104: 105:AVInputFormat * input = av_find_input_format("rawvideo"); AVDictionary * opts; av_dict_set(&opts, "video_size", "352x288", 0); ret = avformat_open_input(&fmt_ctx, NULL, input, &opts); if (ret < 0) { fprintf(stderr, "Could not open input\n"); goto end; It no longer fails via avformat_open_input. BUT, the file mapping is weird and I only get 2 really large (as large as my file) sized buffers. I tried to use various `av_opt_set` routines to set the AVOptions for the rawvideo decoder, but everything looks "private"... maybe I'm missing something. Any advice is appreciated. Thanks again for the reply > > -Anshul From mingzhangsjtu at gmail.com Fri Sep 12 01:13:26 2014 From: mingzhangsjtu at gmail.com (Ming Zhang) Date: Thu, 11 Sep 2014 19:13:26 -0400 Subject: [Libav-user] FFmpeg support for libstagefright hardware decoding Message-ID: Hi, everyone: I am new to ffmpeg. Recently I am working on project to port ffmpeg to android device. At the beginning, I compiled ffmpeg to shared libs(.so files) in a very normal way following some guides on Internet, load them into my android app. It works perfectly. Now I want ffmpeg to use libstagefright to fulfill HW decoding. The problem is, I can compile the .so libs, but when I launch my app and load those .so libs, there is always a java.lang.UnsatisfiedLinkError: Cannot load library: reloc_library[1314]: 114 cannot locate '_ZN7android11MediaBufferC1Ej' I stuck there for a few days. Does anyone encountered any similar problems before? It would be great if someone can give me some hint about this error. My steps: 1. Compile ffmpeg-2.1.4 souce code to .so shared libs. I use the build_libstagefright script to do this, and make some modification based on some guides from Internet. The script is on the attachment. 2. Copy the compiled include and lib directories to my android-ndk-r7/sources/ffmpeg-2.1.4/android/arm directory. The Android.mk under this dir is in the attachment(Android.mk1). 3. Under the jni directory of my android app, the Android.mk and Application.mk files are in the attachment. I am not sure what else materials you need, if anything is missing, please let me know, I will upload it. Thank you guys very much!!! -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: build_libstagefright.sh Type: application/x-sh Size: 4572 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Android.mk1 Type: application/octet-stream Size: 1070 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Android.mk2 Type: application/octet-stream Size: 678 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Application.mk Type: application/octet-stream Size: 65 bytes Desc: not available URL: From anshul.ffmpeg at gmail.com Fri Sep 12 01:33:02 2014 From: anshul.ffmpeg at gmail.com (Anshul) Date: Fri, 12 Sep 2014 05:03:02 +0530 Subject: [Libav-user] avio raw yuv In-Reply-To: References: <5ae19d2c-9c1e-4a14-b599-8f7a4eedae45@email.android.com> Message-ID: <6477c44a-a2df-4533-af1c-04c70ced9ef5@email.android.com> On September 12, 2014 4:22:27 AM IST, Anthony Clark wrote: >> On September 12, 2014 2:46:49 AM IST, Anthony Clark >> wrote: >>>Hey all, >>> >>>I have a YUV file I created with something like `ffmpeg -i video.mp4 >>>-c:v >>>rawvideo -pix_fmt yuv420p out.yuv`. I want to use libav* to retrieve >>>video >>>frames from this raw file. Any clues? So far I just create an >>>`av_file_map` and get the data that way - it's a little primitive. >Does >>>YUV have a demuxer? Decoder? I couldn't find anything in 2.2.4's >source >>>but maybe I looked at the wrong things. >>> >>>Oh, I should note that using the `avio_reading.c` example in 2.2.x >>>fails >>>on `avformat_open_input` - telling me YUV/raw is a little special. >Any >>>help is greatly appreciated! >>> >>>_______________________________________________ >>>Libav-user mailing list >>>Libav-user at ffmpeg.org >>>http://ffmpeg.org/mailman/listinfo/libav-user >> >> You need to specify size through avoptions > > >I think I know what you mean. So, I made these modification to >`avio_reading.c` ... > > >104: >105:AVInputFormat * input = av_find_input_format("rawvideo"); > AVDictionary * opts; > av_dict_set(&opts, "video_size", "352x288", 0); > > ret = avformat_open_input(&fmt_ctx, NULL, input, &opts); > if (ret < 0) { > fprintf(stderr, "Could not open input\n"); > goto end; > > >It no longer fails via avformat_open_input. BUT, the file mapping is >weird >and I only get 2 really large (as large as my file) sized buffers. I think you should try looking deeper here, why does it fail, what makes decoder give u whole file. May be using gdb u can find out. >tried >to use various `av_opt_set` routines to set the AVOptions for the >rawvideo >decoder, but everything looks "private"... maybe I'm missing something. >Any advice is appreciated. Thanks again for the reply > > > > >> >> -Anshul > > >_______________________________________________ >Libav-user mailing list >Libav-user at ffmpeg.org >http://ffmpeg.org/mailman/listinfo/libav-user -- Sent from my Android device with K-9 Mail. Please excuse my brevity. From clarka193 at potsdam.edu Fri Sep 12 01:47:38 2014 From: clarka193 at potsdam.edu (Anthony Clark) Date: 11 Sep 2014 19:47:38 -0400 Subject: [Libav-user] avio raw yuv In-Reply-To: <6477c44a-a2df-4533-af1c-04c70ced9ef5@email.android.com> References: <5ae19d2c-9c1e-4a14-b599-8f7a4eedae45@email.android.com> <6477c44a-a2df-4533-af1c-04c70ced9ef5@email.android.com> Message-ID: > On September 12, 2014 4:22:27 AM IST, Anthony Clark > wrote: >>> On September 12, 2014 2:46:49 AM IST, Anthony Clark >>> wrote: >>>>Hey all, >>>> >>>>I have a YUV file I created with something like `ffmpeg -i video.mp4 >>>>-c:v >>>>rawvideo -pix_fmt yuv420p out.yuv`. I want to use libav* to retrieve >>>>video >>>>frames from this raw file. Any clues? So far I just create an >>>>`av_file_map` and get the data that way - it's a little primitive. >>Does >>>>YUV have a demuxer? Decoder? I couldn't find anything in 2.2.4's >>source >>>>but maybe I looked at the wrong things. >>>> >>>>Oh, I should note that using the `avio_reading.c` example in 2.2.x >>>>fails >>>>on `avformat_open_input` - telling me YUV/raw is a little special. >>Any >>>>help is greatly appreciated! >>>> >>>>_______________________________________________ >>>>Libav-user mailing list >>>>Libav-user at ffmpeg.org >>>>http://ffmpeg.org/mailman/listinfo/libav-user >>> >>> You need to specify size through avoptions >> >> >>I think I know what you mean. So, I made these modification to >>`avio_reading.c` ... >> >> >>104: >>105:AVInputFormat * input = av_find_input_format("rawvideo"); >> AVDictionary * opts; >> av_dict_set(&opts, "video_size", "352x288", 0); >> >> ret = avformat_open_input(&fmt_ctx, NULL, input, &opts); >> if (ret < 0) { >> fprintf(stderr, "Could not open input\n"); >> goto end; >> >> >>It no longer fails via avformat_open_input. BUT, the file mapping is >>weird >>and I only get 2 really large (as large as my file) sized buffers. > > I think you should try looking deeper here, why does it fail, what makes > decoder give u whole file. > May be using gdb u can find out. > You're right. I'll compile some debug libs and check it out. Also, you mentioned AVOptions and I used AVDictionary. I can successfully set "video_size" via the first snippet I sent, but can't do the following: 105 ret = avformat_open_input(&fmt_ctx, NULL, NULL, NULL); 106 if (ret < 0) { 107 fprintf(stderr, "Could not open input\n"); 108 goto end; 109 } 110 ret = av_opt_set_image_size(fmt_ctx, "video_size", 352, 288, AV_OPT_SEARCH_CHILDREN); 111 112 //// Or this? 113 //// -------- 114 //// Docs for AV_OPT_TYPE_IMAGE_SIZE say i need some contiguous ints... 115 ////const int size[] = {352, 288}; 116 ////ret = av_opt_set_int_list(fmt_ctx, "video_size", size, 0, AV_OPT_SEARCH_CHILDREN I thought the second (^ this) version would be preferred, but I see the following error(s): ptr:0x7fc37f891000 size:152064000 [IMGUTILS @ 0x7ffff52b9bb0] Picture size 0x0 is invalid [IMGUTILS @ 0x7ffff52b9730] Picture size 0x0 is invalid [IMGUTILS @ 0x7ffff52b9770] Picture size 0x0 is invalid [rawvideo @ 0x1ef5720] Could not find codec parameters for stream 0 (Video: rawvideo (I420 / 0x30323449), yuv420p, -4 kb/s): unspecified size Consider increasing the value for the 'analyzeduration' and 'probesize' options I just don't know what the correct one to use is - Setting the AVFormatContext options via AVDict, or injecting options via AVOptions. Very unclear. Thanks! > > >>tried >>to use various `av_opt_set` routines to set the AVOptions for the >>rawvideo >>decoder, but everything looks "private"... maybe I'm missing something. >>Any advice is appreciated. Thanks again for the reply >> >> >> >> >>> >>> -Anshul >> >> >>_______________________________________________ >>Libav-user mailing list >>Libav-user at ffmpeg.org >>http://ffmpeg.org/mailman/listinfo/libav-user > > From mingzhangsjtu at gmail.com Fri Sep 12 05:43:20 2014 From: mingzhangsjtu at gmail.com (Ming Zhang) Date: Thu, 11 Sep 2014 23:43:20 -0400 Subject: [Libav-user] FFmpeg support for libstagefright hardware decoding Message-ID: Hi, everyone: I am new to ffmpeg. Recently I am working on project to port ffmpeg to android device. At the beginning, I compiled ffmpeg to shared libs(.so files) in a very normal way following some guides on Internet, load them into my android app. It works perfectly. Now I want ffmpeg to use libstagefright to fulfill HW decoding. The problem is, I can compile the .so libs, but when I launch my app and load those .so libs, there is always a java.lang.UnsatisfiedLinkError: Cannot load library: reloc_library[1314]: 114 cannot locate '_ZN7android11MediaBufferC1Ej' I stuck there for a few days. Does anyone encountered any similar problems before? It would be great if someone can give me some hint about this error. My steps: 1. Compile ffmpeg-2.1.4 souce code to .so shared libs. I use the build_libstagefright script to do this, and make some modification based on some guides from Internet. The script is on the attachment. 2. Copy the compiled include and lib directories to my android-ndk-r7/sources/ffmpeg-2.1.4/android/arm directory. The Android.mk under this dir is in the attachment(Android.mk1). 3. Under the jni directory of my android app, the Android.mk and Application.mk files are in the attachment. I am not sure what else materials you need, if anything is missing, please let me know, I will upload it. Thank you guys very much!!! -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ffmpeg.zip Type: application/zip Size: 2628 bytes Desc: not available URL: From hpsheng2007 at 163.com Fri Sep 12 06:33:58 2014 From: hpsheng2007 at 163.com (PushengHe) Date: Fri, 12 Sep 2014 12:33:58 +0800 (CST) Subject: [Libav-user] FFmpeg support for libstagefright hardware decoding In-Reply-To: References: Message-ID: <71d0f609.1d7b3.14868239f1b.Coremail.hpsheng2007@163.com> You can check your OS and the version of gcc. -- Regards, PushengHe At 2014-09-12 11:43:20, "Ming Zhang" wrote: Hi, everyone: I am new to ffmpeg. Recently I am working on project to port ffmpeg to android device. At the beginning, I compiled ffmpeg to shared libs(.so files) in a very normal way following some guides on Internet, load them into my android app. It works perfectly. Now I want ffmpeg to use libstagefright to fulfill HW decoding. The problem is, I can compile the .so libs, but when I launch my app and load those .so libs, there is always a java.lang.UnsatisfiedLinkError: Cannot load library: reloc_library[1314]: 114 cannot locate '_ZN7android11MediaBufferC1Ej' I stuck there for a few days. Does anyone encountered any similar problems before? It would be great if someone can give me some hint about this error. My steps: 1. Compile ffmpeg-2.1.4 souce code to .so shared libs. I use the build_libstagefright script to do this, and make some modification based on some guides from Internet. The script is on the attachment. 2. Copy the compiled include and lib directories to my android-ndk-r7/sources/ffmpeg-2.1.4/android/arm directory. The Android.mk under this dir is in the attachment(Android.mk1). 3. Under the jni directory of my android app, the Android.mk and Application.mk files are in the attachment. I am not sure what else materials you need, if anything is missing, please let me know, I will upload it. Thank you guys very much!!! -------------- next part -------------- An HTML attachment was scrubbed... URL: From mingzhangsjtu at gmail.com Fri Sep 12 17:09:43 2014 From: mingzhangsjtu at gmail.com (Ming Zhang) Date: Fri, 12 Sep 2014 11:09:43 -0400 Subject: [Libav-user] FFmpeg support for libstagefright hardware decoding In-Reply-To: <71d0f609.1d7b3.14868239f1b.Coremail.hpsheng2007@163.com> References: <71d0f609.1d7b3.14868239f1b.Coremail.hpsheng2007@163.com> Message-ID: Hi, Pusheng: Thanks for you reply! I checked my ndk, which I used to compile ffmpeg and android app native code, the gcc version is 4.4.3, and I also checked the .so lib files on my devices, they also be compiled by gcc 4.4.3. Can you explain me what do you want me to check, maybe I misunderstood you. Thank you! Best Regards Ming 2014-09-12 0:33 GMT-04:00 PushengHe : > You can check your OS and the version of gcc. > > -- > Regards, > PushengHe > > At 2014-09-12 11:43:20, "Ming Zhang" wrote: > > Hi, everyone: > I am new to ffmpeg. Recently I am working on project to port ffmpeg to > android device. > At the beginning, I compiled ffmpeg to shared libs(.so files) in a very > normal way following some guides on Internet, load them into my android > app. It works perfectly. > Now I want ffmpeg to use libstagefright to fulfill HW decoding. > The problem is, I can compile the .so libs, but when I launch my app and > load those .so libs, there is always a java.lang.UnsatisfiedLinkError: > Cannot load library: reloc_library[1314]: 114 cannot locate > '_ZN7android11MediaBufferC1Ej' > I stuck there for a few days. Does anyone encountered any similar problems > before? It would be great if someone can give me some hint about this error. > > My steps: > 1. Compile ffmpeg-2.1.4 souce code to .so shared libs. I use the > build_libstagefright script to do this, and make some modification based on > some guides from Internet. The script is on the attachment. > 2. Copy the compiled include and lib directories to my > android-ndk-r7/sources/ffmpeg-2.1.4/android/arm directory. The Android.mk > under this dir is in the attachment(Android.mk1). > 3. Under the jni directory of my android app, the Android.mk and > Application.mk files are in the attachment. > > I am not sure what else materials you need, if anything is missing, please > let me know, I will upload it. > Thank you guys very much!!! > > > > > _______________________________________________ > 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 adjiev.dmitry at gmail.com Sat Sep 13 19:32:54 2014 From: adjiev.dmitry at gmail.com (Dmitry Adjiev) Date: Sat, 13 Sep 2014 21:32:54 +0400 Subject: [Libav-user] Qt + swsscale on android Message-ID: Hello guys! I have the issue with sws_scale and Qt on android: Here is my code: AVFrame *pict = av_frame_alloc(); avpicture_alloc((AVPicture*) pict, AV_PIX_FMT_RGB24, width, height); sws_scale(sws_ctx, const_cast (frame->data), frame->linesize, 0, height, pict->data, pict->linesize); QImage image(width, height, QImage::Format_RGB888); //QImage image(frame->data[0], frame->width, frame->height, QImage::Format_RGB888); for (int y = 0; y < height; ++ y) memcpy(image.scanLine(y), frame->data[0] + y * frame->linesize[0], codec->width * 3); In result Image repeats 3 times, please find attached file What I do wrong? -- Regards, Dmitry -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: guvcview_image-3.jpg Type: image/jpeg Size: 98195 bytes Desc: not available URL: From adjiev.dmitry at gmail.com Sat Sep 13 19:34:22 2014 From: adjiev.dmitry at gmail.com (Dmitry Adjiev) Date: Sat, 13 Sep 2014 21:34:22 +0400 Subject: [Libav-user] Qt + swsscale on android In-Reply-To: References: Message-ID: 2014-09-13 21:32 GMT+04:00 Dmitry Adjiev : > Hello guys! > I have the issue with sws_scale and Qt on android: > > Here is my code: > > AVFrame *pict = av_frame_alloc(); > avpicture_alloc((AVPicture*) pict, AV_PIX_FMT_RGB24, > width, height); > sws_scale(sws_ctx, const_cast > (frame->data), frame->linesize, 0, height, pict->data, pict->linesize); > QImage image(width, height, QImage::Format_RGB888); > //QImage image(frame->data[0], frame->width, > frame->height, QImage::Format_RGB888); > > for (int y = 0; y < height; ++ y) > memcpy(image.scanLine(y), frame->data[0] + y * > frame->linesize[0], codec->width * 3); > > > In result Image repeats 3 times, please find attached file > What I do wrong? > -- > Regards, > Dmitry > Here is link to the image: https://www.dropbox.com/s/iv5rgi90ic3xrwg/guvcview_image-3.jpg?dl=0 -- Regards, Dmitry -------------- next part -------------- An HTML attachment was scrubbed... URL: From bumblebritches57 at gmail.com Sat Sep 13 19:30:32 2014 From: bumblebritches57 at gmail.com (Marcus Johnson) Date: Sat, 13 Sep 2014 13:30:32 -0400 Subject: [Libav-user] Sharing input file? Message-ID: I'm writing a C++ program, and I'm trying to use LibAVCodec to decode audio a user enters into my program, with the aforementioned library. in my program I've set up InputFile as an ifstream object, that takes input from argv[1], what function do I use to pass this handle to the library? -------------- next part -------------- An HTML attachment was scrubbed... URL: From adjiev.dmitry at gmail.com Sat Sep 13 21:16:07 2014 From: adjiev.dmitry at gmail.com (Dmitry Adjiev) Date: Sat, 13 Sep 2014 23:16:07 +0400 Subject: [Libav-user] Qt + swsscale on android In-Reply-To: References: Message-ID: 2014-09-13 21:34 GMT+04:00 Dmitry Adjiev : > > > 2014-09-13 21:32 GMT+04:00 Dmitry Adjiev : > >> Hello guys! >> I have the issue with sws_scale and Qt on android: >> >> Here is my code: >> >> AVFrame *pict = av_frame_alloc(); >> avpicture_alloc((AVPicture*) pict, AV_PIX_FMT_RGB24, >> width, height); >> sws_scale(sws_ctx, const_cast >> (frame->data), frame->linesize, 0, height, pict->data, pict->linesize); >> QImage image(width, height, QImage::Format_RGB888); >> //QImage image(frame->data[0], frame->width, >> frame->height, QImage::Format_RGB888); >> >> for (int y = 0; y < height; ++ y) >> memcpy(image.scanLine(y), frame->data[0] + y * >> frame->linesize[0], codec->width * 3); >> >> >> In result Image repeats 3 times, please find attached file >> What I do wrong? >> -- >> Regards, >> Dmitry >> > > > Here is link to the image: > https://www.dropbox.com/s/iv5rgi90ic3xrwg/guvcview_image-3.jpg?dl=0 > -- > Regards, > Dmitry > Fixed! See here: http://stackoverflow.com/questions/22511309/video-from-pipe-yuv-with-libav-rgb-with-sws-scale-draw-with-qt -- Regards, Dmitry -------------- next part -------------- An HTML attachment was scrubbed... URL: From tuviahs at telestream.net Sun Sep 14 00:54:58 2014 From: tuviahs at telestream.net (Tuviah Snyder) Date: Sat, 13 Sep 2014 22:54:58 +0000 Subject: [Libav-user] How do I drop corrupted video frames as a result of network issues Message-ID: <8FDC8221-5236-4FC5-9B9F-0A39E1DD2A61@telestream.net> I have an RTSP server running on an iPhone broadcasting H264 over UDP in a local network and I'm using libavformat, libavcodec to demux it and decode on an application running on the desktop.. For the most part it works well with a second latency, but every minute or so I see a few packets are late, dropped, not received at all and therefore I get a corrupt frame with visible macro blocking. Is there any way to detect after decode if the decoder did not have enough information to decode a perfect frame? Don't want AVDecode to try to conceal it, just want to keep feeding in packets to decode, and know if any information was missing, which was required to decode that particular frame. Because our users would rather we never display a corrupt frame, since the iPhone source is just one of many being integrated into a live production (and corrupt frames would lower the overall production value). Instead they want our desktop app to keep displaying the last good frame, until the next good one comes along. Best Tuviah From klikovnick at mail.ru Mon Sep 15 15:22:36 2014 From: klikovnick at mail.ru (=?UTF-8?B?0JrQu9GL0LrQvtCyINCd0LjQutC+0LvQsNC5?=) Date: Mon, 15 Sep 2014 17:22:36 +0400 Subject: [Libav-user] =?utf-8?q?Calculating_DTS_PTS_H=2E264?= Message-ID: <1410787356.216410767@f56.i.mail.ru> Hello, i'm trying to get h.264 rtp stream and write it to mp4 container via live555+ffmpeg. I can get SPS+PPS params from stream and feed it to ffmpeg decoder, so decoding works fine. But i can't properly write nals to mp4 container. I think, i should detect first and last nals of frame, write them to avpacket and fill dts, pts and duration fields. Please, tell me how can i do that. ------ Klykov Nickolay -------------- next part -------------- An HTML attachment was scrubbed... URL: From deron at pagestream.org Mon Sep 15 20:04:00 2014 From: deron at pagestream.org (Deron) Date: Mon, 15 Sep 2014 12:04:00 -0600 Subject: [Libav-user] iOS video player Message-ID: <54172A10.8080907@pagestream.org> Has anyone successfully used libav to build a video player that can play 720p video on an iPhone/iPad? I've got a test app written that uses ffplay as a model and it plays, but the decode rate is in a single digit frames per second range. I realize that my code, the ffmpeg build, or the wind could be the cause but before I dig into these possibilities I'm wondering if such a thing is even possible. I installed the VLC app and it was no better, which doesn't give me a warm fuzzy feeling. Thanks for any guidance, Deron From nfxjfg at googlemail.com Mon Sep 15 20:19:34 2014 From: nfxjfg at googlemail.com (wm4) Date: Mon, 15 Sep 2014 20:19:34 +0200 Subject: [Libav-user] iOS video player In-Reply-To: <54172A10.8080907@pagestream.org> References: <54172A10.8080907@pagestream.org> Message-ID: <20140915201934.57c35ebf@debian> On Mon, 15 Sep 2014 12:04:00 -0600 Deron wrote: > Has anyone successfully used libav to build a video player that can play > 720p video on an iPhone/iPad? I've got a test app written that uses VLC > ffplay as a model and it plays, but the decode rate is in a single digit > frames per second range. I realize that my code, the ffmpeg build, or > the wind could be the cause but before I dig into these possibilities > I'm wondering if such a thing is even possible. I installed the VLC app Oh. Well, the problem is probably that hw decoding is needed, and the iThings might not be powerful enough to get realtime playback with sw decoding? But on the other hand, VLC should support hw decoding. > and it was no better, which doesn't give me a warm fuzzy feeling. > > Thanks for any guidance, > > Deron > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user From bumblebritches57 at gmail.com Wed Sep 17 01:10:26 2014 From: bumblebritches57 at gmail.com (Marcus Johnson) Date: Tue, 16 Sep 2014 19:10:26 -0400 Subject: [Libav-user] Decoding audio? Message-ID: I'm writing a program to demux and decode audio with the help of the ffmpeg libraries, I'm to the part where the audio is decoded but I'm not sure which function the decoded audio comes out of? how do I grab the decoded audio so I can further process it myself? -------------- next part -------------- An HTML attachment was scrubbed... URL: From thoman.mathieu at gmail.com Wed Sep 17 09:13:46 2014 From: thoman.mathieu at gmail.com (Mathieu Thoman) Date: Wed, 17 Sep 2014 09:13:46 +0200 Subject: [Libav-user] Grabbing desktop at a framerate of 25 fps Message-ID: Hello everybody, First sorry for my english. I'm having some troubles with my code. I try to make a screencast at a rate of 25 fps. The first problem is that I can't reach the framerate I'd like to get (I just have 8 or 9 images per seconds). The second problem is that my program crash with an exception with sws_scale. Do you have any idea on how I can improve my code? Here is what I could do. *#define* __STDC_CONSTANT_MACROS 1 *extern* "C" { *#include* "avcodec.h" *#include* "avdevice.h" *#include* "avformat.h" *#include* "swscale.h" } *static* *int* jpeg_frame_number = 0; *void* *SaveFrame*(AVFrame* pFrame, *int* dst_width, *int* dst_height, *int* output_max_size) { AVCodecContext *png_encoder_codec_ctx = NULL; AVCodec *png_encoder_codec = NULL; uint8_t *png_buffer = NULL; uint8_t *png_encoder_output_buffer = NULL; size_t png_encoder_output_buffer_size = 0; *int* err = 0; AVPacket pkt; av_init_packet(&pkt); pkt.data = NULL; pkt.size = 0; *int* gotPacket; png_encoder_codec = avcodec_find_encoder_by_name ("png"); *if*(png_encoder_codec == NULL) *return*; png_encoder_output_buffer = *static_cast*(av_malloc (output_max_size)); *if* (png_encoder_output_buffer == NULL) { av_free (png_buffer); *return*; } png_encoder_codec_ctx = avcodec_alloc_context3(png_encoder_codec); *if* (png_encoder_codec_ctx == NULL) { av_free (png_encoder_output_buffer); av_free (png_buffer); *return*; } png_encoder_codec_ctx->width = dst_width; png_encoder_codec_ctx->height = dst_height; png_encoder_codec_ctx->pix_fmt = PIX_FMT_RGB24; *if* (avcodec_open2(png_encoder_codec_ctx, png_encoder_codec, NULL) < 0) { av_free (png_encoder_codec_ctx); av_free (png_encoder_output_buffer); av_free (png_buffer); *return*; } err = avcodec_encode_video2(png_encoder_codec_ctx, &pkt, pFrame, & gotPacket); *if*(err < 0) { avcodec_close (png_encoder_codec_ctx); av_free (png_encoder_codec_ctx); av_free (png_buffer); } FILE *pFile; *char* szFilename[32]; // Open file jpeg_frame_number++; sprintf(szFilename, "D:/Temp/frame%06d.png", jpeg_frame_number); pFile = fopen(szFilename, "wb"); *if*(pFile == NULL) *return*; // Write pixel data fwrite(pkt.data, 1, pkt.size, pFile); // Close file fclose(pFile); av_free_packet(&pkt); } *int* *main*(*int* argc, *char* **argv) { AVInputFormat* pInputFormat = NULL; AVFormatContext* pFomartCtx = NULL; AVDictionary* pOptions = NULL; AVCodecContext* pCodecCtx = NULL; AVCodec* pCodec = NULL; AVFrame* pFrame = NULL; AVFrame* pFrameRGB = NULL; *struct* SwsContext *img_convert_ctx = NULL; *int* i = 0; *int* videoStream = -1; *int* frameFinished = 0; *int* numBytes = 0; uint8_t *buffer = NULL; AVPacket packet; av_init_packet(&packet); packet.data = NULL; packet.size = 0; // Register all formats and codecs av_register_all(); avdevice_register_all(); // av_log_set_level(-1); *if*(!(pInputFormat = av_find_input_format("gdigrab"))) { fprintf(stderr, "Couldn't get input format. \n"); *return* -1; } // Set up options av_dict_set(&pOptions, "video_size", "1280x970", CODEC_FLAG_QSCALE); // Open desktop *if*(avformat_open_input(&pFomartCtx, "desktop", pInputFormat, &pOptions) != 0) { fprintf(stderr, "Couldn't open desktop input.\n"); *return* -1; } // Find the decoder for the video stream pCodec = avcodec_find_decoder(AV_CODEC_ID_BMP); *if*(pCodec == NULL) { fprintf(stderr, "Codec not found!\n"); *return* -1; } pCodecCtx = avcodec_alloc_context3(pCodec); *if*(pCodecCtx == NULL) { fprintf(stderr, "Codec context not allocated!\n"); *return* -1; } // Open codec *if*(avcodec_open2(pCodecCtx, pCodec, NULL) < 0) { fprintf(stderr, "Could not open codec\n"); *return* -1; } // Allocate video frame pFrame = avcodec_alloc_frame(); pFrameRGB = avcodec_alloc_frame(); *if*(pFrameRGB == NULL || pFrame == NULL) *return* -1; // Read frames and save frames to disk // avio_read(); // avcodec_flush_buffers(); *while*((av_read_frame(pFomartCtx, &packet) >= 0)) { // Decode video frame avcodec_decode_video2(pCodecCtx, pFrame, &frameFinished, &packet); // Did we get a video frame? *if*(frameFinished) { // Convert the image from its native format to RGB *int* width = pCodecCtx->width; *int* height = pCodecCtx->height; // Determine required buffer size and allocate buffer numBytes = avpicture_get_size(AV_PIX_FMT_RGB24, width, height); buffer = *static_cast*(av_malloc(numBytes * *sizeof* (uint8_t))); // Assign appropriate parts of buffer to image planes in pFrameRGB // Note that pFrameRGB is an AVFrame, but AVFrame is a superset // of AVPicture avpicture_fill((AVPicture *)pFrameRGB, buffer, AV_PIX_FMT_RGB24, width, height); img_convert_ctx = sws_getContext(width, height, pCodecCtx->pix_fmt, width, height, AV_PIX_FMT_RGB24, SWS_BILINEAR, NULL, NULL, NULL); sws_scale(img_convert_ctx, pFrame->data, pFrame->linesize, 0, height, pFrameRGB->data, pFrameRGB->linesize); // Save the frame to disk SaveFrame(pFrameRGB, width, height, numBytes); } // Free the packet that was allocated by av_read_frame av_free_packet(&packet); } sws_freeContext(img_convert_ctx); av_free(buffer); // Free the RGB image av_free(pFrameRGB); // Free the YUV frame av_free(pFrame); // Close the codec avcodec_close(pCodecCtx); // Close the video file avformat_close_input(&pFomartCtx); av_dict_free(&pOptions); av_free_packet(&packet); } Thank you very much. Math -------------- next part -------------- An HTML attachment was scrubbed... URL: From mtaha.ansari at gmail.com Wed Sep 17 12:19:28 2014 From: mtaha.ansari at gmail.com (Taha Ansari) Date: Wed, 17 Sep 2014 15:19:28 +0500 Subject: [Libav-user] Grabbing desktop at a framerate of 25 fps In-Reply-To: References: Message-ID: A quick look at your code, you are opening up the encoder each time you write to disk: png_encoder_codec = avcodec_find_encoder_by_name ("png"); Do it just once, like at startup time, and use encoding routines on this png_encoder_codec later. Hope this helps -------------- next part -------------- An HTML attachment was scrubbed... URL: From thoman.mathieu at gmail.com Wed Sep 17 14:13:42 2014 From: thoman.mathieu at gmail.com (Mathieu Thoman) Date: Wed, 17 Sep 2014 14:13:42 +0200 Subject: [Libav-user] Grabbing desktop at a framerate of 25 fps In-Reply-To: References: Message-ID: Thanks for your reply. It will help. I didn't think about it. After analysing it seems that the function av_read_frame() is take a lot of time. I was thinking of using another method instead of this one. But couldn't find for the moment... Math Le 17 sept. 2014 12:19, "Taha Ansari" a ?crit : > > A quick look at your code, you are opening up the encoder each time you > write to disk: > > png_encoder_codec = avcodec_find_encoder_by_name ("png"); > > Do it just once, like at startup time, and use encoding routines on this > png_encoder_codec later. > > Hope this helps > > _______________________________________________ > 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 fernando.takeshi at seventh.com.br Thu Sep 18 01:30:50 2014 From: fernando.takeshi at seventh.com.br (fernando.takeshi) Date: Wed, 17 Sep 2014 16:30:50 -0700 (PDT) Subject: [Libav-user] Mux raw video data directly into mp4 files Message-ID: <1410996650407-4660437.post@n4.nabble.com> Hello, I've been searching for ways to create .mp4 files directly from saved raw video data, without decoding / encoding. The sources of said data can record frames in the h264, m4v and mjpeg formats; I end up with files that are basically raw frames of these formats, one after the other. Now, I've tested the command line approach (that I cannot use, unfortunately) and it seems to work. I need to do this programmatically, however, so I've followed (and tweaked around) ffmpeg's muxing example and many others I found online (stackoverflow, etc) and can't seem to find any consistency in how to (or what would be the correct way to) accomplish this. Right now, I do not have any sample code working, unfortunately. So, what I ask is basically: given a file consisting of raw frames (h264, m4v or mjpeg), how do I go about creating a playable video mp4 file? What would be the correct way? Specifically speaking, which functions should I be calling and in what order as to make the code work for those three formats? Some sample data can be found at https://drive.google.com/file/d/0B8XSlN4yAH72T1R0Ti1zaGViNmM/edit?usp=sharing Thanks in advance! -- View this message in context: http://libav-users.943685.n4.nabble.com/Mux-raw-video-data-directly-into-mp4-files-tp4660437.html Sent from the libav-users mailing list archive at Nabble.com. From androiddevmar11 at gmail.com Thu Sep 18 14:43:18 2014 From: androiddevmar11 at gmail.com (adev dev) Date: Thu, 18 Sep 2014 14:43:18 +0200 Subject: [Libav-user] Problem with compressing AAC files with sampling rate 16000 Message-ID: I am compressing movies from bitmaps and AAC files. Normally AAC files are recorded with following params: bit rate: 192000, sampling rate 44100. These audio params are set in output context (AVFormatContext) in compression. In happy day scenario it is working correctly. Movie and sound are correct. The problem occures if sound params are "strange". From time to time I have AAC files recorded with params: bitrate 96000, sampling rate 16000. In this case sound is very fast and ends before end of movie. If I set these params (96000, 16000) in output context there is no sound in the movie at all. Created movie file has audio stream with bitrate about 500 b/s what is really strange. What else has to be set in FFMPEG to correctly compress AAC files with bit rate 96000 and sampling rate 16000? I am using FFMPEG 2.1 and native AAC encoder. -------------- next part -------------- An HTML attachment was scrubbed... URL: From klaussfreire at gmail.com Thu Sep 18 15:41:08 2014 From: klaussfreire at gmail.com (Claudio Freire) Date: Thu, 18 Sep 2014 10:41:08 -0300 Subject: [Libav-user] Problem with compressing AAC files with sampling rate 16000 In-Reply-To: References: Message-ID: On Thu, Sep 18, 2014 at 9:43 AM, adev dev wrote: > I am compressing movies from bitmaps and AAC files. Normally AAC files are > recorded with following params: bit rate: 192000, sampling rate 44100. These > audio params are set in output context (AVFormatContext) in compression. In > happy day scenario it is working correctly. Movie and sound are correct. > > The problem occures if sound params are "strange". From time to time I have > AAC files recorded with params: bitrate 96000, sampling rate 16000. In this > case sound is very fast and ends before end of movie. If I set these params > (96000, 16000) in output context there is no sound in the movie at all. > Created movie file has audio stream with bitrate about 500 b/s what is > really strange. > > What else has to be set in FFMPEG to correctly compress AAC files with bit > rate 96000 and sampling rate 16000? > > I am using FFMPEG 2.1 and native AAC encoder. If you can build from source, try head after applying the patch in here: https://trac.ffmpeg.org/attachment/ticket/2686/aac-improvements-wip-v8g.patch It fixes some issues with some sampling rates, although your issue doesn't sound familiar to me, it's worth a try. From androiddevmar11 at gmail.com Thu Sep 18 15:56:01 2014 From: androiddevmar11 at gmail.com (adev dev) Date: Thu, 18 Sep 2014 15:56:01 +0200 Subject: [Libav-user] Problem with compressing AAC files with sampling rate 16000 In-Reply-To: References: Message-ID: I will build 2.4 version with patch and write if it helps or not. Thanks! On 18 September 2014 15:41, Claudio Freire wrote: > On Thu, Sep 18, 2014 at 9:43 AM, adev dev > wrote: > > I am compressing movies from bitmaps and AAC files. Normally AAC files > are > > recorded with following params: bit rate: 192000, sampling rate 44100. > These > > audio params are set in output context (AVFormatContext) in compression. > In > > happy day scenario it is working correctly. Movie and sound are correct. > > > > The problem occures if sound params are "strange". From time to time I > have > > AAC files recorded with params: bitrate 96000, sampling rate 16000. In > this > > case sound is very fast and ends before end of movie. If I set these > params > > (96000, 16000) in output context there is no sound in the movie at all. > > Created movie file has audio stream with bitrate about 500 b/s what is > > really strange. > > > > What else has to be set in FFMPEG to correctly compress AAC files with > bit > > rate 96000 and sampling rate 16000? > > > > I am using FFMPEG 2.1 and native AAC encoder. > > > If you can build from source, try head after applying the patch in > here: > https://trac.ffmpeg.org/attachment/ticket/2686/aac-improvements-wip-v8g.patch > > It fixes some issues with some sampling rates, although your issue > doesn't sound familiar to me, it's worth a try. > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > -------------- next part -------------- An HTML attachment was scrubbed... URL: From cehoyos at ag.or.at Thu Sep 18 17:24:08 2014 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Thu, 18 Sep 2014 15:24:08 +0000 (UTC) Subject: [Libav-user] Problem with compressing AAC files with sampling rate 16000 References: Message-ID: adev dev writes: > In this case sound is very fast and ends before > end of movie. (Klaus knows at least a magnitude more about audio than I do but I wonder if he misunderstood you.) Please test current (unpatched) FFmpeg and show your command line and complete, uncut console output and please provide an input sample. Carl Eugen From klaussfreire at gmail.com Thu Sep 18 19:05:07 2014 From: klaussfreire at gmail.com (Claudio Freire) Date: Thu, 18 Sep 2014 14:05:07 -0300 Subject: [Libav-user] Problem with compressing AAC files with sampling rate 16000 In-Reply-To: References: Message-ID: On Thu, Sep 18, 2014 at 12:24 PM, Carl Eugen Hoyos wrote: > adev dev writes: > >> In this case sound is very fast and ends before >> end of movie. > > (Klaus knows at least a magnitude more about audio > than I do but I wonder if he misunderstood you.) > > Please test current (unpatched) FFmpeg and show > your command line and complete, uncut console > output and please provide an input sample. I know the bug sounds very unrelated to that patch, but that audio stream with 500 b/s is something I noticed happening on unpatched git head, that the patch fixes. And there's sample rate table updates too, which AFAIK shouldn't affect 16000, but who knows. From bbcallen at gmail.com Thu Sep 18 20:12:01 2014 From: bbcallen at gmail.com (Zhang Rui) Date: Fri, 19 Sep 2014 02:12:01 +0800 Subject: [Libav-user] Build tag n2.4 for armv7 with --disable-armv6 complaints link error Message-ID: ------------------------- ffmpeg: tag n2.4 (ace90ee265) target: armv7 (iOS) effected option: --disable-armv6 ------------------------- xcode 5.1.1 complaints as below: Undefined symbols for architecture armv7: "_ff_startcode_find_candidate_armv6", referenced from: _ff_h264dsp_init_arm in libIJKMediaPlayer.a(h264dsp_init_arm.o) _ff_vc1dsp_init_arm in libIJKMediaPlayer.a(vc1dsp_init_arm.o) ld: symbol(s) not found for architecture armv7 clang: error: linker command failed with exit code 1 (use -v to see invocation) ------------------------- Possibly caused by this commit: 1e519b9d407fd35538b8d4dfdc723448355e9fe1 avutil: turn arm setend into a cpuflag http://git.videolan.org/?p=ffmpeg.git;a=blobdiff;f=libavutil/arm/cpu.h;h=9b3b6ff58b7c3a130abf75a46c2dff82216ebd22;hp=f056a91ca56d802ff4ad45142150891065a828f1;hb=1e519b9d407fd35538b8d4dfdc723448355e9fe1;hpb=9f61d6d8fb658ec5156f323d5c2264de5383b951 ------------------------- Work around: Link error can be fixed by --enable-armv6 or revert 1e519b9d, but I don't think neither is the best idea. ------------------------- Here is my build env: $ xcrun --sdk iphoneos clang --version Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn) Target: x86_64-apple-darwin13.3.0 Thread model: posix And build scripts: https://github.com/bbcallen/ijkplayer/tree/b0203e5f1b6ead869d17136f067efad54646b98e ------------------------- And my config line: (from config.h with --disable-armv6) #define FFMPEG_CONFIGURATION "--disable-gpl --enable-version3 --disable-nonfree --enable-runtime-cpudetect --disable-gray --disable-swscale-alpha --disable-programs --disable-ffmpeg --disable-ffplay --disable-ffprobe --disable-ffserver --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-avdevice --enable-avcodec --enable-avformat --enable-avutil --enable-swresample --enable-swscale --disable-postproc --disable-avfilter --disable-avresample --enable-network --disable-dxva2 --disable-vaapi --disable-vda --disable-vdpau --disable-encoders --disable-decoders --enable-decoder=aac --enable-decoder=aac_latm --enable-decoder=ac3 --enable-decoder=flv --enable-decoder=h263 --enable-decoder=h263i --enable-decoder=h263p --enable-decoder=h264 --enable-decoder='mp3*' --enable-decoder=vc1 --enable-decoder=vorbis --enable-decoder=vp6 --enable-decoder=vp6a --enable-decoder=vp6f --enable-decoder=vp8 --enable-decoder=webp --disable-hwaccels --disable-muxers --enable-muxer=mpegts --enable-muxer=mp4 --disable-demuxers --enable-demuxer=aac --enable-demuxer=ac3 --enable-demuxer=concat --enable-demuxer=data --enable-demuxer=flv --enable-demuxer=hls --enable-demuxer=latm --enable-demuxer=loas --enable-demuxer=m4v --enable-demuxer=mov --enable-demuxer=mp3 --enable-demuxer=mpegps --enable-demuxer=mpegts --enable-demuxer=mpegvideo --disable-parsers --enable-parser=aac --enable-parser=aac_latm --enable-parser=ac3 --enable-parser=h263 --enable-parser=h264 --enable-parser=vc1 --enable-parser=vorbis --enable-parser=vp8 --enable-parser=vp9 --enable-bsfs --disable-bsf=mjpeg2jpeg --disable-bsf=mjpeg2jpeg --disable-bsf=mjpega_dump_header --disable-bsf=mov2textsub --disable-bsf=text2movsub --enable-protocols --disable-protocol=bluray --disable-protocol=ffrtmpcrypt --enable-protocol=ffrtmphttp --disable-protocol=gopher --disable-protocol='librtmp*' --disable-protocol=libssh --disable-protocol=mmsh --disable-protocol=mmst --disable-protocol=pipe --disable-protocol='rtmp*' --enable-protocol=rtmp --enable-protocol=rtmpt --disable-protocol=rtp --disable-protocol=sctp --disable-protocol=srtp --disable-protocol=unix --disable-devices --disable-filters --disable-iconv --disable-armv5te --disable-armv6 --disable-armv6t2 --enable-cross-compile --disable-symver --disable-stripping --arch=armv7 --target-os=darwin --enable-static --disable-shared --enable-pic --enable-neon --enable-optimizations --enable-debug --enable-small --prefix=/Users/bbcallen/Workspace/bili/ios/ibiliplayer/contrib/ijkplayer/ios/build/ffmpeg-armv7/output --cc='xcrun -sdk iphoneos clang' --extra-cflags=' -arch armv7 -miphoneos-version-min=5.1.1 ' --extra-cxxflags=' -arch armv7 -miphoneos-version-min=5.1.1 ' --extra-ldflags=' -arch armv7 -miphoneos-version-min=5.1.1 '" From cehoyos at ag.or.at Thu Sep 18 23:31:01 2014 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Thu, 18 Sep 2014 21:31:01 +0000 (UTC) Subject: [Libav-user] Build tag n2.4 for armv7 with --disable-armv6 complaints link error References: Message-ID: Zhang Rui writes: > #define FFMPEG_CONFIGURATION > --enable-pic First and most important: Why are you using --enable-pic? I have heard different opinions, did you do any benchmarks? Is there anything that does not work without it? Should it be the default for iOS in your opinion? > --disable-gpl --disable-nonfree --enable-runtime-cpudetect > --disable-gray --enable-avcodec --enable-avformat > --enable-avutil --enable-swresample --enable-swscale > --disable-postproc --disable-avresample --enable-network > --enable-static --disable-shared --enable-optimizations > --enable-debug These are all default vales, your configure line gets easier to read if you remove them. (But see below for --disable-all, you will have to add all --enable options except avutil then.) > --enable-version3 I am nearly sure that this does something that you do not want. (The option does not change the binary but the license.) > --disable-programs --disable-ffmpeg > --disable-ffplay --disable-ffprobe --disable-ffserver disable-programs implies the others, you can remove them. But looking at the rest of you configure line, I suspect you actually want to start with --disable-all and enable the few features you want. > --disable-dxva2 --disable-vaapi --disable-vda > --disable-vdpau dxva2, vaapi and vdpau cannot be enabled for iOS, if vda would work, I suspect you would want it or not? > --enable-decoder=aac --enable-decoder=aac_latm > --enable-decoder=ac3 --enable-decoder=flv ... You can use --enable-decoder=aac*,ac3,flv,... Similar for --enable-muxer=mpegts,mp4 and --enable-demuxer=aac,ac3,concat,... etc. > --disable-armv5te --disable-armv6 > --disable-armv6t2 --arch=armv7 --enable-neon Can you explain this? Why are you disabling some optimizations for the arm target? I would have expected that the three disable options are not a good idea. What do I miss? (Removing them would also fix your linking issue I assume.) > --disable-symver Is this needed? If yes, it may indicate a bug. > --cc='xcrun -sdk iphoneos clang' --extra-cflags=' -arch armv7 > -miphoneos-version-min=5.1.1 ' --extra-cxxflags=' -arch armv7 > -miphoneos-version-min=5.1.1 ' --extra-ldflags=' -arch armv7 > -miphoneos-version-min=5.1.1 '" I believe the following is much simpler: --cc='xcrun -sdk iphoneos clang -arch armv7-miphoneos-version-min=5.1.1' Or does this not work? I usually test without xcrun. Carl Eugen From bbcallen at gmail.com Fri Sep 19 06:21:27 2014 From: bbcallen at gmail.com (Zhang Rui) Date: Fri, 19 Sep 2014 12:21:27 +0800 Subject: [Libav-user] Build tag n2.4 for armv7 with --disable-armv6 complaints link error In-Reply-To: References: Message-ID: Thank you for your reply, which is much more than I expected. 2014-09-19 5:31 GMT+08:00 Carl Eugen Hoyos : > First and most important: > Why are you using --enable-pic? > I have heard different opinions, did you do any > benchmarks? Is there anything that does not work > without it? > Should it be the default for iOS in your opinion? I have no idea. I saw VLC and XBMC set it for ios, so I just follow them. http://git.videolan.org/?p=vlc.git;a=blob;f=contrib/src/ffmpeg/rules.mak;hb=ffabc04f18611f362390b5acc95ee8a4bdcb3c23 https://github.com/xbmc/xbmc/blob/fb16fb8a8bef785409359148eab6d415f20d11db/tools/depends/target/ffmpeg/Makefile >> --disable-gpl --disable-nonfree --enable-runtime-cpudetect >> --disable-gray --enable-avcodec --enable-avformat >> --enable-avutil --enable-swresample --enable-swscale >> --disable-postproc --disable-avresample --enable-network >> --enable-static --disable-shared --enable-optimizations >> --enable-debug > These are all default vales, your configure line gets > easier to read if you remove them. I'm not sure whether the default values could change in future, I maintain some of them explicit in some kind of config file, https://github.com/bbcallen/ijkplayer/blob/master/config/module-lite.sh, and generate else from script for different arch. That makes configure line overelaborate. > (But see below for --disable-all, you will have to add > all --enable options except avutil then.) There is not ./configure --list-all to announce which options excatly effected by --disable-all I don't think I have enough knowledge to handle every options, I only set what I expect and leave others as default value. I thought --disable-all could disable some options I don't expect to be disabled by chance. >> --enable-version3 > > I am nearly sure that this does something that you > do not want. > (The option does not change the binary but the license.) Thank you, I thought it is something like --enable-gpl. >> --disable-programs --disable-ffmpeg >> --disable-ffplay --disable-ffprobe --disable-ffserver > > disable-programs implies the others, you can remove them. Thanks, I didn't know that. > But looking at the rest of you configure line, I suspect > you actually want to start with --disable-all and enable > the few features you want. > >> --disable-dxva2 --disable-vaapi --disable-vda >> --disable-vdpau > > dxva2, vaapi and vdpau cannot be enabled for iOS, if vda > would work, I suspect you would want it or not? I'm afraid vda API only works on OS X, but not on iOS in normal way. https://developer.apple.com/library/mac/technotes/tn2267/_index.html FYI. There is a VideoToolBox api on iOS, which was private API, and is released as public API on iOS8. https://developer.apple.com/library/ios/releasenotes/General/iOS80APIDiffs/frameworks/VideoToolbox.html There is also an implement in XBMC https://github.com/xbmc/xbmc/blob/master/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecVideoToolBox.cpp >> --enable-decoder=aac --enable-decoder=aac_latm >> --enable-decoder=ac3 --enable-decoder=flv ... > > You can use --enable-decoder=aac*,ac3,flv,... > Similar for --enable-muxer=mpegts,mp4 and > --enable-demuxer=aac,ac3,concat,... etc. Thank you. I didn't know that kind of usage. >> --disable-armv5te --disable-armv6 >> --disable-armv6t2 --arch=armv7 --enable-neon > > Can you explain this? > Why are you disabling some optimizations for the > arm target? I would have expected that the three > disable options are not a good idea. What do I > miss? > (Removing them would also fix your linking issue > I assume.) I thought armv6 optimizations have nothing to do with armv7. I've seen something in XBMC, like this: ifeq ($(findstring arm, $(CPU)), arm) ffmpg_config += --enable-pic --disable-armv5te --disable-armv6t2 endif https://github.com/xbmc/xbmc/blob/fb16fb8a8bef785409359148eab6d415f20d11db/tools/depends/target/ffmpeg/Makefile I'm not sure which arch/instruction optimizations depend on run time detection while which are not. Should I enable them all, or leave them as default. >> --disable-symver > > Is this needed? > If yes, it may indicate a bug. Thanks, I must copied it from somewhere. >> --cc='xcrun -sdk iphoneos clang' --extra-cflags=' -arch armv7 >> -miphoneos-version-min=5.1.1 ' --extra-cxxflags=' -arch armv7 >> -miphoneos-version-min=5.1.1 ' --extra-ldflags=' -arch armv7 >> -miphoneos-version-min=5.1.1 '" > > I believe the following is much simpler: > > --cc='xcrun -sdk iphoneos clang -arch armv7-miphoneos-version-min=5.1.1' > Or does this not work? I usually test without xcrun. Thanks. I think it would work. Thanks again for your kindly, detailed reply. From androiddevmar11 at gmail.com Fri Sep 19 10:28:23 2014 From: androiddevmar11 at gmail.com (adev dev) Date: Fri, 19 Sep 2014 10:28:23 +0200 Subject: [Libav-user] Problem with compressing AAC files with sampling rate 16000 In-Reply-To: References: Message-ID: I am not using command line. It is done in code in Android project. Some devices cannot record sound with 192000 and 44100 probably due to some hardware limitations. In such case Android dicreases params to 96000 and 16000. I can reproduce the issue when I record sound with sampling rate 32000 and try to compress it with samling rate 44100 on FFMPEG side. Sound is very fast and it ends before the movie is ended. I this specific case setting sampling rate to 32000 on FFMPEG side fixes the problem and sound is correctly compressed. So it looks that at least for sampling rate 16000 there is problem. I will check with 2.4 version with patch and without path. But it can take quit a long time, building FFMPEG and updated code if some functions no longer exists in 2.4(deprecated in 2.1). I will get back to you. Thanks. On 18 September 2014 19:05, Claudio Freire wrote: > On Thu, Sep 18, 2014 at 12:24 PM, Carl Eugen Hoyos > wrote: > > adev dev writes: > > > >> In this case sound is very fast and ends before > >> end of movie. > > > > (Klaus knows at least a magnitude more about audio > > than I do but I wonder if he misunderstood you.) > > > > Please test current (unpatched) FFmpeg and show > > your command line and complete, uncut console > > output and please provide an input sample. > > I know the bug sounds very unrelated to that patch, but that audio > stream with 500 b/s is something I noticed happening on unpatched git > head, that the patch fixes. > > And there's sample rate table updates too, which AFAIK shouldn't > affect 16000, but who knows. > _______________________________________________ > 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 Fri Sep 19 13:26:43 2014 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Fri, 19 Sep 2014 11:26:43 +0000 (UTC) Subject: [Libav-user] Build tag n2.4 for armv7 with --disable-armv6 complaints link error References: Message-ID: Zhang Rui writes: > 2014-09-19 5:31 GMT+08:00 Carl Eugen Hoyos : > > First and most important: > > Why are you using --enable-pic? > > I have heard different opinions, did you do any > > benchmarks? Is there anything that does not work > > without it? > > Should it be the default for iOS in your opinion? > > I have no idea. Does it work at all for you without --enable-pic? Can you do a performance test? [...] > > (But see below for --disable-all, you will have to add > > all --enable options except avutil then.) > > There is not ./configure --list-all to announce which options excatly > effected by --disable-all But there is the output of ./configure --disable-all --disable-everything is - no matter its name - a debug option for developers to speed up compilation, --disable-all disables all features that can be disabled except default library features. configure output will tell you more. > I don't think I have enough knowledge to handle every options, One more reason to use --enable-all instead of a very complicated configure line. > I only set what I expect and leave others as default value. This is not how I read your current configure line... > I thought --disable-all could disable some options I > don't expect to be disabled by chance. You already disable all possible options in your current configure line afaict. [...] > >> --disable-dxva2 --disable-vaapi --disable-vda > >> --disable-vdpau > > > > dxva2, vaapi and vdpau cannot be enabled for iOS, if vda > > would work, I suspect you would want it or not? > > I'm afraid vda API only works on OS X, but not on iOS in normal way. That is what I meant above: You don't need the options because they don't disable anything. If --disable-vda would do anything useful, you would not want to use it (I guess). > FYI. There is a VideoToolBox api on iOS, which was > private API, and is released as public API on iOS8. Who are you telling... http://thread.gmane.org/gmane.comp.video.ffmpeg.devel/129708/focus=129727 http://thread.gmane.org/gmane.comp.video.ffmpeg.devel/136432/focus=136435 [...] > >> --disable-armv5te --disable-armv6 > >> --disable-armv6t2 --arch=armv7 --enable-neon > > > > Can you explain this? > > Why are you disabling some optimizations for the > > arm target? I would have expected that the three > > disable options are not a good idea. What do I > > miss? > > (Removing them would also fix your linking issue > > I assume.) > > I thought armv6 optimizations have nothing to do with armv7. > I've seen something in XBMC, like this: > ifeq ($(findstring arm, $(CPU)), arm) > ffmpg_config += --enable-pic --disable-armv5te --disable-armv6t2 I suggest you remove --disable-armv6 from your configure line. (And benchmark h264 if you want.) Carl Eugen From klaussfreire at gmail.com Fri Sep 19 18:51:28 2014 From: klaussfreire at gmail.com (Claudio Freire) Date: Fri, 19 Sep 2014 13:51:28 -0300 Subject: [Libav-user] Problem with compressing AAC files with sampling rate 16000 In-Reply-To: References: Message-ID: On Fri, Sep 19, 2014 at 5:28 AM, adev dev wrote: > I am not using command line. It is done in code in Android project. Some > devices cannot record sound with 192000 and 44100 probably due to some > hardware limitations. In such case Android dicreases params to 96000 and > 16000. > > I can reproduce the issue when I record sound with sampling rate 32000 and > try to compress it with samling rate 44100 on FFMPEG side. Sound is very > fast and it ends before the movie is ended. I this specific case setting > sampling rate to 32000 on FFMPEG side fixes the problem and sound is > correctly compressed. Then it is quite possible that either during recording or during playback, the sample rate is specified as 44100 or 22050 when it really is lower. Can you inspect the generated files on a pc, on a console, with the command: ffmpeg -i And paste the output? From androiddevmar11 at gmail.com Sat Sep 20 11:33:08 2014 From: androiddevmar11 at gmail.com (adev dev) Date: Sat, 20 Sep 2014 11:33:08 +0200 Subject: [Libav-user] Problem with compressing AAC files with sampling rate 16000 In-Reply-To: References: Message-ID: This is information about the file which cannot be compressed: * Metadata: major_brand : isom minor_version : 0 compatible_brands: isom3gp4 creation_time : 1948-08-31 11:42:22 Duration: 00:00:47.68, start: 0.000000, bitrate: 96 kb/s Stream #0:0(eng): Audio: aac (mp4a / 0x6134706D), 16000 Hz, mono, s16, 96 kb/s Metadata: creation_time : 1948-08-31 11:42:22 handler_name : SoundHandle* I managed to build FFMPEG 2.4 and it is working. I can compress sound with parameters 96000 and sampling rate 16000. However there is problem with applying patch aac-improvements-wip-v8g.It failes with info: 1 out of 3 hunks FAILED -- saving rejects to file libavcodec/psymodel.h.rej. File psymodel.h.rej looks following: --- libavcodec/psymodel.h +++ libavcodec/psymodel.h @@ -27,9 +27,22 @@ /** maximum possible number of bands */ #define PSY_MAX_BANDS 128 /** maximum number of channels */ -#define PSY_MAX_CHANS 20 +#define PSY_MAX_CHANS 24 -#define AAC_CUTOFF(s) (s->bit_rate ? FFMIN3(4000 + s->bit_rate/8, 12000 + s->bit_rate/32, s->sample_rate / 2) : (s->sample_rate / 2)) +/* cutoff for VBR is purposedly increased, since LP filtering actually + * hinders VBR performance rather than the opposite + */ +#define _AAC_CUTOFF(bit_rate,channels,sample_rate) (bit_rate ? FFMIN3(FFMIN3( \ + bit_rate/channels/2, \ + 3000 + bit_rate/channels/4, \ + 12000 + bit_rate/channels/16), \ + 20000, \ + sample_rate / 2): (sample_rate / 2)) +#define AAC_CUTOFF(s) ( \ + (s->flags & CODEC_FLAG_QSCALE) \ + ? /*_AAC_CUTOFF(((int)(480000.0f*(s->global_quality ? s->global_quality/120.0f : 1.0f))), 1, s->sample_rate)*/s->sample_rate / 2 \ + : _AAC_CUTOFF(s->bit_rate, s->channels, s->sample_rate) \ +) /** * single band psychoacoustic information Build fails with: libavcodec/aaccoder.c:910:13: error: implicit declaration of function '_AAC_CUTOFF' [-Werror=implicit-function-declaration] libavcodec/aaccoder.c:814:44: warning: variable 'energies' set but not used [-Wunused-but-set-variable] libavcodec/aaccoder.c: At top level: libavcodec/aaccoder.c:366:14: warning: 'find_max_absval' defined but not used [-Wunused-function] cc1: some warnings being treated as errors make: *** [libavcodec/aaccoder.o] Error 1 make: *** Waiting for unfinished jobs.... CC libavcodec/aacenc.o libavcodec/aacdec.c: In function 'imdct_and_windowing_eld': libavcodec/aacdec.c:2590:29: warning: array subscript is above array bounds [-Warray-bounds] libavcodec/aacdec.c:2596:29: warning: array subscript is above array bounds [-Warray-bounds] Native build complete, exiting... marcin at marcin:~/android-dev/FFFMPEG_BUILDS/ffmpeg-2.4-build-scrypts$ Good info is that with 2.4 it is working but it would be very good to apply this patch to improve quality of aac. Is there any fix for this patch problem?? BR, Marcin On 19 September 2014 18:51, Claudio Freire wrote: > On Fri, Sep 19, 2014 at 5:28 AM, adev dev > wrote: > > I am not using command line. It is done in code in Android project. Some > > devices cannot record sound with 192000 and 44100 probably due to some > > hardware limitations. In such case Android dicreases params to 96000 and > > 16000. > > > > I can reproduce the issue when I record sound with sampling rate 32000 > and > > try to compress it with samling rate 44100 on FFMPEG side. Sound is very > > fast and it ends before the movie is ended. I this specific case setting > > sampling rate to 32000 on FFMPEG side fixes the problem and sound is > > correctly compressed. > > Then it is quite possible that either during recording or during > playback, the sample rate is specified as 44100 or 22050 when it > really is lower. > > Can you inspect the generated files on a pc, on a console, with the > command: > > ffmpeg -i > > And paste the output? > _______________________________________________ > 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 klaussfreire at gmail.com Sat Sep 20 14:14:43 2014 From: klaussfreire at gmail.com (Claudio Freire) Date: Sat, 20 Sep 2014 09:14:43 -0300 Subject: [Libav-user] Problem with compressing AAC files with sampling rate 16000 In-Reply-To: References: Message-ID: On Sat, Sep 20, 2014 at 6:33 AM, adev dev wrote: > This is information about the file which cannot be compressed: > Metadata: > major_brand : isom > minor_version : 0 > compatible_brands: isom3gp4 > creation_time : 1948-08-31 11:42:22 > Duration: 00:00:47.68, start: 0.000000, bitrate: 96 kb/s > Stream #0:0(eng): Audio: aac (mp4a / 0x6134706D), 16000 Hz, mono, s16, > 96 kb/s > Metadata: > creation_time : 1948-08-31 11:42:22 > handler_name : SoundHandle > > > I managed to build FFMPEG 2.4 and it is working. I can compress sound with > parameters 96000 and sampling rate 16000. However there is problem with > applying patch aac-improvements-wip-v8g.It failes with info: 1 out of 3 > hunks FAILED -- saving rejects to file libavcodec/psymodel.h.rej. File > psymodel.h.rej looks following: I guess it needs rebasing. I didn't think there were changes to those files after the last rebase, but I guess there were. > Build fails with: > > libavcodec/aaccoder.c:910:13: error: implicit declaration of function > '_AAC_CUTOFF' [-Werror=implicit-function-declaration] > libavcodec/aaccoder.c:814:44: warning: variable 'energies' set but not used > [-Wunused-but-set-variable] > libavcodec/aaccoder.c: At top level: > libavcodec/aaccoder.c:366:14: warning: 'find_max_absval' defined but not > used [-Wunused-function] > cc1: some warnings being treated as errors > > make: *** [libavcodec/aaccoder.o] Error 1 > make: *** Waiting for unfinished jobs.... > CC libavcodec/aacenc.o > libavcodec/aacdec.c: In function 'imdct_and_windowing_eld': > libavcodec/aacdec.c:2590:29: warning: array subscript is above array bounds > [-Warray-bounds] > libavcodec/aacdec.c:2596:29: warning: array subscript is above array bounds > [-Warray-bounds] > Native build complete, exiting... > marcin at marcin:~/android-dev/FFFMPEG_BUILDS/ffmpeg-2.4-build-scrypts$ Why are warnings treated as errors? > Good info is that with 2.4 it is working but it would be very good to apply > this patch to improve quality of aac. Is there any fix for this patch > problem?? Yeah, rebasing. I'll do so when I find the time. From androiddevmar11 at gmail.com Sat Sep 20 15:10:14 2014 From: androiddevmar11 at gmail.com (adev dev) Date: Sat, 20 Sep 2014 15:10:14 +0200 Subject: [Libav-user] Problem with compressing AAC files with sampling rate 16000 In-Reply-To: References: Message-ID: I do not know why some warnings are treated as errors. I added flag -disable-werror but still the same. I will wait for update of that patch. For now I managed to build FFMPEG2.4 + aac_quality_improvment.patch. At least that problem with pulsing noice is fixed by that patch. Thanks for help! On 20 September 2014 14:14, Claudio Freire wrote: > On Sat, Sep 20, 2014 at 6:33 AM, adev dev > wrote: > > This is information about the file which cannot be compressed: > > Metadata: > > major_brand : isom > > minor_version : 0 > > compatible_brands: isom3gp4 > > creation_time : 1948-08-31 11:42:22 > > Duration: 00:00:47.68, start: 0.000000, bitrate: 96 kb/s > > Stream #0:0(eng): Audio: aac (mp4a / 0x6134706D), 16000 Hz, mono, > s16, > > 96 kb/s > > Metadata: > > creation_time : 1948-08-31 11:42:22 > > handler_name : SoundHandle > > > > > > I managed to build FFMPEG 2.4 and it is working. I can compress sound > with > > parameters 96000 and sampling rate 16000. However there is problem with > > applying patch aac-improvements-wip-v8g.It failes with info: 1 out of 3 > > hunks FAILED -- saving rejects to file libavcodec/psymodel.h.rej. File > > psymodel.h.rej looks following: > > I guess it needs rebasing. I didn't think there were changes to those > files after the last rebase, but I guess there were. > > > > Build fails with: > > > > libavcodec/aaccoder.c:910:13: error: implicit declaration of function > > '_AAC_CUTOFF' [-Werror=implicit-function-declaration] > > libavcodec/aaccoder.c:814:44: warning: variable 'energies' set but not > used > > [-Wunused-but-set-variable] > > libavcodec/aaccoder.c: At top level: > > libavcodec/aaccoder.c:366:14: warning: 'find_max_absval' defined but not > > used [-Wunused-function] > > cc1: some warnings being treated as errors > > > > make: *** [libavcodec/aaccoder.o] Error 1 > > make: *** Waiting for unfinished jobs.... > > CC libavcodec/aacenc.o > > libavcodec/aacdec.c: In function 'imdct_and_windowing_eld': > > libavcodec/aacdec.c:2590:29: warning: array subscript is above array > bounds > > [-Warray-bounds] > > libavcodec/aacdec.c:2596:29: warning: array subscript is above array > bounds > > [-Warray-bounds] > > Native build complete, exiting... > > marcin at marcin:~/android-dev/FFFMPEG_BUILDS/ffmpeg-2.4-build-scrypts$ > > Why are warnings treated as errors? > > > Good info is that with 2.4 it is working but it would be very good to > apply > > this patch to improve quality of aac. Is there any fix for this patch > > problem?? > > Yeah, rebasing. I'll do so when I find the time. > _______________________________________________ > 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 androiddevmar11 at gmail.com Sat Sep 20 15:20:33 2014 From: androiddevmar11 at gmail.com (adev dev) Date: Sat, 20 Sep 2014 15:20:33 +0200 Subject: [Libav-user] Problem with compressing AAC files with sampling rate 16000 In-Reply-To: References: Message-ID: I made mistake. FFMPEG2.4 + aac_quality_improvment.patch do not solve the issue with sampling rate 16000. I will wait for patch update. On 20 September 2014 15:10, adev dev wrote: > I do not know why some warnings are treated as errors. I added flag > -disable-werror but still the same. I will wait for update of that patch. > For now I managed to build FFMPEG2.4 + aac_quality_improvment.patch. At > least that problem with pulsing noice is fixed by that patch. Thanks for > help! > > On 20 September 2014 14:14, Claudio Freire wrote: > >> On Sat, Sep 20, 2014 at 6:33 AM, adev dev >> wrote: >> > This is information about the file which cannot be compressed: >> > Metadata: >> > major_brand : isom >> > minor_version : 0 >> > compatible_brands: isom3gp4 >> > creation_time : 1948-08-31 11:42:22 >> > Duration: 00:00:47.68, start: 0.000000, bitrate: 96 kb/s >> > Stream #0:0(eng): Audio: aac (mp4a / 0x6134706D), 16000 Hz, mono, >> s16, >> > 96 kb/s >> > Metadata: >> > creation_time : 1948-08-31 11:42:22 >> > handler_name : SoundHandle >> > >> > >> > I managed to build FFMPEG 2.4 and it is working. I can compress sound >> with >> > parameters 96000 and sampling rate 16000. However there is problem with >> > applying patch aac-improvements-wip-v8g.It failes with info: 1 out of 3 >> > hunks FAILED -- saving rejects to file libavcodec/psymodel.h.rej. File >> > psymodel.h.rej looks following: >> >> I guess it needs rebasing. I didn't think there were changes to those >> files after the last rebase, but I guess there were. >> >> >> > Build fails with: >> > >> > libavcodec/aaccoder.c:910:13: error: implicit declaration of function >> > '_AAC_CUTOFF' [-Werror=implicit-function-declaration] >> > libavcodec/aaccoder.c:814:44: warning: variable 'energies' set but not >> used >> > [-Wunused-but-set-variable] >> > libavcodec/aaccoder.c: At top level: >> > libavcodec/aaccoder.c:366:14: warning: 'find_max_absval' defined but not >> > used [-Wunused-function] >> > cc1: some warnings being treated as errors >> > >> > make: *** [libavcodec/aaccoder.o] Error 1 >> > make: *** Waiting for unfinished jobs.... >> > CC libavcodec/aacenc.o >> > libavcodec/aacdec.c: In function 'imdct_and_windowing_eld': >> > libavcodec/aacdec.c:2590:29: warning: array subscript is above array >> bounds >> > [-Warray-bounds] >> > libavcodec/aacdec.c:2596:29: warning: array subscript is above array >> bounds >> > [-Warray-bounds] >> > Native build complete, exiting... >> > marcin at marcin:~/android-dev/FFFMPEG_BUILDS/ffmpeg-2.4-build-scrypts$ >> >> Why are warnings treated as errors? >> >> > Good info is that with 2.4 it is working but it would be very good to >> apply >> > this patch to improve quality of aac. Is there any fix for this patch >> > problem?? >> >> Yeah, rebasing. I'll do so when I find the time. >> _______________________________________________ >> 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 suprith1230 at gmail.com Sun Sep 21 07:55:10 2014 From: suprith1230 at gmail.com (Suprith Gowda) Date: Sun, 21 Sep 2014 11:25:10 +0530 Subject: [Libav-user] Decoding audio? In-Reply-To: References: Message-ID: Hello Marcus Johnson, check out this link : https://libav.org/doxygen/master/avcodec_8c_source.html#l00223 I think this will help you Thanks suprith On Wed, Sep 17, 2014 at 4:40 AM, Marcus Johnson wrote: > I'm writing a program to demux and decode audio with the help of the > ffmpeg libraries, I'm to the part where the audio is decoded but I'm not > sure which function the decoded audio comes out of? > > how do I grab the decoded audio so I can further process it myself? > > _______________________________________________ > 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 julien.durillon at clever-cloud.com Sun Sep 21 14:57:39 2014 From: julien.durillon at clever-cloud.com (Julien Durillon) Date: Sun, 21 Sep 2014 14:57:39 +0200 Subject: [Libav-user] SWR_CH_MAX no more exists Message-ID: Hi, I'm trying to build a project (ffDiaporama, which I'm not the contributor of) that deps on ffmpeg up to 2.1. The ffmpeg installed on my laptop is 2.4. ffDiaporama has only one error when building against 2.4: "error: 'SWR_CH_MAX' was not declared in this scope" I did some digging, and I found out that SWR_CH_MAX (documented here: http://ffmpeg.org/doxygen/2.4/group__lswr.html ) Is no more defined in 2.4, because LIBSWRESAMPLE_VERSION_MAJOR = 1 since ffmpeg 2.4. For my build's sake, I made a local patch to ffDiaporama to define SWR_CH_MAX if swresample.h does not define it. Is SWR_CH_MAX no more to be used? How should I replace it in ffDiaporama? I couldn't find any information about that. Regards, -- Julien Durillon Clever Cloud Tel : 06 09 15 00 49 I'm VSRE compliant (http://vsre.info/index.html) From nfxjfg at googlemail.com Sun Sep 21 15:12:16 2014 From: nfxjfg at googlemail.com (wm4) Date: Sun, 21 Sep 2014 15:12:16 +0200 Subject: [Libav-user] SWR_CH_MAX no more exists In-Reply-To: References: Message-ID: <20140921151216.5a7b98a8@debian> On Sun, 21 Sep 2014 14:57:39 +0200 Julien Durillon wrote: > Hi, > > I'm trying to build a project (ffDiaporama, which I'm not the > contributor of) that deps on ffmpeg up to 2.1. > The ffmpeg installed on my laptop is 2.4. > > ffDiaporama has only one error when building against 2.4: > > "error: 'SWR_CH_MAX' was not declared in this scope" > > I did some digging, and I found out that SWR_CH_MAX (documented here: > http://ffmpeg.org/doxygen/2.4/group__lswr.html ) > Is no more defined in 2.4, because LIBSWRESAMPLE_VERSION_MAJOR = 1 > since ffmpeg 2.4. > > For my build's sake, I made a local patch to ffDiaporama to define > SWR_CH_MAX if swresample.h does not define it. > > Is SWR_CH_MAX no more to be used? How should I replace it in > ffDiaporama? I couldn't find any information about that. > > Regards, The FFmpeg API doesn't impose any maximum channel number, so at least in theory, it could decode audio tracks with INT_MAX channels. (Though it looks like libswsresample is still limited to 32 internally?) If a ffDiaporama needs a static channel limit, the right way is to: 1. define an application-specific constant for the max. channels supported by it 2. when decoding or filtering, check if the channel number is not larger than the supported number of channels, and if it is, exit with an error From julien.durillon at clever-cloud.com Sun Sep 21 15:26:35 2014 From: julien.durillon at clever-cloud.com (Julien Durillon) Date: Sun, 21 Sep 2014 15:26:35 +0200 Subject: [Libav-user] SWR_CH_MAX no more exists In-Reply-To: <20140921151216.5a7b98a8@debian> References: <20140921151216.5a7b98a8@debian> Message-ID: 2014-09-21 15:12 GMT+02:00 wm4 : > The FFmpeg API doesn't impose any maximum channel number, so at least > in theory, it could decode audio tracks with INT_MAX channels. Ok, I understand it now. > (Though it looks like libswsresample is still limited to 32 internally?) > > If a ffDiaporama needs a static channel limit, the right way is to: > > 1. define an application-specific constant for the max. channels > supported by it > 2. when decoding or filtering, check if the channel number is not larger > than the supported number of channels, and if it is, exit with an > error Ok, I'll discuss it with the ffDiaporama team. Thanks for the quick answer! -- Julien Durillon Clever Cloud Tel : 06 09 15 00 49 I'm VSRE compliant (http://vsre.info/index.html) From wadkes93 at gmail.com Sun Sep 21 16:30:26 2014 From: wadkes93 at gmail.com (Ankush) Date: Sun, 21 Sep 2014 20:00:26 +0530 Subject: [Libav-user] Audio stream seeking calculation Message-ID: <541ee106.ee25460a.0192.4545@mx.google.com> Hi, I am working with avseek_frame() using bytes. I figured out the calculation for the timestamp value of the video stream from the frame number but couldn't figure out a way to calculate the approriate timestamp for the audio stream from the sample number. Any help here could be really useful. Thank you -------------- next part -------------- An HTML attachment was scrubbed... URL: From nfxjfg at googlemail.com Sun Sep 21 16:37:39 2014 From: nfxjfg at googlemail.com (wm4) Date: Sun, 21 Sep 2014 16:37:39 +0200 Subject: [Libav-user] Audio stream seeking calculation In-Reply-To: <541ee106.ee25460a.0192.4545@mx.google.com> References: <541ee106.ee25460a.0192.4545@mx.google.com> Message-ID: <20140921163739.06eacd65@debian> On Sun, 21 Sep 2014 20:00:26 +0530 Ankush wrote: > Hi, > I am working with avseek_frame() using bytes. I figured out the calculation for the timestamp value of the video stream from the frame number but couldn't figure out a way to calculate the approriate timestamp for the audio stream from the sample number. Any help here could be really useful. > > Thank you That may be impossible. Just do timestamp seeks directly (and also use AVSEEK_FLAG_BACKWARD). That might be unreliable too (depending on the format), and the only absolutely reliable way to do sample-exact seeking is decoding the file from the start and skipping samples until you reached the target. From mrfun.china at gmail.com Mon Sep 22 09:00:46 2014 From: mrfun.china at gmail.com (YIRAN LI) Date: Mon, 22 Sep 2014 17:00:46 +1000 Subject: [Libav-user] using avpicture_deinterlace Message-ID: Hi there, I have some questions for the deprecated avpicture_deinterlace function in ffmpeg. Our program is using avpicture_deinterlace to deinterlace frames. For every video packet, avcodec_decode_video2 is called to get a complete frame, and if it's interlaced_frame field is true, we can avpicture_deinterlace to deinterlace it. I'm not very familiar with frame interlacing/deinterlacing. But I double will it be possible that even for an interlaced streams, some frames read out are not interlaced and some others are. And for those interlaced frames, they may contain first field only, second field only or both fields. I mean avpicture_deinterlace is simple, it just reads an interlaced frame and outputs a deinterlaced one. I checked the code, seems its implementation doesn't handle those different cases I mentioned. So does avpicture_deinterlace always assume that input frame for example always contains 2 fields and avcodec_decode_video2 internally guarantees it (so that every frame decoded always contains 2 fields) Thanks for any information. -------------- next part -------------- An HTML attachment was scrubbed... URL: From h.leppkes at gmail.com Mon Sep 22 09:25:18 2014 From: h.leppkes at gmail.com (Hendrik Leppkes) Date: Mon, 22 Sep 2014 09:25:18 +0200 Subject: [Libav-user] using avpicture_deinterlace In-Reply-To: References: Message-ID: On Mon, Sep 22, 2014 at 9:00 AM, YIRAN LI wrote: > Hi there, > > I have some questions for the deprecated avpicture_deinterlace function > in ffmpeg. > > Our program is using avpicture_deinterlace to deinterlace frames. For > every video packet, avcodec_decode_video2 is called to get a complete > frame, and if it's interlaced_frame field is true, we can > avpicture_deinterlace to deinterlace it. > > I'm not very familiar with frame interlacing/deinterlacing. But I double > will it be possible that even for an interlaced streams, some frames read > out are not interlaced and some others are. And for those interlaced > frames, they may contain first field only, second field only or both > fields. > > I mean avpicture_deinterlace is simple, it just reads an interlaced frame > and outputs a deinterlaced one. I checked the code, seems its > implementation doesn't handle those different cases I mentioned. > > So does avpicture_deinterlace always assume that input frame for example > always contains 2 fields and avcodec_decode_video2 internally guarantees it > (so that every frame decoded always contains 2 fields) > > Anything in ffmpeg assumes that a frame contains both interlaced fields, and all decoders will always output decoded video like this. - Hendrik -------------- next part -------------- An HTML attachment was scrubbed... URL: From cehoyos at ag.or.at Mon Sep 22 09:40:38 2014 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Mon, 22 Sep 2014 07:40:38 +0000 (UTC) Subject: [Libav-user] =?utf-8?q?using_avpicture=5Fdeinterlace?= References: Message-ID: Hendrik Leppkes writes: > Our program is using avpicture_deinterlace > to deinterlace frames. This sounds like a bad idea, use yadif instead. > if it's interlaced_frame field is true, we > can avpicture_deinterlace to deinterlace it. This is also a bad idea: the interlaced_frame filed tells you how the frame was *encoded* but to decide whether it should be deinterlaced or not only the actual content is relevant which is often independent of interlaced_frame. As Hendrik explained, frames and fields within FFmpeg are defined so that one frame consists of two fields. (Even in cases when this is semantically wrong.) Carl Eugen From mrfun.china at gmail.com Mon Sep 22 12:33:45 2014 From: mrfun.china at gmail.com (YIRAN LI) Date: Mon, 22 Sep 2014 20:33:45 +1000 Subject: [Libav-user] using avpicture_deinterlace In-Reply-To: References: Message-ID: > Hendrik Leppkes writes: > > > Our program is using avpicture_deinterlace > > to deinterlace frames. > > This sounds like a bad idea, use yadif instead. > > > if it's interlaced_frame field is true, we > > can avpicture_deinterlace to deinterlace it. > > This is also a bad idea: the interlaced_frame > filed tells you how the frame was *encoded* > but to decide whether it should be deinterlaced > or not only the actual content is relevant > which is often independent of interlaced_frame. > > As Hendrik explained, frames and fields within > FFmpeg are defined so that one frame consists > of two fields. > (Even in cases when this is semantically wrong.) > > ?Thanks Hendrik and Carl, For some reason, our program can't use yadif, so the only option is ?avpicture_deinterlace. If whether to deinterlace or not only depends on actual content, and there's no single flag for that, how is avpicture_deinterlace used in old days (if there's any example)? Thanks 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 donmoir at comcast.net Mon Sep 22 13:51:02 2014 From: donmoir at comcast.net (Don Moir) Date: Mon, 22 Sep 2014 07:51:02 -0400 Subject: [Libav-user] using avpicture_deinterlace References: Message-ID: <52A5EEB5D54841E4905C50F3BE73F5D6@MANLAP> > Hendrik Leppkes writes: > >> Our program is using avpicture_deinterlace >> to deinterlace frames. > > This sounds like a bad idea, use yadif instead. > >> if it's interlaced_frame field is true, we >> can avpicture_deinterlace to deinterlace it. > > This is also a bad idea: the interlaced_frame > filed tells you how the frame was *encoded* > but to decide whether it should be deinterlaced > or not only the actual content is relevant > which is often independent of interlaced_frame. > > As Hendrik explained, frames and fields within > FFmpeg are defined so that one frame consists > of two fields. > (Even in cases when this is semantically wrong.) > > Carl Eugen > In the initial attempt at using ffmpeg, I used avfilter because it was a part of sample code I was looking at. Then as I got more into it I see I don't need avfilter. I am thinking thank god. Remembering back I was thinking clusmy and a place for more things to go wrong. While there seems to be some useful things in avfilter, I don't really need any of it. Anything I might need from there I just do that myself in my own code. So yadif is integrated via avfilter in ffmpeg I believe. Deinterlacing is something I need to do. I am no expert on deinterlacing, yadif, or avfilter. avpicture_deinterlace is inferior to yadif as far as I know and what most people will tell you. I do not have video where avpicture_deinterlace does not do an acceptable job but somewhere there must be one :) The beauty of avpicture_deinterlace for me is how easy it is to call. There is no setup for it and you can just call it or not depending on deinterlace requriement or intense CPU usage, etc. In other words, an easy on the fly decision. I would like to see avpicture_deinterlace improved, renamed, but retained as part of the main ffmpeg libraries. I have not found a reason to link to avfilter except yadif but so far that is not enough for the potential head aches, additional setup that might require, and not so sure what improvement that would bring. I am thinking a negative it terms of CPU usage as a start. From u at pkh.me Mon Sep 22 13:59:14 2014 From: u at pkh.me (=?utf-8?B?Q2zDqW1lbnQgQsWTc2No?=) Date: Mon, 22 Sep 2014 13:59:14 +0200 Subject: [Libav-user] using avpicture_deinterlace In-Reply-To: <52A5EEB5D54841E4905C50F3BE73F5D6@MANLAP> References: <52A5EEB5D54841E4905C50F3BE73F5D6@MANLAP> Message-ID: <20140922115914.GB27557@leki> On Mon, Sep 22, 2014 at 07:51:02AM -0400, Don Moir wrote: > > >Hendrik Leppkes writes: > > > >>Our program is using avpicture_deinterlace > >>to deinterlace frames. > > > >This sounds like a bad idea, use yadif instead. > > > >>if it's interlaced_frame field is true, we > >>can avpicture_deinterlace to deinterlace it. > > > >This is also a bad idea: the interlaced_frame > >filed tells you how the frame was *encoded* > >but to decide whether it should be deinterlaced > >or not only the actual content is relevant > >which is often independent of interlaced_frame. > > > >As Hendrik explained, frames and fields within > >FFmpeg are defined so that one frame consists > >of two fields. > >(Even in cases when this is semantically wrong.) > > > >Carl Eugen > > > > In the initial attempt at using ffmpeg, I used avfilter because it was a > part of sample code I was looking at. Then as I got more into it I see I > don't need avfilter. I am thinking thank god. Remembering back I was > thinking clusmy and a place for more things to go wrong. While there seems > to be some useful things in avfilter, I don't really need any of it. > Anything I might need from there I just do that myself in my own code. > > So yadif is integrated via avfilter in ffmpeg I believe. Deinterlacing is > something I need to do. I am no expert on deinterlacing, yadif, or avfilter. > > avpicture_deinterlace is inferior to yadif as far as I know and what most > people will tell you. I do not have video where avpicture_deinterlace does > not do an acceptable job but somewhere there must be one :) > > The beauty of avpicture_deinterlace for me is how easy it is to call. There > is no setup for it and you can just call it or not depending on deinterlace > requriement or intense CPU usage, etc. In other words, an easy on the fly > decision. > > I would like to see avpicture_deinterlace improved, renamed, but retained as > part of the main ffmpeg libraries. I have not found a reason to link to > avfilter except yadif but so far that is not enough for the potential head > aches, additional setup that might require, and not so sure what improvement > that would bring. I am thinking a negative it terms of CPU usage as a start. > This code doesn't belong anywhere else than in filters. You can already strip off everything you don't want from libavfilter and link against it. The overhead won't be large. There is no way we are going to maintain an improve a broken filter out of libavfilter. What you want might be a better interface than currently for libavfilter. Now you can also just strip off avpicture_deinterlace() from FFmpeg, and improve it in your application. We have multiple deinterlacers in avfilter, and they need temporal information to be useful. We are not going to have such code in libavcodec, libavfilter is designed for that exact purpose. -- Cl?ment B. -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 473 bytes Desc: not available URL: From donmoir at comcast.net Mon Sep 22 14:16:44 2014 From: donmoir at comcast.net (Don Moir) Date: Mon, 22 Sep 2014 08:16:44 -0400 Subject: [Libav-user] using avpicture_deinterlace References: <52A5EEB5D54841E4905C50F3BE73F5D6@MANLAP> <20140922115914.GB27557@leki> Message-ID: <16FC8CAAE4D149AEB4B556A6563E6625@MANLAP> >> In the initial attempt at using ffmpeg, I used avfilter because it was a >> part of sample code I was looking at. Then as I got more into it I see I >> don't need avfilter. I am thinking thank god. Remembering back I was >> thinking clusmy and a place for more things to go wrong. While there seems >> to be some useful things in avfilter, I don't really need any of it. >> Anything I might need from there I just do that myself in my own code. >> >> So yadif is integrated via avfilter in ffmpeg I believe. Deinterlacing is >> something I need to do. I am no expert on deinterlacing, yadif, or avfilter. >> >> avpicture_deinterlace is inferior to yadif as far as I know and what most >> people will tell you. I do not have video where avpicture_deinterlace does >> not do an acceptable job but somewhere there must be one :) >> >> The beauty of avpicture_deinterlace for me is how easy it is to call. There >> is no setup for it and you can just call it or not depending on deinterlace >> requriement or intense CPU usage, etc. In other words, an easy on the fly >> decision. >> >> I would like to see avpicture_deinterlace improved, renamed, but retained as >> part of the main ffmpeg libraries. I have not found a reason to link to >> avfilter except yadif but so far that is not enough for the potential head >> aches, additional setup that might require, and not so sure what improvement >> that would bring. I am thinking a negative it terms of CPU usage as a start. >> >This code doesn't belong anywhere else than in filters. You can already >strip off everything you don't want from libavfilter and link against it. >The overhead won't be large. There is no way we are going to maintain an >improve a broken filter out of libavfilter. >What you want might be a better interface than currently for libavfilter. >Now you can also just strip off avpicture_deinterlace() from FFmpeg, >and improve it in your application. >We have multiple deinterlacers in avfilter, and they need temporal >information to be useful. We are not going to have such code in >libavcodec, libavfilter is designed for that exact purpose. >-- >Cl?ment B. Yeah I hear you. I already don't call avpicture_deinterlace anymore and started down the path of doing that myself the last time we had this dicussion since there is no way I will be linking to avfilter. I will improve my own internal code when and if I find a need to do that. I already knew this was a losing battle but just gave an opinion on usage one last time since you guys are more expert at deinterlacing then I am. From cehoyos at ag.or.at Mon Sep 22 14:27:52 2014 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Mon, 22 Sep 2014 12:27:52 +0000 (UTC) Subject: [Libav-user] =?utf-8?q?using_avpicture=5Fdeinterlace?= References: Message-ID: YIRAN LI writes: > For some reason, our program can't use yadif, Why not? > so the only option is ?avpicture_deinterlace. You do understand that "deprecated" means this function will get removed from FFmpeg (soon)? > If whether to deinterlace or not only depends > on actual content, and there's no single?flag > for that, how is?avpicture_deinterlace used in > old days (if there's any example)? In the old days, you had to visually inspect the input video to decide if it is interlaced or not, nowadays we fortunately have the idet filter. Carl Eugen From artem.moroz at gmail.com Mon Sep 22 15:21:27 2014 From: artem.moroz at gmail.com (Artem Moroz) Date: Mon, 22 Sep 2014 16:21:27 +0300 Subject: [Libav-user] Cannot disable HLS variant in runtime Message-ID: I am trying to implement the HLS adaptive streaming. I am disabling unneeded variants with setting AVDISCARD_ALL in AVStream->discard. for (i = 0; i < player->input_format_ctx->nb_streams; i++) { AVStream* stream = player->input_format_ctx->streams[i]; AVDictionary* metadaat = stream->metadata; AVDictionaryEntry* tag = NULL; int nReadBitrate = 0; discard = AVDISCARD_ALL; tag = av_dict_get(metadaat, "variant_bitrate", NULL, 0); if (tag != NULL) { nReadBitrate = atoi(tag->value); if (nReadBitrate == 600000) { discard = AVDISCARD_NONE; LOGI(3, "player_read_from_stream enabled bitrate %d for input stream %d", nReadBitrate, i); } else { discard = AVDISCARD_ALL; LOGI(3, "player_read_from_stream disabled bitrate %d for input stream %d", nReadBitrate, i); } } stream->discard = discard; } But once I enable stream bitrate, I cannot disable it again back. It still downloads disabled bitrates! How can I disable fetching of live streams? -------------- next part -------------- An HTML attachment was scrubbed... URL: From fernando.takeshi at seventh.com.br Mon Sep 22 21:05:48 2014 From: fernando.takeshi at seventh.com.br (fernando.takeshi) Date: Mon, 22 Sep 2014 12:05:48 -0700 (PDT) Subject: [Libav-user] Mux raw video data directly into mp4 files In-Reply-To: <1410996650407-4660437.post@n4.nabble.com> References: <1410996650407-4660437.post@n4.nabble.com> Message-ID: <1411412748263-4660468.post@n4.nabble.com> Can't anybody provide some code that would work with the sample data i provided? Or point me in the right direction? -- View this message in context: http://libav-users.943685.n4.nabble.com/Mux-raw-video-data-directly-into-mp4-files-tp4660437p4660468.html Sent from the libav-users mailing list archive at Nabble.com. From * at sbwn.fr Wed Sep 24 10:42:45 2014 From: * at sbwn.fr (sbwn) Date: Wed, 24 Sep 2014 10:42:45 +0200 (CEST) Subject: [Libav-user] [libavcodec][C] convert audio files Message-ID: <1480106813.555495.1411548165391.open-xchange@oxbaltgw16.schlund.de> Hello, I'm trying to make a C++ program that convert music files, but it doesn't work. main.cpp : http://pastebin.com/kTN45Fn1 functions.cpp : http://pastebin.com/aRwdHxy7 Makefile : http://pastebin.com/BzBEBicH Program output : [mp3 @ 0x21eb200] max_analyze_duration reached Input #0, mp3, from 'test.mp3': Metadata: major_brand : mp42 minor_version : 0 compatible_brands: isommp42 creation_time : 2013-11-29 03:30:21 encoder : Lavf53.21.1 Duration: 00:03:58.15, start: 0.000000, bitrate: 192 kb/s Stream #0.0: Audio: mp3, 44100 Hz, stereo, s16, 192 kb/s Output #0, mp4, to 'out.mp4': Stream #0.0: Audio: libvorbis, 44100 Hz, stereo, s16, 192 kb/s [mp4 @ 0x21ee5c0] Codec for stream 0 does not use global headers but container format requires global headers audio encode error-22 Invalid argument avcodec_encode_audio2 returns -22 and the error string is "Invalid argument", I don't know more about the error Thank you to help me [:)] -------------- next part -------------- An HTML attachment was scrubbed... URL: From brado at bighillsoftware.com Wed Sep 24 20:12:28 2014 From: brado at bighillsoftware.com (Bradley O'Hearne) Date: Wed, 24 Sep 2014 11:12:28 -0700 Subject: [Libav-user] [libavcodec][C] convert audio files In-Reply-To: <1480106813.555495.1411548165391.open-xchange@oxbaltgw16.schlund.de> References: <1480106813.555495.1411548165391.open-xchange@oxbaltgw16.schlund.de> Message-ID: <58BE6260-1460-4429-8276-4506091B1A74@bighillsoftware.com> > On Sep 24, 2014, at 1:42 AM, sbwn <*@sbwn.fr> wrote: > > Hello, > I'm trying to make a C++ program that convert music files, but it doesn't work. > > main.cpp : http://pastebin.com/kTN45Fn1 > functions.cpp : http://pastebin.com/aRwdHxy7 > Makefile : http://pastebin.com/BzBEBicH > Program output : > [mp3 @ 0x21eb200] max_analyze_duration reached > Input #0, mp3, from 'test.mp3': > Metadata: > major_brand : mp42 > minor_version : 0 > compatible_brands: isommp42 > creation_time : 2013-11-29 03:30:21 > encoder : Lavf53.21.1 > Duration: 00:03:58.15, start: 0.000000, bitrate: 192 kb/s > Stream #0.0: Audio: mp3, 44100 Hz, stereo, s16, 192 kb/s > Output #0, mp4, to 'out.mp4': > Stream #0.0: Audio: libvorbis, 44100 Hz, stereo, s16, 192 kb/s > [mp4 @ 0x21ee5c0] Codec for stream 0 does not use global headers but container format requires global headers > audio encode error-22 Invalid argument > > avcodec_encode_audio2 returns -22 and the error string is "Invalid argument", I don't know more about the error This isn?t going to solve your immediate problem, but I can give you one bit of advice on any audio resampling operations you are performing, which gave me fits for weeks. My problem was that after what appeared to be successful resampling, I had a buzz that had been added to the audio. I tried all sorts of machinations to fix this, to no avail. In the end, the problem was the rounding function used (which was to round up, and which was employed in virtually every resampling example I found in sample code, blogs, etc. on the Internet). Change the function used to round down ? this will prevent additives to your audio. The logic behind this is probably self-explanatory if you think of the effect to a sound wave by rounding up (adds data) versus down (removes data, albeit a minimal amount). A change of four characters in my code completely resolved the issue. Keep an eye out for this if you are doing heavy resampling. Good luck. Brad -------------- next part -------------- An HTML attachment was scrubbed... URL: From tuviahs at telestream.net Wed Sep 24 20:15:48 2014 From: tuviahs at telestream.net (Tuviah Snyder) Date: Wed, 24 Sep 2014 18:15:48 +0000 Subject: [Libav-user] How do I drop corrupted video frames as a result of network issues In-Reply-To: <58BE6260-1460-4429-8276-4506091B1A74@bighillsoftware.com> References: <1480106813.555495.1411548165391.open-xchange@oxbaltgw16.schlund.de> <58BE6260-1460-4429-8276-4506091B1A74@bighillsoftware.com> Message-ID: <0B7C259F-0AE8-4838-B6B5-4DF92CBE693E@telestream.net> I tried AV_EXPLODE option to AVDecodeContext and its not catching all corrupt frames. Anyone on this list have any idea? Seems like this would be a common requirement. best Tuviah I have an RTSP server running on an iPhone broadcasting H264 over UDP in a local network and I'm using libavformat, libavcodec to demux it and decode on an application running on the desktop.. For the most part it works well with a second latency, but every minute or so I see a few packets are late, dropped, not received at all and therefore I get a corrupt frame with visible macro blocking. Is there any way to detect after decode if the decoder did not have enough information to decode a perfect frame? Don't want AVDecode to try to conceal it, just want to keep feeding in packets to decode, and know if any information was missing, which was required to decode that particular frame. Because our users would rather we never display a corrupt frame, since the iPhone source is just one of many being integrated into a live production (and corrupt frames would lower the overall production value). Instead they want our desktop app to keep displaying the last good frame, until the next good one comes along. Best Tuviah -------------- next part -------------- An HTML attachment was scrubbed... URL: From adrozdoff at gmail.com Fri Sep 26 02:23:30 2014 From: adrozdoff at gmail.com (Alexander Drozdov) Date: Fri, 26 Sep 2014 11:23:30 +1100 Subject: [Libav-user] RTMP Play file descriptor leak In-Reply-To: <20140911012933.45b6b1c2@debian> References: <20140910195428.4680553b@debian> <20140911012933.45b6b1c2@debian> Message-ID: 2014-09-11 10:29 GMT+11:00 wm4 : > On Thu, 11 Sep 2014 09:58:28 +1100 > Alexander Drozdov wrote: > > > Ughr... ffmpeg-devel: not for bug reports... It is evil that I can't > simple > > send patch/report via mail :-( > > This is just so that ffmpeg-devel is not flooded with user questions or > support requests. Sending a patch to ffmpeg-devel is always ok. > I prepare patch with git format-patch, but I can't send it to ffmpeg-devel, link https://lists.ffmpeg.org/mailman/listinfo/ffmpeg-devel/ unavail now. I can't subscribe. Patch is attached. -- WBR, Alexander Drozdov http://htrd.su -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 0001-RTMP-fix-FD-leak-in-rtmp_open.patch Type: text/x-patch Size: 975 bytes Desc: not available URL: From praks411 at gmail.com Fri Sep 26 13:54:59 2014 From: praks411 at gmail.com (Pradeep Karosiya) Date: Fri, 26 Sep 2014 04:54:59 -0700 (PDT) Subject: [Libav-user] Repeating frame while encoding using ffmpeg api Message-ID: <1411732499319-4660473.post@n4.nabble.com> Hi, I'm trying to create small screen capture application using ffmpeg encoding api. The application mostly working fine when I encode each frame as per specified frame rate. However I would like to do some changes in above approach. If there is no change on screen (frames are exactly same) then I don't want to encode the duplicate frames and want ffmpeg to keep the last displayed frame till something changes on screen. I'm doing following steps. 1. Check difference between previous and current frame, if difference == 0 then skip frame else add frame to encoder. 2. In add_frame_encoder I'm encoding the previous screen with previous time stamp and setting extra_delay between current time stamp and previous time stamp in repeat_pict field of the encode frame. frame->repeact_pict = 2*fps*extra_delay where extra_delay is the duration for ffmpeg to display the frame. However the above approach is not working fine. Even though video duration is correct. When I'm playing the video the frame rate is reduced and I don't see repeat_pict option is working. For example I'm encoding a video for 30 seconds at 10 fps containing many duplicate frames. The final number of frames matches the frame which are added for encoding but I don't see any frame repeated by ffmpeg and final fps is reduced to match the video duration. Please suggest what could be going wrong. Regards, Pradeep -- View this message in context: http://libav-users.943685.n4.nabble.com/Repeating-frame-while-encoding-using-ffmpeg-api-tp4660473.html Sent from the libav-users mailing list archive at Nabble.com. From brado at bighillsoftware.com Fri Sep 26 15:05:07 2014 From: brado at bighillsoftware.com (Bradley O'Hearne) Date: Fri, 26 Sep 2014 06:05:07 -0700 Subject: [Libav-user] Repeating frame while encoding using ffmpeg api In-Reply-To: <1411732499319-4660473.post@n4.nabble.com> References: <1411732499319-4660473.post@n4.nabble.com> Message-ID: > On Sep 26, 2014, at 4:54 AM, Pradeep Karosiya wrote: > > Hi, > > I'm trying to create small screen capture application using ffmpeg encoding > api. > The application mostly working fine when I encode each frame as per > specified frame rate. > However I would like to do some changes in above approach. If there is no > change on screen (frames are exactly same) then I don't want to encode the > duplicate frames and want ffmpeg to keep the last displayed frame till > something changes on screen. I'm doing following steps. > 1. Check difference between previous and current frame, if difference == 0 > then skip frame else add frame to encoder. > 2. In add_frame_encoder I'm encoding the previous screen with previous time > stamp and setting extra_delay between current time stamp and previous time > stamp in repeat_pict field of the encode frame. > frame->repeact_pict = 2*fps*extra_delay > where extra_delay is the duration for ffmpeg to display the frame. > > However the above approach is not working fine. Even though video duration > is correct. When I'm playing the video the frame rate is reduced and I don't > see repeat_pict option is working. > For example I'm encoding a video for 30 seconds at 10 fps containing many > duplicate frames. The final > number of frames matches the frame which are added for encoding but I don't > see any frame repeated by ffmpeg and final fps is reduced to match the video > duration. > Please suggest what could be going wrong. Pradeep ? I?m not the authority on this, I can only tell you about my personal experience. I am capturing live video and encoding it in real-time using FFmpeg. Over months of testing, the behavior I have seen is that whatever the time_base.den value is set on your codec, that number of frames per second absolutely has to be fed to the encoder, or else playback of the video will be out of sync. What this means is that if the capture mechanism produces frames at a different frame rate than the encoder is expecting, you have to either encode frames more than once if the capture frame rate drops below time_base.den (which in my case was constantly) or drop the frame if the capture frame rate exceeds time_base.den (which never happened). In my experience and testing over the course of months, changing pts, dts, and duration could not accommodate for this problem. As an example, no matter what the pts, dts, and duration were set at, feeding 15fps to an encoder with a time_base.den of 30 (30fps) produced a video that played back at twice the intended speed. Other folks posted to this list saying otherwise, but I have never seen a code example which could prove this, nor could I ever make it work in my own code, and neither could anyone else when I posted my code to this mailing list. I also received a number of offline responses to the list discussion from other developers who had arrived at the same conclusions from their own testing. So if there is a way to make it work, as far as I?m concerned it will remain legend until code emerges which demonstrates this can be done. Because of this fact, my conclusion ? which is my own, I mean no harm to anyone else by stating this ? is that FFmpeg?s design is particularly suited to non-realtime scenarios, where the whole of a video and its characteristics are known at the time of the creation of the codec and do not fluctuate during the encoding process. In other words, things are pretty straightforward if the video already exists, and is a known entity where you have control of the input to the encoder. But if the video is being captured in realtime, where a frame rate theoretically can fluctuate, or in my case commonly was received at half the time_base.den but with double duration (15fps vs. a time_base.den of 30fps), the only workable solution I found was to make the video look like it was static to the encoder ? i.e. encode the same frame multiple times or drop the frame, depending on which was needed to keep the frame rate constant to time_base.den. It makes for ugly code?but it is working code. No one will be more thrilled than I if working code ever does emerge proving that merely setting pts, dts, and duration (or some other parameter) on the frame will cause the encoder to be able to properly encode video received at a frame rate different from time_base.den. But until that time, this is the only guidance I can offer. I hope you get things worked out, and if in your efforts you find a way to feed an encoder frames at a different frame rate than indicated by time_base.den, please post it. Good luck, Brad From gedikmert89 at gmail.com Sun Sep 28 23:18:30 2014 From: gedikmert89 at gmail.com (Mert Gedik) Date: Mon, 29 Sep 2014 00:18:30 +0300 Subject: [Libav-user] VideoToolbox.framework in iOS8 Message-ID: Hello everyone, ffmpeg supports hardware decoding/encoding in macosx with VideoToolbox.framework, is there anyone that tried to compile and test this with iOS8 SDK ? Thanks, - MG -------------- next part -------------- An HTML attachment was scrubbed... URL: From cehoyos at ag.or.at Sun Sep 28 23:40:27 2014 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Sun, 28 Sep 2014 21:40:27 +0000 (UTC) Subject: [Libav-user] VideoToolbox.framework in iOS8 References: Message-ID: Mert Gedik writes: > ffmpeg supports hardware decoding/encoding in > macosx with VideoToolbox.framework Why do you think so? Carl Eugen From george at nsup.org Mon Sep 29 17:13:22 2014 From: george at nsup.org (Nicolas George) Date: Mon, 29 Sep 2014 17:13:22 +0200 Subject: [Libav-user] Repeating frame while encoding using ffmpeg api In-Reply-To: References: <1411732499319-4660473.post@n4.nabble.com> Message-ID: <20140929151322.GA23739@phare.normalesup.org> Le quintidi 5 vend?miaire, an CCXXIII, Bradley O'Hearne a ?crit?: > Over months of testing, the behavior I have seen is that whatever the > time_base.den value is set on your codec, that number of frames per second > absolutely has to be fed to the encoder, or else playback of the video > will be out of sync. That is not true, but a number of things can be wrong in your program and explain that it does not seem to work. First, you must make sure that all fields are properly set: the time base for both codec and stream and the various frame rate fields. Then, you must make sure that you actually set the timestamps and duration before encoding. Then you must make sure to convert the timestamps from codec time base to stream time base. The muxer is allowed to change the time base during write_header(), so the stream time base may not be what you requested. Then you must make sure that the format you are using supports variable frame rate, since that is what you are trying to achieve; AVI does not, for example. You must also make sure that the muxer implementation in FFmpeg supports it. For example, MOV/MP4 are supposed to support variable frame rate, but the muxer in lavf does not. At this point, you should be able to see valid pkt_pts using ffprobe -show_frames. Last, you must make sure that the application you are using to see the video uses the timestamps. But to answer the first question, which was about dropping frames when they are too similar to the previous one: Do not do that. Video encoding is all about finding what changed between one frame and the next and finding the most efficient way of coding it. If you Compare the frames and drop them when they are too similar, you are re-implementing part of the codec in the application, poorly and without optimizations. Just let the codec do its job. If a frame is very similar to the previous one, it will use very few bits to code it, but these bits will still be better used there than elsewhere. If you are stuck with a poor codec that does a bad job of it, and can not switch to a better codec, consider using the decimate filter, which is specifically designed for that task, with optimizations. Regards, -- Nicolas George -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: From brado at bighillsoftware.com Mon Sep 29 17:26:43 2014 From: brado at bighillsoftware.com (Bradley O'Hearne) Date: Mon, 29 Sep 2014 08:26:43 -0700 Subject: [Libav-user] Repeating frame while encoding using ffmpeg api In-Reply-To: <20140929151322.GA23739@phare.normalesup.org> References: <1411732499319-4660473.post@n4.nabble.com> <20140929151322.GA23739@phare.normalesup.org> Message-ID: <35959A30-9C76-4FD5-B041-0C663CA92840@bighillsoftware.com> On Sep 29, 2014, at 8:13 AM, Nicolas George wrote: > Le quintidi 5 vend?miaire, an CCXXIII, Bradley O'Hearne a ?crit : >> Over months of testing, the behavior I have seen is that whatever the >> time_base.den value is set on your codec, that number of frames per second >> absolutely has to be fed to the encoder, or else playback of the video >> will be out of sync. > > That is not true, but a number of things can be wrong in your program and > explain that it does not seem to work. As soon as an actual working code sample emerges which proves that you can feed varying FPS to the encoder, I?ll be thrilled to implement it in my own code. But I have never come across an example which demonstrates this, nor when I posted source to this list which demonstrated the problem, was any solution given. So until that time, I have to stick with code that works?.not the theory, which I?d highly prefer, but unfortunately I cannot seem to realize in an implementation. As this is relevant to Pradeep?s original question?Pradeep, if you are able to get this to work, if you can post a code sample to the mailing list, it would be much appreciated. Thanks, Brad From greg at kooji.com Mon Sep 29 13:53:38 2014 From: greg at kooji.com (Gregory King) Date: Mon, 29 Sep 2014 12:53:38 +0100 Subject: [Libav-user] Achieving lowest possible latency RTMP stream - Client configuration Message-ID: I have node-rtsp-rtmp-server (https://github.com/iizukanao/node-rtsp-rtmp-server) serving up an RTMP stream nicely and I can configure strobe media player to play with very little latency (fraction of a second) using something like this setup (https://gist.github.com/iizukanao/de7f3c1200c1513f159e) However, whenever I use ffmpeg I come across more buffering than I require for my application. I happen to be using kxmovie on ios as the client and I've recompiled ffmpeg with the default buffer for rtmp set to 0 from 3000, but this appears to make no difference (though my server is now acknowledging the buffer is being set to 0). So I'm really looking for some pointers as to what parameters I need to tweak in ffmpeg to achieve the similar low latency that strobe media player is achieving. Any hints? Thanks, G From bumblebritches57 at gmail.com Tue Sep 30 02:31:49 2014 From: bumblebritches57 at gmail.com (Marcus Johnson) Date: Mon, 29 Sep 2014 20:31:49 -0400 Subject: [Libav-user] (no subject) Message-ID: I'm trying to decode audio using libavformat and codec, it's working fine so far, but I'm having trouble getting the decoded buffer into a single array to hold all samples, I read that there's a function called avpicture_layout, and that's basically exactly what I need, except it's for AVPicture, and I need it for AVFrame, what do I do? I see nothing like that in the docs. -------------- next part -------------- An HTML attachment was scrubbed... URL: From hawkwithwind at gmail.com Tue Sep 30 09:54:47 2014 From: hawkwithwind at gmail.com (Peter Pan) Date: Tue, 30 Sep 2014 15:54:47 +0800 Subject: [Libav-user] how to convert NV21 to YUV420P with swscale Message-ID: Hello I'm trying to convert NV21 image to YUV420P, for x264 encoder to encode it. my code is: static int scale(char* lin, x264_picture_t* pic, int in_width, int in_height, int out_width, int out_height){ if(convertCtx == NULL){ convertCtx = sws_getContext(in_width, in_height, PIX_FMT_NV21, out_width, out_height, PIX_FMT_YUV420P, SWS_FAST_BILINEAR, NULL, NULL, NULL); } AVPicture src; avpicture_fill(&src, lin, PIX_FMT_NV21, in_width, in_height); int h = sws_scale(convertCtx, (const uint8_t **)(&lin), src.linesize, 0, in_height, (uint8_t * const*)(pic->img.plane), pic->img.i_stride); return h; } the images are recorded from android camera with such code: params = mCamera.getParameters(); params.setPreviewFormat(ImageFormat.NV21); mCamera.setParameters(params); And I will get the video buffer from onPreviewFrame callback. the code works well if the src image is PIX_FMT_YUYV422, with android camera set to params.setPreviewFormat(ImageFormat.YUY2); but when I try to convert NV21 images on some other devices, the image broke. the image looks like its purple and green part of the pixels are separated. please help me with this convert code. thank you. Thanks, Peter -------------- next part -------------- An HTML attachment was scrubbed... URL: From wl-chmw at gmx.de Tue Sep 30 11:06:44 2014 From: wl-chmw at gmx.de (Wolfgang Lorenz) Date: Tue, 30 Sep 2014 11:06:44 +0200 Subject: [Libav-user] Private streams in MPEG-TS Message-ID: <20140930110644.3ab9f84e@mike> Hello list readers, I'm trying to interleave some continuous private data into an MPEG-TS container alongside to some audio data. As far as I know, MPEG-TS supports private streams, but I can not get it, to work cleanly. I've attached a little working example to show, what I've got so far and what problems I've encountered. The example file works like this: * Muxing: * Open a format context for the MPEG-TS container. * Add a stream with codec-type AVMEDIA_TYPE_DATA. * Open file, write header. * Fill packets with 1024 bytes of random data (either only digits '0' to '9', or char (0 - 255), and write them to the container. * Write trailer, close file, free format context. * Demuxing: * Open format context and file. * Find and write out stream info. * Read packets and write out some info. * Free format context. Results, when running the example: * With digit-only data ('0' - '9'): * Stream's codec-type is AVMEDIA_TYPE_UNKNOWN * Packet sizes are correct 1024 bytes, as generated while muxing. * Using full bytes: * Stream's codec-type is AVMEDIA_TYPE_AUDIO * I guess FFMPEG tries to decode the not-audio data using either mp3 (FFMPEG 2.2.3) or aac (FFMPEG 2.4.1). * Packet sizes are not preserved. :-( I can work around these problems, by ignoring all warning and error messages, as well as the codec-types. I can just use a dedicated stream ID identify the data stream. I can put the size of each packet at the beginning of each packet, to demangle the package data. But I'd rather have a cleaner solution, where the codec-type is set correctly and FFMPEG does not try to decode my data. So... What have I done wrong? What is the correct way to achieve this? Thanks, Wolfgang -------------- next part -------------- A non-text attachment was scrubbed... Name: private_stream.c Type: text/x-c++src Size: 3670 bytes Desc: not available URL: From praks411 at gmail.com Tue Sep 30 15:45:33 2014 From: praks411 at gmail.com (Pradeep Karosiya) Date: Tue, 30 Sep 2014 06:45:33 -0700 (PDT) Subject: [Libav-user] Repeating frame while encoding using ffmpeg api In-Reply-To: <35959A30-9C76-4FD5-B041-0C663CA92840@bighillsoftware.com> References: <1411732499319-4660473.post@n4.nabble.com> <20140929151322.GA23739@phare.normalesup.org> <35959A30-9C76-4FD5-B041-0C663CA92840@bighillsoftware.com> Message-ID: <1412084733858-4660483.post@n4.nabble.com> Hi All, Thanks for the reply. So I think there is no straight forward to achieve variable fps, till now I've no success but I'll keep looking into it. However if someone has more information on variable fps and how to use repeat_pict field. Please share. Thanks and Regards, Pradeep -- View this message in context: http://libav-users.943685.n4.nabble.com/Repeating-frame-while-encoding-using-ffmpeg-api-tp4660473p4660483.html Sent from the libav-users mailing list archive at Nabble.com. From nfxjfg at googlemail.com Tue Sep 30 16:38:39 2014 From: nfxjfg at googlemail.com (wm4) Date: Tue, 30 Sep 2014 16:38:39 +0200 Subject: [Libav-user] (no subject) In-Reply-To: References: Message-ID: <20140930163839.29fdfc3f@debian> On Mon, 29 Sep 2014 20:31:49 -0400 Marcus Johnson wrote: > I'm trying to decode audio using libavformat and codec, it's working fine > so far, but I'm having trouble getting the decoded buffer into a single > array to hold all samples, I read that there's a function called > avpicture_layout, and that's basically exactly what I need, except it's for > AVPicture, and I need it for AVFrame, what do I do? I see nothing like that > in the docs. av_samples_fill_arrays() does the same thing. It doesn't take an AVFrame directly, so you still have to do something manually. I wonder why you need a single buffer, though...