[Ffmpeg-devel-irc] ffmpeg.log.20121102
burek
burek021 at gmail.com
Sat Nov 3 02:05:01 CET 2012
[00:42] <lucas^> how difficult would it be to pull out libavformat/wtv.c and use it in an application which isn't using ffmpeg?
[00:42] <lucas^> from what I can tell, it'd be a significant project but nothing too complicated
[05:36] <Leoneof> hello
[05:40] <Leoneof> is there a command line to get the info like codecs, resoultions, compression....etc from the file.wmv and use/add this info as "Presets"?
[07:03] <darkstarbyte_> rebootin time.
[07:03] <darkstarbyte_> sorry wrong channel.
[07:27] <darkstarbyte_> What option would I use to not encode audio?
[08:42] <Kazurik> Does anyone know how to make mono record my mic as mono? When I try to stream to twitch.tv (justin.tv) with my mic the viewers will only hear my mic out of their left channel. I use the following command to stream: "ffmpeg -f x11grab -s 1920x1080 -r 30 -i :0.0+1920,0 -ab 64k -f alsa -ac 2 -i pulse -vcodec libx264 -crf 30 -preset medium -acodec libmp3lame -ar 44100 -threads 0 -pix_fmt yuv420p -f flv rtmp://live.justin.tv/app/privatestuffhere"
[09:33] <fling> Hello!! :]
[09:33] <fling> http://dpaste.com/822750/
[09:34] <fling> ffmpeg -f mjpeg -r $fps -i $source -an -vcodec libx264 -b $bitrate -f flv $target -f avi $target_file
[09:35] <fling> I have two outputs: $output is rtmp flv stream and $target_file is a file :p
[09:35] <fling> so how to not encode twice and use a single encode for both rtmp and file?
[09:36] <fling> Kazurik: -ac 1 ?
[09:43] <fling> fling: try this http://ffmpeg.org/trac/ffmpeg/wiki/Creating%20multiple%20outputs
[09:43] <fling> fling: thanks
[09:43] <fling> fling: yw
[09:44] <fling> Kazurik: tell me if -ac 1 works for you
[09:51] <fling> which format do I need to use for pipe between ffmpegs? mpegts is used in the example. why?
[10:19] <Kazurik> fling: Oh my that does work. Well I feel really dumb. Thanks for the help!
[10:19] <fling> Kazurik: tell me more about your streaming, I want to make my own tonight :p
[10:19] <fling> Kazurik: but I do not know much about justit
[10:20] <fling> s/justit/justin/
[10:21] <Kazurik> I actually stream on http://www.twitch.tv/ which I think is just a gaming frontend to jsutin.tv. I don't actually use it for gaming but I do use it to stream my primary monitor. I do this because a bunch of friends and I have started up a business but we don't have an office yet. So we setup a little virtual office where we all stream our primary display + sound
[10:22] <fling> Kazurik: oh! nice :p so what do I need? only the account on their site? and fill my credentials into http:// link? that's it?
[10:22] <Kazurik> Thankully after fighting with pulseaudio for a few hours I found this post http://www.linuxquestions.org/questions/linux-software-2/alsa-and-pulseaudio-recording-multiple-input-devices-877614/ which got my sound output + mic input all streaming at the same time!
[10:23] <fling> Kazurik: I would probarly do the same thing using alsa
[10:23] <fling> I dislike pulseaudio, also I have jack
[10:23] <Kazurik> fling: Yeah you just create an account, log in, click on your name on the top right, click the dashboard optoin, click "Streaming Apps" above the preview, click "Show Key", and then finally drop that key into the privatestuffhere from earlier
[10:24] <fling> oh! I have alsa xruns twice per minute so I will not do streaming with sound until I fix my alsa/ffmpeg somehow
[10:24] <Kazurik> I too hate pulseaudio but I finally got this all working so I'm not touching anything!
[10:24] <fling> I have xruns with every ffmpeg after 0.69 version
[10:25] <fling> but I can't use old ffmpeg with my current setup hmm hmm
[10:25] <lucas^> _finally_ managed to get libmpeg2 working with WinRT
[10:26] <fling> omg
[10:26] <lucas^> tried getting ffmpeg to load, but it was a lost cause from the start I think
[10:26] <fling> how to properly check for ffmpeg running and restart if it not?
[10:27] <fling> s/it/it\ is/
[10:28] <fling> how to take http credentials from a secrets file? I do not want my password to be visible in ps
[10:28] <lucas^> edit / create .htaccess if you're running apache
[10:29] <fling> lucas^: i'm running `ffmpeg -f mjpeg -r $fps -i http://user:pass@ip.cam &´
[10:33] <Leoneof> hi, is there a command line to get the info like codecs, resoultions, compression....etc from the file.wmv and use/add this info as "Presets"?
[10:34] <fling> Leoneof: look at ffplay output
[10:34] <Leoneof> ok
[10:35] <Leoneof> i need something easy, :/
[10:56] <Leoneof> anyone?
[10:56] <Mavrik> O.o
[10:56] <Mavrik> mornin.
[10:57] <Leoneof> oh good morning!
[10:58] <Leoneof> Mavrik: is there a command line to get the info like codecs, resoultions, compression....etc from the file.wmv and use/add this info as "Presets"?
[10:58] <Mavrik> probably not.
[10:58] <Mavrik> you could hack this together with ffprobe and some scripting
[10:58] <Mavrik> but you can't reliably get bitrate from video
[10:59] <Leoneof> the reason is, i have one file.wmv, and i want to convert many files like the properties of file.wmv
[11:00] <mudkipz> try ffprobe?
[11:00] <mudkipz> oh wait, I didn't realize you mentioned that
[11:00] <Leoneof> mudkipz: a lot of info, i'm not expert about it
[11:01] <Mavrik> well there's no "magic" solution, you're gonna have to know what you're doing
[11:01] <Mavrik> ffprobe will give you the info you need, bitrate you'll have to calculate yourself
[11:02] <Leoneof> how to calculate bitrate? i don't know what it's :[
[11:02] <Leoneof> but it seems size of frames per second?
[11:03] <Mavrik> it's number of bits every second of your video may take
[11:06] <Leoneof> yeah, i will try to convert some files to see the results
[13:02] <brontosaurusrex> Leoneof: why convert anything to wmv?
[13:06] <Leoneof> brontosaurusrex: because it has high compression?
[13:06] Action: brontosaurusrex goes into troll mode
[13:07] <brontosaurusrex> where have you been for the last 15 years?
[13:07] <brontosaurusrex> nm, do as you wish, ignore me ...
[13:08] <Leoneof> brontosaurusrex: give me alternative? :/
[13:08] <JEEB> let's just say that the wmv encoder in ffmpeg isn't exactly a good one, and libx264 for H.264 is capable of both faster and better compression
[13:08] <brontosaurusrex> a. AVC + AAC in mp4
[13:08] <brontosaurusrex> listen to JEEB
[13:08] <brontosaurusrex> he is the man
[13:08] <Leoneof> going mp4?
[13:08] <Leoneof> to*
[13:09] <JEEB> the only reason to either use VC-1 or WMV is to have it compatible with certain MS-specific software or hardware
[13:09] <JEEB> and for that you should be using their encoder to be honest
[13:09] <JEEB> if you want good compression and so forth tho, you really want to use an up-to-date libx264 tho :P
[13:10] <Leoneof> how about realmedia?
[13:10] <JEEB> their newest is a cut-off clone of H.264
[13:10] <JEEB> if you want similar results, just turn deblocking to eleven in libx264
[13:10] <JEEB> and you most probably will get better compression :P
[13:10] <JEEB> not that you really want to do that
[13:11] <JEEB> let's just say that no proprietary format is better than H.264 at the moment
[13:11] <JEEB> for video
[13:13] <Leoneof> O_O
[13:13] <Leoneof> i will do some tests for mp4
[13:13] <Leoneof> thanks
[13:15] <JEEB> mp4 is just a container
[13:18] <JEEB> also there's a new way with libx264 to set your preferred "level of quality", the -crf switch. Start with 23 or so instead of setting a bit rate, and then if it looks good you set something higher, and if it looks bad you set something lower. Try it with a couple of thousand frames or so of stuff you're going to encode.
[13:58] <mudkipz> can you use -crf and -maxrate together?
[13:58] <mudkipz> like, for video streaming
[13:58] <mudkipz> nvm, I guess it probably makes more sense to do bitrate that way
[14:00] <JEEB> yes, you can
[14:00] <JEEB> bufsize + maxrate and crf
[14:00] <mudkipz> hmm
[14:06] <JEEB> in most cases I've been doing live streaming in, crf + vbv has been the better option to bitrate based encoding + vbv
[14:19] <saste> JEEB: bufsize only affects FFmpeg encoders, how can it be useful with -crf (libx264 option)?
[14:19] <JEEB> it should set --vbv-bufsize in libx264
[14:19] <JEEB> at least that's what I've been understanding
[14:19] <saste> ok, so it is mapped to libx264 options
[14:20] <JEEB> it /should/ be, correct me if I am incorrect
[14:20] <saste> libx264.c
[14:20] <JEEB> I don't see it in the avoptions tho
[14:20] <JEEB> unless I'm looking at the wrong file...
[14:21] <JEEB> nal-hrd does seem to exist, and its setting's help does seem to imply vbv-bufsize's existence
[14:23] <saste> x4->params.rc.i_vbv_buffer_size = avctx->rc_buffer_size / 1000;
[14:23] <JEEB> yup
[14:23] <JEEB> so yeah, I would guess -bufsize and -maxrate should work
[14:23] <JEEB> yup
[14:23] <saste> yes
[14:23] <JEEB> that would also explain why it helped people when I noted they should use it in limited bandwidth scenarios :)
[15:33] <mudkipz> so, I've started playing around some more with ffmpeg on windows trying to capture my desktop with -f dshow and a program called SCFH DSF (it's commonly used with Flash Media Live Encoder for lightweight desktop capture) but while it works I keep getting errors.
[15:34] <mudkipz> in particular errors like this.
[15:34] <mudkipz> >[dshow @ 00000000003277a0] real-time buffer 122% full! frame dropped!
[15:34] <mudkipz> it works, but it's a little choppy
[15:34] <Leoneof> mudkipz: ffmpeg can capture desktop?
[15:34] <mudkipz> looking around it looks like maybe I would fix this by adding -rtbufsize to my command
[15:35] <mudkipz> um, well in linux you use x11grab, on windows there doesn't seem to be an exact equivalent.
[15:35] <Leoneof> i'm using linux
[15:35] <mudkipz> So I'm using directshow to capture a sort of pseudo-webcam (via SCFH DSF).
[15:35] <Leoneof> interesting
[15:35] <mudkipz> Well, yes, in linux you can capture it with -f x11grab
[15:35] <Leoneof> it's possible to capture webcam?
[15:35] <mudkipz> I use it for rtmp streaming to livestream, ustream, etc..
[15:36] <mudkipz> on linux?
[15:36] <Leoneof> yes
[15:36] <mudkipz> yes, using video4linux2
[15:36] Action: Leoneof *trying*
[15:36] <mudkipz> and video4linux, (no 2).
[15:36] <mudkipz> I have a really really cheap chinese (probably bootleg) capture device (SMI Grabber) that I use to capture my ps2.
[15:37] <mudkipz> I had a lot of trouble getting it to work with video4linux2 on ffmpeg, but gstreamer can do it too.
[15:37] <mudkipz> I can't figure out why my gstreamer command works and my near equivalent ffmpeg one doesn't.
[15:37] <mudkipz> but yea, it's definitely possible, if you want I can give you a sample command to capture your desktop.
[15:38] <Leoneof> yes please
[15:41] <mudkipz> http://pastebin.com/xrxcSDze
[15:41] <mudkipz> there's some more info here http://ffmpeg.org/ffmpeg.html#x11grab
[15:41] <mudkipz> I use some extra stuff in that command because I'm sending it to an rtmp server.
[15:43] <mudkipz> the -strict -2 is because I'm using the internal aac codec (sites like livestream and ustream are only mobile compatible if you stream in aac).
[15:43] <mudkipz> the internal aac encoder is experimental so it's not enabled without the -strict -2
[15:50] <JEEB> mudkipz, btw if you want a better AAC encoder I recommend you try out fdk-aac, https://github.com/mstorsjo/fdk-aac
[15:50] <JEEB> it's fraunhofer's AAC encoder that was released with Android 4.1
[15:51] <mudkipz> yea it is better, but it's not compiled in by default because non-free. I do have a custom ffmpeg compiled with it though.
[15:51] <mudkipz> I'm just trying to get things working with all of the common basic libraries first as I'm also trying to write a guide for a bunch of other streamers.
[15:52] <JEEB> well, yeah -- because it's nonfree with GPL you can't give out binaries that have something GPL linked to them
[15:52] <JEEB> (f.ex. libx264)
[15:52] <mudkipz> yeaa
[15:53] <mudkipz> the libvo-aac codec seems to be bundbable though supposedly. At least that's what zeranoe (ffmpeg window builds guy) thinks so it's bundled with the windows version.
[15:53] <mudkipz> doesn't come default on arch though -_-
[15:53] <JEEB> yes, that is OK with GPLv3
[15:53] <JEEB> as it's Apachev2
[15:53] <JEEB> the main reason why fdk isn't GPL-compatible is because fraunhofer had to go and make its own license :)
[15:54] <JEEB> it is LGPL compatible tho
[15:54] <mudkipz> oh I see
[15:54] <JEEB> basically they made their own license that says you can't take money from it
[15:54] <JEEB> which is what GPL doesn't limit
[15:54] <JEEB> thus... it's not compatible with the GPL
[15:54] <mudkipz> oooh so it's even more "free" than GPL
[15:55] <mudkipz> hahaha that's funny.
[15:55] <JEEB> also libvo-aacenc isn't really better than the internal encoder
[15:55] <JEEB> so you might as well use the internal one in that case
[15:55] <mudkipz> yea, that's what I figured
[15:55] <mudkipz> I've been testing a bit with both, haven't noticed much difference.
[15:56] <mudkipz> but rtmp streaming is by it's nature low quality/low bandwidth/low latency
[15:56] <mudkipz> at least, crappy rtmp streaming hahaha
[16:05] <mudkipz> hmm, tried adding "-rtbufsize 1000000000" to the beginning of my command and it seems to work kind of, but I still get random drops that show up as "*** drop!"
[16:08] <mudkipz> http://pastebin.com/ynx8PhBZ
[16:08] <mudkipz> that's my whole current command.
[16:09] <mudkipz> kinda running low on ideas.
[16:09] <mudkipz> is there anything like "queue" in gstreamer?
[16:09] <mudkipz> in ffmpeg
[16:13] <mudkipz> tried running with -v debug
[16:13] <mudkipz> caught this
[16:13] <mudkipz> [dshow @ 0000000001ed77e0] Probe buffer size limit 5000000 reached
[16:13] <mudkipz> [dshow @ 0000000001ed77e0] Stream #1: not enough frames to estimate rate; consider increasing probesize
[16:13] <mudkipz> [dshow @ 0000000001ed77e0] Estimating duration from bitrate, this may be inaccurate
[16:14] <mudkipz> I feel like I'm choosing absurdly high values for -rtbufsize so I'm not sure if I'm causing the probe buffer problem (I don't really know what either is or if they're related) or if the probe buffer problem is causing others.
[16:19] <mudkipz> one of the things I noticed is that the video quality from the dshow device seems to be really crisp, like way more than it should be.
[16:20] <mudkipz> or well maybe not at '-preset medium', hmm I should probably take a break from this to clear my head.
[16:20] <fling> do I need to use ts or mkv?
[18:33] <fling> how to input wav from fifo?
[18:34] <JEEB> -f wav ?
[18:34] <JEEB> before -i
[18:34] <fling> JEEB: http://bpaste.net/show/55475/
[18:34] <fling> /tmp/mpd2ffmpeg.fifo: Operation not permitted ; pipe:: Operation not permitted
[18:35] <JEEB> sounds like you're doing something wrong unrelated to the wav part
[18:35] <fling> ok wait I need to check the fifo
[18:36] <JEEB> also not sure if you need to set channel and rate manually with wav
[18:36] <JEEB> I thought that it had the needed info in it
[18:36] <JEEB> with raw pcm you naturally need it tho
[18:36] <JEEB> but wav has a header
[18:37] <fling> JEEB: http://dpaste.com/823085/
[18:38] <fling> JEEB: but ncmpcpp and awesome can read from this pipe
[18:38] <fling> prw-r--r-- 1 fling fling 0 Nov 3 00:38 /tmp/mpd2ffmpeg.fifo
[18:39] <fling> so how to make it to be raw pcm instead of wav?
[18:45] <JEEB> you make whatever is pushing stuff into the pipe output raw pcm and then see the matching format for it from 'ffmpeg -formats'?
[18:46] <JEEB> also sorry, I have no idea what you are doing exactly that makes it push out that error
[18:46] <JEEB> I just googled but it doesn't seem to be an ffmpeg-specific bug at least
[18:46] <fling> JEEB: I have mpd playing in the pipe
[18:46] <JEEB> then have mpd output raw pcm?
[18:46] <fling> http://dpaste.com/823092/
[18:46] <JEEB> then see ffmpeg's -formats output and set what seems proper
[18:47] <fling> so if mpd is paused or stopped it sends zeros to the pipe
[18:47] <fling> and ffmpeg just waits
[18:47] <fling> when I press play ffmpeg gives me this error :p
[18:47] <JEEB> are you sure what your mpd configuration is pushing out btw?
[18:48] <JEEB> if it's wav with the header first, or raw pcm?
[18:48] <fling> JEEB: this works: `ffplay -f s16le -ac 2 -ar 44100 -i /tmp/mpd2ffmpeg.fifo´
[18:48] <fling> JEEB: thanks :]
[18:48] <JEEB> then it was not wav to begin with, yes
[18:49] <fling> JEEB: mpd is missing headers, hmmmkay
[18:49] <JEEB> not sure you want headers with a streaming situation where you might not be getting the first bytes anyways tho
[18:49] <fling> right&
[18:49] <JEEB> so as long as you know what's coming in I guess it's fine?
[18:50] <fling> do I need -vpre or -preset with libx264?
[18:50] <fling> JEEB: sound works fine now
[18:50] <JEEB> generally -preset is what you want nowadays, the stuff under -vpre used to be there before libx264 got its own preset system, and the few ffpresets left are for very specific use cases
[18:51] <JEEB> also you probably want to update to current git HEAD ffmpeg if you're building yourself
[18:51] <fling> JEEB: I'm using gentoo's portage
[18:51] <JEEB> a list of x264's internal presets can be seen here: http://mewiki.project357.com/wiki/X264_Settings#preset
[18:51] <JEEB> fling, I kind of gathered that from the ricer flags :P
[18:51] <fling> hehe :]
[18:52] <fling> my mpd sounds better with these flags :]
[18:52] <JEEB> I think there were some lossless ffpreset files as well, and for those you should just set -crf 0 if you're using a 8bit libx264
[18:54] <fling> JEEB: lossless? why do you think I need lossless?
[18:54] <JEEB> I have no idea what you're doing
[18:54] <JEEB> I just noted that there was such a ffpreset and what you should do if you were using it
[18:55] <fling> JEEB: great! thanks :p
[18:55] <fling> I have only few alsa things left to fix&
[18:55] <JEEB> if you are streaming you most probably want to set -maxrate and -bufsize to your needed values too
[18:55] <fling> JEEB: what are good values?
[18:56] <JEEB> -maxrate being the maximum video bandwidth available (minimum bandwidth needed to watch the stream), and bufsize is the amount of buffer over which maxrate is calculated
[18:56] <JEEB> if you know how many seconds the player side will buffer, you set the bufsize to SECONDS*maxrate
[18:57] <fling> what if I will set it to larger value?
[18:58] <JEEB> than what the player side is buffering? then you might have the encoder use too many bits and the minimum bit rate requirement gets broken. You generally want to match those up on the player and encoder
[18:58] <JEEB> the idea is that if you buffer bufsize amounts of bits and your transfer rate is at least maxrate you should be able to watch the video without further buffering after the initial one
[18:59] <fling> hmm hmm
[18:59] <fling> shanks again, I need to think about this
[18:59] <fling> s/shanks/thanks/
[18:59] <JEEB> usually the services you might be using for streaming tell you what is the maximum rate and the amount of buffering is if you're not the one administrating everything
[18:59] <fling> and I need to sleep :]
[19:00] <fling> I'm using justin.tv and I'm new to this
[19:00] <JEEB> well you should then check their documentation
[19:00] <JEEB> they probably have some kind of maximum value and some kind of vague representation of the buffering model :P
[19:01] <JEEB> others tell it in seconds, others tell you the maxrate and bufsize specifically
[19:01] <fling> JEEB: is not it enough to use `-b:v 1m´ ?
[19:01] <JEEB> no
[19:01] <JEEB> that is average bit rate over the whole video
[19:01] <fling> oh!
[19:01] <fling> safe to remove?
[19:01] <JEEB> that does not keep anything within any kind of bandwidth model
[19:01] <JEEB> uhhh
[19:02] <JEEB> you usually want to set some kind of rate control mode
[19:02] <JEEB> I prefer crf + vbv (maxrate/bufsize) generally
[19:02] <JEEB> but you can use bitrate too
[19:03] <JEEB> (crf is the closest we have to "constant quality" nowadays in video encoders)
[19:04] <fling> looks like this is good > -crf 25 -maxrate 2000k -bufsize 3000k
[19:05] <JEEB> well, you should generally just check what is the highest crf that still looks good to you. and then the maxrate/bufsize will limit that rate control mode to the bandwith limitations you have :)
[19:05] <fling> and I still need a preset?
[19:06] <JEEB> yes, that controls the overall encoder's settings (speed vs compression)
[19:06] <JEEB> if you are streaming your screen, you should basically select the slowest that is still capable of realtime
[19:06] <fling> veryfast is slowest ;|
[19:07] <fling> i have image freezes with 'fast'
[19:08] <JEEB> well, that's it then
[19:09] <fling> JEEB: looks like I need to use another box for encoding :p
[19:09] <JEEB> :)
[19:10] <JEEB> anyways, congrats -- you have now learned the basics of streaming with libx264 :) rate control mode + vbv (maxrate/bufsize) + slowest preset you can use for your application on your box
[19:11] <juanmabc> achievement completed, proceed to next level, loading...
[19:13] <fling> JEEB: bitrate= 669.9kbits/s
[19:13] <JEEB> overall average, controlled by your crf value
[19:13] <fling> next level is to fix alsa xruns and underruns :p
[19:14] <fling> then duplicate output channels 1 and 2 to 3 and 4
[19:14] <fling> then make alsamixer dmixed
[19:14] <fling> and then create virtual channels from outputs to be able to record from inputs and outputs same time&
[19:17] <fling> JEEB: umm with this crf I have freezes even with veryfast preset
[19:18] <JEEB> then use a faster preset?
[19:18] <fling> right&
[19:18] <JEEB> however you are checking those "freezes" :)
[19:21] <fling> JEEB: the image is bad with superfast hmm hmm
[19:22] <fling> JEEB: or I may thy decrease crf?
[19:22] <JEEB> yes
[19:22] <JEEB> of course the maxrate/bufsize will be limiting its selections, but it should make it look somewhat better if it looks bad (if the reason for the bad looking is indeed the crf value being too high)
[19:25] <fling> JEEB: freezes with `-preset veryfast -crf 25´, no freezes with `-preset veryfast -crf 20´
[19:34] <fling> JEEB: this is my current script version > http://bpaste.net/show/55488/
[19:34] <fling> I see a lot of ts in examples
[19:34] <fling> do I need ts or mkv?
[19:34] <fling> also is ts good for pipe or for file or for both?
[19:36] <JEEB> mpeg-ts is just a long line of packets meant for broadcasting so you can guess ;)
[19:36] <JEEB> matroska should do as well
[19:37] <fling> I use ts for pipes and for file output and I use flv for streaming
[19:37] <fling> do I need to use mkv for file output and ts for streaming?
[19:37] <JEEB> rtmp needs to be flv in the end
[19:38] <JEEB> otherwise you can use whatever works for you the best :P
[19:38] <fling> ok :p
[19:38] <fling> so what about file output? I can't choose between mkv and ts :)
[19:38] <JEEB> might as well use mkv then
[19:39] <fling> ok, so now I'm about to test my setup
[19:39] <fling> ffmpeg rocks! :@
[19:39] <JEEB> also btw
[19:39] <JEEB> make sure your libx264 isn't built with --disable-asm
[19:39] <JEEB> gentoo used to do that for whatever reason on 32bit
[19:40] <JEEB> and then #x264 got quite a few gentoo users complaining about slow speed :P
[19:40] <fling> I use 64bit
[19:40] <JEEB> even so
[19:40] <JEEB> make sure :P
[19:40] <fling> and multilib portage :]
[19:40] <fling> how to check?
[19:40] <JEEB> check the settings for that package or whatever
[19:40] <fling> ok
[19:41] <fling> JEEB: http://dpaste.com/823119/
[19:42] <JEEB> heh
[19:42] <JEEB> they still have that thing with 32bit and pic it seems
[19:42] <fling> I do not use x86 and I do not use pic&
[19:42] <JEEB> you said that already
[19:43] <fling> sorry
[19:52] <fling> JEEB: will not buffer increase help with picture freezes?
[19:53] <JEEB> fling, no
[19:55] <JEEB> if a picture freezes (Depending on how you are testing it), you are either going over limits with maxrate/bufsize (either with the settings you have set, or libx264 will be telling you it has failed -- latter generally shouldn't happen nowadays since libx264 has various emergency modes to even keep /dev/urandom input under various limits), or you are not going fast enough
[19:55] <JEEB> or, if you are joining the stream before an IDR frame
[19:55] <JEEB> (or after one)
[19:55] <JEEB> and you have to wait until the next one
[19:55] <JEEB> those three in general can cause "picture freeze"
[19:56] <JEEB> libx264 by itself does not cut out pictures or anything like that
[19:59] <fling> which acodec do I need for flv?
[20:00] <fling> aac?
[20:00] <JEEB> you need aac as the audio format, yes. you might want to compile fdk-aac yourself into ffmpeg for that to get the best possible encoder
[20:00] <JEEB> https://github.com/mstorsjo/fdk-aac
[20:01] <JEEB> needs --enable-nonfree in ffmpeg enabled
[20:03] <fling> JEEB: ok, looks like I need latest ffmpeg&
[20:03] <fling> JEEB: will mplayer2 compile with it? :p
[20:05] <brontosaurusrex> aac in flv?
[20:10] <JEEB> fling, yes -- look at the 'unstable' branch if the master branch doesn't
[20:11] <JEEB> brontosaurusrex, specified just fine :P
[20:13] <brontosaurusrex> yeah i see, totally forgot about that
[20:20] <fling> JEEB: -acodec aac -ab 128k > [flv @ 0x117ef20] Tag [3][0][0][0]/0x00000003 incompatible with output codec id '86016' drop=0
[20:29] <JEEB> no idea :P
[20:29] <JEEB> also if you want to use fdk-aac you have to call it
[20:29] <JEEB> libfdk_aacenc or whatever it was
[20:29] <JEEB> should be listed under -codecs
[20:29] <JEEB> also
[20:30] <JEEB> if you didn't use -strict experimental you most probably have another error in there before that
[20:30] <JEEB> the internal aac encoder (ffaac) only works with -strict experimental
[20:42] <bjrohan> I am baaaack with lots of questions on recording my desktop with audio using ffmpeg commandline (as I hear that is the best way to do it for best quality). Can anyone supply me with a basic line to record mydesktop (1680x1050) with audio? Without compression if that will give me best recording resutls.
[20:42] <bjrohan> I have tried: ffmpeg -f alsa -ac 2 -i pulse -f x11grab -r 30 -s 1024x768 -i :0.0 -acodec pcm_s16le -vcodec libx264 -preset ultrafast -crf 0 -threads 0 output.mkv but I get an error unknown input format "alsa" from the static build I have
[20:51] <brontosaurusrex> bjrohan: ffmpeg -formats | grep alsa < gives what?
[20:53] <bjrohan> http://paste.ubuntu.com/1327349/
[20:54] <brontosaurusrex> bjrohan: that means it doesnt even have alsa as format
[20:55] <bjrohan> what doesn't. my ffmpeg install?
[20:55] <bjrohan> I am new so please bear with me. Instead of Alsa I can have pulse correct?
[20:56] <bjrohan> I am using the ffmpeg static build for Ubuntu
[20:58] <brontosaurusrex> seems like a compile of ffmpeg with --enable-x11grab is needed
[20:59] <bjrohan> Makes sense. The only instructions I have found and were also recommended on here is here: https://ffmpeg.org/trac/ffmpeg/wiki/UbuntuCompilationGuide
[21:00] <bjrohan> following this, I think it adds in the xgrab no?
[21:00] <bjrohan> cd
[21:00] <bjrohan> git clone --depth 1 git://source.ffmpeg.org/ffmpeg
[21:00] <bjrohan> cd ffmpeg
[21:00] <bjrohan> ./configure --enable-gpl --enable-libfaac --enable-libfdk-aac --enable-libmp3lame \
[21:00] <bjrohan> --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-librtmp --enable-libtheora \
[21:00] <bjrohan> --enable-libvorbis --enable-libvpx --enable-x11grab --enable-libx264 --enable-nonfree \
[21:00] <bjrohan> --enable-version3
[21:00] <bjrohan> (since it is just you and I on here active)
[21:03] <brontosaurusrex> seems like a compile of ffmpeg with --enable-x11grab is needed
[21:03] <brontosaurusrex> whatever that is
[21:03] <brontosaurusrex> you dont need libvpx, theora
[21:04] <bjrohan> I don't need both of those, OR, I need theora instead of libvpx?
[21:04] <bjrohan> theora is an audio codec correct?
[21:06] <bjrohan> but add the x264 and the fdk-aac
[21:07] <brontosaurusrex> correct, no theora no vpx
[21:10] <bjrohan> I see where to leave out (rather not do the extra work) for the libvpx, Theora is enabled on the section FFMPEG towards the bottom
[21:11] <bjrohan> correct?
[21:16] <bjrohan> Hey brontosaurusrex I have finished the instructions on that page. I am pretty sure ffmpeg is now in ~/ffmpeg. How do I add that to my executable path so when I commanline ffmpeg it goes there?
[21:17] <bjrohan> OKay, not it isn't. I went in that dir, there is no ffmpeg
[21:20] <foonix> bjrohan: some distros have already ~/bin in $PATH, so put ffmpeg binary into it and no need to modify anything
[21:20] <foonix> echo $PATH to verify it
[21:20] <bjrohan> foonix I can't seem to find where the process I just ran put the new ffmpeg :-(
[21:20] <brontosaurusrex> yes, test with "whihc ffmpeg"
[21:20] <brontosaurusrex> which*
[21:21] <foonix> i guess into default prefix, so /usr/local/bin maybe ?
[21:21] <bjrohan> which ffmpeg gives me nothing
[21:22] <bjrohan> ffmpeg says prgram not currently installed type sudo-apt get blah blah blah
[21:22] <bjrohan> I check usr/local/bin has a new x264 not ffmpeg
[21:22] <bjrohan> and /usr/bin does not hae ffmpeg
[21:23] <brontosaurusrex> you did "make install"?
[21:23] <brontosaurusrex> and everything was error free?
[21:23] <bjrohan> Let me check I copied and pasted all output from the line of commands on the FFMPEG.org page
[21:23] <brontosaurusrex> bjrohan: what os are you on?
[21:25] <bjrohan> Kubunutu 12.10
[21:28] <bjrohan> I am going to undo and redo all of this to check. I can't find any error messages
[21:28] <bjrohan> Here is EVERYTHING I did:
[21:28] <bjrohan> http://paste.ubuntu.com/1327445/
[21:28] <brontosaurusrex> why not just use some recorder from repo?
[21:29] <brontosaurusrex> here is my crapy try https://dl.dropbox.com/u/79532365/test2.webm (using first thing i found in repos)
[21:30] <brontosaurusrex> i mean iam sure ffmpeg would work better, but its over your head
[21:31] <bjrohan> That is VERY nice quality
[21:31] <brontosaurusrex> let me try the same with mp4/AVC
[21:31] <brontosaurusrex> hold on ...
[21:31] <bjrohan> ok
[21:31] <donkeycongo> Sorry if I am way off. I dont have much experience with video-encoding. I have >300 videos in mp4/h.264 format on a server, and I just now realized that they are in "lower field order", while Silverlight(ie) and iPhones only accept "progressive". This means that i have to re-encode all of them. Is it possible to do this automatically with FFmpeg somehow?
[21:31] <donkeycongo> Thanks
[21:33] <RobertNagy> why do I get drop_output > 0 on SwrContext, after the first call to swr_convert, which is preceeded by swr_next_ptr(swr_, 0)?
[21:33] <brontosaurusrex> donkeycongo: read on yadif
[21:36] <bjrohan> brontosaurusrex: did you do all of that by way of the install I am trying to do?
[21:36] <donkeycongo> brontosaurusrex: Seems way over my head. How much work are we talking for someone experienced?
[21:37] <brontosaurusrex> bjrohan: nope
[21:37] <brontosaurusrex> hold on
[21:37] <bjrohan> okay.
[21:38] <bjrohan> It really matters not to me I just want it to record a desktop with audio from my webcam in great quality on an older machine, so I can record uncompressed, then compress afterwards
[21:38] <brontosaurusrex> ok, AVC version looks almost good (if 15 fps is ever good)
[21:39] <brontosaurusrex> bjrohan: the tool is named kazam
[21:39] <brontosaurusrex> is in debian repos, perhaps ubuntu has it as well
[21:40] <bjrohan> I have tried using Kazam (gui for ffmpeg as i understand it) but 2 things, ii will sometimes act like it is recording, when I hit finished, nothing happens. I let it sit for an hour nothin, no file etc. If it doew record a file, it only record about 10 seconds of audio, then no audio :-(
[21:40] <bjrohan> Kazam needs ffmpeg to be install right, which Mine is not
[21:41] <brontosaurusrex> well, audio seems fail here as well
[21:41] <bjrohan> aahh
[21:41] <brontosaurusrex> avc test https://dl.dropbox.com/u/79532365/testAVCvideo.mp4 (if i select audio it crashes)
[21:42] <bjrohan> And you are using your current install of ffmpeg correct?
[21:42] <brontosaurusrex> donkeycongo: an hour perhaps
[21:43] <brontosaurusrex> donkeycongo: if the files will fly in
[21:43] <donkeycongo> brontosaurusrex: What does that mean?
[21:43] <brontosaurusrex> donkeycongo: but, always take the master files, dont reconvert
[21:43] <brontosaurusrex> you asked : How much work are we talking for someone experienced?
[21:44] <donkeycongo> Ye, was referring to the latter "if the files will fly in"
[21:44] <donkeycongo> As in dont cause any trouble?
[21:45] <brontosaurusrex> well, the masters may be really big
[21:46] <brontosaurusrex> unless this files are actually progressive and were just marked lff
[21:46] <brontosaurusrex> bjrohan: no ffmpeg there, its using gstreamer as it seems
[21:46] <donkeycongo> brontosaurusrex: There arent any "masters." It is a collection of web videos resized, watermarked and encoded.
[21:46] <bjrohan> ahh
[21:47] <donkeycongo> brontosaurusrex: Yadif is for AviSynth which is Windows software, right? I have the videos on a Debian server
[21:47] <brontosaurusrex> donkeycongo: are they just flaged incorectly, or is it really interlaced stuff?
[21:47] <brontosaurusrex> donkeycongo: yadif is also a filter in ffmpeg
[21:48] <donkeycongo> I assume it is interlaced. Field order was set to "lower" in Adobe PRemiere Pro
[21:48] <bjrohan> brontosaurusrex: Looks like it. Since I uninstall all ffmpeg now I will try Kazam
[21:48] <brontosaurusrex> donkeycongo: upload a sample and url (if its not porn, no support for porn sites here)
[21:49] <donkeycongo> Can I message it to you?
[21:49] <brontosaurusrex> sure
[21:49] <bjrohan> brontosaurusrex: I can start Kazam, begin recording, I get the iconin systray. When I right click it and finish it is fine, then goes blurry (the icon) and nothing happens. In system monitor is is alive taking up memry but not CPU
[21:50] <brontosaurusrex> bjrohan: actually ill dig into this, give me a day or two
[21:50] <brontosaurusrex> but no promises
[21:53] <brontosaurusrex> donkeycongo: yeah, probably there is no way to just restream this and flag as progressive
[21:53] <bjrohan> Thank you brontosaurusrex
[21:53] <brontosaurusrex> donkeycongo: but i havent tryed
[21:54] <donkeycongo> Ye, I guessed. Im never that lucky.
[21:54] <brontosaurusrex> also, you cant deinterlace this anymore
[21:54] <brontosaurusrex> due to being resized
[21:54] <brontosaurusrex> unless this was actually resized in interlaced manner
[21:55] <brontosaurusrex> so perhaps try to use yadif and see what happens, there should be no interlacing visible and no aliasing
[21:55] <brontosaurusrex> actually iam bit surprised, i do only progressive video for the last 10 years
[21:58] <donkeycongo> brontosaurusrex: I imagine it cant be that uncommon to deinterlace/encode in bulks. Do you know of some demonstrated case I could take a look at? Im pretty screwed if I dont fix it. Would take me days to reencode 300 videos.
[21:58] <brontosaurusrex> its not uncommon i guess
[21:59] <donkeycongo> brontosaurusrex: It wasnt resized after being interlaced.
[21:59] <brontosaurusrex> but the masters have the original width/height
[21:59] <brontosaurusrex> 480*272 px?
[21:59] <brontosaurusrex> what kind of format is that then?
[21:59] <brontosaurusrex> brb
[21:59] <donkeycongo> 16/9
[22:00] <donkeycongo> I took flv videos, put them in an Adobe Premiere project, and rendered it with more or less default settings.
[22:03] <brontosaurusrex> and the timeline was interlaced?
[22:04] <brontosaurusrex> check your pm
[22:27] <stephanedev> hi everyone. sorry if my question sounds silly, i have been working with multimedia API's for only a couple of months.
[22:28] <stephanedev> is it possible to share the same AVCodecContext instance between different streams?
[22:33] <kevin11> hello anyone. I was on a couple days ago with upgrade problems for the latest ffmpeg on Ubuntu Lucid Lynx. I still am not able to successfully upgrade. any help appreciated.
[22:34] <durandal_1707> kevin11: needs more info
[22:34] <kevin11> followed instructions here : https://ffmpeg.org/trac/ffmpeg/wiki/UbuntuCompilationGuideLucid
[22:35] <kevin11> result : kolds at ubuntujeos:~$ ffmpeg -version
[22:35] <kevin11> The program 'ffmpeg' is currently not installed. You can install it by typing:
[22:35] <kevin11> sudo apt-get install ffmpeg
[22:36] <stephanedev> the idea is to encode a set of images using let's say VP8, and in parallel: 1) stream the generated video using RTP 2) save the video in a matroska file
[22:37] <stephanedev> of course i would like to encode the video (using vp8) only once
[22:37] <grepper> kevin11: if you run: /usr/local/bin/ffmpeg , does it exist ?
[22:39] <kevin11> does not.
[22:39] <kevin11> I have a .deb file in ~/ffmpeg
[22:39] <kevin11> ffmpeg_5:git-2012-06-05-787c395-1_amd64.deb
[22:39] <grepper> dpkg -i ffmpeg_5:git-2012-06-05-787c395-1_amd64.deb
[22:40] <grepper> guess you checkinstall does not auto install a created package
[22:40] <grepper> your*
[22:41] <stephanedev> so i was thinking of creating my own AVCodecContext instance using avcodec_alloc_context3, but i am not sure how to use it with a stream created by avformat_new_stream since this function seems to allocate another AVCodecContext (stream->codec)
[22:42] <kevin11> do I need to mv the .deb to /usr/local/bin before I dpkg?
[22:46] <grepper> no
[22:47] <grepper> store it with your other self installed debs somewhere if you wish
[22:48] <grepper> /usr/local/bin is for command binaries
[22:48] <Mavrik> stephanedev: that's the decoder context.
[22:48] <bjrohan> I have uninstalled ffmpeg from my distro and my static ffmpeg, and installed by compiling myself (I think via ffmpeg.org instructions for ubuntu). I was able to record a screencast but the quailty was bad. Can someone help me get the video quality up, AND record with sound?
[22:49] <stephanedev> Mavrik: thanks for your answer. what is the decoder context? right now i am just focusing on the encoding side
[22:50] <kevin11> didn't seem to work. I get output that it installs w/o error, yet not there
[22:52] <bjrohan> Can someone help me out. What codec if any is this recording in: ffmpeg -f alsa -ac 2 -i pulse -f x11grab -r 30 -s 1680x1050 -i :0.0 -acodec pcm_s16le -vcodec libx264 -preset ultrafast -crf 0 -threads 0 output.mkv
[22:53] <kevin11> going to start from scratch. May be back in a bit.
[22:56] <grepper> kevin_b: that is strange - try listing the contents of the deb file
[22:56] <bjrohan> Grrrrrr. I am having serious issues with getting ffmpeg to record in decent quality, AND have it synch the audio and video. Any suggestions?
[22:58] <Mavrik> bjrohan: your parameters are nonsensical
[22:58] <Mavrik> crf 0?
[22:58] <Mavrik> and why raw audio?
[22:58] <bjrohan> I don't know what I am doing to tell you the truth, as if you couldn't tell. I have been having issues with different trials and errors for weeks
[22:59] <bjrohan> Mavrik: I have just compiled ffmpeg with x264 and other things (tutorial here):https://ffmpeg.org/trac/ffmpeg/wiki/UbuntuCompilationGuide
[22:59] <Mavrik> yeah, not reading up on what you're ding does that.
[22:59] <Mavrik> *doing
[22:59] <bjrohan> Mavrik: I get different answers from different people, and read various things then try them
[22:59] <Mavrik> bjrohan: first get a decent CRF setting (like 23 or 20 if you really want to waste space)
[22:59] <Mavrik> switch encode to aac
[23:00] <Mavrik> sorry, audio encoder to aac
[23:00] <bjrohan> what is a decent crf?
[23:00] <Mavrik> and FIST and foremost
[23:00] <Mavrik> so we see what ffmpeg you have and what exacly is going wrong.
[23:00] <bjrohan> what command would you like to see me run?
[23:00] <stephanedev> i can create my video file using the AVCodecContext from the stream created by avformat_new_stream
[23:01] <bjrohan> Mav
[23:01] <stephanedev> but is there a way to create a stream with an existing AVCodecContext?
[23:01] <bjrohan> Mavrik: I have a laptop with 1680x1050 resolution that I want to record the desktop with audio from my webcam what would be a good starting point?
[23:02] <Mavrik> stephanedev: you shouldn't.
[23:02] <Mavrik> bjrohan: fix your crf to numbers I mentioned above
[23:02] <Mavrik> see the quality
[23:02] <Mavrik> give us the output in the pastebin
[23:02] <Mavrik> and let's work from there
[23:02] <stephanedev> Mavrik: thanks. but how to share an encoding between different streams then?
[23:04] <Mavrik> AVCodecContext describes the state and internal variables of an encoder
[23:04] <Mavrik> you can't share that
[23:04] <Mavrik> if you wanna double up encoded frames you have to do it on muxer level
[23:05] <bjrohan> bjrohan at bjrohan-MM061:~$ ffmpeg -f alsa -ac 2 -i pulse -f x11grab -r 30 -s 1680x1050 -i :0.0 -acodec pcm_s16le -vcodec libx264 -preset ultrafast -crf 25 -threads 0 output.mkv
[23:05] <bjrohan> ffmpeg version git-2012-11-02-77d89a5 Copyright (c) 2000-2012 the FFmpeg developers
[23:05] <bjrohan> built on Nov 2 2012 14:27:29 with gcc 4.7 (Ubuntu/Linaro 4.7.2-2ubuntu1)
[23:05] <bjrohan> configuration: --enable-gpl --enable-libfaac --enable-libfdk-aac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-librtmp --enable-libtheora --enable-libvorbis --enable-libvpx --enable-x11grab --enable-libx264 --enable-nonfree --enable-version3
[23:05] <bjrohan> libavutil 52. 2.100 / 52. 2.100
[23:05] <bjrohan> libavcodec 54. 70.100 / 54. 70.100
[23:05] <bjrohan> libavformat 54. 35.100 / 54. 35.100
[23:05] <bjrohan> libavdevice 54. 3.100 / 54. 3.100
[23:05] <bjrohan> libavfilter 3. 21.106 / 3. 21.106
[23:05] <bjrohan> libswscale 2. 1.102 / 2. 1.102
[23:05] <bjrohan> libswresample 0. 16.100 / 0. 16.100
[23:05] <bjrohan> libpostproc 52. 1.100 / 52. 1.100
[23:05] <bjrohan> [alsa @ 0x9def7c0] Estimating duration from bitrate, this may be inaccurate
[23:05] <bjrohan> Guessed Channel Layout for Input Stream #0.0 : stereo
[23:05] <bjrohan> Input #0, alsa, from 'pulse':
[23:05] <bjrohan> Duration: N/A, start: 1351893822.887415, bitrate: 1536 kb/s
[23:05] <bjrohan> Stream #0:0: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
[23:05] <bjrohan> [x11grab @ 0x9decc00] device: :0.0 -> display: :0.0 x: 0 y: 0 width: 1680 height: 1050
[23:05] <bjrohan> [x11grab @ 0x9decc00] shared memory extension found
[23:05] <bjrohan> [x11grab @ 0x9decc00] Estimating duration from bitrate, this may be inaccurate
[23:05] <bjrohan> Input #1, x11grab, from ':0.0':
[23:05] <bjrohan> Duration: N/A, start: 1351893822.937167, bitrate: 1693440 kb/s
[23:05] <bjrohan> Stream #1:0: Video: rawvideo (BGR[0] / 0x524742), bgr0, 1680x1050, 1693440 kb/s, 30 tbr, 1000k tbn, 30 tbc
[23:05] <bjrohan> File 'output.mkv' already exists. Overwrite ? [y/N] y
[23:05] <bjrohan> using cpu capabilities: MMX2 Cache64
[23:05] <bjrohan> [libx264 @ 0x9e20440] profile High 4:4:4 Predictive, level 4.0, 4:4:4 8-bit
[23:05] <bjrohan> [libx264 @ 0x9e20440] 264 - core 128 r2 198a7ea - H.264/MPEG-4 AVC codec - Copyleft 2003-2012 - http://www.videolan.org/x264.html - options: cabac=0 ref=1 deblock=0:0:0 analyse=0:0 me=dia subme=0 psy=1 psy_rd=1.00:0.00 mixed_ref=0 me_range=16 chroma_me=1 trellis=0 8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=6 threads=3 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0
[23:05] <bjrohan> bframes=0 weightp=0 keyint=250 keyint_min=25 scenecut=0 intra_refresh=0 rc=crf mbtree=0 crf=25.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=0
[23:06] <bjrohan> Output #0, matroska, to 'output.mkv':
[23:06] <bjrohan> Metadata:
[23:06] <bjrohan> encoder : Lavf54.35.100
[23:06] <bjrohan> Stream #0:0: Video: h264, yuv444p, 1680x1050, q=-1--1, 1k tbn, 30 tbc
[23:06] <juanmabc> oh, lord
[23:06] <bjrohan> Stream #0:1: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
[23:06] <bjrohan> Stream mapping:
[23:06] <bjrohan> Stream #1:0 -> #0:0 (rawvideo -> libx264)
[23:06] <bjrohan> Stream #0:0 -> #0:1 (pcm_s16le -> pcm_s16le)
[23:06] <bjrohan> Press [q] to stop, [?] for help
[23:06] <bjrohan> frame= 412 fps= 12 q=13351205.0 Lsize= 7914kB time=00:00:13.73 bitrate=4721.1kbits/s
[23:06] <bjrohan> video:5529kB audio:2319kB subtitle:0 global headers:0kB muxing overhead 0.851180%
[23:06] <bjrohan> [libx264 @ 0x9e20440] frame I:2 Avg QP:19.50 size:496491
[23:06] <bjrohan> [libx264 @ 0x9e20440] frame P:410 Avg QP:16.53 size: 11385
[23:06] <bjrohan> [libx264 @ 0x9e20440] mb I I16..4: 100.0% 0.0% 0.0%
[23:06] <bjrohan> [libx264 @ 0x9e20440] mb P I16..4: 1.0% 0.0% 0.0% P16..4: 2.7% 0.0% 0.0% 0.0% 0.0% skip:96.3%
[23:06] <bjrohan> [libx264 @ 0x9e20440] coded y,u,v intra: 39.5% 29.1% 28.8% inter: 1.4% 1.1% 1.1%
[23:06] <bjrohan> [libx264 @ 0x9e20440] i16 v,h,dc,p: 61% 29% 7% 3%
[23:06] <juanmabc> ircterminal
[23:06] <bjrohan> [libx264 @ 0x9e20440] kb/s:3297.63
[23:06] <bjrohan> crap!!
[23:06] <bjrohan> sorrryyy
[23:06] <bjrohan> http://paste.ubuntu.com/1327670/
[23:06] <bjrohan> I am sooo sorry!
[23:06] <bjrohan> Mavrik: That is the pastbin of the results. the audio and video are still out of synv
[23:06] <stephanedev> Mavrik: thanks again for taking the time to answer
[23:08] <stephanedev> the way i understand it is: image-src -> vp8-encoder -> (0)(0) -> webm-muxer -> output-file
[23:08] <stephanedev> sorry, unclear formatting
[23:08] <stephanedev> image-src -> vp8-encoder -> (0)
[23:08] <stephanedev> (0) -> webm-muxer -> file
[23:09] <stephanedev> (0) -> rtp-stream
[23:09] <bjrohan> I am assuming when libx264 says skip96.3% that is an issue?
[23:10] <stephanedev> for the vp8 encoding part, i use avcodec_encode_video2 with a codec context
[23:11] <bjrohan> I have been blocked huh?
[23:12] <stephanedev> that's why i thought i need to share the codec context between 2 streams so that i don't encode twice
[23:15] <Mavrik> stephanedev: you'll probably need a webm-muxer and a rtp-muxer
[23:15] <stephanedev> Mavrik: thanks. yes i agree
[23:15] <Mavrik> stephanedev: so it looks like this
[23:16] <stephanedev> i actually have some code based on the muxing.c example
[23:16] <Mavrik> image-src -> (images) -> vp8-encoder -> (encoded packets) -=> webm-muxer/rtp-muxer
[23:16] <Mavrik> basically what you do is intialize 2 muxers with one stream each
[23:16] <stephanedev> but i don't quite understand how to share the encoding part between the 2 streams
[23:16] <Mavrik> and then pass encoded packets t them
[23:17] <Mavrik> stephanedev: you have a single encoder that gives you encoded frames by calling avcodec_encode_video or whatever it is
[23:17] <stephanedev> yes
[23:17] <Mavrik> you then pass the result to 2 muxers: webm and rtp with av_write_frame or what is it
[23:17] <stephanedev> and this encoder uses an AVCodecContext, am i right?
[23:17] <Mavrik> so you call av_write_frame twice
[23:18] <Mavrik> stephanedev: gimme a sec to open sourc e:)
[23:18] <stephanedev> Mavrik: sure, thank you very much
[23:19] <stephanedev> as i understand it, a muxer is associated to an AVFormatContext instance
[23:19] <stephanedev> while an encoder is associated to an AVCodecContext instance
[23:20] <stephanedev> does it make sense?
[23:20] <Mavrik> yeah, it's exactly that
[23:20] <Mavrik> you'll have a single AVCodecContext (since you have one encoder on one thread)
[23:20] <Mavrik> and two AVFormatContexts (one for webm, one for rtp)
[23:21] <stephanedev> yes that's what i have so far
[23:21] <Mavrik> then when you call avcodec_encode_video2 you'll get an encoded packet
[23:21] <stephanedev> actually i call avformat_new_stream first
[23:21] <Mavrik> and then you call av_interleaved_write_frame() twice
[23:21] <Mavrik> once for each avformatcontext
[23:22] <stephanedev> i understand the steps you described
[23:23] <stephanedev> but i thought that i needed to add a video stream to the AVFormatContext first
[23:25] <stephanedev> and my concern is that when adding this video stream with avformat_new_stream, it comes with its own AVCodecContext
[23:29] <stephanedev> welcome back Mavrik. not sure what the last message you got from me is?
[23:30] <Mavrik> yuck, my internet died.
[23:30] <Mavrik> stephanedev: er, nothing, ony my monologue :D
[23:31] <stephanedev> ok, so i'll recap
[23:31] <stephanedev> i understood the steps you described (very clear by the way, thanks)
[23:32] <stephanedev> i thought that before muxing, i need to add a video stream to the AVFormatContext using avformat_new_stream
[23:33] <stephanedev> is that correct?
[23:33] <Mavrik> stephanedev: yeah
[23:33] <Mavrik> "stream" is a concept that belongs to a format (that is - container)
[23:34] <Mavrik> encoders don't have notion of streams - they just process a sequence of images (or audio samples)
[23:34] <Mavrik> so when you initialize a format you need to tell it how many streams it can expect
[23:34] <stephanedev> yes, that's what i thought and read in some documen
[23:34] <stephanedev> document*
[23:35] <stephanedev> so my concern now is: the stream returned by avformat_new_stream comes with its own AVCodecContext (stream->codec)
[23:35] <Mavrik> stephanedev: i'm not really sure that's set
[23:35] <Mavrik> lemme check the docs
[23:36] <stephanedev> at least it's allocated according the muxing.c
[23:36] <stephanedev> according to*
[23:36] <stephanedev> then some of its fields are set (bit_rate, width, height, ...)
[23:37] <Mavrik> stephanedev: ah, I se
[23:37] <Mavrik> stephanedev: if you read the comment in avformat.h in AVStream
[23:37] <stephanedev> let me open it
[23:38] <Mavrik> it says that when encoding that AVCodecContext is just used to read some codec-related data for formats that need it (like resolution, bitrate, etc.)
[23:38] <Mavrik> so it can be pretty much any AVCodecContext that has those few fields set
[23:38] <Mavrik> meaning that I think you can set same AVCodecContext for both muxers
[23:39] <Mavrik> (getting long way around to the answer) :P
[23:44] <stephanedev> Mavrik: ahhh it's much clearer now
[23:45] <stephanedev> "Mandatory fields as specified in AVCodecContext documentation must be set even if this AVCodecContext is not actually used for encoding."
[23:45] <Mavrik> yeah
[23:45] <stephanedev> and it was all in the doxygen doc, my apologies :(
[23:45] <Mavrik> the Contexts are actually a hack on the fact C isn't an object-oriented language :)
[23:46] <Mavrik> since you can't create an instance of an "encoder" you have to create a context that is (essentialy) an object :P
[23:46] Action: Mavrik hides from language pundits.
[23:46] <stephanedev> i focused too much on the function documentation without checking enough the struct documentation (guess what langauge i'm using...)
[23:47] <Mavrik> C++? :P
[23:47] <stephanedev> good guess!
[23:48] <Mavrik> anyway, hope I helped
[23:48] <Mavrik> I wonder where the previous guy went to though.
[23:48] <stephanedev> Mavrik: i am very grateful for the help you provided. i apologize again as it was all in the documentation and i didn't see it
[23:48] <Mavrik> *shrug*
[23:48] <Mavrik> ffmpeg documentation when it comes to APIs is... interesting :D
[23:49] <stephanedev> yeah, it's kind of terse sometimes, but still better than nothing
[23:49] <stephanedev> and now i will remember to look at the struct documentation more
[23:50] <stephanedev> thank you very much again!
[23:58] <bjrohan> Hello. I am back from an errand and promise not to post too many lines at once by accident again!
[23:58] <bjrohan> Mavrik: Are you still here by chance?
[23:58] <Mavrik> bjrohan: yeah, I was busy before
[23:58] <Mavrik> :)
[23:58] <bjrohan> I flooded, sorry. Embarassing
[23:58] <Mavrik> bjrohan: how did you result look?
[23:59] <bjrohan> crappy, and the audio/video was not in sync
[23:59] <Mavrik> in what way does the video look crappy? are the colors off? blocky? text blurry?
[00:00] --- Sat Nov 3 2012
More information about the Ffmpeg-devel-irc
mailing list