[Ffmpeg-devel-irc] ffmpeg.log.20130208

burek burek021 at gmail.com
Sat Feb 9 02:05:02 CET 2013


[00:56] <stephanedev> saste: i just want to thank you again for your help. i am now setting "lag-in-frames" to zero for the vp8 encoder and latency is much lower.
[00:56] <saste> stephanedev, of course you can't achieve the same performance with all encoders
[00:57] <saste> libx264 -tune zerolatency is fu***ng brilliant
[00:57] <saste> most other encoders may not be suited for that kind of use
[00:57] <stephanedev> yeah i saw that option for x264
[00:58] <stephanedev> for now we settled on vp8 because we are not sure about x264 license
[00:58] <JEEBsv> the software license or licensing of the H.264 format?
[00:59] <JEEBsv> x264 at least is available for payware licensing if you don't want to touch GPL
[00:59] <stephanedev> the format
[00:59] <JEEBsv> yeah, that depends on how you're using it, don't remember where the MPEG-LA pdf about it was
[00:59] <stephanedev> for ffmpeg we use lgpl
[01:00] <JEEBsv> also IIRC MPEG-LA is rather open for talks, unlike VIA licensing f.ex.
[01:00] <JEEBsv> so they should be rather easily contactable
[01:01] <stephanedev> ok, thanks for the advice. we may contact them if vp8 does not do the job or customers want x264
[01:02] <stephanedev> by the way, i assume i need to build my own ffmpeg DLL with the proper options to remove everything that is not lgpl if this is the license i use, even if i don't use the glp bits?
[01:02] <stephanedev> gpl*
[01:03] <JEEBsv> yes
[01:04] <JEEBsv> people have a tendency of checking the license you built/used your ffmpeg with
[01:04] <stephanedev> thank you
[01:04] <JEEBsv> and trolling you if you linked against a GPL ffmpeg
[01:04] <JEEBsv> so yeah, building an LGPL library is a *good* idea
[01:05] <stephanedev> it makes sense. we want to respect every third-party license, so i will build a lgpl version before we distribute our software
[01:06] <JEEBsv> heh, I wish every developer was like you :P
[01:07] <stephanedev> that's the least we can do, given how helpful some of these libraries are
[01:08] <JEEBsv> people copying their ffmpeg confiuration from random GPL project X, and then subsequently using it with their non-open source app...
[01:08] <JEEBsv> I wish that didn't happen as much as it does
[01:10] <stephanedev> some developers don't bother to check the license text and just assume they can do anything with source code they find online
[01:11] <JEEBsv> yup
[01:42] <Keshl> stephanedev: Sorry for randomly going afk. Mind slipped. I swear I have early onset alzheimers. <É< http://pastebin.com/uN9RnWng
[01:44] <stephanedev> hmm i usually get the fps on the video stream line, i.e. the one starting with Stream#0:0: Video
[01:45] <stephanedev> let me try with a flv file on my system
[01:49] <stephanedev> Keshl: i don't have fps either when probing a flv file. but it seems you can rely on the tbr: http://stackoverflow.com/questions/3199489/meaning-of-ffmpeg-output-tbc-tbn-tbr
[01:49] <Keshl> oÉo.
[01:50] <Keshl> 25 tbs == 25 fps, or "about 25, maybe 24"?
[01:53] <stephanedev> Keshl: i guess so, but check the last paragraph of the second message about tbr on: http://ffmpeg-users.933282.n4.nabble.com/What-does-the-output-of-ffmpeg-mean-tbr-tbn-tbc-etc-td941538.html
[01:53] <Keshl> "I hope that helps a little.", oÉo?
[01:53] <stephanedev> the one just before that :p
[01:53] <Keshl> Ohhh oÉo
[01:54] <Keshl> ... What kind of video is 25 or 12.5 fps?
[01:54] <Keshl> o.O'
[01:54] <stephanedev> i don't know what the field rate is, sorry
[01:54] <Keshl> How does vlc know what rate to play it at? o_o'
[01:54] <stephanedev> i am just a ffmpeg API user still struggling with some of the concepts involved :p
[01:55] <stephanedev> it knows with the container rate and the codec rate
[01:55] <Keshl> So how does I calculate that?
[01:55] <stephanedev> the time bases in AVStream and AVCodecContext
[01:55] <Keshl> o_o
[01:56] <stephanedev> each packet is timestamped
[01:57] <Keshl> <.< Can I get a dump of the first 60 timestamps
[01:57] <Keshl> *?
[01:57] <Keshl> =D
[01:57] <stephanedev> the unit for the packet timestamp read from the file is in stream time base units (hope i am correct)
[01:58] <stephanedev> not sure how to do it with ffmpeg command-line
[01:58] Action: Keshl dies.
[01:58] <Keshl> x.x
[01:58] <stephanedev> but if you can program, the ffmpeg C API allows you to do that
[01:59] <Keshl> o_o Anything beyond the standard library makes me wet myself.
[01:59] <stephanedev> the demuxing.c example is a good starting point if you want to try
[02:01] <stephanedev> you can easily modify demuxing.c (http://ffmpeg.org/doxygen/trunk/doc_2examples_2demuxing_8c-example.html) by adding some traces around the line calling avcodec_decode_video2
[02:02] <stephanedev> some printf's to show some of the members of pkt and frame (like pkt.pts, ...)
[02:08] <stephanedev> Keshl: for ffmpeg command-line, "-debug_ts" may be useful
[10:19] <portal`> hey guys - http://pastebin.com/RzV4yvgA - trying to transcode HTTP Live Stream to WMV, it cuts off after about 9-20 seconds.
[10:19] <portal`> would love for someone to chime in on why it might be.
[10:19] <portal`> ffmpeg version N-49527-g985e93a
[10:26] <portal`> running the same command usually will stop at around 8 seconds, but i just had it go to 48 seconds and stop there
[14:07] <jeje34> hi to all
[14:08] <jeje34> I have a problem using the last ffmpeg release (1.1.1) to decode h264 stream
[14:10] <jeje34> when I want to enable multithreading to decompress, I always got an error when I open the codec (The maximum value for lowres supported by the decoder is 0)
[14:10] <jeje34> But in the code of utils.c, this message appear when: if (avctx->codec->max_lowres < avctx->lowres || avctx->lowres < 0)
[14:11] <jeje34> if I trace my code I have avctx->lowres=0 and avctx->codec->max_lowres=0
[14:11] <jeje34> I can't understand why I have this error
[14:12] <jeje34> my codecctx have thread_count=3 (I have a dualcore) and I set thread_type = FF_THREAD_FRAME|FF_THREAD_SLICE
[14:12] <jeje34> Thanks for your responses
[14:15] <jeje34> for informations, I compile FFMPEG with Mingw with --enable-w32threads because I use ffmpeg libs in a windows application (using Visual Studio vc++ 2003)
[14:29] <jeje34> the error code resulting from avcodec_open2 is -22
[14:52] <iive> jeje34: i don't think you are supposed to change max_lowres.
[14:53] <iive> imho, if you don't use it, don't touch lowres too.
[14:53] <iive> you may want to print the context after you get the error and see the value of lowres. if you think this is what caused the error.
[14:54] <jeje34> I don't modify the value of max_lowres and lowres. When I look at the value, the two values are set to 0 (I think the default values)
[14:54] <iive> aha. good...
[14:55] <jeje34> I just call avcodec_alloc_context3 to get my context and so avcodec_get_context_defaults to set the default values
[14:55] <iive> another possibility is that something got wrong with some of the other threads.
[14:55] <iive> they have their own contexts, that are cloned from the main one...
[14:55] <iive> most likely some tricky memory corruption.
[14:57] <iive> just something for you to check. win32 doesn't have memalign, so ffmpeg have special memory allocation, that allocates more memory and then uses aligned memory into that allocation.
[14:57] <jeje34> but what I don"t understand is why before calling avcodec_open2(codecCtx, codec, NULL) I have lowres=0 of my codecCtx and max_lowres=0 in my codec but I have the error message
[14:57] <iive> be sure that memory allocated by ffmpeg function is free'd by ffmpeg functions and vice versa.
[14:58] <iive> jeje34: put some debug printf's or breakpoints into the code that prints the error, and check the values there.
[14:58] <jeje34> I use the ffmpeg calling to allocate and free memory
[14:59] <iive> good.
[15:00] <jeje34> I try to activate multithreading because I have a dualcore. When I decompress one stream, my CPU usage is near 1-2%. When I decompress 2 streams, I have 3-4%. But when I decompress 3 streams, i tkae me 25% of CPU usage.
[15:00] <jeje34> Do you think activate Multithreading could decrease my cpu usage?
[15:01] <iive> i didn't quite get that.
[15:03] <jeje34> I'm going to rebuild FFMPEG with more traces I think
[15:10] <iive> i would have recommended running it under valgrind, but I'm not sure if it is available under windows.
[15:12] <JEEBsv> nope
[15:12] <JEEBsv> there's a crap port, but that doesn't really work :S
[15:14] <jeje34> I already have a look trying using GDB tools to debug FMMPEG under VisualStudio but I don't find naything working
[15:14] <jeje34> opps anything sorry
[15:15] <jeje34> Is someone have an idea how to configure the AVContext to use the lowest CPU usage when decoding H264 video streaming?
[15:16] <jeje34> or perhaps in all the configurationof compilinf FFMPEG too
[15:16] <jeje34> there's too much options...
[15:22] <jeje34> my configure option are:  ./configure --prefix=/mingw/i686-pc-mingw32 --enable-shared --disable-static
[15:22] <jeje34> --enable-w32threads --enable-runtime-cpudetect --enable-memalign-hack --enable-
[15:22] <jeje34> hwaccels --cpu=i686 --enable-debug=3 (I had enable-debug to try to see more reason)
[15:33] <jeje34> for the CodecContext, I use error_concealment= FF_EC_GUESS_MVS | FF_EC_DEBLOCK, err_recognition       = AV_EF_CAREFUL, debug = FF_DEBUG_THREADS
[15:55] <flexnsniff> So i'm trying to stream RTMP to AMS5& streaming a movie to it.  It works when i use the live/ app, but then is a green screen when i use the livepkgr/ app.  Should i set ffmpeg differently or change how AMS works?
[15:57] <jeje34> I add some trace in Utils.c of libavcodec, and so on, I have avctx->codec->max_lowres=0, avctx->lowres=3
[15:57] <jeje34> very strange
[15:57] <jeje34> but it explain why I have this message when using avcodec_open2
[16:08] <Damik> Hi, I've problem with compiling ffmpeg under msvc toolchain. I've got - c99wrap cl is unable to create an executable file.
[17:16] <mpfundstein> is here someone who has experience with sar/dar stuff?
[17:16] <JEEBsv> in what way?
[17:17] <mpfundstein> i have a video which is 720x480 (par 32/27, dar 16/9). all my calculations lead me to an actual width of 853x480 but quicktime reports 872x480 , which also works well in my formulas. i cant find any formula which leads to an actual width of 872
[17:17] <mpfundstein> i tried so many formulas, all of them say actual width = 853, but i need 872 :-)
[17:18] <JEEBsv> are you sure there is no other metadata related?
[17:18] <JEEBsv> also what video format is that in?
[17:18] <mpfundstein> :( i dont know
[17:18] <mpfundstein> video format?
[17:18] <mpfundstein> mpeg2
[17:18] <mpfundstein> one sec
[17:18] <mpfundstein> ill give you a ffprobe output
[17:18] <JEEBsv> k
[17:19] <mpfundstein> https://gist.github.com/MarkusXite/e7f3b032fe698041c985
[17:19] <mpfundstein> 720*((16/9)/1.5) = 853
[17:20] <mpfundstein> 1.5 = 720/480
[17:21] <JEEBsv> 875 or so is the DVD "16:9" aspect ratio (the whole size of the active+non-active picture areas), but unfortunately that really doesn't give us enough info on what the actual values either in the MPEG-2 video track or in the MOV container are
[17:22] <mpfundstein> how can quicktime calculate it right
[17:22] <mpfundstein> when i open the video in quicktime it says 720x480 (actual: 872x480)
[17:22] <JEEBsv> depends on several things, none of which I can say anythin about definitely
[17:22] <JEEBsv> because as I said, not enough info
[17:22] <mpfundstein> ok
[17:22] <mpfundstein> what do you think is missing?
[17:22] <mpfundstein> :-)
[17:23] <JEEBsv> I have no fucking idea, a full dump of the MPEG-2 Video headers and the full dump of data in the container would be needed for that
[17:23] <JEEBsv> for dump of the MOV file, you can try http://code.google.com/p/l-smash/ 's boxdumper
[17:23] <JEEBsv> (output boxdumper's output into a text file, then go through it)
[17:24] <mpfundstein> ok
[17:24] <mpfundstein> so its probably encoded with non visible data on the left and right
[17:24] <JEEBsv> as for the MPEG-2 stream, you'd need something like elecard streameye to check the headers
[17:24] <JEEBsv> mpfundstein: no
[17:24] <JEEBsv> the 720x480 picture in DVDs is by the specs encoded with a SAR of 40:33
[17:24] <JEEBsv> which ends up being 875x480 or so
[17:24] <mpfundstein> AH
[17:25] <JEEBsv> (the active picture is 704x480)
[17:25] <mpfundstein> that is really f**** up
[17:25] <JEEBsv> (and 704x480 with a 40:33 AR is 853x480 or so)
[17:25] <mpfundstein> mh
[17:25] <JEEBsv> not really
[17:26] <JEEBsv> so in the simplest case, QT just takes MPEG-2 Video in with these aspect ratios, but somehow I /really/ wouldn't like to think that's all it bases its guess upon
[17:26] <JEEBsv> thus
[17:26] <JEEBsv> go look at 1) the boxdumper's dump of the mov's metadata 2) the MPEG-2 Video headers
[17:26] <mpfundstein> im screwed -.-
[17:26] <Mavrik> hmm, how did I manage to miss the existence of AAC Main profile
[17:27] <mpfundstein> ok thx JEEBsv, ill do more research on that
[17:32] <casimiro_> Helloa all, is there anybody here who have combined ffmpeg with libev ?
[17:35] <casimiro_> Or better, is there anyway that I can give a buffer with mpeg ts received from an tcp socket to libavformat so that I can extract the mpeg ts packets ?
[18:27] <iive> casimiro_: ffmpeg merges most of libav, but it also adds its own stuff and fixes.
[19:23] <casimiro_> thank you for your response iive. Do you know of anyway I pass a buffer containing an mpeg ts stream to some ffmpeg function and I get the mpeg ts packets ?
[19:24] <iive> casimiro_: i'm not familiar with libavformat. but imho, mpeg-ts packets are the easiest to parse. they are always of same size and start with same sync byte.
[19:28] <casimiro_> iive: In fact! But I have written an little app that receives mpeg ts from an TCP socket and send the stream through an UDP socket. In this case I need to splice the stream in order to send the udp packets correctly. I am able to find the sync bytes, but it seems that after some few packets I need to synchronize (find the sync bytes again..)
[19:29] <casimiro_> iive: It seems that it's not only a matter of finding a sync byte and split every 188 bytes ahead
[19:29] <iive> casimiro_: do you send exact multiples of the ts packet size?
[19:30] <iive> udp could easily be lost or delivered out-of-order.
[19:30] <Mavrik> casimiro_, so basically you want to read TCP stream
[19:31] <Mavrik> casimiro_, and then forward it over UDP?
[19:31] <Mavrik> without remuxing?
[19:31] <casimiro_> Mavrik: yes
[19:31] <Mavrik> hmm
[19:32] <Mavrik> MPEG2-TS packetization is handled via MPEG-TS muxer in ffmpeg, so I'm not sure if there's an elegant way of doing that with ffmpeg libs
[19:32] <Mavrik> (without remuxing that is)
[19:32] <casimiro_> I see
[19:33] <casimiro_> Should not it be just a matter of splicing the incoming stream on every 188 bytes ?
[19:33] <Mavrik> casimiro_, yes, but you need to splice them on the packet boundaries
[19:33] <Mavrik> casimiro_, basically you're looking for 0x47 sync byte at the start of each TS packet
[19:35] <casimiro_> Exactly. And everything works fine at the beginning. But after a few packets, there is not anoter sync byte after 188 bytes from the current sync byte
[19:35] <casimiro_> I understand that I will need to synchronize things after some time, but I am having to synchronize to often...
[19:36] <casimiro_> I'm sorry if it's too much noob problem. =)
[19:36] <Mavrik> not a noob problem really :)
[19:36] <casimiro_> Thx!
[19:39] <Mavrik> casimiro_, btw, are you checking continuity counters if your packets are in order?
[19:41] <casimiro_> No...All I do for now is identify a sync byte send one UDP message for every 188 bytes ahead
[19:42] <Mavrik> casimiro_, check those so you see if your packets are ordered properly on the input
[19:42] <Mavrik> it's a 4-bit field in packet head
[19:44] <casimiro_> But, an not ordered packet would implicate on bytes between packets ou packets longer or shorter ?
[19:44] <casimiro_> Also, I am receiving the data from an HTTP request...
[20:09] <portal`> hey guys - http://pastebin.com/RzV4yvgA - trying to transcode HTTP Live Stream to WMV, it cuts off after about 9-20 seconds.
[21:06] <shevy> quick question - can I easily combine .mp4 files via ffmpeg?
[21:31] <shevy> ah well, the mencoder variant worked fine. cya.
[21:32] <walker> Hi folks - I'm using ffmpeg to transcode a live video stream, from RTP to RTMP.
[21:33] <walker> It works fine in good conditions, but I have an instance where the RTP sender starts with video muted.
[21:33] <walker> So it doesn't start sending RTP until a few seconds in. During that time, ffmpeg starts up, can't analyze the video stream, and just does audio.
[21:34] <walker> And won't do video after that (packets received from video stream are marked as NULL stream in ffmpeg -v debug)
[21:34] <walker> How can I get around this?
[21:34] <cheeseboy> with -f image2 -usefirst can i limit # of writes per second or something?
[21:35] <beastd> cheeseboy: what do you want to do?
[21:36] <cheeseboy> beastd, i want to load a preview frame ron my website but if its writting it 20 times a second its lil hard to load
[21:36] <beastd> cheeseboy: you could use -re and probably probably set a different framerate
[21:37] <cheeseboy> beastd, i want it to still encode at right rate thoo
[21:37] <Fjorgynn> can I do -ss and copy and burn in the subs?
[21:39] <beastd> cheeseboy: hmm. probably i still do not understand what you want.
[21:39] <beastd> Fjorgynn: probably not
[21:41] <beastd> cheeseboy: if you encode faster you will write out more frames per second and therefore you will be overriding the outputfile more often.
[21:42] <beastd> Fjorgynn: I meant, you cannot use copy for the video stream you want to burn the subs onto.
[21:52] <Fjorgynn> seems like I can't copy an ass file to that
[22:15] <Youka> @shevy: have a look at <http://ffmpeg.org/trac/ffmpeg/wiki/How%20to%20concatenate%20%28join,%20merge%29%20media%20files>
[00:00] --- Sat Feb  9 2013


More information about the Ffmpeg-devel-irc mailing list