From alexcohn at netvision.net.il Wed Aug 1 06:30:13 2012 From: alexcohn at netvision.net.il (Alex Cohn) Date: Wed, 1 Aug 2012 07:30:13 +0300 Subject: [Libav-user] [newbie] how to extract current timestamp of h264 avi file In-Reply-To: <1343547991.51052.YahooMailNeo@web29806.mail.ird.yahoo.com> References: <1343547991.51052.YahooMailNeo@web29806.mail.ird.yahoo.com> Message-ID: On 31 Jul 2012 21:34, "aa aaaa" wrote: > > Hello everyone, I am newbie to ffmpeg and I am trying to use it in project I am working on. > > I am using OpenCv but the standar functions give wrong results so I decided to try with ffmpeg. > > So I would like someone to help me out with the steps I need to do in order to get the timestamp of a frame in a h264 avi file. > > for example , I would appreciate advice on how to do it. > > Which libraries must I use, and which steps or procedure must I do. > > Steps I mean something lik > > 1.load the video > 2.parse video frame by frame > 3.use command to get the timestamp. > > > Any piece of code would be great to help me understand better. > > So thank everyone in advance for every info they can give me to solve my problem. Start with a classic tutorial http://dranger.com/ffmpeg/tutorial05.html, look for "frame pts". BR, Alex -------------- next part -------------- An HTML attachment was scrubbed... URL: From sendtofaraway at sina.com Wed Aug 1 11:03:16 2012 From: sendtofaraway at sina.com (sendtofaraway at sina.com) Date: Wed, 01 Aug 2012 17:03:16 +0800 Subject: [Libav-user] Can the HLS protocol adapt to the status of network? Message-ID: <20120801090316.448185B00FB@webmail.sinamail.sina.com.cn> Hello everyone . I am trying to do a mediaplayer using ffmpeg . And I noticed that the ffmpeg have imlement the apple live streaming . I'd want to know the ffmepg can adapt to the network status And choose different segments automatically. And which files in the ffmpeg is responsible for this function? Thanks ! Sincerely ! -------------- next part -------------- An HTML attachment was scrubbed... URL: From aviadr1 at gmail.com Wed Aug 1 17:27:36 2012 From: aviadr1 at gmail.com (aviad rozenhek) Date: Wed, 1 Aug 2012 18:27:36 +0300 Subject: [Libav-user] black frame from nothing Message-ID: here's a command line to create a TS file with black frames from nothing in ffmpeg ffmpeg -f lavfi -i color=black:320x240:25 out.ts how do I do the same with avconv? -- Aviad Rozenhek -------------- next part -------------- An HTML attachment was scrubbed... URL: From mbradshaw at sorensonmedia.com Wed Aug 1 18:26:06 2012 From: mbradshaw at sorensonmedia.com (Michael Bradshaw) Date: Wed, 1 Aug 2012 10:26:06 -0600 Subject: [Libav-user] black frame from nothing In-Reply-To: References: Message-ID: On Wed, Aug 1, 2012 at 9:27 AM, aviad rozenhek wrote: > here's a command line to create a TS file with black frames from nothing > in ffmpeg > ffmpeg -f lavfi -i color=black:320x240:25 out.ts > > how do I do the same with avconv? > Wrong mailing list? This is the FFmpeg mailing list. If you want to use libav, you should contact their mailing list. See http://libav.org/contact.html (looks like you want the libav-tools mailing list) --Michael -------------- next part -------------- An HTML attachment was scrubbed... URL: From sendtofaraway at sina.com Wed Aug 1 10:07:44 2012 From: sendtofaraway at sina.com (andro) Date: Wed, 1 Aug 2012 01:07:44 -0700 (PDT) Subject: [Libav-user] Can the HLS protocol adapt to the status of network? Message-ID: <1343808464415-4655505.post@n4.nabble.com> Hello everyone . I am trying to do a mediaplayer using ffmpeg . And I noticed that the ffmpeg have imlement the apple live streaming . I'd want to know the ffmepg can adapt to the network status And choose different segments automatically. And which files in the ffmpeg is responsible for this function? Thanks ! Sincerely -- View this message in context: http://libav-users.943685.n4.nabble.com/Libav-user-Can-the-HLS-protocol-adapt-to-the-status-of-network-tp4655505.html Sent from the libav-users mailing list archive at Nabble.com. From sendtofaraway at sina.com Wed Aug 1 09:35:23 2012 From: sendtofaraway at sina.com (andro) Date: Wed, 1 Aug 2012 00:35:23 -0700 (PDT) Subject: [Libav-user] Can m3u8 demuxer choose resource accrooding to the status of network? Message-ID: <1343806523051-4655504.post@n4.nabble.com> I am doing a live streaming player for android using ffmpeg recently . And I have noticed that ffmpeg has already implement a lot of protocols including applehttp . As I know . The applehttp server will prepare different quality of segment of a movie ,and hope the client to choose the better quality movie if the bandwidth is allowed .?I'd want to know if the ffmpeg have already implement it now ? or I have to do it my self ? -- View this message in context: http://libav-users.943685.n4.nabble.com/Can-m3u8-demuxer-choose-resource-accrooding-to-the-status-of-network-tp4655504.html Sent from the libav-users mailing list archive at Nabble.com. From aviadr1 at gmail.com Wed Aug 1 20:51:28 2012 From: aviadr1 at gmail.com (aviad rozenhek) Date: Wed, 1 Aug 2012 21:51:28 +0300 Subject: [Libav-user] where are my type 5 NALs? Message-ID: Hi, I encode h264 using the following cmdlne avconv.exe -i input.mp4 -bsf h264_mp4toannexb output.h264 but for some reason, only the first keyframe has NAL type 5 (Coded slice of an IDR picture ) all other frames are of type 7 (SPS), 8 (PPS), 6 (SEI) or 1 ( Coded slice of a non-IDR picture ) there are no additional type 5 NALs ... why am I not getting keyframes as type 5 NALs? [btw I'm doing the NAL analysis using http://sourceforge.net/projects/h264bitstream/ ] here's how the output from h264bitstream looks like: nal_unit_type : 7 ( Sequence parameter set ) nal_unit_type : 8 ( Picture parameter set ) nal_unit_type : 6 ( Supplemental enhancement information (SEI) ) nal_unit_type : 5 ( Coded slice of an IDR picture ) nal_unit_type : 1 ( Coded slice of a non-IDR picture ) nal_unit_type : 1 ( Coded slice of a non-IDR picture ) nal_unit_type : 1 ( Coded slice of a non-IDR picture ) nal_unit_type : 1 ( Coded slice of a non-IDR picture ) nal_unit_type : 1 ( Coded slice of a non-IDR picture ) nal_unit_type : 1 ( Coded slice of a non-IDR picture ) nal_unit_type : 1 ( Coded slice of a non-IDR picture ) nal_unit_type : 1 ( Coded slice of a non-IDR picture ) nal_unit_type : 1 ( Coded slice of a non-IDR picture ) nal_unit_type : 1 ( Coded slice of a non-IDR picture ) nal_unit_type : 1 ( Coded slice of a non-IDR picture ) nal_unit_type : 1 ( Coded slice of a non-IDR picture ) nal_unit_type : 1 ( Coded slice of a non-IDR picture ) nal_unit_type : 1 ( Coded slice of a non-IDR picture ) nal_unit_type : 1 ( Coded slice of a non-IDR picture ) nal_unit_type : 1 ( Coded slice of a non-IDR picture ) nal_unit_type : 1 ( Coded slice of a non-IDR picture ) nal_unit_type : 1 ( Coded slice of a non-IDR picture ) nal_unit_type : 1 ( Coded slice of a non-IDR picture ) nal_unit_type : 1 ( Coded slice of a non-IDR picture ) nal_unit_type : 1 ( Coded slice of a non-IDR picture ) nal_unit_type : 1 ( Coded slice of a non-IDR picture ) nal_unit_type : 1 ( Coded slice of a non-IDR picture ) nal_unit_type : 1 ( Coded slice of a non-IDR picture ) nal_unit_type : 1 ( Coded slice of a non-IDR picture ) nal_unit_type : 1 ( Coded slice of a non-IDR picture ) nal_unit_type : 1 ( Coded slice of a non-IDR picture ) nal_unit_type : 1 ( Coded slice of a non-IDR picture ) nal_unit_type : 1 ( Coded slice of a non-IDR picture ) nal_unit_type : 7 ( Sequence parameter set ) nal_unit_type : 8 ( Picture parameter set ) nal_unit_type : 6 ( Supplemental enhancement information (SEI) ) nal_unit_type : 1 ( Coded slice of a non-IDR picture ) nal_unit_type : 1 ( Coded slice of a non-IDR picture ) nal_unit_type : 1 ( Coded slice of a non-IDR picture ) nal_unit_type : 1 ( Coded slice of a non-IDR picture ) nal_unit_type : 1 ( Coded slice of a non-IDR picture ) nal_unit_type : 1 ( Coded slice of a non-IDR picture ) nal_unit_type : 1 ( Coded slice of a non-IDR picture ) nal_unit_type : 1 ( Coded slice of a non-IDR picture ) nal_unit_type : 1 ( Coded slice of a non-IDR picture ) nal_unit_type : 1 ( Coded slice of a non-IDR picture ) nal_unit_type : 1 ( Coded slice of a non-IDR picture ) nal_unit_type : 1 ( Coded slice of a non-IDR picture ) nal_unit_type : 1 ( Coded slice of a non-IDR picture ) nal_unit_type : 1 ( Coded slice of a non-IDR picture ) nal_unit_type : 1 ( Coded slice of a non-IDR picture ) nal_unit_type : 1 ( Coded slice of a non-IDR picture ) nal_unit_type : 1 ( Coded slice of a non-IDR picture ) nal_unit_type : 1 ( Coded slice of a non-IDR picture ) nal_unit_type : 1 ( Coded slice of a non-IDR picture ) nal_unit_type : 1 ( Coded slice of a non-IDR picture ) nal_unit_type : 1 ( Coded slice of a non-IDR picture ) nal_unit_type : 1 ( Coded slice of a non-IDR picture ) nal_unit_type : 1 ( Coded slice of a non-IDR picture ) nal_unit_type : 1 ( Coded slice of a non-IDR picture ) nal_unit_type : 1 ( Coded slice of a non-IDR picture ) nal_unit_type : 1 ( Coded slice of a non-IDR picture ) nal_unit_type : 1 ( Coded slice of a non-IDR picture ) nal_unit_type : 1 ( Coded slice of a non-IDR picture ) nal_unit_type : 1 ( Coded slice of a non-IDR picture ) nal_unit_type : 7 ( Sequence parameter set ) nal_unit_type : 8 ( Picture parameter set ) nal_unit_type : 6 ( Supplemental enhancement information (SEI) ) nal_unit_type : 1 ( Coded slice of a non-IDR picture ) nal_unit_type : 1 ( Coded slice of a non-IDR picture ) nal_unit_type : 1 ( Coded slice of a non-IDR picture ) ... and here's the output from the avconv run $> avconv.exe -i flashback.mp4 -bsf h264_mp4toannexb flashback2.h264 avconv version v0.8-2274-g82f82cc, Copyright (c) 2000-2012 the Libav developers built on Jul 9 2012 17:45:40 with gcc 4.5.2 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'flashback.mp4': Metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2avc1mp41 encoder : Lavf54.6.0 Duration: 00:02:15.25, start: 0.000000, bitrate: 1119 kb/s Chapter #0.0: start 0.054667, end 135.253333 Metadata: title : Stream #0.0(und): Video: h264 (High), yuv420p, 848x480, 1019 kb/s, 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc Stream #0.1(und): Audio: aac, 48000 Hz, stereo, s16, 93 kb/s File 'flashback2.h264' already exists. Overwrite ? [y/N] y [libx264 @ 03c43c40] MB rate (143100000) > level limit (2073600) [libx264 @ 03c43c40] using cpu capabilities: MMX2 SSE2Fast SSSE3 FastShuffle SSE4.2 AVX [libx264 @ 03c43c40] profile High, level 5.2 Output #0, h264, to 'flashback2.h264': Metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2avc1mp41 encoder : Lavf54.6.0 Chapter #0.0: start 0.054667, end 135.253333 Metadata: title : Stream #0.0(und): Video: libx264, yuv420p, 848x480, q=-1--1, 90k tbn, 90k tbc Stream mapping: Stream #0:0 -> #0:0 (h264 -> libx264) Press ctrl-c to stop encoding frame= 4051 fps=118 q=2685815.0 Lsize= 11260kB time=135.07 bitrate= 682.9kbits/s video:11247kB audio:0kB global headers:0kB muxing overhead 0.119182% [libx264 @ 03c43c40] frame I:97 Avg QP:19.85 size: 10246 [libx264 @ 03c43c40] frame P:1753 Avg QP:22.69 size: 4649 [libx264 @ 03c43c40] frame B:2201 Avg QP:26.08 size: 1084 [libx264 @ 03c43c40] consecutive B-frames: 20.6% 18.6% 6.7% 54.1% [libx264 @ 03c43c40] mb I I16..4: 32.0% 62.6% 5.4% [libx264 @ 03c43c40] mb P I16..4: 10.8% 14.1% 0.5% P16..4: 34.4% 7.2% 2.6% 0.0% 0.0% skip:30.5% [libx264 @ 03c43c40] mb B I16..4: 0.9% 0.6% 0.0% B16..8: 26.7% 1.5% 0.2% direct: 1.4% skip:68.7% L0:40.5% L1:56.2% BI: 3.3% [libx264 @ 03c43c40] 8x8 transform intra:55.6% inter:86.4% [libx264 @ 03c43c40] coded y,uvDC,uvAC intra: 29.0% 42.4% 10.6% inter: 7.8% 14.3% 0.3% [libx264 @ 03c43c40] i16 v,h,dc,p: 44% 35% 6% 15% [libx264 @ 03c43c40] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 25% 20% 25% 3% 5% 7% 5% 5% 4% [libx264 @ 03c43c40] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 37% 15% 11% 4% 8% 10% 6% 6% 3% [libx264 @ 03c43c40] i8c dc,h,v,p: 59% 15% 20% 5% [libx264 @ 03c43c40] Weighted P-Frames: Y:26.4% UV:22.8% [libx264 @ 03c43c40] ref P L0: 69.3% 10.8% 14.9% 4.9% 0.2% [libx264 @ 03c43c40] ref B L0: 88.6% 9.5% 1.9% [libx264 @ 03c43c40] ref B L1: 97.2% 2.8% [libx264 @ 03c43c40] kb/s:682.44 -- Aviad Rozenhek -------------- next part -------------- An HTML attachment was scrubbed... URL: From cehoyos at ag.or.at Wed Aug 1 21:22:00 2012 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Wed, 1 Aug 2012 19:22:00 +0000 (UTC) Subject: [Libav-user] where are my type 5 NALs? References: Message-ID: aviad rozenhek writes: > $> avconv.exe -i flashback.mp4 -bsf h264_mp4toannexb ?flashback2.h264 > avconv version v0.8-2274-g82f82cc This is an intentionally broken version of ffmpeg with several hundred known regressions, some of them may be security relevant, we therefore cannot support it. Please test current git head, see http://ffmpeg.org/download.html Carl Eugen From cehoyos at ag.or.at Wed Aug 1 21:38:44 2012 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Wed, 1 Aug 2012 19:38:44 +0000 (UTC) Subject: [Libav-user] black frame from nothing References: Message-ID: Michael Bradshaw writes: > On Wed, Aug 1, 2012 at 9:27 AM, aviad rozenhek wrote: > > > here's a command line to create a TS file with black > > frames from nothing in ffmpeg > > ffmpeg -f lavfi -i color=black:320x240:25 out.ts? > > how do I do the same with avconv? > > Wrong mailing list? This is the FFmpeg mailing list. > If you want to use libav, you should contact their mailing list. > See?http://libav.org/contact.html?(looks like you want > the libav-tools mailing list) Allow me to add that if you have any problems with FFmpeg please tell us either on this mailing list or on trac, don't forget we like good bugreports, see http://ffmpeg.org/bugreports.html Carl Eugen From yoganandu at gmail.com Thu Aug 2 12:14:34 2012 From: yoganandu at gmail.com (NANDU) Date: Thu, 2 Aug 2012 15:44:34 +0530 Subject: [Libav-user] Need Help Message-ID: Hi All I am new to this forum and to FFMPEG, image encoding as well. I am using this library in android application. My requirement is that I have to create a TIFF image with specific DPI from the raw data received from camera. What are the FFMPEG interfaces need to be called to achieve this. Thanks -- Nandu (Yoganandu Pottam) +919740365200 From gilles at solidanim.com Thu Aug 2 14:49:50 2012 From: gilles at solidanim.com (gilles pouliquen) Date: Thu, 02 Aug 2012 14:49:50 +0200 Subject: [Libav-user] generating timecode in a quicktime movie Message-ID: <501A776E.7080008@solidanim.com> Hello, I'm trying to generate a movie and I'd like to include timecodes information to my video stream. I know that quicktime has support for a timecode track so I am using the mov encoder in ffmpeg hoping i could add my own timecode track. So I have two questions: is that the right way to go about it, and more importantly is there a sample/tutorial on how to add a timecode track to a stream. Cheers. Gilles Pouliquen From lulebo at gmail.com Thu Aug 2 16:02:53 2012 From: lulebo at gmail.com (Carl Lindqvist) Date: Thu, 2 Aug 2012 16:02:53 +0200 Subject: [Libav-user] generating timecode in a quicktime movie In-Reply-To: <501A776E.7080008@solidanim.com> References: <501A776E.7080008@solidanim.com> Message-ID: My research on this subject says you probably need the ffmbc fork for this. I have tried it, but never managed to get timecode in my files :( Documentation was pretty much non existant if I remember correctly. Maybe this has changed now. Let me know how it goes! Regards Carl -------------- next part -------------- An HTML attachment was scrubbed... URL: From gilles at solidanim.com Thu Aug 2 17:33:41 2012 From: gilles at solidanim.com (gilles pouliquen) Date: Thu, 02 Aug 2012 17:33:41 +0200 Subject: [Libav-user] generating timecode in a quicktime movie In-Reply-To: References: <501A776E.7080008@solidanim.com> Message-ID: <501A9DD5.1000905@solidanim.com> Le 02/08/2012 16:02, Carl Lindqvist a ?crit : > My research on this subject says you probably need the ffmbc fork for > this. I have tried it, but never managed to get timecode in my files > :( Documentation was pretty much non existant if I remember correctly. > Maybe this has changed now. > > Let me know how it goes! > > Regards > Carl > > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user So actually I found it's not too hard to add an initial timecode to the mov file: av_dict_set( &st->metadata, "timecode", "hh:mm:ss:ff", 0 ); where "hh:mm:ss:ff" is the initial timecode. When you open the mov in quicktime and display the timecode you get the correct value. But yeah I would definitly love to see the ffmbc anyway fork but I can't find the source code :( ... Gilles -------------- next part -------------- An HTML attachment was scrubbed... URL: From mbradshaw at sorensonmedia.com Thu Aug 2 18:19:14 2012 From: mbradshaw at sorensonmedia.com (Michael Bradshaw) Date: Thu, 2 Aug 2012 10:19:14 -0600 Subject: [Libav-user] generating timecode in a quicktime movie In-Reply-To: <501A9DD5.1000905@solidanim.com> References: <501A776E.7080008@solidanim.com> <501A9DD5.1000905@solidanim.com> Message-ID: On Thu, Aug 2, 2012 at 9:33 AM, gilles pouliquen wrote: > > But yeah I would definitly love to see the ffmbc anyway fork but I can't > find the source code :( ... > You mean you can't find the FFmbc source? http://code.google.com/p/ffmbc/ --Michael -------------- next part -------------- An HTML attachment was scrubbed... URL: From rogerdpack2 at gmail.com Thu Aug 2 20:10:38 2012 From: rogerdpack2 at gmail.com (Roger Pack) Date: Thu, 2 Aug 2012 12:10:38 -0600 Subject: [Libav-user] Why does av_seek_frame() not seek to a keyframe? In-Reply-To: References: Message-ID: > Could you provide a sample that does not seek to a keyframe with > ffmpeg -ss x -i input out.png > (I tested this yesterday on random mpeg2video samples and afaict, > it did work.) With me, I get this: with this file: http://rogerdpack.t28.net/incoming/sintel.mpg $ ffmpeg -i sintel.mpg -vcodec copy -acodec copy -ss 90.0 starting_at_90.mpg then try and use it again: $ ffmpeg -i starting_at_90.mpg -vframes 1 -f image2 -an snap.jpg I get this warning message: [mpeg2video @ 01f09860] warning: first frame is no keyframe Anybody know if this is expected? I almost don't think it is... -r From rogerdpack2 at gmail.com Thu Aug 2 20:19:29 2012 From: rogerdpack2 at gmail.com (Roger Pack) Date: Thu, 2 Aug 2012 12:19:29 -0600 Subject: [Libav-user] Why does av_seek_frame() not seek to a keyframe? In-Reply-To: References: Message-ID: > $ ffmpeg -i sintel.mpg -vcodec copy -acodec copy -ss 90.0 starting_at_90.mpg > > then try and use it again: > > $ ffmpeg -i starting_at_90.mpg -vframes 1 -f image2 -an snap.jpg > > I get this warning message: > [mpeg2video @ 01f09860] warning: first frame is no keyframe > > Anybody know if this is expected? I almost don't think it is... My only conjecture is that, today, running "ffmpeg -ss 90.0 -vcodec copy" actually goes exactly to second 90.0, then inserts some "a few non i-frames" and then an i-frame, and continues normally. Then when I use that file, it skips past the non-i-frames until it reaches its first i-frame, and then continues on. Except I get this warning message no matter what "-ss" time I specify for my original cut (since this is from a DVD, I'd expect an i-frame at least every second, but can never find *even a single one*), which leaves me wondering what is actually occurring... Thanks! -roger- From mbradshaw at sorensonmedia.com Thu Aug 2 20:30:06 2012 From: mbradshaw at sorensonmedia.com (Michael Bradshaw) Date: Thu, 2 Aug 2012 12:30:06 -0600 Subject: [Libav-user] Why does av_seek_frame() not seek to a keyframe? In-Reply-To: References: Message-ID: On Thu, Aug 2, 2012 at 12:10 PM, Roger Pack wrote: > > Could you provide a sample that does not seek to a keyframe with > > ffmpeg -ss x -i input out.png > > (I tested this yesterday on random mpeg2video samples and afaict, > > it did work.) > > With me, I get this: > > with this file: http://rogerdpack.t28.net/incoming/sintel.mpg > > $ ffmpeg -i sintel.mpg -vcodec copy -acodec copy -ss 90.0 > starting_at_90.mpg > > then try and use it again: > > $ ffmpeg -i starting_at_90.mpg -vframes 1 -f image2 -an snap.jpg > > I get this warning message: > [mpeg2video @ 01f09860] warning: first frame is no keyframe > > Anybody know if this is expected? I almost don't think it is... I could be wrong on my understanding, so someone please correct me if I am... I believe that does no seeking there. Putting -ss after the input will cause ffmpeg to demux up to the requested timestamp, so it's not quite related to seeking (putting -ss before the input will seek the input file). Since -a/vcoded copy avoids re-encoding, it just copies the packets (without regard to keyframes, iiuc). The packet closest to 90 seconds probably isn't a keyframe, but since that's where you requested the start it ffmpeg starts copying packets from there anyway. Maybe there should be the ability to set a start time and copy packets, starting with the closest keyframe packet to the requested time... --Michael -------------- next part -------------- An HTML attachment was scrubbed... URL: From rogerdpack2 at gmail.com Thu Aug 2 20:48:51 2012 From: rogerdpack2 at gmail.com (Roger Pack) Date: Thu, 2 Aug 2012 12:48:51 -0600 Subject: [Libav-user] Why does av_seek_frame() not seek to a keyframe? In-Reply-To: References: Message-ID: > I believe that does no seeking there. Putting -ss after the input will cause > ffmpeg to demux up to the requested timestamp, so it's not quite related to > seeking (putting -ss before the input will seek the input file). > > Since -a/vcoded copy avoids re-encoding, it just copies the packets (without > regard to keyframes, iiuc). The packet closest to 90 seconds probably isn't > a keyframe, but since that's where you requested the start it ffmpeg starts > copying packets from there anyway. Yes I would totally agree with you, except I can't find a single "-ss" time that seems to "accidentally hit an i-frame" and work the way you and I would expect it to...though I haven't looked into it much... -r From brado at bighillsoftware.com Thu Aug 2 22:06:20 2012 From: brado at bighillsoftware.com (Brad O'Hearne) Date: Thu, 2 Aug 2012 13:06:20 -0700 Subject: [Libav-user] Translating working command line to programmatic code Message-ID: <9859F27C-40E1-41A2-B32A-5DF2E1ADD0BE@bighillsoftware.com> Hello, I could use a little guidance from the ffmpeg gurus on the list here. The short summary of my request is that I have a working ffmpeg command line which proves my use case, and now I need to convert that to programmatic code and integrate it into a app. Details: *** My use case: On a Mac, I need to capture video from an attached camera (such as the internal MacBook Pro camera), transcode it to FLV, and then stream (publish) it to Wowza media server for restreaming. *** What I have done so far: I have successfully used the ffmpeg client to take an mp4 video, transcode it to FLV, and publish it to Wowza using RTMP, using the following command line: ffmpeg -i ~/SampleVideo.mp4 -re -r 24 -b:v 1000k -f flv rtmp://localhost/live/SAMPLE_STREAM I have also consumed the video from a web browser successfully, so I know that this is both possible in ffmpeg and works. Basically the above serves as a successful prototype for my use-case. *** What I need to do now: I need know how to do two things specifically: 1) Convert the above command line to programmatic code which uses the underlying ffmpeg libraries to accomplish the same thing. Can anyone point me in the right direction of which libraries to use, and or direct me to a snippet of sample code which demonstrates how to do this? 2) Whatever the approach in 1 above, I need to convert from taking a video file as input, and instead taking captured frame data as input. Any help with these two things would be greatly appreciated. Cheers, Brad Brad O'Hearne Founder / Lead Developer Big Hill Software LLC http://www.bighillsoftware.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From krueger at lesspain.de Fri Aug 3 08:10:40 2012 From: krueger at lesspain.de (=?UTF-8?Q?Robert_Kr=C3=BCger?=) Date: Fri, 3 Aug 2012 08:10:40 +0200 Subject: [Libav-user] Translating working command line to programmatic code In-Reply-To: <9859F27C-40E1-41A2-B32A-5DF2E1ADD0BE@bighillsoftware.com> References: <9859F27C-40E1-41A2-B32A-5DF2E1ADD0BE@bighillsoftware.com> Message-ID: Hi, On Thu, Aug 2, 2012 at 10:06 PM, Brad O'Hearne wrote: > Hello, > > I could use a little guidance from the ffmpeg gurus on the list here. The > short summary of my request is that I have a working ffmpeg command line > which proves my use case, and now I need to convert that to programmatic > code and integrate it into a app. Details: > > *** My use case: > On a Mac, I need to capture video from an attached camera (such as the > internal MacBook Pro camera), transcode it to FLV, and then stream (publish) > it to Wowza media server for restreaming. > > *** What I have done so far: > I have successfully used the ffmpeg client to take an mp4 video, transcode > it to FLV, and publish it to Wowza using RTMP, using the following command > line: > > ffmpeg -i ~/SampleVideo.mp4 -re -r 24 -b:v 1000k -f flv > rtmp://localhost/live/SAMPLE_STREAM > > I have also consumed the video from a web browser successfully, so I know > that this is both possible in ffmpeg and works. Basically the above serves > as a successful prototype for my use-case. > > *** What I need to do now: > I need know how to do two things specifically: > > 1) Convert the above command line to programmatic code which uses the > underlying ffmpeg libraries to accomplish the same thing. Can anyone point > me in the right direction of which libraries to use, and or direct me to a > snippet of sample code which demonstrates how to do this? > > 2) Whatever the approach in 1 above, I need to convert from taking a video > file as input, and instead taking captured frame data as input. > > Any help with these two things would be greatly appreciated. > > Cheers, > > Brad > > Brad O'Hearne > Founder / Lead Developer > Big Hill Software LLC > http://www.bighillsoftware.com > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > start with the examples in doc/examples and then go through the source code of ffmpeg.c to see what happens for your specific command line. Either use a debugger to see what values are set for codec contexts or format context in your case or put your own debug output there. HTH, Robert From gilles at solidanim.com Fri Aug 3 10:13:18 2012 From: gilles at solidanim.com (gilles pouliquen) Date: Fri, 03 Aug 2012 10:13:18 +0200 Subject: [Libav-user] generating timecode in a quicktime movie In-Reply-To: References: <501A776E.7080008@solidanim.com> <501A9DD5.1000905@solidanim.com> Message-ID: <501B881E.8040605@solidanim.com> Le 02/08/2012 18:19, Michael Bradshaw a ?crit : > On Thu, Aug 2, 2012 at 9:33 AM, gilles pouliquen > wrote: > > But yeah I would definitly love to see the ffmbc anyway fork but I > can't find the source code :( ... > > > You mean you can't find the FFmbc source? http://code.google.com/p/ffmbc/ > > --Michael > > > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user oh, I'm really bad, thanks for the link. So I looked at the code and it seems ffmbc is mainly a wrapper around ffmpeg, or am i missing something? Gilles -------------- next part -------------- An HTML attachment was scrubbed... URL: From christian.bruemmer at gmx.de Sat Aug 4 14:11:26 2012 From: christian.bruemmer at gmx.de (=?ISO-8859-15?Q?Christian_Br=FCmmer?=) Date: Sat, 04 Aug 2012 14:11:26 +0200 Subject: [Libav-user] Speedup FFmpeg h264 Decoding on Android-Devices Message-ID: <501D116E.1080901@gmx.de> Hi, i am using FFmpeg for H264 Decoding on an Android Device. The Videoframes are encoded on a desktop pc and streamed frame-by-frame to the phone. For my tests i used Samsung Galaxy S2 (2x 1,2 ghz) but the decoding time is between 27 - 31 ms for one Frame with the resolution of 800 x 480 (nativ display res of the s2). I already compiled FFmpeg with Neon Support. My x264-Encoding Options are: av_opt_set(mCodec->priv_data, "profile", "baseline", 0); av_opt_set(mCodec->priv_data, "preset", "medium", 0); av_opt_set(mCodec->priv_data, "tune", "zerolatency", 0); av_opt_set(mCodec->priv_data, "x264opts", "rc-lookahead=0", 0); I used zerolatency because i need a very low latency (and need to encode parallel more than one videostream - which is working so far) between video encoding and setting the decoded videoframe to screen (on the smartphone display). Which settings could help to speedup h264 decoding (without reducing display resolution). For example I would like to combine zerolatency and the fast-decode tune but i dont know how to do this! Best regards, Christian From mbradshaw at sorensonmedia.com Sat Aug 4 16:05:52 2012 From: mbradshaw at sorensonmedia.com (Michael Bradshaw) Date: Sat, 4 Aug 2012 08:05:52 -0600 Subject: [Libav-user] Speedup FFmpeg h264 Decoding on Android-Devices In-Reply-To: <501D116E.1080901@gmx.de> References: <501D116E.1080901@gmx.de> Message-ID: On Aug 4, 2012 6:11 AM, "Christian Br?mmer" wrote: > > Hi, > > i am using FFmpeg for H264 Decoding on an Android Device. Out of curiosity, is there a reason you aren't using Android's native decoder? It may be more optimized for the device than FFmpeg too. Sorry I don't know how to make FFmpeg faster. --Michael -------------- next part -------------- An HTML attachment was scrubbed... URL: From christian.bruemmer at gmx.de Sat Aug 4 16:22:24 2012 From: christian.bruemmer at gmx.de (=?ISO-8859-1?Q?Christian_Br=FCmmer?=) Date: Sat, 04 Aug 2012 16:22:24 +0200 Subject: [Libav-user] Speedup FFmpeg h264 Decoding on Android-Devices In-Reply-To: References: <501D116E.1080901@gmx.de> Message-ID: <501D3020.4060903@gmx.de> For sure i first tried to use the Android MediaPlayer in combination with a RTSP-Stream but it has a - not configurable - frame buffer which size dependends of the rtsp fps. The result is a delay about 3-5 seconds which is a known problem as i discovered. so for a real time video application your on your own.. But anyway i thought there might be a few lever (on the encoding system) which i have to move to increase the decoding performance! What about the fast-decoding tune - how can i combine that with my zero latency configuration? Am 04.08.2012 16:05, schrieb Michael Bradshaw: > > On Aug 4, 2012 6:11 AM, "Christian Br?mmer" > wrote: > > > > Hi, > > > > i am using FFmpeg for H264 Decoding on an Android Device. > > Out of curiosity, is there a reason you aren't using Android's native > decoder? It may be more optimized for the device than FFmpeg too. > Sorry I don't know how to make FFmpeg faster. > > --Michael > > > > _______________________________________________ > 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 h.leppkes at gmail.com Sat Aug 4 16:55:12 2012 From: h.leppkes at gmail.com (Hendrik Leppkes) Date: Sat, 4 Aug 2012 16:55:12 +0200 Subject: [Libav-user] Speedup FFmpeg h264 Decoding on Android-Devices In-Reply-To: <501D3020.4060903@gmx.de> References: <501D116E.1080901@gmx.de> <501D3020.4060903@gmx.de> Message-ID: On Sat, Aug 4, 2012 at 4:22 PM, Christian Br?mmer wrote: > > What about the fast-decoding tune - how can i combine that with my zero > latency configuration? > > You should be able to provide a comma separated list for the tune parameter, try "zerolatency,fastdecode" -------------- next part -------------- An HTML attachment was scrubbed... URL: From alexcohn at netvision.net.il Sat Aug 4 17:52:53 2012 From: alexcohn at netvision.net.il (Alex Cohn) Date: Sat, 4 Aug 2012 18:52:53 +0300 Subject: [Libav-user] Speedup FFmpeg h264 Decoding on Android-Devices In-Reply-To: <501D3020.4060903@gmx.de> References: <501D116E.1080901@gmx.de> <501D3020.4060903@gmx.de> Message-ID: On Aug 4, 2012 5:22 PM, "Christian Br?mmer" wrote: > > For sure i first tried to use the Android MediaPlayer in combination with a RTSP-Stream but it has a - not configurable - frame buffer which size dependends of the rtsp fps. The result is a delay about 3-5 seconds which is a known problem as i discovered. > so for a real time video application your on your own.. You could directly call the built-in stagefreight avc decoder, this approach does not introduce extra latency. But the number of instances is limited - three or four, not more. BR, Alex Cohn > But anyway i thought there might be a few lever (on the encoding system) which i have to move to increase the decoding performance! > > What about the fast-decoding tune - how can i combine that with my zero latency configuration? > > Am 04.08.2012 16:05, schrieb Michael Bradshaw: >> >> On Aug 4, 2012 6:11 AM, "Christian Br?mmer" wrote: >> > >> > Hi, >> > >> > i am using FFmpeg for H264 Decoding on an Android Device. >> >> Out of curiosity, is there a reason you aren't using Android's native decoder? It may be more optimized for the device than FFmpeg too. Sorry I don't know how to make FFmpeg faster. >> >> --Michael >> >> >> >> _______________________________________________ >> Libav-user mailing list >> Libav-user at ffmpeg.org >> http://ffmpeg.org/mailman/listinfo/libav-user > > > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > -------------- next part -------------- An HTML attachment was scrubbed... URL: From christian.bruemmer at gmx.de Sat Aug 4 20:20:49 2012 From: christian.bruemmer at gmx.de (=?ISO-8859-1?Q?Christian_Br=FCmmer?=) Date: Sat, 04 Aug 2012 20:20:49 +0200 Subject: [Libav-user] Speedup FFmpeg h264 Decoding on Android-Devices In-Reply-To: References: <501D116E.1080901@gmx.de> <501D3020.4060903@gmx.de> Message-ID: <501D6801.20006@gmx.de> Okay i will consider that if i am not able to speedup ffmpeg decoding. First I will post my results after using the x264opts Hendrik provides ( "zerolatency,fastdecode" ). Am 04.08.2012 17:52, schrieb Alex Cohn: > > On Aug 4, 2012 5:22 PM, "Christian Br?mmer" > wrote: > > > > For sure i first tried to use the Android MediaPlayer in combination > with a RTSP-Stream but it has a - not configurable - frame buffer > which size dependends of the rtsp fps. The result is a delay about 3-5 > seconds which is a known problem as i discovered. > > so for a real time video application your on your own.. > > You could directly call the built-in stagefreight avc decoder, this > approach does not introduce extra latency. But the number of instances > is limited - three or four, not more. > > BR, > Alex Cohn > > > But anyway i thought there might be a few lever (on the encoding > system) which i have to move to increase the decoding performance! > > > > What about the fast-decoding tune - how can i combine that with my > zero latency configuration? > > > > Am 04.08.2012 16:05, schrieb Michael Bradshaw: > >> > >> On Aug 4, 2012 6:11 AM, "Christian Br?mmer" > > wrote: > >> > > >> > Hi, > >> > > >> > i am using FFmpeg for H264 Decoding on an Android Device. > >> > >> Out of curiosity, is there a reason you aren't using Android's > native decoder? It may be more optimized for the device than FFmpeg > too. Sorry I don't know how to make FFmpeg faster. > >> > >> --Michael > >> > >> > >> > >> _______________________________________________ > >> Libav-user mailing list > >> Libav-user at ffmpeg.org > >> http://ffmpeg.org/mailman/listinfo/libav-user > > > > > > > > _______________________________________________ > > Libav-user mailing list > > Libav-user at ffmpeg.org > > http://ffmpeg.org/mailman/listinfo/libav-user > > > > > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user -------------- next part -------------- An HTML attachment was scrubbed... URL: From jettoblack at gmail.com Sun Aug 5 06:40:06 2012 From: jettoblack at gmail.com (jettoblack) Date: Sat, 4 Aug 2012 21:40:06 -0700 (PDT) Subject: [Libav-user] Setting libx264 bitrate via API In-Reply-To: <1343077959076-4655479.post@n4.nabble.com> References: <1342823147934-4655453.post@n4.nabble.com> <0BD925121A830C4DACF7FF9213266ACAB3A981CCB4@CHN-HCLT-EVS09.HCLT.CORP.HCL.IN> <1343077959076-4655479.post@n4.nabble.com> Message-ID: <1344141606088-4655531.post@n4.nabble.com> After digging through ffmpeg.c, I finally figured it out. My code was sending pictures into the encoder using a pts in the stream's time_base of 1/90000 (e.g. 3003, 6006, 9009). The solution was to first rescale the AVFrame's pts from the stream's time_base to the codec time_base to get a simple frame number (e.g. 1, 2, 3). pic->pts = av_rescale_q(pic->pts, ost->time_base, enc->time_base); avcodec_encode_video2(enc, &newpkt, pic, &got_packet_ptr); Then when a packet is received from the encoder, you need to rescale pts and dts back to the stream time_base. newpkt.pts = av_rescale_q(newpkt.pts, enc->time_base, ost->time_base); newpkt.dts = av_rescale_q(newpkt.dts, enc->time_base, ost->time_base); av_interleaved_write_frame(out, &newpkt); I guess not every codec requires this to be done, but libx264 does if you want to encode CBR/ABR. -- View this message in context: http://libav-users.943685.n4.nabble.com/Setting-libx264-bitrate-via-API-tp4655453p4655531.html Sent from the libav-users mailing list archive at Nabble.com. From donmoir at comcast.net Sun Aug 5 12:36:23 2012 From: donmoir at comcast.net (Don Moir) Date: Sun, 5 Aug 2012 06:36:23 -0400 Subject: [Libav-user] Why does av_seek_frame() not seek to a keyframe? References: Message-ID: ----- Original Message ----- From: "Roger Pack" To: "This list is about using libavcodec, libavformat, libavutil,libavdevice and libavfilter." Sent: Thursday, August 02, 2012 2:48 PM Subject: Re: [Libav-user] Why does av_seek_frame() not seek to a keyframe? >> I believe that does no seeking there. Putting -ss after the input will >> cause >> ffmpeg to demux up to the requested timestamp, so it's not quite related >> to >> seeking (putting -ss before the input will seek the input file). >> >> Since -a/vcoded copy avoids re-encoding, it just copies the packets >> (without >> regard to keyframes, iiuc). The packet closest to 90 seconds probably >> isn't >> a keyframe, but since that's where you requested the start it ffmpeg >> starts >> copying packets from there anyway. > > Yes I would totally agree with you, except I can't find a single "-ss" > time that seems to "accidentally hit an i-frame" and work the way you > and I would expect it to...though I haven't looked into it much... > -r Given that seeking on mpeg2video does not seek to a key frame unless you get lucky. I did a couple of test and normally for mpeg2video the first frame read after a seek is not a key frame which causes a delay in the animiation. Then I seeked to known keyframe times and that seems to successfully seek to a key frame. I did this a couple times. For testing, I got the known keyframe times by looking at the data after a seek. So when seeking backward you should always be at a keyframe at or before your requested time but in the case of mpeg2video it does not happen. o - Is there an intent to get this reported as a bug if not already ? o - If it is reported as a bug, whats the likelyhood it will be fixed ? I think I saw somewhere that it has been known for sometime or something to that effect. From donmoir at comcast.net Sun Aug 5 13:51:00 2012 From: donmoir at comcast.net (Don Moir) Date: Sun, 5 Aug 2012 07:51:00 -0400 Subject: [Libav-user] Why does av_seek_frame() not seek to a keyframe? References: Message-ID: <386E874DF5244247AB24C8E39BBC2811@MANLAP> ----- Original Message ----- From: "Don Moir" To: "This list is about using libavcodec, libavformat, libavutil,libavdevice and libavfilter." Sent: Sunday, August 05, 2012 6:36 AM Subject: Re: [Libav-user] Why does av_seek_frame() not seek to a keyframe? > ----- Original Message ----- > From: "Roger Pack" > To: "This list is about using libavcodec, libavformat, > libavutil,libavdevice and libavfilter." > Sent: Thursday, August 02, 2012 2:48 PM > Subject: Re: [Libav-user] Why does av_seek_frame() not seek to a keyframe? > > >>> I believe that does no seeking there. Putting -ss after the input will >>> cause >>> ffmpeg to demux up to the requested timestamp, so it's not quite related >>> to >>> seeking (putting -ss before the input will seek the input file). >>> >>> Since -a/vcoded copy avoids re-encoding, it just copies the packets >>> (without >>> regard to keyframes, iiuc). The packet closest to 90 seconds probably >>> isn't >>> a keyframe, but since that's where you requested the start it ffmpeg >>> starts >>> copying packets from there anyway. >> >> Yes I would totally agree with you, except I can't find a single "-ss" >> time that seems to "accidentally hit an i-frame" and work the way you >> and I would expect it to...though I haven't looked into it much... >> -r > > Given that seeking on mpeg2video does not seek to a key frame unless you > get lucky. > > I did a couple of test and normally for mpeg2video the first frame read > after a seek is not a key frame which causes a delay in the animiation. > Then I seeked to known keyframe times and that seems to successfully seek > to a key frame. I did this a couple times. For testing, I got the known > keyframe times by looking at the data after a seek. > > So when seeking backward you should always be at a keyframe at or before > your requested time but in the case of mpeg2video it does not happen. > > o - Is there an intent to get this reported as a bug if not already ? > > o - If it is reported as a bug, whats the likelyhood it will be fixed ? I > think I saw somewhere that it has been known for sometime or something to > that effect. I see this has been reported as ticket #1575 but why this is reported as an enhancement and not a bug, god only knows. This should not be a documentation issue and in my way of thinking, its a bug. We don't need gray areas like this and the frustration just gets passed on to everyone. From christian.bruemmer at gmx.de Sun Aug 5 15:17:44 2012 From: christian.bruemmer at gmx.de (=?ISO-8859-1?Q?Christian_Br=FCmmer?=) Date: Sun, 05 Aug 2012 15:17:44 +0200 Subject: [Libav-user] Speedup FFmpeg h264 Decoding on Android-Devices In-Reply-To: <501D6801.20006@gmx.de> References: <501D116E.1080901@gmx.de> <501D3020.4060903@gmx.de> <501D6801.20006@gmx.de> Message-ID: <501E7278.30002@gmx.de> I tried the "zerolatency,fastdecode" combination and the results are amazing! Before fastdecode the avg (about~ 200 measurements) was 19,8 ms per frame. Now on fastdecode (if iam not doing anything wrong) the avg is 10,52. Almost the half of the processing time. The avg framesize for both is exact the same: 11722 bytes (for the first 300 frames). This is great and it is enough for my application environment! Thanks for the help! Am 04.08.2012 20:20, schrieb Christian Br?mmer: > Okay i will consider that if i am not able to speedup ffmpeg decoding. > > First I will post my results after using the x264opts Hendrik provides > ( "zerolatency,fastdecode" ). > > Am 04.08.2012 17:52, schrieb Alex Cohn: >> >> On Aug 4, 2012 5:22 PM, "Christian Br?mmer" >> > wrote: >> > >> > For sure i first tried to use the Android MediaPlayer in >> combination with a RTSP-Stream but it has a - not configurable - >> frame buffer which size dependends of the rtsp fps. The result is a >> delay about 3-5 seconds which is a known problem as i discovered. >> > so for a real time video application your on your own.. >> >> You could directly call the built-in stagefreight avc decoder, this >> approach does not introduce extra latency. But the number of >> instances is limited - three or four, not more. >> >> BR, >> Alex Cohn >> >> > But anyway i thought there might be a few lever (on the encoding >> system) which i have to move to increase the decoding performance! >> > >> > What about the fast-decoding tune - how can i combine that with my >> zero latency configuration? >> > >> > Am 04.08.2012 16:05, schrieb Michael Bradshaw: >> >> >> >> On Aug 4, 2012 6:11 AM, "Christian Br?mmer" >> > wrote: >> >> > >> >> > Hi, >> >> > >> >> > i am using FFmpeg for H264 Decoding on an Android Device. >> >> >> >> Out of curiosity, is there a reason you aren't using Android's >> native decoder? It may be more optimized for the device than FFmpeg >> too. Sorry I don't know how to make FFmpeg faster. >> >> >> >> --Michael >> >> >> >> >> >> >> >> _______________________________________________ >> >> Libav-user mailing list >> >> Libav-user at ffmpeg.org >> >> http://ffmpeg.org/mailman/listinfo/libav-user >> > >> > >> > >> > _______________________________________________ >> > Libav-user mailing list >> > Libav-user at ffmpeg.org >> > http://ffmpeg.org/mailman/listinfo/libav-user >> > >> >> >> >> _______________________________________________ >> Libav-user mailing list >> Libav-user at ffmpeg.org >> http://ffmpeg.org/mailman/listinfo/libav-user > > > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user -------------- next part -------------- An HTML attachment was scrubbed... URL: From christian.bruemmer at gmx.de Sun Aug 5 15:31:40 2012 From: christian.bruemmer at gmx.de (=?ISO-8859-15?Q?Christian_Br=FCmmer?=) Date: Sun, 05 Aug 2012 15:31:40 +0200 Subject: [Libav-user] FFmpeg parallel H264 Decoding Message-ID: <501E75BC.908@gmx.de> Hi! I m using FFmpeg (v 0.8) on Android to decode H264 encoded Videoframes received over network. For the new multicore Smartphone devices i would like to optimize the decoding process by parallelization. The frames are encoded via x264 and the zerolatency tune so each frame contains a whole videoframe (if i got it right). As soon as i try to use avcodec_decode_video2 parallel at the same time i got many ffmpeg log errors and the videoframe is messed up There was a ffmpeg-mt branch and as far as i know it was merged some time ago. My question: Is it possible to use avcodec_decode_video2 parallel and if yes - how can i do it? Best regards, Christian From cehoyos at ag.or.at Sun Aug 5 16:32:21 2012 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Sun, 5 Aug 2012 14:32:21 +0000 (UTC) Subject: [Libav-user] FFmpeg parallel H264 Decoding References: <501E75BC.908@gmx.de> Message-ID: Christian Br?mmer writes: > I m using FFmpeg (v 0.8) You do realize that this is ancient and that many optimizations, especially for Android, have been committed since? Carl Eugen From mbradshaw at sorensonmedia.com Sun Aug 5 17:09:07 2012 From: mbradshaw at sorensonmedia.com (Michael Bradshaw) Date: Sun, 5 Aug 2012 09:09:07 -0600 Subject: [Libav-user] Why does av_seek_frame() not seek to a keyframe? In-Reply-To: <386E874DF5244247AB24C8E39BBC2811@MANLAP> References: <386E874DF5244247AB24C8E39BBC2811@MANLAP> Message-ID: On Sun, Aug 5, 2012 at 5:51 AM, Don Moir wrote: > I see this has been reported as ticket #1575 but why this is reported as an > enhancement and not a bug, god only knows. > > This should not be a documentation issue and in my way of thinking, its a > bug. We don't need gray areas like this and the frustration just gets passed > on to everyone. Yeah, I added a comment a day or two ago to the bug saying that maybe it would be better to force seeking without AVSEEK_FLAG_ANY in an mpg file to fail. I'll close it as invalid and open a new bug (with the status of defect). ... Ok, closed 1575 and opened 1607: https://ffmpeg.org/trac/ffmpeg/ticket/1607 Feel free to add any additional input you may have to that ticket. Thanks, Michael From donmoir at comcast.net Sun Aug 5 18:03:01 2012 From: donmoir at comcast.net (Don Moir) Date: Sun, 5 Aug 2012 12:03:01 -0400 Subject: [Libav-user] Why does av_seek_frame() not seek to a keyframe? References: <386E874DF5244247AB24C8E39BBC2811@MANLAP> Message-ID: ----- Original Message ----- From: "Michael Bradshaw" To: "This list is about using libavcodec, libavformat, libavutil,libavdevice and libavfilter." Sent: Sunday, August 05, 2012 11:09 AM Subject: Re: [Libav-user] Why does av_seek_frame() not seek to a keyframe? > On Sun, Aug 5, 2012 at 5:51 AM, Don Moir wrote: >> I see this has been reported as ticket #1575 but why this is reported as >> an >> enhancement and not a bug, god only knows. >> >> This should not be a documentation issue and in my way of thinking, its a >> bug. We don't need gray areas like this and the frustration just gets >> passed >> on to everyone. > > Yeah, I added a comment a day or two ago to the bug saying that maybe > it would be better to force seeking without AVSEEK_FLAG_ANY in an mpg > file to fail. I'll close it as invalid and open a new bug (with the > status of defect). > > ... > > Ok, closed 1575 and opened 1607: > https://ffmpeg.org/trac/ffmpeg/ticket/1607 > > Feel free to add any additional input you may have to that ticket. > > Thanks, > I think requiring AVSEEK_FLAG_ANY just side tracks the issue and could break some apps. I added a comment to ticket 1607. The way it works now is slightly broken and not convienent to work around but its close. It does seem like it should be more or less busy work to get it working probably. I say busy work because I think the seek code would need to be specialized somewhat to work in this case rather then using the generic seek code. I am guessing a bit. From mbradshaw at sorensonmedia.com Sun Aug 5 18:22:16 2012 From: mbradshaw at sorensonmedia.com (Michael Bradshaw) Date: Sun, 5 Aug 2012 10:22:16 -0600 Subject: [Libav-user] Why does av_seek_frame() not seek to a keyframe? In-Reply-To: References: <386E874DF5244247AB24C8E39BBC2811@MANLAP> Message-ID: On Sun, Aug 5, 2012 at 10:03 AM, Don Moir wrote: > I think requiring AVSEEK_FLAG_ANY just side tracks the issue and could break > some apps. I added a comment to ticket 1607. > > The way it works now is slightly broken and not convienent to work around > but its close. It does seem like it should be more or less busy work to get > it working probably. I say busy work because I think the seek code would > need to be specialized somewhat to work in this case rather then using the > generic seek code. I am guessing a bit. Yeah, I read your comment and agree it may not be the best change. I've added a comment, but for those who may not read the ticket, what do people think of changing ff_seek_frame_binary() so that after it finds a frame, and if AVSEEK_FLAG_ANY is not set, it reads backwards until it finds a keyframe? This would fix it for more than just the mpg case (if it's a problem for other formats; I don't know). seek_frame_generic() seems like it will try to seek to a keyframe even if AVSEEK_FLAG_ANY is set, which may be a problem. It will read up to the requested time, and then keep reading until it finds a keyframe (up to reading 1000 frames). I don't think seek_frame_generic() can be fixed so that it finds a keyframe before the requested timestamp, judging by the code. --Michael From christian.bruemmer at gmx.de Sun Aug 5 18:50:22 2012 From: christian.bruemmer at gmx.de (=?UTF-8?B?Q2hyaXN0aWFuIEJyw7xtbWVy?=) Date: Sun, 05 Aug 2012 18:50:22 +0200 Subject: [Libav-user] FFmpeg parallel H264 Decoding In-Reply-To: References: <501E75BC.908@gmx.de> Message-ID: <501EA44E.2090005@gmx.de> I was wrong. i am using one of the head/snapshot (git://source.ffmpeg.org/ffmpeg.git) version from june 2012! okay - so what about parallel decoding? Am 05.08.2012 16:32, schrieb Carl Eugen Hoyos: > Christian Br?mmer writes: > >> I m using FFmpeg (v 0.8) > You do realize that this is ancient and that many optimizations, > especially for Android, have been committed since? > > Carl Eugen > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user From cehoyos at ag.or.at Sun Aug 5 19:03:21 2012 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Sun, 5 Aug 2012 17:03:21 +0000 (UTC) Subject: [Libav-user] FFmpeg parallel H264 Decoding References: <501E75BC.908@gmx.de> <501EA44E.2090005@gmx.de> Message-ID: Christian Br?mmer writes: > I was wrong. i am using one of the head/snapshot > (git://source.ffmpeg.org/ffmpeg.git) version from june 2012! That's still old. > okay - so what about parallel decoding? Just pass a number greater than your core count to thread_count. Please do not top-post here, Carl Eugen From christian.bruemmer at gmx.de Sun Aug 5 19:43:43 2012 From: christian.bruemmer at gmx.de (=?UTF-8?B?Q2hyaXN0aWFuIEJyw7xtbWVy?=) Date: Sun, 05 Aug 2012 19:43:43 +0200 Subject: [Libav-user] FFmpeg parallel H264 Decoding In-Reply-To: References: <501E75BC.908@gmx.de> <501EA44E.2090005@gmx.de> Message-ID: <501EB0CF.9010504@gmx.de> Am 05.08.2012 19:03, schrieb Carl Eugen Hoyos: > Christian Br?mmer writes: > >> I was wrong. i am using one of the head/snapshot >> (git://source.ffmpeg.org/ffmpeg.git) version from june 2012! > That's still old. > >> okay - so what about parallel decoding? > Just pass a number greater than your core count to thread_count. > > Please do not top-post here, Carl Eugen > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user Oh, 2 month ago is too old? I was not aware of such a progress. In the docs AVCodecContext::thread_count is marked as "encoding: Set by user" (nothing about decoding). So i thought it will not affect the decoding performance. Ah but i see in AVCodecContext::execute there is a hint "decoding: Set by libavcodec, user can override. " Okay, i will give it a try! Thank you for your fast reply! I've another question cause it seems that you are familiar with FFmpeg and its dependancies. The problem beside decoding (@Android Phone )is the Color-Conversion from YUV to RGBA. I m using swscale (performance is worse ~ about the decoding time) and i heared about splitting the image in two parts and use swscale parallel for each part. Is that possible? If not - is there a way to speed up colour conversion (some thing like "thread_count") for android? I get a log output that says there is no hardware acceleration for colour conversion - is that still right or is there a patch somewhere to use advanced neon commands for color-conversions? From nicolas.george at normalesup.org Sun Aug 5 20:00:43 2012 From: nicolas.george at normalesup.org (Nicolas George) Date: Sun, 5 Aug 2012 20:00:43 +0200 Subject: [Libav-user] FFmpeg parallel H264 Decoding In-Reply-To: <501E75BC.908@gmx.de> References: <501E75BC.908@gmx.de> Message-ID: <20120805180043.GA25440@phare.normalesup.org> Le nonidi 19 thermidor, an CCXX, Christian Br?mmer a ?crit?: > As soon as i try to use avcodec_decode_video2 parallel at the same > time i got many ffmpeg log errors and the videoframe is messed up You can not use the same AVCodecContext simultaneously from several threads. You could create several AVCodecContext and use them simultaneously, or you can keep a single one: it will return you the frames sequentially, but behind the scenes it will decode in parallel. I do not think the first solution can work if the frames come from the same stream: zerolatency means that no frame depends on a later frame, either at encoding or at decoding, but they still depend on previous frames. Otherwise, it is an I-frame only codec, and the bitrate is much higher. In fact, my intuition says that zerolatency will more or less kill all hope of parallel frame decoding. Fortunately, you can still go for slice-based threading. Regards, -- Nicolas George -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: Digital signature URL: From cehoyos at ag.or.at Sun Aug 5 22:38:50 2012 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Sun, 5 Aug 2012 20:38:50 +0000 (UTC) Subject: [Libav-user] FFmpeg parallel H264 Decoding References: <501E75BC.908@gmx.de> <501EA44E.2090005@gmx.de> <501EB0CF.9010504@gmx.de> Message-ID: Christian Br?mmer writes: > In the docs AVCodecContext::thread_count is marked as > "encoding: Set by user" (nothing about decoding). So i > thought it will not affect the decoding performance. My avcodec.h says: * - decoding: Set by user. Carl Eugen From christian.bruemmer at gmx.de Mon Aug 6 01:25:09 2012 From: christian.bruemmer at gmx.de (=?UTF-8?B?Q2hyaXN0aWFuIEJyw7xtbWVy?=) Date: Mon, 06 Aug 2012 01:25:09 +0200 Subject: [Libav-user] FFmpeg parallel H264 Decoding In-Reply-To: References: <501E75BC.908@gmx.de> <501EA44E.2090005@gmx.de> <501EB0CF.9010504@gmx.de> Message-ID: <501F00D5.6060900@gmx.de> Am 05.08.2012 22:38, schrieb Carl Eugen Hoyos: > Christian Br?mmer writes: > >> In the docs AVCodecContext::thread_count is marked as >> "encoding: Set by user" (nothing about decoding). So i >> thought it will not affect the decoding performance. > My avcodec.h says: > * - decoding: Set by user. > > Carl Eugen > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user Okay, but nothing about my other question concerning swscale? From notzed at gmail.com Mon Aug 6 02:15:50 2012 From: notzed at gmail.com (Michael Zucchi) Date: Mon, 06 Aug 2012 09:45:50 +0930 Subject: [Libav-user] FFmpeg parallel H264 Decoding In-Reply-To: <501EB0CF.9010504@gmx.de> References: <501E75BC.908@gmx.de> <501EA44E.2090005@gmx.de> <501EB0CF.9010504@gmx.de> Message-ID: <501F0CB6.3030403@gmail.com> On 06/08/12 03:13, Christian Br?mmer wrote: > I've another question cause it seems that you are familiar with FFmpeg > and its dependancies. The problem beside decoding (@Android Phone )is > the Color-Conversion from YUV to RGBA. I m using swscale (performance is > worse ~ about the decoding time) and i heared about splitting the image > in two parts and use swscale parallel for each part. Is that possible? > If not - is there a way to speed up colour conversion (some thing like > "thread_count") for android? I get a log output that says there is no > hardware acceleration for colour conversion - is that still right or is > there a patch somewhere to use advanced neon commands for > color-conversions? I used opengles2 for this, it works well and gives you the scaling directly and is pretty well ideal if all you're doing is displaying it (also requires smaller texture uploads - which are #@#@$# slow - the android player uses external textures which directly load YUV from 'cpu ram', but these are not exposed apis). swscale is way too slow (unless it's been improved lately for arm), but if you want to try it MT the api directly handles 'slices', so converting it to MT should be fairly simple and obvious. For optimised versions, the yuv conversion alone isn't too hard to write (i'm sure there is some out there for neon or at least arm, search for it) but if you need scaling it complicates things a little bit. You can do the yuv conversion concurrently to decoding the next frame, so if all threads are busy decoding the video already, doing an MT conversion wont help. But either way, mp4 is just slow to decode and you hit limits trying to do it in software. If you have control over both ends you're not tied to one format though. Michael From adrozdoff at gmail.com Mon Aug 6 06:15:49 2012 From: adrozdoff at gmail.com (hatred) Date: Mon, 6 Aug 2012 15:15:49 +1100 Subject: [Libav-user] How to change framerate for output stream Message-ID: Hi all! I write live transcoder (https://gitorious.org/live-transcoder) that can accept input streams from web cams (and other live streams) and transcode it into given formats and distribute it via different transports (currently HTTP only). On my work we plan to use this transcoder for transcode streams from Axis cams to FLV and publish its ob our site. But it look like FLV players wants FLV with 25 FPS but cams provide streams with FPS from 25 up to 30. And I have trouble: I set: 1. AVCodecContext::time_base to 1/25 2. AVStream::time_base to 1/25 3. AVStream::r_frame_rate to 25/1 After encoding packet I scale PTS: Packet.pts = av_rescale_q(Frame.pts, FrameTimeBase, PacketTimeBase); FrameTimeBase equal to input video stream time base PacketTimeBase equal to output video stream time base AVIOContext I alloc with avio_alloc_context() and write packets to HTTP stream with av_write_frame() All work well (in the first approximation) but if I try to play video stream via ffplay it plays and ffplay shows 1k tbr, 1k tbn, 1k tbc but I expect about 25 tbr I dump FLV (with curl) to file, manualy parse header and view, that framerate set to 25, so I can't understand how to correct change framerate for output stream. Thanks for any help. -------------- next part -------------- An HTML attachment was scrubbed... URL: From i.like.privacy.too at gmail.com Mon Aug 6 16:30:52 2012 From: i.like.privacy.too at gmail.com (Camera Man) Date: Mon, 06 Aug 2012 10:30:52 -0400 Subject: [Libav-user] FFmpeg parallel H264 Decoding In-Reply-To: <501EA44E.2090005@gmx.de> References: <501E75BC.908@gmx.de> <501EA44E.2090005@gmx.de> Message-ID: <501FD51C.6020202@gmail.com> An HTML attachment was scrubbed... URL: From eric at teratorn.org Mon Aug 6 03:32:47 2012 From: eric at teratorn.org (Eric P. Mangold) Date: Sun, 5 Aug 2012 21:32:47 -0400 Subject: [Libav-user] FFmpeg parallel H264 Decoding In-Reply-To: <501EB0CF.9010504@gmx.de> References: <501E75BC.908@gmx.de> <501EA44E.2090005@gmx.de> <501EB0CF.9010504@gmx.de> Message-ID: <20120806013247.GX10379@ragnarok.teratorn.org> On Sun, Aug 05, 2012 at 07:43:43PM +0200, Christian Br??mmer wrote: > Am 05.08.2012 19:03, schrieb Carl Eugen Hoyos: > >Christian Br??mmer writes: > > > >>I was wrong. i am using one of the head/snapshot > >>(git://source.ffmpeg.org/ffmpeg.git) version from june 2012! > >That's still old. > > > >>okay - so what about parallel decoding? > >Just pass a number greater than your core count to thread_count. > > > >Please do not top-post here, Carl Eugen > > > >_______________________________________________ > >Libav-user mailing list > >Libav-user at ffmpeg.org > >http://ffmpeg.org/mailman/listinfo/libav-user > > Oh, 2 month ago is too old? I was not aware of such a progress. > > In the docs AVCodecContext::thread_count is marked as "encoding: Set > by user" (nothing about decoding). So i thought it will not affect > the decoding performance. > Ah but i see in AVCodecContext::execute there is a hint "decoding: > Set by libavcodec, user can override. " > > Okay, i will give it a try! Thank you for your fast reply! > > I've another question cause it seems that you are familiar with Im sorry but that belongs in another thread, would you mind posting a new thread with a new subject line? this is as much for the list's health, as for search engines everywhere. -- Thanks a lot, -E PS Feel free to repost the content from this thread. From marshadsaleem at tataelxsi.co.in Tue Aug 7 05:51:03 2012 From: marshadsaleem at tataelxsi.co.in (Mohd Arshad Saleem) Date: Tue, 7 Aug 2012 09:21:03 +0530 Subject: [Libav-user] Regarding decoding the video data Message-ID: <502090A7.1070205@tataelxsi.co.in> Hi Team, We are working on H264 decoder side in which we are trying to decode the video data by using avcodec_decode_video() API. Two questions i would like to ask:- 1) Just wanted to know the size or length of decoded data which we are receiving and in which field of structure the decoded data is getting stored. 2) In AVFrame structure what is int linesize[4] field and char *data[4]. We will highly thankful to you. Thanks and Regards Arshad From cehoyos at ag.or.at Tue Aug 7 07:46:57 2012 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Tue, 7 Aug 2012 05:46:57 +0000 (UTC) Subject: [Libav-user] Regarding decoding the video data References: <502090A7.1070205@tataelxsi.co.in> Message-ID: Mohd Arshad Saleem writes: > 2) In AVFrame structure what is int linesize[4] field and char *data[4]. Some formats (for example yuva420p) need four pointers (and four linesizes). When decoding h264, you can ignore the fourth pointer. Carl Eugen From rakesh-sg at hcl.com Tue Aug 7 12:02:31 2012 From: rakesh-sg at hcl.com (Rakesh Shivayya Guttedar -ERS, HCL Tech) Date: Tue, 7 Aug 2012 15:32:31 +0530 Subject: [Libav-user] Setting libx264 bitrate via API In-Reply-To: <1344141606088-4655531.post@n4.nabble.com> References: <1342823147934-4655453.post@n4.nabble.com> <0BD925121A830C4DACF7FF9213266ACAB3A981CCB4@CHN-HCLT-EVS09.HCLT.CORP.HCL.IN> <1343077959076-4655479.post@n4.nabble.com> <1344141606088-4655531.post@n4.nabble.com> Message-ID: <0BD925121A830C4DACF7FF9213266ACAB8675CEC75@CHN-HCLT-EVS09.HCLT.CORP.HCL.IN> Hi, Your finding has fixed the issue in my case also. Thanks for posting. It would certainly help others who are facing similar issue. Regards, Rakesh -----Original Message----- From: libav-user-bounces at ffmpeg.org [mailto:libav-user-bounces at ffmpeg.org] On Behalf Of jettoblack Sent: Sunday, August 05, 2012 10:10 AM To: libav-user at ffmpeg.org Subject: Re: [Libav-user] Setting libx264 bitrate via API After digging through ffmpeg.c, I finally figured it out. My code was sending pictures into the encoder using a pts in the stream's time_base of 1/90000 (e.g. 3003, 6006, 9009). The solution was to first rescale the AVFrame's pts from the stream's time_base to the codec time_base to get a simple frame number (e.g. 1, 2, 3). pic->pts = av_rescale_q(pic->pts, ost->time_base, enc->time_base); avcodec_encode_video2(enc, &newpkt, pic, &got_packet_ptr); Then when a packet is received from the encoder, you need to rescale pts and dts back to the stream time_base. newpkt.pts = av_rescale_q(newpkt.pts, enc->time_base, ost->time_base); newpkt.dts = av_rescale_q(newpkt.dts, enc->time_base, ost->time_base); av_interleaved_write_frame(out, &newpkt); I guess not every codec requires this to be done, but libx264 does if you want to encode CBR/ABR. -- View this message in context: http://libav-users.943685.n4.nabble.com/Setting-libx264-bitrate-via-API-tp4655453p4655531.html Sent from the libav-users mailing list archive at Nabble.com. _______________________________________________ Libav-user mailing list Libav-user at ffmpeg.org http://ffmpeg.org/mailman/listinfo/libav-user ::DISCLAIMER:: ---------------------------------------------------------------------------------------------------------------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. E-mail transmission is not guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or may contain viruses in transmission. The e mail and its contents (with or without referred errors) shall therefore not attach any liability on the originator or HCL or its affiliates. Views or opinions, if any, presented in this email are solely those of the author and may not necessarily reflect the views or opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of authorized representative of HCL is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any email and/or attachments, please check them for viruses and other defects. ---------------------------------------------------------------------------------------------------------------------------------------------------- From amillett at matrox.com Tue Aug 7 14:53:13 2012 From: amillett at matrox.com (Alexandre Millette) Date: Tue, 07 Aug 2012 08:53:13 -0400 Subject: [Libav-user] Regarding decoding the video data In-Reply-To: <502090A7.1070205@tataelxsi.co.in> References: <502090A7.1070205@tataelxsi.co.in> Message-ID: <50210FB9.5000000@matrox.com> Hello, Mohd Arshad Saleem wrote: > We are working on H264 decoder side in which we are trying to decode the > video data by using avcodec_decode_video() API. avcodec_decode_video() is deprecated, you should use avcodec_decode_video2(). > 1) Just wanted to know the size or length of decoded data which we are > receiving and in which field of structure the decoded data is getting > stored. The second parameter of avcodec_decode_video2 is a pointer to a AVFrame structure which will be filled with the decoded data upon returning. AVFrame.data is an array that contains the decoded data, separated by channels (data[0] would be the Y data in YUV). Be sure to allocate the AVFrame first with avcodec_alloc_frame() and use sws_scale() if you wish to convert your decoded data from any format (usually YUV) to a more convenient (RGB) format. As for the size of the decoded data, you can use: int numBytes = avpicture_get_size( mpCodecCtx->pix_fmt, mpCodecCtx->width, mpCodecCtx->height); Where mpCodecCtx is your AVCodecContext structure pointer. Although this would return the total size of the data decoded by avcodec_decode_video2 and not the size of each channel. You could also use AVFrame.linesize[i] * AVCodecContext.height to get the size of the array reserved for the i channel. Again, you can use sws_scale() to convert to a RGB format and simplify your processing (assuming you can afford the performance cost). Hope this helps, Alex M. From xhpohanka at gmail.com Wed Aug 8 11:31:47 2012 From: xhpohanka at gmail.com (Jan Pohanka) Date: Wed, 08 Aug 2012 11:31:47 +0200 Subject: [Libav-user] using avformat with external hardware codec Message-ID: Hello, I'd like to use avformat library to format the h264 stream which I get from the hardware codec on my SoC to some container (mkv, 3gp, ...). What parameters need to be set avformat? I have tried following code (simplified). AVFormatContext *os; AVOutputFormat *fmt; AVStream *video_st; av_register_all(); fmt = av_guess_format("matroska", NULL, NULL); os = avformat_alloc_context(); os->oformat = fmt; strncpy(os->filename, "test.mkv", 32); video_st = av_new_stream(os, 0); video_st->codec->codec_id = CODEC_ID_H264; video_st->codec->codec_type = AVMEDIA_TYPE_VIDEO; avio_open(&os->pb, "test.mkv", URL_WRONLY); av_write_header(os); while (frames) { AVPacket pkt; av_init_packet(&pkt); pkt.data = enc_buf->user_addr; pkt.size = enc_buf->bytes_used; pkt.pts = env->frame_cnt; pkt.stream_index = 0; av_interleaved_write_frame(os, &pkt); } av_write_trailer(os); Unfortunately this ends with SIGFPE arithmetic exception. I think I can create a "dummy" avcodec codec and use it to fill the contents of video_st->codec, but I'd rather to go without such workaround. Maybe the parameters can be read from the first frame of the raw h264 stream? with best regards Jan -- Tato zpr?va byla vytvo?ena p?evratn?m po?tovn?m klientem Opery: http://www.opera.com/mail/ From xhpohanka at gmail.com Wed Aug 8 13:07:06 2012 From: xhpohanka at gmail.com (Jan Pohanka) Date: Wed, 08 Aug 2012 13:07:06 +0200 Subject: [Libav-user] using avformat with external hardware codec In-Reply-To: References: Message-ID: > What parameters need to be set avformat? I have tried following code > (simplified). > > video_st = av_new_stream(os, 0); > video_st->codec->codec_id = CODEC_ID_H264; > video_st->codec->codec_type = AVMEDIA_TYPE_VIDEO; > Ok. I have found that et least following parameters has to be set in codec struct. video_st->codec->codec_id = CODEC_ID_H264; video_st->codec->codec_type = AVMEDIA_TYPE_VIDEO; video_st->codec->time_base = (AVRational) {1, 5}; video_st->codec->width = 1600; video_st->codec->height = 1200; I still do not know whether it is not possible to get these parameters from encoded raw stream. I have tried the avformat_open_input() function, but it does not fill codec->width and height members for exapmle. best regards Jan -- Tato zpr?va byla vytvo?ena p?evratn?m po?tovn?m klientem Opery: http://www.opera.com/mail/ From alexcohn at netvision.net.il Wed Aug 8 15:40:39 2012 From: alexcohn at netvision.net.il (Alex Cohn) Date: Wed, 8 Aug 2012 16:40:39 +0300 Subject: [Libav-user] using avformat with external hardware codec In-Reply-To: References: Message-ID: On Wed, Aug 8, 2012 at 2:07 PM, Jan Pohanka wrote: >> What parameters need to be set avformat? I have tried following code >> (simplified). >> >> video_st = av_new_stream(os, 0); >> video_st->codec->codec_id = CODEC_ID_H264; >> video_st->codec->codec_type = AVMEDIA_TYPE_VIDEO; >> > > Ok. I have found that et least following parameters has to be set in codec > struct. > > > video_st->codec->codec_id = CODEC_ID_H264; > video_st->codec->codec_type = AVMEDIA_TYPE_VIDEO; > video_st->codec->time_base = (AVRational) {1, 5}; > video_st->codec->width = 1600; > video_st->codec->height = 1200; > > I still do not know whether it is not possible to get these parameters from > encoded raw stream. > I have tried the avformat_open_input() function, but it does not fill > codec->width and height members for exapmle. > > > best regards > Jan You can get this data from the SPS field (NALU in h264-speak) that must precede the first frame. See http://ffmpeg.org/doxygen/trunk/structSPS.html From niulicheng at gmail.com Thu Aug 9 10:13:23 2012 From: niulicheng at gmail.com (Chinos) Date: Thu, 9 Aug 2012 01:13:23 -0700 (PDT) Subject: [Libav-user] http live streaming implementation in ffmpeg Message-ID: <1344500003162-4655557.post@n4.nabble.com> hi everyone, I am recently undertaking a project about http live streaming. When I read ffmpeg code, I see both hls.c and hls_protocol.c are included in ffmpeg?0.11. It looks like that hls.c implement http live streaming as a demuxer, while hls_protocol.c implement http live streaming as a IO protocol. I have no idea which implementation is better. Then I see a log in ffmpeg: "Using the hls protocol is discouraged, please try using the hls demuxer instead. The hls demuxer should be more complete and work as well as the protocol implementation. " It seems like that the ffmpeg developers considers hls demuxer as the better implementation. In my point of view, the structure of hls protocol is more clear. I am confused about this. So would anyone explain the advantage of hls demuxer? Is it more powerful or efficient? or just because it is with less bugs and more stability? Thanks -- View this message in context: http://libav-users.943685.n4.nabble.com/Libav-user-http-live-streaming-implementation-in-ffmpeg-tp4655557.html Sent from the libav-users mailing list archive at Nabble.com. From jp4work at gmail.com Fri Aug 10 09:41:26 2012 From: jp4work at gmail.com (JIA Pei) Date: Fri, 10 Aug 2012 00:41:26 -0700 Subject: [Libav-user] error LNK2001: unresolved external symbol _av_pix_fmt_descriptors Message-ID: Hi, all: First, my environment: Windows 7 + Visual Studio 2010 + libav 0.8.3 Release. Before the final success, I got this final error: > error LNK2001: unresolved external symbol _av_pix_fmt_descriptors It seems the solution can be found at http://ffmpeg.arrozcru.org/forum/viewtopic.php?f=8&t=1514 > You can hack the headers and put __declspec(dllimport) before the > variable. Its size is PIX_FMT_NB if I recall correctly. Well, the detailed solutions can be found at http://code.google.com/r/souranil-javacv/source/browse/src/main/resources/com/googlecode/javacv/cpp/avutil.h?r=d40508ddddb1f4d87ddfb0ac7fccb1dd69b971b1 > #ifdef _WIN32 > #undef av_pix_fmt_descriptors > __declspec(dllimport) extern const AVPixFmtDescriptor > av_pix_fmt_descriptors[]; > ... However, I strictly followed this solution, but still got an additional error: > error C2370: 'av_pix_fmt_descriptors' : redefinition; different storage > class Cheers -- Pei JIA Email: jp4work at gmail.com cell: +1 604-362-5816 Welcome to Vision Open http://www.visionopen.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From cehoyos at ag.or.at Fri Aug 10 10:45:12 2012 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Fri, 10 Aug 2012 08:45:12 +0000 (UTC) Subject: [Libav-user] =?utf-8?q?error_LNK2001=3A_unresolved_external_symbo?= =?utf-8?q?l_=5Fav=5Fpix=5Ffmt=5Fdescriptors?= References: Message-ID: JIA Pei writes: > First, my environment:?Windows 7 + Visual Studio 2010 >?+ libav 0.8.3 Release. This is a broken version of FFmpeg with several hundred known regressions, some of them possibly security relevant. Please understand that we cannot support broken versions. See http://ffmpeg.org/download.html for supported versions of FFmpeg, use git head if you are not a distributor. Carl Eugen From jp4work at gmail.com Fri Aug 10 22:51:29 2012 From: jp4work at gmail.com (JIA Pei) Date: Fri, 10 Aug 2012 13:51:29 -0700 Subject: [Libav-user] error LNK2001: unresolved external symbol _av_pix_fmt_descriptors In-Reply-To: References: Message-ID: On Fri, Aug 10, 2012 at 1:45 AM, Carl Eugen Hoyos wrote: > JIA Pei writes: > > > First, my environment: Windows 7 + Visual Studio 2010 > > > + libav 0.8.3 Release. > > This is a broken version of FFmpeg with several hundred > known regressions, some of them possibly security relevant. > Please understand that we cannot support broken versions. > See http://ffmpeg.org/download.html for supported > versions of FFmpeg, use git head if you are not a > distributor. > > Carl Eugen > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user Hi, Thank you Carl Eugen Hoyos: I just have no idea what's the relationship between ffmpeg and libav? It seems libav is replacing ffmpeg? Which is newer? Are ffmpeg and libav 2 different groups? It's always problematic to build ffmpeg under Windows anyway. At the bottom of http://ffmpeg.zeranoe.com/builds/, the dependent 3rd party (external) libraries are afforded, but not all of those libraries are able to be built successfully under Windows. A typical example is bzip2: $ make install ... chmod: changing permissions of '/usr/local/bin/bzip2': Bad file number make: *** [install] Error 1 In fact, I just want ffmpeg to be successfully built and be able to support RTMPDump, x264, Xvid, etc.... However, there are always some problems... Please do help... Thank you very much. Best Regards Pei -- Pei JIA Email: jp4work at gmail.com cell: +1 604-362-5816 Welcome to Vision Open http://www.visionopen.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From jp4work at gmail.com Fri Aug 10 23:33:41 2012 From: jp4work at gmail.com (JIA Pei) Date: Fri, 10 Aug 2012 14:33:41 -0700 Subject: [Libav-user] error LNK2001: unresolved external symbol _av_pix_fmt_descriptors In-Reply-To: References: Message-ID: Hi, sorry... The problem of bzip2 seems to be solved here http://kemovitra.blogspot.ca/2009/08/mingw-to-compile-ffmpeg.html I'm moving on to build my own ffmpeg anyway... Cheers Pei On Fri, Aug 10, 2012 at 1:51 PM, JIA Pei wrote: > > > On Fri, Aug 10, 2012 at 1:45 AM, Carl Eugen Hoyos wrote: > >> JIA Pei writes: >> >> > First, my environment: Windows 7 + Visual Studio 2010 >> >> > + libav 0.8.3 Release. >> >> This is a broken version of FFmpeg with several hundred >> known regressions, some of them possibly security relevant. >> Please understand that we cannot support broken versions. >> See http://ffmpeg.org/download.html for supported >> versions of FFmpeg, use git head if you are not a >> distributor. >> >> Carl Eugen >> >> _______________________________________________ >> Libav-user mailing list >> Libav-user at ffmpeg.org >> http://ffmpeg.org/mailman/listinfo/libav-user > > > > > Hi, Thank you Carl Eugen Hoyos: > > I just have no idea what's the relationship between ffmpeg and libav? It > seems > libav is replacing ffmpeg? Which is newer? Are ffmpeg and libav 2 > different > groups? > > It's always problematic to build ffmpeg under Windows anyway. At the > bottom of > http://ffmpeg.zeranoe.com/builds/, the dependent 3rd party (external) > libraries > are afforded, but not all of those libraries are able to be built > successfully > under Windows. A typical example is bzip2: > > $ make install > ... > chmod: changing permissions of '/usr/local/bin/bzip2': Bad file number > make: *** [install] Error 1 > > > In fact, I just want ffmpeg to be successfully built and be able to > support > RTMPDump, x264, Xvid, etc.... However, there are always some problems... > > > Please do help... > > > Thank you very much. > > > Best Regards > Pei > > > > -- > > Pei JIA > > Email: jp4work at gmail.com > cell: +1 604-362-5816 > > Welcome to Vision Open > http://www.visionopen.com > -- Pei JIA Email: jp4work at gmail.com cell: +1 604-362-5816 Welcome to Vision Open http://www.visionopen.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From bruce at spearmorgan.com Fri Aug 10 23:46:01 2012 From: bruce at spearmorgan.com (Bruce Wheaton) Date: Fri, 10 Aug 2012 14:46:01 -0700 Subject: [Libav-user] error LNK2001: unresolved external symbol _av_pix_fmt_descriptors In-Reply-To: References: Message-ID: <5E39B8B6-A78F-431D-B2B4-685977454026@spearmorgan.com> > I just have no idea what's the relationship between ffmpeg and libav? It seems > libav is replacing ffmpeg? Which is newer? Are ffmpeg and libav 2 different > groups? Touchy topic. Picked at random, here's some discussion on the situation: http://blog.pkh.me/p/13-the-ffmpeg-libav-situation.html Bruce From halonso at vpod.tv Fri Aug 10 13:35:00 2012 From: halonso at vpod.tv (Hector Alonso) Date: Fri, 10 Aug 2012 13:35:00 +0200 Subject: [Libav-user] Audio aligned buffer in 32/64bit system. Message-ID: Hello, I'm developing a multiplatform player using libav and QT. It works fine in Win32, MacOS and Linux, but I have a problem with audio in Linux 64bits. When I perform a search, my SwrContext pointer still at the same place but I get segmentation fault when it gets to swr_convert function. I guess it might be another data structure which is going out of bounds. Also I have an audio cracking which changes when I modify the parameters of my audio decoding buffer declared like this: DECLARE_ALIGNED(16, uint8_t, m_tDecodingBuffer)[AVCODEC_MAX_AUDIO_FRAME_SIZE*4]; Is there any special configuration or data structure which depends of the system word size? Any clues? Thank you. Hector. -------------- next part -------------- An HTML attachment was scrubbed... URL: From noahzarc at hotmail.co.uk Thu Aug 9 18:06:11 2012 From: noahzarc at hotmail.co.uk (noahzarc) Date: Thu, 9 Aug 2012 09:06:11 -0700 (PDT) Subject: [Libav-user] Using LibX264 with ffmpeg libraries In-Reply-To: <20120723201422.GA23339@phare.normalesup.org> References: <20120720205857.GA6985@phare.normalesup.org> <1343068619950-4655472.post@n4.nabble.com> <20120723201422.GA23339@phare.normalesup.org> Message-ID: <1344528371689-4655558.post@n4.nabble.com> Nicolas George-2 wrote > > Le sextidi 6 thermidor, an CCXX, noahzarc a ?crit?: >> Apologies for top posting, it's my very first time using a mailing list. > > No problem, you fixed it. > >> Apologies, it's my very first time using a mailing list. Would this be >> the >> correct way of setting priv_data? >> >> AVDictionary *outputDictionary; >> av_dict_set(&outputDictionary, "crf", "0", AV_DICT_APPEND); >> avcodec_open2(outputCodecCtx, codec, &outputDictionary); > > You would probably make sure you init outputDictionary to NULL before > doing > anything on it. And AV_DICT_APPEND is not necessary here and may be > harmful > under some circumstances, but yes, this is the gist of it. > > Regards, > > -- > Nicolas GEorge > > _______________________________________________ > Libav-user mailing list > Libav-user@ > http://ffmpeg.org/mailman/listinfo/libav-user > Yeah so I tried to implement this into my code, it works but some thing weird happens when I change the value of crf.. So originally I have crf set at 0, which produces lossless output. But since the output file size is too big, I wanted to change crf to a higher value, let's say 18. But if I do that, the output video file generated would be 6KB without any content in it. Any ideas why/how this happened? Thanks! Cheers -- View this message in context: http://libav-users.943685.n4.nabble.com/Libav-user-Using-LibX264-with-ffmpeg-libraries-tp4655395p4655558.html Sent from the libav-users mailing list archive at Nabble.com. From olivier.durecu at gmail.com Fri Aug 10 16:13:41 2012 From: olivier.durecu at gmail.com (=?ISO-8859-1?Q?Olivier_Dur=E9cu?=) Date: Fri, 10 Aug 2012 16:13:41 +0200 Subject: [Libav-user] Streaming RTMP Message-ID: Hi experts, I am trying to use FFMpeg from my app to stream a RTMP flow I have a piece a code working fine to generate a local FLV file. And I thought that it would be enough to replace my filename by the RTMP url when allocating the AVFormatContext to have RTMP streaming... but nothing happens. And even setting the debug log level doesn't say anything My code is very "standard" AVFormatContext *oc; avformat_alloc_output_context2(&oc, NULL, "FLV", "rtmp:// 127.0.0.1:1935/live/test.flv"); then adding AVStream for audio and video And using av_interleaved_write_frame to write the encoded packets. Anyone has a clue ? Thanks Olivier -------------- next part -------------- An HTML attachment was scrubbed... URL: From info at denisgottardello.it Sun Aug 12 21:51:51 2012 From: info at denisgottardello.it (Denis) Date: Sun, 12 Aug 2012 21:51:51 +0200 Subject: [Libav-user] Audio aligned buffer in 32/64bit system. In-Reply-To: References: Message-ID: <201208122151.51460.info@denisgottardello.it> In data venerd? 10 agosto 2012 13:35:00, Hector Alonso ha scritto: > I'm developing a multiplatform player using libav and QT. Sorry for this mail. I read that you are able to develop with qt on mac. I have Mac Lion with latest xCode but I'm not able to install qtcreator in online or offline mode. How can i do this? -- www.denisgottardello.it Skype: mrdebug Videosurveillance and home automation! http://www.denisgottardello.it/DomusBoss/DomusBossIndice.php From xhpohanka at gmail.com Mon Aug 13 09:06:40 2012 From: xhpohanka at gmail.com (Jan Pohanka) Date: Mon, 13 Aug 2012 09:06:40 +0200 Subject: [Libav-user] using avformat with external hardware codec In-Reply-To: References: Message-ID: Hi, > You can get this data from the SPS field (NALU in h264-speak) that > must precede the first frame. See > http://ffmpeg.org/doxygen/trunk/structSPS.html Could you please give me a short example how to do that using libav* libraries? What should I do when I receive the first frame of raw h264 stream? regards Jan -- Tato zpr?va byla vytvo?ena p?evratn?m po?tovn?m klientem Opery: http://www.opera.com/mail/ From dhaval.shah at fugital.com Tue Aug 14 10:03:11 2012 From: dhaval.shah at fugital.com (Dhaval Shah) Date: Tue, 14 Aug 2012 13:33:11 +0530 Subject: [Libav-user] How to create TS with one h264 and multiple aac tracks Message-ID: <000c01cd79f3$417bab10$c4730130$@shah@fugital.com> Hi, I am trying to create .ts file with H264+AAC using av_interleaved_write_frame(). And its works fine with H264+AAC. But now I want to create .ts file with 1 h264 and eight AAC tracks. I have tried to write audio in file with av_interleaved_write_frame() but when I open this file in vlc it shows only one audio track. And audios are mixed up. I want to make .ts file which I can open in vlc with eight different audio tracks and only one video track. So if anyone has tried it before with ffmpeg command line or with c application please let me know the solution. It will be very great help for me. Regards Dhaval Shah Embedded Engineer 091 9727960989 -------------- next part -------------- An HTML attachment was scrubbed... URL: From halonso at vpod.tv Mon Aug 13 16:32:54 2012 From: halonso at vpod.tv (Hector Alonso) Date: Mon, 13 Aug 2012 16:32:54 +0200 Subject: [Libav-user] Audio aligned buffer in 32/64bit system. In-Reply-To: <201208122151.51460.info@denisgottardello.it> References: <201208122151.51460.info@denisgottardello.it> Message-ID: I had no problem at all, sorry, don't mind, you should ask into a QTCreator forum. Any ideas about audio buffer alignement in 32/64 b ? On Sun, Aug 12, 2012 at 9:51 PM, Denis wrote: > In data venerd? 10 agosto 2012 13:35:00, Hector Alonso ha scritto: > > I'm developing a multiplatform player using libav and QT. > > Sorry for this mail. I read that you are able to develop with qt on mac. I > have Mac Lion with latest xCode but I'm not able to install qtcreator in > online or offline mode. How can i do this? > > > -- > www.denisgottardello.it > Skype: mrdebug > Videosurveillance and home automation! > http://www.denisgottardello.it/DomusBoss/DomusBossIndice.php > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > -------------- next part -------------- An HTML attachment was scrubbed... URL: From andrey.krieger.utkin at gmail.com Thu Aug 16 08:20:32 2012 From: andrey.krieger.utkin at gmail.com (Andrey Utkin) Date: Thu, 16 Aug 2012 09:20:32 +0300 Subject: [Libav-user] Streaming RTMP In-Reply-To: References: Message-ID: 2012/8/10 Olivier Dur?cu : > Hi experts, > > I am trying to use FFMpeg from my app to stream a RTMP flow > > I have a piece a code working fine to generate a local FLV file. And I > thought that it would be enough to replace my filename by the RTMP url when > allocating the AVFormatContext to have RTMP streaming... but nothing > happens. And even setting the debug log level doesn't say anything > > My code is very "standard" > > AVFormatContext *oc; > avformat_alloc_output_context2(&oc, NULL, "FLV", > "rtmp://127.0.0.1:1935/live/test.flv"); > > then adding AVStream for audio and video > > And using av_interleaved_write_frame to write the encoded packets. > > Anyone has a clue ? I assume you have RTMP server and you want to publish your stream to it as a client. Are you sure you have correctly configured the server to percept a stream on this URL? Seems correct at first sight then, although usually you have to pass some options in URL. Sniff the TCP traffic on 1935 port to further investigate the situation. Check libavformat debug messages (set loglevel to debug). To check this issue without chance of having bug in your app, try it with ffmpeg utility. ffmpeg -i my.flv -c copy rtmp://127.0.0.1:1935/live/test.flv -loglevel debug -- Andrey Utkin From Sebastian.Hommel at hs-ruhrwest.de Thu Aug 16 11:42:15 2012 From: Sebastian.Hommel at hs-ruhrwest.de (Hommel, Sebastian) Date: Thu, 16 Aug 2012 09:42:15 +0000 Subject: [Libav-user] no frame error Message-ID: <3F9F72BDC864C2408907D56FE9A065F6563CA63D@mh-maildb01.ad.hs-rw.de> Hello, I try to grab images from a H.264 video stream of an Axis camera with Visual Studio 2010 for a x64 machine. I use the latest Version of ffmpeg. If I use ffplay.exe the stream is well shown, but in my implementation I get the Error: "no frame!" from avcodec_decode_video2(). My code and the full error is shown below. Your help is greatly appreciated. #include "stdafx.h" extern "C" { #include #include } int _tmain(int argc, _TCHAR* argv[]) { AVFormatContext* ic = avformat_alloc_context(); avcodec_register_all(); avformat_network_init(); av_register_all(); AVPacket pkt1, *pkt = &pkt1; avformat_open_input(&ic, "rtsp://root:hallo2010 at 10.2.114.57/axis-media/media.amp", NULL, NULL); av_find_stream_info(ic); av_dump_format(ic, 0, ic->filename, false); AVCodecContext* enc = ic->streams[0]->codec; int video_index = -1; for(int i = 0; i < ic->nb_streams; i++) { enc = ic->streams[i]->codec; if(enc->codec_type == AVMEDIA_TYPE_VIDEO) { video_index = i; } } int picture = 0; AVCodec* codec = avcodec_find_decoder(ic->streams[video_index]->codec->codec_id); enc = avcodec_alloc_context(); if(codec->capabilities & CODEC_CAP_TRUNCATED) ic->streams[video_index]->codec->flags|=CODEC_FLAG_TRUNCATED; if (!codec || avcodec_open(enc, codec) < 0) return -1; av_read_play(ic); AVFrame* frame; frame = avcodec_alloc_frame(); av_init_packet(pkt); avcodec_flush_buffers(enc); uint8_t *buffer; int numBytes; enc->width = 1920; enc->height = 1080; // Determine required buffer size and allocate buffer numBytes=avpicture_get_size(PIX_FMT_RGB24, enc->width, enc->height); buffer=(uint8_t *)av_malloc(numBytes*sizeof(uint8_t)); avpicture_fill((AVPicture *)frame, buffer, PIX_FMT_RGB24, enc->width, enc->height); int i = 10; while(i>0) { i--; if(av_read_packet(ic, pkt)<0) break; if(pkt->stream_index==video_index) { avcodec_decode_video2(enc, frame, &picture, pkt); } av_free_packet(pkt); } avcodec_close(enc); av_close_input_file(ic); return 0; } OUTPUT: [udp @ 0000000000588fe0] 'circular_buffer_size' option was set but it is not sup ported on this build (pthread support is required) [udp @ 000000000058fbc0] 'circular_buffer_size' option was set but it is not sup ported on this build (pthread support is required) [rtsp @ 0000000000586fc0] Estimating duration from bitrate, this may be inaccura te Input #0, rtsp, from 'rtsp://root:hallo2010 at 10.2.114.57/axis-media/media.amp': Metadata: title : Media Presentation Duration: N/A, start: 0.120000, bitrate: N/A Stream #0:0: Video: h264 (Baseline), yuvj420p, 1920x1080 [SAR 1:1 DAR 16:9], 25 tbr, 90k tbn, 180k tbc [h264 @ 00000000004a29a0] no frame! [h264 @ 00000000004a29a0] no frame! [h264 @ 00000000004a29a0] no frame! [h264 @ 00000000004a29a0] no frame! [h264 @ 00000000004a29a0] no frame! [h264 @ 00000000004a29a0] no frame! [h264 @ 00000000004a29a0] no frame! [h264 @ 00000000004a29a0] no frame! [h264 @ 00000000004a29a0] no frame! [h264 @ 00000000004a29a0] no frame! -------------- next part -------------- An HTML attachment was scrubbed... URL: From salsaman at gmail.com Thu Aug 16 15:52:33 2012 From: salsaman at gmail.com (salsaman) Date: Thu, 16 Aug 2012 10:52:33 -0300 Subject: [Libav-user] Help with deprecated functions/members Message-ID: Hi, could somebody please tell me what I should do to replace the following deprecated functions/members, or point me to some documentation explaining the changes ? Also, if known, which version of the libs these functions/members were removed in. error: 'AVCodecContext' has no member named 'palctrl' warning: implicit declaration of function 'avcodec_init error: 'AVFormatContext' has no member named 'cur_st' error: 'AVStream' has no member named 'cur_pkt error: 'AVStream' has no member named 'cur_ptr' error: 'AVStream' has no member named 'cur_len' Thanks in advance, Salsaman. main developer, LiVES. http://lives.sourceforge.net https://www.ohloh.net/accounts/salsaman -------------- next part -------------- An HTML attachment was scrubbed... URL: From nitinkumgoyal at gmail.com Thu Aug 16 17:45:04 2012 From: nitinkumgoyal at gmail.com (NITIN GOYAL) Date: Thu, 16 Aug 2012 21:15:04 +0530 Subject: [Libav-user] Help with deprecated functions/members In-Reply-To: References: Message-ID: please mention the libav version you are currently using then only people will be able to tell you the differences. Also, please check the source code from GITHUB and compare the differences from the previous version to check out. Regards Nitin On Thu, Aug 16, 2012 at 7:22 PM, salsaman wrote: > error: 'AVCodecContext' has no member named 'palctrl' > -------------- next part -------------- An HTML attachment was scrubbed... URL: From salsaman at gmail.com Thu Aug 16 19:26:12 2012 From: salsaman at gmail.com (salsaman) Date: Thu, 16 Aug 2012 14:26:12 -0300 Subject: [Libav-user] Help with deprecated functions/members In-Reply-To: References: Message-ID: Thanks for the response. I am using various versions of the libs, for example: libavutil 51. 22. 1 / 51. 22. 1 libavcodec 53. 35. 0 / 53. 35. 0 libavformat 53. 21. 0 / 53. 21. 0 which compiles with the unchanged code. Looking at the latest versions of the decoders in the libs, it seems like palctrl has been moved into other structs, and that avcodec_init() and the other members have simply been removed. I don't know which versions of the libs have the problems, as the issue was reported by the LiVES packager for Fedora 18 and I am awaiting further info from him, but it would be whatever is included with ffmpeg 0.11.1 As I stated, I would like to know in which versions of the libs these changes were made if you have that information, so as I can #ifdef around them. Presumably there are other projects which need to do the same thing. And also if my changes are correct (removing avcodec_init() and no longer freeing avstream->curpkt seem particularly strange for example). None of this should require knowledge of the lib versions which I am using, just an awareness that some things have changed between an older version and the current version. Regards, Salsaman, main developer, LiVES. http://lives.sourceforge.net https://www.ohloh.net/accounts/salsaman On Thu, Aug 16, 2012 at 12:45 PM, NITIN GOYAL wrote: > please mention the libav version you are currently using then only people > will be able to tell you the differences. > > Also, please check the source code from GITHUB and compare the differences > from the previous version to check out. > > Regards > Nitin > > > On Thu, Aug 16, 2012 at 7:22 PM, salsaman wrote: > >> error: 'AVCodecContext' has no member named 'palctrl' >> > > > _______________________________________________ > 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 jcbfonseca at gmail.com Thu Aug 16 21:26:33 2012 From: jcbfonseca at gmail.com (Jorge Fonseca) Date: Thu, 16 Aug 2012 16:26:33 -0300 Subject: [Libav-user] AVFrame necessary fields to create correctly raw Frame Message-ID: Hi All, I have a C program using FFmpeg API that: - load bmp files and create a video file. Its works correctly. ------------- Now, i need to create the same video from a RAW data (char array). I allocating a frame, and try to set AVFrame directly... *Question: * - Which fields a need to fill? My current code is: * pFrameRaw = avcodec_alloc_frame(); if (!pFrameRaw) { printf("Can't allocate memory for AVFrame\n"); return NULL ; } // Determine required buffer size and allocate buffer int numBytes = avpicture_get_size(PIX_FMT_BGR24,FRAME_WIDTH, FRAME_HEIGHT); uint8_t *buffer = (uint8_t *) av_malloc(numBytes * sizeof(uint8_t)); avpicture_fill((AVPicture *) pFrameRaw, buffer, PIX_FMT_BGR24, **FRAME_WIDTH, FRAME_HEIGHT**); ** pFrameRaw->data[0] = raw_data_array; ** pFrameRaw->linesize[0] = FRAME_SIZE; * --------------------------- Regards, Jorge. -------------- next part -------------- An HTML attachment was scrubbed... URL: From salsaman at gmail.com Thu Aug 16 21:39:35 2012 From: salsaman at gmail.com (salsaman) Date: Thu, 16 Aug 2012 16:39:35 -0300 Subject: [Libav-user] Help with deprecated functions/members In-Reply-To: References: Message-ID: OK, so I got a reply back from the Fedora packager, the versions which require updated code are: libavutil 51. 54.100 / 51. 54.100 libavcodec 54. 23.100 / 54. 23.100 libavformat 54. 6.100 / 54. 6.100 so the changes must have occurred between the versions I gave earlier, and the above versions. Also, since posting the original message I have been contacted by the main developer of veejay (http://www.veejayhq.net), Niels Elburg, who tells me has exactly the same issues. So as I guessed, several projects are impacted by this. And I am mystifed as to what kind of design decisions went into this. For example, why remove avcodec_init() ? Since it returns nothing, if it is no longer needed, why not just remove the code from it and leave the empty function, and return a compiler deprecated warning ? That would be standard practice in most libraries as it retains backwards compatibility with existing code. Obviously someone had good reason to remove it completely but it is not apparent what the reasoning was. I am trying to understand this to help avoid similar problems in the future. Thanks in advance for any replies. Salsaman. main developer, LiVES. http://lives.sourceforge.net https://www.ohloh.net/accounts/salsaman On Thu, Aug 16, 2012 at 2:26 PM, salsaman wrote: > Thanks for the response. > > I am using various versions of the libs, for example: > > libavutil 51. 22. 1 / 51. 22. 1 > libavcodec 53. 35. 0 / 53. 35. 0 > libavformat 53. 21. 0 / 53. 21. 0 > > which compiles with the unchanged code. Looking at the latest versions of > the decoders in the libs, it seems like palctrl has been moved into other > structs, and that avcodec_init() and the other members have simply been > removed. I don't know which versions of the libs have the problems, as the > issue was reported by the LiVES packager for Fedora 18 and I am awaiting > further info from him, but it would be whatever is included with ffmpeg > 0.11.1 > > > As I stated, I would like to know in which versions of the libs these > changes were made if you have that information, so as I can #ifdef around > them. Presumably there are other projects which need to do the same thing. > And also if my changes are correct (removing avcodec_init() and no longer > freeing avstream->curpkt seem particularly strange for example). None of > this should require knowledge of the lib versions which I am using, just an > awareness that some things have changed between an older version and the > current version. > > > > > > > > > Regards, > Salsaman, > > main developer, LiVES. > > > http://lives.sourceforge.net > https://www.ohloh.net/accounts/salsaman > > > > On Thu, Aug 16, 2012 at 12:45 PM, NITIN GOYAL wrote: > >> please mention the libav version you are currently using then only people >> will be able to tell you the differences. >> >> Also, please check the source code from GITHUB and compare the >> differences from the previous version to check out. >> >> Regards >> Nitin >> >> >> On Thu, Aug 16, 2012 at 7:22 PM, salsaman wrote: >> >>> error: 'AVCodecContext' has no member named 'palctrl' >>> >> >> >> _______________________________________________ >> Libav-user mailing list >> Libav-user at ffmpeg.org >> http://ffmpeg.org/mailman/listinfo/libav-user >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mbradshaw at sorensonmedia.com Thu Aug 16 21:40:54 2012 From: mbradshaw at sorensonmedia.com (Michael Bradshaw) Date: Thu, 16 Aug 2012 13:40:54 -0600 Subject: [Libav-user] AVFrame necessary fields to create correctly raw Frame In-Reply-To: References: Message-ID: On Thu, Aug 16, 2012 at 1:26 PM, Jorge Fonseca wrote: > Hi All, > > I have a C program using FFmpeg API that: > - load bmp files and create a video file. > > Its works correctly. > > ------------- > > Now, i need to create the same video from a RAW data (char array). > I allocating a frame, and try to set AVFrame directly... > > Question: > > - Which fields a need to fill? > > My current code is: > > pFrameRaw = avcodec_alloc_frame(); > if (!pFrameRaw) { > printf("Can't allocate memory for AVFrame\n"); > return NULL ; > } > > > // Determine required buffer size and allocate buffer > int numBytes = avpicture_get_size(PIX_FMT_BGR24,FRAME_WIDTH, > FRAME_HEIGHT); > uint8_t *buffer = (uint8_t *) av_malloc(numBytes * sizeof(uint8_t)); Not sure if I understand the question, but this can be simplified if you use avpicture_alloc(). --Michael From jcbfonseca at gmail.com Thu Aug 16 21:51:14 2012 From: jcbfonseca at gmail.com (Jorge Fonseca) Date: Thu, 16 Aug 2012 16:51:14 -0300 Subject: [Libav-user] AVFrame necessary fields to create correctly raw Frame In-Reply-To: References: Message-ID: 2012/8/16 Michael Bradshaw > On Thu, Aug 16, 2012 at 1:26 PM, Jorge Fonseca > wrote: > > Hi All, > > > > I have a C program using FFmpeg API that: > > - load bmp files and create a video file. > > > > Its works correctly. > > > > ------------- > > > > Now, i need to create the same video from a RAW data (char array). > > I allocating a frame, and try to set AVFrame directly... > > > > Question: > > > > - Which fields a need to fill? > > > > My current code is: > > > > pFrameRaw = avcodec_alloc_frame(); > > if (!pFrameRaw) { > > printf("Can't allocate memory for AVFrame\n"); > > return NULL ; > > } > > > > > > // Determine required buffer size and allocate buffer > > int numBytes = avpicture_get_size(PIX_FMT_BGR24,FRAME_WIDTH, > > FRAME_HEIGHT); > > uint8_t *buffer = (uint8_t *) av_malloc(numBytes * > sizeof(uint8_t)); > > Not sure if I understand the question, but this can be simplified if > you use avpicture_alloc(). > Michael, Thanks.. And how to fill raw_data and correct format that will be used in the video encode? Only setting data and fmt fields? Jorge. > > --Michael > _______________________________________________ > 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 jcbfonseca at gmail.com Thu Aug 16 22:47:11 2012 From: jcbfonseca at gmail.com (Jorge Fonseca) Date: Thu, 16 Aug 2012 17:47:11 -0300 Subject: [Libav-user] AVFrame necessary fields to create correctly raw Frame In-Reply-To: References: Message-ID: > 2012/8/16 Michael Bradshaw > >> On Thu, Aug 16, 2012 at 1:26 PM, Jorge Fonseca >> wrote: >> > Hi All, >> > >> > I have a C program using FFmpeg API that: >> > - load bmp files and create a video file. >> > >> > Its works correctly. >> > >> > ------------- >> > >> > Now, i need to create the same video from a RAW data (char array). >> > I allocating a frame, and try to set AVFrame directly... >> > >> > Question: >> > >> > - Which fields a need to fill? >> > >> > My current code is: >> > >> > pFrameRaw = avcodec_alloc_frame(); >> > if (!pFrameRaw) { >> > printf("Can't allocate memory for AVFrame\n"); >> > return NULL ; >> > } >> > >> > >> > // Determine required buffer size and allocate buffer >> > int numBytes = avpicture_get_size(PIX_FMT_BGR24,FRAME_WIDTH, >> > FRAME_HEIGHT); >> > uint8_t *buffer = (uint8_t *) av_malloc(numBytes * >> sizeof(uint8_t)); >> >> Not sure if I understand the question, but this can be simplified if >> you use avpicture_alloc(). >> > > Michael, > Thanks.. > > And how to fill raw_data and correct format that will be used in the video > encode? Only setting data and fmt fields? > detailing more... Using *avpicture_alloc* or not, the error occurs when i try to scale to YUV format.. * img_convert_ctx = sws_getContext(FRAME_WIDTH, FRAME_HEIGHT, PIX_FMT_BGR24, FRAME_WIDTH, FRAME, PIX_FMT_YUV420P, SWS_BICUBIC, NULL, NULL, NULL ); sws_scale(img_convert_ctx, pFrameRaw->data, pFrameRaw->linesize, 0,FRAME_HEIGHT, tmp_picture->data, tmp_picture->linesize);* > Jorge. > >> >> --Michael >> _______________________________________________ >> 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 ivan.ushakov at gmail.com Sun Aug 19 09:01:34 2012 From: ivan.ushakov at gmail.com (Ivan Ushakov) Date: Sun, 19 Aug 2012 11:01:34 +0400 Subject: [Libav-user] H264 decoding problem Message-ID: Hello. I'm using libav for decoding h264 in my iOS application. This application also uses Live555 for RTSP stuff. I use following link for testing: *rtsp*://*184.72* .239.149/vod/mp4:BigBuckBunny_175k.mov When I get data from Live555 MediaSink I add 3 bytes (0x00 0x00 0x01) at the beginning and trying to decode it with libav. I got following errors: 2012-08-19 10:21:55.008 RTPlayer[333:12f03] Unknown NAL code: 28 (2350 bits) 2012-08-19 10:21:55.010 RTPlayer[333:12f03] no frame! 2012-08-19 10:21:55.108 RTPlayer[333:12f03] non-existing PPS 0 referenced 2012-08-19 10:21:55.109 RTPlayer[333:12f03] decode_slice_header error 2012-08-19 10:21:55.110 RTPlayer[333:12f03] no frame! 2012-08-19 10:21:55.110 RTPlayer[333:12f03] non-existing PPS 0 referenced 2012-08-19 10:21:55.111 RTPlayer[333:12f03] decode_slice_header error 2012-08-19 10:21:55.112 RTPlayer[333:12f03] no frame! ... 2012-08-19 10:21:56.572 RTPlayer[333:12f03] non-existing PPS 0 referenced 2012-08-19 10:21:56.572 RTPlayer[333:12f03] decode_slice_header error 2012-08-19 10:21:56.573 RTPlayer[333:12f03] Unknown NAL code: 29 (191 bits) 2012-08-19 10:21:56.574 RTPlayer[333:12f03] no frame! 2012-08-19 10:21:56.672 RTPlayer[333:12f03] non-existing PPS 0 referenced 2012-08-19 10:21:56.673 RTPlayer[333:12f03] decode_slice_header error 2012-08-19 10:21:56.674 RTPlayer[333:12f03] no frame! 2012-08-19 10:21:56.675 RTPlayer[333:12f03] non-existing PPS 0 referenced 2012-08-19 10:21:56.676 RTPlayer[333:12f03] decode_slice_header error 2012-08-19 10:21:56.677 RTPlayer[333:12f03] Partitioned H.264 support is incomplete 2012-08-19 10:21:56.678 RTPlayer[333:12f03] non-existing PPS 0 referenced 2012-08-19 10:21:56.679 RTPlayer[333:12f03] decode_slice_header error 2012-08-19 10:21:56.679 RTPlayer[333:12f03] no frame! And so on. Could somebody help me with this? Thank you -------------- next part -------------- An HTML attachment was scrubbed... URL: From cehoyos at ag.or.at Sun Aug 19 10:02:53 2012 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Sun, 19 Aug 2012 08:02:53 +0000 (UTC) Subject: [Libav-user] H264 decoding problem References: Message-ID: Ivan Ushakov writes: > I'm using libav for decoding h264 in my iOS application. > This application also uses Live555 for RTSP stuff. > > I use following link for testing: >?rtsp://184.72.239.149/vod/mp4:BigBuckBunny_175k.mov This works fine here with current git head without using live555 at all - which version are you using? > When I get data from Live555 MediaSink I add 3 bytes > (0x00 0x00 0x01) at the beginning and trying to decode > it with libav. I implemented this once for MPlayer - iirc you have to feed the data you receive to the H264 parser, see libmpdemux/demux_rtp.cpp in the MPlayer sources. But as said, this is outdated, FFmpeg now contains all the necessary code to receive above stream. Carl Eugen From ivan.ushakov at gmail.com Sun Aug 19 10:10:17 2012 From: ivan.ushakov at gmail.com (Ivan Ushakov) Date: Sun, 19 Aug 2012 12:10:17 +0400 Subject: [Libav-user] H264 decoding problem In-Reply-To: References: Message-ID: Thank you for your answer. Could you please tell me where I can see example of working with RTSP via ffmpeg only? 2012/8/19 Carl Eugen Hoyos > Ivan Ushakov writes: > > > I'm using libav for decoding h264 in my iOS application. > > This application also uses Live555 for RTSP stuff. > > > > I use following link for testing: > > rtsp://184.72.239.149/vod/mp4:BigBuckBunny_175k.mov > > This works fine here with current git head without > using live555 at all - which version are you using? > > > When I get data from Live555 MediaSink I add 3 bytes > > (0x00 0x00 0x01) at the beginning and trying to decode > > it with libav. > > I implemented this once for MPlayer - iirc you have to > feed the data you receive to the H264 parser, see > libmpdemux/demux_rtp.cpp in the MPlayer sources. > > But as said, this is outdated, FFmpeg now contains all > the necessary code to receive above stream. > > Carl Eugen > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > -------------- next part -------------- An HTML attachment was scrubbed... URL: From cehoyos at ag.or.at Sun Aug 19 12:57:01 2012 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Sun, 19 Aug 2012 10:57:01 +0000 (UTC) Subject: [Libav-user] H264 decoding problem References: Message-ID: Ivan Ushakov writes: > Could you please tell me where I can see example of > working with RTSP via ffmpeg only? I tested the following: $ ffplay rtsp://184.72.239.149/vod/mp4:BigBuckBunny_175k.mov So instead of passing a file-name, passing your Url should work fine (I suppose). Please do not top-post here, Carl Eugen From david.longest at apx-labs.com Mon Aug 20 20:35:45 2012 From: david.longest at apx-labs.com (David Longest) Date: Mon, 20 Aug 2012 18:35:45 +0000 Subject: [Libav-user] h263 frame rate Message-ID: Hello all, I am demuxing an h263 RTP stream and providing the raw h263 data to libav. The source of the stream is transmitting at 15fps. It seems no matter what I do, libavcodec and libavformat give me back a framerate and time stamp that results in ~30fps. I have tried adding the option "framerate", "1:15" to the dictionary sent in avformat_open_input(), but it does not change the result. The incorrect framerate and AVStream time_base cause my playback to stutter. What is the proper way to handle overriding the frame rate reported by libav? Thanks, David -------------- next part -------------- An HTML attachment was scrubbed... URL: From cehoyos at ag.or.at Mon Aug 20 23:24:06 2012 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Mon, 20 Aug 2012 21:24:06 +0000 (UTC) Subject: [Libav-user] h263 frame rate References: Message-ID: David Longest writes: > I am demuxing an h263 RTP stream and providing the raw > h263 data to libav. The source of the stream is > transmitting at 15fps. It seems no matter what I do, > libavcodec and libavformat give me back a framerate and > time stamp that results in ~30fps. I have tried adding > the option ?framerate?, ?1:15? to the dictionary sent in avformat_open_input(), but it does not change the result. > The incorrect framerate and AVStream time_base cause my > playback to stutter. Does it work with ffmpeg / ffplay ? (The applications?) > What is the proper way to handle overriding the frame > rate reported by libav? I don't think it is generally possible. Carl Eugen From krishnaks at iwavesystems.com Tue Aug 21 09:25:49 2012 From: krishnaks at iwavesystems.com (Krishna) Date: Tue, 21 Aug 2012 12:55:49 +0530 Subject: [Libav-user] H264 decoding problem In-Reply-To: References: Message-ID: I guess you need to pre-append SPS and PPS information (not only (0x00 0x00 0x01)) in the beginning of 1st frame. Decoder will use this information. From: Ivan Ushakov Sent: Sunday, August 19, 2012 12:31 PM To: libav-user at ffmpeg.org Subject: [Libav-user] H264 decoding problem Hello. I'm using libav for decoding h264 in my iOS application. This application also uses Live555 for RTSP stuff. I use following link for testing: rtsp://184.72.239.149/vod/mp4:BigBuckBunny_175k.mov When I get data from Live555 MediaSink I add 3 bytes (0x00 0x00 0x01) at the beginning and trying to decode it with libav. I got following errors: 2012-08-19 10:21:55.008 RTPlayer[333:12f03] Unknown NAL code: 28 (2350 bits) 2012-08-19 10:21:55.010 RTPlayer[333:12f03] no frame! 2012-08-19 10:21:55.108 RTPlayer[333:12f03] non-existing PPS 0 referenced 2012-08-19 10:21:55.109 RTPlayer[333:12f03] decode_slice_header error 2012-08-19 10:21:55.110 RTPlayer[333:12f03] no frame! 2012-08-19 10:21:55.110 RTPlayer[333:12f03] non-existing PPS 0 referenced 2012-08-19 10:21:55.111 RTPlayer[333:12f03] decode_slice_header error 2012-08-19 10:21:55.112 RTPlayer[333:12f03] no frame! ... 2012-08-19 10:21:56.572 RTPlayer[333:12f03] non-existing PPS 0 referenced 2012-08-19 10:21:56.572 RTPlayer[333:12f03] decode_slice_header error 2012-08-19 10:21:56.573 RTPlayer[333:12f03] Unknown NAL code: 29 (191 bits) 2012-08-19 10:21:56.574 RTPlayer[333:12f03] no frame! 2012-08-19 10:21:56.672 RTPlayer[333:12f03] non-existing PPS 0 referenced 2012-08-19 10:21:56.673 RTPlayer[333:12f03] decode_slice_header error 2012-08-19 10:21:56.674 RTPlayer[333:12f03] no frame! 2012-08-19 10:21:56.675 RTPlayer[333:12f03] non-existing PPS 0 referenced 2012-08-19 10:21:56.676 RTPlayer[333:12f03] decode_slice_header error 2012-08-19 10:21:56.677 RTPlayer[333:12f03] Partitioned H.264 support is incomplete 2012-08-19 10:21:56.678 RTPlayer[333:12f03] non-existing PPS 0 referenced 2012-08-19 10:21:56.679 RTPlayer[333:12f03] decode_slice_header error 2012-08-19 10:21:56.679 RTPlayer[333:12f03] no frame! And so on. Could somebody help me with this? Thank you -------------------------------------------------------------------------------- _______________________________________________ Libav-user mailing list Libav-user at ffmpeg.org http://ffmpeg.org/mailman/listinfo/libav-user -------------- next part -------------- An HTML attachment was scrubbed... URL: From fzanelli at tecnosens.it Tue Aug 21 16:13:11 2012 From: fzanelli at tecnosens.it (Zanelli Franco) Date: Tue, 21 Aug 2012 16:13:11 +0200 Subject: [Libav-user] avformat_find_stream_info memory leak Message-ID: I experienced that avformat_find_stream_info(), during the stream scan of an ip camera, has a strong memory leakage, maybe because it buffers the data to probe. Did someone experience the same problem? Is there a way to free the memory? thank you ps: this is my code: // format context AVFormatContext *fc = avformat_alloc_context(); params->clock = clock(); AVIOInterruptCB int_cb = {interrupt_cb, params}; fc->interrupt_callback = int_cb; // options. Es. rtsp_transport tcp AVDictionary *opts = 0; if (jopts != NULL) { int stringCount = (*env)->GetArrayLength(env, jopts); int i; for (i = 0; i < stringCount; i += 2) { jstring jopt = (jstring) (*env)->GetObjectArrayElement(env, jopts, i); jstring jval = (jstring) (*env)->GetObjectArrayElement(env, jopts, i + 1); const char *opt = (*env)->GetStringUTFChars(env, jopt, 0); const char *val = (*env)->GetStringUTFChars(env, jval, 0); av_dict_set(&opts, opt, val, 0); } } // start the input stream int res; res = avformat_open_input(&fc, url, 0, &opts); if (res != 0) { char response[2048]; av_strerror(res, response, sizeof (response)); printlog(LOG_TYPE_ERROR, dec_id, "av_format_open_input: %s", response); return res; } // stream info res = avformat_find_stream_info(fc, &opts); if (!(res >= 0)) { char response[2048]; av_strerror(res, response, sizeof (response)); printlog(LOG_TYPE_ERROR, dec_id, "avformat_find_stream_info: %s", response); avformat_free_context(fc); return res; } .... From olivier.durecu at gmail.com Wed Aug 22 08:41:13 2012 From: olivier.durecu at gmail.com (=?ISO-8859-1?Q?Olivier_Dur=E9cu?=) Date: Wed, 22 Aug 2012 08:41:13 +0200 Subject: [Libav-user] RTMP streaming / sound but no video Message-ID: Hi all, I have written a C program (working fine) that captures audio and video and encode them in a FLV container (H264/MP3). I get a FLV file which is OK Now I would like to be able to stream in RTMP the encoded audio and video instead of creating a local file. So when creating my AVFormatContext, I simply put in the filename attribute the RTMP url where I want to stream (rtmp://localhost:1935/live/mystream) I see audio and video RTMP packets sent to the server. The sound works fine but the video not. I get a black screen on server side. If I use ffmpeg program from command line to stream one of my FLV file, everything works fine... Does anyone know if there are some additional properties / flags to set in the container / video stream / H264 encoder to have the video streaming fine in RTMP ? My whole chain works since I am able to produce a local FLV file. I can't understand why the RTMP video packets produced can't be shown on server side [image: :-(] (I am using red5 1.0.0 RC2 whose logs don't show any error...) Thanks for any help -------------- next part -------------- An HTML attachment was scrubbed... URL: From andrey.krieger.utkin at gmail.com Wed Aug 22 15:58:43 2012 From: andrey.krieger.utkin at gmail.com (Andrey Utkin) Date: Wed, 22 Aug 2012 16:58:43 +0300 Subject: [Libav-user] avformat_find_stream_info memory leak In-Reply-To: References: Message-ID: 2012/8/21 Zanelli Franco : > ps: this is my code: Please minimize your code. -- Andrey Utkin From fzanelli at tecnosens.it Wed Aug 22 16:09:28 2012 From: fzanelli at tecnosens.it (Zanelli Franco) Date: Wed, 22 Aug 2012 16:09:28 +0200 Subject: [Libav-user] avformat_find_stream_info memory leak In-Reply-To: References: Message-ID: I experienced that avformat_find_stream_info(), during the stream scan of an ip camera, has a strong memory leakage, maybe because it buffers the data to probe. Did someone experience the same problem? Is there a way to free the memory? thank you ps: this is my code: // format context AVFormatContext *fc = avformat_alloc_context(); // start the input stream int res; res = avformat_open_input(&fc, url, 0, &opts); if (res != 0) { return res; } // stream info res = avformat_find_stream_info(fc, &opts); if (!(res >= 0)) { return res; } Il 22/08/2012 15:58, Andrey Utkin ha scritto: > 2012/8/21 Zanelli Franco : >> ps: this is my code: > Please minimize your code. > From cyrilapan at yahoo.fr Sat Aug 25 20:20:35 2012 From: cyrilapan at yahoo.fr (cyril apan) Date: Sat, 25 Aug 2012 19:20:35 +0100 (BST) Subject: [Libav-user] How to retrieve cover arts from mp4 or mkv files Message-ID: <1345918835.13104.YahooMailNeo@web29504.mail.ird.yahoo.com> Hi there, Can anybody show me a sample on the best way to retrieve cover arts from mp4 or mkv files using libav? I found out that the AVStream structure has a AVPacket?attached_pic field, but also that the streams field of the AVFormatContext structure can contain a stream of type AVMEDIA_TYPE_ATTACHMENT. I'm not sure to see what's the difference of use between both, but at the end I want to get a bitmap of the cover art or the p?cture in its original format and what is the format (if it's jpeg, gif, png or something else). Thanks for the help. Cyril. -------------- next part -------------- An HTML attachment was scrubbed... URL: From rizwan.raza at gmail.com Sun Aug 26 00:48:22 2012 From: rizwan.raza at gmail.com (Rizwan Raza) Date: Sat, 25 Aug 2012 17:48:22 -0500 Subject: [Libav-user] convert to OGV format Message-ID: I need to convert to OGV format from MP4 format. Does ffmpeg supports converting to this format? Thanks in advance -------------- next part -------------- An HTML attachment was scrubbed... URL: From cehoyos at ag.or.at Sun Aug 26 09:05:07 2012 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Sun, 26 Aug 2012 07:05:07 +0000 (UTC) Subject: [Libav-user] convert to OGV format References: Message-ID: Rizwan Raza writes: > I need to convert to OGV format from MP4 format. Did you try the following? $ ffmpeg -i input.mp4 out.ogv Carl Eugen From mm26859 at gmail.com Sun Aug 26 12:49:50 2012 From: mm26859 at gmail.com (mm26859 at gmail.com) Date: Sun, 26 Aug 2012 12:49:50 +0200 Subject: [Libav-user] avconv mjpeg vfr input Message-ID: <5039FF4E.3090609@gmail.com> hi i have a http mjpeg VFR stream from camera, i would like to store it with proper PTS. using -vcodec copy , into mp4 or mkv. after many tries, i think that the mjpeg decoder does not set PTS correctly. i have tried -vsync vfr , but everytime avconv sets a CFR in output. is there any way to preserve VFR ? thank you Mike. From cehoyos at ag.or.at Sun Aug 26 13:15:01 2012 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Sun, 26 Aug 2012 11:15:01 +0000 (UTC) Subject: [Libav-user] avconv mjpeg vfr input References: <5039FF4E.3090609@gmail.com> Message-ID: mm26859 at ... writes: > i have a http mjpeg VFR stream from camera, i would like to > store it with proper PTS. using -vcodec copy , into mp4 or mkv. > after many tries, i think that the mjpeg decoder does not set > PTS correctly. i have tried -vsync vfr , but everytime avconv > sets a CFR in output. Please note that avconv is known to contain several hundred regressions over ffmpeg, some of them possibly security relevant, so it cannot be supported here. > is there any way to preserve VFR ? This does not work for mp4, but I believe it should work for other containers, please add (ffmpeg) command line together with complete, uncut console output. Carl Eugen From mm26859 at gmail.com Sun Aug 26 14:10:45 2012 From: mm26859 at gmail.com (mm26859 at gmail.com) Date: Sun, 26 Aug 2012 14:10:45 +0200 Subject: [Libav-user] avconv mjpeg vfr input In-Reply-To: References: <5039FF4E.3090609@gmail.com> Message-ID: <503A1245.8000009@gmail.com> D?a 26.08.2012 13:15, Carl Eugen Hoyos wrote / nap?sal(a): > Please note that avconv is known to contain several hundred > regressions over ffmpeg, some of them possibly security relevant, so > it cannot be supported here. my mistake > >> is there any way to preserve VFR ? > This does not work for mp4, but I believe it should work > for other containers, please add (ffmpeg) command line > together with complete, uncut console output. btw. mp4 generally supports vfr (vlc works) so i installed the ffmpeg from ppa jon-severinsson the end result is , that the ouput is CFR ,but expected is VFR the resulting file has length 10:00 but it has frames from much longer input cca. 18s ffmpeg -analyzeduration 0 -f mjpeg -i "http://ip/videostream.cgi?user=admin&pwd=&resolution=32&rate=0" -vsync vfr -t 10:00 -vcodec copy -y output.mkv output: WARNING: gnome-keyring:: couldn't connect to: /tmp/keyring-QCVqZz/pkcs11: No such file or directory ffmpeg version 0.10.4-6:0.10.4-0ubuntu0jon2 Copyright (c) 2000-2012 the FFmpeg developers built on Jun 12 2012 23:02:05 with gcc 4.6.3 configuration: --extra-version='6:0.10.4-0ubuntu0jon2' --arch=amd64 --prefix=/usr --libdir=/usr/lib/x86_64-linux-gnu --disable-stripping --enable-vaapi --enable-vdpau --enable-bzlib --enable-gnutls --enable-libgsm --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-pthreads --enable-zlib --enable-libvpx --enable-runtime-cpudetect --enable-libfreetype --enable-libpulse --enable-vaapi --enable-librtmp --enable-gpl --enable-postproc --enable-x11grab --enable-libcdio --enable-version3 --enable-libdc1394 --shlibdir=/usr/lib/x86_64-linux-gnu --enable-shared --disable-static avutil configuration: --extra-version='6:0.10.4.0ubuntu0jon2.2' --arch=amd64 --prefix=/usr --libdir=/usr/lib/x86_64-linux-gnu --disable-stripping --enable-vaapi --enable-vdpau --enable-bzlib --enable-gnutls --enable-libgsm --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-pthreads --enable-zlib --enable-libvpx --enable-runtime-cpudetect --enable-libfreetype --enable-libpulse --enable-vaapi --enable-libopenjpeg --enable-libmp3lame --enable-librtmp --enable-frei0r --enable-libopencv --enable-gpl --enable-postproc --enable-x11grab --enable-libcdio --enable-libx264 --enable-version3 --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libdc1394 --shlibdir=/usr/lib/x86_64-linux-gnu --enable-shared --disable-static swresample configuration: --extra-version='6:0.10.4.0ubuntu0jon2.2' --arch=amd64 --prefix=/usr --libdir=/usr/lib/x86_64-linux-gnu --disable-stripping --enable-vaapi --enable-vdpau --enable-bzlib --enable-gnutls --enable-libgsm --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-pthreads --enable-zlib --enable-libvpx --enable-runtime-cpudetect --enable-libfreetype --enable-libpulse --enable-vaapi --enable-libopenjpeg --enable-libmp3lame --enable-librtmp --enable-frei0r --enable-libopencv --enable-gpl --enable-postproc --enable-x11grab --enable-libcdio --enable-libx264 --enable-version3 --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libdc1394 --shlibdir=/usr/lib/x86_64-linux-gnu --enable-shared --disable-static libavutil 51. 35.100 / 51. 35.100 libavcodec 53. 61.100 / 53. 61.100 libavformat 53. 32.100 / 53. 32.100 libavdevice 53. 4.100 / 53. 4.100 libavfilter 2. 61.100 / 2. 61.100 libswscale 2. 1.100 / 2. 1.100 libswresample 0. 6.100 / 0. 6.100 libpostproc 52. 0.100 / 52. 0.100 [mjpeg @ 0x815440] max_analyze_duration 0 reached at 0 [mjpeg @ 0x815440] Estimating duration from bitrate, this may be inaccurate Input #0, mjpeg, from 'http://ip/videostream.cgi?user=admin&pwd=&resolution=32&rate=0': Duration: N/A, bitrate: N/A Stream #0:0: Video: mjpeg, yuvj422p, 640x480, 25 tbr, 1200k tbn, 25 tbc Output #0, matroska, to 'output.mkv': Metadata: encoder : Lavf53.32.100 Stream #0:0: Video: mjpeg, yuvj422p, 640x480, q=2-31, 1k tbn, 1200k tbc Stream mapping: Stream #0:0 -> #0:0 (copy) Press [q] to stop, [?] for help frame= 250 fps= 13 q=-1.0 Lsize= 9973kB time=00:00:09.96 bitrate=8202.4kbits/s video:9962kB audio:0kB global headers:0kB muxing overhead 0.102927% thanks for help. M. From mm26859 at gmail.com Sun Aug 26 14:23:43 2012 From: mm26859 at gmail.com (mm26859 at gmail.com) Date: Sun, 26 Aug 2012 14:23:43 +0200 Subject: [Libav-user] avconv mjpeg vfr input In-Reply-To: References: <5039FF4E.3090609@gmail.com> Message-ID: <503A154F.3030808@gmail.com> just found out that this has an open bug: http://ffmpeg.org/trac/ffmpeg/ticket/730 M. From wagner.patriota at gmail.com Mon Aug 27 12:54:14 2012 From: wagner.patriota at gmail.com (Wagner Patriota) Date: Mon, 27 Aug 2012 07:54:14 -0300 Subject: [Libav-user] Conversion of PTS from MP4 to MPEG2-TS Message-ID: I am studying how PTS/DTS works and therefore making some tests with transmuxers... I would like to understand how ffmpeg converts the PTS from an MP4 to a MPEG2-TS The ffmpeg transmux (-vcodec copy) does this conversion: What is the formula for this conversion? (probably with exception for the first PTS, that seems to have no sense for MP4 case) *MP4 MPEG2-TS* 1.84467E+19 126000 2000 141015 1000 137261 4000 148523 3000 144769 6000 156030 5000 152276 8000 163538 7000 159784 10000 171045 9000 167291 12000 178553 11000 174799 14000 186060 13000 182306 16000 193568 15000 189814 18000 201075 17000 197321 20000 208583 19000 204829 22000 216090 ... ... -------------- next part -------------- An HTML attachment was scrubbed... URL: From andrey.krieger.utkin at gmail.com Mon Aug 27 16:05:31 2012 From: andrey.krieger.utkin at gmail.com (Andrey Utkin) Date: Mon, 27 Aug 2012 17:05:31 +0300 Subject: [Libav-user] Conversion of PTS from MP4 to MPEG2-TS In-Reply-To: References: Message-ID: 2012/8/27 Wagner Patriota : > What is the formula for this conversion? (probably with exception for the > first PTS, that seems to have no sense for MP4 case) Tthere's a concept of "timebase". MPEG-TS has timebase of 1/90000 (90 kHz), thus 90000 units of dts/pts represent 1 second. I don't remember same about MP4. You can convert timestamps from one timebase to another, using function av_rescale_q(). -- Andrey Utkin From fzanelli at tecnosens.it Mon Aug 27 16:19:25 2012 From: fzanelli at tecnosens.it (Zanelli Franco) Date: Mon, 27 Aug 2012 16:19:25 +0200 Subject: [Libav-user] avformat_find_stream_info memory leak In-Reply-To: References: Message-ID: Did someone experience this problem? Thank you Il 22/08/2012 16:09, Zanelli Franco ha scritto: > I experienced that avformat_find_stream_info(), during the stream scan > of an ip camera, has a strong memory leakage, maybe because it buffers > the data to probe. Did someone experience the same problem? Is there a > way to free the memory? > > thank you > > ps: this is my code: > > // format context > AVFormatContext *fc = avformat_alloc_context(); > > // start the input stream > int res; > res = avformat_open_input(&fc, url, 0, &opts); > if (res != 0) { > return res; > } > > // stream info > res = avformat_find_stream_info(fc, &opts); > if (!(res >= 0)) { > return res; > } > > > > Il 22/08/2012 15:58, Andrey Utkin ha scritto: >> 2012/8/21 Zanelli Franco : >>> ps: this is my code: >> Please minimize your code. >> > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user From andrey.krieger.utkin at gmail.com Mon Aug 27 16:33:33 2012 From: andrey.krieger.utkin at gmail.com (Andrey Utkin) Date: Mon, 27 Aug 2012 17:33:33 +0300 Subject: [Libav-user] avformat_find_stream_info memory leak In-Reply-To: References: Message-ID: What you posted second time looks sane as is. There sometimes happen a leak here and there, including avformat_find_stream_info(), but not such to be named as "strong". It can be more chances your usage of API introduces leak. What i'd advice is to check your whole app with Valgrind memory debugger. Valgrind will show you exact places of leak. If you cannot eliminate leaks in your application in such way, then make up minimal app that uses ffmpeg API _the same way your app does_, that reproduces the same valgrind output, and publish it in this maillist. -- Andrey Utkin From chinos at microrapid.com Mon Aug 27 16:01:05 2012 From: chinos at microrapid.com (=?ISO-8859-1?B?Y2hpbm9z?=) Date: Mon, 27 Aug 2012 22:01:05 +0800 Subject: [Libav-user] Conversion of PTS from MP4 to MPEG2-TS Message-ID: MPEGTS is based on 90 kHz clock. In your example, the fps of the stream is computed as follow: 1/((141015-137261)/90000) = 24fps but i am confused why PTS of TS is always not started at 0. could anyone explain it to me? ------------------ Original ------------------ From: "Wagner Patriota"; Date: Mon, Aug 27, 2012 06:54 PM To: "This list is about using libavcodec, libavformat, libavutil,libavdevice and libavfilter."; Subject: [Libav-user] Conversion of PTS from MP4 to MPEG2-TS I am studying how PTS/DTS works and therefore making some tests with transmuxers... I would like to understand how ffmpeg converts the PTS from an MP4 to a MPEG2-TS The ffmpeg transmux (-vcodec copy) does this conversion: What is the formula for this conversion? (probably with exception for the first PTS, that seems to have no sense for MP4 case) MP4 MPEG2-TS 1.84467E+19 126000 2000 141015 1000 137261 4000 148523 3000 144769 6000 156030 5000 152276 8000 163538 7000 159784 10000 171045 9000 167291 12000 178553 11000 174799 14000 186060 13000 182306 16000 193568 15000 189814 18000 201075 17000 197321 20000 208583 19000 204829 22000 216090 ... ... -------------- next part -------------- An HTML attachment was scrubbed... URL: From andrey.krieger.utkin at gmail.com Tue Aug 28 00:01:02 2012 From: andrey.krieger.utkin at gmail.com (Andrey Utkin) Date: Tue, 28 Aug 2012 01:01:02 +0300 Subject: [Libav-user] Conversion of PTS from MP4 to MPEG2-TS In-Reply-To: References: Message-ID: 2012/8/27 chinos : > but i am confused why PTS of TS is always not started at 0. could anyone > explain it to me? Depends on source of a file. Often TS is originated from continuous broadcasted stream, and obviously it is a cut from the middle, thus timestamps do not start from zero. -- Andrey Utkin From andrey.krieger.utkin at gmail.com Tue Aug 28 20:47:56 2012 From: andrey.krieger.utkin at gmail.com (Andrey Utkin) Date: Tue, 28 Aug 2012 21:47:56 +0300 Subject: [Libav-user] Interrupt network wait in av_read_frame() to seek Message-ID: We implement a player using libavformat. Player reads MPEGTS streams via protocols HLS and HTTP. Application calls av_read_frame() as usual; note that this call is blocking due to network delays. Let's imagine that app has stuck inside av_read_frame() for long time, and at this time user wants to seek on the stream to particular place. It would be perfect to interrupt the read and proceed with seeking immediately. What is elegant solution to do this without delay? What we have thought about so far: 1. Interrupt the protocol reader using avio callback, and reopen the stream. Not an option, huge delay for reopen. 2. Fire the interrupt using avio callback, and then proceed working on opened stream. It is an abuse of interrupt callback concept and should not work theoretically. 3. Non-blocking demuxing (*_FLAG_NONBLOCK). Seems under construction. Don't see mentions of these flags neither in http protocol driver, nor in hls, mpegts demuxers. -- Andrey Utkin From mark.kenna at sureviewsystems.com Wed Aug 29 17:53:03 2012 From: mark.kenna at sureviewsystems.com (Mark Kenna) Date: Wed, 29 Aug 2012 16:53:03 +0100 Subject: [Libav-user] MOOV Atom Not Found Message-ID: Hi Guys I am wondering how it is possible to play streamed MP4 files that are produced by FFMpeg - it seems as though AV* puts the MOOV atom at the end of the file which means that the entire file would have to be downloaded before the video can be played. What I am trying to achieve is a kind of http-streaming where the video is played as soon as possible. Can someone tell me how a conversion for live streaming is possible? Also, I would be doing the file conversion dynamically in memory which means that I cannot just encode a file, re-position the MOOV atom and then stream. Thanks, Mark. -------------- next part -------------- An HTML attachment was scrubbed... URL: From cehoyos at ag.or.at Wed Aug 29 22:17:37 2012 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Wed, 29 Aug 2012 20:17:37 +0000 (UTC) Subject: [Libav-user] MOOV Atom Not Found References: Message-ID: Mark Kenna writes: > I am wondering how it is possible to play streamed MP4 files > that are produced by FFMpeg - it seems as though AV* puts the > MOOV atom at the end of the file which means that the entire > file would have to be downloaded before the video can be played. FFmpeg comes with a tool to move the moov atom: tools/qt-faststart Carl Eugen From mark.kenna at sureviewsystems.com Wed Aug 29 22:31:24 2012 From: mark.kenna at sureviewsystems.com (Mark Kenna) Date: Wed, 29 Aug 2012 21:31:24 +0100 Subject: [Libav-user] MOOV Atom Not Found In-Reply-To: References: Message-ID: <2943363885602405226@unknownmsgid> On 29 Aug 2012, at 21:20, Carl Eugen Hoyos wrote: > Mark Kenna writes: > >> I am wondering how it is possible to play streamed MP4 files >> that are produced by FFMpeg - it seems as though AV* puts the >> MOOV atom at the end of the file which means that the entire >> file would have to be downloaded before the video can be played. > > FFmpeg comes with a tool to move the moov atom: > tools/qt-faststart > > Carl Eugen > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user But for that you would have to have encoded the entire file before streaming right? I need to stream as I'm encoding so there will never be a physical file. I'm not sure of the usage of this tool - would that still work? Thanks, Mark. From eclipse7 at gmx.net Wed Aug 29 23:45:03 2012 From: eclipse7 at gmx.net (Alexander Strasser) Date: Wed, 29 Aug 2012 23:45:03 +0200 Subject: [Libav-user] Autumn Website Banner Contest Message-ID: <20120829214503.GA7271@akuma> Hi all, the contest for the FFmpeg autumn website banner is in progress. Please read the details on our website: http://ffmpeg.org/index.html#logo_art_contest_autumn-2012 P.S. Please excuse this email if you are not interested in artwork related to the FFmpeg project. From radford.parker at gmail.com Thu Aug 30 01:42:44 2012 From: radford.parker at gmail.com (Radford Parker) Date: Wed, 29 Aug 2012 16:42:44 -0700 (PDT) Subject: [Libav-user] UDP Stream Read Pixelation/Macroblock Corruption In-Reply-To: <1340722218338-4655294.post@n4.nabble.com> References: <1340650759048-4655270.post@n4.nabble.com> <1340722218338-4655294.post@n4.nabble.com> Message-ID: <1346283764458-4655609.post@n4.nabble.com> Just saw that I never mentioned the outcome of this. I ended up switching completely to libvlc and had none of the aforementioned problems. -- View this message in context: http://libav-users.943685.n4.nabble.com/UDP-Stream-Read-Pixelation-Macroblock-Corruption-tp4655270p4655609.html Sent from the libav-users mailing list archive at Nabble.com. From phpdev at ehrhardt.nl Thu Aug 30 00:49:43 2012 From: phpdev at ehrhardt.nl (Jan Ehrhardt) Date: Thu, 30 Aug 2012 00:49:43 +0200 Subject: [Libav-user] MOOV Atom Not Found References: <2943363885602405226@unknownmsgid> Message-ID: Mark Kenna in gmane.comp.video.ffmpeg.libav.user (Wed, 29 Aug 2012 21:31:24 +0100): >But for that you would have to have encoded the entire file before >streaming right? I need to stream as I'm encoding so there will never >be a physical file. qt-faststart, mp4box -inter nnn and mp4creator -optimize all do more or less the same on transcoded files. You might take a look at http://stackoverflow.com/questions/8616855/how-to-output-fragmented-mp4-with-ffmpeg/9734251#9734251 Jan From xhpohanka at gmail.com Thu Aug 30 08:34:06 2012 From: xhpohanka at gmail.com (Jan Pohanka) Date: Thu, 30 Aug 2012 08:34:06 +0200 Subject: [Libav-user] how to use own buffers for input data with av_read_frame() Message-ID: Hello, I'm implementing support for hardware video decoder on DM365 and I have some problems with buffers. I have simple testing application with following code (simplified) ... avformat_open_input(&fctx, filename, NULL, NULL); ... av_find_stream_info(fctx); ... codec = avcodec_find_decoder_by_name("libdm365_h264"); ... ret = avcodec_open(avctx, codec) ... picture = avcodec_alloc_frame(); ... for (i = 0; i < 500; i++) { int nb; char fname[32]; if (av_read_frame(fctx, &pkt) < 0) break; nb = avcodec_decode_video2(avctx, picture, &got_pic, &pkt); if (nb < 0) { av_log(avctx, AV_LOG_ERROR, "error in decoding\n"); goto decode_cleanup; } printf("Decoded frame: %d\n", i); sprintf(fname, "frame%02d.jpg", i); save_image(picture, avctx->pix_fmt, avctx->width, avctx->height, fname); } The problem is that the decoder needs to have both input and output data in a buffer which is continuous in physical memory. I can fulfill this constraint for the output data (AVFrame *picture) because the buffer is allocated by codec itself so I can use my own allocator there. Unfortunately I do not know how to handle data of AVPacktet pkt, which are filled in by av_read_frame() - these are allocated by av_malloc which fallbacks to malloc and the buffers probably won't be continuous. I see two solutions here, but I'm not happy with neither of them: - copy the whole packet to the continuous buffer (but this will significantly slower the application) - provide own av_malloc wrapper that will use my own allocator (many things from libav* internals will be also allocated there and this is not exactly what I want) Do please someone know some more elegant solution? with best regards Jan -- Tato zpr?va byla vytvo?ena p?evratn?m po?tovn?m klientem Opery: http://www.opera.com/mail/ From mark.kenna at sureviewsystems.com Thu Aug 30 09:41:48 2012 From: mark.kenna at sureviewsystems.com (Mark Kenna) Date: Thu, 30 Aug 2012 08:41:48 +0100 Subject: [Libav-user] MOOV Atom Not Found In-Reply-To: References: <2943363885602405226@unknownmsgid> Message-ID: <-1442068983148223900@unknownmsgid> On 30 Aug 2012, at 01:10, Jan Ehrhardt wrote: > Mark Kenna in gmane.comp.video.ffmpeg.libav.user (Wed, 29 Aug 2012 > 21:31:24 +0100): >> But for that you would have to have encoded the entire file before >> streaming right? I need to stream as I'm encoding so there will never >> be a physical file. > > qt-faststart, mp4box -inter nnn and mp4creator -optimize all do more or > less the same on transcoded files. You might take a look at > > http://stackoverflow.com/questions/8616855/how-to-output-fragmented-mp4-with-ffmpeg/9734251#9734251 > > Jan > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user Surely all these tools require a pre-encoded file as input? I would need to do it on the fly so the moon atom would have to exist just after the write header stage. Mark. From mark.kenna at sureviewsystems.com Thu Aug 30 10:11:42 2012 From: mark.kenna at sureviewsystems.com (Mark Kenna) Date: Thu, 30 Aug 2012 09:11:42 +0100 Subject: [Libav-user] MOOV Atom Not Found In-Reply-To: <-1442068983148223900@unknownmsgid> References: <2943363885602405226@unknownmsgid> <-1442068983148223900@unknownmsgid> Message-ID: On 30 August 2012 08:41, Mark Kenna wrote: > On 30 Aug 2012, at 01:10, Jan Ehrhardt wrote: > > > Mark Kenna in gmane.comp.video.ffmpeg.libav.user (Wed, 29 Aug 2012 > > 21:31:24 +0100): > >> But for that you would have to have encoded the entire file before > >> streaming right? I need to stream as I'm encoding so there will never > >> be a physical file. > > > > qt-faststart, mp4box -inter nnn and mp4creator -optimize all do more or > > less the same on transcoded files. You might take a look at > > > > > http://stackoverflow.com/questions/8616855/how-to-output-fragmented-mp4-with-ffmpeg/9734251#9734251 > > > > Jan > > > > _______________________________________________ > > Libav-user mailing list > > Libav-user at ffmpeg.org > > http://ffmpeg.org/mailman/listinfo/libav-user > > Surely all these tools require a pre-encoded file as input? I would > need to do it on the fly so the moon atom would have to exist just > after the write header stage. > > Mark. > Also - I have tried the "-movflags empty_moov" but it seems that FFMpeg does not actually write the output until the entire input is decoded (which would not work with live streaming). I then tried adding the "frag_keyframe" but that results in a file that is unplayable. Mark. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mark.kenna at sureviewsystems.com Thu Aug 30 12:57:36 2012 From: mark.kenna at sureviewsystems.com (Mark Kenna) Date: Thu, 30 Aug 2012 11:57:36 +0100 Subject: [Libav-user] RTSP Data Stream Message-ID: Hi Guys In a *very* old version of FFMpeg I can play an RTSP stream which has 3 streams: 0.1-CODEC_TYPE_VIDEO, 0.2-CODEC_TYPE_AUDIO, 0.3-CODEC_TYPE_DATA. In never versions I cannot see the CODEC_TYPE_DATA stream anymore, I have also tried using -allowed_media_types data+video+audio with no joy. I have included the output shown in FFProbe so if someone could suggest how to resolve the issue? C:\Immix\SureView.Media\FFMPEG\ffmpeg-20120608-git-718607b-win32-shared\bin>ffprobe > -loglevel debug rtsp://lab:9553/lowQ.sdp -rtsp_transport tcp > -allowed_media_types data+video+audio > ffprobe version N-41416-g718607b Copyright (c) 2007-2012 the FFmpeg > developers > built on Jun 8 2012 12:47:57 with gcc 4.6.3 > configuration: --disable-static --enable-shared --enable-gpl > --enable-version3 --disable-w32threads --enable-runtime-cpudetect > --enable-avisynth --enable-bzlib --enable-frei0r --enable-libass > --enable-libcelt --enable-libopencore-amrnb --enable-libopencore-amrwb > --enable-libfreetype --enable-libgsm --enable-libmp3lame --enable-libnut > --enable-libopenjpeg --enable-librtmp --enable-libschroedinger > --enable-libspeex --enable-libtheora --enable-libutvideo > --enable-libvo-aacenc --enable-libvo-amrwb > enc --enabl libavutil 51. 56.100 / 51. 56.100 > libavcodec 54. 25.100 / 54. 25.100 > libavformat 54. 6.101 / 54. 6.101 > libavdevice 54. 0.100 / 54. 0.100 > libavfilter 2. 78.101 / 2. 78.101 > libswscale 2. 1.100 / 2. 1.100 > libswresample 0. 15.100 / 0. 15.100 > libpostproc 52. 0.100 / 52. 0.100 > [rtsp @ 01e70580] SDP: > v=0 > o=- 1346318325550197 1346318325550204 IN IP4 127.0.0.1 > s=lowQ > e=NONE > c=IN IP4 0.0.0.0 > b=RR:0 > t=0 0 > a=control:* > m=video 0 RTP/AVP 96 > b=AS:100 > a=framerate:5 > a=rtpmap:96 H264/90000 > a=fmtp:96 profile-level-id=42001e; > sprop-parameter-sets=Z0IAHqtAWB7I,aM44gA==; packetization-mode=1 > a=control:trackID=1 > m=control 0 RTP/AVP 98 > a=rtpmap:98 X-HREF/90000 > a=control:trackID=2 > m=audio 0 RTP/AVP 0 > b=AS:64 > a=rtpmap:0 PCMU/8000 > a=control:trackID=3 > > [rtsp @ 01e70580] video codec set to: h264 > [NULL @ 01e789a0] RTP Profile IDC: 42 Profile IOP: 0 Level: 1e > [NULL @ 01e789a0] Extradata set to 01e78e00 (size: 21)! > [NULL @ 01e789a0] RTP Packetization Mode: 1 > [rtsp @ 01e70580] audio codec set to: pcm_mulaw > [rtsp @ 01e70580] audio samplerate set to: 8000 > [rtsp @ 01e70580] audio channels set to: 1 > [rtsp @ 01e70580] hello state=0 > [h264 @ 01e789a0] Missing reference picture > [h264 @ 01e789a0] decode_slice_header error > [h264 @ 01e789a0] concealing 1320 DC, 1320 AC, 1320 MV errors > [rtsp @ 01e70580] All info found > rfps: 5.000000 0.004265 > rfps: 5.083333 0.004937 > rfps: 10.000000 0.017062 > rfps: 10.083333 0.009311 > rfps: 10.166667 0.019748 > rfps: 19.833333 0.011241 > rfps: 19.916667 0.011828 > rfps: 24.833333 0.010190 > Last message repeated 1 times > rfps: 24.916667 0.002354 > rfps: 25.000000 0.012707 > Last message repeated 1 times > rfps: 29.833333 0.017670 > Last message repeated 1 times > rfps: 29.916667 0.001411 > Last message repeated 1 times > rfps: 30.000000 0.003341 > Last message repeated 1 times > rfps: 34.916667 0.008999 > Last message repeated 1 times > rfps: 35.000000 0.002506 > rfps: 35.083333 0.014202 > Last message repeated 1 times > rfps: 40.000000 0.010202 > rfps: 40.083333 0.013476 > rfps: 49.750000 0.015994 > rfps: 49.833333 0.009416 > rfps: 54.750000 0.018265 > Last message repeated 1 times > rfps: 54.833333 0.003264 > rfps: 54.916667 0.006453 > Last message repeated 1 times > rfps: 59.833333 0.005644 > Last message repeated 1 times > rfps: 59.916667 0.000410 > Last message repeated 1 times > rfps: 29.970030 0.000552 > Last message repeated 1 times > rfps: 59.940060 0.002210 > Last message repeated 1 times > [rtsp @ 01e70580] Estimating duration from bitrate, this may be inaccurate > Input #0, rtsp, from 'rtsp://lab:9553/lowQ.sdp': > Metadata: > title : lowQ > Duration: N/A, start: 0.000000, bitrate: 64 kb/s > Stream #0:0, 22, 1/90000: Video: h264 (Baseline), yuv420p, 704x480, > 1/180000, 59.92 tbr, 90k tbn, 180k tbc > Stream #0:1, 111, 1/8000: Audio: pcm_mulaw, 8000 Hz, 1 channels, s16, > 64 kb/s > [h264 @ 01e789a0] detected 4 logical cores Thanks, Mark. -------------- next part -------------- An HTML attachment was scrubbed... URL: From i.like.privacy.too at gmail.com Thu Aug 30 17:08:33 2012 From: i.like.privacy.too at gmail.com (Camera Man) Date: Thu, 30 Aug 2012 11:08:33 -0400 Subject: [Libav-user] MOOV Atom Not Found In-Reply-To: References: Message-ID: <503F81F1.7050800@gmail.com> An HTML attachment was scrubbed... URL: From mark.kenna at sureviewsystems.com Thu Aug 30 17:38:23 2012 From: mark.kenna at sureviewsystems.com (Mark Kenna) Date: Thu, 30 Aug 2012 16:38:23 +0100 Subject: [Libav-user] MOOV Atom Not Found In-Reply-To: <503F81F1.7050800@gmail.com> References: <503F81F1.7050800@gmail.com> Message-ID: On 30 August 2012 16:08, Camera Man wrote: > ** > On 08/29/2012 11:53 AM, Mark Kenna wrote: > > Can someone tell me how a conversion for live streaming is possible? Also, > I would be doing the file conversion dynamically in memory which means that > I cannot just encode a file, re-position the MOOV atom and then stream. > > > If you can estimate the needed size of the moov atom, you can reserve > space with the -moov_size option (added in the last year, I think); this > would remove the need for qt-faststart and friends, and you could do > everything in one pass. (There will be wasted space for sure, but if your > estimate is reasonable it will not be too bad) > > Do note, however, that ffmpeg will only write that MOOV atom after all the > data is in the file, so it will not let you start streaming any earlier > than you could with qt-faststart or mp4box. > > If you want immediate live streaming, perhaps HTTPLiveStreaming (HLS) will > be better for you. If you want MP4 output, you'll have to finish making the > file before starting to play it, regardless of whether it plays immediately > when it starts streaming. > > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > > Ok - thanks for the info. I'm trying to implement HTTP live streaming for HTML5 (or at least determine whether it's possible at this point). Maybe I will try and use WEBM then? Thanks, Mark. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ggarra13 at gmail.com Thu Aug 30 20:07:44 2012 From: ggarra13 at gmail.com (Gonzalo Garramuno) Date: Thu, 30 Aug 2012 15:07:44 -0300 Subject: [Libav-user] Simple example of recording a video file in rgba space Message-ID: TItle says it all. I'm looking for a tutorial or for code that shows how to encode a movie or avi file with rgba as the color space. -- Gonzalo Garramu?o ggarra13 at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From bruce at spearmorgan.com Thu Aug 30 20:14:27 2012 From: bruce at spearmorgan.com (Bruce Wheaton) Date: Thu, 30 Aug 2012 11:14:27 -0700 Subject: [Libav-user] MOOV Atom Not Found In-Reply-To: <503F81F1.7050800@gmail.com> References: <503F81F1.7050800@gmail.com> Message-ID: <5D15ACF1-39E0-434A-99CF-3C87C968016B@spearmorgan.com> On Aug 30, 2012, at 8:08 AM, Camera Man wrote: > On 08/29/2012 11:53 AM, Mark Kenna wrote: >> Can someone tell me how a conversion for live streaming is possible? Also, I would be doing the file conversion dynamically in memory which means that I cannot just encode a file, re-position the MOOV atom and then stream. > > If you can estimate the needed size of the moov atom, you can reserve space with the -moov_size option (added in the last year, I think); this would remove the need for qt-faststart and friends, and you could do everything in one pass. (There will be wasted space for sure, but if your estimate is reasonable it will not be too bad) I missed that. Is there a programmatic option to reserve space for a moov atom too? I think I need to know the number of frames/packets to know the atom size, but don't need to know the size of data in each packet, right? So a re-compression to a different codec could be accomplished this way? Bruce > > Do note, however, that ffmpeg will only write that MOOV atom after all the data is in the file, so it will not let you start streaming any earlier than you could with qt-faststart or mp4box. > > If you want immediate live streaming, perhaps HTTPLiveStreaming (HLS) will be better for you. If you want MP4 output, you'll have to finish making the file before starting to play it, regardless of whether it plays immediately when it starts streaming. > > _______________________________________________ > 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 xhpohanka at gmail.com Fri Aug 31 14:16:47 2012 From: xhpohanka at gmail.com (Jan Pohanka) Date: Fri, 31 Aug 2012 14:16:47 +0200 Subject: [Libav-user] swscale speed Message-ID: Hello, what is the fastest settings for swscale? I'd like to use it on a small embedded system (armv5) to downsample (decimate) or just to convert pixel formats. I have not checked the internals but it seems that swscale always do a lot of processing because even if it does just pixel format conversion (no scaling) for example from YUV420 to NV12 it takes really long. In the case of scaling I have also not found a big difference while using different interpolations (eg. SWS_BICUBIC vs SWS_POINT) and I think that nearest neighbour should be significantly faster. Is there any optimalization if only decimating (scaling with factor of 2^n) is performed? with best regards Jan -- Tato zpr?va byla vytvo?ena p?evratn?m po?tovn?m klientem Opery: http://www.opera.com/mail/ From rogerdpack2 at gmail.com Fri Aug 31 20:17:20 2012 From: rogerdpack2 at gmail.com (Roger Pack) Date: Fri, 31 Aug 2012 12:17:20 -0600 Subject: [Libav-user] swscale speed In-Reply-To: References: Message-ID: > In the case of scaling I have also not found a big difference while using > different interpolations (eg. SWS_BICUBIC vs SWS_POINT) and I think that > nearest neighbour should be significantly faster. Is there any > optimalization if only decimating (scaling with factor of 2^n) is performed? Maybe on your cpu RAM speed is the bottleneck (i.e. cpu is very fast) so it's able to keep up. Now compare it with lanczos... -r From halonso at vpod.tv Fri Aug 31 09:17:23 2012 From: halonso at vpod.tv (Hector Alonso) Date: Fri, 31 Aug 2012 09:17:23 +0200 Subject: [Libav-user] Using yadif filter outside a libav environnment. Message-ID: Hi, I'm developing a module for paying from a capture card (within a video framework that uses libav in other modules) and I'd like to use the libav yadif filter. I have stored the captured picture in PIX_FMT_UYVY422 pixel format and I've been able to use the swscale for converting the image and avpicture_deinterlace to apply the old libav deinterlacing method, but the results aren't as good as expected. First of all, I have to make one copy and convert the image to PIX_FMT_YUV422P (the one this method requires), apply the deinterlace method and then re-convert the result image to the needed original pixel format, so it would be 3 copies and 3 modifications... a huge delay for such bad results. I have an AVPicture source frame (easy to convert to an AVFrame) and I need to get the same as result. Questions: - Do I need to convert my original frame to an specific pixel format? - Do I need another data structure for frame storage (vector/array/list)? - Is there any independent function to do that (inside vf_yadif.c) I could use? Thank you in advance, Hector. -------------- next part -------------- An HTML attachment was scrubbed... URL: