15:15:19 < niez> how can I open video from memory buffer in 9.X? in 0.8.X I used ByteIOContext (now AVIOContext) and av_open_input_stream(), now I should use avformat_open_input() but how should I use ByteIOContext with that? 15:20:26 < niez> ok, I can create AVFormatContext with avformat_alloc_context(), but what next? 15:21:22 < JEEB> unless there's a pre-made in-memory AVIO thingy, you just have to implement three or so functions that implement the IO 15:22:33 < niez> yes, I have done that, I used avio_alloc_context() 15:22:52 < niez> and now I have AVIOContext 15:22:54 <@elenril> niez: that's documented in avformat_open_input() doxy 15:23:05 <@elenril> you preallocate the context, then set its pb element 15:23:18 <@elenril> then call avformat_open_input() 15:23:26 < niez> ach, ok 15:23:55 < niez> ok, everything is clear now 15:23:59 < JEEB> :) 15:24:07 -!- moser [~moser@59.42.82.226] has joined #libav 15:24:07 < JEEB> I implemented this for an MS API some months ago 15:24:18 -!- D4RK-PH0ENiX [~D4RK-PH0E@73.199.192.61.east.global.crust-r.net] has quit [Read error: Connection reset by peer] 15:24:50 -!- D4RK-PH0ENiX [~D4RK-PH0E@73.199.192.61.east.global.crust-r.net] has joined #libav 15:25:54 < niez> cool, it works 15:40:08 < niez> ok, last issue, avg_frame_rate.den == 0 15:40:14 < niez> any hints? 15:42:41 <@elenril> did you call find_stream_info()? 15:44:40 < niez> hm... 15:46:22 <@elenril> and note that in general you cannot rely on it being set to anything meaningful 15:46:31 <@elenril> e.g. when the container does not provide any timestamps 15:47:40 -!- tpyo [~tpyo@31-209-245-236.dsl.dynamic.simnet.is] has joined #libav 15:48:37 < niez> yes, I'm using this function, it was av_find_stream_info in 0.8.x, I've changed it to avformat_find_stream_info(formatContext, NULL); 15:48:45 -!- tpyo [~tpyo@31-209-245-236.dsl.dynamic.simnet.is] has quit [Client Quit] 15:49:07 <@elenril> what is the container? 15:49:18 <@elenril> and are you setting any AVFormatContext options? 15:49:20 < niez> ogg works good 15:49:51 < niez> avi and mp4 have problems with that 15:50:14 < niez> no, I didn't sen any options 15:52:17 <@elenril> what does avconv say on such files? 15:53:32 < niez> how should I run it? which options? 15:54:10 <@elenril> just avconv -i 15:55:32 < niez> http://pastebin.com/cBRw1vKG 15:57:41 < niez> here is output for ogg: http://pastebin.com/84fVkmUK 15:58:02 < niez> fps: 24 appears only for ogg 15:59:08 < niez> it looks like I can use tbn or tbc values as fps, am I right? 16:00:39 <@elenril> it won't work in all cases 16:03:29 < niez> tbn != fps in general? or this valye is sometimes missing? 16:03:47 <@elenril> tbn is the stream timebase 16:03:59 <@elenril> that is the units that are used for the timestamps 16:04:05 <@elenril> those can be completely arbitrary 16:04:15 <@elenril> e.g. in matroska you'll usually get 1/1000 16:05:33 < niez> ok, so, avconv didn't display fps - it couldn't get that ifo from my file? 16:07:18 <@elenril> apparently 16:07:21 <@elenril> looking into that now 16:07:54 < niez> I have used big buck bunny video from website for testing 16:13:26 < niez> well, in my application I can assume 25fps for every video, I can hardcode num and den for now 16:19:09 <@elenril> hmm, seems it's the usual libavformat timestamps insanity 16:19:37 <@elenril> i'll do something about it in git master, but don't expect it to be backported to releases, as it might break some obscure cases 16:19:53 <@elenril> in general you shouldn't rely on avg_frame_rate too much anyway 16:20:17 < niez> ok, what should I do in general then? 16:20:26 <@elenril> what do you need it for? 16:21:02 <@elenril> in general your video can be vfr, so the average framerate is some potentially meaningless number 16:21:12 < niez> oh, yes, in my application I can hardcode 25fps, but what about general video player? how to determine fps? 16:21:13 -!- Spamoi [~Spamoi@134.117.39.62.rev.sfr.net] has quit [Ping timeout: 240 seconds] 16:21:44 < niez> vfr? 16:21:49 <@elenril> variable frame rate 16:22:00 <@elenril> i.e. non-constant frame durations 16:22:08 < niez> in case of network vodeo stream or something? 16:22:39 <@elenril> various webcams or desktop grabbers often produce vfr 16:23:08 < niez> anyway, strange things, so how can you tell at what time display next frame? 16:23:16 <@elenril> by looking at the timestamps 16:23:28 <@elenril> AVPacket.pts / AVFrame.pkt_pts 16:23:47 < niez> ach, ok