From cehoyos at ag.or.at Tue May 1 08:18:26 2012 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Tue, 1 May 2012 06:18:26 +0000 (UTC) Subject: [Libav-user] Frame order from TS demux - mpeg2video vs h264 References: <1335746086040-4597204.post@n4.nabble.com> <3D89D15A-CA26-4DC9-92A5-2D962B5E0218@universalx.net> Message-ID: jettoblack writes: > I tried that and for H.264 it's definitely wrong if I use the frames > in-order from the demuxer. It does work fine for MPEG-2 video. > > Should I file a bug report? Is the problem reproducible with ffmpeg -i input -qscale 2 out.avi or ffplay file ? Carl Eugen From genesys at gmx.ch Tue May 1 22:08:48 2012 From: genesys at gmx.ch (=?iso-8859-1?Q?=22Matthias_B=FChlmann=22?=) Date: Tue, 01 May 2012 22:08:48 +0200 Subject: [Libav-user] How to setup codecContext for FFV1 encoding? Message-ID: <20120501200848.181210@gmx.net> Can someone provide an example of how to setup an AvCodecContext to encode a video with FFV1? I'm a bit confused as to what settings are relevant for lossless compression and how to set them. -- NEU: FreePhone 3-fach-Flat mit kostenlosem Smartphone! Jetzt informieren: http://mobile.1und1.de/?ac=OM.PW.PW003K20328T7073a From jettoblack at gmail.com Wed May 2 01:47:40 2012 From: jettoblack at gmail.com (jettoblack) Date: Tue, 1 May 2012 16:47:40 -0700 (PDT) Subject: [Libav-user] Frame order from TS demux - mpeg2video vs h264 In-Reply-To: References: <1335746086040-4597204.post@n4.nabble.com> <3D89D15A-CA26-4DC9-92A5-2D962B5E0218@universalx.net> Message-ID: On Tue, May 1, 2012 at 2:20 AM, Carl Eugen Hoyos [via libav-users] < ml-node+s943685n4600239h26 at n4.nabble.com> wrote: > jettoblack writes: > > > I tried that and for H.264 it's definitely wrong if I use the frames > > in-order from the demuxer. It does work fine for MPEG-2 video. > > > > Should I file a bug report? > > Is the problem reproducible with ffmpeg -i input -qscale 2 out.avi > or ffplay file ? > Hi Carl, I really appreciate the response. The output file plays/trancodes without any problems using ffplay or ffmpeg. I don't know much about the internals of ffmpeg, but is it possible that the muxing process is reversing the issue? In any case, can you advise on how to determine the frame display index of a AVPacket? I've tried: A) the incremental order from the demuxer B) using the pts value: int frame_num = (pkt.pts * av_q2d(in->streams [videoStream]->time_base)) / (1 / frameRate); C) coded_picture_number (after decoding to AVPicture) When the transport stream contains MPEG-2 video codec, all of these methods work equally well. When it contains H.264 video codec, the pts and incremental order from the demuxer are definitely not in picture display order. coded_picture_number is giving the closest result but it is wrong on approx. every 150th frame (key frames?). Thanks! Jason -- View this message in context: http://libav-users.943685.n4.nabble.com/Frame-order-from-TS-demux-mpeg2video-vs-h264-tp4597204p4602029.html Sent from the libav-users mailing list archive at Nabble.com. From cehoyos at ag.or.at Wed May 2 08:10:46 2012 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Wed, 2 May 2012 06:10:46 +0000 (UTC) Subject: [Libav-user] Frame order from TS demux - mpeg2video vs h264 References: <1335746086040-4597204.post@n4.nabble.com> <3D89D15A-CA26-4DC9-92A5-2D962B5E0218@universalx.net> Message-ID: jettoblack writes: > When it contains H.264 video codec, the pts and > incremental order from the demuxer are definitely not in > picture display order. coded_picture_number is giving the > closest result but it is wrong on approx. every 150th > frame (key frames?). Are you using the parser? (Do you see the same results with ffmpeg if you configure with --disable-parser=h264 ?) Carl Eugen From xiaobo_yc at 163.com Wed May 2 12:02:21 2012 From: xiaobo_yc at 163.com (=?GBK?B?0KSyqA==?=) Date: Wed, 2 May 2012 18:02:21 +0800 (CST) Subject: [Libav-user] How to decode audio with data size of 20 Message-ID: <4fcd57bf.2e355.1370d002272.Coremail.xiaobo_yc$163.com> Hi all, How to decode the audio data of data sizeI(sample bit width) is 20? I read the source code of libav 0.8.1 in libavformat/lxf.dec, and in about line 316 there a comment wrote:"read non-20-bit audio data into lxf->temp so we can deplanarize it". So does ffmpeg don't support audio with data size 20? Is there any solutions if I want to decode it? -------------- next part -------------- An HTML attachment was scrubbed... URL: From info at denisgottardello.it Tue May 1 11:23:32 2012 From: info at denisgottardello.it (Denis) Date: Tue, 1 May 2012 11:23:32 +0200 Subject: [Libav-user] AVSubtitle Message-ID: <201205011123.32626.info@denisgottardello.it> Does anybody has an example on how to add subtitles to a video stream? I hope somebody reply. -- www.denisgottardello.it Skype: mrdebug Videosurveillance and home automation! http://www.denisgottardello.it/DomusBoss/DomusBossIndice.php From wagner.patriota at gmail.com Wed May 2 21:23:44 2012 From: wagner.patriota at gmail.com (Wagner Patriota) Date: Wed, 2 May 2012 16:23:44 -0300 Subject: [Libav-user] How to redirect FFMPEG output to a socket Message-ID: Hello, I wanna make an application that outputs the content of FFMPEG to a socket... it that easy? where should I look for it? Maybe ffserver has something to do with what I want, but for sure I want something simpler... I have my server open, a "socket handle", everything ready... only waiting for write the file content... any hints where I can begin? Thank you. -------------- next part -------------- An HTML attachment was scrubbed... URL: From wagner.patriota at gmail.com Wed May 2 23:19:25 2012 From: wagner.patriota at gmail.com (Wagner Patriota) Date: Wed, 2 May 2012 18:19:25 -0300 Subject: [Libav-user] How to redirect FFMPEG output to a socket In-Reply-To: References: Message-ID: hummm... nevermind... I got it already... I need to implement my own URLProtocol... :-) On Wed, May 2, 2012 at 4:23 PM, Wagner Patriota wrote: > Hello, > > I wanna make an application that outputs the content of FFMPEG to a > socket... it that easy? where should I look for it? > > Maybe ffserver has something to do with what I want, but for sure I want > something simpler... > > I have my server open, a "socket handle", everything ready... only waiting > for write the file content... any hints where I can begin? > > Thank you. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From info at denisgottardello.it Wed May 2 21:48:35 2012 From: info at denisgottardello.it (Denis) Date: Wed, 2 May 2012 21:48:35 +0200 Subject: [Libav-user] How to redirect FFMPEG output to a socket In-Reply-To: References: Message-ID: <201205022148.35701.info@denisgottardello.it> In data mercoled? 02 maggio 2012 21:23:44, Wagner Patriota ha scritto: > Hello, > > I wanna make an application that outputs the content of FFMPEG to a > socket... it that easy? where should I look for it? > > Maybe ffserver has something to do with what I want, but for sure I want > something simpler... > > I have my server open, a "socket handle", everything ready... only waiting > for write the file content... any hints where I can begin? > > Thank you. It's possible but is not so easy. In the last year I have posted a lot of questions about this but nobody has reply to me. I not know why, perhaps because I'm from Italy and my english is not correct or because is not a tipical question. In order to grab all from ffmpeg you have two ways: 1) Using callbacks "avio_alloc_context" 2) Using "avio_open_dyn_buf" and "avio_close_dyn_buf" After that you must know that not all format are streamable. I don't know if these are the right ways but works for me. I have wrote a surveillance software with ffmpeg. -- www.denisgottardello.it Skype: mrdebug Videosurveillance and home automation! http://www.denisgottardello.it/DomusBoss/DomusBossIndice.php From mika_rajala_2 at hotmail.com Thu May 3 11:22:40 2012 From: mika_rajala_2 at hotmail.com (Mika Rajala) Date: Thu, 3 May 2012 09:22:40 +0000 Subject: [Libav-user] av_open_input_file takes a while Message-ID: Hi I'm using the method avformat_open_input to load a ~2GB h264 encoded video file. int err = avformat_open_input(&m_formatContext, path, NULL, NULL); This takes a bit too long however, is there any way to make it faster? -mika From goocreations at gmail.com Thu May 3 11:30:06 2012 From: goocreations at gmail.com (Goo Creations) Date: Thu, 3 May 2012 11:30:06 +0200 Subject: [Libav-user] Reducing sample rate and channels for encoding Message-ID: Hi, I'm relatively new to FFMpeg. I have a buffer in memory of decoded samples (44100Hz, 2 channels) and I want to encode them to 22050Hz mono. Hence, the size of the buffer should be 4 times smaller. If I pass my samples to av_encode_audio2, should I accommodate for this reduction or will FFMpeg handle this? For example if I want to encode from stereo to mono, should I remove every second sample before passing the buffer to av_encode_audio2, or will this function automatically remove every second sample for me? Thanks Christoph -------------- next part -------------- An HTML attachment was scrubbed... URL: From cehoyos at ag.or.at Thu May 3 11:34:48 2012 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Thu, 3 May 2012 09:34:48 +0000 (UTC) Subject: [Libav-user] Reducing sample rate and channels for encoding References: Message-ID: Goo Creations writes: > Hi,I'm relatively new to FFMpeg. I have a buffer in memory > of decoded samples (44100Hz, 2 channels) and I want to > encode them to 22050Hz mono. You will have to use libswresample. Carl Eugen From andrey.krieger.utkin at gmail.com Thu May 3 11:42:45 2012 From: andrey.krieger.utkin at gmail.com (Andrey Utkin) Date: Thu, 3 May 2012 12:42:45 +0300 Subject: [Libav-user] How to redirect FFMPEG output to a socket In-Reply-To: References: Message-ID: 2012/5/2 Wagner Patriota : > Hello, > > I wanna make an application that outputs the content of FFMPEG to a > socket... it that easy??where should I look for it? > > Maybe ffserver has something to do with what I want, but for sure I want > something simpler... > > I have my server open, a "socket handle", everything ready... only waiting > for write the file content... any hints where I can begin? Yep, that's very hard... As hard as opening output file specified with string "tcp://host:port". Or "udp://host:port". Or "http://host.port". You get the idea. See `ffmpeg -protocols`. -- Andrey Utkin From goocreations at gmail.com Thu May 3 11:46:31 2012 From: goocreations at gmail.com (Goo Creations) Date: Thu, 3 May 2012 11:46:31 +0200 Subject: [Libav-user] Reducing sample rate and channels for encoding In-Reply-To: References: Message-ID: Oh cool. Thanks. I'll try that On Thu, May 3, 2012 at 11:34 AM, Carl Eugen Hoyos wrote: > Goo Creations writes: > > > Hi,I'm relatively new to FFMpeg. I have a buffer in memory > > of decoded samples (44100Hz, 2 channels) and I want to > > encode them to 22050Hz mono. > > You will have to use libswresample. > > 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 andrey.krieger.utkin at gmail.com Thu May 3 11:51:24 2012 From: andrey.krieger.utkin at gmail.com (Andrey Utkin) Date: Thu, 3 May 2012 12:51:24 +0300 Subject: [Libav-user] Frame order from TS demux - mpeg2video vs h264 In-Reply-To: <1335746086040-4597204.post@n4.nabble.com> References: <1335746086040-4597204.post@n4.nabble.com> Message-ID: Dear topicstarter. You print the pts timestamps of demuxed packets. It is correct that they are not sorted by pts. They are ordered by dts, the Decoding Timestamp. They are in the order for being decoded. You should look at pts of resulting frames (actually i use AVFrame.pkt_pts, as i see in my apps sources). Decoders return frames in _pts_ order, that is what you need. -- Andrey Utkin From kalileo at universalx.net Thu May 3 12:23:08 2012 From: kalileo at universalx.net (Kalileo) Date: Thu, 3 May 2012 17:23:08 +0700 Subject: [Libav-user] Frame order from TS demux - mpeg2video vs h264 In-Reply-To: References: <1335746086040-4597204.post@n4.nabble.com> <3D89D15A-CA26-4DC9-92A5-2D962B5E0218@universalx.net> Message-ID: <937ABCE1-8C58-41C1-B386-8F885661F6D3@universalx.net> On Apr 30, 2012, at 23:53 , jettoblack wrote: > On Mon, Apr 30, 2012 at 2:51 AM, Kalileo [via libav-users] < > ml-node+s943685n4597541h88 at n4.nabble.com> wrote: > >> >> The decoder gives you the (decoded) pictures in the correct order. >> >> > That's what I expected, and it does for MPEG-2 codec video, but not for > H.264 codec within a MPEG-2 transport stream. It does. Otherwise there would be no way to display h264 video correctly ;) As i said, and as also Andrey Utkin pointed out, the correct order for display is in the pts value, and after decoding (not after demuxing) the pictures/frames should be in pts order, ready for display. > >> I would try to attach the metadata in the order as you get it from the >> demuxer with the pictures as you get them out of the decoder. >> > > I tried that No you haven't. > and for H.264 it's definitely wrong if I use the frames > in-order from the demuxed. as said, for h264 with b frames you need the order _not_ "as demuxed" but "as decoded", and I'm not talking about any 'coded_picture_number' but about the order of the h264 frames as the decoder returns them. That is the correct order, and the pts should reflect that order. If it doesn't, trust the order the decoder gives you over the pts. > It does work fine for MPEG-2 video. but not in h264 because in h264 the coded frames are reordered depending on which frame is needed for decoding first, not which frame is to be displayed first. > > Should I file a bug report? No. You expect info from the demuxer which is not there. From deepika at cinemacraft.tv Thu May 3 14:07:56 2012 From: deepika at cinemacraft.tv (Deepika R) Date: Thu, 3 May 2012 20:07:56 +0800 Subject: [Libav-user] Add MPEG-2 user data or H.264 SEI metadata while remuxing In-Reply-To: <1333488207782-4530217.post@n4.nabble.com> References: <1333488207782-4530217.post@n4.nabble.com> Message-ID: Hi, I am looking for this too. Any leads? Regards, Deepika On Wed, Apr 4, 2012 at 5:23 AM, jettoblack wrote: > Hello, > I'm imagining a program that will accept an incoming MPEG-2 transport > stream, demux, add some metadata to the video packets, then remux and > write/stream back out. There will be no decompression or recompression of > the a/v codec data. > > For MPEG-2 video, the data would be added as MPEG-2 user data packets > (appended to each video frame, in frame encoded order). H.264 in MPEG-2 TS > would use SEI RBSP packets. Audio or other packets would be passed through > to the remuxed stream without any changes. > > I can generate the bytes for the actual metadata content, but I'm not sure > how to get this appended within a user data packet or SEI packet to the > video frames while remuxing. > > Does anyone have some ideas, example code or maybe some pointers on where > to > look to get started? Thanks! > > > -- > View this message in context: > http://libav-users.943685.n4.nabble.com/Add-MPEG-2-user-data-or-H-264-SEI-metadata-while-remuxing-tp4530217p4530217.html > Sent from the libav-users mailing list archive at Nabble.com. > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > -------------- next part -------------- An HTML attachment was scrubbed... URL: From alexcohn at netvision.net.il Thu May 3 14:44:06 2012 From: alexcohn at netvision.net.il (Alex Cohn) Date: Thu, 3 May 2012 15:44:06 +0300 Subject: [Libav-user] av_open_input_file takes a while In-Reply-To: References: Message-ID: On Thu, May 3, 2012 at 12:22 PM, Mika Rajala wrote: > > Hi > > I'm using the method avformat_open_input to load a ~2GB h264 encoded video file. > > int err = avformat_open_input(&m_formatContext, path, NULL, NULL); > > This takes a bit too long however, is there any way to make it faster? > > -mika You could probably reduce the opening time if you disable format/codec sniffing. Alex From jettoblack at gmail.com Thu May 3 19:16:42 2012 From: jettoblack at gmail.com (jettoblack) Date: Thu, 3 May 2012 10:16:42 -0700 (PDT) Subject: [Libav-user] Frame order from TS demux - mpeg2video vs h264 In-Reply-To: <937ABCE1-8C58-41C1-B386-8F885661F6D3@universalx.net> References: <1335746086040-4597204.post@n4.nabble.com> <3D89D15A-CA26-4DC9-92A5-2D962B5E0218@universalx.net> <937ABCE1-8C58-41C1-B386-8F885661F6D3@universalx.net> Message-ID: <1336065402146-4606589.post@n4.nabble.com> Kalileo wrote > > On Apr 30, 2012, at 23:53 , jettoblack wrote: > >> On Mon, Apr 30, 2012 at 2:51 AM, Kalileo [via libav-users] < >> ml-node+s943685n4597541h88 at .nabble> wrote: >> >>> >>> The decoder gives you the (decoded) pictures in the correct order. >>> >>> >> That's what I expected, and it does for MPEG-2 codec video, but not for >> H.264 codec within a MPEG-2 transport stream. > > It does. Otherwise there would be no way to display h264 video correctly > ;) > > As i said, and as also Andrey Utkin pointed out, the correct order for > display is in the pts value, and after decoding (not after demuxing) the > pictures/frames should be in pts order, ready for display. > > Thanks Kalileo, I think I'm getting it now. :) So, related question, I want to figure out what is the starting pts of the stream (lowest pts). Is this info available from the demuxer by the time of demuxing the first picture packet, or do I have to wait until I receive some number of packets and look for the one with the lowest pts? I have seen some files where the first packet is an I frame, and the next is a B frame that precedes the I frame (BBIBBP...), e.g.: pkt 0: I frame dts 126000 pts 135009 pkt 1: B frame dts 129003 pts 129003 pkt 2: B frame dts 132006 pts 132006 pkt 3: P frame dts 135009 pts 144018 ... I suppose at the time of demuxing packet 0, there is no way to know yet that the next packet will have a lower pts? Would a workaround be to discard any frames with a pts lower than the first I frame? I really appreciate the help, thanks again! Jason -- View this message in context: http://libav-users.943685.n4.nabble.com/Frame-order-from-TS-demux-mpeg2video-vs-h264-tp4597204p4606589.html Sent from the libav-users mailing list archive at Nabble.com. From jettoblack at gmail.com Thu May 3 19:24:06 2012 From: jettoblack at gmail.com (jettoblack) Date: Thu, 3 May 2012 10:24:06 -0700 (PDT) Subject: [Libav-user] Add MPEG-2 user data or H.264 SEI metadata while remuxing In-Reply-To: References: <1333488207782-4530217.post@n4.nabble.com> Message-ID: <1336065846702-4606610.post@n4.nabble.com> Deepika wrote > > Hi, > > I am looking for this too. Any leads? > > Regards, > Deepika > > Hi Deepika, I've got the basic idea of it working now. For MPEG-2 Video it is relatively simple as you can just append the user data structure to the end of the frame data. It looks like: 0x000001b2 [user data] 0x000001 For H.264 you must construct a NAL type 6 containing a SEI message: 0x00000106 [SEI message starting with payload type] 0x00 [payload size] 0x80 This gets inserted into the packet after any other SEI messages but before the first video slice, so you have to parse the NALs in the frame data to find the insertion point. Hope this helps, Jason -- View this message in context: http://libav-users.943685.n4.nabble.com/Add-MPEG-2-user-data-or-H-264-SEI-metadata-while-remuxing-tp4530217p4606610.html Sent from the libav-users mailing list archive at Nabble.com. From wagner.patriota at gmail.com Thu May 3 21:39:36 2012 From: wagner.patriota at gmail.com (Wagner Patriota) Date: Thu, 3 May 2012 16:39:36 -0300 Subject: [Libav-user] How to redirect FFMPEG output to a socket In-Reply-To: References: Message-ID: Hey guys, sorry... but it's VERY VERY simple... I did it in about 10 or 15 minutes after I figured out how URLProtocol works... I just rewrote the URLProtocol... that's it... I created a new one, based on file.c and then I rewrote all the functions to write in my socket... it worked right in the first time. On Thu, May 3, 2012 at 6:42 AM, Andrey Utkin wrote: > 2012/5/2 Wagner Patriota : > > Hello, > > > > I wanna make an application that outputs the content of FFMPEG to a > > socket... it that easy? where should I look for it? > > > > Maybe ffserver has something to do with what I want, but for sure I want > > something simpler... > > > > I have my server open, a "socket handle", everything ready... only > waiting > > for write the file content... any hints where I can begin? > > Yep, that's very hard... As hard as opening output file specified with > string "tcp://host:port". Or "udp://host:port". Or "http://host.port". > You get the idea. See `ffmpeg -protocols`. > > -- > Andrey Utkin > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mbradshaw at sorensonmedia.com Thu May 3 22:04:18 2012 From: mbradshaw at sorensonmedia.com (Michael Bradshaw) Date: Thu, 3 May 2012 14:04:18 -0600 Subject: [Libav-user] How to redirect FFMPEG output to a socket In-Reply-To: References: Message-ID: On Thu, May 3, 2012 at 1:39 PM, Wagner Patriota wrote: > Hey guys, sorry... but it's VERY VERY simple... I did it in about 10 or 15 > minutes after I figured out how URLProtocol works... > > I just rewrote the URLProtocol... that's it... I created a new one, based on > file.c and then I rewrote all the functions to write in my socket... it > worked right in the first time. Are you using ffmpeg (the command line) or libavcodec (the library in your own program)? If you're using ffmpeg, Andrey Utkin's point was that ffmpeg already supports outputting to a socket. petroxp:mydev mjbshaw$ ffmpeg -protocols ffmpeg version N-39731-g0cd17a6 Copyright (c) 2000-2012 the FFmpeg developers built on May 1 2012 11:57:41 with gcc 4.2.1 (Apple Inc. build 5666) (dot 3) configuration: --enable-libopenjpeg libavutil 51. 46.100 / 51. 46.100 libavcodec 54. 14.101 / 54. 14.101 libavformat 54. 3.100 / 54. 3.100 libavdevice 53. 4.100 / 53. 4.100 libavfilter 2. 67.101 / 2. 67.101 libswscale 2. 1.100 / 2. 1.100 libswresample 0. 11.100 / 0. 11.100 Supported file protocols: Input: applehttp cache concat crypto file gopher hls http httpproxy mmsh mmst pipe rtmp rtp tcp udp Output: file gopher http httpproxy md5 pipe rtmp rtp tcp udp Notice http, tcp, and udp are all supported as output. Even if you were using libavcodec and not ffmpeg, you could still use the http, tcp, udp, or whatever else you needed protocols, as they're already completed. If you need your own custom network protocol, then yes, you do need a custom URLProtocol. --Michael From info at denisgottardello.it Thu May 3 21:54:14 2012 From: info at denisgottardello.it (Denis) Date: Thu, 3 May 2012 21:54:14 +0200 Subject: [Libav-user] How to redirect FFMPEG output to a socket In-Reply-To: References: Message-ID: <201205032154.14961.info@denisgottardello.it> In data gioved? 03 maggio 2012 21:39:36, Wagner Patriota ha scritto: > Hey guys, sorry... but it's VERY VERY simple... I did it in about 10 or 15 > minutes after I figured out how URLProtocol works... > > I just rewrote the URLProtocol... that's it... I created a new one, based > on file.c and then I rewrote all the functions to write in my socket... it > worked right in the first time. Can you post an example? Can this method be used for send not to a socket but to a memory buffer? -- www.denisgottardello.it Skype: mrdebug Videosurveillance and home automation! http://www.denisgottardello.it/DomusBoss/DomusBossIndice.php From xiaobo_yc at 163.com Fri May 4 04:57:05 2012 From: xiaobo_yc at 163.com (=?GBK?B?0KSyqA==?=) Date: Fri, 4 May 2012 10:57:05 +0800 (CST) Subject: [Libav-user] Problems with some MXF file decoding In-Reply-To: References: <4d6e56bc.26ed2.136ed99399f.Coremail.xiaobo_yc@163.com> <796880e4.2b142.136ee52fc05.Coremail.xiaobo_yc@163.com> Message-ID: <6b7c0a78.26731.13715c78397.Coremail.xiaobo_yc$163.com> ? 2012-04-27 20:41:31?"Carl Eugen Hoyos" ??? >?? writes: > >> >> I found that the current git code have problems with decoding >> >> of some of my MXF files, but the libav-0.8.1 is OK. >> > >> >Could you test with current FFmpeg, >> >see http://ffmpeg.org/download.html ? >> >> My test operation is Windows 7,and I downloaded the from both >> http://ffmpeg.zeranoe.com > >Please provide the complete, uncut console output. > My console input is just "avprobe.exe -show_packets d:\test_sample.mxf". If I use the latest git, when the pts and dts of video packet upto about 14998, it will always be 14998,14999, 15000 or 0x8000000000000000. If I use libav 0.8.1, the dts and pts will always increase and upto 16332. >> >If one of your files does not work with current FFmpeg, please post >> >complete, uncut console output here and provide a sample. >> >> My sample file is about 4.8GB,it's too large, It's difficult to >> upload it for me. > >Try to cut the sample and test if it still plays with your older download. > >If it does work, please provide the sample. > I spiited my sampe mxf file, and just uploaded the first 900MB to the following link: http://fs-53.gz.fs.163.com/dl/?file=PKWe2XRurviDyUF7dQSMGZlvsGw6WIFzIziBS5uPxtAsg29cqbd2Cng90Sfgyd1hjZIRnbsXwUWrmNTkl2G9hA&callback=163mail and if use the libav-0.8.1, I can get the both video and auio last timecode is 16332,and the latest git have problems.anybody can have a test. >Carl Eugen > >_______________________________________________ >Libav-user mailing list >Libav-user at ffmpeg.org >http://ffmpeg.org/mailman/listinfo/libav-user XiaoBo 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 lixiaohui9219 at 126.com Fri May 4 07:15:21 2012 From: lixiaohui9219 at 126.com (=?GBK?B?wOjQobvU?=) Date: Fri, 4 May 2012 13:15:21 +0800 (CST) Subject: [Libav-user] rtmp address play failed!!! Message-ID: <73fa1638.1df27.137164617b7.Coremail.lixiaohui9219$126.com> Hi, I patched FFmpeg 0.5.0 for support the RTMP. Testing some rtmp address can play ok(e.g. rtmp://www.planeta-online.tv:1936/live/channel_4, rtmp://58.54.253.52:1935/vod/mp4:20110627mlt1.f4v), but this address cannot play (rtmp://flashcloud.mediacdn.com/live/kontratv.flv) . Debuging results: When receiving a packet(type :invoke,channle:5),but the Rtmp_paser_result() show me "tmpstr = NetStream.Play.UnpublishNotify" ,and setup the rt->state as "STATE_STOPPED". The rtmp address which can play ok,the Rtmp_paser_result() show me first "tmpstr = NetStream.Play.Reset" and the rt->state is "STATE_READY", and then tmpstr = NetStream.Play.Start and setup the rt->state as "STATE_PLAYING". What can I do for this situation? Please help me if you have some idea for this problem! Thank you very much! Best Reguard huiiuh -------------- next part -------------- An HTML attachment was scrubbed... URL: From xiaohui.li at fulansoft.com Fri May 4 06:23:36 2012 From: xiaohui.li at fulansoft.com (LXH) Date: Fri, 4 May 2012 12:23:36 +0800 Subject: [Libav-user] A rtmp address cannot play usering ffmpeg Message-ID: <4D213C28F5C7436780AFD4A70346E6AB@JC10LXH> Hi, I patched FFmpeg 0.5.0 for support the RTMP. Testing some rtmp address can play ok(e.g. rtmp://www.planeta-online.tv:1936/live/channel_4, rtmp://58.54.253.52:1935/vod/mp4:20110627mlt1.f4v), but this address cannot play (rtmp://flashcloud.mediacdn.com/live/kontratv.flv) . Debuging results: When receiving a packet(type :invoke,channle:5),but the Rtmp_paser_result() show me "tmpstr = NetStream.Play.UnpublishNotify" ,and setup the rt->state as "STATE_STOPPED". The rtmp address which can play ok,the Rtmp_paser_result() show me first "tmpstr = NetStream.Play.Reset" and the rt->state is "STATE_READY", and then tmpstr = NetStream.Play.Start and setup the rt->state as "STATE_PLAYING". What can I do for this situation? Please help me if you have some idea for this problem! Thank you very much! Best Reguard huiiuh -------------- next part -------------- An HTML attachment was scrubbed... URL: From kalileo at universalx.net Fri May 4 13:37:06 2012 From: kalileo at universalx.net (Kalileo) Date: Fri, 4 May 2012 18:37:06 +0700 Subject: [Libav-user] Frame order from TS demux - mpeg2video vs h264 In-Reply-To: <1336065402146-4606589.post@n4.nabble.com> References: <1335746086040-4597204.post@n4.nabble.com> <3D89D15A-CA26-4DC9-92A5-2D962B5E0218@universalx.net> <937ABCE1-8C58-41C1-B386-8F885661F6D3@universalx.net> <1336065402146-4606589.post@n4.nabble.com> Message-ID: On May 4, 2012, at 00:16 , jettoblack wrote: > > Kalileo wrote >> >> On Apr 30, 2012, at 23:53 , jettoblack wrote: >> >>> On Mon, Apr 30, 2012 at 2:51 AM, Kalileo [via libav-users] < >>> ml-node+s943685n4597541h88 at .nabble> wrote: >>> >>>> >>>> The decoder gives you the (decoded) pictures in the correct order. >>>> >>>> >>> That's what I expected, and it does for MPEG-2 codec video, but not for >>> H.264 codec within a MPEG-2 transport stream. >> >> It does. Otherwise there would be no way to display h264 video correctly >> ;) >> >> As i said, and as also Andrey Utkin pointed out, the correct order for >> display is in the pts value, and after decoding (not after demuxing) the >> pictures/frames should be in pts order, ready for display. >> >> > > Thanks Kalileo, I think I'm getting it now. :) > > So, related question, I want to figure out what is the starting pts of the > stream (lowest pts). Is this info available from the demuxer by the time of > demuxing the first picture packet, or do I have to wait until I receive some > number of packets and look for the one with the lowest pts? > > I have seen some files where the first packet is an I frame, and the next is > a B frame that precedes the I frame (BBIBBP...), e.g.: > pkt 0: I frame dts 126000 pts 135009 > pkt 1: B frame dts 129003 pts 129003 > pkt 2: B frame dts 132006 pts 132006 > pkt 3: P frame dts 135009 pts 144018 > ... > > I suppose at the time of demuxing packet 0, there is no way to know yet that > the next packet will have a lower its? in a stream with h264, yes. > > Would a workaround be to discard any frames with a pts lower than the first > I frame? > > I really appreciate the help, thanks again! > Jason > That's how I do it, and it works for me. Wait for the first I-frame and start feeding the video frames to the decoder with this first I-frame. I remember that I've seen video frames with a lower pts even after such an I-frame, however I ignore that pts, but not such a frame. After the first I-Frame they all go to the decoder. The pts / dts of that first I-frame is what you sync with the dts / pts of the first audio or whatever frame you take and sync from there. From cehoyos at ag.or.at Fri May 4 15:51:02 2012 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Fri, 4 May 2012 13:51:02 +0000 (UTC) Subject: [Libav-user] Frame order from TS demux - mpeg2video vs h264 References: <1335746086040-4597204.post@n4.nabble.com> <3D89D15A-CA26-4DC9-92A5-2D962B5E0218@universalx.net> <937ABCE1-8C58-41C1-B386-8F885661F6D3@universalx.net> <1336065402146-4606589.post@n4.nabble.com> Message-ID: Kalileo writes: > That's how I do it, and it works for me. Wait for the first I-frame Don't forget that valid H264 streams do not necessarily contain I frames. (I don't know of such a sample.) Carl Eugen From wagner.patriota at gmail.com Fri May 4 19:10:51 2012 From: wagner.patriota at gmail.com (Wagner Patriota) Date: Fri, 4 May 2012 14:10:51 -0300 Subject: [Libav-user] How to redirect FFMPEG output to a socket In-Reply-To: <201205032154.14961.info@denisgottardello.it> References: <201205032154.14961.info@denisgottardello.it> Message-ID: yes... sure... this is still a skeleton, but it's already working... In MY CASE, I have a socket already open... sending and receiving some information already... I need to use the same socket to send the output of ffmpeg... everything I do is "equivalent" to type, for example: "ffmpeg -i inputfile *socket://8989*" so my application send the output to the socket with handle 8989... the code below is enough... maybe I will do some optmization later, but it works pretty fine. If you want to write do some buffer, you should pass the buffer address with socket_open, save the address in priv_data, as I did, and then use socket_write to write to this buffer... of couse, use appropriate names for it... and I am not completely sure about what you want so I am not sure if this is the best solution for you... but the idea is to make your own URLProtocol... :-) static int socket_write(URLContext *h, const unsigned char *buf, int size) { int *socketHandleInt32 = (int*)h->priv_data; int r = send(*socketHandleInt32, buf, size, 0); return (-1 == r) ? AVERROR(errno) : r; } static int socket_get_handle(URLContext *h) { return *(int*)h->priv_data; } static int socket_check(URLContext *h, int mask) { return 0; } static int socket_open(URLContext *h, const char *socketHandle, int flags) { int * socketHandleInt32 = av_malloc( sizeof(int) ); socketHandle += 9; // skip "socket://" h->priv_data = socketHandleInt32; *socketHandleInt32 = atoi( socketHandle ); return 0; } static int socket_close(URLContext *h) { int *socketHandleInt32 = (int*)h->priv_data; return !close(*socketHandleInt32); } URLProtocol ff_socket_protocol = { .name = "socket", .url_open = socket_open, .url_write = socket_write, .url_close = socket_close, .url_get_file_handle = socket_get_handle, .url_check = socket_check, }; On Thu, May 3, 2012 at 4:54 PM, Denis wrote: > In data gioved? 03 maggio 2012 21:39:36, Wagner Patriota ha scritto: > > Hey guys, sorry... but it's VERY VERY simple... I did it in about 10 or > 15 > > minutes after I figured out how URLProtocol works... > > > > I just rewrote the URLProtocol... that's it... I created a new one, based > > on file.c and then I rewrote all the functions to write in my socket... > it > > worked right in the first time. > > Can you post an example? > Can this method be used for send not to a socket but to a memory buffer? > > -- > 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 info at denisgottardello.it Fri May 4 23:32:09 2012 From: info at denisgottardello.it (Denis) Date: Fri, 4 May 2012 23:32:09 +0200 Subject: [Libav-user] How to redirect FFMPEG output to a socket In-Reply-To: References: <201205032154.14961.info@denisgottardello.it> Message-ID: <201205042332.09605.info@denisgottardello.it> In data venerd? 04 maggio 2012 19:10:51, Wagner Patriota ha scritto: > yes... sure... > this is still a skeleton, but it's already working... > > In MY CASE, I have a socket already open... sending and receiving some > information already... I need to use the same socket to send the output of > ffmpeg... everything I do is "equivalent" to type, for example: "ffmpeg -i > inputfile socket://8989" > > so my application send the output to the socket with handle 8989... the > code below is enough... maybe I will do some optmization later, but it > works pretty fine. In order to implement my onw URLProcotol the speps are: - Add to libavformat/file.c my procolol "CONFIG_BUFFER_PROTOCOL" - Addo to config.mak "CONFIG_BUFFER_PROTOCOL" And then? Wich are the next steps? Thank you. -- www.denisgottardello.it Skype: mrdebug Videosurveillance and home automation! http://www.denisgottardello.it/DomusBoss/DomusBossIndice.php From jyavenard at gmail.com Sun May 6 00:54:21 2012 From: jyavenard at gmail.com (Jean-Yves Avenard) Date: Sun, 6 May 2012 08:54:21 +1000 Subject: [Libav-user] Determining video container format of streamed file after url_open Message-ID: Hi there. I would like to get help on the best way to determine what the container format is of a streamed media accessed via ffmpeg; right after calling url_open and before starting to use url_read What I'm trying to determine is if a file being accessed over http is either mp4 or m4v format. I was wondering if such a function existed... Thank you in advance Regards Jean-Yves From bruce at spearmorgan.com Sun May 6 05:28:27 2012 From: bruce at spearmorgan.com (Bruce Wheaton) Date: Sat, 5 May 2012 20:28:27 -0700 Subject: [Libav-user] Switching codecs from encode to playback on the fly Message-ID: <698EE6B3-D212-40B2-8413-420238C3E743@spearmorgan.com> Is it possible to open codecs for encoding, and use them to encode a complete piece, then, on the fly (when the complete clip had already been encoded) switch over and use them to decompress the same media? I'm flexible on which codecs, although I like MP4 for being LGPL and good at multi-threading. Bruce From alexcohn at netvision.net.il Sun May 6 06:16:44 2012 From: alexcohn at netvision.net.il (Alex Cohn) Date: Sun, 6 May 2012 07:16:44 +0300 Subject: [Libav-user] Switching codecs from encode to playback on the fly In-Reply-To: <698EE6B3-D212-40B2-8413-420238C3E743@spearmorgan.com> References: <698EE6B3-D212-40B2-8413-420238C3E743@spearmorgan.com> Message-ID: On May 6, 2012 6:28 AM, "Bruce Wheaton" wrote: > > Is it possible to open codecs for encoding, and use them to encode a complete piece, then, on the fly (when the complete clip had already been encoded) switch over and use them to decompress the same media? > > I'm flexible on which codecs, although I like MP4 for being LGPL and good at multi-threading. > > > Bruce To the best of my knowledge, encoders and decoders are completely separate. But nothing can prevent you from creating both at initialization time, and using the encoder or decoder whenever you need that. BR, Alex -------------- next part -------------- An HTML attachment was scrubbed... URL: From alexcohn at netvision.net.il Sun May 6 09:05:42 2012 From: alexcohn at netvision.net.il (Alex Cohn) Date: Sun, 6 May 2012 10:05:42 +0300 Subject: [Libav-user] Determining video container format of streamed file after url_open In-Reply-To: References: Message-ID: On Sun, May 6, 2012 at 1:54 AM, Jean-Yves Avenard wrote: > Hi there. > > I would like to get help on the best way to determine what the > container format is of a streamed media accessed via ffmpeg; right > after calling url_open and before starting to use url_read > > What I'm trying to determine is if a file being accessed over http is > either mp4 or m4v format. > > I was wondering if such a function existed... > > Thank you in advance > Regards > Jean-Yves The difference between mp4 and m4v is often illusionary, see http://en.wikipedia.org/wiki/M4V and https://discussions.apple.com/thread/2309476?start=0&tstart=0 for some details. The big issue is DRM, which may render the mv4 file impossible to decode with ffmpeg. The AC3 (Dolby Digital) audio which may be embedded in m4v, but never mp4 - is less of a problem for your decoder. BR, Alex Cohn From jyavenard at gmail.com Sun May 6 10:28:14 2012 From: jyavenard at gmail.com (Jean-Yves Avenard) Date: Sun, 6 May 2012 18:28:14 +1000 Subject: [Libav-user] Determining video container format of streamed file after url_open In-Reply-To: References: Message-ID: On 6 May 2012 17:05, Alex Cohn wrote: > The difference between mp4 and m4v is often illusionary, see > http://en.wikipedia.org/wiki/M4V and > https://discussions.apple.com/thread/2309476?start=0&tstart=0 for some > details. The big issue is DRM, which may render the mv4 file > impossible to decode with ffmpeg. The AC3 (Dolby Digital) audio which > may be embedded in m4v, but never mp4 - is less of a problem for your > decoder. I guess I didn't explain myself properly.. I want to distinguish mp4/m4vm from all others containers (be it AVI, mkv, whatever) It's not about distinguishing mp4 vs m4v... From alexcohn at netvision.net.il Sun May 6 12:25:08 2012 From: alexcohn at netvision.net.il (Alex Cohn) Date: Sun, 6 May 2012 13:25:08 +0300 Subject: [Libav-user] Determining video container format of streamed file after url_open In-Reply-To: References: Message-ID: On Sun, May 6, 2012 at 11:28 AM, Jean-Yves Avenard wrote: > On 6 May 2012 17:05, Alex Cohn wrote: >> The difference between mp4 and m4v is often illusionary, see >> http://en.wikipedia.org/wiki/M4V and >> https://discussions.apple.com/thread/2309476?start=0&tstart=0 for some >> details. The big issue is DRM, which may render the mv4 file >> impossible to decode with ffmpeg. The AC3 (Dolby Digital) audio which >> may be embedded in m4v, but never mp4 - is less of a problem for your >> decoder. > > I guess I didn't explain myself properly.. > > I want to distinguish mp4/m4vm from all others containers (be it AVI, > mkv, whatever) > > It's not about distinguishing mp4 vs m4v... It's very easy to check for mov file format: open it, read first 8 bytes, and check for '\0\0\0' . 'ftyp'. Note that byte number 3 is not fixed. see http://echoone.com/filejuicer/formats/mov-repair for more info. BR, Alex Cohn From sendtofaraway at gmail.com Sun May 6 17:27:41 2012 From: sendtofaraway at gmail.com (=?GB2312?B?zrrC1w==?=) Date: Sun, 6 May 2012 23:27:41 +0800 Subject: [Libav-user] AVFilter to do YUV->RGB Message-ID: In the traditional way , We usually convert the yuv to rgb using libswscale . But, I notice that the avfilter can do this work too . Do this two way make some different in performance? which way is now recommended? -------------- next part -------------- An HTML attachment was scrubbed... URL: From bruce at spearmorgan.com Sun May 6 18:32:36 2012 From: bruce at spearmorgan.com (Bruce Wheaton) Date: Sun, 6 May 2012 09:32:36 -0700 Subject: [Libav-user] Switching codecs from encode to playback on the fly In-Reply-To: References: <698EE6B3-D212-40B2-8413-420238C3E743@spearmorgan.com> Message-ID: <26BFD1D9-C84E-460E-8FC8-8FA5CCC92A56@spearmorgan.com> On May 5, 2012, at 9:16 PM, Alex Cohn wrote: > On May 6, 2012 6:28 AM, "Bruce Wheaton" wrote: > > > > Is it possible to open codecs for encoding, and use them to encode a complete piece, then, on the fly (when the complete clip had already been encoded) switch over and use them to decompress the same media? > > > > I'm flexible on which codecs, although I like MP4 for being LGPL and good at multi-threading. > > > > To the best of my knowledge, encoders and decoders are completely separate. But nothing can prevent you from creating both at initialization time, and using the encoder or decoder whenever you need that. > Thanks. I wasn't really aware of that distinction. Ah, I see. avcodec_find_decoder versus avcodec_find_encoder. Then I suppose the question becomes, can I use the same AVFormatContext with encoders and decoders? and use the same AVStreams? Bruce From nicolas.george at normalesup.org Sun May 6 18:57:52 2012 From: nicolas.george at normalesup.org (Nicolas George) Date: Sun, 6 May 2012 18:57:52 +0200 Subject: [Libav-user] AVFilter to do YUV->RGB In-Reply-To: References: Message-ID: <20120506165752.GA30586@phare.normalesup.org> L'octidi 18 flor?al, an CCXX, ?? a ?crit?: > In the traditional way , We usually convert the yuv to rgb using > libswscale . > But, I notice that the avfilter can do this work too . Do this two way make > some different in performance? > which way is now recommended? The filter in lavfi that does the colorspace conversion is the scale filter, and it is implemented using libswscale. Therefore the code that does the work is the same, and so is the speed. Using libavfilter would add a small additional overhead, but it is probably negligible compared to the conversion itself, unless the frame is very small. 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 alexcohn at netvision.net.il Sun May 6 20:04:34 2012 From: alexcohn at netvision.net.il (Alex Cohn) Date: Sun, 6 May 2012 21:04:34 +0300 Subject: [Libav-user] Switching codecs from encode to playback on the fly In-Reply-To: <26BFD1D9-C84E-460E-8FC8-8FA5CCC92A56@spearmorgan.com> References: <698EE6B3-D212-40B2-8413-420238C3E743@spearmorgan.com> <26BFD1D9-C84E-460E-8FC8-8FA5CCC92A56@spearmorgan.com> Message-ID: On May 6, 2012 7:32 PM, "Bruce Wheaton" wrote: > > On May 5, 2012, at 9:16 PM, Alex Cohn wrote: > > > On May 6, 2012 6:28 AM, "Bruce Wheaton" wrote: > > > > > > Is it possible to open codecs for encoding, and use them to encode a complete piece, then, on the fly (when the complete clip had already been encoded) switch over and use them to decompress the same media? > > > > > > I'm flexible on which codecs, although I like MP4 for being LGPL and good at multi-threading. > > > > > > > To the best of my knowledge, encoders and decoders are completely separate. But nothing can prevent you from creating both at initialization time, and using the encoder or decoder whenever you need that. > > > Thanks. I wasn't really aware of that distinction. Ah, I see. avcodec_find_decoder versus avcodec_find_encoder. > > Then I suppose the question becomes, can I use the same AVFormatContext with encoders and decoders? and use the same AVStreams? > > Bruce They were never designed for such reuse; but even if you could, what kind of profit would you gain? These objects are negligebly small compared to video data you must cache anyway. Alex -------------- next part -------------- An HTML attachment was scrubbed... URL: From bruce at spearmorgan.com Sun May 6 21:28:02 2012 From: bruce at spearmorgan.com (Bruce Wheaton) Date: Sun, 6 May 2012 12:28:02 -0700 Subject: [Libav-user] Switching codecs from encode to playback on the fly In-Reply-To: References: <698EE6B3-D212-40B2-8413-420238C3E743@spearmorgan.com> <26BFD1D9-C84E-460E-8FC8-8FA5CCC92A56@spearmorgan.com> Message-ID: <4725CD91-6B48-488E-BF71-D0585E66A39B@spearmorgan.com> On May 6, 2012, at 11:04 AM, Alex Cohn wrote:> > > Then I suppose the question becomes, can I use the same AVFormatContext with encoders and decoders? and use the same AVStreams? > > > > Bruce > > They were never designed for such reuse; but even if you could, what kind of profit would you gain? These objects are negligebly small compared to video data you must cache anyway. > > Good question. The intent is to seamlessly move from ingesting a movie and viewing it to playing back. I can't find a way to access the same movie for playback as it's being ingested (that would work fine too), can't tell which media container might support that even. So my workaround was to get frames, cache them for playback and record at the same time. I was hoping to use all the same structures to minimize the interruption as I switch between modes. It was more the time to set up the new structures - opening the movie file etc. that was a pain, and having to have a double set of structures that will bloat my playback code. Bruce -------------- next part -------------- An HTML attachment was scrubbed... URL: From alexcohn at netvision.net.il Sun May 6 21:36:16 2012 From: alexcohn at netvision.net.il (Alex Cohn) Date: Sun, 6 May 2012 22:36:16 +0300 Subject: [Libav-user] Switching codecs from encode to playback on the fly In-Reply-To: <4725CD91-6B48-488E-BF71-D0585E66A39B@spearmorgan.com> References: <698EE6B3-D212-40B2-8413-420238C3E743@spearmorgan.com> <26BFD1D9-C84E-460E-8FC8-8FA5CCC92A56@spearmorgan.com> <4725CD91-6B48-488E-BF71-D0585E66A39B@spearmorgan.com> Message-ID: On May 6, 2012 10:28 PM, "Bruce Wheaton" wrote: > > On May 6, 2012, at 11:04 AM, Alex Cohn wrote:> >> >> > Then I suppose the question becomes, can I use the same AVFormatContext with encoders and decoders? and use the same AVStreams? >> > >> > Bruce >> >> They were never designed for such reuse; but even if you could, what kind of profit would you gain? These objects are negligebly small compared to video data you must cache anyway. >> >> > Good question. The intent is to seamlessly move from ingesting a movie and viewing it to playing back. I can't find a way to access the same movie for playback as it's being ingested (that would work fine too), can't tell which media container might support that even. So my workaround was to get frames, cache them for playback and record at the same time. > > I was hoping to use all the same structures to minimize the interruption as I switch between modes. It was more the time to set up the new structures - opening the movie file etc. that was a pain, and having to have a double set of structures that will bloat my playback code. > > Bruce Can you describe your intended usage in some kind of very high level pseudocode? Alex -------------- next part -------------- An HTML attachment was scrubbed... URL: From kalileo at universalx.net Mon May 7 04:16:04 2012 From: kalileo at universalx.net (Kalileo) Date: Mon, 7 May 2012 09:16:04 +0700 Subject: [Libav-user] Switching codecs from encode to playback on the fly In-Reply-To: <4725CD91-6B48-488E-BF71-D0585E66A39B@spearmorgan.com> References: <698EE6B3-D212-40B2-8413-420238C3E743@spearmorgan.com> <26BFD1D9-C84E-460E-8FC8-8FA5CCC92A56@spearmorgan.com> <4725CD91-6B48-488E-BF71-D0585E66A39B@spearmorgan.com> Message-ID: <2B0B356D-DEA5-4838-9609-50CAB9B17F51@universalx.net> On May 7, 2012, at 02:28 , Bruce Wheaton wrote: > Good question. The intent is to seamlessly move from ingesting a movie and viewing it to playing back. I can't find a way to access the same movie for playback as it's being ingested (that would work fine too), can't tell which media container might support that even. So my workaround was to get frames, cache them for playback and record at the same time. > > I was hoping to use all the same structures to minimize the interruption as I switch between modes. It was more the time to set up the new structures - opening the movie file etc. that was a pain, and having to have a double set of structures that will bloat my playback code. Why don't you simply play the movie _before_ you encode it, when you still have the raw data? From bruce at spearmorgan.com Mon May 7 06:03:17 2012 From: bruce at spearmorgan.com (Bruce Wheaton) Date: Sun, 6 May 2012 21:03:17 -0700 Subject: [Libav-user] Switching codecs from encode to playback on the fly In-Reply-To: <2B0B356D-DEA5-4838-9609-50CAB9B17F51@universalx.net> References: <698EE6B3-D212-40B2-8413-420238C3E743@spearmorgan.com> <26BFD1D9-C84E-460E-8FC8-8FA5CCC92A56@spearmorgan.com> <4725CD91-6B48-488E-BF71-D0585E66A39B@spearmorgan.com> <2B0B356D-DEA5-4838-9609-50CAB9B17F51@universalx.net> Message-ID: On May 6, 2012, at 7:16 PM, Kalileo wrote: >> code. > > Why don't you simply play the movie _before_ you encode it, when you still have the raw data? I'd like to do both at once. Play the raw frames, and pass them for encoding, then at the end, finalize the movie and switch to playback mode. Bruce From bruce at spearmorgan.com Mon May 7 06:09:42 2012 From: bruce at spearmorgan.com (Bruce Wheaton) Date: Sun, 6 May 2012 21:09:42 -0700 Subject: [Libav-user] Switching codecs from encode to playback on the fly In-Reply-To: References: <698EE6B3-D212-40B2-8413-420238C3E743@spearmorgan.com> <26BFD1D9-C84E-460E-8FC8-8FA5CCC92A56@spearmorgan.com> <4725CD91-6B48-488E-BF71-D0585E66A39B@spearmorgan.com> Message-ID: <14DB3941-A35E-463C-BD96-F0282358214D@spearmorgan.com> On May 6, 2012, at 12:36 PM, Alex Cohn wrote: > > Good question. The intent is to seamlessly move from ingesting a movie and viewing it to playing back. I can't find a way to access the same movie for playback as it's being ingested (that would work fine too), can't tell which media container might support that even. So my workaround was to get frames, cache them for playback and record at the same time. > > > > I was hoping to use all the same structures to minimize the interruption as I switch between modes. It was more the time to set up the new structures - opening the movie file etc. that was a pain, and having to have a double set of structures that will bloat my playback code. > > > > Bruce > > Can you describe your intended usage in some kind of very high level pseudocode? > > Umm, I think so: Open movie for encode and playback (or stream) for each source movie frame { pass to display function encode and pass to movie for saving if (lastFrame) { finalizeMovie switch to playback mode } } while !lastFrame for each frame on disk (allowing seek and shuttle now) { pass to display function } Sorta. It's that changeover, and making it quick and clean I'm wondering about. Whether I should just treat it, from an ffmpeg point of view, as a completely separate step. Since all the movie details are already know in the encoding, I was wondering if I could use that. Bruce -------------- next part -------------- An HTML attachment was scrubbed... URL: From alexcohn at netvision.net.il Mon May 7 12:05:45 2012 From: alexcohn at netvision.net.il (Alex Cohn) Date: Mon, 7 May 2012 13:05:45 +0300 Subject: [Libav-user] Switching codecs from encode to playback on the fly In-Reply-To: <14DB3941-A35E-463C-BD96-F0282358214D@spearmorgan.com> References: <698EE6B3-D212-40B2-8413-420238C3E743@spearmorgan.com> <26BFD1D9-C84E-460E-8FC8-8FA5CCC92A56@spearmorgan.com> <4725CD91-6B48-488E-BF71-D0585E66A39B@spearmorgan.com> <14DB3941-A35E-463C-BD96-F0282358214D@spearmorgan.com> Message-ID: On Mon, May 7, 2012 at 7:09 AM, Bruce Wheaton wrote: > On May 6, 2012, at 12:36 PM, Alex Cohn wrote: > >> Good question. The intent is to seamlessly move from ingesting a movie and >> viewing it to playing back. I can't find a way to access the same movie for >> playback as it's being ingested (that would work fine too), can't tell which >> media container might support that even. So my workaround was to get frames, >> cache them for playback and record at the same time. >> >> I was hoping to use all the same structures to minimize the interruption >> as I switch between modes. It was more the time to set up the new structures >> - opening the movie file etc. that was a pain, and having to have a double >> set of structures that will bloat my playback code. >> >> Bruce > > Can you describe your intended usage in some kind of very high level > pseudocode? > > Umm, I think so: > > Open movie for encode and playback (or stream) > > for each source movie frame { > ? ? pass to display function > ? ? encode and pass to movie for saving > > ? ? if (lastFrame) { > ? ? ? ? finalizeMovie > switch to playback mode > ? ? ?} > } while !lastFrame > > for each frame on disk (allowing seek and shuttle now) { > ? ? ?pass to display function > } > > Sorta. > > It's that changeover, and making it quick and clean I'm wondering about. > Whether I should just treat it, from an ffmpeg point of view, as a > completely separate step. Since all the movie details are already know in > the encoding, I was wondering if I could use that. > > Bruce Unfortunately, AVFormatContext Struct Reference [http://ffmpeg.org/doxygen/trunk/structAVFormatContext.html] says explicitly that this object can only be iformat or oformat, not both at the same time. As for AVStream, there is no explicit prohibition, but this structure is not populated by user during demuxing/decoding, thus you will gain nothing if you attempt to reuse it (the decoder will rebuild it anyway). BR, Alex From onlineweinies at bluewin.ch Mon May 7 14:20:41 2012 From: onlineweinies at bluewin.ch (Beni Weine) Date: Mon, 7 May 2012 12:20:41 +0000 (GMT+00:00) Subject: [Libav-user] av_open_input_file takes a while In-Reply-To: References: Message-ID: <4119886.94821336393241407.JavaMail.webmail@bluewin.ch> Flag AVFMT_FLAG_IGNIDX might help. We're using it with one of the latest libav (similar to ffmpeg) builds. I don't know if the flag works with ffmpeg. In our case we are having fragmented video files, which do not contain any hint data at all. This makes the av_open_input_file (or avformat_open_input as it called now) a lenghty procedure as well. But watchout: Fast load can lead to a (first time) slow seek. Based on my experience, an index is required for seeking. The first time you wish to seek, the library creates an index. Beni -- code -- if( mIsFastload ) { mFormatContext = avformat_alloc_context(); mFormatContext->flags |= AVFMT_FLAG_IGNIDX; } avformat_open_input( &mFormatContext, mFilePath.toStdString().c_str(), NULL, NULL ) ----Urspr?ngliche Nachricht---- Von: mika_rajala_2 at hotmail.com Datum: 03.05.2012 11:22 An: Betreff: [Libav-user] av_open_input_file takes a while Hi I'm using the method avformat_open_input to load a ~2GB h264 encoded video file. int err = avformat_open_input(&m_formatContext, path, NULL, NULL); This takes a bit too long however, is there any way to make it faster? -mika _______________________________________________ Libav-user mailing list Libav- user at ffmpeg.org http://ffmpeg.org/mailman/listinfo/libav-user From wagner.patriota at gmail.com Mon May 7 16:14:17 2012 From: wagner.patriota at gmail.com (Wagner Patriota) Date: Mon, 7 May 2012 11:14:17 -0300 Subject: [Libav-user] How to redirect FFMPEG output to a socket In-Reply-To: <201205042332.09605.info@denisgottardello.it> References: <201205032154.14961.info@denisgottardello.it> <201205042332.09605.info@denisgottardello.it> Message-ID: no, it's easier... example: if you have myprotocol.c, just add to Makefile the following line: OBJS-$(CONFIG_MYPROTOCOL_PROTOCOL) += myprotocol.o that's it... look for the session "protocols I/O" in the Makefile On Fri, May 4, 2012 at 6:32 PM, Denis wrote: > In data venerd? 04 maggio 2012 19:10:51, Wagner Patriota ha scritto: > > yes... sure... > > this is still a skeleton, but it's already working... > > > > In MY CASE, I have a socket already open... sending and receiving some > > information already... I need to use the same socket to send the output > of > > ffmpeg... everything I do is "equivalent" to type, for example: "ffmpeg > -i > > inputfile socket://8989" > > > > so my application send the output to the socket with handle 8989... the > > code below is enough... maybe I will do some optmization later, but it > > works pretty fine. > > > > In order to implement my onw URLProcotol the speps are: > > - Add to libavformat/file.c my procolol "CONFIG_BUFFER_PROTOCOL" > - Addo to config.mak "CONFIG_BUFFER_PROTOCOL" > > And then? Wich are the next steps? > > Thank you. > > > > -- > 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 bruce at spearmorgan.com Mon May 7 18:55:29 2012 From: bruce at spearmorgan.com (Bruce Wheaton) Date: Mon, 7 May 2012 09:55:29 -0700 Subject: [Libav-user] Switching codecs from encode to playback on the fly In-Reply-To: References: <698EE6B3-D212-40B2-8413-420238C3E743@spearmorgan.com> <26BFD1D9-C84E-460E-8FC8-8FA5CCC92A56@spearmorgan.com> <4725CD91-6B48-488E-BF71-D0585E66A39B@spearmorgan.com> <14DB3941-A35E-463C-BD96-F0282358214D@spearmorgan.com> Message-ID: On May 7, 2012, at 3:05 AM, Alex Cohn wrote: > > Unfortunately, AVFormatContext Struct Reference > [http://ffmpeg.org/doxygen/trunk/structAVFormatContext.html] says > explicitly that this object can only be iformat or oformat, not both > at the same time. > > As for AVStream, there is no explicit prohibition, but this structure > is not populated by user during demuxing/decoding, thus you will gain > nothing if you attempt to reuse it (the decoder will rebuild it > anyway). OK, thank you Alex. No shortcuts for me. Bruce From curer57458 at mypacks.net Mon May 7 20:38:56 2012 From: curer57458 at mypacks.net (curer57458 at mypacks.net) Date: Mon, 7 May 2012 11:38:56 -0700 (GMT-07:00) Subject: [Libav-user] error avformat.h: avformat undeclared Message-ID: <26792511.1336415936887.JavaMail.root@mswamui-andean.atl.sa.earthlink.net> Hi libav user, Where is AVFormat declared for the ffmpeg header file avformat.h found in /usr/include/libavformat/avformat.h? libavutil 51. 34.101 / 51. 34.101 libavcodec 53. 60.100 / 53. 60.100 libavformat 53. 31.100 / 53. 31.100 libavdevice 53. 4.100 / 53. 4.100 libavfilter 2. 60.100 / 2. 60.100 libswscale 2. 1.100 / 2. 1.100 libswresample 0. 6.100 / 0. 6.100 libpostproc 52. 0.100 / 52. 0.100 The compilation error is from an application including the header file avformat.h: error: ?AVPacket? was not declared in this scope This error was also there with an older version of libavformat: 52 75 0. A google search was not helpful in finding out where AVFormat is declared. Are there some CFLAGS that are needed to work with avformat.h, or what is missing? Also, the older version avformat.h 52 75 0 had the version defined in a MACRO and had a comment with swear words in it and "douchebag" while the newer version 53 31 100 did not. From alexcohn at netvision.net.il Mon May 7 21:04:48 2012 From: alexcohn at netvision.net.il (Alex Cohn) Date: Mon, 7 May 2012 22:04:48 +0300 Subject: [Libav-user] error avformat.h: avformat undeclared In-Reply-To: <26792511.1336415936887.JavaMail.root@mswamui-andean.atl.sa.earthlink.net> References: <26792511.1336415936887.JavaMail.root@mswamui-andean.atl.sa.earthlink.net> Message-ID: On May 7, 2012 9:39 PM, wrote: > > Hi libav user, > > Where is AVFormat declared for the ffmpeg header file avformat.h found in /usr/include/libavformat/avformat.h? > > libavutil 51. 34.101 / 51. 34.101 > libavcodec 53. 60.100 / 53. 60.100 > libavformat 53. 31.100 / 53. 31.100 > libavdevice 53. 4.100 / 53. 4.100 > libavfilter 2. 60.100 / 2. 60.100 > libswscale 2. 1.100 / 2. 1.100 > libswresample 0. 6.100 / 0. 6.100 > libpostproc 52. 0.100 / 52. 0.100 > > The compilation error is from an application including the header file avformat.h: > error: ?AVPacket? was not declared in this scope > > This error was also there with an older version of libavformat: 52 75 0. > A google search was not helpful in finding out where AVFormat is declared. Are there some CFLAGS that are needed to work with avformat.h, or what is missing? Also, the older version avformat.h 52 75 0 had the version defined in a MACRO and had a comment with swear words in it and "douchebag" while the newer version 53 31 100 did not. If your source is C++, you must include av headers like extern "C" { #include "avformat.h" } BR, Alex Cohn -------------- next part -------------- An HTML attachment was scrubbed... URL: From curer57458 at mypacks.net Mon May 7 22:30:45 2012 From: curer57458 at mypacks.net (curer57458 at mypacks.net) Date: Mon, 7 May 2012 13:30:45 -0700 (GMT-07:00) Subject: [Libav-user] error avformat.h: avformat undeclared Message-ID: <33257652.1336422645856.JavaMail.root@mswamui-andean.atl.sa.earthlink.net> > Where is AVFormat declared for the ffmpeg header file avformat.h found in /usr/include/libavformat/avformat.h? Meant to say Where is AVPacket declared for the ffmpeg header file avformat.h. > If your source is C++, you must include av headers like > extern "C" { > #include "avformat.h" > } The source files are CPP and H files. They are declared with extern this way for including avformat.h: extern "C" { ... #include ...}. Changing the < > to " " and running make clean, make does not change the undeclared AVPacket. There was a header file that had declared AVPacket /usr/include/libavcodec/avcodec.h, but including it did not solve the problem as it is still considered AVPacket undeclared. On reading the file avformat.h, it does not declare AVPacket. What header file or source file for ffmpeg declares this variable AVPacket? Using c++-4.5 and gcc-4.5. Also tried gcc-3.3. From curer57458 at mypacks.net Mon May 7 23:05:11 2012 From: curer57458 at mypacks.net (curer57458 at mypacks.net) Date: Mon, 7 May 2012 14:05:11 -0700 (GMT-07:00) Subject: [Libav-user] error avformat.h: avformat undeclared Message-ID: <5949114.1336424711071.JavaMail.root@mswamui-andean.atl.sa.earthlink.net> >Meant to say Where is AVPacket declared for the ffmpeg header file avformat.h. > Did find that avformat.h includes libavcodec/avcodec.h, so not necessary to include it separately. It looks like part of the compile error could be from a different header file tree being used first, as there are a few different ffmpeg builds. The correct header file should be /usr/include/libavcodec.h, and the other file(s) should not be included. Solving this include directory path error should solve the original problem. > avcodec.h, but including it did not solve the problem as it is still considered AVPacket undeclared. This seems to be from a different avcodec.h being included from another ffmpeg branch. Will try to sort this out. From gstream at ccc2.com Tue May 8 08:11:26 2012 From: gstream at ccc2.com (gstream at ccc2.com) Date: Mon, 7 May 2012 23:11:26 -0700 Subject: [Libav-user] force rtsp input over tcp Message-ID: <1c3903c3262c26c01905762979fc421c.squirrel@webmail.ccc2.com> Hi All, I have noted that a rtsp input will rollover to TCP if an UDP timeout occurs. Can I force TCP as an option so UDP is not the default? I have tried -i "rtsp://xx.xx.xx.xx:yyyy/blah?tcp" with... ..."Invalid data found when processing input" thanks Art From i.like.privacy.too at gmail.com Tue May 8 18:52:34 2012 From: i.like.privacy.too at gmail.com (Camera Man) Date: Tue, 08 May 2012 12:52:34 -0400 Subject: [Libav-user] force rtsp input over tcp In-Reply-To: <1c3903c3262c26c01905762979fc421c.squirrel@webmail.ccc2.com> References: <1c3903c3262c26c01905762979fc421c.squirrel@webmail.ccc2.com> Message-ID: <4FA94F52.4090802@gmail.com> An HTML attachment was scrubbed... URL: From info at denisgottardello.it Tue May 8 21:02:24 2012 From: info at denisgottardello.it (Denis) Date: Tue, 8 May 2012 21:02:24 +0200 Subject: [Libav-user] How to redirect FFMPEG output to a socket In-Reply-To: References: <201205042332.09605.info@denisgottardello.it> Message-ID: <201205082102.24385.info@denisgottardello.it> In data luned? 07 maggio 2012 16:14:17, Wagner Patriota ha scritto: > no, it's easier... example: if you have myprotocol.c, just add to Makefile > the following line: > > OBJS-$(CONFIG_MYPROTOCOL_PROTOCOL) += myprotocol.o > > that's it... look for the session "protocols I/O" in the Makefile I don't understand. I have placed a file called "bufferptocolo.c" in "ffmpeg-0.10.2/libavformat/" folder. Then in the "ffmpeg-0.10.2/libavformat/makefile" file I have added this row "OBJS-$(CONFIG_BUFFER_PROTOCOL) += bufferprotocol.o" but the file is not compiled. No error has reported. The file contains this: #if CONFIG_BUFFER_PROTOCOL static int buffer_open(URLContext *h, const char *filename, int flags) { printf("buffer_open\n"); return 0; } static int buffer_read(URLContext *h, unsigned char *buf, int size) { printf("buffer_read\n"); return (-1 == r)?AVERROR(errno):r; } static int buffer_write(URLContext *h, const unsigned char *buf, int size) { printf("buffer_write\n"); return (-1 == r)?AVERROR(errno):r; } static int64_t buffer_seek(URLContext *h, int64_t pos, int whence) { printf("buffer_seek\n"); return 0; } static int buffer_close(URLContext *h) { printf("buffer_seek\n"); return 0; } static int buffer_get_handle(URLContext *h) { printf("buffer_get_handle\n"); return (intptr_t) h->priv_data; } static int buffer_check(URLContext *h, int mask) { printf("buffer_check\n"); return 0; } URLProtocol ff_buffer_protocol = { .name = "buffer", .url_open = buffer_open, .url_read = buffer_read, .url_write = buffer_write, .url_seek = buffer_seek, .url_close = buffer_close, .url_get_file_handle = buffer_get_handle, .url_check = buffer_check, }; #endif /* CONFIG_BUFFER_PROTOCOL */ Have you got any idea? -- www.denisgottardello.it Skype: mrdebug Videosurveillance and home automation! http://www.denisgottardello.it/DomusBoss/DomusBossIndice.php From lizhang at utelisys.com Wed May 9 11:38:30 2012 From: lizhang at utelisys.com (Li Zhang) Date: Wed, 9 May 2012 11:38:30 +0200 Subject: [Libav-user] PCR value for TS stream Message-ID: Hi, I used the TS container to encapsulate my H264 and AAC. I want to use the PCR value to control UDP sending. However, I found that the PCR value I got from ffmpeg is very strange. Firstly, some of the pcr value is super big and abnormal, such as pcr_extention:475,pcr_base:2127168108, pcr_extention:111,pcr_base:1162685276 ------------------pcr_extention:0,------------------pcr_base:18590400 ------------------pcr_extention:0,------------------pcr_base:18597600 ------------------pcr_extention:0,------------------pcr_base:18604800 ------------------pcr_extention:0,------------------pcr_base:18612000 ------------------pcr_extention:227,------------------pcr_base:18446744073583863388 ------------------pcr_extention:0,------------------pcr_base:18619200 ------------------pcr_extention:0,------------------pcr_base:18626400 ------------------pcr_extention:0,------------------pcr_base:18633600 ------------------pcr_extention:0,------------------pcr_base:18640800 Secondly, I found the difference between two PCR value is 7200 or 3600, which is 80ms or 40ms. And there are twenty-four 80ms and only two 40ms every 26 differences. According the standard, TS stream should have a pcr value at least 40ms. So I do not know why. Here is the code I used to parse PCR value, I hope it is correct. int i=0; //position pointer iterator int buf_size = 0; //the length of data packet uint8_t *buf = NULL; //data packet pointer uint8_t *position = NULL; //starting point for each 188B uint8_t adaption_field = 0; //adaption field existing flag unsigned int pcr_flag; //pcr existing flag uint8_t *pcr_field = NULL; //pcr field pointer uint64_t pcr_base; //base part of pcr unsigned int pcr_ext; //extentions part of pcr for(i=0;i>4; if(adaption_field > 1) { pcr_flag = (position[5] & 0x10)>>4; if(pcr_flag == 1) { pcr_field = position + 6; pcr_base = (pcr_field[0] * 0x2000000) + (pcr_field[1] * 0x20000) + (pcr_field[2] * 0x200) + (pcr_field[3] * 0x02) + ((pcr_field[4] & 0x80) >> 7); pcr_ext = ((pcr_field[4] & 0x01) * 0x100) + pcr_field[5]; printf("------------------pcr_extention:%u,",pcr_ext); printf("------------------pcr_base:%llu \n",pcr_base); } } i += 188; } So does anyone can help me with that? Thanks. Best regards, Li From alexcohn at netvision.net.il Wed May 9 14:22:53 2012 From: alexcohn at netvision.net.il (Alex Cohn) Date: Wed, 9 May 2012 15:22:53 +0300 Subject: [Libav-user] Empty .MTS output videos when using -ss command line argument In-Reply-To: References: Message-ID: On Mon, Apr 16, 2012 at 7:05 PM, Simon Daniels wrote: > Hi guys, > > I have a set of .MTS files that I'm trying to splice. If I start at 0:00:00, > the output video works fine. But if I start splicing any time after 0:00:00, > the output video is empty. I've used the exact same command line with other > .MTS files and had no problem. It seems like something specific to this > Panasonic Lumix camera. MP4 and MOV files work fine too. > > This repros in FFmpeg HEAD-8dfb13e, 0.10.2, and 0.8.3. > > Any ideas? Thanks! > > Users-MacBook-Pro:ffmpeg-0.10.2 user$ ./ffmpeg -ss 00:00:01 -t 00:00:25 -i > 00004.MTS -threads 3 -acodec copy -vcodec copy "output.MTS" Your input video stream has only one keyframe, which is the first frame. For h264, -vcodec copy can only start writing video from a keyframe. That's why it produces 0 frames in the end. BR, Alex Cohn From jyavenard at gmail.com Wed May 9 18:17:41 2012 From: jyavenard at gmail.com (Jean-Yves Avenard) Date: Thu, 10 May 2012 02:17:41 +1000 Subject: [Libav-user] HTTP Live streaming: using demuxer Message-ID: Hi I can easily play a HLS stream, simply by using ffurl_open(&m_context, url, AVIO_FLAG_READ, NULL, NULL); I just need to have my url starts with applehttp (obsolete) or hls+http So the url would be a string with: http://192.168.10.11:45631/live-playback-2.4.0/index_3c136413-ba6b-4dcb-b42f-0f1aff9c30bd.m3u8 when doing so however, I see the message [hls @ 0x10ab95340] 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. (If not, please report it.) To use the demuxer, simply use http://192.168.10.11:45631/live-playback-2.4.0/index_3c136413-ba6b-4dcb-b42f-0f1aff9c30bd.m3u8 Also, when using this method, seek do not work (along with other feature) So I would like to use the demuxer. But how would you do so ? Could anyone provide an example on how to use the hls demuxer (or any demuxer for that matter) Thanks in advance JY From nrson at win4net.com Thu May 10 02:51:26 2012 From: nrson at win4net.com (nrson) Date: Thu, 10 May 2012 09:51:26 +0900 Subject: [Libav-user] =?utf-8?q?How_to_decode_the_avcodec=5Fdecode=5Fvideo?= =?utf-8?q?2=28=29_using_lowres=3F?= Message-ID: <5d4d7cf7832ff50e39a2640fc6ea8d67@win4net.com> Hi ffmpeg users! I?ve been trying to speed down for H.264 decoder. I know the lowres is low resolution supported by the decoder. When decoding after setting the lowres(1), the results of avcodec_decode_video2() occur the errors. My program is as following: bool init_first = true; main() { FILE *fp, *ifs; uint8_t buf[1024*10]; char *InFileStream = "InStream.264"; char *InFileData = "InStreamSize.txt"; fp = fopen("a.264", "rb"); ifs = fopen("InStreamSize.txt", "rb"); AVCodec* codec; AVCodecContext* context; AVFrame* picture; AVPacket avpkt; int frame = 0; AVFrame* pFrameRGB; int numBytes; uint8_t *pFrameRGB_buffer; BYTE *inbuf = new BYTE [1000000]; LPBYTE pbtYuv = NULL; pbtYuv = new BYTE [ 1920 * 1080 * 2 ]; int nEncSize, len; av_register_all(); //register all the codecs avcodec_register_all(); avcodec_init(); av_init_packet(&avpkt); codec = avcodec_find_decoder(CODEC_ID_H264); //find the H264 video decoder if(!codec) { fprintf(stderr, "codec not found\n"); ReleaseMutex(hMutex); return false; } context = avcodec_alloc_context(); picture = avcodec_alloc_frame(); pFrameRGB = avcodec_alloc_frame(); context->flags |= CODEC_FLAG_PART; context-->workaround_bugs = 1; context->error_concealment = 3; context->error_recognition = 1; context->pix_fmt = PIX_FMT_YUV420P; context->width = nWidth; context->height = nHeight; context->skip_loop_filter = AVDISCARD_ALL; context->skip_frame = AVDISCARD_NONREF; //AVDISCARD_NONREF context->skip_idct = AVDISCARD_ALL; context->idct_algo = 1; context->has_b_frames = 0; context->refs = 1; codec->max_lowres = 1; if(codec->max_lowres) { context->lowres = codec->max_lowres; // 1->1/2 size, 2->1/4 size, 3->1/8 -> error occur context->flags |= CODEC_FLAG_EMU_EDGE; context->flags |= CODEC_FLAG_GRAY; } if(codec->capabilities & CODEC_CAP_TRUNCATED) // & CODEC_CAP_HWACCEL) context->flags |= CODEC_FLAG_TRUNCATED; // we do not send complete frames if (avcodec_open(context, codec) < 0) //open it { fprintf(stderr, "could not open codec\n"); return false; } PixelFormat iFormat = context->pix_fmt; PixelFormat dFormat = PIX_FMT_YUYV422; numBytes = avpicture_get_size(dFormat, context->width, context->height); pFrameRGB_buffer =(uint8_t *)av_malloc(numBytes*sizeof(uint8_t)); avpicture_fill((AVPicture *)pFrameRGB, pFrameRGB_buffer, dFormat, context->width, context->height); for(;;) { ZeroMemory(inbuf, 1000000); fread(&nEncSize, sizeof(DWORD), 1, ifs); fread(inbuf,1,nEncSize, fp); avpkt.size = nEncSize; if(avpkt.size == 0) break; avpkt.data = inbuf; while(avpkt.size >0) { if(init_first == true) { len = avcodec_decode_video2(context, picture, &got_picture, &avpkt); init_first = false; } len = avcodec_decode_video2(context, Picture, &got_picture, &avpkt); if(len < 0) { fprintf(stderr, "Error while decoding frame %d\n", frame); exit(1); } if(got_picture) { struct SwsContext *img_convert_ctx = NULL; img_convert_ctx = sws_getContext( context->width, context->height, context->pix_fmt, context->width, context->height, dFormat, SWS_FAST_BILINEAR, NULL, NULL, NULL); if(img_convert_ctx == NULL) { printf("[CFFH264Decode::MainDecode::SWScale] --- Exception\n"); exit(1); } int ret = sws_scale(img_convert_ctx, picture->data, picture->linesize, 0, context->height, pFrameRGB->data, pFrameRGB->linesize); if(pFrameRGB_buffer) { av_free( pFrameRGB_buffer ); pFrameRGB_buffer = NULL; } sws_freeContext(img_convert_ctx); if(img_convert_ctx != NULL) img_convert_ctx = NULL; frame++; } avpkt.size -= len; avpkt.data += len; } } if(inbuf != NULL || pbtYuv != NULL) { delete [] inbuf; delete [] pbtYuv; } if(context != NULL) { avcodec_close(context); pGBCodec = NULL; av_free(context); context = NULL; av_free(picture); picture = NULL; } fclose(fp); fclose(ifs); } How to solve the problems? Thank you in advances, nrson From krishnaks at iwavesystems.com Thu May 10 09:21:57 2012 From: krishnaks at iwavesystems.com (krishnaks at iwavesystems.com) Date: Thu, 10 May 2012 12:51:57 +0530 Subject: [Libav-user] Getting "Increasing reorder buffer" warning Message-ID: Hi, I am getting following warning How to avoid this warnings. Is this related to memory issue? h264 @ 0x117ee00] Increasing reorder buffer to 2 [h264 @ 0x117ee00] Increasing reorder buffer to 5 [h264 @ 0x117ee00] Increasing reorder buffer to 8 [h264 @ 0x117ee00] Increasing reorder buffer to 9 [h264 @ 0x117ee00] Increasing reorder buffer to 12 [h264 @ 0x117ee00] Increasing reorder buffer to 13 [h264 @ 0x117ee00] Increasing reorder buffer to 16 Regards, KP From krishnaks at iwavesystems.com Thu May 10 09:23:38 2012 From: krishnaks at iwavesystems.com (krishnaks at iwavesystems.com) Date: Thu, 10 May 2012 12:53:38 +0530 Subject: [Libav-user] No accelerated colorspace conversion found from yuv420p to rgba Message-ID: <5a9280293501bc405da856a3556a322b.squirrel@124.124.219.233> Hi, I am getting following warning. [swscaler @ 0x5a34000] No accelerated colorspace conversion found from yuv420p to rgba. How to avoid this? Thanks in advance. Regards, KP From cehoyos at ag.or.at Thu May 10 09:31:43 2012 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Thu, 10 May 2012 07:31:43 +0000 (UTC) Subject: [Libav-user] No accelerated colorspace conversion found from yuv420p to rgba References: <5a9280293501bc405da856a3556a322b.squirrel@124.124.219.233> Message-ID: writes: > I am getting following warning. > > [swscaler @ 0x5a34000] No accelerated colorspace conversion found from > yuv420p to rgba. Command line and complete, uncut console output missing. Carl Eugen From cehoyos at ag.or.at Thu May 10 09:35:58 2012 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Thu, 10 May 2012 07:35:58 +0000 (UTC) Subject: [Libav-user] =?utf-8?q?How_to_decode_the_avcodec=5Fdecode=5Fvideo?= =?utf-8?q?2=28=29_using_lowres=3F?= References: <5d4d7cf7832ff50e39a2640fc6ea8d67@win4net.com> Message-ID: nrson writes: > I?ve been trying to speed down for H.264 decoder. I know the lowres is > low resolution supported by the decoder. lowres is not supported for the H264 decoder. Carl Eugen From alexcohn at netvision.net.il Thu May 10 10:16:49 2012 From: alexcohn at netvision.net.il (Alex Cohn) Date: Thu, 10 May 2012 11:16:49 +0300 Subject: [Libav-user] No accelerated colorspace conversion found from yuv420p to rgba In-Reply-To: <5a9280293501bc405da856a3556a322b.squirrel@124.124.219.233> References: <5a9280293501bc405da856a3556a322b.squirrel@124.124.219.233> Message-ID: On May 10, 2012 10:25 AM, wrote: > > Hi, > > I am getting following warning. > > [swscaler @ 0x5a34000] No accelerated colorspace conversion found from > yuv420p to rgba. > > How to avoid this? > > Thanks in advance. > Regards, > KP What is your platform, version? How did you build the library? BR, Alex -------------- next part -------------- An HTML attachment was scrubbed... URL: From krishnaks at iwavesystems.com Thu May 10 11:08:11 2012 From: krishnaks at iwavesystems.com (krishnaks at iwavesystems.com) Date: Thu, 10 May 2012 14:38:11 +0530 Subject: [Libav-user] No accelerated colorspace conversion found from yuv420p to rgba In-Reply-To: References: <5a9280293501bc405da856a3556a322b.squirrel@124.124.219.233> Message-ID: <5ba5cd7d804f3bce0290606251661659.squirrel@124.124.219.233> Hi, I am using FFmpeg library for decoding H264 frames and display it on iPad. I have cross compiled FFmpeg library for arm architecture. > On May 10, 2012 10:25 AM, wrote: >> >> Hi, >> >> I am getting following warning. >> >> [swscaler @ 0x5a34000] No accelerated colorspace conversion found from >> yuv420p to rgba. >> >> How to avoid this? >> >> Thanks in advance. >> Regards, >> KP > > What is your platform, version? How did you build the library? > > BR, > Alex > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > From krishnaks at iwavesystems.com Thu May 10 11:21:14 2012 From: krishnaks at iwavesystems.com (krishnaks at iwavesystems.com) Date: Thu, 10 May 2012 14:51:14 +0530 Subject: [Libav-user] Getting "Increasing reorder buffer" warning In-Reply-To: References: Message-ID: Hi, Is this warnings coming because of following reason? "The overread happens because your system seems to slow to decode at the speed at which the stream is received" If yes Any solutions? > Hi, > > I am getting following warning > How to avoid this warnings. Is this related to memory issue? > > h264 @ 0x117ee00] Increasing reorder buffer to 2 > [h264 @ 0x117ee00] Increasing reorder buffer to 5 > [h264 @ 0x117ee00] Increasing reorder buffer to 8 > [h264 @ 0x117ee00] Increasing reorder buffer to 9 > [h264 @ 0x117ee00] Increasing reorder buffer to 12 > [h264 @ 0x117ee00] Increasing reorder buffer to 13 > [h264 @ 0x117ee00] Increasing reorder buffer to 16 > > Regards, > KP > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > From alexcohn at netvision.net.il Thu May 10 12:38:22 2012 From: alexcohn at netvision.net.il (Alex Cohn) Date: Thu, 10 May 2012 13:38:22 +0300 Subject: [Libav-user] No accelerated colorspace conversion found from yuv420p to rgba In-Reply-To: <5ba5cd7d804f3bce0290606251661659.squirrel@124.124.219.233> References: <5a9280293501bc405da856a3556a322b.squirrel@124.124.219.233> <5ba5cd7d804f3bce0290606251661659.squirrel@124.124.219.233> Message-ID: On Thu, May 10, 2012 at 12:08 PM, wrote: > Hi, > I am using FFmpeg library for decoding H264 frames and display it on iPad. > I have cross compiled FFmpeg library for arm architecture. Unfortunately, ARM build does not have optimized colorspace conversion. Your options are either do the slow conversion, or accept the video output in its natural yuv420p format. If you use OpenGL to render the video on your iPad, you may try a pixel shader to display the yuv images correctly and efficiently. BR, Alex Cohn >> On May 10, 2012 10:25 AM, wrote: >>> >>> Hi, >>> >>> I am getting following warning. >>> >>> [swscaler @ 0x5a34000] No accelerated colorspace conversion found from >>> yuv420p to rgba. >>> >>> ?How to avoid this? >>> >>> Thanks in advance. >>> Regards, >>> KP >> >> What is your platform, version? How did you build the library? >> >> BR, >> Alex From alexcohn at netvision.net.il Thu May 10 12:43:39 2012 From: alexcohn at netvision.net.il (Alex Cohn) Date: Thu, 10 May 2012 13:43:39 +0300 Subject: [Libav-user] Getting "Increasing reorder buffer" warning In-Reply-To: References: Message-ID: On Thu, May 10, 2012 at 12:21 PM, wrote: > Hi, > Is this warnings coming ?because of following reason? > > "The overread happens because your system seems to slow to decode at the > speed at which the stream is received" Where do you get this message from? > If yes Any solutions? > >> Hi, >> >> I am getting following warning >> How to avoid this warnings. Is this related to memory issue? >> >> h264 @ 0x117ee00] Increasing reorder buffer to 2 >> [h264 @ 0x117ee00] Increasing reorder buffer to 5 >> [h264 @ 0x117ee00] Increasing reorder buffer to 8 >> [h264 @ 0x117ee00] Increasing reorder buffer to 9 >> [h264 @ 0x117ee00] Increasing reorder buffer to 12 >> [h264 @ 0x117ee00] Increasing reorder buffer to 13 >> [h264 @ 0x117ee00] Increasing reorder buffer to 16 >> >> Regards, >> KP Please try to process your video stream with the latest command-line ffmpeg utility. It is possible that the warnings are about the headers of your h264 stream. This may be displayed when the declared number of b-frames is less than the actual, and have nothing to do with the performance of your system. BR, Alex Cohn From krishnaks at iwavesystems.com Thu May 10 14:30:22 2012 From: krishnaks at iwavesystems.com (krishnaks at iwavesystems.com) Date: Thu, 10 May 2012 18:00:22 +0530 Subject: [Libav-user] No accelerated colorspace conversion found from yuv420p to rgba In-Reply-To: References: <5a9280293501bc405da856a3556a322b.squirrel@124.124.219.233> <5ba5cd7d804f3bce0290606251661659.squirrel@124.124.219.233> Message-ID: <0e53f32fa33cbb005646da2dd02bd65f.squirrel@124.124.219.233> Thanx Alex for the info! > On Thu, May 10, 2012 at 12:08 PM, wrote: >> Hi, >> I am using FFmpeg library for decoding H264 frames and display it on >> iPad. >> I have cross compiled FFmpeg library for arm architecture. > > Unfortunately, ARM build does not have optimized colorspace > conversion. Your options are either do the slow conversion, or accept > the video output in its natural yuv420p format. If you use OpenGL to > render the video on your iPad, you may try a pixel shader to display > the yuv images correctly and efficiently. > > BR, > Alex Cohn > >>> On May 10, 2012 10:25 AM, wrote: >>>> >>>> Hi, >>>> >>>> I am getting following warning. >>>> >>>> [swscaler @ 0x5a34000] No accelerated colorspace conversion found from >>>> yuv420p to rgba. >>>> >>>> ?How to avoid this? >>>> >>>> Thanks in advance. >>>> Regards, >>>> KP >>> >>> What is your platform, version? How did you build the library? >>> >>> BR, >>> Alex > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > From krishnaks at iwavesystems.com Thu May 10 14:35:55 2012 From: krishnaks at iwavesystems.com (krishnaks at iwavesystems.com) Date: Thu, 10 May 2012 18:05:55 +0530 Subject: [Libav-user] Getting "Increasing reorder buffer" warning In-Reply-To: References: Message-ID: <111718d84aeff0aad76e10d97137bb63.squirrel@124.124.219.233> I am using FFmpeg library for decoding H264 frames and display it on iPad. iPad is able to display decoded messages. But the "increasing reorder buffer" warning is coming continuously. After this I received memory warning from iPad also. > On Thu, May 10, 2012 at 12:21 PM, wrote: >> Hi, >> Is this warnings coming ?because of following reason? >> >> "The overread happens because your system seems to slow to decode at the >> speed at which the stream is received" > > Where do you get this message from? > >> If yes Any solutions? >> >>> Hi, >>> >>> I am getting following warning >>> How to avoid this warnings. Is this related to memory issue? >>> >>> h264 @ 0x117ee00] Increasing reorder buffer to 2 >>> [h264 @ 0x117ee00] Increasing reorder buffer to 5 >>> [h264 @ 0x117ee00] Increasing reorder buffer to 8 >>> [h264 @ 0x117ee00] Increasing reorder buffer to 9 >>> [h264 @ 0x117ee00] Increasing reorder buffer to 12 >>> [h264 @ 0x117ee00] Increasing reorder buffer to 13 >>> [h264 @ 0x117ee00] Increasing reorder buffer to 16 >>> >>> Regards, >>> KP > > Please try to process your video stream with the latest command-line > ffmpeg utility. It is possible that the warnings are about the headers > of your h264 stream. This may be displayed when the declared number of > b-frames is less than the actual, and have nothing to do with the > performance of your system. > > BR, > Alex Cohn > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > From bobslf at gmail.com Thu May 10 14:43:36 2012 From: bobslf at gmail.com (Bob Self) Date: Thu, 10 May 2012 08:43:36 -0400 Subject: [Libav-user] decoding video frames Message-ID: I'm trying to decode video frames. The decoding loop prints this message: [mpeg4 @ 00823420] Invalid and inefficient vfw-avi packed B frames detected After that it prints these lines over and over: [mpeg4 @ ...] slice end not reached but screenspace end (5 left 78000, score= -2) [mpeg4 @ ...] concealing 1350 DC, 1350 AC, 1350 MV errors What causes these warning messages? Is this the correct way to decode video? thanks, Bob AVCodec *codec; AVCodecContext *codec_ctx= NULL; AVFormatContext *format_ctx=NULL; AVFrame *picture=NULL; int frame, got_picture, len; FILE *f; uint8_t inbuf[INBUF_SIZE + FF_INPUT_BUFFER_PADDING_SIZE]; char buf[1024]; AVPacket avpkt; const char *outfilename = "x.x"; const char *filename = MOVIE; unsigned long frames=0L; int status; int64_t duration = 0; const char *cptr=NULL; unsigned long count=0L; unsigned long total_bytes = 0L; int vidstream = -1; int i; int flags=0; if (!exists(MOVIE)) { printf("can't find %s\n", MOVIE); exit 1; } av_log_set_flags(AV_LOG_SKIP_REPEATED); avcodec_register_all(); av_register_all(); avformat_network_init(); unsigned int codec_version = avcodec_version(); av_init_packet(&avpkt); // avcodec version: 54.10.100 printf("avcodec version = %d.%d.%d\n", (codec_version&0x00ff0000)>>16, (codec_version&0x0000ff00)>>8, codec_version&0x000000ff); // version 52.72.2 format_ctx = avformat_alloc_context(); cptr = MOVIE; status = avformat_open_input(&format_ctx, MOVIE, NULL, NULL); if (status != 0) { printf("error1\n"); goto done; } // find the first video stream for (i=0; i<(int)format_ctx->nb_streams; i++) { if (format_ctx->streams[i]->codec->codec_type == AVMEDIA_TYPE_VIDEO) { vidstream = i; break; } } if (vidstream == -1) { printf("error3\n"); goto done; } // Get a pointer to the codec context for the video stream codec_ctx = format_ctx->streams[vidstream]->codec; frames = (unsigned long)format_ctx->streams[vidstream]->nb_frames; // 154959 double d; d = frames / 23.97; // d = 5170 d /= 3600.0; // d = 1.79 hours memset(inbuf + INBUF_SIZE, 0, FF_INPUT_BUFFER_PADDING_SIZE); codec = avcodec_find_decoder(CODEC_ID_MPEG4); if (!codec) { fprintf(stderr, "codec not found\n"); goto done; } codec_ctx = avcodec_alloc_context3(codec); picture= avcodec_alloc_frame(); if(codec->capabilities&CODEC_CAP_TRUNCATED) { codec_ctx->flags|= CODEC_FLAG_TRUNCATED; // we do not send complete frames } if (avcodec_open2(codec_ctx, codec, NULL) < 0) { fprintf(stderr, "could not open codec\n"); goto done; } f = fopen(filename, "rb"); if (!f) { fprintf(stderr, "could not open %s\n", filename); goto done; } frame = 0; while(1) { avpkt.size = fread(inbuf, 1, INBUF_SIZE, f); count++; total_bytes += avpkt.size; if (avpkt.size == 0) { break; } avpkt.data = inbuf; while (avpkt.size > 0) { len = avcodec_decode_video2(codec_ctx, picture, &got_picture, &avpkt); if (len < 0) { fclose(f); printf("Error while decoding frame %d, count = %ld, total_bytes = %ld\n", frame, count, total_bytes); goto done; } if (got_picture) { frame++; if ((frame%100)==0) { printf("&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& %d\n", frame); } } avpkt.size -= len; avpkt.data += len; } // while (avpkt.size > 0) } // while(1) avpkt.data = NULL; avpkt.size = 0; done: FCLOSE(f); if (format_ctx) { //av_close_input_file(format_ctx); avformat_free_context(format_ctx); } if (codec_ctx) { avcodec_close(codec_ctx); av_free(codec_ctx); } if (picture) { av_free(picture); } From alexcohn at netvision.net.il Thu May 10 16:03:04 2012 From: alexcohn at netvision.net.il (Alex Cohn) Date: Thu, 10 May 2012 17:03:04 +0300 Subject: [Libav-user] decoding video frames In-Reply-To: References: Message-ID: On Thu, May 10, 2012 at 3:43 PM, Bob Self wrote: > I'm trying to decode video frames. The decoding loop prints this message: > ? ? ?[mpeg4 @ 00823420] Invalid and inefficient vfw-avi packed B > frames detected > > After that it prints these lines over and over: > > ? ? ?[mpeg4 @ ...] slice end not reached but screenspace end (5 left > 78000, score= -2) > ? ? ?[mpeg4 @ ...] concealing 1350 DC, 1350 AC, 1350 MV errors > > > What causes these warning messages? Is this the correct way to decode video? > > thanks, > Bob Such problems could be caused by some strange video steams. Therefore it's important to decode your file with the latest command-line ffmpeg. If its output is not as expected, it's also recommended to use alternative players: either the video may be corrupt, or there may be a bug in ffmpeg. But if ffmpeg succeeds, your code must be analyzed for problems. BR, Alex Cohn From alex3.dr at googlemail.com Thu May 10 16:16:21 2012 From: alex3.dr at googlemail.com (Alex Druml) Date: Thu, 10 May 2012 16:16:21 +0200 Subject: [Libav-user] Creating mp4 (h264 codec) video from OpenGL frames In-Reply-To: <4FABCCBA.5060704@gmail.com> References: <4FABCCBA.5060704@gmail.com> Message-ID: <4FABCDB5.4070602@gmail.com> hello! i am currently trying to encode frames (RGB) rendered with opengl into a mp4 file encoded with h264. i already managed to convert the frames from RGB to YUV (swscale) and i use the video_encode_example example from http://git.videolan.org/?p=ffmpeg.git;a=blob;f=doc/examples/decoding_encoding.c;h=cb63294b142f007cf78436c5d81c08a49f3124be;hb=HEAD to encode the frames into a h264 file (vlc already plays the file). now i want to write this encoded file into a common container like mp4. i found a muxing example here http://git.videolan.org/?p=ffmpeg.git;a=blob;f=doc/examples/muxing.c;h=9d338dee670699d07b1f87505d78ee52a17cb920;hb=HEAD but is it possible to write the encoded frames directly into a mp4 file? best regards! From wagner.patriota at gmail.com Thu May 10 16:38:11 2012 From: wagner.patriota at gmail.com (Wagner Patriota) Date: Thu, 10 May 2012 11:38:11 -0300 Subject: [Libav-user] How to redirect FFMPEG output to a socket In-Reply-To: <201205082102.24385.info@denisgottardello.it> References: <201205042332.09605.info@denisgottardello.it> <201205082102.24385.info@denisgottardello.it> Message-ID: should work... maybe you are compiling with "?-disable-protocols" ? http://ffmpeg.org/ffmpeg.html#Protocols On Tue, May 8, 2012 at 4:02 PM, Denis wrote: > In data luned? 07 maggio 2012 16:14:17, Wagner Patriota ha scritto: > > no, it's easier... example: if you have myprotocol.c, just add to > Makefile > > the following line: > > > > OBJS-$(CONFIG_MYPROTOCOL_PROTOCOL) += myprotocol.o > > > > that's it... look for the session "protocols I/O" in the Makefile > > > I don't understand. I have placed a file called "bufferptocolo.c" in > "ffmpeg-0.10.2/libavformat/" folder. Then in the > "ffmpeg-0.10.2/libavformat/makefile" file I have added this row > "OBJS-$(CONFIG_BUFFER_PROTOCOL) += bufferprotocol.o" > but the file is not compiled. No error has reported. > > The file contains this: > > > #if CONFIG_BUFFER_PROTOCOL > > static int buffer_open(URLContext *h, const char *filename, int flags) > { > printf("buffer_open\n"); > return 0; > } > > static int buffer_read(URLContext *h, unsigned char *buf, int size) > { > printf("buffer_read\n"); > return (-1 == r)?AVERROR(errno):r; > } > > static int buffer_write(URLContext *h, const unsigned char *buf, int size) > { > printf("buffer_write\n"); > return (-1 == r)?AVERROR(errno):r; > } > > static int64_t buffer_seek(URLContext *h, int64_t pos, int whence) > { > printf("buffer_seek\n"); > return 0; > } > > static int buffer_close(URLContext *h) > { > printf("buffer_seek\n"); > return 0; > } > > static int buffer_get_handle(URLContext *h) > { > printf("buffer_get_handle\n"); > return (intptr_t) h->priv_data; > } > > static int buffer_check(URLContext *h, int mask) > { > printf("buffer_check\n"); > return 0; > } > > URLProtocol ff_buffer_protocol = { > .name = "buffer", > .url_open = buffer_open, > .url_read = buffer_read, > .url_write = buffer_write, > .url_seek = buffer_seek, > .url_close = buffer_close, > .url_get_file_handle = buffer_get_handle, > .url_check = buffer_check, > }; > > #endif /* CONFIG_BUFFER_PROTOCOL */ > > > Have you got any idea? > > -- > 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 wagner.patriota at gmail.com Thu May 10 16:44:09 2012 From: wagner.patriota at gmail.com (Wagner Patriota) Date: Thu, 10 May 2012 11:44:09 -0300 Subject: [Libav-user] How to redirect FFMPEG output to a socket In-Reply-To: References: <201205042332.09605.info@denisgottardello.it> <201205082102.24385.info@denisgottardello.it> Message-ID: and don't forget to "./configure" again.... it's necessary in order to create the config.h again.... On Thu, May 10, 2012 at 11:38 AM, Wagner Patriota wrote: > should work... > > maybe you are compiling with "?-disable-protocols" ? > http://ffmpeg.org/ffmpeg.html#Protocols > > > On Tue, May 8, 2012 at 4:02 PM, Denis wrote: > >> In data luned? 07 maggio 2012 16:14:17, Wagner Patriota ha scritto: >> > no, it's easier... example: if you have myprotocol.c, just add to >> Makefile >> > the following line: >> > >> > OBJS-$(CONFIG_MYPROTOCOL_PROTOCOL) += myprotocol.o >> > >> > that's it... look for the session "protocols I/O" in the Makefile >> >> >> I don't understand. I have placed a file called "bufferptocolo.c" in >> "ffmpeg-0.10.2/libavformat/" folder. Then in the >> "ffmpeg-0.10.2/libavformat/makefile" file I have added this row >> "OBJS-$(CONFIG_BUFFER_PROTOCOL) += bufferprotocol.o" >> but the file is not compiled. No error has reported. >> >> The file contains this: >> >> >> #if CONFIG_BUFFER_PROTOCOL >> >> static int buffer_open(URLContext *h, const char *filename, int flags) >> { >> printf("buffer_open\n"); >> return 0; >> } >> >> static int buffer_read(URLContext *h, unsigned char *buf, int size) >> { >> printf("buffer_read\n"); >> return (-1 == r)?AVERROR(errno):r; >> } >> >> static int buffer_write(URLContext *h, const unsigned char *buf, int size) >> { >> printf("buffer_write\n"); >> return (-1 == r)?AVERROR(errno):r; >> } >> >> static int64_t buffer_seek(URLContext *h, int64_t pos, int whence) >> { >> printf("buffer_seek\n"); >> return 0; >> } >> >> static int buffer_close(URLContext *h) >> { >> printf("buffer_seek\n"); >> return 0; >> } >> >> static int buffer_get_handle(URLContext *h) >> { >> printf("buffer_get_handle\n"); >> return (intptr_t) h->priv_data; >> } >> >> static int buffer_check(URLContext *h, int mask) >> { >> printf("buffer_check\n"); >> return 0; >> } >> >> URLProtocol ff_buffer_protocol = { >> .name = "buffer", >> .url_open = buffer_open, >> .url_read = buffer_read, >> .url_write = buffer_write, >> .url_seek = buffer_seek, >> .url_close = buffer_close, >> .url_get_file_handle = buffer_get_handle, >> .url_check = buffer_check, >> }; >> >> #endif /* CONFIG_BUFFER_PROTOCOL */ >> >> >> Have you got any idea? >> >> -- >> 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 wagner.patriota at gmail.com Thu May 10 16:47:29 2012 From: wagner.patriota at gmail.com (Wagner Patriota) Date: Thu, 10 May 2012 11:47:29 -0300 Subject: [Libav-user] Unknown decoder 'copy' = avcodec_find_decoder_by_name("copy") returning 0 on iOS Message-ID: Hello... I compiled for iOS with the following parameters: *[in this case, for simulator]* ./configure \ --cc=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc \ --as='/usr/local/bin/gas-preprocessor.pl/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc' \ --sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk \ --target-os=darwin \ --arch=i386 \ --cpu=i386 \ --extra-cflags='-arch i386' \ --extra-ldflags='-arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk' \ --prefix=compiled/i386 \ --enable-cross-compile \ --enable-nonfree \ --enable-gpl \ --enable-postproc \ --enable-avfilter \ --disable-armv5te \ --disable-ffplay \ --disable-ffserver \ --disable-ffprobe \ --disable-doc \ --disable-debug \ --disable-neon \ --disable-pic \ --disable-asm when I get to avcodec_find_decoder_by_name("copy") ... it returns 0... I am doing the equivalent of doing "ffmpeg -i input.mp4 output.ts" any ideia of what is happening? -------------- next part -------------- An HTML attachment was scrubbed... URL: From alexcohn at netvision.net.il Thu May 10 17:19:05 2012 From: alexcohn at netvision.net.il (Alex Cohn) Date: Thu, 10 May 2012 18:19:05 +0300 Subject: [Libav-user] Creating mp4 (h264 codec) video from OpenGL frames In-Reply-To: <4FABCDB5.4070602@gmail.com> References: <4FABCCBA.5060704@gmail.com> <4FABCDB5.4070602@gmail.com> Message-ID: On Thu, May 10, 2012 at 5:16 PM, Alex Druml wrote: > > hello! > > i am currently trying to encode frames (RGB) rendered with opengl into a mp4 > file encoded with h264. > > i already managed to convert the frames from RGB to YUV (swscale) and i > use the video_encode_example example from > http://git.videolan.org/?p=ffmpeg.git;a=blob;f=doc/examples/decoding_encoding.c;h=cb63294b142f007cf78436c5d81c08a49f3124be;hb=HEAD > > to encode the frames into a h264 file (vlc already plays the file). now > i want to write this encoded file into a common container like mp4. > > i found a muxing example here > http://git.videolan.org/?p=ffmpeg.git;a=blob;f=doc/examples/muxing.c;h=9d338dee670699d07b1f87505d78ee52a17cb920;hb=HEAD > > but is it possible to write the encoded frames directly into a mp4 file? > > best regards! No, you must conform to mp4 container logic. This is what the muxer is for. BR, Alex Cohn From wagner.patriota at gmail.com Thu May 10 17:18:52 2012 From: wagner.patriota at gmail.com (Wagner Patriota) Date: Thu, 10 May 2012 12:18:52 -0300 Subject: [Libav-user] Unknown decoder 'copy' = avcodec_find_decoder_by_name("copy") returning 0 on iOS In-Reply-To: References: Message-ID: sorry, I forgot something... the equivalent ffmpeg command is: ffmpeg -i input.mp4 *-acodec copy* output.ts On Thu, May 10, 2012 at 11:47 AM, Wagner Patriota wrote: > Hello... I compiled for iOS with the following parameters: > > *[in this case, for simulator]* > ./configure \ > --cc=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc > \ > --as='/usr/local/bin/gas-preprocessor.pl/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc' > \ > --sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk > \ > --target-os=darwin \ > --arch=i386 \ > --cpu=i386 \ > --extra-cflags='-arch i386' \ > --extra-ldflags='-arch i386 -isysroot > /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk' > \ > --prefix=compiled/i386 \ > --enable-cross-compile \ > --enable-nonfree \ > --enable-gpl \ > --enable-postproc \ > --enable-avfilter \ > --disable-armv5te \ > --disable-ffplay \ > --disable-ffserver \ > --disable-ffprobe \ > --disable-doc \ > --disable-debug \ > --disable-neon \ > --disable-pic \ > --disable-asm > > > when I get to avcodec_find_decoder_by_name("copy") ... it returns 0... > > I am doing the equivalent of doing "ffmpeg -i input.mp4 output.ts" > > any ideia of what is happening? > -------------- next part -------------- An HTML attachment was scrubbed... URL: From alexcohn at netvision.net.il Thu May 10 17:25:52 2012 From: alexcohn at netvision.net.il (Alex Cohn) Date: Thu, 10 May 2012 18:25:52 +0300 Subject: [Libav-user] Unknown decoder 'copy' = avcodec_find_decoder_by_name("copy") returning 0 on iOS In-Reply-To: References: Message-ID: On Thu, May 10, 2012 at 6:18 PM, Wagner Patriota wrote: > sorry, I forgot something... the equivalent ffmpeg command is: > > ffmpeg -i input.mp4 -acodec copy output.ts > > > On Thu, May 10, 2012 at 11:47 AM, Wagner Patriota > wrote: >> >> Hello... I compiled for iOS with the following parameters: >> >> [in this case, for simulator] >> ./configure \ >> >> --cc=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc >> \ >> --as='/usr/local/bin/gas-preprocessor.pl >> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc' >> \ >> >> --sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk >> \ >> --target-os=darwin \ >> --arch=i386 \ >> --cpu=i386 \ >> --extra-cflags='-arch i386' \ >> --extra-ldflags='-arch i386 -isysroot >> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk' >> \ >> --prefix=compiled/i386 \ >> --enable-cross-compile \ >> --enable-nonfree \ >> --enable-gpl \ >> --enable-postproc \ >> --enable-avfilter \ >> --disable-armv5te \ >> --disable-ffplay \ >> --disable-ffserver \ >> --disable-ffprobe \ >> --disable-doc \ >> --disable-debug \ >> --disable-neon \ >> --disable-pic \ >> --disable-asm >> >> >> when I get to?avcodec_find_decoder_by_name("copy") ... it returns 0... >> >> I am doing the equivalent of doing "ffmpeg -i input.mp4 output.ts" >> >> any ideia of what is happening? "copy" is a placeholder for not running codec at all. In your program that implements this logic, you should "short-circuit" the demuxer and the muxer. Note that in some cases, you cannot avoid running the video codec, because it is the way to extract global headers, etc. BR, Alex Cohn From bobslf at gmail.com Thu May 10 17:26:27 2012 From: bobslf at gmail.com (Bob Self) Date: Thu, 10 May 2012 11:26:27 -0400 Subject: [Libav-user] decoding video frames In-Reply-To: References: Message-ID: On Thu, May 10, 2012 at 10:03 AM, Alex Cohn wrote: > On Thu, May 10, 2012 at 3:43 PM, Bob Self wrote: >> I'm trying to decode video frames. The decoding loop prints this message: >> ? ? ?[mpeg4 @ 00823420] Invalid and inefficient vfw-avi packed B >> frames detected >> >> After that it prints these lines over and over: >> >> ? ? ?[mpeg4 @ ...] slice end not reached but screenspace end (5 left >> 78000, score= -2) >> ? ? ?[mpeg4 @ ...] concealing 1350 DC, 1350 AC, 1350 MV errors >> >> >> What causes these warning messages? Is this the correct way to decode video? >> >> thanks, >> Bob > > Such problems could be caused by some strange video steams. Therefore > it's important to decode your file with the latest command-line > ffmpeg. If its output is not as expected, it's also recommended to use > alternative players: either the video may be corrupt, or there may be > a bug in ffmpeg. > > But if ffmpeg succeeds, your code must be analyzed for problems. > > BR, > Alex Cohn > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user My example is basically from the doc/examples directory. There is this note there in the video_decode_example() function /* NOTE1: some codecs are stream based (mpegvideo, mpegaudio) and this is the only method to use them because you cannot know the compressed data size before analysing it. BUT some other codecs (msmpeg4, mpeg4) are inherently frame based, so you must call them with all the data for one frame exactly. You must also initialize 'width' and 'height' before initializing them. */ Since the video I'm trying to decode is MPEG4, how do you initialize the width and height? Could this be my problem? From wagner.patriota at gmail.com Thu May 10 17:49:50 2012 From: wagner.patriota at gmail.com (Wagner Patriota) Date: Thu, 10 May 2012 12:49:50 -0300 Subject: [Libav-user] Unknown decoder 'copy' = avcodec_find_decoder_by_name("copy") returning 0 on iOS In-Reply-To: References: Message-ID: ok, the thing is that I am adapting from ffmpeg.c, like renaming main(argc,argv) -> ffmpeg(argc,argv) and using this function with the parameter I want... so it's supposed to have the same behavior of the command line... is there any problem with it? On Thu, May 10, 2012 at 12:25 PM, Alex Cohn wrote: > On Thu, May 10, 2012 at 6:18 PM, Wagner Patriota > wrote: > > sorry, I forgot something... the equivalent ffmpeg command is: > > > > ffmpeg -i input.mp4 -acodec copy output.ts > > > > > > On Thu, May 10, 2012 at 11:47 AM, Wagner Patriota > > wrote: > >> > >> Hello... I compiled for iOS with the following parameters: > >> > >> [in this case, for simulator] > >> ./configure \ > >> > >> > --cc=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc > >> \ > >> --as='/usr/local/bin/gas-preprocessor.pl > >> > /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc' > >> \ > >> > >> > --sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk > >> \ > >> --target-os=darwin \ > >> --arch=i386 \ > >> --cpu=i386 \ > >> --extra-cflags='-arch i386' \ > >> --extra-ldflags='-arch i386 -isysroot > >> > /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk' > >> \ > >> --prefix=compiled/i386 \ > >> --enable-cross-compile \ > >> --enable-nonfree \ > >> --enable-gpl \ > >> --enable-postproc \ > >> --enable-avfilter \ > >> --disable-armv5te \ > >> --disable-ffplay \ > >> --disable-ffserver \ > >> --disable-ffprobe \ > >> --disable-doc \ > >> --disable-debug \ > >> --disable-neon \ > >> --disable-pic \ > >> --disable-asm > >> > >> > >> when I get to avcodec_find_decoder_by_name("copy") ... it returns 0... > >> > >> I am doing the equivalent of doing "ffmpeg -i input.mp4 output.ts" > >> > >> any ideia of what is happening? > > "copy" is a placeholder for not running codec at all. In your program > that implements this logic, you should "short-circuit" the demuxer and > the muxer. Note that in some cases, you cannot avoid running the video > codec, because it is the way to extract global headers, etc. > > BR, > Alex Cohn > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > -------------- next part -------------- An HTML attachment was scrubbed... URL: From alexcohn at netvision.net.il Thu May 10 19:08:39 2012 From: alexcohn at netvision.net.il (Alex Cohn) Date: Thu, 10 May 2012 20:08:39 +0300 Subject: [Libav-user] decoding video frames In-Reply-To: References: Message-ID: On Thu, May 10, 2012 at 3:43 PM, Bob Self wrote: > I'm trying to decode video frames. The decoding loop prints this message: > ? ? ?[mpeg4 @ 00823420] Invalid and inefficient vfw-avi packed B > frames detected > > After that it prints these lines over and over: > > ? ? ?[mpeg4 @ ...] slice end not reached but screenspace end (5 left > 78000, score= -2) > ? ? ?[mpeg4 @ ...] concealing 1350 DC, 1350 AC, 1350 MV errors > > > What causes these warning messages? Is this the correct way to decode video? > > thanks, > Bob > > > AVCodec *codec; > AVCodecContext *codec_ctx= NULL; > AVFormatContext *format_ctx=NULL; > AVFrame *picture=NULL; > int frame, got_picture, len; > FILE *f; > uint8_t inbuf[INBUF_SIZE + FF_INPUT_BUFFER_PADDING_SIZE]; > char buf[1024]; > AVPacket avpkt; > const char *outfilename = "x.x"; > const char *filename = MOVIE; > unsigned long frames=0L; > int status; > int64_t duration = 0; > const char *cptr=NULL; > unsigned long count=0L; > unsigned long total_bytes = 0L; > int vidstream = -1; > int i; > int flags=0; > > if (!exists(MOVIE)) ?{ > ? printf("can't find %s\n", MOVIE); > ? exit 1; > } > > av_log_set_flags(AV_LOG_SKIP_REPEATED); > avcodec_register_all(); > av_register_all(); > avformat_network_init(); > > unsigned int codec_version = avcodec_version(); > av_init_packet(&avpkt); > > // avcodec version: 54.10.100 > printf("avcodec version = %d.%d.%d\n", (codec_version&0x00ff0000)>>16, > (codec_version&0x0000ff00)>>8, codec_version&0x000000ff); ? ? ?// > version 52.72.2 > > > format_ctx = avformat_alloc_context(); > cptr = MOVIE; > status = avformat_open_input(&format_ctx, MOVIE, NULL, NULL); > > if (status != 0) ?{ > ? printf("error1\n"); > ? goto done; > } > > // find the first video stream > > for (i=0; i<(int)format_ctx->nb_streams; i++) { > ? if (format_ctx->streams[i]->codec->codec_type == AVMEDIA_TYPE_VIDEO) { > ? ? ?vidstream = i; > ? ? ?break; > ? } > } > > if (vidstream == -1) { > ? printf("error3\n"); > ? goto done; > } > > // Get a pointer to the codec context for the video stream > codec_ctx = format_ctx->streams[vidstream]->codec; > frames = (unsigned long)format_ctx->streams[vidstream]->nb_frames; // 154959 > > > double d; > > d = frames / 23.97; // d = 5170 > d /= 3600.0; // d = 1.79 hours > > memset(inbuf + INBUF_SIZE, 0, FF_INPUT_BUFFER_PADDING_SIZE); > > codec = avcodec_find_decoder(CODEC_ID_MPEG4); > if (!codec) { > ? fprintf(stderr, "codec not found\n"); > ? goto done; > } > > codec_ctx = avcodec_alloc_context3(codec); > picture= avcodec_alloc_frame(); > > if(codec->capabilities&CODEC_CAP_TRUNCATED) ?{ > ? codec_ctx->flags|= CODEC_FLAG_TRUNCATED; ? ? ? ? ? ? ? // we do not > send complete frames > } > > if (avcodec_open2(codec_ctx, codec, NULL) < 0) { > ? fprintf(stderr, "could not open codec\n"); > ? goto done; > } > > f = fopen(filename, "rb"); > if (!f) { > ? fprintf(stderr, "could not open %s\n", filename); > ? goto done; > } > > frame = 0; > > while(1) ?{ > ? avpkt.size = fread(inbuf, 1, INBUF_SIZE, f); > ? count++; > ? total_bytes += avpkt.size; > > ? if (avpkt.size == 0) ?{ > ? ? ?break; > ? } > > ? avpkt.data = inbuf; > > ? while (avpkt.size > 0) { > ? ? ?len = avcodec_decode_video2(codec_ctx, picture, &got_picture, &avpkt); > ? ? ?if (len < 0) { > ? ? ? ? fclose(f); > ? ? ? ? printf("Error while decoding frame %d, count = %ld, > total_bytes = %ld\n", frame, count, total_bytes); > ? ? ? ? goto done; > ? ? ?} > > ? ? ?if (got_picture) { > ? ? ? ? frame++; > ? ? ? ? if ((frame%100)==0) ?{ > ? ? ? ? ? ?printf("&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& > ? ?%d\n", frame); > ? ? ? ? } > ? ? ?} > ? ? ?avpkt.size -= len; > ? ? ?avpkt.data += len; This code implies that the actual compressed packets are of the size that fits precisely into INBUF_SIZE. Otherwise, when you reach the end of first buffer you got from fread(), you will have a non-complete packet. The decoder cannot handle such case. You should put this remaining chunk aside and append the data you read from the file so that the compressed packets that go to decoder are always complete. The trick is, you don't know the actual size of the next packet, therefore you cannot decide whether to read another piece of data from the file, or not. This is why it is preferred to use avformat functions to read the file. > ? } ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?// while (avpkt.size > 0) > } ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? // while(1) > > avpkt.data = NULL; > avpkt.size = 0; > > done: > FCLOSE(f); > > if (format_ctx) ?{ > ? //av_close_input_file(format_ctx); > ? avformat_free_context(format_ctx); > } > if (codec_ctx) ?{ > ? avcodec_close(codec_ctx); > ? av_free(codec_ctx); > } > if (picture) ?{ > ? av_free(picture); > } BR, Alex Cohn From bobslf at gmail.com Thu May 10 19:40:38 2012 From: bobslf at gmail.com (Bob Self) Date: Thu, 10 May 2012 13:40:38 -0400 Subject: [Libav-user] decoding video frames In-Reply-To: References: Message-ID: On Thu, May 10, 2012 at 1:08 PM, Alex Cohn wrote: > This code implies that the actual compressed packets are of the size > that fits precisely into INBUF_SIZE. Otherwise, when you reach the end > of first buffer you got from fread(), you will have a non-complete > packet. The decoder cannot handle such case. You should put this > remaining chunk aside and append the data you read from the file so > that the compressed packets that go to decoder are always complete. > > The trick is, you don't know the actual size of the next packet, > therefore you cannot decide whether to read another piece of data from > the file, or not. This is why it is preferred to use avformat > functions to read the file. > > BR, > Alex Cohn > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user That makes sense. I am using the example in the doc/examples directory. It uses fread(). Can you point me to an example that uses the avformat functions? I've been trying to find examples, but haven't had any luck. From wagner.patriota at gmail.com Thu May 10 21:21:36 2012 From: wagner.patriota at gmail.com (Wagner Patriota) Date: Thu, 10 May 2012 16:21:36 -0300 Subject: [Libav-user] Unknown decoder 'copy' = avcodec_find_decoder_by_name("copy") returning 0 on iOS In-Reply-To: References: Message-ID: hummm, nevermind... it happened because I used the ffmpeg() more than once.... the first time was working... so I had to reset the static variables of ffmpeg.c to use it over... now it's ok On Thu, May 10, 2012 at 12:49 PM, Wagner Patriota wrote: > ok, the thing is that I am adapting from ffmpeg.c, like renaming > main(argc,argv) -> ffmpeg(argc,argv) and using this function with the > parameter I want... so it's supposed to have the same behavior of the > command line... is there any problem with it? > > > On Thu, May 10, 2012 at 12:25 PM, Alex Cohn wrote: > >> On Thu, May 10, 2012 at 6:18 PM, Wagner Patriota >> wrote: >> > sorry, I forgot something... the equivalent ffmpeg command is: >> > >> > ffmpeg -i input.mp4 -acodec copy output.ts >> > >> > >> > On Thu, May 10, 2012 at 11:47 AM, Wagner Patriota >> > wrote: >> >> >> >> Hello... I compiled for iOS with the following parameters: >> >> >> >> [in this case, for simulator] >> >> ./configure \ >> >> >> >> >> --cc=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc >> >> \ >> >> --as='/usr/local/bin/gas-preprocessor.pl >> >> >> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc' >> >> \ >> >> >> >> >> --sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk >> >> \ >> >> --target-os=darwin \ >> >> --arch=i386 \ >> >> --cpu=i386 \ >> >> --extra-cflags='-arch i386' \ >> >> --extra-ldflags='-arch i386 -isysroot >> >> >> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk' >> >> \ >> >> --prefix=compiled/i386 \ >> >> --enable-cross-compile \ >> >> --enable-nonfree \ >> >> --enable-gpl \ >> >> --enable-postproc \ >> >> --enable-avfilter \ >> >> --disable-armv5te \ >> >> --disable-ffplay \ >> >> --disable-ffserver \ >> >> --disable-ffprobe \ >> >> --disable-doc \ >> >> --disable-debug \ >> >> --disable-neon \ >> >> --disable-pic \ >> >> --disable-asm >> >> >> >> >> >> when I get to avcodec_find_decoder_by_name("copy") ... it returns 0... >> >> >> >> I am doing the equivalent of doing "ffmpeg -i input.mp4 output.ts" >> >> >> >> any ideia of what is happening? >> >> "copy" is a placeholder for not running codec at all. In your program >> that implements this logic, you should "short-circuit" the demuxer and >> the muxer. Note that in some cases, you cannot avoid running the video >> codec, because it is the way to extract global headers, etc. >> >> BR, >> Alex Cohn >> _______________________________________________ >> Libav-user mailing list >> Libav-user at ffmpeg.org >> http://ffmpeg.org/mailman/listinfo/libav-user >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From info at denisgottardello.it Thu May 10 08:45:30 2012 From: info at denisgottardello.it (Denis) Date: Thu, 10 May 2012 08:45:30 +0200 Subject: [Libav-user] How to redirect FFMPEG output to a socket In-Reply-To: <201205082102.24385.info@denisgottardello.it> References: <201205082102.24385.info@denisgottardello.it> Message-ID: <201205100845.30880.info@denisgottardello.it> In data marted? 08 maggio 2012 21:02:24, Denis ha scritto: > I don't understand. I have placed a file called "bufferptocolo.c" in > "ffmpeg-0.10.2/libavformat/" folder. Then in the > "ffmpeg-0.10.2/libavformat/makefile" file I have added this row > "OBJS-$(CONFIG_BUFFER_PROTOCOL) += bufferprotocol.o" > but the file is not compiled. No error has reported. > > The file contains this: > > > #if CONFIG_BUFFER_PROTOCOL > > static int buffer_open(URLContext *h, const char *filename, int flags) > { > printf("buffer_open\n"); > return 0; > } > > static int buffer_read(URLContext *h, unsigned char *buf, int size) > { > printf("buffer_read\n"); > return (-1 == r)?AVERROR(errno):r; > } > > static int buffer_write(URLContext *h, const unsigned char *buf, int size) > { > printf("buffer_write\n"); > return (-1 == r)?AVERROR(errno):r; > } > > static int64_t buffer_seek(URLContext *h, int64_t pos, int whence) > { > printf("buffer_seek\n"); > return 0; > } > > static int buffer_close(URLContext *h) > { > printf("buffer_seek\n"); > return 0; > } > > static int buffer_get_handle(URLContext *h) > { > printf("buffer_get_handle\n"); > return (intptr_t) h->priv_data; > } > > static int buffer_check(URLContext *h, int mask) > { > printf("buffer_check\n"); > return 0; > } > > URLProtocol ff_buffer_protocol = { > .name = "buffer", > .url_open = buffer_open, > .url_read = buffer_read, > .url_write = buffer_write, > .url_seek = buffer_seek, > .url_close = buffer_close, > .url_get_file_handle = buffer_get_handle, > .url_check = buffer_check, > }; > > #endif /* CONFIG_BUFFER_PROTOCOL */ > > > Have you got any idea? Up! -- www.denisgottardello.it Skype: mrdebug Videosurveillance and home automation! http://www.denisgottardello.it/DomusBoss/DomusBossIndice.php From amir.rouhi at rmit.edu.au Fri May 11 06:09:12 2012 From: amir.rouhi at rmit.edu.au (amir.rouhi at rmit.edu.au) Date: Fri, 11 May 2012 14:09:12 +1000 Subject: [Libav-user] Extracted I-Frames seems not correct, Why? Message-ID: Hi to ffmpeg seniors and experts I am using windows platform and I have created a series of video in pure format of *.264 from raw format by the below command: ffmpeg -f rawvideo -pix_fmt yuv420p -s 360x240 -i C:\1.yuv -an -vcodec libx264 -threads 0 -s 360x240 -f h264 C:\1.264 I want to extract I-Frames which are created in adaptive mode in encoding phase. i use the below command: ffmpeg -i C:\ 1.264 -vsync 0 -vf select="eq(pict_type\, PICT_TYPE_I)" C:\ Test\IFrames\I-Frm-%03d.jpeg Its a short video and i just get 4 images but the images does not looks correct images, They are not sharp and clear images. BTW, adaptive I-Frame are expected t be located at the start of a new group of pictures, after any big changes in the scene, but these extracted image are not showing this. do you know whats my mistake or whats wrong? -- Amir -------------- next part -------------- An HTML attachment was scrubbed... URL: From ufaweb at gmail.com Fri May 11 10:00:17 2012 From: ufaweb at gmail.com (=?UTF-8?B?0KDRg9GB0LvQsNC9INCo0LDRgNC40L/QvtCy?=) Date: Fri, 11 May 2012 14:00:17 +0600 Subject: [Libav-user] The problem with video recording (when using segmentation) Message-ID: Hello. I'm having trouble using avconv. My problem - is recording video with IP-cameras (used j2000-ip). Record directly from the camera impossible, because it is restriction on 3 RTSP session (first to relay live video, second for administrative staff, the third - reserve). Software is used to relay live video - erlyvideo http://erlyvideo.org. Recording is performed as follows: ======== recorder at cctv:~/records/records$ avconv -i rtmp://cctv.lo.ufanet.ru/live/demo2 -vcodec copy -an -sn -map 0 -f segment -segment_format mp4 -segment_time 60 -y 'stream-%03d.mp4' avconv version 0.8.1-5:0.8.1-4, Copyright (c) 2000-2011 the Libav developers built on Mar 30 2012 14:37:42 with gcc 4.6.3 HandShake: client signature does not match! Metadata: height 576.00 remote_addr: sdp_session {sdp_session,0, {sdp_o,"admin","3904","3905",inet4,"10.1.12.7"}, "NVT", {inet4,"10.1.12.7"}, {0,0}, [{"range","npt=now-"}, {"control","rtsp://10.1.12.7/snl/live/1/1/"}]} width 704.00 [flv @ 0x19e68c0] Estimating duration from bitrate, this may be inaccurate Input #0, flv, from 'rtmp://cctv.lo.ufanet.ru/live/demo2': Duration: N/A, start: 0.000000, bitrate: N/A Stream #0.0: Video: h264 (Baseline), yuv420p, 704x576, 200 tbr, 1k tbn, 2k tbc Output #0, segment, to 'stream-%03d.mp4': Metadata: encoder : Lavf53.21.0 Stream #0.0: Video: libx264, yuv420p, 704x576, q=2-31, 1k tbn, 1k tbc Stream mapping: Stream #0:0 -> #0:0 (copy) Press ctrl-c to stop encoding ^Cframe=11178 fps= 32 q=-1.0 Lsize= -0kB time=394.69 bitrate= -0.0kbits/s video:24201kB audio:0kB global headers:0kB muxing overhead -100.000089% Received signal 2: terminating. ======== Segmentation is necessary to store small pieces of time, it simplifies access to the video archive later. But unfortunately the record does not work as expected. The first segment able to play successfully in Flash (PC, Linux, Mac) and QuickTime (iOS), but subsequent segments are played back only in Flash, QuickTime simply displays a black screen. An example of RTMP input stream: rtmp://cctv.lo.ufanet.ru/live/demo2 Sample entries: http://cctv.lo.ufanet.ru/cctv/ Tell me, what could be the reason why that is received by the segments (except first) do not play QuickTime (both iOS, and on Mac OS X)? Thanks. -- ? ?????????, ??????? ??????. ???????????? ?????? ?????????? ? ????????????? ???????????? ??????????? ??? "??????". ?????????? ??????????: google+: http://gplus.to/ruslan jid: serafim at jabber.ufanet.ru wave: ufaweb at googlewave.com skype: ufaweb phone: +7(917)4775460 vkontakte: http://vkontakte.ru/ufaweb myspace: http://www.myspace.com/ufaweb facebook: http://facebook.com/sharipov linkedin: http://www.linkedin.com/in/ufaweb twitter: http://twitter.com/ufaweb From krishnaks at iwavesystems.com Fri May 11 10:30:01 2012 From: krishnaks at iwavesystems.com (krishnaks at iwavesystems.com) Date: Fri, 11 May 2012 14:00:01 +0530 Subject: [Libav-user] How to set Frame rate Message-ID: Hi, I am using FFmpeg for decoding H264 frames.H264 frames I am receiving from Live555 at 30fps Any setting related to frame rate I need to set for Avcodec/AvcodecContext? Thanks in advance, KP From bobslf at gmail.com Fri May 11 11:12:39 2012 From: bobslf at gmail.com (Bob Self) Date: Fri, 11 May 2012 05:12:39 -0400 Subject: [Libav-user] mpeg4 decoding only decodes 36395 out of 154959 frames Message-ID: I finally found an incomplete example that I was able to get sort-of working with non-deprecated functions. The only error (or warning?) that I get is "[mpeg4 @ 0x1367c80] Invalid and inefficient vfw-avi packed B frames detected" once. Other than that the program runs without errors, but there is still something that I don't understand. pFormatCtx->streams[videoStream]->nb_frames says that there are 154,959 frames But if I count the decoded frames (frame++), I only get 36,395 frames before the loop quits. Why does this happen? the program output: ------------------------------- [avi @ 0x1361920] Format avi probed with size=2048 and score=100 [AVI demuxer @ 0x1361e60] use odml:1 st:1 removing common factor 128 from timebase [mpeg4 @ 0x1367c80] Invalid and inefficient vfw-avi packed B frames detected [avi @ 0x1361920] All info found Input #0, avi, from 'test.avi': Metadata: encoder : FairUse Wizard - http://fairusewizard.com Duration: 01:47:43.08, start: 0.000000, bitrate: 1815 kb/s Stream #0:0, 1, 1001/24000: Video: mpeg4 (Advanced Simple Profile) (XVID / 0x44495658), yuv420p, 688x368 [SAR 1:1 DAR 43:23], 1001/24000, 23.98 tbr, 23.98 tbn, 23.98 tbc Stream #0:1, 21, 3/125: Audio: mp3 (U[0][0][0] / 0x0055), 48000 Hz, stereo, s16, 128 kb/s the test function: ---------------------------- int test(void) { const char *inputfile = "test.avi"; int totalFrames = 0; int frameLocation = 0; AVFormatContext *pFormatCtx; unsigned int i, videoStream; AVCodecContext *pCodecCtx; AVCodec *pCodec; AVFrame *pFrame; AVFrame *pFrameYUV; int numBytes; uint8_t *buffer; int status; unsigned int codec_version; av_register_all(); codec_version = avcodec_version(); // avcodec version: 54.10.100 printf("avcodec version = %d.%d.%d\n", (codec_version&0x00ff0000)>>16, (codec_version&0x0000ff00)>>8, codec_version&0x000000ff); // version 52.72.2 av_log_set_level(AV_LOG_DEBUG); pFormatCtx = avformat_alloc_context(); status = avformat_open_input(&pFormatCtx, inputfile, NULL, NULL); if (status != 0) { return -1; } status = avformat_find_stream_info(pFormatCtx, NULL); if (status<0) { return -2; } av_dump_format(pFormatCtx, 0, inputfile, false); videoStream=-1; for(i=0; inb_streams; i++) { if(pFormatCtx->streams[i]->codec->codec_type==AVMEDIA_TYPE_VIDEO) { videoStream=i; break; } } if(videoStream==-1) { return -3; } pCodecCtx = pFormatCtx->streams[videoStream]->codec; double duration = double(pFormatCtx->duration) / AV_TIME_BASE; pCodec=avcodec_find_decoder(pCodecCtx->codec_id); if(pCodec==NULL) { return -4; } if(pCodec->capabilities & CODEC_CAP_TRUNCATED) { pCodecCtx->flags|=CODEC_FLAG_TRUNCATED; } if(avcodec_open2(pCodecCtx, pCodec, NULL)<0) { return -5; } printf("Using codec: %s\n", pCodec->name); pFrame = avcodec_alloc_frame(); pFrameYUV=avcodec_alloc_frame(); if(pFrameYUV==NULL) { return -6; } numBytes = avpicture_get_size(PIX_FMT_YUV420P, pCodecCtx->width, pCodecCtx->height); // 379776 buffer = (uint8_t *)av_malloc(numBytes*sizeof(uint8_t)); avpicture_fill((AVPicture *)pFrameYUV, buffer, PIX_FMT_YUV420P, pCodecCtx->width, pCodecCtx->height); totalFrames = pFormatCtx->streams[videoStream]->nb_frames; // 154959 printf("Frames: %d\n", totalFrames); AVPacket packet; int isFrameFinished = 0; int pixelScanCount = 0; printf("video width = %d\n", pCodecCtx->width); printf("video height = %d\n", pCodecCtx->height); int frame = 0; int loops = 0; while (av_read_frame(pFormatCtx, &packet) >= 0) { status = av_read_frame(pFormatCtx, &packet); if (status<0) { break; } loops++; if (packet.stream_index == videoStream) { status = avcodec_decode_video2(pCodecCtx, pFrame, &isFrameFinished, &packet); if (isFrameFinished) { frame++; if ( (frame%1000) == 0) { printf("%d\n", frame); } pixelScanCount = 0; for (int y = 0; y < pCodecCtx->height; y++) { uint8_t *p = pFrame->data[0] + y * pFrame->linesize[0]; for (int x = 0; x < pCodecCtx->width; x++) { pixelScanCount++; } } av_free_packet(&packet); } else { av_free_packet(&packet); } } } printf("frame = %d\n", frame); // frame = 36395 printf("loops = %d\n", loops); // loops = 212127 printf("totalFrames = %d\n", totalFrames); // totalFrames = 154959 delete [] buffer; av_free(pFrameYUV); av_free(pFrame); avcodec_close(pCodecCtx); avformat_close_input(&pFormatCtx); return 0; } From bobslf at gmail.com Fri May 11 14:24:31 2012 From: bobslf at gmail.com (Bob Self) Date: Fri, 11 May 2012 08:24:31 -0400 Subject: [Libav-user] mpeg4 decoding only decodes 36395 out of 154959 frames Message-ID: I modified the program (and fixed a mistake), and now this loop gets the right count. Before, it was only counting video_frames if 'isFrameFinished' was non-zero, but this version counts all video frames from av_read_frame(). It is amazing how little documentation there is on this stuff and how the examples you find are full of deprecated (incompatible?) functions. What is the purpose of isFrameFinished in avcodec_decode_video2()? Should a video frame be counted if it is not finished? while (1) { status = av_read_frame(pFormatCtx, &packet); if (status<0) { break; } if (packet.stream_index == videoStream) { video_frames++; status = avcodec_decode_video2(pCodecCtx, pFrame, &isFrameFinished, &packet); /* if (isFrameFinished) { if ( (video_frames%1000) == 0) { printf("%d\n", video_frames); } // SCANNING GOES HERE pixelScanCount = 0; for (int y = 0; y < pCodecCtx->height; y++) { uint8_t *p = pFrame->data[0] + y * pFrame->linesize[0]; // this gets Y' in YUV for (int x = 0; x < pCodecCtx->width; x++) { pixelScanCount++; //printf("Frame %d at %d, %d has Y'=%d\n", frameLocation, x, y, p[x]); } } } */ } else { audio_frames++; } av_free_packet(&packet); } // while(1) From cehoyos at ag.or.at Fri May 11 16:09:45 2012 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Fri, 11 May 2012 14:09:45 +0000 (UTC) Subject: [Libav-user] Extracted I-Frames seems not correct, Why? References: Message-ID: writes: > C:\?1.264 -vsync 0 -vf select="eq(pict_type\, PICT_TYPE_I)"? > C:\?Test\IFrames\I-Frm-%03d.jpeg? > Its a short video and i just get 4 images but the images > does not looks correct images Could you test with the reference decoder? If you find any difference, this sounds like a very important issue, please provide the sample in this case. Carl Eugen From cehoyos at ag.or.at Fri May 11 16:12:54 2012 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Fri, 11 May 2012 14:12:54 +0000 (UTC) Subject: [Libav-user] The problem with video recording (when using segmentation) References: Message-ID: ?????? ??????? writes: > avconv version 0.8.1-5:0.8.1-4, This fork is known to have several hundred regressions over FFmpeg, among them many securigy relevant issues, and is therefore unsupported here, please see http://ffmpeg.org/download.html Current git head is always recommended. For segmented mov, you need -flags global_header Carl Eugen From alex3.dr at googlemail.com Fri May 11 19:43:49 2012 From: alex3.dr at googlemail.com (Alex Druml) Date: Fri, 11 May 2012 19:43:49 +0200 Subject: [Libav-user] Creating mp4 (h264 codec) video from OpenGL frames In-Reply-To: References: <4FABCCBA.5060704@gmail.com> <4FABCDB5.4070602@gmail.com> Message-ID: <4FAD4FD5.8050501@gmail.com> Thx for the fast reply! is there an example for muxing a h264 stream into a mp4 file using the C API ? BR, Alex Am 10.05.2012 17:19, schrieb Alex Cohn: > On Thu, May 10, 2012 at 5:16 PM, Alex Druml wrote: >> >> hello! >> >> i am currently trying to encode frames (RGB) rendered with opengl into a mp4 >> file encoded with h264. >> >> i already managed to convert the frames from RGB to YUV (swscale) and i >> use the video_encode_example example from >> http://git.videolan.org/?p=ffmpeg.git;a=blob;f=doc/examples/decoding_encoding.c;h=cb63294b142f007cf78436c5d81c08a49f3124be;hb=HEAD >> >> to encode the frames into a h264 file (vlc already plays the file). now >> i want to write this encoded file into a common container like mp4. >> >> i found a muxing example here >> http://git.videolan.org/?p=ffmpeg.git;a=blob;f=doc/examples/muxing.c;h=9d338dee670699d07b1f87505d78ee52a17cb920;hb=HEAD >> >> but is it possible to write the encoded frames directly into a mp4 file? >> >> best regards! > > No, you must conform to mp4 container logic. This is what the muxer is for. > > BR, > Alex Cohn > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user From arlhey.herrera at art.jovenclub.cu Fri May 11 20:46:08 2012 From: arlhey.herrera at art.jovenclub.cu (Ing. Arlhey Herrera Mendoza) Date: Fri, 11 May 2012 14:46:08 -0400 Subject: [Libav-user] Issue detecting video stream and using methods to encode and decode any video file. Message-ID: <4FAD5E70.8080800@art.jovenclub.cu> Hi, I'm new using libavformat, libavcodec and libavutil and I got this thesis project where I need to select any video file from filesystem and encode to any video format whatever I want. I've tried many things, even the examples on several forums but I got no luck. I'm working with Qt and C++ in Ubuntu 11.10, I don't know if this could be an issue. My principal problem is how to detect which is the video stream in the array of streams (using libavformar for that), the thing is that I need a codec id which can be compared with any file I choose from the filesystem, or need to know if there is a way to find out which is the right codec id to compare. The other problem I got is when try to decode/encode the selected file the function avcodec_encode_video fails. Also fails when I try to get file info using libavformat and is a HD video file (doesn't matter the extension, mkv, avi, mpg, mpg4; always fails). Does anyone know anything about it? Thanks in advance for any help. Sorry by my english... -- -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/png Size: 20501 bytes Desc: not available URL: From wagner.patriota at gmail.com Fri May 11 22:51:46 2012 From: wagner.patriota at gmail.com (Wagner Patriota) Date: Fri, 11 May 2012 17:51:46 -0300 Subject: [Libav-user] output video via PHP using ffmpeg / kind of wrapper? In-Reply-To: References: Message-ID: Does anybody know some wrapper of FFMPEG for PHP? What I want is: I have a video in my server, but I want to get the same video from a certain duration.... example: myphp?*startTime=30* ffmpeg *-ss 30* -i input.mp4 -acodec copy -vcodec copy *SOMEOUTPUT* * * I want to know how to redirect my output to the php output, so the user will receive a new valid MP4 from the time 30 seconds... DETAIL: I don't have access to system().... but if you know some solution using system(), please send me anyway... :-) -------------- next part -------------- An HTML attachment was scrubbed... URL: From geoffrey.tn at hotmail.fr Sat May 12 01:33:54 2012 From: geoffrey.tn at hotmail.fr (Geoffrey tn) Date: Sat, 12 May 2012 01:33:54 +0200 Subject: [Libav-user] Color depth in MXF file Message-ID: Hi, Usually I use the function av_find_best_stream(...) to get the color depth of a generic media file and I retrieve the information with "fmt_ctx->streams[video_stream_index]->codec->bits_per_coded_sample" and it works perfectly. My problem is, it doesn't work with a MXF File. The value of "bits_per_coded_sample" is all the time fixed to 0. I tried with MXF files composed of JP2K and IMX. Can you give me a trick ? -------------- next part -------------- An HTML attachment was scrubbed... URL: From alexcohn at netvision.net.il Sat May 12 07:47:15 2012 From: alexcohn at netvision.net.il (Alex Cohn) Date: Sat, 12 May 2012 08:47:15 +0300 Subject: [Libav-user] Creating mp4 (h264 codec) video from OpenGL frames In-Reply-To: <4FAD4FD5.8050501@gmail.com> References: <4FABCCBA.5060704@gmail.com> <4FABCDB5.4070602@gmail.com> <4FAD4FD5.8050501@gmail.com> Message-ID: On May 11, 2012 8:43 PM, "Alex Druml" wrote: > > Thx for the fast reply! is there an example for muxing a h264 stream into a mp4 file using the C API ? > > BR, > Alex The best example is ffmpeg.c sincerely, Alex Cohn > Am 10.05.2012 17:19, schrieb Alex Cohn: >> >> On Thu, May 10, 2012 at 5:16 PM, Alex Druml wrote: >>> >>> >>> hello! >>> >>> i am currently trying to encode frames (RGB) rendered with opengl into a mp4 >>> file encoded with h264. >>> >>> i already managed to convert the frames from RGB to YUV (swscale) and i >>> use the video_encode_example example from >>> http://git.videolan.org/?p=ffmpeg.git;a=blob;f=doc/examples/decoding_encoding.c;h=cb63294b142f007cf78436c5d81c08a49f3124be;hb=HEAD >>> >>> to encode the frames into a h264 file (vlc already plays the file). now >>> i want to write this encoded file into a common container like mp4. >>> >>> i found a muxing example here >>> http://git.videolan.org/?p=ffmpeg.git;a=blob;f=doc/examples/muxing.c;h=9d338dee670699d07b1f87505d78ee52a17cb920;hb=HEAD >>> >>> but is it possible to write the encoded frames directly into a mp4 file? >>> >>> best regards! >> >> >> No, you must conform to mp4 container logic. This is what the muxer is for. >> >> BR, >> Alex Cohn >> _______________________________________________ >> 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 alexcohn at netvision.net.il Sat May 12 07:51:58 2012 From: alexcohn at netvision.net.il (Alex Cohn) Date: Sat, 12 May 2012 08:51:58 +0300 Subject: [Libav-user] mpeg4 decoding only decodes 36395 out of 154959 frames In-Reply-To: References: Message-ID: On May 11, 2012 12:12 PM, "Bob Self" wrote: > > I finally found an incomplete example that I was able to get sort-of working > with non-deprecated functions. The only error (or warning?) that I get is > "[mpeg4 @ 0x1367c80] Invalid and inefficient vfw-avi packed B frames detected" > once. Other than that the program runs without errors, but there is still > something that I don't understand. > > pFormatCtx->streams[videoStream]->nb_frames says that there are 154,959 frames > But if I count the decoded frames (frame++), I only get 36,395 frames > before the loop quits. Why does this happen? > nb_frames may be not reliable. How many frames does ffmpeg command decide? BR, Alex Cohn > the program output: > ------------------------------- > > [avi @ 0x1361920] Format avi probed with size=2048 and score=100 > [AVI demuxer @ 0x1361e60] use odml:1 > st:1 removing common factor 128 from timebase > [mpeg4 @ 0x1367c80] Invalid and inefficient vfw-avi packed B frames detected > [avi @ 0x1361920] All info found > Input #0, avi, from 'test.avi': > Metadata: > encoder : FairUse Wizard - http://fairusewizard.com > Duration: 01:47:43.08, start: 0.000000, bitrate: 1815 kb/s > Stream #0:0, 1, 1001/24000: Video: mpeg4 (Advanced Simple Profile) > (XVID / 0x44495658), yuv420p, 688x368 [SAR 1:1 DAR 43:23], 1001/24000, > 23.98 tbr, 23.98 tbn, 23.98 tbc > Stream #0:1, 21, 3/125: Audio: mp3 (U[0][0][0] / 0x0055), 48000 > Hz, stereo, s16, 128 kb/s > > > the test function: > ---------------------------- > > int test(void) { > const char *inputfile = "test.avi"; > int totalFrames = 0; > int frameLocation = 0; > AVFormatContext *pFormatCtx; > unsigned int i, videoStream; > AVCodecContext *pCodecCtx; > AVCodec *pCodec; > AVFrame *pFrame; > AVFrame *pFrameYUV; > int numBytes; > uint8_t *buffer; > int status; > unsigned int codec_version; > > av_register_all(); > > codec_version = avcodec_version(); > // avcodec version: 54.10.100 > printf("avcodec version = %d.%d.%d\n", > (codec_version&0x00ff0000)>>16, (codec_version&0x0000ff00)>>8, > codec_version&0x000000ff); // version 52.72.2 > > av_log_set_level(AV_LOG_DEBUG); > > pFormatCtx = avformat_alloc_context(); > > status = avformat_open_input(&pFormatCtx, inputfile, NULL, NULL); > if (status != 0) { > return -1; > } > > status = avformat_find_stream_info(pFormatCtx, NULL); > if (status<0) { > return -2; > } > > av_dump_format(pFormatCtx, 0, inputfile, false); > > videoStream=-1; > > for(i=0; inb_streams; i++) { > if(pFormatCtx->streams[i]->codec->codec_type==AVMEDIA_TYPE_VIDEO) { > videoStream=i; > break; > } > } > if(videoStream==-1) { > return -3; > } > > pCodecCtx = pFormatCtx->streams[videoStream]->codec; > > double duration = double(pFormatCtx->duration) / AV_TIME_BASE; > > pCodec=avcodec_find_decoder(pCodecCtx->codec_id); > if(pCodec==NULL) { > return -4; > } > > if(pCodec->capabilities & CODEC_CAP_TRUNCATED) { > pCodecCtx->flags|=CODEC_FLAG_TRUNCATED; > } > > if(avcodec_open2(pCodecCtx, pCodec, NULL)<0) { > return -5; > } > > printf("Using codec: %s\n", pCodec->name); > > pFrame = avcodec_alloc_frame(); > > pFrameYUV=avcodec_alloc_frame(); > if(pFrameYUV==NULL) { > return -6; > } > > numBytes = avpicture_get_size(PIX_FMT_YUV420P, pCodecCtx->width, > pCodecCtx->height); // 379776 > buffer = (uint8_t *)av_malloc(numBytes*sizeof(uint8_t)); > > avpicture_fill((AVPicture *)pFrameYUV, buffer, PIX_FMT_YUV420P, > pCodecCtx->width, pCodecCtx->height); > > totalFrames = pFormatCtx->streams[videoStream]->nb_frames; > // 154959 > printf("Frames: %d\n", totalFrames); > > AVPacket packet; > int isFrameFinished = 0; > int pixelScanCount = 0; > > printf("video width = %d\n", pCodecCtx->width); > printf("video height = %d\n", pCodecCtx->height); > > int frame = 0; > int loops = 0; > > while (av_read_frame(pFormatCtx, &packet) >= 0) { > status = av_read_frame(pFormatCtx, &packet); > if (status<0) { > break; > } > > loops++; > > if (packet.stream_index == videoStream) { > status = avcodec_decode_video2(pCodecCtx, pFrame, > &isFrameFinished, &packet); > if (isFrameFinished) { > frame++; > > if ( (frame%1000) == 0) { > printf("%d\n", frame); > } > > pixelScanCount = 0; > > for (int y = 0; y < pCodecCtx->height; y++) { > uint8_t *p = pFrame->data[0] + y * pFrame->linesize[0]; > > for (int x = 0; x < pCodecCtx->width; x++) { > pixelScanCount++; > } > } > av_free_packet(&packet); > > } > else { > av_free_packet(&packet); > } > } > } > > > printf("frame = %d\n", frame); // frame = 36395 > printf("loops = %d\n", loops); // loops = 212127 > printf("totalFrames = %d\n", totalFrames); // totalFrames = 154959 > > delete [] buffer; > av_free(pFrameYUV); > av_free(pFrame); > avcodec_close(pCodecCtx); > avformat_close_input(&pFormatCtx); > > return 0; > } > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user -------------- next part -------------- An HTML attachment was scrubbed... URL: From cehoyos at ag.or.at Sat May 12 08:54:07 2012 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Sat, 12 May 2012 06:54:07 +0000 (UTC) Subject: [Libav-user] Color depth in MXF file References: Message-ID: Geoffrey tn writes: > My problem is, it doesn't work with a MXF File. The value of > "bits_per_coded_sample" is all the time fixed to 0.? > > I tried with MXF files composed of JP2K and IMX. Could you provide samples? For jp2k, the (libopenjpeg) decoder will set it in the future. Carl Eugen From geoffrey.tn at hotmail.fr Sat May 12 11:31:34 2012 From: geoffrey.tn at hotmail.fr (Geoffrey tn) Date: Sat, 12 May 2012 11:31:34 +0200 Subject: [Libav-user] Color depth in MXF file In-Reply-To: References: , Message-ID: You can find the MXF samples I used, there: http://www.opencubetech.com/page47/ > To: libav-user at ffmpeg.org > From: cehoyos at ag.or.at > Date: Sat, 12 May 2012 06:54:07 +0000 > Subject: Re: [Libav-user] Color depth in MXF file > > Geoffrey tn writes: > > > My problem is, it doesn't work with a MXF File. The value of > > "bits_per_coded_sample" is all the time fixed to 0. > > > > I tried with MXF files composed of JP2K and IMX. > > Could you provide samples? > For jp2k, the (libopenjpeg) decoder will set it in the future. > > Carl Eugen > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user -------------- next part -------------- An HTML attachment was scrubbed... URL: From cehoyos at ag.or.at Sat May 12 14:43:47 2012 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Sat, 12 May 2012 12:43:47 +0000 (UTC) Subject: [Libav-user] Color depth in MXF file References: Message-ID: Geoffrey tn writes: > My problem is, it doesn't work with a MXF File. The value of > "bits_per_coded_sample" is all the time fixed to 0.? > > I tried with MXF files composed of JP2K and IMX. I suspect bits_per_coded_sample is not written in the mxf files (it is written in some other files in the directory). If you initialize the decoder, you should get the information. For mpeg2video 4:2:2 as used in the imx samples, it is always 16 bit per pixel, j2k supports different values, but rgb24 as in the sample is always 24bit. Carl Eugen From genesys at gmx.ch Sat May 12 20:46:19 2012 From: genesys at gmx.ch (=?iso-8859-1?Q?=22Matthias_B=FChlmann=22?=) Date: Sat, 12 May 2012 20:46:19 +0200 Subject: [Libav-user] Creating mp4 (h264 codec) video from OpenGL frames In-Reply-To: References: <4FABCCBA.5060704@gmail.com> <4FABCDB5.4070602@gmail.com> Message-ID: <20120512184619.265570@gmx.net> check the libavformat/output-example.c (instead of the libavcodec/api-example.c) following the same steps as in this file (but for mp4 instead of mpeg) i was able to write an opengl output directly into an mp4 that i could play with quicktime. what I didn't manage was to encode packages that i could use as stream as well as writing them to mp4 file at once (since the mp4 file seems to require a global header while a stream requires the header to be in the packages or something like that and the way x264 lib is used by ffmpeg only one or the other seems to be possible). But that's most likely not what you need so the libavformat/output-example.c should give you what you need. -------- Original-Nachricht -------- > Datum: Thu, 10 May 2012 18:19:05 +0300 > Von: Alex Cohn > An: "This list is about using libavcodec, libavformat, libavutil, libavdevice and libavfilter." > Betreff: Re: [Libav-user] Creating mp4 (h264 codec) video from OpenGL frames > On Thu, May 10, 2012 at 5:16 PM, Alex Druml > wrote: > > > > hello! > > > > i am currently trying to encode frames (RGB) rendered with opengl into a > mp4 > > file encoded with h264. > > > > i already managed to convert the frames from RGB to YUV (swscale) and i > > use the video_encode_example example from > > > http://git.videolan.org/?p=ffmpeg.git;a=blob;f=doc/examples/decoding_encoding.c;h=cb63294b142f007cf78436c5d81c08a49f3124be;hb=HEAD > > > > to encode the frames into a h264 file (vlc already plays the file). now > > i want to write this encoded file into a common container like mp4. > > > > i found a muxing example here > > > http://git.videolan.org/?p=ffmpeg.git;a=blob;f=doc/examples/muxing.c;h=9d338dee670699d07b1f87505d78ee52a17cb920;hb=HEAD > > > > but is it possible to write the encoded frames directly into a mp4 file? > > > > best regards! > > No, you must conform to mp4 container logic. This is what the muxer is > for. > > BR, > Alex Cohn > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user -- NEU: FreePhone 3-fach-Flat mit kostenlosem Smartphone! Jetzt informieren: http://mobile.1und1.de/?ac=OM.PW.PW003K20328T7073a From soltic.lucas at gmail.com Sun May 13 10:16:48 2012 From: soltic.lucas at gmail.com (Lucas Soltic) Date: Sun, 13 May 2012 10:16:48 +0200 Subject: [Libav-user] H.264 always enabled on OS X.. ? Message-ID: <0B85229D-9CED-4C94-89F2-EC4A8EE2F131@gmail.com> Hello, Today I noticed something weird about the enabled decoders. Is it normal that ./configure --disable-yasm --disable-decoders --disable-encoders --disable-muxers gives me that? [...] Enabled decoders: h264 Enabled encoders: Enabled hwaccels: h264_vda [...] Why is it enabled even if I chose to disable it? I'm running OS X Lion and I use FFmpeg 0.10.3. Regards, Lucas SOLTIC From cehoyos at ag.or.at Sun May 13 13:57:37 2012 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Sun, 13 May 2012 11:57:37 +0000 (UTC) Subject: [Libav-user] H.264 always enabled on OS X.. ? References: <0B85229D-9CED-4C94-89F2-EC4A8EE2F131@gmail.com> Message-ID: Lucas Soltic writes: > Today I noticed something weird about the enabled decoders. > Is it normal that ./configure --disable-yasm --disable-decoders > --disable-encoders --disable-muxers gives me that? > Enabled decoders: > h264 > Enabled hwaccels: > h264_vda (I can only guess because I am not on OS X.) By default, hwaccels are enabled / autodetected. Since you did not disable hwaccels, h264_vda was detected and enabled and since it required the h264 (software) decoder, this decoder was also enabled. I do understand why you suspect a bug, but it can be argued that this is intended, if you want to disable the software decoder (and don't need h264_vda), use --disable-hwaccels. Could you explain what you are trying to achieve with --disable-decoders --disable-encoders --disable-muxers? If you only need demuxers, I wonder how good they work with --disable-decoders... Note that there is --disable-everything (which can be combined with enable-options) which you may be searching for. Carl Eugen From soltic.lucas at gmail.com Sun May 13 16:26:35 2012 From: soltic.lucas at gmail.com (Lucas Soltic) Date: Sun, 13 May 2012 16:26:35 +0200 Subject: [Libav-user] H.264 always enabled on OS X.. ? In-Reply-To: References: <0B85229D-9CED-4C94-89F2-EC4A8EE2F131@gmail.com> Message-ID: <30C08DA8-019C-4BA7-B3C5-FD5B44F88748@gmail.com> Le 13 mai 2012 ? 13:57, Carl Eugen Hoyos a ?crit : > Lucas Soltic writes: > >> Today I noticed something weird about the enabled decoders. >> Is it normal that ./configure --disable-yasm --disable-decoders >> --disable-encoders --disable-muxers gives me that? > >> Enabled decoders: >> h264 > >> Enabled hwaccels: >> h264_vda > > (I can only guess because I am not on OS X.) > By default, hwaccels are enabled / autodetected. Since you did not > disable hwaccels, h264_vda was detected and enabled and since it > required the h264 (software) decoder, this decoder was also enabled. > > I do understand why you suspect a bug, but it can be argued that > this is intended, if you want to disable the software decoder (and > don't need h264_vda), use --disable-hwaccels. You are right. Using --disable-hwaccels removes h264 from the enabled decoders list. However it still seems a bit odd to enable a decoder when I ask to disable all of them. I'm using --disable-decoders so that I can do --enable-decoder=... for each decoder I want, and no other one. This is especially useful as I want to distribute binaries that are not concerned by royalties. But as I understand it, here it uses the hardware decoder, thus it's not a decoder made by FFmpeg, but a decoder provided by the OS, thus a binary using this hardware decoder should not be concerned by royalties. > Could you explain what you are trying to achieve with --disable-decoders > --disable-encoders --disable-muxers? If you only need demuxers, I > wonder how good they work with --disable-decoders... Well, it was just for testing purposes, I agree the options I put are meaningless. I added some --disable-... options only in order to make the output a bit shorter. Thanks for your help :) . > > Note that there is --disable-everything (which can be combined with > enable-options) which you may be searching for. > > 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 May 13 16:43:13 2012 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Sun, 13 May 2012 14:43:13 +0000 (UTC) Subject: [Libav-user] H.264 always enabled on OS X.. ? References: <0B85229D-9CED-4C94-89F2-EC4A8EE2F131@gmail.com> <30C08DA8-019C-4BA7-B3C5-FD5B44F88748@gmail.com> Message-ID: Lucas Soltic writes: > This is especially useful as I want to distribute binaries > that are not concerned by royalties. I don't think this is possible (in case you need a guarantee). Carl Eugen From soltic.lucas at gmail.com Sun May 13 16:49:33 2012 From: soltic.lucas at gmail.com (Lucas Soltic) Date: Sun, 13 May 2012 16:49:33 +0200 Subject: [Libav-user] H.264 always enabled on OS X.. ? In-Reply-To: References: <0B85229D-9CED-4C94-89F2-EC4A8EE2F131@gmail.com> <30C08DA8-019C-4BA7-B3C5-FD5B44F88748@gmail.com> Message-ID: Le 13 mai 2012 ? 16:43, Carl Eugen Hoyos a ?crit : > Lucas Soltic writes: > >> This is especially useful as I want to distribute binaries >> that are not concerned by royalties. > > I don't think this is possible (in case you need a guarantee). Why wouldn't it be possible if I configure FFmpeg to include only decoders such as vorbis and theora? Or maybe you mean even these codecs may be covered by some hidden patents and one day we may have to pay even for these. But at the moment I'm not considering that, it's ok for me if there are currently no major issues with these. > > Carl Eugen > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user From alex3.dr at googlemail.com Sun May 13 22:31:51 2012 From: alex3.dr at googlemail.com (Alex Druml) Date: Sun, 13 May 2012 22:31:51 +0200 Subject: [Libav-user] Creating mp4 (h264 codec) video from OpenGL frames In-Reply-To: <20120512184619.265570@gmx.net> References: <4FABCCBA.5060704@gmail.com> <4FABCDB5.4070602@gmail.com> <20120512184619.265570@gmx.net> Message-ID: <4FB01A37.7040308@gmail.com> thx matthias for the great hint! finally got it to work ... now i can render the rgb frames (windowsize) into a mp4 with x264 (yuv and videosize)! thx to all! Am 12.05.2012 20:46, schrieb "Matthias B?hlmann": > check the libavformat/output-example.c (instead of the libavcodec/api-example.c) > > following the same steps as in this file (but for mp4 instead of mpeg) i was able to write an opengl output directly into an mp4 that i could play with quicktime. > > what I didn't manage was to encode packages that i could use as stream as well as writing them to mp4 file at once (since the mp4 file seems to require a global header while a stream requires the header to be in the packages or something like that and the way x264 lib is used by ffmpeg only one or the other seems to be possible). But that's most likely not what you need so the libavformat/output-example.c should give you what you need. > > -------- Original-Nachricht -------- >> Datum: Thu, 10 May 2012 18:19:05 +0300 >> Von: Alex Cohn >> An: "This list is about using libavcodec, libavformat, libavutil, libavdevice and libavfilter." >> Betreff: Re: [Libav-user] Creating mp4 (h264 codec) video from OpenGL frames > >> On Thu, May 10, 2012 at 5:16 PM, Alex Druml >> wrote: >>> >>> hello! >>> >>> i am currently trying to encode frames (RGB) rendered with opengl into a >> mp4 >>> file encoded with h264. >>> >>> i already managed to convert the frames from RGB to YUV (swscale) and i >>> use the video_encode_example example from >>> >> http://git.videolan.org/?p=ffmpeg.git;a=blob;f=doc/examples/decoding_encoding.c;h=cb63294b142f007cf78436c5d81c08a49f3124be;hb=HEAD >>> >>> to encode the frames into a h264 file (vlc already plays the file). now >>> i want to write this encoded file into a common container like mp4. >>> >>> i found a muxing example here >>> >> http://git.videolan.org/?p=ffmpeg.git;a=blob;f=doc/examples/muxing.c;h=9d338dee670699d07b1f87505d78ee52a17cb920;hb=HEAD >>> >>> but is it possible to write the encoded frames directly into a mp4 file? >>> >>> best regards! >> >> No, you must conform to mp4 container logic. This is what the muxer is >> for. >> >> BR, >> Alex Cohn >> _______________________________________________ >> Libav-user mailing list >> Libav-user at ffmpeg.org >> http://ffmpeg.org/mailman/listinfo/libav-user From jettoblack at gmail.com Mon May 14 00:38:17 2012 From: jettoblack at gmail.com (Jason Livingston) Date: Sun, 13 May 2012 18:38:17 -0400 Subject: [Libav-user] How to set mpegts muxrate via API? Message-ID: Hello, When I set the muxrate via ffmpeg CLI, it works fine, so this isn't a bug. I just can't figure out how to set the same muxrate option via the APIs. E.g. this works fine and the muxed rate looks right: ffmpeg -i inputfile -muxrate 3500000 -vcodec copy -acodec copy output.ts Log msg from muxer: [mpegts @ 0x7faf82028400] muxrate 3500000, pcr every 49 pkts, sdt every 1246, pat/pmt every 249 pkts Trying to set the same thing via API, and the option setting seems to stick in the MpegTs private class options (calling av_get_int() for "muxrate" gives me the intended value back, so it looks like I succeeded in setting the option value), but the resulting stream is not muxed at the right rate. Code: AVFormatContext *out = NULL; int mux_rate = 3500000; char *outfile = "test.ts"; int r; // Open output file for writing out = avformat_alloc_context(); assert(out); out->oformat = av_guess_format(NULL, outfile, NULL); // Guess output container format based on file extension assert(out->oformat); printf("Open output file: %s\nOutput format: %s\n", outfile, out->oformat->long_name); // set output muxrate r = av_opt_set_int(&out->oformat->priv_class, "muxrate", mux_rate, AV_OPT_SEARCH_CHILDREN); if (r) { char errbuf[128]; av_strerror(r, errbuf, 128); printf("error %s when setting opt muxrate=%"PRId64"\n", errbuf, mux_rate); } // read back muxrate int64_t res = av_get_int(&out->oformat->priv_class, "muxrate", NULL); printf("muxrate set to %"PRId64"\n", res); if (res != mux_rate) { printf("Warning: output mux rate %"PRId64" doesn't match input mux rate %"PRId64"\n", res, mux_rate); } // open output r = avio_open2(&out->pb, outfile, AVIO_FLAG_WRITE, NULL, NULL); if (r) { printf("err %x\n", r); return r; } I get this log output: muxrate set to 3500000 [mpegts @ 0x103023c00] muxrate VBR, pcr every 5 pkts, sdt every 200, pat/pmt every 40 pkts So the "muxrate VBR" log msg from the muxer seems to indicate that my muxrate option is not being used. Any ideas? How does the ffmpeg "-muxrate" option get passed into the muxer? Thanks! From rnp at 25ghz.net Mon May 14 14:13:04 2012 From: rnp at 25ghz.net (Rafael do Nascimento Pereira) Date: Mon, 14 May 2012 14:13:04 +0200 Subject: [Libav-user] libav* + gui toolkits Message-ID: Hello folks, I trying to write a gui applications that uses FFmpeg as backend. I have already read and played with the (upgraded) Dranger's FFmpeg tutorial(1), which in fact works. It is used in this tutorial the libSDL. As far as i know i does not integrate well with the modern GUI Toolkits (GTK+3 ans Qt4). I have read about the combinations like FFmpeg + Qt4 (and maybe Gstreamer) and FFmpeg + GTK+3 + clutter/Gstreamer. Does anybody know other possible combination ? Which one has more advantages ? Any help will be appriciated. (1) https://drangertuts.wordpress.com/ Best regards, Rafael. *"If you can't explain it simply, you don't understand it well enough." --Albert Einstein* -------------- next part -------------- An HTML attachment was scrubbed... URL: From robert.grasboeck at gmail.com Mon May 14 14:46:08 2012 From: robert.grasboeck at gmail.com (=?ISO-8859-1?Q?Robert_Grasb=F6ck?=) Date: Mon, 14 May 2012 14:46:08 +0200 Subject: [Libav-user] HW Acceleration Message-ID: Hi! I would like to compile ffmpeg including HW accelleration. My configure call is as follow: ./configure --prefix=/usr --disable-nonfree --disable-gpl --disable-encoders --disable-muxers --disable-debug --disable-amd3dnow --disable-amd3dnowext --enable-hwaccels --enable-vaapi --enable-vdpau --enable-runtime-cpudetect --enable-shared --disable-devices I can see following lines after I run ./configure Enabled hwaccels: h263_vaapi ? ? ? ? ? ? ?mpeg2_vaapi ? ? ? ? ? ? vc1_vaapi h264_vaapi ? ? ? ? ? ? ?mpeg4_vaapi ? ? ? ? ? ? wmv3_vaapi Now my question is do I get HW acceleration directly inside the libavcodec or do I have to manage this with special hw_accel contexts? thx for answer, Robert Grasb?ck From alex3.dr at googlemail.com Mon May 14 16:09:46 2012 From: alex3.dr at googlemail.com (Alex Druml) Date: Mon, 14 May 2012 16:09:46 +0200 Subject: [Libav-user] Flip frame using swscale Message-ID: <4FB1122A.8080507@gmail.com> Hi iam searching for a way to flip a frame (RGB image from opengl backbuffer - origin bottom left) so that the origin is on top left because my videos are currently vertical inverted. is it possible to achieve such a flip by modifying the strides and slices? BR, alex From bstewart at ais-sim.com Mon May 14 20:18:06 2012 From: bstewart at ais-sim.com (Bryan Stewart) Date: Mon, 14 May 2012 11:18:06 -0700 Subject: [Libav-user] AVFilter overlay transparent image onto another transparent image Message-ID: <4FB14C5E.40202@ais-sim.com> ffmpeg/libav version from git-1eabd71 windows build dated: 3/25/2012 I am trying to merge two transparent images onto one another using the avfilter overlay: ffmpeg -i a.png -vf movie=a.png, transpose=1 [inA]; [in] [inA] overlay [out] a.png has alpha in the image. When I run, the main image is always converted to yuv420p (no alpha) while the overlay image remains a yuva420p image. I have tried to insert the format filter in front, back, etc to the source image, but the filter graph still inserts an extra scale filter to force the main image to be a yuv420p (no alpha) image. The resulting image always has the background as my image without alpha and the overlay image has alpha. Is there a way to get the main overlay image to remain an alpha image? -- #-----------------------------------------------------------------# # Bryan C. Stewart Email: bstewart at ais-sim.com # # Web: www.ais-sim.com # # Advanced Interactive Systems, Inc. Phone: (831)655-0440 # # 8 Harris Ct, Suite B5, Fax: (831)655-0885 # # Monterey, CA 93940 # #-----------------------------------------------------------------# * * CONFIDENTIALITY NOTICE ---------------------- This message, together with any attachments, may be legally privileged and is confidential information intended only for the use of the individual or entity to which it is addressed. It is exempt from disclosure under applicable law including court orders. If you are not the intended recipient, you are hereby notified that any use, dissemination, distribution or copy of this message, or any attachment, is strictly prohibited. If you have received this message in error, please notify the original sender and delete this message, along with any attachments, from your computer. In addition, Data contained in this email may be subject to the International Traffic in Arms Regulation (ITAR) or the Export Administration Regulation (EAR) of 1979. Regulated data may not be exported, released, or disclosed to foreign nationals inside or outside the United States without obtaining the prior written approval of Advanced Interactive Systems, Inc. and licenses as required by the U.S. Department of State. From amir.rouhi at rmit.edu.au Tue May 15 03:25:22 2012 From: amir.rouhi at rmit.edu.au (amir.rouhi at rmit.edu.au) Date: Tue, 15 May 2012 11:25:22 +1000 Subject: [Libav-user] Extracted I-Frames seems not correct, Why? In-Reply-To: References: Message-ID: Would you explain how can i test it with referenced decoder? do you mean , testing by JM software? If you mean this, i should say that i have extracted i frames by JM software and they are 4 and same as the number that ffmpeg shows. If i am wrong i would be pleased if you give me more advice. Amir On 12 May 2012 00:09, Carl Eugen Hoyos wrote: > writes: > > > C:\ 1.264 -vsync 0 -vf select="eq(pict_type\, PICT_TYPE_I)" > > C:\ Test\IFrames\I-Frm-%03d.jpeg > > Its a short video and i just get 4 images but the images > > does not looks correct images > > Could you test with the reference decoder? > If you find any difference, this sounds like a very important > issue, please provide the sample in this case. > > Carl Eugen > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > -- Amir H. Rouhi PhD Student/ CSIT RMIT University Room: 14-09-04 http://raws.adc.rmit.edu.au/~s3288736/blog2/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From info at denisgottardello.it Mon May 14 21:03:41 2012 From: info at denisgottardello.it (Denis) Date: Mon, 14 May 2012 21:03:41 +0200 Subject: [Libav-user] libav* + gui toolkits In-Reply-To: References: Message-ID: <201205142103.42342.info@denisgottardello.it> In data luned? 14 maggio 2012 14:13:04, Rafael do Nascimento Pereira ha scritto: > ello folks, > > I trying to write a gui applications that uses FFmpeg as backend. I have > already read and played with the (upgraded) Dranger's FFmpeg tutorial(1), > which in fact works. It is used in this tutorial the libSDL. As far as i > know i does not integrate well with the modern GUI Toolkits (GTK+3 ans > Qt4). > > I have read about the combinations like FFmpeg + Qt4 (and maybe Gstreamer) > and FFmpeg + GTK+3 + clutter/Gstreamer. Does anybody know other possible > combination ? Which one has more advantages ? Any help will be > appriciated. In my case I have wrote a program in Qt4 that extracts the frames directly from the movies. I think if you want you can use this way. -- www.denisgottardello.it Skype: mrdebug Videosurveillance and home automation! http://www.denisgottardello.it/DomusBoss/DomusBossIndice.php From info at denisgottardello.it Mon May 14 22:27:58 2012 From: info at denisgottardello.it (Denis) Date: Mon, 14 May 2012 22:27:58 +0200 Subject: [Libav-user] How to redirect FFMPEG output to a socket In-Reply-To: References: <201205042332.09605.info@denisgottardello.it> Message-ID: <201205142227.58594.info@denisgottardello.it> In data luned? 07 maggio 2012 16:14:17, Wagner Patriota ha scritto: > no, it's easier... example: if you have myprotocol.c, just add to Makefile > the following line: > > OBJS-$(CONFIG_MYPROTOCOL_PROTOCOL) += myprotocol.o > > that's it... look for the session "protocols I/O" in the Makefile I'm sorry but I'm not be able. I have put the attached file in "ffmpeg-0.10.2/libavformat/" folder. Then I have added this row "OBJS-$(CONFIG_BUFFER_PROTOCOL) += buffer.o" to this filie "ffmpeg-0.10.2/libavformat/makefile" And then for compile I use these rows "./configure --enable-gpl --enable-nonfree --enable-libx264 --enable-libvorbis --enable-libtheora --enable-libvpx --enable-shared --enable-protocol=buffer" "make" but nothing. How you can see there isn't "buffer" as protocol. "Enabled protocols: applehttp httpproxy rtmps cache md5 rtmpt concat mmsh rtmpte crypto mmst rtp file pipe tcp gopher rtmp udp http rtmpe" -- www.denisgottardello.it Skype: mrdebug Videosurveillance and home automation! http://www.denisgottardello.it/DomusBoss/DomusBossIndice.php -------------- next part -------------- A non-text attachment was scrubbed... Name: buffer.c Type: text/x-csrc Size: 1194 bytes Desc: not available URL: From jettoblack at gmail.com Tue May 15 07:08:42 2012 From: jettoblack at gmail.com (jettoblack) Date: Mon, 14 May 2012 22:08:42 -0700 (PDT) Subject: [Libav-user] How to set mpegts muxrate via API? In-Reply-To: References: Message-ID: <1337058522010-4633928.post@n4.nabble.com> Nevermind, I figured it out. :) Needed to create a AVDictionary containing "muxrate" as a key, and pass that into avformat_write_header(). -- View this message in context: http://libav-users.943685.n4.nabble.com/Libav-user-How-to-set-mpegts-muxrate-via-API-tp4631113p4633928.html Sent from the libav-users mailing list archive at Nabble.com. From cehoyos at ag.or.at Tue May 15 07:46:34 2012 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Tue, 15 May 2012 05:46:34 +0000 (UTC) Subject: [Libav-user] Extracted I-Frames seems not correct, Why? References: Message-ID: writes: > Would you explain how can i test it with?referenced?decoder? > do you mean , testing by JM software? Yes, JM is the H264 reference decoder. > If you mean this, i should say that i have extracted i > frames by JM software and they are 4 and same as the number > that ffmpeg shows. Then a bug seems unlikely, don't you agree? Please do not top-post here, Carl Eugen From cehoyos at ag.or.at Tue May 15 08:42:30 2012 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Tue, 15 May 2012 06:42:30 +0000 (UTC) Subject: [Libav-user] =?utf-8?q?AVFilter_overlay_transparent_image_onto_an?= =?utf-8?q?other=09transparent_image?= References: <4FB14C5E.40202@ais-sim.com> Message-ID: Bryan Stewart writes: > ffmpeg -i a.png -vf movie=a.png, transpose=1 [inA]; [in] [inA] overlay [out] Complete, uncut console output missing. You do realize that your disclaimer does not make much sense on a public mailing list? Carl Eugen From krishnaks at iwavesystems.com Tue May 15 09:36:25 2012 From: krishnaks at iwavesystems.com (krishnaks at iwavesystems.com) Date: Tue, 15 May 2012 13:06:25 +0530 Subject: [Libav-user] Hardware accelerator context for IOS Message-ID: <53046d03e3582b8a504dd428faee71f5.squirrel@124.124.219.233> /** * Hardware accelerator context. * For some hardware accelerators, a global context needs to be * provided by the user. In that case, this holds display-dependent * data FFmpeg cannot instantiate itself. Please refer to the * FFmpeg HW accelerator documentation to know how to fill this * is. e.g. for VA API, this is a struct vaapi_context. * - encoding: unused * - decoding: Set by user */ void *hwaccel_context; I am developing iPad application and using libavcodec for H264 decoding. Can I use this variable for hardware accelerated decoding? From wagner.patriota at gmail.com Tue May 15 19:59:01 2012 From: wagner.patriota at gmail.com (Wagner Patriota) Date: Tue, 15 May 2012 14:59:01 -0300 Subject: [Libav-user] How to redirect FFMPEG output to a socket In-Reply-To: <201205142227.58594.info@denisgottardello.it> References: <201205042332.09605.info@denisgottardello.it> <201205142227.58594.info@denisgottardello.it> Message-ID: yes I see... maybe something with the name "buffer", for some weard reason.... because I did exactly the same thing and it worked on the first time... try change the name... On Mon, May 14, 2012 at 5:27 PM, Denis wrote: > In data luned? 07 maggio 2012 16:14:17, Wagner Patriota ha scritto: > > no, it's easier... example: if you have myprotocol.c, just add to > Makefile > > the following line: > > > > OBJS-$(CONFIG_MYPROTOCOL_PROTOCOL) += myprotocol.o > > > > that's it... look for the session "protocols I/O" in the Makefile > > > I'm sorry but I'm not be able. > I have put the attached file in "ffmpeg-0.10.2/libavformat/" folder. > > Then I have added this row > "OBJS-$(CONFIG_BUFFER_PROTOCOL) += buffer.o" > > to this filie > "ffmpeg-0.10.2/libavformat/makefile" > > And then for compile I use these rows > "./configure --enable-gpl --enable-nonfree --enable-libx264 > --enable-libvorbis > --enable-libtheora --enable-libvpx --enable-shared > --enable-protocol=buffer" > "make" > > but nothing. How you can see there isn't "buffer" as protocol. > > "Enabled protocols: > applehttp httpproxy rtmps > cache md5 rtmpt > concat mmsh rtmpte > crypto mmst rtp > file pipe tcp > gopher rtmp udp > http rtmpe" > > > > > -- > 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 amir.rouhi at rmit.edu.au Wed May 16 03:53:09 2012 From: amir.rouhi at rmit.edu.au (amir.rouhi at rmit.edu.au) Date: Wed, 16 May 2012 11:53:09 +1000 Subject: [Libav-user] Extracted I-Frames seems not correct, Why? In-Reply-To: References: Message-ID: Hi Carl I dont want to report a bug, i just want to know where is my problem? and by the wayif i should not top-post here, then how can i explain my problem to you experts? Thanks On 15 May 2012 15:46, Carl Eugen Hoyos wrote: > writes: > > > Would you explain how can i test it with referenced decoder? > > do you mean , testing by JM software? > > Yes, JM is the H264 reference decoder. > > > If you mean this, i should say that i have extracted i > > frames by JM software and they are 4 and same as the number > > that ffmpeg shows. > > Then a bug seems unlikely, don't you agree? > > Please do not top-post here, Carl Eugen > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > -- Amir H. Rouhi PhD Student/ CSIT RMIT University Room: 14-09-04 http://raws.adc.rmit.edu.au/~s3288736/blog2/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From wagner.patriota at gmail.com Wed May 16 05:46:53 2012 From: wagner.patriota at gmail.com (Wagner Patriota) Date: Wed, 16 May 2012 00:46:53 -0300 Subject: [Libav-user] Challenge... create a black .TS file from NOTHING? Message-ID: Hello, Is there a way in ffmpeg for me to create a .TS video only with 1 stream of video H.264 with black frames? As input I would give, of couse, width+height+duration... the the output is a MPEG2-TS with this video in black... what is the easiest way for me to do it with command line? -------------- next part -------------- An HTML attachment was scrubbed... URL: From wagner.patriota at gmail.com Wed May 16 06:44:34 2012 From: wagner.patriota at gmail.com (Wagner Patriota) Date: Wed, 16 May 2012 01:44:34 -0300 Subject: [Libav-user] Compiling for Mac with libx264 Message-ID: I can't compile the last version of FFMPEG with libx264... it says: "ERROR: libx264 version must be >= 0.118." I have the latest version from the libx264 website... any idea? -------------- next part -------------- An HTML attachment was scrubbed... URL: From cehoyos at ag.or.at Wed May 16 08:17:37 2012 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Wed, 16 May 2012 06:17:37 +0000 (UTC) Subject: [Libav-user] Challenge... create a black .TS file from NOTHING? References: Message-ID: Wagner Patriota writes: > Is there a way in ffmpeg for me to create a .TS video only with > 1 stream of video H.264 with black frames? $ ffmpeg -f rawvideo -pix_fmt rgb24 -s 640x480 -i /dev/zero out.ts (This produces mpeg2video, but I am sure you will be able to fill in the output options.) Carl Eugen From alexcohn at netvision.net.il Wed May 16 10:31:18 2012 From: alexcohn at netvision.net.il (Alex Cohn) Date: Wed, 16 May 2012 11:31:18 +0300 Subject: [Libav-user] Extracted I-Frames seems not correct, Why? In-Reply-To: References: Message-ID: On Tue, May 15, 2012 at 8:46 AM, Carl Eugen Hoyos wrote: > writes: > > > Would you explain how can i test it with referenced decoder? > > do you mean , testing by JM software? > > Yes, JM is the H264 reference decoder. > > > If you mean this, i should say that i have extracted i > > frames by JM software and they are 4 and same as the number > > that ffmpeg shows. > > Then a bug seems unlikely, don't you agree? > If I understand correctly, Amir complains about the encoder, not the decoder. Using JM he verified that the I-frames are not sharp, and not inserted adaptively at big changes of the scene. This is either a problem of x264 encoder, or of (failing to) specify the correct options for the encoder via ffmpeg command line. Sincerely, Alex Cohn -------------- next part -------------- An HTML attachment was scrubbed... URL: From amir.rouhi at rmit.edu.au Wed May 16 10:38:53 2012 From: amir.rouhi at rmit.edu.au (amir.rouhi at rmit.edu.au) Date: Wed, 16 May 2012 18:38:53 +1000 Subject: [Libav-user] Double frame rate after conversion Message-ID: Hi I convert a mpeg1 video mpeg4/ AVC by the below command but i dont know why the visual frame rate become double after conversion (fps in both are same but tbr will be twice as the original video) ffmpeg -i C:\Video\TrecVid-Video\2\1.mpg -r 25 -an -vcodec libx264 -threads 0 -f h264 -r 25 -g 0 C:\Video\TrecVid-Video\2\11.264 what is your advice? -------------- next part -------------- An HTML attachment was scrubbed... URL: From alexcohn at netvision.net.il Wed May 16 10:42:15 2012 From: alexcohn at netvision.net.il (Alex Cohn) Date: Wed, 16 May 2012 11:42:15 +0300 Subject: [Libav-user] Extracted I-Frames seems not correct, Why? In-Reply-To: References: Message-ID: On Fri, May 11, 2012 at 7:09 AM, wrote: > Hi to ffmpeg seniors and experts > I am using windows platform and I have created a series of video in pure > format of *.264 from raw format by the below command: > > ffmpeg -f rawvideo -pix_fmt yuv420p -s 360x240 -i C:\1.yuv -an -vcodec > libx264 -threads 0 -s 360x240 -f h264 C:\1.264 > > I want to extract I-Frames which are created in adaptive mode in encoding > phase. i use the below command: > > ffmpeg -i C:\ 1.264 -vsync 0 -vf select="eq(pict_type\, PICT_TYPE_I)" > C:\ Test\IFrames\I-Frm-%03d.jpeg > Its a short video and i just get 4 images but the images does not looks > correct images, They are not sharp and clear images. BTW, adaptive I-Frame > are expected t be located at the start of a new group of pictures, after > any big changes in the scene, but these extracted image are not showing > this. do you know whats my mistake or whats wrong? > -- > Amir > Hi, Adaptive GOP is not the default for x264 encoder. See http://mewiki.project357.com/wiki/X264_Settings for all options. The relevant command line arguments are also discussed at http://www.digital-digest.com/articles/x264_options_page5.html. This said, you should also learn the way to specify x264 parameters via ffmpeg command line. A good guide can be found here: http://sites.google.com/site/linuxencoding/x264-ffmpeg-mapping Regarding sharpness of the I-frames, it really does happen that key frames display lower quality than the rest of the video. The reason is that when the encoder tries to maintain certain bitrate, it prefers to apply more lossy compression to the I-frames, because otherwise they get very big. Again, this bias can be controlled with x264 parameters. BR, Alex Cohn -------------- next part -------------- An HTML attachment was scrubbed... URL: From cehoyos at ag.or.at Wed May 16 10:46:41 2012 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Wed, 16 May 2012 08:46:41 +0000 (UTC) Subject: [Libav-user] Double frame rate after conversion References: Message-ID: writes: > I convert a mpeg1 video mpeg4/?AVC?by the below command but > i dont know why the visual frame rate become double after > conversion (fps in both are same but tbr will be twice as > the original video) But tbr is not the framerate. > ffmpeg -i C:\Video\TrecVid-Video\2\1.mpg -r 25 -an > -vcodec libx264 -threads 0 ?-f h264 -r 25 -g 0 > C:\Video\TrecVid-Video\2\11.264 > > what is your advice? Please post complete, uncut console output. Carl Eugen From cehoyos at ag.or.at Wed May 16 10:48:21 2012 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Wed, 16 May 2012 08:48:21 +0000 (UTC) Subject: [Libav-user] Extracted I-Frames seems not correct, Why? References: Message-ID: Alex Cohn writes: > If I understand correctly, Amir complains about the > encoder, not the decoder. Then your answer was clearly more helpful than mine! Carl Eugen From alexcohn at netvision.net.il Wed May 16 11:40:03 2012 From: alexcohn at netvision.net.il (Alex Cohn) Date: Wed, 16 May 2012 12:40:03 +0300 Subject: [Libav-user] Double frame rate after conversion In-Reply-To: References: Message-ID: On Wed, May 16, 2012 at 11:38 AM, wrote: > Hi > I convert a mpeg1 video mpeg4/ AVC by the below command but i dont know > why the visual frame rate become double after conversion (fps in both are > same but tbr will be twice as the original video) > > ffmpeg -i C:\Video\TrecVid-Video\2\1.mpg -r 25 -an -vcodec libx264 > -threads 0 -f h264 -r 25 -g 0 C:\Video\TrecVid-Video\2\11.264 > > what is your advice? > It's fine for TBR to be higher than the nominal frame rate. See libavformat/avformat.h for more explanation: TBR is the r_frame_rate field of AVStream structure. BR, Alex Cohn -------------- next part -------------- An HTML attachment was scrubbed... URL: From amir.rouhi at rmit.edu.au Wed May 16 12:44:40 2012 From: amir.rouhi at rmit.edu.au (amir.rouhi at rmit.edu.au) Date: Wed, 16 May 2012 20:44:40 +1000 Subject: [Libav-user] Double frame rate after conversion In-Reply-To: References: Message-ID: Knowing that what is tbr exactly, can not solve the problem. the frame rate are same technically, when you compare the information by ffmpeg. The fact is that the transformed video, after using vcodec libx264, is twice faster as the original video. when i compare the information of bot video i noticed tbr of the transformed video is twice as the original one. can you help me to have a similar video after transformation? On 16 May 2012 19:40, Alex Cohn wrote: > On Wed, May 16, 2012 at 11:38 AM, wrote: > >> Hi >> I convert a mpeg1 video mpeg4/ AVC by the below command but i dont know >> why the visual frame rate become double after conversion (fps in both are >> same but tbr will be twice as the original video) >> >> ffmpeg -i C:\Video\TrecVid-Video\2\1.mpg -r 25 -an -vcodec libx264 >> -threads 0 -f h264 -r 25 -g 0 C:\Video\TrecVid-Video\2\11.264 >> >> what is your advice? >> > > It's fine for TBR to be higher than the nominal frame rate. See > libavformat/avformat.h for more explanation: TBR is the r_frame_rate field > of AVStream structure. > > BR, > > Alex Cohn > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > > -- Amir H. Rouhi PhD Student/ CSIT RMIT University Room: 14-09-04 http://raws.adc.rmit.edu.au/~s3288736/blog2/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From wagner.patriota at gmail.com Wed May 16 18:27:36 2012 From: wagner.patriota at gmail.com (Wagner Patriota) Date: Wed, 16 May 2012 13:27:36 -0300 Subject: [Libav-user] Challenge... create a black .TS file from NOTHING? In-Reply-To: References: Message-ID: perfectly... it worked! :-) thanks... yes... I will customize now on... thankz!!! On Wed, May 16, 2012 at 3:17 AM, Carl Eugen Hoyos wrote: > Wagner Patriota writes: > > > Is there a way in ffmpeg for me to create a .TS video only with > > 1 stream of video H.264 with black frames? > > $ ffmpeg -f rawvideo -pix_fmt rgb24 -s 640x480 -i /dev/zero out.ts > (This produces mpeg2video, but I am sure you will be able to > fill in the output options.) > > 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 alexcohn at netvision.net.il Wed May 16 20:38:17 2012 From: alexcohn at netvision.net.il (Alex Cohn) Date: Wed, 16 May 2012 21:38:17 +0300 Subject: [Libav-user] Double frame rate after conversion In-Reply-To: References: Message-ID: On May 16, 2012 1:45 PM, wrote: > > Knowing that what is tbr exactly, can not solve the problem. the frame rate are same technically, when you compare the information by ffmpeg. The fact is that the transformed video, after using vcodec libx264, is twice faster as the original video. when i compare the information of bot video i noticed tbr of the transformed video is twice as the original one. > can you help me to have a similar video after transformation? Which player displays this behavior? Alex -------------- next part -------------- An HTML attachment was scrubbed... URL: From dnegel666 at gmail.com Thu May 17 00:33:45 2012 From: dnegel666 at gmail.com (Dnegel X.) Date: Thu, 17 May 2012 00:33:45 +0200 Subject: [Libav-user] Retrieve 10bit video frames Message-ID: Hi, I would like to decode 10bit videos into PIX_FMT_YUV422P10LE pixel format, using: struct SwsContext* swContext = sws_getContext(width, height, originalpixfmt, width, height, PIX_FMT_YUV422P10LE, SWS_FAST_BILINEAR, NULL, NULL, NULL); sws_scale(swContext, frame->data, frame->linesize, 0, height, frameYUV->data, frameYUV->linesize); However, the decoded frameYUV->data is of type uint8_t, and I would expect to get something able to store 10bit values like a uint16_t. So, what is returned in this 8bit array in this case? How can I proceed to get the 10bit values? Thanks for your help. Nigel -------------- next part -------------- An HTML attachment was scrubbed... URL: From mbradshaw at sorensonmedia.com Thu May 17 00:59:18 2012 From: mbradshaw at sorensonmedia.com (Michael Bradshaw) Date: Wed, 16 May 2012 16:59:18 -0600 Subject: [Libav-user] Retrieve 10bit video frames In-Reply-To: References: Message-ID: > However, the decoded frameYUV->data is of type uint8_t, and I would expect > to get something able to store 10bit values like a uint16_t. So, what is > returned in this 8bit array in this case? How can I proceed to get the 10bit > values? Just cast the buffer. uint16_t* planes[3] = {(uint16_t*)frameYUV->data[0], (uint16_t*)frameYUV->data[1], (uint16_t*)frameYUV->data[2]}; --Michael From amir.rouhi at rmit.edu.au Thu May 17 03:29:16 2012 From: amir.rouhi at rmit.edu.au (amir.rouhi at rmit.edu.au) Date: Thu, 17 May 2012 11:29:16 +1000 Subject: [Libav-user] Double frame rate after conversion In-Reply-To: References: Message-ID: I usually use SMPlayer, but even ffplay shows the same behavior (the speed is twice so the time length is half). my version of VLC can not play .264 files, may be i need to install a patch or upgrade it. On 17 May 2012 04:38, Alex Cohn wrote: > On May 16, 2012 1:45 PM, wrote: > > > > Knowing that what is tbr exactly, can not solve the problem. the frame > rate are same technically, when you compare the information by ffmpeg. The > fact is that the transformed video, after using vcodec libx264, is twice > faster as the original video. when i compare the information of bot video i > noticed tbr of the transformed video is twice as the original one. > > can you help me to have a similar video after transformation? > > Which player displays this behavior? > > Alex > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > > -- Amir H. Rouhi PhD Student/ CSIT RMIT University Room: 14-09-04 http://raws.adc.rmit.edu.au/~s3288736/blog2/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From amir.rouhi at rmit.edu.au Thu May 17 04:05:38 2012 From: amir.rouhi at rmit.edu.au (amir.rouhi at rmit.edu.au) Date: Thu, 17 May 2012 12:05:38 +1000 Subject: [Libav-user] Extracted I-Frames seems not correct, Why? In-Reply-To: References: Message-ID: I am confusing guys, i encountered a new problem in regard with adaptive and fixed rate I-Frames by ffmpeg under windows. it is as below: first i convert the original video (mpeg1) to the pure h.264 format by below command for adaptive I-Frame rate: ffmpeg -i C:\1.mpg -r 25 -an -vcodec libx264 -threads 0 -f h264 -r 25 -g 0 C:\1adapt.264 (-g 0 for adaptive I-frame rate) ffmpeg -i C:\1.mpg -r 25 -an -vcodec libx264 -threads 0 -f h264 -r 25 -g 25 C:\1fixed.264 (-g 25 for fixed I-frame rate every 25 frame one i-frame) I dont involve you about my first problem which was related to the twice tbr value in the h264 transformed videos and their shorter time length (with twice faster speed) my current problem is that when i want to use select filter to extract the i-frames from the above 264 videos, it is natural that i expect different results and for a 50sec video with -g 25 and 25fps, i expected 50 i-frames but the result was exactly same and just 5 frames for both videos. the select filter which i used can be seen at below: ffmpeg -i C:\1adapt.264 -vsync 0 -vf select="eq(pict_type\, PICT_TYPE_I)" C:\I-Frm1adapt-%03d.jpeg ffmpeg -i C:\1fixed.264 -vsync 0 -vf select="eq(pict_type\, PICT_TYPE_I)" C:\I-Frm1fixed-%03d.jpeg both produce 5 image for a originally 50 sec video with 25fps tbr 25 which after transformed reduced to 25 sec with 25fps but tbr 50. Its strange , isnt it? On 16 May 2012 18:48, Carl Eugen Hoyos wrote: > Alex Cohn writes: > > > If I understand correctly, Amir complains about the > > encoder, not the decoder. > > Then your answer was clearly more helpful than mine! > > Carl Eugen > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > -- Amir H. Rouhi PhD Student/ CSIT RMIT University Room: 14-09-04 http://raws.adc.rmit.edu.au/~s3288736/blog2/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From amir.rouhi at rmit.edu.au Thu May 17 05:32:53 2012 From: amir.rouhi at rmit.edu.au (amir.rouhi at rmit.edu.au) Date: Thu, 17 May 2012 13:32:53 +1000 Subject: [Libav-user] Extracted I-Frames seems not correct, Why? In-Reply-To: References: Message-ID: OMG, when i check the I-Frames by JM software, that software shows only 3 I-Frames. how this is possible? please help me to understand where is my problem? On 17 May 2012 12:05, wrote: > I am confusing guys, i encountered a new problem in regard with adaptive > and fixed rate I-Frames by ffmpeg under windows. it is as below: > first i convert the original video (mpeg1) to the pure h.264 format by > below command for adaptive I-Frame rate: > > ffmpeg -i C:\1.mpg -r 25 -an -vcodec libx264 -threads 0 -f h264 -r 25 -g > 0 C:\1adapt.264 (-g 0 for adaptive I-frame rate) > ffmpeg -i C:\1.mpg -r 25 -an -vcodec libx264 -threads 0 -f h264 -r 25 -g > 25 C:\1fixed.264 (-g 25 for fixed I-frame rate every 25 frame one i-frame) > > I dont involve you about my first problem which was related to the twice > tbr value in the h264 transformed videos and their shorter time length > (with twice faster speed) > > my current problem is that when i want to use select filter to extract the > i-frames from the above 264 videos, it is natural that i expect different > results and for a 50sec video with -g 25 and 25fps, i expected 50 i-frames > but the result was exactly same and just 5 frames for both videos. the > select filter which i used can be seen at below: > > ffmpeg -i C:\1adapt.264 -vsync 0 -vf select="eq(pict_type\, PICT_TYPE_I)" > C:\I-Frm1adapt-%03d.jpeg > ffmpeg -i C:\1fixed.264 -vsync 0 -vf select="eq(pict_type\, PICT_TYPE_I)" > C:\I-Frm1fixed-%03d.jpeg > > both produce 5 image for a originally 50 sec video with 25fps tbr 25 which > after transformed reduced to 25 sec with 25fps but tbr 50. Its strange , > isnt it? > > On 16 May 2012 18:48, Carl Eugen Hoyos wrote: > >> Alex Cohn writes: >> >> > If I understand correctly, Amir complains about the >> > encoder, not the decoder. >> >> Then your answer was clearly more helpful than mine! >> >> Carl Eugen >> >> _______________________________________________ >> Libav-user mailing list >> Libav-user at ffmpeg.org >> http://ffmpeg.org/mailman/listinfo/libav-user >> > > > > -- > Amir H. Rouhi > PhD Student/ CSIT RMIT University > Room: 14-09-04 > http://raws.adc.rmit.edu.au/~s3288736/blog2/ > -- Amir H. Rouhi PhD Student/ CSIT RMIT University Room: 14-09-04 http://raws.adc.rmit.edu.au/~s3288736/blog2/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From alexcohn at netvision.net.il Thu May 17 08:43:07 2012 From: alexcohn at netvision.net.il (Alex Cohn) Date: Thu, 17 May 2012 09:43:07 +0300 Subject: [Libav-user] Extracted I-Frames seems not correct, Why? In-Reply-To: References: Message-ID: On Thu, May 17, 2012 at 6:32 AM, wrote: > OMG, when i check the I-Frames by JM software, that software shows only 3 > I-Frames. how this is possible? please help me to understand where is my > problem? You can use ffmpeg debugging to learn more about your video stream. ffmpeg -i C:\1adapt.264 -dump -debug pict -vcodec copy -y NUL Enjoy, Alex Cohn > On 17 May 2012 12:05, wrote: >> >> I am confusing guys, i encountered a new problem in regard with adaptive >> and fixed rate I-Frames by ffmpeg under windows. it is as below: >> first i convert the original video (mpeg1) to the pure h.264 format by >> below command for adaptive I-Frame rate: >> >> ffmpeg -i C:\1.mpg -r 25 -an -vcodec libx264 -threads 0 ?-f h264 -r 25 -g >> 0 C:\1adapt.264 ?(-g 0 for adaptive I-frame rate) >> ffmpeg -i C:\1.mpg -r 25 -an -vcodec libx264 -threads 0 ?-f h264 -r 25 -g >> 25 C:\1fixed.264 ?(-g 25 for fixed I-frame rate every 25 frame one i-frame) >> >> I dont involve you about my first problem which was related to the twice >> tbr value in the h264 transformed videos and their shorter time length (with >> twice faster speed) >> >> my current problem is that when i want to use select filter to extract the >> i-frames from the above 264 videos, it is natural that i expect different >> results and for a 50sec video with -g 25 and 25fps, i expected 50 i-frames >> but the result was exactly same and just 5 frames for both videos. the >> select filter which i used can be seen at below: >> >> ffmpeg -i C:\1adapt.264 -vsync 0 -vf select="eq(pict_type\, PICT_TYPE_I)" >> C:\I-Frm1adapt-%03d.jpeg >> ffmpeg -i C:\1fixed.264 -vsync 0 -vf select="eq(pict_type\, PICT_TYPE_I)" >> C:\I-Frm1fixed-%03d.jpeg >> >> both produce 5 image for a originally 50 sec video with 25fps tbr 25 which >> after transformed reduced to 25 sec with 25fps but tbr 50. Its strange , >> isnt it? >> >> On 16 May 2012 18:48, Carl Eugen Hoyos wrote: >>> >>> Alex Cohn writes: >>> >>> > If I understand correctly, Amir complains about the >>> > encoder, not the decoder. >>> >>> Then your answer was clearly more helpful than mine! >>> >>> Carl Eugen >> -- >> Amir H. Rouhi >> PhD Student/ CSIT RMIT University >> Room: 14-09-04 >> http://raws.adc.rmit.edu.au/~s3288736/blog2/ From alexcohn at netvision.net.il Thu May 17 08:55:21 2012 From: alexcohn at netvision.net.il (Alex Cohn) Date: Thu, 17 May 2012 09:55:21 +0300 Subject: [Libav-user] Double frame rate after conversion In-Reply-To: References: Message-ID: On Thu, May 17, 2012 at 4:29 AM, wrote: > I usually use SMPlayer, but even ffplay shows the same?behavior?(the speed > is twice so the time length is half). > my version of VLC can not play .264 files, may be i need to install a patch > or upgrade it. One reason could be that your input mpg file has actually different frame rate, you override it with 25 on input. Also, try to use -force_fps parameter, -r may be considered a recommendation only. Sincerely, Alex Cohn > On 17 May 2012 04:38, Alex Cohn wrote: >> >> On May 16, 2012 1:45 PM, wrote: >> > >> > Knowing that what is tbr exactly, can not solve the problem. ?the frame >> > rate are same technically, when you compare the information by ffmpeg. The >> > fact is that the transformed video, after using vcodec libx264, is twice >> > faster as the original video. when i compare the information of bot video i >> > noticed tbr of the transformed video is twice as the original one. >> > can you help me to have a similar video after transformation? >> >> Which player displays this behavior? >> >> Alex > -- > Amir H. Rouhi > PhD Student/ CSIT RMIT University > Room: 14-09-04 > http://raws.adc.rmit.edu.au/~s3288736/blog2/ From calvinmann at gmail.com Wed May 16 23:57:40 2012 From: calvinmann at gmail.com (Calvin Mann) Date: Wed, 16 May 2012 23:57:40 +0200 Subject: [Libav-user] Custom IO using AVIOContext Message-ID: I have an app that is using AVIOContext to provide custom IO (through an intemediary buffer) to an event driven data stream. This works great as long as there is data available to read, however when the incoming data is runs low, *read_frame succeeds*, and then the following *decode fails *with *-1* (I have some print statements showing me that it reads until there is no data, and then fails.) Also, while I have set the flags for AVFMT_NON_BLOCK, I do not ever seem to get EAGAIN returned. Am I able to either, 1. Determine how much data is required before calling read_frame or decode. (I am able to wait before calling)? 2. Get these methods to return EAGAIN when the data runs out instead of giving other errors? 3. Something else to make this work? Any help would be much appreciated! Thanks Calvin -------------- next part -------------- An HTML attachment was scrubbed... URL: From dnegel666 at gmail.com Thu May 17 13:43:00 2012 From: dnegel666 at gmail.com (Dnegel X.) Date: Thu, 17 May 2012 13:43:00 +0200 Subject: [Libav-user] Retrieve 10bit video frames In-Reply-To: References: Message-ID: > > However, the decoded frameYUV->data is of type uint8_t, and I would > > expect > > to get something able to store 10bit values like a uint16_t. So, what is > > returned in this 8bit array in this case? How can I proceed to get the > > 10bit > > values? > > Just cast the buffer. > > uint16_t* planes[3] = {(uint16_t*)frameYUV->data[0], > (uint16_t*)frameYUV->data[1], (uint16_t*)frameYUV->data[2]}; > > --Michael Alright. I'm wondering if the part allocating space needs to be changed: numBytes = avpicture_get_size(out, width, height); buffer = (uint8_t *)av_malloc(numBytes*sizeof(uint8_t)); Is numBytes the number of uint8_t that can be cast to uint16_t, or should I allocate numBytes*sizeof(uint16_t)? --Nigel From stefasab at gmail.com Fri May 18 01:18:01 2012 From: stefasab at gmail.com (Stefano Sabatini) Date: Fri, 18 May 2012 01:18:01 +0200 Subject: [Libav-user] Challenge... create a black .TS file from NOTHING? In-Reply-To: References: Message-ID: <20120517231800.GF13061@arborea> On date Wednesday 2012-05-16 06:17:37 +0000, Carl Eugen Hoyos encoded: > Wagner Patriota writes: > > > Is there a way in ffmpeg for me to create a .TS video only with > > 1 stream of video H.264 with black frames? > > $ ffmpeg -f rawvideo -pix_fmt rgb24 -s 640x480 -i /dev/zero out.ts > (This produces mpeg2video, but I am sure you will be able to > fill in the output options.) Alternatively: ffmpeg -f lavfi -i color=black:WxH:RATE out.ts From wagner.patriota at gmail.com Fri May 18 01:24:38 2012 From: wagner.patriota at gmail.com (Wagner Patriota) Date: Thu, 17 May 2012 20:24:38 -0300 Subject: [Libav-user] Challenge... create a black .TS file from NOTHING? In-Reply-To: <20120517231800.GF13061@arborea> References: <20120517231800.GF13061@arborea> Message-ID: for me to force it be an H.264 .ts file... I need to use libx264 or there's another alternative? I am asking it because the version I am working on doesn't have libx264... the last ffmpeg is not compiling with the last libx264.... it says "ERROR: libx264 version must be >= 0.118" :-( On Thu, May 17, 2012 at 8:18 PM, Stefano Sabatini wrote: > On date Wednesday 2012-05-16 06:17:37 +0000, Carl Eugen Hoyos encoded: > > Wagner Patriota writes: > > > > > Is there a way in ffmpeg for me to create a .TS video only with > > > 1 stream of video H.264 with black frames? > > > > $ ffmpeg -f rawvideo -pix_fmt rgb24 -s 640x480 -i /dev/zero out.ts > > (This produces mpeg2video, but I am sure you will be able to > > fill in the output options.) > > Alternatively: > ffmpeg -f lavfi -i color=black:WxH:RATE out.ts > _______________________________________________ > 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 renegs.2378 at gmail.com Fri May 18 02:00:13 2012 From: renegs.2378 at gmail.com (Rene Gonzalez) Date: Thu, 17 May 2012 19:00:13 -0500 Subject: [Libav-user] Custom usage of AVFormatContext Message-ID: Hi folks, ffmpeg experts, I have an app/lib that handles video containers such as mp4. The data to be processed is buffered and send to the lib so basically I get the video format by means of: av_probe_input_format() then the format flags is set to AVFMT_NOFILE. so the warn is, since AVFMT_NOFILE is set "AVFMT_NOFILE formats will not have an AVIOContext" doesn't make sense to allocate context for AVIOContext so the ic->pb is leaved with zero. So I thought the next logical steep is to create the AVformatContext by means of: avformat_open_input() But it eventual leadme to a segmentation fault cus AVformatContext methods handles the AVIOContext (ic->pb). My question is: what is the approach to customized the AVFormatContext? or What is the approach to handle video data (format) from a buffer? Thanks in advance for any help, It will be much appreciated, Reno. -------------- next part -------------- An HTML attachment was scrubbed... URL: From kalileo at universalx.net Fri May 18 04:28:14 2012 From: kalileo at universalx.net (Kalileo) Date: Fri, 18 May 2012 09:28:14 +0700 Subject: [Libav-user] Compiling for Mac with libx264 In-Reply-To: References: Message-ID: <6B384842-C8A7-4190-BA88-6DAEB8506D72@universalx.net> On May 16, 2012, at 11:44 , Wagner Patriota wrote: > I can't compile the last version of FFMPEG with libx264... it says: > "ERROR: libx264 version must be >= 0.118." > > I have the latest version from the libx264 website... > You don't. There are still fles from an old libx264 installation in your ../libs/.. folder(s). Check all /usr/libs/.. and /opt/libs/.. folders and manually delete all x264 stuff (or use macports or whatever you used to install libx264 before) After that reinstall the latest libx264. Note that this includes the ffmpeg libs where libx264 was compiled in. I had to deinstall them too. So the best is most probably to completely deinstall (check the ../libs/ folders!) libx264 and ffmpeg and then reinstall both whenever you want to upgrade libx264. From rnp at 25ghz.net Fri May 18 10:40:27 2012 From: rnp at 25ghz.net (Rafael do Nascimento Pereira) Date: Fri, 18 May 2012 10:40:27 +0200 Subject: [Libav-user] libav* + gui toolkits In-Reply-To: <201205142103.42342.info@denisgottardello.it> References: <201205142103.42342.info@denisgottardello.it> Message-ID: Hello Denis, good to know. But i would like to know also, if you have used the phonon module (the multimedia framework) or if you haved used directly the output from AVFrame/AVPicture. Best regards, Rafael. *"If you can't explain it simply, you don't understand it well enough." --Albert Einstein* 2012/5/14 Denis > In data luned? 14 maggio 2012 14:13:04, Rafael do Nascimento Pereira ha > scritto: > > ello folks, > > > > I trying to write a gui applications that uses FFmpeg as backend. I have > > already read and played with the (upgraded) Dranger's FFmpeg tutorial(1), > > which in fact works. It is used in this tutorial the libSDL. As far as i > > know i does not integrate well with the modern GUI Toolkits (GTK+3 ans > > Qt4). > > > > I have read about the combinations like FFmpeg + Qt4 (and maybe > Gstreamer) > > and FFmpeg + GTK+3 + clutter/Gstreamer. Does anybody know other possible > > combination ? Which one has more advantages ? Any help will be > > appriciated. > > > In my case I have wrote a program in Qt4 that extracts the frames directly > from the movies. I think if you want you can use this way. > > > -- > 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 nitinkumgoyal at gmail.com Fri May 18 16:32:04 2012 From: nitinkumgoyal at gmail.com (NITIN GOYAL) Date: Fri, 18 May 2012 20:02:04 +0530 Subject: [Libav-user] G726 decodng: Initcodec return -22 error Message-ID: Hi I am trying to decode G726 audio codec but when i give string "g726" to initcodec funciton, but ffmpeg is not able to detect the codec and return -22 error. Can someone help me what -22 error says? If i will use CODEC_ID_ADPCM_G726 will it work? I have the G726-16 codec over a stream. Regards Nitin -------------- next part -------------- An HTML attachment was scrubbed... URL: From simondaniels23 at gmail.com Fri May 18 18:22:52 2012 From: simondaniels23 at gmail.com (Simon Daniels) Date: Fri, 18 May 2012 12:22:52 -0400 Subject: [Libav-user] Empty .MTS output videos when using -ss command line argument In-Reply-To: References: Message-ID: Weird -- any idea why there's only 1 key frame? I guess that's what the camera decided to do... On Wed, May 9, 2012 at 8:22 AM, Alex Cohn wrote: > On Mon, Apr 16, 2012 at 7:05 PM, Simon Daniels > wrote: > > Hi guys, > > > > I have a set of .MTS files that I'm trying to splice. If I start at > 0:00:00, > > the output video works fine. But if I start splicing any time after > 0:00:00, > > the output video is empty. I've used the exact same command line with > other > > .MTS files and had no problem. It seems like something specific to this > > Panasonic Lumix camera. MP4 and MOV files work fine too. > > > > This repros in FFmpeg HEAD-8dfb13e, 0.10.2, and 0.8.3. > > > > Any ideas? Thanks! > > > > Users-MacBook-Pro:ffmpeg-0.10.2 user$ ./ffmpeg -ss 00:00:01 -t 00:00:25 > -i > > 00004.MTS -threads 3 -acodec copy -vcodec copy "output.MTS" > > Your input video stream has only one keyframe, which is the first > frame. For h264, -vcodec copy can only start writing video from a > keyframe. That's why it produces 0 frames in the end. > > BR, > Alex Cohn > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mbradshaw at sorensonmedia.com Fri May 18 18:59:22 2012 From: mbradshaw at sorensonmedia.com (Michael Bradshaw) Date: Fri, 18 May 2012 10:59:22 -0600 Subject: [Libav-user] Retrieve 10bit video frames In-Reply-To: References: Message-ID: On Thu, May 17, 2012 at 5:43 AM, Dnegel X. wrote: >> > However, the decoded frameYUV->data is of type uint8_t, and I would >> > expect >> > to get something able to store 10bit values like a uint16_t. So, what is >> > returned in this 8bit array in this case? How can I proceed to get the >> > 10bit >> > values? >> >> Just cast the buffer. >> >> uint16_t* planes[3] = {(uint16_t*)frameYUV->data[0], >> (uint16_t*)frameYUV->data[1], (uint16_t*)frameYUV->data[2]}; >> >> --Michael > > Alright. I'm wondering if the part allocating space needs to be changed: > numBytes = avpicture_get_size(out, width, height); > buffer = (uint8_t *)av_malloc(numBytes*sizeof(uint8_t)); > > Is numBytes the number of uint8_t that can be cast to uint16_t, or > should I allocate numBytes*sizeof(uint16_t)? No, the allocation code does not need to change. If you look up the docs for avpicture_get_size, you'll see that it calculates the necessary size *in bytes*. From mbradshaw at sorensonmedia.com Fri May 18 19:04:17 2012 From: mbradshaw at sorensonmedia.com (Michael Bradshaw) Date: Fri, 18 May 2012 11:04:17 -0600 Subject: [Libav-user] Compiling for Mac with libx264 In-Reply-To: <6B384842-C8A7-4190-BA88-6DAEB8506D72@universalx.net> References: <6B384842-C8A7-4190-BA88-6DAEB8506D72@universalx.net> Message-ID: On May 16, 2012, at 11:44 , Wagner Patriota wrote: > I can't compile the last version of FFMPEG with libx264... it says: > "ERROR: libx264 version must be >= 0.118." > > I have the latest version from the libx264 website... Make sure you've built and installed libx264 correctly. I don't think the default ./configure command for libx264 builds and installs the development libs, so you have to: ./configure --enable-shared to get the dev libs as well as x264 before building and installing. From wagner.patriota at gmail.com Fri May 18 21:45:16 2012 From: wagner.patriota at gmail.com (Wagner Patriota) Date: Fri, 18 May 2012 16:45:16 -0300 Subject: [Libav-user] Compiling for Mac with libx264 In-Reply-To: References: <6B384842-C8A7-4190-BA88-6DAEB8506D72@universalx.net> Message-ID: hummm... this was my problem... thanks Kalileo and Michael On Fri, May 18, 2012 at 2:04 PM, Michael Bradshaw < mbradshaw at sorensonmedia.com> wrote: > On May 16, 2012, at 11:44 , Wagner Patriota wrote: > > I can't compile the last version of FFMPEG with libx264... it says: > > "ERROR: libx264 version must be >= 0.118." > > > > I have the latest version from the libx264 website... > > Make sure you've built and installed libx264 correctly. I don't think > the default ./configure command for libx264 builds and installs the > development libs, so you have to: > > ./configure --enable-shared > > to get the dev libs as well as x264 before building and installing. > _______________________________________________ > 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 wagner.patriota at gmail.com Fri May 18 23:33:25 2012 From: wagner.patriota at gmail.com (Wagner Patriota) Date: Fri, 18 May 2012 18:33:25 -0300 Subject: [Libav-user] How do I change the .TS files "Timestamps and Continuity Counters"? Message-ID: I am working in a implementation of HLS protocol. http://tools.ietf.org/html/draft-pantos-http-live-streaming-08 I see all my .TS files have the "audio timestamp" equal to 126000. According to the HLS specification, section 4 Media segments, it says: A media segment MUST be the continuation of the encoded media at the end of the segment with the previous sequence number, where values in a continuous series, such as *timestamps* and *Continuity Counters*, continue uninterrupted - unless the media segment was the first ever to appear in the Playlist file or has an EXT-X-DISCONTINUITY tag applied to it. And then I see my videos are getting out of sync because of it. *How do I change the .TS files "timestamps and Continuity Counters"?* * * Thank you... *[ DEEP DETAILS: ]* I am transmuxing the HLS files one by one, so I would like to have a parameter [that I think it doesn't exist here] MPEGTS muxer AVOptions: -mpegts_transport_stream_id E.... Set transport_stream_id field. -mpegts_original_network_id E.... Set original_network_id field. -mpegts_service_id E.... Set service_id field. -mpegts_pmt_start_pid E.... Set the first pid of the PMT. -mpegts_start_pid E.... Set the first pid. -mpegts_m2ts_mode E.... Enable m2ts mode. -muxrate E.... -pes_payload_size E.... Minimum PES packet payload in bytes -resend_headers E.... Reemit PAT/PMT before writing the next packet SO, with this "parameter" I would have a chance to change this data... however, I tried to figure out in the mpegtsenc.c WHERE is this "timestamp" or continuity counter... I thought it would be somthing around here: typedef struct MpegTSWriteStream { struct MpegTSService *service; int pid; /* stream associated pid */ * int cc;* int payload_size; * int first_pts_check; ///< first pts check needed* int prev_payload_key; int64_t payload_pts; int64_t payload_dts; int payload_flags; uint8_t *payload; ADTSContext *adts; } MpegTSWriteStream; BUT I think I misinterpreted it... because in the mpegts_write_header(), we have: ts->pat.pid = PAT_PID; ts->pat.cc = 15; // Initialize at 15 so that it wraps and be equal to 0 for the first packet we write as fixed values.... so I don't understand HOW THE mpegtsenc MUXER GOT 126000 as the timestamp... where is this value in mpegtsenc.c so I could tune it? -------------- next part -------------- An HTML attachment was scrubbed... URL: From plug.gulp at gmail.com Sun May 20 08:44:16 2012 From: plug.gulp at gmail.com (Plug Gulp) Date: Sun, 20 May 2012 07:44:16 +0100 Subject: [Libav-user] [Newbie] Scaling movies... Message-ID: Hi, I want to convert and scale few movies in various formats (.ogv, .mov, .mp4 etc) to .mp4. From command line I am able to achieve this as follows: ffmpeg -i -acodec copy -scodec copy -vf scale=320:-1 How do I achieve this using C? I referred the ffmpeg code to understand how this works, but my head started spinning. Is there a simple tutorial/example source code that I can refer to to understand how a video can be scaled while retaining other streams? Thanks and regards, ~Plug From genesys at gmx.ch Sun May 20 15:53:13 2012 From: genesys at gmx.ch (=?iso-8859-1?Q?=22Matthias_B=FChlmann=22?=) Date: Sun, 20 May 2012 15:53:13 +0200 Subject: [Libav-user] encode video with PNG or similar? Message-ID: <20120520135313.280100@gmx.net> we have sequences of images that we want to encode. we tried to do this before using FFMPEG and H.264 There are some temporal coherences between the frames, but not really those of natural video and H.264 does not seem to be suited for our data (I-frame encoding gives better results than P-frame encoding at same bitrate). We would like to try some codec that will not generate any block-artifacts. It should preserve any hard edges in the (RGB) source image at exact pixels - but the color-depth can be very reduced. PNG seems to be able to do something like this. As FFMPEG is already integrated in our system, it would be cool if we could use it right away with PNG encoding somehow (how?) or with another video codec that has similar properties. Any suggestions? It should be a codec that compresses well if most pixels have more or less the same color (medium gray) and only a few of them diverge -- NEU: FreePhone 3-fach-Flat mit kostenlosem Smartphone! Jetzt informieren: http://mobile.1und1.de/?ac=OM.PW.PW003K20328T7073a From uriel.fra at gmail.com Mon May 21 08:50:43 2012 From: uriel.fra at gmail.com (Uriel Frankel) Date: Mon, 21 May 2012 09:50:43 +0300 Subject: [Libav-user] Stream UDP from android device's camera to VLC player Message-ID: Hello all :) I want to be able to send a UDP stream from my android device camera to a computer running VLC that is on the same network. 1. Can it be done? 2. Can someone guide me how to do it? every help will be great Uriel Frankel -------------- next part -------------- An HTML attachment was scrubbed... URL: From l8_07 at yahoo.com Mon May 21 09:36:12 2012 From: l8_07 at yahoo.com (abigail patron) Date: Mon, 21 May 2012 00:36:12 -0700 (PDT) Subject: [Libav-user] Using Ffmpeg on Android to Play .asf File Message-ID: <1337585772.63318.YahooMailClassic@web161004.mail.bf1.yahoo.com> Hi, Asf file format is not yet supported on Android. This is why I have to use Ffmpeg in order to convert it to a PCM data to play in Android's AudioTrack. The asf file will be transferred via http streaming. I have already successfully build ffmpeg on android but I am a beginner in ffmpeg development. Can anyone tell me how to have a good start? Any good reference? Thanks! -------------- next part -------------- An HTML attachment was scrubbed... URL: From lulebo at gmail.com Mon May 21 10:30:07 2012 From: lulebo at gmail.com (Carl Lindqvist) Date: Mon, 21 May 2012 10:30:07 +0200 Subject: [Libav-user] Mux output to buffer instead of file Message-ID: Hello! This is my first post on this list. I am sorry if this has come up before, but I have been searching the archives and can't find a good answer to this. I have an application that encodes an incoming video stream and muxes it as a transport stream. This is working great when writing to a file like in the example muxing.c. Now what I would like to do is to capture the muxed output in a RAM buffer (queue of some sort) instead of writing directly to file. Is this possible? The reason is that I will be encoding the signal continuously, but the finished muxed TS will be passed on to different places and files as the application is running. Sometimes it will be written to multiple destinations at once and stuff like that. Any help is much appreciated! Thank you Regards Carl Lindqvist -------------- next part -------------- An HTML attachment was scrubbed... URL: From ggarra13 at gmail.com Mon May 21 20:56:39 2012 From: ggarra13 at gmail.com (Gonzalo Garramuno) Date: Mon, 21 May 2012 15:56:39 -0300 Subject: [Libav-user] mrViewer: Flipbook and video player Message-ID: <4FBA8FE7.3030500@gmail.com> I've created and released a video and flipbook player that relies on ffmpeg. This was my first attempt at video work, so it is rather crude imho. The program can be downloaded from sourceforge.net at: http://sourceforge.net/projects/mrviewer/files/ Source code is in git at: git clone git://git.code.sf.net/p/mrviewer/code mrviewer-code Some movie files showing what it can do at: http://www.youtube.com/watch?v=d92DTYv1TmM http://www.youtube.com/watch?v=zC7U6gdoDm4 http://www.youtube.com/watch?v=d7C8sAmnNJc http://www.youtube.com/watch?v=1oHnEpYrgXw From sp27 at cornell.edu Mon May 21 22:40:07 2012 From: sp27 at cornell.edu (Slava Paperno) Date: Mon, 21 May 2012 16:40:07 -0400 Subject: [Libav-user] mp3 to ogg converter with API that can be called from ColdFusion Message-ID: <4FBAA827.1030503@cornell.edu> I am looking for a mp3 to ogg converter that can be used by issuing API calls from a ColdFusion script (to convert a file that's stored on the server). I know about the command-line ffmpeg converter, and I know it can be invoked with a cfexecute call, but I would like to avoid that. An API call would be much preferable. Doesn't have to be free. Any tips will be appreciated, Slava From lulebo at gmail.com Tue May 22 10:09:36 2012 From: lulebo at gmail.com (Carl Lindqvist) Date: Tue, 22 May 2012 10:09:36 +0200 Subject: [Libav-user] Mux output to buffer instead of file In-Reply-To: References: Message-ID: 2012/5/21 Carl Lindqvist > Hello! > > This is my first post on this list. I am sorry if this has come up before, > but I have been searching the archives and can't find a good answer to this. > > I have an application that encodes an incoming video stream and muxes it > as a transport stream. This is working great when writing to a file like in > the example muxing.c. > > Now what I would like to do is to capture the muxed output in a RAM buffer > (queue of some sort) instead of writing directly to file. Is this possible? > > The reason is that I will be encoding the signal continuously, but the > finished muxed TS will be passed on to different places and files as the > application is running. Sometimes it will be written to multiple > destinations at once and stuff like that. > > Any help is much appreciated! > > Thank you > > Regards > Carl Lindqvist > After some more reading on the subject, I understand that I must implement my own URLProtocol using something like file.c as a base. I am writing my application in C++ and would like to implement the buffer/queue system in a C++ class. How would I tell my protocol about this class? Also, if I do this, I have to recompile the libav libraries with this new protocol. WIll this affect the licences of how I may use this in a commercial application? I have also seen something about using "avio_open_dyn_buf" and "avio_close_dyn_buf" instead, but I haven't gotten my head around that yet. Regards Carl Lindqvist -------------- next part -------------- An HTML attachment was scrubbed... URL: From henell at gmail.com Tue May 22 10:35:11 2012 From: henell at gmail.com (Daniel Henell) Date: Tue, 22 May 2012 17:35:11 +0900 Subject: [Libav-user] Mux output to buffer instead of file In-Reply-To: References: Message-ID: Hello, I did this in an previous project. The code is available here https://github.com/EvilTengil/kinect-streamer/blob/master/src/kstreamer/ffv1_depth_encoder.cpp Best, Daniel Henell On Tue, May 22, 2012 at 5:09 PM, Carl Lindqvist wrote: > 2012/5/21 Carl Lindqvist >> >> Hello! >> >> This is my first post on this list. I am sorry if this has come up before, >> but I have been searching the archives and can't find a good answer to this. >> >> I have an application that encodes an incoming video stream and muxes it >> as a transport stream. This is working great when writing to a file like in >> the example muxing.c. >> >> Now what I would like to do is to capture the muxed output in a RAM buffer >> (queue of some sort) instead of writing directly to file. Is this possible? >> >> The reason is that I will be encoding the signal continuously, but the >> finished muxed TS will be passed on to different places and files as the >> application is running. Sometimes it will be written to multiple >> destinations at once and stuff like that. >> >> Any help is much appreciated! >> >> Thank you >> >> Regards >> Carl Lindqvist > > > > After some more reading on the subject, I understand that I must implement > my own URLProtocol using something like file.c as a base. > > I am writing my application in C++ and would like to implement the > buffer/queue system in a C++ class. How would I tell my protocol about this > class? > > Also, if I do this, I have to recompile the libav libraries with this new > protocol. WIll this affect the licences of how I may use this in a > commercial application? > > I have also seen something about using "avio_open_dyn_buf" and > "avio_close_dyn_buf" instead, but I haven't gotten my head around that yet. > > Regards > Carl Lindqvist > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > From avsn9849625263 at gmail.com Tue May 22 10:44:31 2012 From: avsn9849625263 at gmail.com (Murthy Avanithsa) Date: Tue, 22 May 2012 04:44:31 -0400 Subject: [Libav-user] total frames in a video Message-ID: Hi every one,This is my first post, I have been using FFmpeg for a while .now I want to start use of libav api. Can any one please suggest a beginner guide to libav api. My first code would be to find total frames in a video. Thanks in advance. Murthy. -------------- next part -------------- An HTML attachment was scrubbed... URL: From amir.rouhi at rmit.edu.au Tue May 22 10:47:57 2012 From: amir.rouhi at rmit.edu.au (amir.rouhi at rmit.edu.au) Date: Tue, 22 May 2012 18:47:57 +1000 Subject: [Libav-user] ffmpeg and JM I_Frame nonconformity Message-ID: I have noticed that the I-Frames in a pure h264 video created by ffmpeg is not same as what JM detect as I-Frame in the same video. In JM software s_type=2 means I_Frame. the number of s_types frames are always lower than what ffmpeg shows. What is your advice? Amir -------------- next part -------------- An HTML attachment was scrubbed... URL: From alexcohn at netvision.net.il Tue May 22 12:02:55 2012 From: alexcohn at netvision.net.il (Alex Cohn) Date: Tue, 22 May 2012 13:02:55 +0300 Subject: [Libav-user] ffmpeg and JM I_Frame nonconformity In-Reply-To: References: Message-ID: On Tue, May 22, 2012 at 11:47 AM, wrote: > > I have noticed that the I-Frames in a pure h264 video created by ffmpeg is > not same as what JM detect as I-Frame in the same video. > In JM software s_type=2 means I_Frame. the number of s_types frames are > always lower than what ffmpeg shows. > ?What is your advice? > Amir Would you like to upload an example? Alex From arash.cordi at gmail.com Tue May 22 14:42:53 2012 From: arash.cordi at gmail.com (Arash Cordi) Date: Tue, 22 May 2012 17:12:53 +0430 Subject: [Libav-user] using stdout for output stream Message-ID: hi all, i want to send output stream data to stdout but url_fopen() only accepts file path when i try this: if (url_fopen(&oc->pb, "/dev/stdout/", URL_WRONLY) < 0) { fprintf(stderr, "Could not open '%s'\n", outfile); exit(1); } i get an error is there another way to get a ByteIOContext pointing to stdout? thanks in advance -------------- next part -------------- An HTML attachment was scrubbed... URL: From sp27 at cornell.edu Tue May 22 15:40:37 2012 From: sp27 at cornell.edu (Slava Paperno) Date: Tue, 22 May 2012 09:40:37 -0400 Subject: [Libav-user] use of ffmpeg on Web server to encode user submissions In-Reply-To: <11366_1337632810_q4LKe6Se026708_4FBAA827.1030503@cornell.edu> References: <11366_1337632810_q4LKe6Se026708_4FBAA827.1030503@cornell.edu> Message-ID: <4FBB9755.5010703@cornell.edu> I know that ffmpeg is used on Web servers to encode files submitted by users. I wonder if it is invoked by launching a process with a command-line call or by using an API. I've heard an opinion that API is better/safer/more efficient than command-line calls. Any data on that? Is there an API-enabled Java encoder for ogg to mp3 conversion? I'll be calling it on the Web server from ColdFusion scripts. Any advice will be appreciated. Slava From lulebo at gmail.com Wed May 23 09:30:50 2012 From: lulebo at gmail.com (Carl Lindqvist) Date: Wed, 23 May 2012 09:30:50 +0200 Subject: [Libav-user] Mux output to buffer instead of file In-Reply-To: References: Message-ID: 2012/5/22 Daniel Henell > Hello, > > I did this in an previous project. The code is available here > > > https://github.com/EvilTengil/kinect-streamer/blob/master/src/kstreamer/ffv1_depth_encoder.cpp > > Best, > > Daniel Henell > Thank you! Got it working. Regards Carl -------------- next part -------------- An HTML attachment was scrubbed... URL: From rnp at 25ghz.net Wed May 23 09:58:05 2012 From: rnp at 25ghz.net (Rafael do Nascimento Pereira) Date: Wed, 23 May 2012 09:58:05 +0200 Subject: [Libav-user] total frames in a video In-Reply-To: References: Message-ID: Hi Murthy, Documentation is unbfortunately a problem. There is but, most of it (as far as i know) is out of date. The one i can recommend you is the Dranger tutorial's updated version: https://drangertuts.wordpress.com/ You can also generate a FFmpeg doxygen documentation based on the current sources*. *:)* *Regards, Rafael.* ** "If you can't explain it simply, you don't understand it well enough." --Albert Einstein* 2012/5/22 Murthy Avanithsa > Hi every one,This is my first post, > I have been using FFmpeg for a while .now I want to start use of libav api. > Can any one please suggest a beginner guide to libav api. > My first code would be to find total frames in a video. > > Thanks in advance. > > > Murthy. > > _______________________________________________ > 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 avsn9849625263 at gmail.com Wed May 23 12:19:37 2012 From: avsn9849625263 at gmail.com (Murthy Avanithsa) Date: Wed, 23 May 2012 15:49:37 +0530 Subject: [Libav-user] total frames in a video In-Reply-To: References: Message-ID: Thank you Mr.Rafael. I have downloaded those sample C source files.I think they should be helpful to me. I love you people On Wed, May 23, 2012 at 1:28 PM, Rafael do Nascimento Pereira wrote: > Hi Murthy, > > Documentation is unbfortunately a problem. There is but, most of it (as > far as i know) is out of date. > The one i can recommend you is the Dranger tutorial's updated version: > > https://drangertuts.wordpress.com/ > > You can also generate a FFmpeg doxygen documentation based on the current > sources*. *:)* > > *Regards, > Rafael.* > ** > > "If you can't explain it simply, you don't understand it well enough." > --Albert Einstein* > > > > 2012/5/22 Murthy Avanithsa > >> Hi every one,This is my first post, >> I have been using FFmpeg for a while .now I want to start use of libav >> api. >> Can any one please suggest a beginner guide to libav api. >> My first code would be to find total frames in a video. >> >> Thanks in advance. >> >> >> Murthy. >> >> _______________________________________________ >> 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 > > -- SUREN (murthy) -------------- next part -------------- An HTML attachment was scrubbed... URL: From wesley at ubuntu.com Wed May 23 13:28:51 2012 From: wesley at ubuntu.com (Wesley S.) Date: Wed, 23 May 2012 13:28:51 +0200 Subject: [Libav-user] Video Quality Analyzer - implement which features? Message-ID: Hi, I am a software developer currently working on a (cross-platform) Video Quality Analyzer application for a project at university. It will most likely be released as open source software when it is finished. I am posting to this list to ask the video encoding/quality experts what is essential in comparing video quality according to them. A few important design choices I have made: - libav is used to open video files in order to support many video formats out of the box (and to support extraction of information from decoder, for example motion vectors) - image processing plug-ins and tools are extensible through scripting and dynamically linked plug-ins So, most important question: What plug-ins would be essential in this kind of application for you? Also, if you would be interested in more information or if you would like to try writing your own script or plug-in for this application, you can contact me by e-mail. Kind regards, Wesley S. PS: here's a little preview screenshot of the current user interface: http://i50.tinypic.com/acptnq.png -------------- next part -------------- An HTML attachment was scrubbed... URL: From nitinkumgoyal at gmail.com Wed May 23 13:56:33 2012 From: nitinkumgoyal at gmail.com (NITIN GOYAL) Date: Wed, 23 May 2012 17:26:33 +0530 Subject: [Libav-user] Video Quality Analyzer - implement which features? In-Reply-To: References: Message-ID: I am also working on the Video quality analyzer tool. But mine is a No reference one where i don't need to compare my video quality to the source content. But for measuring the quality, it depends on the parameters you want to take into consideration and if you can provide a MOS values in last based on the comparison made. There can be many parameters like display jitter, freezes, frame rates, GOP sizes, frame types, display time, PTS nd DTS analysis, for audio u can include sampling stuff, noise detection Also, for the different parameters, you can use ffmpeg in order to decode the content, OpenCV for motion vector and scene activity calculations Left all plugins will depend upoin the parameters you can include. Thanks Nitin On Wed, May 23, 2012 at 4:58 PM, Wesley S. wrote: > Hi, > > I am a software developer currently working on a (cross-platform) Video > Quality Analyzer application > for a project at university. It will most likely be released as open > source software when it is finished. > > I am posting to this list to ask the video encoding/quality experts what > is essential > in comparing video quality according to them. > > A few important design choices I have made: > - libav is used to open video files in order to support many video formats > out of the box > (and to support extraction of information from decoder, for example motion > vectors) > - image processing plug-ins and tools are extensible through scripting and > dynamically linked plug-ins > > So, most important question: > What plug-ins would be essential in this kind of application for you? > > Also, if you would be interested in more information or if you would like > to try writing > your own script or plug-in for this application, you can contact me by > e-mail. > > Kind regards, > Wesley S. > > PS: here's a little preview screenshot of the current user interface: > http://i50.tinypic.com/acptnq.png > > _______________________________________________ > 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 krueger at lesspain.de Wed May 23 14:31:51 2012 From: krueger at lesspain.de (=?UTF-8?Q?Robert_Kr=C3=BCger?=) Date: Wed, 23 May 2012 14:31:51 +0200 Subject: [Libav-user] use of ffmpeg on Web server to encode user submissions In-Reply-To: <4FBB9755.5010703@cornell.edu> References: <11366_1337632810_q4LKe6Se026708_4FBAA827.1030503@cornell.edu> <4FBB9755.5010703@cornell.edu> Message-ID: On Tue, May 22, 2012 at 3:40 PM, Slava Paperno wrote: > I know that ffmpeg is used on Web servers to encode files submitted by > users. > > I wonder if it is invoked by launching a process with a command-line call or > by using an API. > whatever you want or find more suitable for your needs. launching a process with a command line: much safer, because you cannot shoot yourself in the leg with memory management stuff etc, clumsy from a software integration perspective (but get's the job done also for people running pretty complex, high-volume applications) launching via API: much steeper learning curve, more flexible (but you might not need that extra flexibility) but more dangerous (see above) > I've heard an opinion that API is better/safer/more efficient than > command-line calls. Any data on that? depends of what kind of encoding you do but for any but the smallest transcoding processes, I would guess that the command line startup overhead is negligible compared to decoding, encoding. > > Is there an API-enabled Java encoder for ogg to mp3 conversion? I'll be > calling it on the Web server from ColdFusion scripts. Do you know Xuggler? If you don't check it out. However, there maybe other audio-only converters if ogg to mp3 is all you want to do. > > Any advice will be appreciated. > My 2c: Look at your requirements and check if they can be satisfied with simple command line invocation. If not and you are working in a Java-based environment Xuggler is the way to check next because a native integration using JNI or another mapping technique is doing it the hard way and you don't want to do that without a good reason. YMMV HTH Robert From christian.bruemmer at gmx.de Wed May 23 14:49:23 2012 From: christian.bruemmer at gmx.de (=?ISO-8859-15?Q?Christian_Br=FCmmer?=) Date: Wed, 23 May 2012 14:49:23 +0200 Subject: [Libav-user] x264 encoding crashes on av_interleaved_write_frame Message-ID: <4FBCDCD3.7090509@gmx.de> Hi, im new to libav and video compression at all. Im working on Windows 7 in Visual Studio 2010 and i try to simply encode a dummy image to x264 using an actual Zeranoe-Build (x86). First i tried to use the output-example which doesnt work with x264 out of the box. I put many code snippets together and often i really dont know what the code does - so my error might be anywhere. So its saidly a lot of code but the main problem existing in *write_video_frame* where the program crashes on *av_interleaved_write_frame* (so you may have a look on that)! Encoding works so far (as far as i can say -> no errors shown)- takes me a lot of time and i got help from zeranoe forum (thread: http://ffmpeg.zeranoe.com/forum/viewtopic.php?f=15&t=534&p=1581#p1581). I really need ffmpeg / libav for x264 encoding in my project @ university and i dont know what's wrong and to do :/! #include #include #include #include extern "C" { #include #include #include #include #include #include "libavutil/imgutils.h" } #define WIDTH 800 #define HEIGHT 480 #define STREAM_NB_FRAMES ((int)(STREAM_DURATION * FRAME_RATE)) #define FRAME_RATE 25 #define PIXEL_FORMAT PIX_FMT_YUV420P #define STREAM_DURATION 1 //seconds #define BIT_RATE 400000 static int sws_flags = SWS_BICUBIC; AVFrame *picture, *tmp_picture; uint8_t *video_outbuf; int frame_count, video_outbuf_size; static void closeVideo(AVFormatContext *oc, AVStream *st) { avcodec_close(st->codec); av_free(picture->data[0]); av_free(picture); if (tmp_picture) { av_free(tmp_picture->data[0]); av_free(tmp_picture); } av_free(video_outbuf); } static AVFrame *alloc_picture(enum PixelFormat pix_fmt, int width, int height) { AVFrame *picture; uint8_t *picture_buf; int size; picture = avcodec_alloc_frame(); if(!picture) return NULL; size = avpicture_get_size(pix_fmt, width, height); picture_buf = (uint8_t*)(av_malloc(size)); if (!picture_buf) { av_free(picture); return NULL; } avpicture_fill((AVPicture *) picture, picture_buf, pix_fmt, WIDTH, HEIGHT); return picture; } static void openVideo(AVFormatContext *oc, AVStream *st) { AVCodec *codec; AVCodecContext *c; c = st->codec; //if(c->idct_algo == CodecID::CODEC_ID_H264) // av_opt_set(c->priv_data, "preset", "slow", 0); codec = avcodec_find_encoder(c->codec_id); if(!codec) { std::cout << "Codec not found." << std::endl; std::cin.get();std::cin.get();exit(1); } if(avcodec_get_context_defaults3 (c, codec) < 0) { std::cout << "Cannot get default codec context! \n" << std::endl; std::cin.get(); exit(1); } c->bit_rate = BIT_RATE; c->width = WIDTH; c->height = HEIGHT; c->time_base.den = FRAME_RATE; c->time_base.num = 1; c->gop_size = FRAME_RATE; c->pix_fmt = PIX_FMT_YUV420P; if(oc->oformat->flags & AVFMT_GLOBALHEADER) c->flags |= CODEC_FLAG_GLOBAL_HEADER; if(avcodec_open2(c, codec, NULL) < 0) { std::cout << "Could not open codec." << std::endl; std::cin.get();std::cin.get();exit(1); } video_outbuf = NULL; if(!(oc->oformat->flags & AVFMT_RAWPICTURE)) { video_outbuf_size = 200000; video_outbuf = (uint8_t*)(av_malloc(video_outbuf_size)); } picture = alloc_picture(c->pix_fmt, c->width, c->height); if(!picture) { std::cout << "Could not allocate picture" << std::endl; std::cin.get();exit(1); } tmp_picture = NULL; if(c->pix_fmt != PIX_FMT_YUV420P) { tmp_picture = alloc_picture(PIX_FMT_YUV420P, WIDTH, HEIGHT); if(!tmp_picture) { std::cout << " Could not allocate temporary picture" << std::endl; std::cin.get();exit(1); } } } static AVStream* addVideoStream(AVFormatContext *context, enum CodecID codecID) { AVCodecContext *codec; AVStream *stream; stream = av_new_stream(context, 0); if(!stream) { std::cout << "Could not alloc stream." << std::endl; std::cin.get();exit(1); } codec = stream->codec; codec->codec_id = codecID; codec->codec_type = AVMEDIA_TYPE_VIDEO; // sample rate codec->bit_rate = BIT_RATE; // resolution must be a multiple of two codec->width = WIDTH; codec->height = HEIGHT; codec->time_base.den = FRAME_RATE; // stream fps codec->time_base.num = 1; codec->gop_size = FRAME_RATE; // intra frame every twelve frames at most codec->pix_fmt = PIXEL_FORMAT; if(codec->codec_id == CODEC_ID_MPEG2VIDEO) codec->max_b_frames = 2; // for testing, B frames if(codec->codec_id == CODEC_ID_MPEG1VIDEO) codec->mb_decision = 2; if(context->oformat->flags & AVFMT_GLOBALHEADER) codec->flags |= CODEC_FLAG_GLOBAL_HEADER; return stream; } static void fill_yuv_image(AVFrame *pict, int frame_index, int width, int height) { int x, y, i; i = frame_index; /* Y */ for(y=0;ydata[0][y * pict->linesize[0] + x] = x + y + i * 3; } } /* Cb and Cr */ for(y=0;ydata[1][y * pict->linesize[1] + x] = 128 + y + i * 2; pict->data[2][y * pict->linesize[2] + x] = 64 + x + i * 5; } } } static void write_video_frame(AVFormatContext *oc, AVStream *st) { int out_size, ret; AVCodecContext *c; static struct SwsContext *img_convert_ctx; c = st->codec; if(frame_count >= STREAM_NB_FRAMES) { } else { if(c->pix_fmt != PIX_FMT_YUV420P) { if(img_convert_ctx = NULL) { img_convert_ctx = sws_getContext(WIDTH, HEIGHT, PIX_FMT_YUV420P, WIDTH, HEIGHT, c->pix_fmt, sws_flags, NULL, NULL, NULL); if(img_convert_ctx == NULL) { std::cout << "Cannot initialize the conversion context" << std::endl; std::cin.get();exit(1); } } fill_yuv_image(tmp_picture, frame_count, WIDTH, HEIGHT); sws_scale(img_convert_ctx, tmp_picture->data, tmp_picture->linesize, 0, HEIGHT, picture->data, picture->linesize); } else { fill_yuv_image(picture, frame_count, WIDTH, HEIGHT); } } if (oc->oformat->flags & AVFMT_RAWPICTURE) { /* raw video case. The API will change slightly in the near futur for that */ AVPacket pkt; av_init_packet(&pkt); pkt.flags |= AV_PKT_FLAG_KEY; pkt.stream_index= st->index; pkt.data= (uint8_t *)picture; pkt.size= sizeof(AVPicture); ret = av_interleaved_write_frame(oc, &pkt); } else { /* encode the image */ picture->pts = (float) frame_count * (1000.0/(float)(FRAME_RATE)) * 90; int result, result2; AVPacket pkt; av_init_packet(&pkt); pkt.dts = AV_NOPTS_VALUE; pkt.stream_index = st->index; pkt.data = video_outbuf; pkt.size = video_outbuf_size; pkt.duration = 0; result2 = avcodec_encode_video2(c, &pkt, picture, &result); if (result == 1 && result2 == 0) { ret = av_interleaved_write_frame(oc, &pkt); // CRASH !!! } else { ret = 0; } } if (ret != 0) { std::cout << "Error while writing video frames" << std::endl; std::cin.get();exit(1); } frame_count++; } int main(int argc, char** argv) { const char* filename = "test.h264"; AVOutputFormat *outputFormat; AVFormatContext *context; AVCodecContext *codec; AVStream *videoStream; double videoPTS; // init libavcodec, register all codecs and formats av_register_all(); avcodec_register_all(); // auto detect the output format from the name outputFormat = av_guess_format(NULL, filename, NULL); if(!outputFormat) { std::cout << "Cannot guess output format! Using mpeg!" << std::endl; std::cin.get(); outputFormat = av_guess_format(NULL, "h263" , NULL); } if(!outputFormat) { std::cout << "Could not find suitable output format." << std::endl; std::cin.get();exit(1); } context = avformat_alloc_context(); if(!context) { std::cout << "Cannot allocate avformat memory." << std::endl; std::cin.get();exit(1); } context->oformat = outputFormat; sprintf_s(context->filename, sizeof(context->filename), "%s", filename); std::cout << "Is '" << context->filename << "' = '" << filename << "'" << std::endl; videoStream = NULL; outputFormat->audio_codec = CODEC_ID_NONE; videoStream = addVideoStream(context, outputFormat->video_codec); /* still needed? if(av_set_parameters(context, NULL) < 0) { std::cout << "Invalid output format parameters." << std::endl; exit(0); }*/ av_dump_format(context, 0, filename, 1); if(videoStream) openVideo(context, videoStream); if(!outputFormat->flags & AVFMT_NOFILE) { if(avio_open(&context->pb, filename, AVIO_FLAG_READ_WRITE) < 0) { std::cout << "Could not open " << filename << std::endl; std::cin.get();exit(1); } } avformat_write_header(context, 0); while(true) { if(videoStream) videoPTS = (double) videoStream->pts.val * videoStream->time_base.num / videoStream->time_base.den; else videoPTS = 0.; if((!videoStream || videoPTS >= STREAM_DURATION)) { break; } write_video_frame(context, videoStream); } av_write_trailer(context); if(videoStream) closeVideo(context, videoStream); for(int i = 0; i < context->nb_streams; i++) { av_freep(&context->streams[i]->codec); av_freep(&context->streams[i]); } if(!(outputFormat->flags & AVFMT_NOFILE)) { avio_close(context->pb); } av_free(context); std::cin.get(); return 0; }; -------------- next part -------------- An HTML attachment was scrubbed... URL: From rnp at 25ghz.net Wed May 23 15:06:34 2012 From: rnp at 25ghz.net (Rafael do Nascimento Pereira) Date: Wed, 23 May 2012 15:06:34 +0200 Subject: [Libav-user] Video Quality Analyzer - implement which features? In-Reply-To: References: Message-ID: Hi Wesley, i would include a PSNR, Quantization, Bit Rate, GOP Length, Aspect Ratio, Color Format. There are some options the are common to any video format and other are specific. I suggest you take a look at this site, maybe you can get some ideas: http://www.tek.com/datasheet/video-quality-analysis-software *"If you can't explain it simply, you don't understand it well enough." --Albert Einstein* 2012/5/23 Wesley S. > Hi, > > I am a software developer currently working on a (cross-platform) Video > Quality Analyzer application > for a project at university. It will most likely be released as open > source software when it is finished. > > I am posting to this list to ask the video encoding/quality experts what > is essential > in comparing video quality according to them. > > A few important design choices I have made: > - libav is used to open video files in order to support many video formats > out of the box > (and to support extraction of information from decoder, for example motion > vectors) > - image processing plug-ins and tools are extensible through scripting and > dynamically linked plug-ins > > So, most important question: > What plug-ins would be essential in this kind of application for you? > > Also, if you would be interested in more information or if you would like > to try writing > your own script or plug-in for this application, you can contact me by > e-mail. > > Kind regards, > Wesley S. > > PS: here's a little preview screenshot of the current user interface: > http://i50.tinypic.com/acptnq.png > > _______________________________________________ > 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 lulebo at gmail.com Wed May 23 17:30:20 2012 From: lulebo at gmail.com (Carl Lindqvist) Date: Wed, 23 May 2012 17:30:20 +0200 Subject: [Libav-user] Swscale: Interlaced 4:2:2 to interlaced 4:2:0 Message-ID: Hi A while back i posted this question on stackoverflow but it hasn't gained much attention: http://stackoverflow.com/questions/9681059/swscale-color-space-convert-interlaced-frames As you can see I have problems when changing the color space from 4:2:2 to 4:2:0 on interlaced material. I hope this is the right list for questions regarding swscale, as I assume where that's where the problem is. Can I tell swscale to create interlaced 4:2:0 frames somehow? Right now it just creates a progressive 4:2:0 frame and libavcodec continues to encode it as interlaced. Regards Carl Lindqvist -------------- next part -------------- An HTML attachment was scrubbed... URL: From amir.rouhi at rmit.edu.au Thu May 24 03:28:29 2012 From: amir.rouhi at rmit.edu.au (amir.rouhi at rmit.edu.au) Date: Thu, 24 May 2012 11:28:29 +1000 Subject: [Libav-user] ffmpeg and JM I_Frame nonconformity In-Reply-To: References: Message-ID: I use the below command for making video out of 5 different bmp images: ffmpeg -f image2 -r 0.1 -i C:\test%1d.bmp -an -vcodec libx264 -threads 0 -f h264 -r 0.5 -force_key_frames 0.1 -s 360x240 C:\5frameTest.264 I used -force_key_frames instead if -g to inforce the ffmpeg to generate i-frames. BTW with -g i did not get even the correct video. The generated video shows the images but not in same interval distance but shows all 5 images in the video. then i use JM decoder and tried to get the frames with s-type=2 nad the result was just 3 , not 5. Question is why 5 i-frame in ffmpeg can not be detected in JM? On 22 May 2012 20:02, Alex Cohn wrote: > On Tue, May 22, 2012 at 11:47 AM, wrote: > > > > I have noticed that the I-Frames in a pure h264 video created by ffmpeg > is > > not same as what JM detect as I-Frame in the same video. > > In JM software s_type=2 means I_Frame. the number of s_types frames are > > always lower than what ffmpeg shows. > > What is your advice? > > Amir > > Would you like to upload an example? > > Alex > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > -- Amir H. Rouhi PhD Student/ CSIT RMIT University Room: 14-09-04 http://raws.adc.rmit.edu.au/~s3288736/blog2/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From alexcohn at netvision.net.il Thu May 24 08:24:34 2012 From: alexcohn at netvision.net.il (Alex Cohn) Date: Thu, 24 May 2012 09:24:34 +0300 Subject: [Libav-user] ffmpeg and JM I_Frame nonconformity In-Reply-To: References: Message-ID: On Thu, May 24, 2012 at 4:28 AM, wrote: > I use the below command for making video out of 5 different bmp images: > > ffmpeg -f image2 -r 0.1 -i C:\test%1d.bmp -an -vcodec libx264 -threads 0 ?-f > h264 -r 0.5 -force_key_frames 0.1 -s 360x240 C:\5frameTest.264 -force_key_frames expects a comma separated list of timestamps, not a "step" or something BR, Alex > I used? -force_key_frames? instead if -g to inforce the ffmpeg to generate > i-frames. BTW with -g i did not get even the correct video. > The generated video shows the images but not in same interval distance but > shows all 5 images in the video. > > then i use JM decoder and tried to get the frames with s-type=2 nad the > result was just 3 , not 5. > Question is why 5 i-frame in ffmpeg can not be detected in JM? > > On 22 May 2012 20:02, Alex Cohn wrote: >> >> On Tue, May 22, 2012 at 11:47 AM, ? wrote: >> > >> > I have noticed that the I-Frames in a pure h264 video created by ffmpeg >> > is >> > not same as what JM detect as I-Frame in the same video. >> > In JM software s_type=2 means I_Frame. the number of s_types frames are >> > always lower than what ffmpeg shows. >> > ?What is your advice? >> > Amir >> >> Would you like to upload an example? >> >> Alex > -- > Amir H. Rouhi > PhD Student/ CSIT RMIT University > Room: 14-09-04 > http://raws.adc.rmit.edu.au/~s3288736/blog2/ From alexcohn at netvision.net.il Thu May 24 08:44:27 2012 From: alexcohn at netvision.net.il (Alex Cohn) Date: Thu, 24 May 2012 09:44:27 +0300 Subject: [Libav-user] Swscale: Interlaced 4:2:2 to interlaced 4:2:0 In-Reply-To: References: Message-ID: On Wed, May 23, 2012 at 6:30 PM, Carl Lindqvist wrote: > Hi > > A while back i posted this question on stackoverflow but it hasn't gained > much attention: > > http://stackoverflow.com/questions/9681059/swscale-color-space-convert-interlaced-frames > > As you can see I have problems when changing the color space from 4:2:2 to > 4:2:0 on interlaced material. I hope this is the right list for questions > regarding swscale, as I assume where that's where the problem is. Can I tell > swscale to create interlaced 4:2:0 frames somehow? Right now it just creates > a progressive 4:2:0 frame and libavcodec continues to encode it as > interlaced. > > Regards > Carl Lindqvist In ffmpeg, deinterlace is performed by avcodec (imgconvert.c avpicture_deinterlace), it does some 4:2:2 pixel formats, but not uyvy. On teh other hand, swscale has no knowledge of interlaced formats. If you are using ffmpeg tool, please publish the exact command line; if it is your program that calls swscale and libavcodec, please publish relevant code. BR, Alex From cehoyos at ag.or.at Thu May 24 08:59:42 2012 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Thu, 24 May 2012 06:59:42 +0000 (UTC) Subject: [Libav-user] Swscale: Interlaced 4:2:2 to interlaced 4:2:0 References: Message-ID: Alex Cohn writes: > In ffmpeg, deinterlace is performed by avcodec (imgconvert.c > avpicture_deinterlace) This deinterlacer is old, if you have no license issue, please use yadif. (If you have a license issue, contact the developer.) Aren't there filters to "interleave" (if this is the correct word, I mean putting the fields above each other) the interlaced content, scale it, and "de-interleave" it again? Carl Eugen From lulebo at gmail.com Thu May 24 09:16:54 2012 From: lulebo at gmail.com (Carl Lindqvist) Date: Thu, 24 May 2012 09:16:54 +0200 Subject: [Libav-user] Swscale: Interlaced 4:2:2 to interlaced 4:2:0 In-Reply-To: References: Message-ID: 2012/5/24 Carl Eugen Hoyos > Alex Cohn writes: > > > In ffmpeg, deinterlace is performed by avcodec (imgconvert.c > > avpicture_deinterlace) > > This deinterlacer is old, if you have no license issue, please > use yadif. > (If you have a license issue, contact the developer.) > > Aren't there filters to "interleave" (if this is the correct word, > I mean putting the fields above each other) the interlaced > content, scale it, and "de-interleave" it again? > > Carl Eugen > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > You are not understanding the issue. The issue is not deinterlacing anything, it is producing correct 4:2:0 frames for encoding interlaced. Interlaced 4:2:0 is different than progressive 4:2:0. The chroma samples are interpolated from rows 1 and 3, 2 and 4 etc instead of 1 and 2, 3 and 4 and so on. This is to keep chroma samples in the same field. My question is if it is possible to create interlaced 4:2:0 in a correct way. /Carl Lindqvist -------------- next part -------------- An HTML attachment was scrubbed... URL: From cehoyos at ag.or.at Thu May 24 09:23:44 2012 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Thu, 24 May 2012 07:23:44 +0000 (UTC) Subject: [Libav-user] Swscale: Interlaced 4:2:2 to interlaced 4:2:0 References: Message-ID: Carl Lindqvist writes: > 2012/5/24 Carl Eugen Hoyos ag.or.at> > Alex Cohn ...> writes: > > > In ffmpeg, deinterlace is performed by avcodec (imgconvert.c > > > avpicture_deinterlace) > > > > This deinterlacer is old, if you have no license issue, please > > use yadif. > > You are not understanding the issue. The issue is not > deinterlacing anything, it is producing correct 4:2:0 frames > for encoding interlaced. I just wanted to answer the sentence "In ffmpeg, deinterlace is performed by avcodec" by Alex Cohn, I did not comment on your original issue. Is your input interlaced frames? Or do you want to half the framerate of your input? Carl Eugen From lulebo at gmail.com Thu May 24 10:19:36 2012 From: lulebo at gmail.com (Carl Lindqvist) Date: Thu, 24 May 2012 10:19:36 +0200 Subject: [Libav-user] Swscale: Interlaced 4:2:2 to interlaced 4:2:0 In-Reply-To: References: Message-ID: 2012/5/24 Carl Eugen Hoyos > Carl Lindqvist writes: > > > 2012/5/24 Carl Eugen Hoyos ag.or.at> > > Alex Cohn ...> writes: > > > > In ffmpeg, deinterlace is performed by avcodec (imgconvert.c > > > > avpicture_deinterlace) > > > > > > This deinterlacer is old, if you have no license issue, please > > > use yadif. > > > > You are not understanding the issue. The issue is not > > deinterlacing anything, it is producing correct 4:2:0 frames > > for encoding interlaced. > > I just wanted to answer the sentence "In ffmpeg, deinterlace is > performed by avcodec" by Alex Cohn, I did not comment > on your original issue. > > Is your input interlaced frames? > Or do you want to half the framerate of your input? > > Carl Eugen > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > Ok, I misunderstood you. Yes, my input is raw SDI video. Interlaced SD 4:2:2 8bit (or 10bit, but I use 8bit). I want the output to be interlaced, full field rade. Right now, swscale produces chroma samples that are scaled from both fields, which give the effect in the image in the stack overflow thread when looking at the final video. I have been reading what I can find about swscale, but can't really find any info on this. This is the code I use (just standard stuff): img_convert_ctx = sws_getContext(destWidth, destHeight, PIX_FMT_UYVY422, c->width, c->height, c->pix_fmt, sws_flags, NULL, NULL, NULL); sws_scale(img_convert_ctx, tmp_picture->data, tmp_picture->linesize, 0, destHeight, picture->data, picture->linesize); Is there a flag that sets this? There are some flags like SWS_FULL_CHR_H_INP, but I can't find any info on what they do. Regards Carl Lindqvist -------------- next part -------------- An HTML attachment was scrubbed... URL: From amir.rouhi at rmit.edu.au Thu May 24 10:33:09 2012 From: amir.rouhi at rmit.edu.au (amir.rouhi at rmit.edu.au) Date: Thu, 24 May 2012 18:33:09 +1000 Subject: [Libav-user] ffmpeg and JM I_Frame nonconformity In-Reply-To: References: Message-ID: Oh, Thanks Alex, In the FFMPEG DOCUMENTATION says the format of usage should be: ?-force_key_frames[:stream_specifier] time[,time...] (*output,per-stream*) so for example i should write: ffmpeg -f image2 -r 0.1 -i C:\test%1d.bmp -an -vcodec libx264 -threads 0 -f h264 -r 0.5 -force_key_frames time[0,5,10,15,20] -s 360x240 C:\5frameTest.264 Is that correct? BTW, if the time stamps are long , i.e every 5 second from start of the video, is there any other simplified form to use in time stamp? and would you please let me know whats the difference of -force_key_frames time and -g ? Thanks Amir On 24 May 2012 16:24, Alex Cohn wrote: > On Thu, May 24, 2012 at 4:28 AM, wrote: > > I use the below command for making video out of 5 different bmp images: > > > > ffmpeg -f image2 -r 0.1 -i C:\test%1d.bmp -an -vcodec libx264 -threads 0 > -f > > h264 -r 0.5 -force_key_frames 0.1 -s 360x240 C:\5frameTest.264 > > -force_key_frames expects a comma separated list of timestamps, not a > "step" or something > > BR, > Alex > > > I used -force_key_frames instead if -g to inforce the ffmpeg to > generate > > i-frames. BTW with -g i did not get even the correct video. > > The generated video shows the images but not in same interval distance > but > > shows all 5 images in the video. > > > > then i use JM decoder and tried to get the frames with s-type=2 nad the > > result was just 3 , not 5. > > Question is why 5 i-frame in ffmpeg can not be detected in JM? > > > > On 22 May 2012 20:02, Alex Cohn wrote: > >> > >> On Tue, May 22, 2012 at 11:47 AM, wrote: > >> > > >> > I have noticed that the I-Frames in a pure h264 video created by > ffmpeg > >> > is > >> > not same as what JM detect as I-Frame in the same video. > >> > In JM software s_type=2 means I_Frame. the number of s_types frames > are > >> > always lower than what ffmpeg shows. > >> > What is your advice? > >> > Amir > >> > >> Would you like to upload an example? > >> > >> Alex > > -- > > Amir H. Rouhi > > PhD Student/ CSIT RMIT University > > Room: 14-09-04 > > http://raws.adc.rmit.edu.au/~s3288736/blog2/ > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > -- Amir H. Rouhi PhD Student/ CSIT RMIT University Room: 14-09-04 http://raws.adc.rmit.edu.au/~s3288736/blog2/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From cehoyos at ag.or.at Thu May 24 10:34:27 2012 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Thu, 24 May 2012 08:34:27 +0000 (UTC) Subject: [Libav-user] Swscale: Interlaced 4:2:2 to interlaced 4:2:0 References: Message-ID: Carl Lindqvist writes: > Yes, my input is raw SDI video. Interlaced SD 4:2:2 8bit > (or 10bit, but I use 8bit). I want the output to be > interlaced, full field rade. Right now, swscale produces > chroma samples that are scaled from both fields, which give > the effect in the image in the stack overflow thread when > looking at the final video. I believe you need two sws contexts, one for each field with half height and twice the stride. Did you already look at MPlayer/libmpcodecs/vf_scale.c ? Carl Eugen From andrey.krieger.utkin at gmail.com Thu May 24 13:12:08 2012 From: andrey.krieger.utkin at gmail.com (Andrey Utkin) Date: Thu, 24 May 2012 14:12:08 +0300 Subject: [Libav-user] Is it possible in some codec that AVFrame.pts is not derived from AVPacket.pts? Message-ID: Is that right or wrong that at some cases the frame pts (reachable after decoding) is _not_ derived from packet pts/dts (reachable after demux), but is encapsulated in the coded frame itself? In other words, can elementary AVStream have its own internal timestamps besides the timestamps provided by media container? If such situation may have place, is that the case for MPEGTS container and video codecs h264, mpeg2, audio codecs aac, mp3, ac3? Practical question is: can i safely join videos of same characteristics by keyframe bounds, just by remuxing it and altering AVPacket pts/dts? -- Andrey Utkin From alexcohn at netvision.net.il Thu May 24 16:19:09 2012 From: alexcohn at netvision.net.il (Alex Cohn) Date: Thu, 24 May 2012 17:19:09 +0300 Subject: [Libav-user] ffmpeg and JM I_Frame nonconformity In-Reply-To: References: Message-ID: On Thu, May 24, 2012 at 11:33 AM, wrote: > Oh, Thanks Alex, In the FFMPEG DOCUMENTATION says the format of usage should > be: > ?-force_key_frames[:stream_specifier]?time[,time...] (output,per-stream) > so for example i should write: > ? ffmpeg -f image2 -r 0.1 -i C:\test%1d.bmp -an -vcodec libx264 -threads 0 > ?-f??h264 -r 0.5 -force_key_frames time[0,5,10,15,20] -s 360x240 > C:\5frameTest.264 > Is that correct? Looks reasonable. > BTW, if the time stamps are long , i.e every 5 second from start of the > video, is there any other simplified form to use in?time stamp? Not that I am aware of. > and would you please let me know whats the difference of? -force_key_frames > time? and -g ? You should learn http://sites.google.com/site/linuxencoding/x264-ffmpeg-mapping > Thanks > Amir BR, Alex From alexcohn at netvision.net.il Thu May 24 16:38:18 2012 From: alexcohn at netvision.net.il (Alex Cohn) Date: Thu, 24 May 2012 17:38:18 +0300 Subject: [Libav-user] Swscale: Interlaced 4:2:2 to interlaced 4:2:0 In-Reply-To: References: Message-ID: On Thu, May 24, 2012 at 11:19 AM, Carl Lindqvist wrote: > > Yes, my input is raw SDI video. Interlaced SD 4:2:2 8bit (or 10bit, but I > use 8bit). I want the output to be interlaced, full field rade. Right now, > swscale produces chroma samples that are scaled from both fields, which give > the effect in the image in the stack overflow thread when looking at the > final video. > > I have been reading what I can find about swscale, but can't really find any > info on this. This is the code I use (just standard stuff): > > img_convert_ctx = sws_getContext(destWidth, destHeight, > ???????????????????????????????????????????????? PIX_FMT_UYVY422, > ???????????????????????????????????????????????? c->width, c->height, > ???????????????????????????????????????????????? c->pix_fmt, > ???????????????????????????????????????????????? sws_flags, NULL, NULL, > NULL); > > sws_scale(img_convert_ctx, tmp_picture->data, tmp_picture->linesize, > ????????????????????? 0, destHeight, picture->data, picture->linesize); What are the input and output sizes in your case? > Is there a flag that sets this? There are some flags like > SWS_FULL_CHR_H_INP, but I can't find any info on what they do. > > Regards > Carl Lindqvist BR Alex From mbradshaw at sorensonmedia.com Thu May 24 21:07:58 2012 From: mbradshaw at sorensonmedia.com (Michael Bradshaw) Date: Thu, 24 May 2012 13:07:58 -0600 Subject: [Libav-user] Why is HTTP streaming so slow? Message-ID: I've written a plugin for a program that uses FFmpeg to read and decode a video file, and then passes the decoded frames to an encoder (not FFmpeg) that consumes them. A big motivation for this plugin is FFmpeg's ability to stream videos over HTTP. However, I've found this to be incredibly slow, and I'm wondering if I'm doing things right. The sample video file can be downloaded through my web browser in about 2 minutes (at a rate of about 3.5-4MB per second), and transcoded (using my FFmpeg reader for decoding) in about 12 minutes (using about 80% of my CPU), for ~14 minutes in total. However, if I use the URL in the reader (and stream the video over HTTP), it downloads at a rate of about 80KB per second, and the transcode was only ~15% done after 14 minutes (and only used 5-10% of my CPU). I'm quite sure the bottleneck is my decoder not downloading the video fast enough, so it doesn't decode and feed frames to the encoder fast either (hence my low CPU usage). Why is downloading the file and then transcoding it so much faster than streaming it while transcoding? Are there any quirks I need to be aware of when streaming, or any flags I need to set in order to increase the streaming rate? Right now my code is pretty straight forward, and is semi-similar to ffplay (i.e. nothing fancy) (ffplay can't play it back fast enough either, and streams it at the same rate as my plugin decoder). Is there a particular reason FFmpeg streams so slowly? Thanks, Michael From andrey.krieger.utkin at gmail.com Thu May 24 22:05:15 2012 From: andrey.krieger.utkin at gmail.com (Andrey Utkin) Date: Thu, 24 May 2012 23:05:15 +0300 Subject: [Libav-user] Why is HTTP streaming so slow? In-Reply-To: References: Message-ID: > Is there a particular reason FFmpeg streams so slowly? Coz while you decode, you don't fetch, and while you fetch, you don't decode. That's what switching overhead and lack of parallelism in your app result in. Thanks for interesting info you've investigated. -- Andrey Utkin -------------- next part -------------- An HTML attachment was scrubbed... URL: From mbradshaw at sorensonmedia.com Thu May 24 23:35:35 2012 From: mbradshaw at sorensonmedia.com (Michael Bradshaw) Date: Thu, 24 May 2012 15:35:35 -0600 Subject: [Libav-user] Why is HTTP streaming so slow? In-Reply-To: References: Message-ID: On Thu, May 24, 2012 at 2:05 PM, Andrey Utkin wrote: >> Is there a particular reason FFmpeg streams so slowly? > > Coz while you decode, you don't fetch, and while you fetch, you don't > decode. That's what switching overhead and lack of parallelism in your app > result in. Hmmm... that seems like it would make sense, but I just ran a simple test program that simply loops and calls av_read_frame() (no decoding) and I get the same results (uses <5% of the CPU, so it doesn't look like the network is waiting on the CPU). Here's what I've found (and these numbers seem pretty consistent on my machine): Downloading in Google Chrome is about 50x faster Downloading in Internet Explorer is about 25x faster Streaming with QuickTime Player is about 25x faster Streaming with Media Player Classic - Home Cinema is about 25x faster Downloading with wget is about 5x faster (I wonder if wget was demuxing and things like my decoder does if they'd be about the same speed) I have no idea why Chrome, IE, QT, and MPC-HC are so much faster, and I wonder if they're setting some network options in their sockets (maybe setting a larger window size or something?), and I wonder why wget isn't nearly as fast as them. From lulebo at gmail.com Fri May 25 00:52:37 2012 From: lulebo at gmail.com (Carl Lindqvist) Date: Fri, 25 May 2012 00:52:37 +0200 Subject: [Libav-user] Swscale: Interlaced 4:2:2 to interlaced 4:2:0 In-Reply-To: References: Message-ID: 2012/5/24 Alex Cohn > On Thu, May 24, 2012 at 11:19 AM, Carl Lindqvist wrote: > > > > Yes, my input is raw SDI video. Interlaced SD 4:2:2 8bit (or 10bit, but I > > use 8bit). I want the output to be interlaced, full field rade. Right > now, > > swscale produces chroma samples that are scaled from both fields, which > give > > the effect in the image in the stack overflow thread when looking at the > > final video. > > > > I have been reading what I can find about swscale, but can't really find > any > > info on this. This is the code I use (just standard stuff): > > > > img_convert_ctx = sws_getContext(destWidth, destHeight, > > PIX_FMT_UYVY422, > > c->width, c->height, > > c->pix_fmt, > > sws_flags, NULL, NULL, > > NULL); > > > > sws_scale(img_convert_ctx, tmp_picture->data, tmp_picture->linesize, > > 0, destHeight, picture->data, picture->linesize); > > What are the input and output sizes in your case? > > > Is there a flag that sets this? There are some flags like > > SWS_FULL_CHR_H_INP, but I can't find any info on what they do. > > > > Regards > > Carl Lindqvist > > BR > Alex > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > In this case the video is just standard SD video, 720x576 8bit uyvy. But I also have some 1080i video i would like to process in the same way. If I understand how to do one, I can probably figure out how to do the other one. I can probably do my own calculations and even optimize a bit with SSE, since I think I get how the chroma samples should behave, but it would be nice to have swscale do it for me if it is supported. Is it really necessary to have 2 instances, one for each field. It seems as if this would be a pretty common thing to want to do. I have not yet looked at MPlayer/libmpcodecs/vf_scale.c, will do it tomorrow and see what I can find. How does the ffmpeg app do it? What file should I look at for source examples? Regards Carl Lindqvist -------------- next part -------------- An HTML attachment was scrubbed... URL: From sendtofaraway at gmail.com Fri May 25 03:55:29 2012 From: sendtofaraway at gmail.com (=?GB2312?B?zrrC1w==?=) Date: Fri, 25 May 2012 09:55:29 +0800 Subject: [Libav-user] How to use the ffmepg multithread in h264 decode? Message-ID: Recently , I am doing streaming media using ffmpeg . But when the video size get to 640x480, the decode speed become too slow to play normal . I see the h264 decoder in the ffmepg can do multithread decoding . I am wonder it will work on the single CPU core machine or not ? And if works ,what is the thread_count recommended and if there is some doc or example can help me . Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: From kalileo at universalx.net Fri May 25 06:21:28 2012 From: kalileo at universalx.net (Kalileo) Date: Fri, 25 May 2012 11:21:28 +0700 Subject: [Libav-user] Why is HTTP streaming so slow? In-Reply-To: References: Message-ID: <8B029418-9E52-40BE-930A-07E86182E4D8@universalx.net> On May 25, 2012, at 04:35 , Michael Bradshaw wrote: > On Thu, May 24, 2012 at 2:05 PM, Andrey Utkin > wrote: >>> Is there a particular reason FFmpeg streams so slowly? >> >> Coz while you decode, you don't fetch, and while you fetch, you don't >> decode. That's what switching overhead and lack of parallelism in your app >> result in. > > Hmmm... that seems like it would make sense, but I just ran a simple > test program that simply loops and calls av_read_frame() (no decoding) > and I get the same results (uses <5% of the CPU, so it doesn't look > like the network is waiting on the CPU). Here's what I've found (and > these numbers seem pretty consistent on my machine): There is no reason why FFMPEG would not stream fast enough. However, a lot depends on your code. If you run decoding and streaming in different threads there should be no reason why streaming would be slower than required. You talk about passing the decoded frames to a separate encoder, then you talk about using FFMPEG for streaming over HTTP, I don't really see how that fits together. From krishnaks at iwavesystems.com Fri May 25 06:51:01 2012 From: krishnaks at iwavesystems.com (krishnaks at iwavesystems.com) Date: Fri, 25 May 2012 10:21:01 +0530 Subject: [Libav-user] avcodec_decode_video2 got_picture parameter returns zero sometimes Message-ID: <0770434339582c5ad83b860a48606df3.squirrel@124.124.219.233> Hi, I am using libavcodec for H264 decoying. I am using this API for decoding H264 video frame int avcodec_decode_video2(AVCodecContext *avctx, AVFrame *picture, int *got_picture_ptr, const AVPacket *avpkt); Here sometimes got_picture_ptr returns zero which means frames could not be decompressed. What may be the reason? I am getting the H264 frame without any loss. ANy configuration option I am missing? Thanks in advance. From nitinkumgoyal at gmail.com Fri May 25 07:57:42 2012 From: nitinkumgoyal at gmail.com (NITIN GOYAL) Date: Fri, 25 May 2012 11:27:42 +0530 Subject: [Libav-user] avcodec_decode_video2 got_picture parameter returns zero sometimes In-Reply-To: <0770434339582c5ad83b860a48606df3.squirrel@124.124.219.233> References: <0770434339582c5ad83b860a48606df3.squirrel@124.124.219.233> Message-ID: wht do you mean by sometimes? if its not consistent then i wonder the data frame you are sending are not correct. if its consistent and always results zero then either the NAL formation have some issue or you are missing some important configuration. On Fri, May 25, 2012 at 10:21 AM, wrote: > Here sometimes got_picture_ptr returns zero which means frames could not > be decompressed. > What may be the reason? I am getting the H264 frame without any loss. > ANy configuration option I am missing? > -------------- next part -------------- An HTML attachment was scrubbed... URL: From cehoyos at ag.or.at Fri May 25 08:04:54 2012 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Fri, 25 May 2012 06:04:54 +0000 (UTC) Subject: [Libav-user] Swscale: Interlaced 4:2:2 to interlaced 4:2:0 References: Message-ID: Carl Lindqvist writes: > I have not yet looked at?MPlayer/libmpcodecs/vf_scale.c, > will do it tomorrow and see what I can find. > > How does the ffmpeg app do it? What file should I look > at for source examples? libavfilter/vf_scale.c (look for isws) Not surprisingly, it looks similar to the MPlayer code. Carl Eugen From sendnewmailmessage at gmail.com Fri May 25 10:53:53 2012 From: sendnewmailmessage at gmail.com (Dmitry Kosei) Date: Fri, 25 May 2012 11:53:53 +0300 Subject: [Libav-user] SPS/PPS parameters generation Message-ID: Hi! I'm using such code for initialization: avcodec_register_all(); av_register_all(); avformat_network_init(); const char *filename="rtp://192.168.0.101:10202"; AVOutputFormat *formatRTP = av_guess_format("rtp", filename, NULL); pFormatRTP = avformat_alloc_context(); pFormatRTP->oformat = formatRTP; video_st = av_new_stream(pFormatRTP, AVMEDIA_TYPE_VIDEO); avcodec_get_context_defaults3(video_st->codec, avcodec_find_encoder(CODEC_ID_H264)); H264Context = video_st->codec; H264Context->codec_id = CODEC_ID_H264; H264Context->codec_type = AVMEDIA_TYPE_VIDEO; H264Context->width = VideoWidth; H264Context->height = VideoHeight; H264Context->time_base.den = VideoFps; H264Context->time_base.num = 1; H264Context->pix_fmt = PIX_FMT_YUV420P; H264Context->flags |= CODEC_FLAG_GLOBAL_HEADER; if (avio_open(&pFormatRTP->pb, filename, 2) != 0) { return S_FALSE; } if(avformat_write_header(pFormatRTP, NULL)!=0) { return S_FALSE; } But when I call av_sdp_create after that, it neither returns sprop-parameter-sets for sdp nor profile-level-id. Can somebody help? -------------- next part -------------- An HTML attachment was scrubbed... URL: From anton at khirnov.net Fri May 25 13:54:50 2012 From: anton at khirnov.net (Anton Khirnov) Date: Fri, 25 May 2012 13:54:50 +0200 Subject: [Libav-user] [libav-api] Is it possible in some codec that AVFrame.pts is not derived from AVPacket.pts? In-Reply-To: References: Message-ID: <20120525115450.5030.18703@daenerys.khirnov.net> On Thu, 24 May 2012 14:12:08 +0300, Andrey Utkin wrote: > Is that right or wrong that at some cases the frame pts (reachable > after decoding) is _not_ derived from packet pts/dts (reachable after > demux), but is encapsulated in the coded frame itself? What pts do you mean? AVFrame.pkt_pts should always be exactly equal to AVPacket.pts of the packet that was used to produce this frame. AVFrame.pts is AFAIK currently not set to anything useful for decoding. If some codec stores timestamps inside codec data, they could in theory be exported there. Justin has also suggested using it for audio to allow properly handling decoder delay. > In other words, can elementary AVStream have its own internal > timestamps besides the timestamps provided by media container? If such > situation may have place, is that the case for MPEGTS container and > video codecs h264, mpeg2, audio codecs aac, mp3, ac3? > Practical question is: can i safely join videos of same > characteristics by keyframe bounds, just by remuxing it and altering > AVPacket pts/dts? > "Safely" depends on the codec details i think, but mostly yes, as long as you're careful to verify that they are indeed the same. -- Anton Khirnov From mbradshaw at sorensonmedia.com Fri May 25 16:28:43 2012 From: mbradshaw at sorensonmedia.com (Michael Bradshaw) Date: Fri, 25 May 2012 08:28:43 -0600 Subject: [Libav-user] Why is HTTP streaming so slow? In-Reply-To: <8B029418-9E52-40BE-930A-07E86182E4D8@universalx.net> References: <8B029418-9E52-40BE-930A-07E86182E4D8@universalx.net> Message-ID: On Thu, May 24, 2012 at 10:21 PM, Kalileo wrote: > > On May 25, 2012, at 04:35 , Michael Bradshaw wrote: > >> On Thu, May 24, 2012 at 2:05 PM, Andrey Utkin >> wrote: >>>> Is there a particular reason FFmpeg streams so slowly? >>> >>> Coz while you decode, you don't fetch, and while you fetch, you don't >>> decode. That's what switching overhead and lack of parallelism in your app >>> result in. >> >> Hmmm... that seems like it would make sense, but I just ran a simple >> test program that simply loops and calls av_read_frame() (no decoding) >> and I get the same results (uses <5% of the CPU, so it doesn't look >> like the network is waiting on the CPU). Here's what I've found (and >> these numbers seem pretty consistent on my machine): > > There is no reason why FFMPEG would not stream fast enough. However, a lot depends on your code. In a small, separate test program I made, I just opened the file and looped calling av_read_frame() (without decoding the packets), and it streamed at the same rate. I can't see why simply looping and calling av_read_frame() downloads the video at a fraction of the rate my web browser (or QuickTime Player) does, either, but that's the behavior I keep seeing. > If you run ?decoding and streaming in different threads there should be no reason why streaming would be slower than required. You mean av_read_frame() in one thread and avcodec_decode_video2/audio4() in another, right? Because eliminating avcodec_decode_video2/audio4() doesn't seem to help, which I thought it would have. > You talk about passing the decoded frames to a separate encoder, then you talk about using FFMPEG for streaming over HTTP, I don't really see how that fits together. Open and stream file over HTTP -> decode frames -> pass frames to encoder. I'm using FFmpeg for the first two parts. Maybe I'll have to do some profiling... I'll post back if I find anything. Thanks, Michael From lizhang at utelisys.com Fri May 25 16:42:12 2012 From: lizhang at utelisys.com (Li Zhang) Date: Fri, 25 May 2012 16:42:12 +0200 Subject: [Libav-user] avcodec_decode_video2 got_picture parameter returns zero sometimes In-Reply-To: References: <0770434339582c5ad83b860a48606df3.squirrel@124.124.219.233>, Message-ID: Hi, I also got the similar problem. I used avcodec_decode_video2() to decode mpeg2 video and avcodec_decode_audio4() to decode audio in TS. Most of the time the decoding is correct. But sometimes it will fail. And the audio decoding is far more failure than video decoding. Now if the video decoding is failed, I will duplicate the last frame. If the audio decoding is failed, I will insert a silent packet into output stream. I do not know why they failed. Can anyone can help us? That is the code I used: For video: len = avcodec_decode_video2(vCodecCtx, oVFrame, &frameFinished, &packet); if((0 > len) || (0 >= frameFinished)) { printf("Error decoding. The video frame index is: %d\n", outs->video_frame_index); } For audio: ret = avcodec_decode_audio4(aCodecCtx,oAFrame,&is_audio_valid, &packet); if((0 > ret) || (0 >= is_audio_valid)) { printf("audio: Error decoiding, ret=%d,the audio frame index is: %lld\n", ret, out->audio_frame_index); } And I got the following results: audio: Error decoiding, ret=-1094995529,the audio frame index is: 180333 audio: Error decoiding, ret=-1094995529,the audio frame index is: 194069 audio: Error decoiding, ret=-1094995529,the audio frame index is: 194287 audio: Error decoiding, ret=-1094995529,the audio frame index is: 222202 audio: Error decoiding, ret=-1094995529,the audio frame index is: 222212 audio: Error decoiding, ret=-1094995529,the audio frame index is: 222214 audio: Error decoiding, ret=-1094995529,the audio frame index is: 236272 audio: Error decoiding, ret=-1094995529,the audio frame index is: 236273 audio: Error decoiding, ret=-1094995529,the audio frame index is: 250601 audio: Error decoiding, ret=-1094995529,the audio frame index is: 264342 audio: Error decoiding, ret=-1094995529,the audio frame index is: 292479 audio: Error decoiding, ret=-1094995529,the audio frame index is: 292482 audio: Error decoiding, ret=-1094995529,the audio frame index is: 292505 audio: Error decoiding, ret=-1094995529,the audio frame index is: 292511 audio: Error decoiding, ret=-1094995529,the audio frame index is: 292801 audio: Error decoiding, ret=-1094995529,the audio frame index is: 306571 audio: Error decoiding, ret=-1094995529,the audio frame index is: 306829 audio: Error decoiding, ret=-1094995529,the audio frame index is: 306843 audio: Error decoiding, ret=-1094995529,the audio frame index is: 306846 audio: Error decoiding, ret=-1094995529,the audio frame index is: 320645 audio: Error decoiding, ret=-1094995529,the audio frame index is: 320855 audio: Error decoiding, ret=-1094995529,the audio frame index is: 320910 audio: Error decoiding, ret=-1094995529,the audio frame index is: 334672 audio: Error decoiding, ret=-1094995529,the audio frame index is: 334887 audio: Error decoiding, ret=-1094995529,the audio frame index is: 334949 audio: Error decoiding, ret=-1094995529,the audio frame index is: 348727 audio: Error decoiding, ret=-1094995529,the audio frame index is: 348730 audio: Error decoiding, ret=-1094995529,the audio frame index is: 350134 audio: Error decoiding, ret=-1094995529,the audio frame index is: 362777 audio: Error decoiding, ret=-1094995529,the audio frame index is: 362791 audio: Error decoiding, ret=-1094995529,the audio frame index is: 362794 audio: Error decoiding, ret=-1094995529,the audio frame index is: 377155 audio: Error decoiding, ret=-1094995529,the audio frame index is: 390910 audio: Error decoiding, ret=-1094995529,the audio frame index is: 391142 audio: Error decoiding, ret=-1094995529,the audio frame index is: 404941 audio: Error decoiding, ret=-1094995529,the audio frame index is: 404949 audio: Error decoiding, ret=-1094995529,the audio frame index is: 405173 audio: Error decoiding, ret=-1094995529,the audio frame index is: 405234 audio: Error decoiding, ret=-1094995529,the audio frame index is: 405249 audio: Error decoiding, ret=-1094995529,the audio frame index is: 405252 audio: Error decoiding, ret=-1094995529,the audio frame index is: 405960 audio: Error decoiding, ret=-1094995529,the audio frame index is: 418995 audio: Error decoiding, ret=-1094995529,the audio frame index is: 419004 audio: Error decoiding, ret=-1094995529,the audio frame index is: 419009 audio: Error decoiding, ret=-1094995529,the audio frame index is: 419284 audio: Error decoiding, ret=-1094995529,the audio frame index is: 433297 audio: Error decoiding, ret=-1094995529,the audio frame index is: 433354 audio: Error decoiding, ret=-1094995529,the audio frame index is: 433355 audio: Error decoiding, ret=-1094995529,the audio frame index is: 433373 audio: Error decoiding, ret=-1094995529,the audio frame index is: 435408 audio: Error decoiding, ret=-1094995529,the audio frame index is: 447131 audio: Error decoiding, ret=-1094995529,the audio frame index is: 447428 audio: Error decoiding, ret=-1094995529,the audio frame index is: 461200 audio: Error decoiding, ret=-1094995529,the audio frame index is: 475537 audio: Error decoiding, ret=-1094995529,the audio frame index is: 475538 audio: Error decoiding, ret=-1094995529,the audio frame index is: 475554 Best regards, Li ________________________________________ From: libav-user-bounces at ffmpeg.org [libav-user-bounces at ffmpeg.org] On Behalf Of NITIN GOYAL [nitinkumgoyal at gmail.com] Sent: Friday, May 25, 2012 7:57 AM To: This list is about using libavcodec, libavformat, libavutil, libavdevice and libavfilter. Subject: Re: [Libav-user] avcodec_decode_video2 got_picture parameter returns zero sometimes wht do you mean by sometimes? if its not consistent then i wonder the data frame you are sending are not correct. if its consistent and always results zero then either the NAL formation have some issue or you are missing some important configuration. On Fri, May 25, 2012 at 10:21 AM, > wrote: Here sometimes got_picture_ptr returns zero which means frames could not be decompressed. What may be the reason? I am getting the H264 frame without any loss. ANy configuration option I am missing? From i.like.privacy.too at gmail.com Fri May 25 20:48:19 2012 From: i.like.privacy.too at gmail.com (Camera Man) Date: Fri, 25 May 2012 14:48:19 -0400 Subject: [Libav-user] Why is HTTP streaming so slow? In-Reply-To: References: Message-ID: <4FBFD3F3.5080606@gmail.com> An HTML attachment was scrubbed... URL: From namballa.vijaykumar at gmail.com Sat May 26 08:09:35 2012 From: namballa.vijaykumar at gmail.com (Vijay Ajay) Date: Sat, 26 May 2012 02:09:35 -0400 Subject: [Libav-user] Problem in Getting Stream Information Message-ID: Hi, I am using libavformat to get the stream information...but there is a problem in getting the total stram information here is my code... typedef struct Duration { int hours, mins, secs, us; }Duration; Duration getDuration(AVFormatContext *ic) { Duration dur; if (ic->duration != AV_NOPTS_VALUE) { dur.secs = ic->duration / AV_TIME_BASE; dur.us = ic->duration % AV_TIME_BASE; dur.mins = dur.secs / 60; dur.secs %= 60; dur.hours = dur.mins / 60; dur.mins %= 60; //printf("%02d:%02d:%02d.%02d", hours, mins, secs,(100 * us) / AV_TIME_BASE); } return dur; } double getBitrate(AVFormatContext *ic) { return (ic->bit_rate)? (double)ic->bit_rate / 1000 : 0.0; } int main(int argc,char **argv) { Duration dur; AVFormatContext *ic=NULL; int bitrate; AVDictionary *tag=NULL; AVDictionaryEntry *elemts = NULL; av_register_all(); int is_output = 0; char url[35]; strcpy(url,argv[1]); if(avformat_open_input(&ic,argv[1],NULL,NULL)) return -1; avformat_find_stream_info(ic,NULL); uint8_t *printed = ic->nb_streams ? av_mallocz(ic->nb_streams) : NULL; if (ic->nb_streams && !printed) return -1; printf("%s #%d, %s, %s '%s':\n",is_output ? "Output" : "Input",0,is_output ? ic->oformat->name : ic->iformat->name,is_output ? "to" : "from", url); printf("\n Duration : "); dur = getDuration(ic); printf("%02d:%02d:%02d.%02d %llu\n", dur.hours, dur.mins, dur.secs,(100 * dur.us) / AV_TIME_BASE,ic->duration); int i; printf("\n Chapters : %d",*ic->nb_chapters*); for (i = 0; i < *ic->nb_chapters*; i++) { AVChapter *ch = ic->chapters[i]; printf("Chapter #%d.%d: ", 0, i); printf("start %f, ", ch->start * av_q2d(ch->time_base)); printf("end %f\n",ch->end*av_q2d(ch->time_base)); } bitrate = getBitrate(ic); printf("\n Bitrate : %d kb/s.",bitrate); if(ic->*nb_programs*) { int j, k, total = 0; for(j=0; j*nb_programs*; j++) { AVDictionaryEntry *name = av_dict_get(ic->programs[j]->metadata,"name", NULL, 0); printf(" Program %d %s\n", ic->programs[j]->id,name ? name->value : ""); //dump_metadata(NULL, ic->programs[j]->metadata, " "); for(k=0; kprograms[j]->nb_stream_indexes; k++) { //dump_stream_format(ic, ic->programs[j]->stream_index[k], index, is_output); printed[ic->programs[j]->stream_index[k]] = 1; } total += ic->programs[j]->nb_stream_indexes; } if (total < ic->nb_streams) printf(" No Program\n"); } avformat_free_context(ic); return 0; } compiling this code iam only getting bitrate and duration.. and i am not able to get the remaining information such as fps audio metadata....... ic->nb_chapters and ic->nb_programs is set to 0. what shall i do to get the complete stream info. thanks in advance -------------- next part -------------- An HTML attachment was scrubbed... URL: From christian.bruemmer at gmx.de Sat May 26 11:07:49 2012 From: christian.bruemmer at gmx.de (=?ISO-8859-15?Q?Christian_Br=FCmmer?=) Date: Sat, 26 May 2012 11:07:49 +0200 Subject: [Libav-user] Working h264 codec configuration for current ffmpeg build Message-ID: <4FC09D65.4080608@gmx.de> Hi, i'm new to libav and video compression at all. What i tried so far is reusing output-example.c or decoding-encoding.c slightly modyfied for compiling on VS++2010 (win7) and to use it for x264 encoding. One of my main problems are that i didnt find up-to-date x264 configurations (c: hardcoded) working with current ffmpeg build. Most examples i found (around 2010) using deprecated flags and functions for configuration and cause i dont know what most of that flag does - so i can't replace them with up-to-date right ones. Would be nice to get a example configuration which is working (c-code and may without using ffmpeg-presets) so i can make sure that my problems (crashes on avcodec_encode_video or av_interleaved_write_frame()) not caused by bad codec configurations! By the way: my avcodec_encode_video returns 32 times "0" before really writing a frame and returning a valid byte size - can this be a right behaviour? Thanks for reading! Regards, Christian -------------- next part -------------- An HTML attachment was scrubbed... URL: From ratin3 at gmail.com Sat May 26 19:21:39 2012 From: ratin3 at gmail.com (Ratin) Date: Sat, 26 May 2012 10:21:39 -0700 Subject: [Libav-user] How to cleanup libavcodec buffers when release is called during decode? Message-ID: Hi, for h.264 decode with hardware like Nvidia's VDPAU decoding, what should I do to cleanup the resources when avcodec_release callback is called? It seems that there are are some memory leaks when running decode for long period of time. Also whats the significance of AVFrame->age , is it used to keep reference frames alive ? Thanks Ratin From cehoyos at ag.or.at Sat May 26 22:03:06 2012 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Sat, 26 May 2012 20:03:06 +0000 (UTC) Subject: [Libav-user] How to cleanup libavcodec buffers when release is called during decode? References: Message-ID: Ratin writes: > Hi, for h.264 decode with hardware like Nvidia's VDPAU decoding, what > should I do to cleanup the resources when avcodec_release callback is > called? > It seems that there are are some memory leaks when running > decode for long period of time. I am only guessing since you did not provide any valgrind output, but did you see the comment for vdpau_render_state.bitstream_buffers? Also see MPlayer r29793 Carl Eugen From avsn9849625263 at gmail.com Sun May 27 17:03:27 2012 From: avsn9849625263 at gmail.com (Murthy Avanithsa) Date: Sun, 27 May 2012 20:33:27 +0530 Subject: [Libav-user] join two mp4 videos Message-ID: Hi all, I just want to know is it possible to join two mp4 videos using libav API. I am aware of joining videos using ffmpeg tool by converting to mpg and using cat to join them. Thanks in advance. -- Regards, Murthy. -------------- next part -------------- An HTML attachment was scrubbed... URL: From devart107 at yahoo.com Sat May 26 16:43:50 2012 From: devart107 at yahoo.com (jacky jacky) Date: Sat, 26 May 2012 22:43:50 +0800 (SGT) Subject: [Libav-user] Asking for using FFMPEG in trade software Message-ID: <1338043430.5947.YahooMailNeo@web190402.mail.sg3.yahoo.com> Dear Sir or Madam, I want to write a program for slitting mp3 file.I used to use FFMPEG for window( Please reference?http://ffmpeg.org/index.html?)?. I want to sale this program.Can I? Must ?I pay money for you because of using this lib? Please help me know clearly.? Thanks for support, Hanh -------------- next part -------------- An HTML attachment was scrubbed... URL: From mirkogheinkel at gmail.com Mon May 21 12:19:25 2012 From: mirkogheinkel at gmail.com (GeraldH) Date: Mon, 21 May 2012 03:19:25 -0700 (PDT) Subject: [Libav-user] audio-problem when playing multiple video segments Message-ID: <1337595565423-4647937.post@n4.nabble.com> hi all, i am using an updated (latest ffmpeg, SDL 1.2.15, MSVC++) version of Dranger's tutorial and basically, it works fine. now, i started to extend it for to play multiple 10-seconds video segments (gapless), what also works out as long as i don't fill the audio queue. but if i do so, as soon it switches to the second segment, i just get some fast techno-style noise, but video is still running. here is the code of the main loop: main(...) { ... while (1) { while(av_read_frame(pFormatCtx, &packet) >= 0) { if(packet.stream_index == videoStream) { avcodec_decode_video2(pCodecCtx, pFrame, &frameFinished, &packet); if(frameFinished) { SDL_LockYUVOverlay(bmp); AVPicture pict; pict.data[0] = bmp->pixels[0]; pict.data[1] = bmp->pixels[2]; pict.data[2] = bmp->pixels[1]; pict.linesize[0] = bmp->pitches[0]; pict.linesize[1] = bmp->pitches[2]; pict.linesize[2] = bmp->pitches[1]; sws_scale(ctx, pFrame->data, pFrame->linesize, 0, h,pict.data, pict.linesize); //av_picture_copy( (AVPicture*)&pict, (AVPicture*)pFrame, pCodecCtx->pix_fmt, w, h); SDL_UnlockYUVOverlay(bmp); rect.x = 0; rect.y = 0; rect.w = w; rect.h = h; SDL_DisplayYUVOverlay(bmp, &rect); SDL_Delay(40); } } else if(packet.stream_index == audioStream) { packet_queue_put(&audioq, &packet); } else { av_free_packet(&packet); } SDL_PollEvent(&event); switch(event.type) { case SDL_QUIT: quit = 1; break; case SDL_KEYUP: if (event.key.keysym.sym == SDLK_ESCAPE) quit = 1; break; default: break; } if (quit) { SDL_Quit(); exit(0); } } av_free(buffer); av_free(pFrameRGB); av_free(pFrame); avcodec_close(pCodecCtx); av_close_input_file(pFormatCtx); pFormatCtx = avformat_alloc_context(); fileNo++; if (fileNo == 10) break; //switch to the next segment file char szFilename[5]; sprintf(szFilename, "%d.asf", fileNo); if(avformat_open_input(&pFormatCtx, szFilename, NULL, NULL)!=0) return -1; // Couldn't open file //initializing audio and video as done before entering the while loop... aCodecCtx = pFormatCtx->streams[audioStream]->codec; wanted_spec.freq = aCodecCtx->sample_rate; wanted_spec.format = AUDIO_S16SYS; wanted_spec.channels = aCodecCtx->channels; wanted_spec.silence = 0; wanted_spec.samples = SDL_AUDIO_BUFFER_SIZE; wanted_spec.callback = audio_callback; wanted_spec.userdata = aCodecCtx; SDL_OpenAudio(&wanted_spec, &spec); aCodec = avcodec_find_decoder(aCodecCtx->codec_id); avcodec_open(aCodecCtx, aCodec); packet_queue_init(&audioq); SDL_PauseAudio(0); pCodecCtx=pFormatCtx->streams[videoStream]->codec; pCodec=avcodec_find_decoder(pCodecCtx->codec_id); avcodec_open(pCodecCtx, pCodec); pFrame=avcodec_alloc_frame(); pFrameRGB=avcodec_alloc_frame(); //numBytes = avpicture_get_size(PIX_FMT_RGB24, pCodecCtx->width, pCodecCtx->height); buffer = (uint8_t *)av_malloc(numBytes*sizeof(uint8_t)); } ... } int packet_queue_put(PacketQueue *q, AVPacket *pkt) { AVPacketList *pkt1; if(av_dup_packet(pkt) < 0) return -1; //check mirko: pkt1 = (AVPacketList *)av_malloc(sizeof(AVPacketList)); if (!pkt1) return -1; pkt1->pkt = *pkt; pkt1->next = NULL; SDL_LockMutex(q->mutex); if (!q->last_pkt) q->first_pkt = pkt1; else q->last_pkt->next = pkt1; q->last_pkt = pkt1; q->nb_packets++; q->size += pkt1->pkt.size; SDL_CondSignal(q->cond); SDL_UnlockMutex(q->mutex); return 0; } can anybody give me a hint whats going wrong ? - or - is anyone interested in a freelance job ? todo's would be: - based on the code above, gapless playing of video/audio of multiple video segments. - video output on any given windows form (e.g. a panel) by using SDL_GetWMInfo(SDL_SysWMinfo *info); // SDL_syswm.h - other things like pause, stop, play, volume control i will appreciate any question about that! regards, Gerald -- View this message in context: http://libav-users.943685.n4.nabble.com/audio-problem-when-playing-multiple-video-segments-tp4647937.html Sent from the libav-users mailing list archive at Nabble.com. From simying at aiisecurity.com Sat May 19 15:11:00 2012 From: simying at aiisecurity.com (=?GB2312?B?06bQwA==?=) Date: Sat, 19 May 2012 21:11:00 +0800 Subject: [Libav-user] Ts re-mux to MKV problem Message-ID: Hi, I want to demux a ts stream and then re-mux it to MKV format with out decoding and coding, but I got problems here. 1, Does ffmpeg support this kind of transformation ? 2, The duration of MKV was always wrong, it is very large(like 911 mins, actually my ts stream was only 6s ...) Would you pls help to provide your comments? Thanks in advance! Cheers Simon -------------- next part -------------- An HTML attachment was scrubbed... URL: From some.birdie at gmail.com Fri May 18 14:56:15 2012 From: some.birdie at gmail.com (some_birdie) Date: Fri, 18 May 2012 05:56:15 -0700 (PDT) Subject: [Libav-user] muxing video and audio to avi In-Reply-To: References: Message-ID: <1337345775213-4644463.post@n4.nabble.com> Have you solved the problem? -- View this message in context: http://libav-users.943685.n4.nabble.com/muxing-video-and-audio-to-avi-tp3159703p4644463.html Sent from the libav-users mailing list archive at Nabble.com. From info at denisgottardello.it Fri May 18 14:36:34 2012 From: info at denisgottardello.it (Denis) Date: Fri, 18 May 2012 14:36:34 +0200 Subject: [Libav-user] libav* + gui toolkits In-Reply-To: References: <201205142103.42342.info@denisgottardello.it> Message-ID: <201205181436.34804.info@denisgottardello.it> In data venerd? 18 maggio 2012 10:40:27, Rafael do Nascimento Pereira ha scritto: > Hello Denis, > > good to know. But i would like to know also, if you have used the phonon > module (the multimedia framework) or if you haved used directly the output > from AVFrame/AVPicture. > > Best regards, > Rafael. No, I'm not using phonon, I grab the images directly from a file or from a stream for do what I want. -- www.denisgottardello.it Skype: mrdebug Videosurveillance and home automation! http://www.denisgottardello.it/DomusBoss/DomusBossIndice.php From info at denisgottardello.it Tue May 22 16:07:57 2012 From: info at denisgottardello.it (Denis) Date: Tue, 22 May 2012 16:07:57 +0200 Subject: [Libav-user] Mux output to buffer instead of file In-Reply-To: References: Message-ID: <201205221607.57648.info@denisgottardello.it> In data marted? 22 maggio 2012 10:35:11, Daniel Henell ha scritto: > Hello, > > I did this in an previous project. The code is available here > > https://github.com/EvilTengil/kinect-streamer/blob/master/src/kstreamer/ffv > 1_depth_encoder.cpp > > Best, Are you sure that this approach (avio_alloc_context and Callback) is the best one instead of URLProtocol implementation? What top ffmpegs developers think about it? -- www.denisgottardello.it Skype: mrdebug Videosurveillance and home automation! http://www.denisgottardello.it/DomusBoss/DomusBossIndice.php From alfredo at perseum.com Mon May 28 09:40:34 2012 From: alfredo at perseum.com (Alfredo Perez) Date: Mon, 28 May 2012 09:40:34 +0200 Subject: [Libav-user] How to speed-up vp8 video decoding. Message-ID: Hi everyone, I'm new to this list so I want to say hello first of all and second congratulate you for the excellent work you are doing. I am running version 0.8.11 "love" version of the ffmpeg library on my application. The encoder works fine. It takes ~60 milliseconds to encode each frame. The problem is that I could not compile the library for the decoder with assembler enabled. It takes more than 250 milliseconds to decode each frame. I am using gop size 10, at 8 frames per second, max_b_frames = 3. Do you know if there is any option on the codecContext for the decoder that I can use to reduce the quality but increasing the speed? Thank you very much. Alfredo. -------------- next part -------------- An HTML attachment was scrubbed... URL: From andrey.krieger.utkin at gmail.com Mon May 28 10:07:39 2012 From: andrey.krieger.utkin at gmail.com (Andrey Utkin) Date: Mon, 28 May 2012 11:07:39 +0300 Subject: [Libav-user] join two mp4 videos In-Reply-To: References: Message-ID: 2012/5/27 Murthy Avanithsa : > Hi all, > > I just want to know is it possible to join two mp4 videos using libav API. Yes. -- Andrey Utkin From avsn9849625263 at gmail.com Mon May 28 10:15:38 2012 From: avsn9849625263 at gmail.com (Murthy Avanithsa) Date: Mon, 28 May 2012 13:45:38 +0530 Subject: [Libav-user] join two mp4 videos In-Reply-To: References: Message-ID: On Mon, May 28, 2012 at 1:37 PM, Andrey Utkin < andrey.krieger.utkin at gmail.com> wrote: > 2012/5/27 Murthy Avanithsa : > > Hi all, > > > > I just want to know is it possible to join two mp4 videos using libav > API. > > Yes. > > -- > Andrey Utkin > Thanks Mr.Andrey Utkin. Can we avoid converting mp4 to raw(mpeg) by using api.If yes can you please suggest any quick steps. Thanks in advance. > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > -- Regards, Murthy. -------------- next part -------------- An HTML attachment was scrubbed... URL: From andrey.krieger.utkin at gmail.com Mon May 28 10:23:32 2012 From: andrey.krieger.utkin at gmail.com (Andrey Utkin) Date: Mon, 28 May 2012 11:23:32 +0300 Subject: [Libav-user] join two mp4 videos In-Reply-To: References: Message-ID: 2012/5/28 Murthy Avanithsa : > Thanks Mr.Andrey Utkin. > Can we avoid?converting?mp4 to raw(mpeg) by using api.If yes can you please > suggest any quick steps. Surely yes. There are two cases for joining video: remuxing and reencoding. Remux method is not always applicable, it works when the characteristics of files is same. Also for remux method to work, mp4 files must be in Annex B format, it is quite fast to convert your source files to this mp4 flavour. -- Andrey Utkin From alexcohn at netvision.net.il Mon May 28 10:28:58 2012 From: alexcohn at netvision.net.il (Alex Cohn) Date: Mon, 28 May 2012 11:28:58 +0300 Subject: [Libav-user] join two mp4 videos In-Reply-To: References: Message-ID: On Mon, May 28, 2012 at 11:23 AM, Andrey Utkin wrote: > 2012/5/28 Murthy Avanithsa : >> Thanks Mr.Andrey Utkin. >> Can we avoid?converting?mp4 to raw(mpeg) by using api.If yes can you please >> suggest any quick steps. > > Surely yes. There are two cases for joining video: remuxing and > reencoding. Remux method is not always applicable, it works when the > characteristics of files is same. Also for remux method to work, mp4 > files must be in Annex B format, it is quite fast to convert your > source files to this mp4 flavour. > -- > Andrey Utkin I believe you can always employ the mp4toannexb filter. BR, Alex Cohn From alexcohn at netvision.net.il Mon May 28 10:31:01 2012 From: alexcohn at netvision.net.il (Alex Cohn) Date: Mon, 28 May 2012 11:31:01 +0300 Subject: [Libav-user] How to speed-up vp8 video decoding. In-Reply-To: References: Message-ID: On Mon, May 28, 2012 at 10:40 AM, Alfredo Perez wrote: > Hi everyone, > > I'm new to this list so I want to say hello first of all and second > congratulate you for the excellent work you are doing. > > I am running version 0.8.11 "love" version of the ffmpeg library on my > application. The encoder works fine. It takes ~60 milliseconds to encode > each frame. The problem is that I could not compile the library for the > decoder with assembler enabled. Which toolchain are you using? > It takes more than 250 milliseconds to > decode each frame. I am using gop size 10, at 8 frames per second, > max_b_frames = 3. > > Do you know if there is any option on the codecContext for the decoder that > I can use to reduce the quality but increasing the speed? > > Thank you very much. > Alfredo. BR, Alex From avsn9849625263 at gmail.com Mon May 28 10:39:44 2012 From: avsn9849625263 at gmail.com (Murthy Avanithsa) Date: Mon, 28 May 2012 14:09:44 +0530 Subject: [Libav-user] join two mp4 videos In-Reply-To: References: Message-ID: On Mon, May 28, 2012 at 1:58 PM, Alex Cohn wrote: > On Mon, May 28, 2012 at 11:23 AM, Andrey Utkin > wrote: > > 2012/5/28 Murthy Avanithsa : > >> Thanks Mr.Andrey Utkin. > >> Can we avoid converting mp4 to raw(mpeg) by using api.If yes can you > please > >> suggest any quick steps. > > > > Surely yes. There are two cases for joining video: remuxing and > > reencoding. Remux method is not always applicable, it works when the > > characteristics of files is same. Also for remux method to work, mp4 > > files must be in Annex B format, it is quite fast to convert your > > source files to this mp4 flavour. > > -- > > Andrey Utkin > > I believe you can always employ the mp4toannexb filter. > > BR, > Alex Cohn > Thank you Mr Alex and Mr.Andrey Utkin I am new to libav api.I will try out few things based on your suggestion. Thanks for your support. > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > -- Regards, Murthy. -------------- next part -------------- An HTML attachment was scrubbed... URL: From alfredo at perseum.com Mon May 28 11:27:14 2012 From: alfredo at perseum.com (Alfredo Perez) Date: Mon, 28 May 2012 11:27:14 +0200 Subject: [Libav-user] How to speed-up vp8 video decoding. In-Reply-To: References: Message-ID: iPhoneOS5.1.sdk On 28 May 2012 10:31, Alex Cohn wrote: > On Mon, May 28, 2012 at 10:40 AM, Alfredo Perez > wrote: > > Hi everyone, > > > > I'm new to this list so I want to say hello first of all and second > > congratulate you for the excellent work you are doing. > > > > I am running version 0.8.11 "love" version of the ffmpeg library on my > > application. The encoder works fine. It takes ~60 milliseconds to encode > > each frame. The problem is that I could not compile the library for the > > decoder with assembler enabled. > > Which toolchain are you using? > > > It takes more than 250 milliseconds to > > decode each frame. I am using gop size 10, at 8 frames per second, > > max_b_frames = 3. > > > > Do you know if there is any option on the codecContext for the decoder > that > > I can use to reduce the quality but increasing the speed? > > > > Thank you very much. > > Alfredo. > > BR, > Alex > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > -------------- next part -------------- An HTML attachment was scrubbed... URL: From alexcohn at netvision.net.il Mon May 28 12:31:10 2012 From: alexcohn at netvision.net.il (Alex Cohn) Date: Mon, 28 May 2012 13:31:10 +0300 Subject: [Libav-user] How to speed-up vp8 video decoding. In-Reply-To: References: Message-ID: On Mon, May 28, 2012 at 12:27 PM, Alfredo Perez wrote: iPhoneOS5.1.sdk > You can probably enable asm to ffmpeg: http://ffmpeg.org/pipermail/ffmpeg-devel/2012-January/119626.html On 28 May 2012 10:31, Alex Cohn wrote: > >> On Mon, May 28, 2012 at 10:40 AM, Alfredo Perez >> wrote: >> > Hi everyone, >> > >> > I'm new to this list so I want to say hello first of all and second >> > congratulate you for the excellent work you are doing. >> > >> > I am running version 0.8.11 "love" version of the ffmpeg library on my >> > application. The encoder works fine. It takes ~60 milliseconds to encode >> > each frame. The problem is that I could not compile the library for the >> > decoder with assembler enabled. >> >> Which toolchain are you using? >> >> > It takes more than 250 milliseconds to >> > decode each frame. I am using gop size 10, at 8 frames per second, >> > max_b_frames = 3. >> > >> > Do you know if there is any option on the codecContext for the decoder >> that >> > I can use to reduce the quality but increasing the speed? >> > >> > Thank you very much. >> > Alfredo. >> > BR, Alex -------------- next part -------------- An HTML attachment was scrubbed... URL: From koli at koli.sk Mon May 28 13:39:00 2012 From: koli at koli.sk (koli at koli.sk) Date: Mon, 28 May 2012 13:39:00 +0200 Subject: [Libav-user] Lossless encoding - red color sharpness defect Message-ID: Hi, I was trying to use ffmpeg for screen capture and come to this problem. I was using x264 for encoding with many different options, but the result was unsatisfactory. Problem is with red colored labels, which are really important in screen videos that should be captured. Here is series of sample PNG pictures http://tucniak.sk/ffmpeg/GrabedPictures.zip It is just simple desktop with running Thunderbird with one email selected as "Important" so it is red colored text in dark background. Simple encoding via command line ffmpeg -r 5 -i ./GrabedPictures/Pic%d.png -r 5 -vcodec libx264 TestX264.avi made this result http://tucniak.sk/ffmpeg/TestX264.avi Everything is pretty sharp, except the red text in Thunderbird. Then I used "lossless" option ffmpeg -r 5 -i ./GrabedPictures/Pic%d.png -vcodec libx264 -x264opts qp=0 TestLosslessX264.avi Everything is almost the same, except the file size (almost twice), but the red text still remains fuzzy We have developed a simple grabber using ffmpeg library, where we used hardcoded YUV444 colorspace and with that we made this video with similar screen. http://tucniak.sk/ffmpeg/OwnGrabX264_YUV444.avi and the problem still remains. I don't know how much "LOSSLESS" is the qp=0 option but it seems that it is not enough to produce the same output as input. Can anybody give some hint for options that could be used to make it REAL LOSSLESS. For testing purpose I tried also "ffv1" and "huff" codec. I am not posting the result videos because of the size, but you can do it yourself by downloading GrabedPictures.zip and comands ffmpeg -r 5 -i ./GrabedPictures/Pic%d.png -r 5 -vcodec huffyuv OutHuff.avi ffmpeg -r 5 -i ./GrabedPictures/Pic%d.png -r 5 -vcodec ffv1 -sameq TestFfv1.avi But these are not a good solution. -Huff produced 270MB video from 50MB of PNG, and maybe I am doing somethig wrong but direct playing PNGs as frames would be more efficient. -Ffv1 produced 22MB video which is some kind better but it is still too much in comparison with 0,3MB for standard X264 and 0,6MB for "lossless" X264. What is more interesting when I was trying to play huff or ffv1 video with mplayer or ffplay the red text was still fuzzy. So I thought that even these codecs are not real lossless. Then by accident I played these videos with vlc player and with this the red text was sharp. So the problem was not encoding but decoding. It seems that ffmpeg has not correct decoding of "lossless" video codecs. Then I tried to play my "lossless" videos (TestLosslessX264.avi, OwnGrabX264_YUV444.avi) with vlc hoping that the problem is just in decoding. But again I was not successful. The first one shows only first frame in vlc, and the second one only black screen. Any hints or tips how to make "lossless" video with sharp red labels are welcome Best regards Juraj Kolesar From alfredo at perseum.com Mon May 28 14:08:14 2012 From: alfredo at perseum.com (Alfredo Perez) Date: Mon, 28 May 2012 14:08:14 +0200 Subject: [Libav-user] How to speed-up vp8 video decoding. In-Reply-To: References: Message-ID: Thanks a lot :) So... compiling ffmpeg with assembler support is my only hope, isnt it? thanks again. On 28 May 2012 12:31, Alex Cohn wrote: > On Mon, May 28, 2012 at 12:27 PM, Alfredo Perez wrote: > > iPhoneOS5.1.sdk >> > > You can probably enable asm to ffmpeg: > http://ffmpeg.org/pipermail/ffmpeg-devel/2012-January/119626.html > > On 28 May 2012 10:31, Alex Cohn wrote: >> >>> On Mon, May 28, 2012 at 10:40 AM, Alfredo Perez >>> wrote: >>> > Hi everyone, >>> > >>> > I'm new to this list so I want to say hello first of all and second >>> > congratulate you for the excellent work you are doing. >>> > >>> > I am running version 0.8.11 "love" version of the ffmpeg library on my >>> > application. The encoder works fine. It takes ~60 milliseconds to >>> encode >>> > each frame. The problem is that I could not compile the library for the >>> > decoder with assembler enabled. >>> >>> Which toolchain are you using? >>> >>> > It takes more than 250 milliseconds to >>> > decode each frame. I am using gop size 10, at 8 frames per second, >>> > max_b_frames = 3. >>> > >>> > Do you know if there is any option on the codecContext for the decoder >>> that >>> > I can use to reduce the quality but increasing the speed? >>> > >>> > Thank you very much. >>> > Alfredo. >>> >> > BR, > Alex > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From cehoyos at ag.or.at Mon May 28 14:45:49 2012 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Mon, 28 May 2012 12:45:49 +0000 (UTC) Subject: [Libav-user] Lossless encoding - red color sharpness defect References: Message-ID: writes: > I was trying to use ffmpeg for screen capture and come to > this problem. (Note that ffmpeg natively supports screen capture input, no need to use png's.) [...] > ffmpeg -r 5 -i ./GrabedPictures/Pic%d.png -r 5 -vcodec libx264 > TestX264.avi Complete, uncut console output missing. Your resulting file has colourspace yuv420p, that means it cannot look better / store all colour information;-) Either you are using an ancient or broken version of FFmpeg, or your version of x264 only supports yuv420p (current x264 also supports yuv444p which does not loose chroma information, current FFmpeg with current x264 automatically chooses yuv444p). [...] > ffmpeg -r 5 -i ./GrabedPictures/Pic%d.png -r 5 -vcodec huffyuv > OutHuff.avi > ffmpeg -r 5 -i ./GrabedPictures/Pic%d.png -r 5 -vcodec ffv1 > -sameq TestFfv1.avi -sameq does not do what you believe and it has no effect in this command line (ffv1 is always lossless). [...] > What is more interesting when I was trying to play huff or ffv1 > video with mplayer or ffplay the red text was still fuzzy. (Complete, uncut MPlayer console output missing.) ffplay only supports yuv420p output and you started mplayer with the wrong -vo, try -vo gl which supports yuv444p output. > It seems that ffmpeg has not > correct decoding of "lossless" video codecs. Please understand that this is not a very useful comment, the lossless codecs are tested quite extensibly (which does not mean they cannot have bugs, but they should be reported differently). Carl Eugen From alexcohn at netvision.net.il Mon May 28 15:04:49 2012 From: alexcohn at netvision.net.il (Alex Cohn) Date: Mon, 28 May 2012 16:04:49 +0300 Subject: [Libav-user] How to speed-up vp8 video decoding. In-Reply-To: References: Message-ID: On Mon, May 28, 2012 at 3:08 PM, Alfredo Perez wrote: > Thanks a lot :) > > So... compiling ffmpeg with assembler support is my only hope, isnt it? > > thanks again. > I would say, it's your best option, and the result is worth the effort. We've been able to encode and decode vp8 at 20 FPS 352x288 on iPhone 4. This involves the code from Google, without ffmpeg wrapper, but I don't think this overhead is very high. BR, Alex Cohn > On 28 May 2012 12:31, Alex Cohn wrote: > >> On Mon, May 28, 2012 at 12:27 PM, Alfredo Perez wrote: >> >> iPhoneOS5.1.sdk >>> >> >> You can probably enable asm to ffmpeg: >> http://ffmpeg.org/pipermail/ffmpeg-devel/2012-January/119626.html >> >> On 28 May 2012 10:31, Alex Cohn wrote: >>> >>>> On Mon, May 28, 2012 at 10:40 AM, Alfredo Perez >>>> wrote: >>>> > Hi everyone, >>>> > >>>> > I'm new to this list so I want to say hello first of all and second >>>> > congratulate you for the excellent work you are doing. >>>> > >>>> > I am running version 0.8.11 "love" version of the ffmpeg library on my >>>> > application. The encoder works fine. It takes ~60 milliseconds to >>>> encode >>>> > each frame. The problem is that I could not compile the library for >>>> the >>>> > decoder with assembler enabled. >>>> >>>> Which toolchain are you using? >>>> >>>> > It takes more than 250 milliseconds to >>>> > decode each frame. I am using gop size 10, at 8 frames per second, >>>> > max_b_frames = 3. >>>> > >>>> > Do you know if there is any option on the codecContext for the >>>> decoder that >>>> > I can use to reduce the quality but increasing the speed? >>>> > >>>> > Thank you very much. >>>> > Alfredo. >>>> >>> >> BR, >> Alex >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From koli at koli.sk Mon May 28 15:39:56 2012 From: koli at koli.sk (koli at koli.sk) Date: Mon, 28 May 2012 15:39:56 +0200 Subject: [Libav-user] Lossless encoding - red color sharpness defect In-Reply-To: References: Message-ID: <2c62b92b091c8d010ca93d09b145f78f@koli.sk> On 28.05.2012 14:45, Carl Eugen Hoyos wrote: > writes: > >> I was trying to use ffmpeg for screen capture and come to >> this problem. > > (Note that ffmpeg natively supports screen capture input, > no need to use png's.) I know, but the PNG images was meant as kind of etalon. If someone can download those pictures and with some command (option), create a H264 encoded video with sharp red colored text that is possible to play via ffplay, mplayer (ffmpeg). I don't know a way how to share my desktop for everybody anytime someone wants to play with it. ;-). > > [...] > >> ffmpeg -r 5 -i ./GrabedPictures/Pic%d.png -r 5 -vcodec libx264 >> TestX264.avi > > Complete, uncut console output missing. > Your resulting file has colourspace yuv420p, that means it cannot > look better / store all colour information;-) > Either you are using an ancient or broken version of FFmpeg, or > your version of x264 only supports yuv420p (current x264 also > supports yuv444p which does not loose chroma information, > current FFmpeg with current x264 automatically chooses yuv444p). I am not suffering with color degradation. It is ok and acceptable. You can see the green or red color of the text console in the video is fade in comparison with original PNG images, but it is OK. Problem is the sharpness of red text. Why is all other text nice sharp, but the red is fuzzy? Anyway what kind of option (switch.value) and how should I use when I want to encode in yuv444 and not the default yuv420. I was trying something like ffmpeg -r 5 -i ./GrabedPictures/Pic%d.png -vf format=yuv444p -vcodec libx264 -x264opts qp=0 TestLL_X264_yuv444.avi Here is wanted console output: ffmpeg version 0.10 Copyright (c) 2000-2012 the FFmpeg developers built on Mar 2 2012 10:02:15 with gcc 4.5.3 configuration: --prefix=/usr --libdir=/usr/lib64 --shlibdir=/usr/lib64 --mandir=/usr/share/man --enable-shared --cc=x86_64-pc-linux-gnu-gcc --cxx=x86_64-pc-linux-gnu-g++ --ar=x86_64-pc-linux-gnu-ar --optflags='-O2 -pipe' --extra-cflags='-O2 -pipe' --extra-cxxflags='-O2 -pipe' --disable-static --enable-gpl --enable-postproc --enable-avfilter --disable-stripping --disable-debug --disable-vaapi --enable-runtime-cpudetect --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --disable-indev=v4l --disable-indev=v4l2 --disable-indev=oss --enable-x11grab --disable-outdev=oss --enable-libfreetype --enable-pthreads --enable-libdirac --enable-libschroedinger --enable-libspeex --disable-altivec --disable-avx --disable-vis --disable-neon --disable-iwmmxt --enable-hardcoded-tables libavutil 51. 34.101 / 51. 34.101 libavcodec 53. 60.100 / 53. 60.100 libavformat 53. 31.100 / 53. 31.100 libavdevice 53. 4.100 / 53. 4.100 libavfilter 2. 60.100 / 2. 60.100 libswscale 2. 1.100 / 2. 1.100 libswresample 0. 6.100 / 0. 6.100 libpostproc 52. 0.100 / 52. 0.100 Input #0, image2, from './GrabedPictures/Pic%d.png': Duration: 00:00:20.00, start: 0.000000, bitrate: N/A Stream #0:0: Video: png, rgba, 1680x1050, 5 fps, 5 tbr, 5 tbn, 5 tbc File 'TestLL_X264_yuv444.avi' already exists. Overwrite ? [y/N] y Incompatible pixel format 'rgba' for codec 'libx264', auto-selecting format 'yuv420p' [buffer @ 0x2470810] w:1680 h:1050 pixfmt:rgba tb:1/1000000 sar:0/1 sws_param: [buffersink @ 0x2468600] auto-inserting filter 'auto-inserted scale 0' between the filter 'Parsed_format_0' and the filter 'out' [format @ 0x2478d70] auto-inserting filter 'auto-inserted scale 1' between the filter 'src' and the filter 'Parsed_format_0' [scale @ 0x247a1b0] w:1680 h:1050 fmt:rgba -> w:1680 h:1050 fmt:yuv444p flags:0x4 [scale @ 0x2479a70] w:1680 h:1050 fmt:yuv444p -> w:1680 h:1050 fmt:yuv420p flags:0x4 [libx264 @ 0x246f990] using cpu capabilities: MMX2 SSE2Fast SSSE3 Cache64 [libx264 @ 0x246f990] profile High 4:4:4 Predictive, level 4.0, 4:2:0 8-bit Output #0, avi, to 'TestLL_X264_yuv444.avi': Metadata: ISFT : Lavf53.31.100 Stream #0:0: Video: h264 (H264 / 0x34363248), yuv420p, 1680x1050, q=-1--1, 5 tbn, 5 tbc Stream mapping: Stream #0:0 -> #0:0 (png -> libx264) Press [q] to stop, [?] for help frame= 100 fps= 12 q=-1.0 Lsize= 616kB time=00:00:19.60 bitrate= 257.4kbits/s video:608kB audio:0kB global headers:0kB muxing overhead 1.305962% [libx264 @ 0x246f990] frame I:1 Avg QP: 0.00 size:152460 [libx264 @ 0x246f990] frame P:99 Avg QP: 0.00 size: 4747 [libx264 @ 0x246f990] mb I I16..4: 76.6% 5.3% 18.1% [libx264 @ 0x246f990] mb P I16..4: 2.1% 0.1% 0.4% P16..4: 0.6% 0.1% 0.0% 0.0% 0.0% skip:96.7% [libx264 @ 0x246f990] 8x8 transform intra:3.0% inter:19.2% [libx264 @ 0x246f990] coded y,uvDC,uvAC intra: 20.4% 16.3% 16.3% inter: 0.1% 0.4% 0.4% [libx264 @ 0x246f990] i16 v,h,dc,p: 78% 21% 0% 0% [libx264 @ 0x246f990] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 46% 49% 3% 1% 0% 0% 0% 1% 0% [libx264 @ 0x246f990] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 42% 42% 6% 3% 2% 1% 1% 2% 1% [libx264 @ 0x246f990] i8c dc,h,v,p: 81% 12% 8% 0% [libx264 @ 0x246f990] Weighted P-Frames: Y:0.0% UV:0.0% [libx264 @ 0x246f990] ref P L0: 70.1% 0.9% 18.8% 10.2% [libx264 @ 0x246f990] kb/s:248.98 But as you can see the output was still using yuv420. That's why we coded our own ffmpeg grabber(compressor) and hardcoded there this yuv444 as you can see in this video (e.g. try mediainfo) http://tucniak.sk/ffmpeg/OwnGrabX264_YUV444.avi > > [...] > >> ffmpeg -r 5 -i ./GrabedPictures/Pic%d.png -r 5 -vcodec huffyuv >> OutHuff.avi >> ffmpeg -r 5 -i ./GrabedPictures/Pic%d.png -r 5 -vcodec ffv1 >> -sameq TestFfv1.avi > > -sameq does not do what you believe and it has no effect in this > command line (ffv1 is always lossless). > I didn't studied options for these codecs in detail just copied it somewhere from the web, anyway the outcome is the same. > [...] > >> What is more interesting when I was trying to play huff or ffv1 >> video with mplayer or ffplay the red text was still fuzzy. > > (Complete, uncut MPlayer console output missing.) > ffplay only supports yuv420p output and you started mplayer > with the wrong -vo, try -vo gl which supports yuv444p output. OK this helped. With this option mplayer plays it sharp. > >> It seems that ffmpeg has not >> correct decoding of "lossless" video codecs. > > Please understand that this is not a very useful comment, > the lossless codecs are tested quite extensibly (which does > not mean they cannot have bugs, but they should be > reported differently). Maybe "not correct" was not the right description. Now I see that ffplay does not support it and mplayer does with right option. So outcome from this is that ffmpeg as library is ok for decoding lossless yuv444 video. > > Carl Eugen > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user From cehoyos at ag.or.at Mon May 28 16:07:49 2012 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Mon, 28 May 2012 14:07:49 +0000 (UTC) Subject: [Libav-user] Lossless encoding - red color sharpness defect References: <2c62b92b091c8d010ca93d09b145f78f@koli.sk> Message-ID: writes: > > (Note that ffmpeg natively supports screen capture input, > > no need to use png's.) > > I know, but the PNG images was meant as kind of etalon. If someone can > download those pictures and with some command (option), create a H264 > encoded video with sharp red colored text that is possible to play via > ffplay, mplayer (ffmpeg). I don't know a way how to share my desktop for > everybody anytime someone wants to play with it. . You are right and thank you for clarifying it (it it true that unreproducible problems often cannot be fixed), but in your case, complete, uncut console output would have been sufficient (and is needed for every report on this list). > I am not suffering with color degradation. Yes, you are, this is what you reported and it is not a known "problem", but a known limitation of the usual (in the sense of "MPEG usual") way of storing pixel information. > Anyway what kind of option (switch.value) and how should I use when I > want to encode in yuv444 and not the default yuv420. You need to recompile x264 with support for yuv444p encoding. (I may absolutely be wrong with this recommendation: Try ffmpeg -i input.png -pix_fmt yuv444p -vcodec libx264 out.mov to know for sure.) Carl Eugen From koli at koli.sk Mon May 28 16:23:51 2012 From: koli at koli.sk (koli at koli.sk) Date: Mon, 28 May 2012 16:23:51 +0200 Subject: [Libav-user] Lossless encoding - red color sharpness defect In-Reply-To: References: <2c62b92b091c8d010ca93d09b145f78f@koli.sk> Message-ID: <6edb770bc9a1805aba3a7e03301a8ed2@koli.sk> On 28.05.2012 16:07, Carl Eugen Hoyos wrote: > writes: > >> > (Note that ffmpeg natively supports screen capture input, >> > no need to use png's.) >> >> I know, but the PNG images was meant as kind of etalon. If someone >> can >> download those pictures and with some command (option), create a >> H264 >> encoded video with sharp red colored text that is possible to play >> via >> ffplay, mplayer (ffmpeg). I don't know a way how to share my desktop >> for >> everybody anytime someone wants to play with it. . > Ok next time I won't forget. > You are right and thank you for clarifying it (it it true that > unreproducible problems often cannot be fixed), but in your > case, complete, uncut console output would have been sufficient > (and is needed for every report on this list). > >> I am not suffering with color degradation. > > Yes, you are, this is what you reported and it is not a known > "problem", but a known limitation of the usual (in the sense > of "MPEG usual") way of storing pixel information. > Ok you are right. >> Anyway what kind of option (switch.value) and how should I use when >> I >> want to encode in yuv444 and not the default yuv420. > > You need to recompile x264 with support for yuv444p encoding. > (I may absolutely be wrong with this recommendation: > Try ffmpeg -i input.png -pix_fmt yuv444p -vcodec libx264 out.mov > to know for sure.) Perfect. Recompile was not needed, -pic_fmt option solved it and it is nice sharp and has only 0,7MB :-D Thanks for help > > Carl Eugen > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user From cehoyos at ag.or.at Mon May 28 16:38:02 2012 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Mon, 28 May 2012 14:38:02 +0000 (UTC) Subject: [Libav-user] Ts re-mux to MKV problem References: Message-ID: ?? writes: > 2, The duration of MKV was always wrong, it is very large > (like 911 mins, actually my ts stream was only 6s ...) Please provide FFmpeg command line together with complete, uncut console output. Carl Eugen From alfredo at perseum.com Mon May 28 17:50:57 2012 From: alfredo at perseum.com (Alfredo Perez) Date: Mon, 28 May 2012 17:50:57 +0200 Subject: [Libav-user] How to speed-up vp8 video decoding. In-Reply-To: References: Message-ID: My main target is iPad 1. The resolution Im working with is 1024x768. Maybe thats the problem. Appart from the assembler issue do you think it would be important to reduce the screen resolution?. Regards. And thanks again for all your help. On 28 May 2012 15:04, Alex Cohn wrote: > On Mon, May 28, 2012 at 3:08 PM, Alfredo Perez wrote: > >> Thanks a lot :) >> >> So... compiling ffmpeg with assembler support is my only hope, isnt it? >> >> thanks again. >> > > I would say, it's your best option, and the result is worth the effort. > We've been able to encode and decode vp8 at 20 FPS 352x288 on iPhone 4. > > This involves the code from Google, without ffmpeg wrapper, but I don't > think this overhead is very high. > > BR, > Alex Cohn > > >> On 28 May 2012 12:31, Alex Cohn wrote: >> >>> On Mon, May 28, 2012 at 12:27 PM, Alfredo Perez wrote: >>> >>> iPhoneOS5.1.sdk >>>> >>> >>> You can probably enable asm to ffmpeg: >>> http://ffmpeg.org/pipermail/ffmpeg-devel/2012-January/119626.html >>> >>> On 28 May 2012 10:31, Alex Cohn wrote: >>>> >>>>> On Mon, May 28, 2012 at 10:40 AM, Alfredo Perez >>>>> wrote: >>>>> > Hi everyone, >>>>> > >>>>> > I'm new to this list so I want to say hello first of all and second >>>>> > congratulate you for the excellent work you are doing. >>>>> > >>>>> > I am running version 0.8.11 "love" version of the ffmpeg library on >>>>> my >>>>> > application. The encoder works fine. It takes ~60 milliseconds to >>>>> encode >>>>> > each frame. The problem is that I could not compile the library for >>>>> the >>>>> > decoder with assembler enabled. >>>>> >>>>> Which toolchain are you using? >>>>> >>>>> > It takes more than 250 milliseconds to >>>>> > decode each frame. I am using gop size 10, at 8 frames per second, >>>>> > max_b_frames = 3. >>>>> > >>>>> > Do you know if there is any option on the codecContext for the >>>>> decoder that >>>>> > I can use to reduce the quality but increasing the speed? >>>>> > >>>>> > Thank you very much. >>>>> > Alfredo. >>>>> >>>> >>> BR, >>> Alex >>> >> > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From alexcohn at netvision.net.il Mon May 28 17:56:17 2012 From: alexcohn at netvision.net.il (Alex Cohn) Date: Mon, 28 May 2012 18:56:17 +0300 Subject: [Libav-user] How to speed-up vp8 video decoding. In-Reply-To: References: Message-ID: On Mon, May 28, 2012 at 6:50 PM, Alfredo Perez wrote: > My main target is iPad 1. > > The resolution Im working with is 1024x768. Maybe thats the problem. > Appart from the assembler issue do you think it would be important to > reduce the screen resolution?. > > Regards. And thanks again for all your help. > I am afraid iPad 1 is too slow to decode full video res with vp8. You may consider the hardware h264 codec instead. BR, Alex Cohn -------------- next part -------------- An HTML attachment was scrubbed... URL: From christian.bruemmer at gmx.de Mon May 28 19:21:56 2012 From: christian.bruemmer at gmx.de (=?ISO-8859-15?Q?Christian_Br=FCmmer?=) Date: Mon, 28 May 2012 19:21:56 +0200 Subject: [Libav-user] Getting SPS and PPS-information from x264 encoding Message-ID: <4FC3B434.5000607@gmx.de> Hi, i encode video frames using a default codec configuration via avcodec_get_context_defaults3(). That video frames are further used for rtsp streaming based on live555. For compatibility i need the SPS and PPS-informations for the rtsp server but i didnt know them (cause default configurations i cant access). How can i get that infos out of a AVCodecContext after setting to default values (c-code)? Best regards and thanks for reading, Christian From mbradshaw at sorensonmedia.com Mon May 28 20:53:09 2012 From: mbradshaw at sorensonmedia.com (Michael Bradshaw) Date: Mon, 28 May 2012 12:53:09 -0600 Subject: [Libav-user] Asking for using FFMPEG in trade software In-Reply-To: <1338043430.5947.YahooMailNeo@web190402.mail.sg3.yahoo.com> References: <1338043430.5947.YahooMailNeo@web190402.mail.sg3.yahoo.com> Message-ID: As long as you comply with the LGPL, you can sell your program. See the License page on ffmpeg.org for more information. You should be aware, however, that depending on how you configure ffmpeg, you may have to use the GPL. Be sure to not --enable-gpl when configuring ffmpeg. Also be aware that some codecs may be patented, and if you use those codecs you may have to obtain a license from the patent holder (which is not ffmpeg). You should consult a technical lawyer if you plan on commercially releasing a program, though, to try and be safe. I'm not a lawyer and can't say what is and isn't patented. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mbradshaw at sorensonmedia.com Mon May 28 22:05:56 2012 From: mbradshaw at sorensonmedia.com (Michael Bradshaw) Date: Mon, 28 May 2012 14:05:56 -0600 Subject: [Libav-user] Why is HTTP streaming so slow? In-Reply-To: <4FBFD3F3.5080606@gmail.com> References: <4FBFD3F3.5080606@gmail.com> Message-ID: On Fri, May 25, 2012 at 12:48 PM, Camera Man wrote: > On 05/24/2012 03:07 PM, Michael Bradshaw wrote: > > Is there a particular reason FFmpeg streams so slowly? > > > Speculation: Sounds like it might be a buffering problem: The easy way to > test it is to time transfers from a nearby machine (localhost or anything > with <1ms ping time), vs the internet. If? things become disproportionally > faster (e.g., chrome goes *3 from 4MB/sec to 12MB/sec but ffmpeg goes *50 > from 80KB/sec to 4MB/sec), then this is your problem. > > Browsers (and wget and curl and friends) set the socket buffers to a few > megabytes. IIRC, ffmpeg leaves tcp connections at the 8KB default. Which > means, after 8K-16K have been received and not yet processed (which takes > all of ~5ms in your case), the local kernel tells the remote one "my buffer > is full, stop sending", and only when this has been processed, it will tell > the other side "ok, you can resume". Because of how TCP works, this is > synchronous and inserts delays that depend on the ping time to the server. > > AFAIK, there's no way to set the http/tcp buffer size in ffmpeg; (udp > connections have the ?buffer_size=xxxx option, but tcp doesn't) Great, thanks for that input. I'll check the transfer speeds going through localhost when I get the chance tomorrow. I wouldn't be surprised if that's it, and I hope it is because it sounds decently patchable. Thanks, Michael From ratin3 at gmail.com Tue May 29 07:01:51 2012 From: ratin3 at gmail.com (Ratin) Date: Mon, 28 May 2012 22:01:51 -0700 Subject: [Libav-user] How to cleanup libavcodec buffers when release is called during decode? In-Reply-To: References: Message-ID: On Sat, May 26, 2012 at 1:03 PM, Carl Eugen Hoyos wrote: > Ratin writes: > >> Hi, ?for h.264 decode with hardware like Nvidia's VDPAU decoding, what >> should I do to cleanup the resources when avcodec_release callback is >> called? > >> It seems that there are are some memory leaks when running >> decode for long period of time. > > I am only guessing since you did not provide any valgrind output, > but did you see the comment for vdpau_render_state.bitstream_buffers? > Also see MPlayer r29793 > > Carl Eugen Hi Carl, According to valgrind there is no leak, the leak seems to be kernel memory leak (SUnreclaim in /proc/meminfo grows incrementally). Also mplayer is kind of hard to follow for me, since the release happens elsewhere, not very straight forward. I am doing the following in release: av_freep(&rndState->bitstream_buffers); rndState->bitstream_buffers_allocated=0; for(i=0; i<4; i++){ pic->data[i]= NULL; I allocate the video surfaces in the beginning and keep reusing them. So there is not surface release while packets are being decoded. I am kind of clueless whats causing this kernel memory leak. Thanks Ratin From christian.bruemmer at gmx.de Tue May 29 14:00:33 2012 From: christian.bruemmer at gmx.de (=?ISO-8859-1?Q?Christian_Br=FCmmer?=) Date: Tue, 29 May 2012 14:00:33 +0200 Subject: [Libav-user] Getting SPS and PPS-information from x264 encoding In-Reply-To: <4FC3B434.5000607@gmx.de> References: <4FC3B434.5000607@gmx.de> Message-ID: <4FC4BA61.90302@gmx.de> Am 28.05.2012 19:21, schrieb Christian Br?mmer: > Hi, > > i encode video frames using a default codec configuration via > avcodec_get_context_defaults3(). That video frames are further used > for rtsp streaming based on live555. For compatibility i need the SPS > and PPS-informations for the rtsp server but i didnt know them (cause > default configurations i cant access). > > How can i get that infos out of a AVCodecContext after setting to > default values (c-code)? > > Best regards and thanks for reading, > Christian > > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > I figured out that those informations typically found in SDP-descriptions. So i tried av_sdp_create which works so far but it has no sprop-parameter-sets :/. Cant be that hard - or? From christian.bruemmer at gmx.de Tue May 29 15:26:12 2012 From: christian.bruemmer at gmx.de (=?ISO-8859-1?Q?Christian_Br=FCmmer?=) Date: Tue, 29 May 2012 15:26:12 +0200 Subject: [Libav-user] Getting SPS and PPS-information from x264 encoding In-Reply-To: <4FC4BA61.90302@gmx.de> References: <4FC3B434.5000607@gmx.de> <4FC4BA61.90302@gmx.de> Message-ID: <4FC4CE74.3030403@gmx.de> Am 29.05.2012 14:00, schrieb Christian Br?mmer: > Am 28.05.2012 19:21, schrieb Christian Br?mmer: >> Hi, >> >> i encode video frames using a default codec configuration via >> avcodec_get_context_defaults3(). That video frames are further used >> for rtsp streaming based on live555. For compatibility i need the SPS >> and PPS-informations for the rtsp server but i didnt know them (cause >> default configurations i cant access). >> >> How can i get that infos out of a AVCodecContext after setting to >> default values (c-code)? >> >> Best regards and thanks for reading, >> Christian >> >> >> _______________________________________________ >> Libav-user mailing list >> Libav-user at ffmpeg.org >> http://ffmpeg.org/mailman/listinfo/libav-user >> > > I figured out that those informations typically found in > SDP-descriptions. So i tried av_sdp_create which works so far but it > has no sprop-parameter-sets :/. > > Cant be that hard - or? > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > "Cant be that hard - or? " Okay now im pretty sure it is: I read AVCodecContex.extradata contains the informations i need. For decoding i used that code -> http://cgit.lscube.org/cgit.cgi/feng/tree/src/media/parser/h264.c#n218 - in a slightly modified way (replaced glib functions with e.g. libavs base64.h). Finally the decoding stuff is running - BUT... my AVCodecContext.extradata_size == 0 <- what the heck?!? So no data for decoding and really no idea left how to get those informations.... WHAA! I make desperate efforts but i cant get into that... At least i need another hint. Im not asking for complete solution - its enough to know roughly the right way! From thom1948 at gmail.com Tue May 29 19:47:00 2012 From: thom1948 at gmail.com (Thomas H) Date: Tue, 29 May 2012 13:47:00 -0400 Subject: [Libav-user] Convert MP4 1280x720 to MPG 1280x720 Message-ID: ffmpeg -i MyKitty.mp4 -vf scale=1280:720 -idct h264 -sameq -target ntsc-dvd MyKitty.mpg Input file: Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x720, 944 kb/s, 30 fps, 30 tbr, 60 tbn, 60 tbc Output file: Stream #0:0(und): Video: mpeg2video, yuv420p, 1280x720, q=2-31, 6000 kb/s, 90k tbn, 29.97 tbc Output is not of the same quality. I have a suspect it has something to do with the Video, but do not know how to correct this. I have been working on this for about a week and can not figure it out. Regards Thomas From cehoyos at ag.or.at Tue May 29 21:48:48 2012 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Tue, 29 May 2012 19:48:48 +0000 (UTC) Subject: [Libav-user] Convert MP4 1280x720 to MPG 1280x720 References: Message-ID: Thomas H writes: > ffmpeg -i MyKitty.mp4 -vf scale=1280:720 -idct h264 -sameq -target > ntsc-dvd MyKitty.mpg (Complete, uncut console output missing.) Are you sure you want to produce a "HD" "DVD"? Please explain what "-idct h264" does, I am curious. And please note that -sameq does not mean "same quality". (Especially not for h264 -> mpeg1 conversion.) Carl Eugen From thom1948 at gmail.com Tue May 29 23:04:21 2012 From: thom1948 at gmail.com (Thomas H) Date: Tue, 29 May 2012 17:04:21 -0400 Subject: [Libav-user] Convert MP4 1280x720 to MPG 1280x720 In-Reply-To: References: Message-ID: Hello Carl. Not sure. Tried everything in the Docs and FAQ. I searched everywhere and found it on a forum. When I run: ffmpeg -i MyKitty.mp4 -vf scale=1280:720 -idct h264 -sameq -target ntsc-dvd MyKitty.mpg The ouput file reports 1280x720 however compared to the original viewed with VLC, the mpg file looks pixilated. Regards Thomas ********************************************************************************************************************************************************* C:\Users\Thomas\Documents\Blender\cgboorman>ffmpeg -i MyKitty.mp4 -vf scale=1280:720 -idct h264 -sameq -target ntsc-dvd MyKitty.mpg ffmpeg version N-40824-g31dfe20 Copyright (c) 2000-2012 the FFmpeg developers built on May 19 2012 00:45:59 with gcc 4.6.3 configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-runtime-cpudetect --enable-avisynth --enab le-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-libschro edinger --enable-libspeex --enable-libtheora --enable-libutvideo --enable-libvo-aacenc --enable-libvo-amrwbenc --enable- libvorbis --enable-libvpx --enable-libx264 --enable-libxavs --enable-libxvid --enable-zlib libavutil 51. 53.100 / 51. 53.100 libavcodec 54. 21.101 / 54. 21.101 libavformat 54. 5.100 / 54. 5.100 libavdevice 53. 4.100 / 53. 4.100 libavfilter 2. 74.101 / 2. 74.101 libswscale 2. 1.100 / 2. 1.100 libswresample 0. 12.100 / 0. 12.100 libpostproc 52. 0.100 / 52. 0.100 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'MyKitty.mp4': Metadata: major_brand : mp42 minor_version : 0 compatible_brands: isommp42 creation_time : 2011-11-05 01:52:31 Duration: 00:07:17.10, start: 0.000000, bitrate: 1086 kb/s Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x720, 944 kb/s, 30 fps, 30 tbr, 60 tbn, 60 tb c Metadata: creation_time : 1970-01-01 00:00:00 handler_name : VideoHandler Stream #0:1(und): Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, s16, 139 kb/s Metadata: creation_time : 2011-11-05 01:52:32 handler_name : IsoMedia File Produced by Google, 5-11-2011 [buffer @ 0036d020] w:1280 h:720 pixfmt:yuv420p tb:1/1000000 sar:0/1 sws_param:flags=2 [buffersink @ 0036d060] No opaque field provided [scale @ 0036d0c0] w:1280 h:720 fmt:yuv420p sar:0/1 -> w:720 h:480 fmt:yuv420p sar:0/1 flags:0x4 [scale @ 0036d180] w:720 h:480 fmt:yuv420p sar:0/1 -> w:1280 h:720 fmt:yuv420p sar:0/1 flags:0x4 [abuffer @ 0036d3e0] format:s16 layout:stereo rate:44100 [aformat @ 0036d480] auto-inserting filter 'auto-inserted resampler 0' between the filter 'src' and the filter 'aformat' [aresample @ 0036d4e0] r:44100Hz -> r:48000Hz Output #0, dvd, to 'MyKitty.mpg': Metadata: major_brand : mp42 minor_version : 0 compatible_brands: isommp42 creation_time : 2011-11-05 01:52:31 encoder : Lavf54.5.100 Stream #0:0(und): Video: mpeg2video, yuv420p, 1280x720, q=2-31, 6000 kb/s, 90k tbn, 29.97 tbc Metadata: creation_time : 1970-01-01 00:00:00 handler_name : VideoHandler Stream #0:1(und): Audio: ac3, 48000 Hz, stereo, flt, 448 kb/s Metadata: creation_time : 2011-11-05 01:52:32 handler_name : IsoMedia File Produced by Google, 5-11-2011 Stream mapping: Stream #0:0 -> #0:0 (h264 -> mpeg2video) Stream #0:1 -> #0:1 (aac -> ac3) Press [q] to stop, [?] for help ********************************************************************************************************************************************************* On Tue, May 29, 2012 at 3:48 PM, Carl Eugen Hoyos wrote: > Thomas H writes: > >> ffmpeg -i MyKitty.mp4 -vf scale=1280:720 -idct h264 -sameq -target >> ntsc-dvd MyKitty.mpg > > (Complete, uncut console output missing.) > > Are you sure you want to produce a "HD" "DVD"? > Please explain what "-idct h264" does, I am curious. > > And please note that -sameq does not mean "same quality". > (Especially not for h264 -> mpeg1 conversion.) > > Carl Eugen > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user From mbradshaw at sorensonmedia.com Tue May 29 23:28:48 2012 From: mbradshaw at sorensonmedia.com (Michael Bradshaw) Date: Tue, 29 May 2012 15:28:48 -0600 Subject: [Libav-user] Convert MP4 1280x720 to MPG 1280x720 In-Reply-To: References: Message-ID: On Tue, May 29, 2012 at 3:04 PM, Thomas H wrote: > Hello Carl. > > Not sure. > Tried everything in the Docs and FAQ. > I searched everywhere and found it on a forum. > When I run: > ffmpeg -i MyKitty.mp4 -vf scale=1280:720 -idct h264 -sameq -target > ntsc-dvd MyKitty.mpg I'm curious about this. NTSC DVDs are 720x480, not 1280x720. You may want to look at this: http://en.wikipedia.org/wiki/DVD-Video#Frame_size_and_frame_rate What exactly is it that you are trying to accomplish? --Michael From thom1948 at gmail.com Wed May 30 02:29:43 2012 From: thom1948 at gmail.com (Thomas H) Date: Tue, 29 May 2012 20:29:43 -0400 Subject: [Libav-user] Convert MP4 1280x720 to MPG 1280x720 In-Reply-To: References: Message-ID: Hello Michael Thanks for the link. I have a DVD Burner program that only accepts avi, dvr_ms, mpg, mpeg, mpv, wmv, or asf files. I am trying to convert mp4 files to one of those. While I can convert to mpg, the mpg file is pixelated, less quality than the original when I compare them using VLC Media Player. Regards Thomas On Tue, May 29, 2012 at 5:28 PM, Michael Bradshaw wrote: > On Tue, May 29, 2012 at 3:04 PM, Thomas H wrote: >> Hello Carl. >> >> Not sure. >> Tried everything in the Docs and FAQ. >> I searched everywhere and found it on a forum. >> When I run: >> ffmpeg -i MyKitty.mp4 -vf scale=1280:720 -idct h264 -sameq -target >> ntsc-dvd MyKitty.mpg > > I'm curious about this. NTSC DVDs are 720x480, not 1280x720. You may > want to look at this: > http://en.wikipedia.org/wiki/DVD-Video#Frame_size_and_frame_rate > > What exactly is it that you are trying to accomplish? > > --Michael > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user From kalileo at universalx.net Wed May 30 04:07:50 2012 From: kalileo at universalx.net (Kalileo) Date: Wed, 30 May 2012 09:07:50 +0700 Subject: [Libav-user] Getting SPS and PPS-information from x264 encoding In-Reply-To: <4FC4CE74.3030403@gmx.de> References: <4FC3B434.5000607@gmx.de> <4FC4BA61.90302@gmx.de> <4FC4CE74.3030403@gmx.de> Message-ID: On May 29, 2012, at 20:26 , Christian Br?mmer wrote: > "Cant be that hard - or? " > > Okay now im pretty sure it is: > > I read AVCodecContex.extradata contains the informations i need. For decoding i used that code -> http://cgit.lscube.org/cgit.cgi/feng/tree/src/media/parser/h264.c#n218 - in a slightly modified way (replaced glib functions with e.g. libavs base64.h). Finally the decoding stuff is running - BUT... > > my AVCodecContext.extradata_size == 0 <- what the heck?!? So no data for decoding and really no idea left how to get those informations.... WHAA! > > I make desperate efforts but i cant get into that... > > At least i need another hint. Im not asking for complete solution - its enough to know roughly the right way! From what I think I understood extradata contains what you expect when your source is a video format with a global header. What's the source format you use for your tests? From arash.cordi at gmail.com Wed May 30 12:26:52 2012 From: arash.cordi at gmail.com (Arash Cordi) Date: Wed, 30 May 2012 14:56:52 +0430 Subject: [Libav-user] Working h264 codec configuration for current ffmpeg build In-Reply-To: <4FC09D65.4080608@gmx.de> References: <4FC09D65.4080608@gmx.de> Message-ID: I use these following extra setting for h264 encoding, where o_v_st is the ouput video stream I can send you a complete sample code if you need more information // for H264 o_v_st->codec->me_range = 16; o_v_st->codec->max_qdiff = 4; // lower value for higher quality range: 0-52 o_v_st->codec->qmin = 10; o_v_st->codec->qmax = 26; o_v_st->codec->qcompress = 0.6; On Sat, May 26, 2012 at 1:37 PM, Christian Br?mmer < christian.bruemmer at gmx.de> wrote: > Hi, > > i'm new to libav and video compression at all. What i tried so far is > reusing output-example.c or decoding-encoding.c slightly modyfied for > compiling on VS++2010 (win7) and to use it for x264 encoding. One of my > main problems are that i didnt find up-to-date x264 configurations (c: > hardcoded) working with current ffmpeg build. Most examples i found (around > 2010) using deprecated flags and functions for configuration and cause i > dont know what most of that flag does - so i can't replace them with > up-to-date right ones. > > Would be nice to get a example configuration which is working (c-code and > may without using ffmpeg-presets) so i can make sure that my problems > (crashes on avcodec_encode_video or av_interleaved_write_frame()) not > caused by bad codec configurations! > > By the way: my avcodec_encode_video returns 32 times "0" before really > writing a frame and returning a valid byte size - can this be a right > behaviour? > > Thanks for reading! > Regards, > Christian > > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > > -- ArasH -------------- next part -------------- An HTML attachment was scrubbed... URL: From christian.bruemmer at gmx.de Wed May 30 12:44:22 2012 From: christian.bruemmer at gmx.de (=?ISO-8859-1?Q?Christian_Br=FCmmer?=) Date: Wed, 30 May 2012 12:44:22 +0200 Subject: [Libav-user] Getting SPS and PPS-information from x264 encoding In-Reply-To: References: <4FC3B434.5000607@gmx.de> <4FC4BA61.90302@gmx.de> <4FC4CE74.3030403@gmx.de> Message-ID: <4FC5FA06.8000209@gmx.de> Am 30.05.2012 04:07, schrieb Kalileo: > On May 29, 2012, at 20:26 , Christian Br?mmer wrote: > >> "Cant be that hard - or?" >> >> Okay now im pretty sure it is: >> >> I read AVCodecContex.extradata contains the informations i need. For decoding i used that code -> http://cgit.lscube.org/cgit.cgi/feng/tree/src/media/parser/h264.c#n218 - in a slightly modified way (replaced glib functions with e.g. libavs base64.h). Finally the decoding stuff is running - BUT... >> >> my AVCodecContext.extradata_size == 0<- what the heck?!? So no data for decoding and really no idea left how to get those informations.... WHAA! >> >> I make desperate efforts but i cant get into that... >> >> At least i need another hint. Im not asking for complete solution - its enough to know roughly the right way! > > From what I think I understood extradata contains what you expect when your source is a video format with a global header. > > What's the source format you use for your tests? > > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > I create dummy images (should be replaced later on) and encoding them to x264 frames. Further i stream those images via rtsp which is working on VLC but not on android and i thinks its a stream configuration problem. When should extradata be filled? In my text a dont encode a frame before i try to get the sps pps infos out of extradata. I may have to call a special function or encode a frame or header before? So my source format is: codec = avcodec_find_encoder(c->codec_id); if(!codec) { std::cout << "Codec not found." << std::endl; std::cin.get();std::cin.get();exit(1); } *if(avcodec_get_context_defaults3 (c, codec) < 0) // cause i dont know a working x264 configuration without deprecated flags * { std::cout << "Cannot get default codec context! \n" << std::endl; std::cin.get(); exit(1); } and codec = stream->codec; codec->codec_id = codecID; codec->codec_type = AVMEDIA_TYPE_VIDEO; codec->bit_rate = mParameters.mBitRate; codec->width = mParameters.mWidth; codec->height = mParameters.mHeight; codec->time_base.den = mParameters.mFrameRate; codec->time_base.num = 1; codec->gop_size = mParameters.mFrameRate; codec->pix_fmt = PIXEL_FORMAT; codec->b_frame_strategy = 0; codec->level = 12; if(codec->codec_id == CODEC_ID_MPEG2VIDEO) codec->max_b_frames = 2; // for testing, B frames if(codec->codec_id == CODEC_ID_MPEG1VIDEO) codec->mb_decision = 2; if(context->oformat->flags & AVFMT_GLOBALHEADER) codec->flags |= CODEC_FLAG_GLOBAL_HEADER; where mParamters are: imLiveStreamParameters param; param.mBitRate = 4000; param.mCodec = "x264"; param.mFrameRate = 24; param.mHeight = 240; param.mWidth = 320; Thank you for your reply! -------------- next part -------------- An HTML attachment was scrubbed... URL: From thom1948 at gmail.com Wed May 30 15:47:14 2012 From: thom1948 at gmail.com (Thomas H) Date: Wed, 30 May 2012 09:47:14 -0400 Subject: [Libav-user] Convert MP4 1280x720 to MPG 1280x720 In-Reply-To: References: Message-ID: Hello Michael That did it. Eliminated "ntsc-dvd" and now it works fine. ffmpeg -i MyKitty.mp4 -vf scale=1280:720 -idct h264 -sameq MyKitty.mpg Thanks for your response. Regards Thomas On Tue, May 29, 2012 at 8:29 PM, Thomas H wrote: > Hello Michael > > Thanks for the link. > > I have a DVD Burner program that only accepts avi, dvr_ms, mpg, mpeg, > mpv, wmv, or asf files. I am trying to convert mp4 files to one of > those. > While I can convert to mpg, the mpg file is pixelated, less quality > than the original when I compare them using VLC Media Player. > > Regards > Thomas > > On Tue, May 29, 2012 at 5:28 PM, Michael Bradshaw > wrote: >> On Tue, May 29, 2012 at 3:04 PM, Thomas H wrote: >>> Hello Carl. >>> >>> Not sure. >>> Tried everything in the Docs and FAQ. >>> I searched everywhere and found it on a forum. >>> When I run: >>> ffmpeg -i MyKitty.mp4 -vf scale=1280:720 -idct h264 -sameq -target >>> ntsc-dvd MyKitty.mpg >> >> I'm curious about this. NTSC DVDs are 720x480, not 1280x720. You may >> want to look at this: >> http://en.wikipedia.org/wiki/DVD-Video#Frame_size_and_frame_rate >> >> What exactly is it that you are trying to accomplish? >> >> --Michael >> _______________________________________________ >> Libav-user mailing list >> Libav-user at ffmpeg.org >> http://ffmpeg.org/mailman/listinfo/libav-user From tim.bradstock at googlemail.com Wed May 30 20:15:44 2012 From: tim.bradstock at googlemail.com (Tim Bradstock) Date: Wed, 30 May 2012 19:15:44 +0100 Subject: [Libav-user] LGPL Compilation and 3GP Conversion Error Message-ID: Dear All, I've historically used a GPL compiled version of FFmpeg to convert to the 3GP format and it worked perfectly with the following command line: ffmpeg.exe -i sample1.flv -vcodec mpeg4 -acodec aac -strict experimental -ac 1 123.3gp However, in the last few weeks I've moved to a LGPL compilation for licensing reasons. The LGPL builds were produced by Zeraneo based on ffmpeg-20120511-git-9eb99ab-win32-shared-lgpl. However, now I cannot get the above command line to work and cannot convert to the 3GP format. I am passing '-strict experimental' and the FFmpeg DLL returns a code which suggests it has successfully accepted the parameter (it?s in opt_default function). But later, in the code it fails with the same error ? 'code is experimental'. I've also tried using the following command line but this also fails: ffmpeg.exe -i sample1.flv -vcodec mpeg4 -acodec libvo-aacenc -ac 1 123.3gp Can anyone help? Thanks. Tim -------------- next part -------------- An HTML attachment was scrubbed... URL: From arlhey.herrera at art.jovenclub.cu Wed May 30 21:30:54 2012 From: arlhey.herrera at art.jovenclub.cu (Ing. Arlhey Herrera Mendoza) Date: Wed, 30 May 2012 15:30:54 -0400 Subject: [Libav-user] Problem using Libav APi for converting video and audio Message-ID: <4FC6756E.1060104@art.jovenclub.cu> Hi ffmpeg geeks, I'm newbie using the Libav APi. I've use ffmpeg several times for converting video and audio files but rigt now I'm working on an APi with Qt and C++ which need to integrate libavcodec and libavformat for converting any video file to another format, mostly OGG(Vorbis/Theora) video. So the main problem I got is that I don't know how to do that. I've seen a lot of examples even the ffmpeg.c source file but realy doesn't work for me. Maybe I miss understood or maybe 'cause the examples are outdated and most of the functions are deprecated. The function gets and input video file and must convert it to an output video file (i.e: outVideo.avi, outVideo.mpeg, outVideo.ogv, etc) ... so here is a piece of my code... AVPacket pkt; av_init_packet(&pkt); AVFrame * picture = avcodec_alloc_frame(); int finishedFrames; int vframe, aframe = 0; while(av_read_frame(avInFormatCtx, &pkt) >= 0) { if(pkt.stream_index == videoStreamPos) { int outSize = avcodec_decode_video2(videoDecoderCodecCtx, picture, &finishedFrames, &pkt); printf("Bytes Decodificados: %d\n", outSize); if(finishedFrames) { vframe++; printf("Decoding VIDEO frame %d\n", vframe); int encodedVideo = avcodec_encode_video(videoEncoderCodecCtx, frameBuffer, finishedFrames, videoFrame); // What do I have to do with VIDEO here? } } if(pkt.stream_index == audioStreamPos) { aframe++; printf("PROCESSING AUDIO FRAME ...%d\n", aframe); // What do I have to do with AUDIO here? } av_free_packet(&pkt); } Anyone could tell me what I got wrong or point me what I have to do. Thanks in advance for any help or suggestion. -- -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.png Type: image/png Size: 20501 bytes Desc: not available URL: From umanga.forums at gmail.com Thu May 31 04:30:45 2012 From: umanga.forums at gmail.com (ashika umanga) Date: Thu, 31 May 2012 11:30:45 +0900 Subject: [Libav-user] Filling AVFrame with RGB24 sample data? Message-ID: Greetings all, I am trying to fill sample data for a AVFrame initialized with RGB24 format. I use following code snippet to populate RGB data. But in the encoded video,I can only see grayscale strip covering only 1/3 of the videoframe. This code snippet suppose to fill only Red color. Any tips what Im doing wrong here ? AVFrame *targetFrame=..... int height=imageHeight(); int width=imageWidth(); for(y=0;ydata0[index][(y* width)+x]=(x%255); //R targetFrame->data0[index][(y* width)+x+1]=0; //G targetFrame->data0[index][(y* width)+x+2]=0; //B } } -------------- next part -------------- An HTML attachment was scrubbed... URL: From umanga.forums at gmail.com Thu May 31 04:33:47 2012 From: umanga.forums at gmail.com (ashika umanga) Date: Thu, 31 May 2012 11:33:47 +0900 Subject: [Libav-user] Filling AVFrame with RGB24 sample data? In-Reply-To: References: Message-ID: sorry,this is the code snippet AVFrame *targetFrame=..... int height=imageHeight(); int width=imageWidth(); for(y=0;ydata[0][index][(y* width)+x]=(x%255); //R targetFrame->data[0][index][(y* width)+x+1]=0; //G targetFrame->data[0][index][(y* width)+x+2]=0; //B } } On Thu, May 31, 2012 at 11:30 AM, ashika umanga wrote: > Greetings all, > > I am trying to fill sample data for a AVFrame initialized with RGB24 > format. > I use following code snippet to populate RGB data. > But in the encoded video,I can only see grayscale strip covering only 1/3 > of the videoframe. > This code snippet suppose to fill only Red color. > Any tips what Im doing wrong here ? > > > > > AVFrame *targetFrame=..... > int height=imageHeight(); > int width=imageWidth(); > > > for(y=0;y for(x=0;x< encoder.getVideoParams().width;x++){ > > > targetFrame->data0[index][(y* width)+x]=(x%255); //R > targetFrame->data0[index][(y* width)+x+1]=0; //G > targetFrame->data0[index][(y* width)+x+2]=0; //B > > > } > } > -------------- next part -------------- An HTML attachment was scrubbed... URL: From umanga.forums at gmail.com Thu May 31 05:02:49 2012 From: umanga.forums at gmail.com (ashika umanga) Date: Thu, 31 May 2012 12:02:49 +0900 Subject: [Libav-user] Filling AVFrame with RGB24 sample data? In-Reply-To: References: Message-ID: sorry about that..i was calculating the offser wrong. On Thu, May 31, 2012 at 11:30 AM, ashika umanga wrote: > Greetings all, > > I am trying to fill sample data for a AVFrame initialized with RGB24 > format. > I use following code snippet to populate RGB data. > But in the encoded video,I can only see grayscale strip covering only 1/3 > of the videoframe. > This code snippet suppose to fill only Red color. > Any tips what Im doing wrong here ? > > > > > AVFrame *targetFrame=..... > int height=imageHeight(); > int width=imageWidth(); > > > for(y=0;y for(x=0;x< encoder.getVideoParams().width;x++){ > > > targetFrame->data0[index][(y* width)+x]=(x%255); //R > targetFrame->data0[index][(y* width)+x+1]=0; //G > targetFrame->data0[index][(y* width)+x+2]=0; //B > > > } > } > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bruce at spearmorgan.com Thu May 31 07:13:43 2012 From: bruce at spearmorgan.com (Bruce Wheaton) Date: Wed, 30 May 2012 22:13:43 -0700 Subject: [Libav-user] Filling AVFrame with RGB24 sample data? In-Reply-To: References: Message-ID: <948354A5-CFD8-461F-A9C6-501CA3564FA6@spearmorgan.com> On May 30, 2012, at 8:02 PM, ashika umanga wrote: > > for(y=0;y for(x=0;x< encoder.getVideoParams().width;x++){ > > > targetFrame->data0[index][(y* width)+x]=(x%255); //R > targetFrame->data0[index][(y* width)+x+1]=0; //G > targetFrame->data0[index][(y* width)+x+2]=0; //B > > > } > } > You're drawing a greyscale image, that's why. I think you mean to be doing X = X + 3, so you jump pixels. You're actually setting every single byte, then setting the next two bytes, then overwriting them. I don't know about the pixel/byte layout of RGB24, by the way. But that mistake seems clear. BRuce -------------- next part -------------- An HTML attachment was scrubbed... URL: From christian.bruemmer at gmx.de Thu May 31 15:51:00 2012 From: christian.bruemmer at gmx.de (=?ISO-8859-1?Q?Christian_Br=FCmmer?=) Date: Thu, 31 May 2012 15:51:00 +0200 Subject: [Libav-user] Getting SPS and PPS-information from x264 encoding In-Reply-To: <4FC5FA06.8000209@gmx.de> References: <4FC3B434.5000607@gmx.de> <4FC4BA61.90302@gmx.de> <4FC4CE74.3030403@gmx.de> <4FC5FA06.8000209@gmx.de> Message-ID: <4FC77744.4020804@gmx.de> Am 30.05.2012 12:44, schrieb Christian Br?mmer: > Am 30.05.2012 04:07, schrieb Kalileo: >> On May 29, 2012, at 20:26 , Christian Br?mmer wrote: >> >>> "Cant be that hard - or?" >>> >>> Okay now im pretty sure it is: >>> >>> I read AVCodecContex.extradata contains the informations i need. For decoding i used that code -> http://cgit.lscube.org/cgit.cgi/feng/tree/src/media/parser/h264.c#n218 - in a slightly modified way (replaced glib functions with e.g. libavs base64.h). Finally the decoding stuff is running - BUT... >>> >>> my AVCodecContext.extradata_size == 0<- what the heck?!? So no data for decoding and really no idea left how to get those informations.... WHAA! >>> >>> I make desperate efforts but i cant get into that... >>> >>> At least i need another hint. Im not asking for complete solution - its enough to know roughly the right way! >> > From what I think I understood extradata contains what you expect when your source is a video format with a global header. >> >> What's the source format you use for your tests? >> >> >> _______________________________________________ >> Libav-user mailing list >> Libav-user at ffmpeg.org >> http://ffmpeg.org/mailman/listinfo/libav-user >> > I create dummy images (should be replaced later on) and encoding them > to x264 frames. Further i stream those images via rtsp which is > working on VLC but not on android and i thinks its a stream > configuration problem. > > When should extradata be filled? In my text a dont encode a frame > before i try to get the sps pps infos out of extradata. I may have to > call a special function or encode a frame or header before? > > So my source format is: > > codec = avcodec_find_encoder(c->codec_id); > if(!codec) > { > std::cout << "Codec not found." << std::endl; > std::cin.get();std::cin.get();exit(1); > } > > *if(avcodec_get_context_defaults3 (c, codec) < 0) // cause i dont know > a working x264 configuration without deprecated flags * > { > std::cout << "Cannot get default codec context! \n" << std::endl; > std::cin.get(); > exit(1); > } > > and > > codec = stream->codec; > codec->codec_id = codecID; > codec->codec_type = AVMEDIA_TYPE_VIDEO; > codec->bit_rate = mParameters.mBitRate; > codec->width = mParameters.mWidth; > codec->height = mParameters.mHeight; > codec->time_base.den = mParameters.mFrameRate; > codec->time_base.num = 1; > codec->gop_size = mParameters.mFrameRate; > codec->pix_fmt = PIXEL_FORMAT; > codec->b_frame_strategy = 0; > codec->level = 12; > if(codec->codec_id == CODEC_ID_MPEG2VIDEO) > codec->max_b_frames = 2; // for testing, B frames > > if(codec->codec_id == CODEC_ID_MPEG1VIDEO) > codec->mb_decision = 2; > > if(context->oformat->flags & AVFMT_GLOBALHEADER) > codec->flags |= CODEC_FLAG_GLOBAL_HEADER; > > where mParamters are: > > imLiveStreamParameters param; > param.mBitRate = 4000; > param.mCodec = "x264"; > param.mFrameRate = 24; > param.mHeight = 240; > param.mWidth = 320; > > Thank you for your reply! > > > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user I figured out that if i add c->flags |= CODEC_FLAG_GLOBAL_HEADER; for my video codec configuration AVCodecContext.extradata.size is bigger than 0. Whats a reason for dont using global headers? Further i tried the av_sdp_create function again and now i get a string containing "sprop-parameter-sets". My rtsp server accept the sdp string but the vlc cant play my stream. But i will ask the live555 mailing list for that! Are there other aspects i have to consider using global header with x264 encoding (other configurations)? -------------- next part -------------- An HTML attachment was scrubbed... URL: From christian.bruemmer at gmx.de Thu May 31 17:32:14 2012 From: christian.bruemmer at gmx.de (=?ISO-8859-1?Q?Christian_Br=FCmmer?=) Date: Thu, 31 May 2012 17:32:14 +0200 Subject: [Libav-user] Getting SPS and PPS-information from x264 encoding In-Reply-To: <4FC77744.4020804@gmx.de> References: <4FC3B434.5000607@gmx.de> <4FC4BA61.90302@gmx.de> <4FC4CE74.3030403@gmx.de> <4FC5FA06.8000209@gmx.de> <4FC77744.4020804@gmx.de> Message-ID: <4FC78EFE.3010903@gmx.de> Am 31.05.2012 15:51, schrieb Christian Br?mmer: > Am 30.05.2012 12:44, schrieb Christian Br?mmer: >> Am 30.05.2012 04:07, schrieb Kalileo: >>> On May 29, 2012, at 20:26 , Christian Br?mmer wrote: >>> >>>> "Cant be that hard - or?" >>>> >>>> Okay now im pretty sure it is: >>>> >>>> I read AVCodecContex.extradata contains the informations i need. For decoding i used that code -> http://cgit.lscube.org/cgit.cgi/feng/tree/src/media/parser/h264.c#n218 - in a slightly modified way (replaced glib functions with e.g. libavs base64.h). Finally the decoding stuff is running - BUT... >>>> >>>> my AVCodecContext.extradata_size == 0<- what the heck?!? So no data for decoding and really no idea left how to get those informations.... WHAA! >>>> >>>> I make desperate efforts but i cant get into that... >>>> >>>> At least i need another hint. Im not asking for complete solution - its enough to know roughly the right way! >>> > From what I think I understood extradata contains what you expect when your source is a video format with a global header. >>> >>> What's the source format you use for your tests? >>> >>> >>> _______________________________________________ >>> Libav-user mailing list >>> Libav-user at ffmpeg.org >>> http://ffmpeg.org/mailman/listinfo/libav-user >>> >> I create dummy images (should be replaced later on) and encoding them >> to x264 frames. Further i stream those images via rtsp which is >> working on VLC but not on android and i thinks its a stream >> configuration problem. >> >> When should extradata be filled? In my text a dont encode a frame >> before i try to get the sps pps infos out of extradata. I may have to >> call a special function or encode a frame or header before? >> >> So my source format is: >> >> codec = avcodec_find_encoder(c->codec_id); >> if(!codec) >> { >> std::cout << "Codec not found." << std::endl; >> std::cin.get();std::cin.get();exit(1); >> } >> >> *if(avcodec_get_context_defaults3 (c, codec) < 0) // cause i dont >> know a working x264 configuration without deprecated flags * >> { >> std::cout << "Cannot get default codec context! \n" << std::endl; >> std::cin.get(); >> exit(1); >> } >> >> and >> >> codec = stream->codec; >> codec->codec_id = codecID; >> codec->codec_type = AVMEDIA_TYPE_VIDEO; >> codec->bit_rate = mParameters.mBitRate; >> codec->width = mParameters.mWidth; >> codec->height = mParameters.mHeight; >> codec->time_base.den = mParameters.mFrameRate; >> codec->time_base.num = 1; >> codec->gop_size = mParameters.mFrameRate; >> codec->pix_fmt = PIXEL_FORMAT; >> codec->b_frame_strategy = 0; >> codec->level = 12; >> if(codec->codec_id == CODEC_ID_MPEG2VIDEO) >> codec->max_b_frames = 2; // for testing, B frames >> >> if(codec->codec_id == CODEC_ID_MPEG1VIDEO) >> codec->mb_decision = 2; >> >> if(context->oformat->flags & AVFMT_GLOBALHEADER) >> codec->flags |= CODEC_FLAG_GLOBAL_HEADER; >> >> where mParamters are: >> >> imLiveStreamParameters param; >> param.mBitRate = 4000; >> param.mCodec = "x264"; >> param.mFrameRate = 24; >> param.mHeight = 240; >> param.mWidth = 320; >> >> Thank you for your reply! >> >> >> >> _______________________________________________ >> Libav-user mailing list >> Libav-user at ffmpeg.org >> http://ffmpeg.org/mailman/listinfo/libav-user > I figured out that if i add c->flags |= CODEC_FLAG_GLOBAL_HEADER; for > my video codec configuration AVCodecContext.extradata.size is bigger > than 0. > Whats a reason for dont using global headers? > > Further i tried the av_sdp_create function again and now i get a > string containing "sprop-parameter-sets". My rtsp server accept the > sdp string but the vlc cant play my stream. But i will ask the live555 > mailing list for that! > > Are there other aspects i have to consider using global header with > x264 encoding (other configurations)? > > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user I finally got it. The created sdp-line is working as expected. I had to create a substring and only parsing the "bytestream" of the sprop-parameter-sets without the qualifier "sprop-parameter-sets=". But thats nothing about libav. Thanks for reading, best regards, Christian -------------- next part -------------- An HTML attachment was scrubbed... URL: From christian.bruemmer at gmx.de Thu May 31 18:15:38 2012 From: christian.bruemmer at gmx.de (=?ISO-8859-15?Q?Christian_Br=FCmmer?=) Date: Thu, 31 May 2012 18:15:38 +0200 Subject: [Libav-user] Artifacts while encoding x264 video Message-ID: <4FC7992A.5070704@gmx.de> Hi, i get strange artifacts while encoding a few dummy images to videoframes. this is the result: http://youtu.be/pL0bKaxTBiU This is my c-code configuration: codec = stream->codec; codec->codec_id = codecID; codec->codec_type = AVMEDIA_TYPE_VIDEO; codec->bit_rate = mParameters.mBitRate; codec->width = mParameters.mWidth; codec->height = mParameters.mHeight; codec->time_base.den = mParameters.mFrameRate; codec->time_base.num = 1; codec->gop_size = mParameters.mFrameRate; codec->pix_fmt = PIXEL_FORMAT; codec->b_frame_strategy = 0; codec->level = 12; // for H264 codec->me_range = 16; codec->max_qdiff = 4; // lower value for higher quality range: 0-52 codec->qmin = 10; codec->qmax = 26; codec->qcompress = 0.6; with parameters: param.mBitRate = 40000; param.mCodec = "x264"; param.mFrameRate = 24; param.mHeight = 480; param.mWidth = 800; What can be the reason for those very ugly artifacs appearing every few seconds? Best regards, Christian -------------- next part -------------- An HTML attachment was scrubbed... URL: From itf-freak at gmx.de Thu May 31 17:29:58 2012 From: itf-freak at gmx.de (=?ISO-8859-1?Q?Christian_Br=FCmmer?=) Date: Thu, 31 May 2012 17:29:58 +0200 Subject: [Libav-user] Getting SPS and PPS-information from x264 encoding In-Reply-To: <4FC77744.4020804@gmx.de> References: <4FC3B434.5000607@gmx.de> <4FC4BA61.90302@gmx.de> <4FC4CE74.3030403@gmx.de> <4FC5FA06.8000209@gmx.de> <4FC77744.4020804@gmx.de> Message-ID: <4FC78E76.4020307@gmx.de> Am 31.05.2012 15:51, schrieb Christian Br?mmer: > Am 30.05.2012 12:44, schrieb Christian Br?mmer: >> Am 30.05.2012 04:07, schrieb Kalileo: >>> On May 29, 2012, at 20:26 , Christian Br?mmer wrote: >>> >>>> "Cant be that hard - or?" >>>> >>>> Okay now im pretty sure it is: >>>> >>>> I read AVCodecContex.extradata contains the informations i need. For decoding i used that code -> http://cgit.lscube.org/cgit.cgi/feng/tree/src/media/parser/h264.c#n218 - in a slightly modified way (replaced glib functions with e.g. libavs base64.h). Finally the decoding stuff is running - BUT... >>>> >>>> my AVCodecContext.extradata_size == 0<- what the heck?!? So no data for decoding and really no idea left how to get those informations.... WHAA! >>>> >>>> I make desperate efforts but i cant get into that... >>>> >>>> At least i need another hint. Im not asking for complete solution - its enough to know roughly the right way! >>> > From what I think I understood extradata contains what you expect when your source is a video format with a global header. >>> >>> What's the source format you use for your tests? >>> >>> >>> _______________________________________________ >>> Libav-user mailing list >>> Libav-user at ffmpeg.org >>> http://ffmpeg.org/mailman/listinfo/libav-user >>> >> I create dummy images (should be replaced later on) and encoding them >> to x264 frames. Further i stream those images via rtsp which is >> working on VLC but not on android and i thinks its a stream >> configuration problem. >> >> When should extradata be filled? In my text a dont encode a frame >> before i try to get the sps pps infos out of extradata. I may have to >> call a special function or encode a frame or header before? >> >> So my source format is: >> >> codec = avcodec_find_encoder(c->codec_id); >> if(!codec) >> { >> std::cout << "Codec not found." << std::endl; >> std::cin.get();std::cin.get();exit(1); >> } >> >> *if(avcodec_get_context_defaults3 (c, codec) < 0) // cause i dont >> know a working x264 configuration without deprecated flags * >> { >> std::cout << "Cannot get default codec context! \n" << std::endl; >> std::cin.get(); >> exit(1); >> } >> >> and >> >> codec = stream->codec; >> codec->codec_id = codecID; >> codec->codec_type = AVMEDIA_TYPE_VIDEO; >> codec->bit_rate = mParameters.mBitRate; >> codec->width = mParameters.mWidth; >> codec->height = mParameters.mHeight; >> codec->time_base.den = mParameters.mFrameRate; >> codec->time_base.num = 1; >> codec->gop_size = mParameters.mFrameRate; >> codec->pix_fmt = PIXEL_FORMAT; >> codec->b_frame_strategy = 0; >> codec->level = 12; >> if(codec->codec_id == CODEC_ID_MPEG2VIDEO) >> codec->max_b_frames = 2; // for testing, B frames >> >> if(codec->codec_id == CODEC_ID_MPEG1VIDEO) >> codec->mb_decision = 2; >> >> if(context->oformat->flags & AVFMT_GLOBALHEADER) >> codec->flags |= CODEC_FLAG_GLOBAL_HEADER; >> >> where mParamters are: >> >> imLiveStreamParameters param; >> param.mBitRate = 4000; >> param.mCodec = "x264"; >> param.mFrameRate = 24; >> param.mHeight = 240; >> param.mWidth = 320; >> >> Thank you for your reply! >> >> >> >> _______________________________________________ >> Libav-user mailing list >> Libav-user at ffmpeg.org >> http://ffmpeg.org/mailman/listinfo/libav-user > I figured out that if i add c->flags |= CODEC_FLAG_GLOBAL_HEADER; for > my video codec configuration AVCodecContext.extradata.size is bigger > than 0. > Whats a reason for dont using global headers? > > Further i tried the av_sdp_create function again and now i get a > string containing "sprop-parameter-sets". My rtsp server accept the > sdp string but the vlc cant play my stream. But i will ask the live555 > mailing list for that! > > Are there other aspects i have to consider using global header with > x264 encoding (other configurations)? > > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user I finally got it. The created sdp-line is working as expected. I had to create a substring and only parsing the "bytestream" of the sprop-parameter-sets without the qualifier "sprop-parameter-sets=". But thats nothing about libav. Thanks for reading, best regards, Christian -------------- next part -------------- An HTML attachment was scrubbed... URL: