[02:21] <norbert_> hi folks, I'm using ffmpeg to record the desktop, an area of 1280x720, at 25 fps [02:21] <norbert_> for some reason it's framedropping, even though CPU usage for dual core is only at 50% (of 200%) using recording [02:21] <norbert_> I don't need the audio [02:21] <norbert_> what I'm using is: ffmpeg -an -f x11grab -r 25 -s 1280x720 -i :0.0+46,118 -vcodec ffvhuff -crf 0 output.avi [02:22] <sacarasc> What's your disk usage looking like? [02:22] <norbert_> iotop shows about 30 M/s [02:23] <norbert_> 99.99% IO> now and then [02:23] <norbert_> interesting [02:23] <norbert_> so that's the problem then [02:23] <norbert_> I need a non-raw codec? [02:23] <klaxa> ffvhuff is not raw ;) [02:24] <klaxa> you could try libx264 with -qp 0 [02:24] <klaxa> and -preset ultrafast [02:24] <norbert_> I don't have 264 compiled here [02:24] <klaxa> that should put more strain on the CPU, but le-- oh [02:24] <klaxa> well what codecs DO you have available? and would compiling x264 be an option? [02:24] <norbert_> I think most Linux distros don't have 264, not even Ubuntu [02:24] <klaxa> because right now, it's the best option [02:24] <klaxa> um... i think most have [02:26] <norbert_> maybe the static build at http://ffmpeg.gusari.org/static/32bit/ has it, let me check [02:26] <klaxa> oh right, those usually have it [02:26] <klaxa> but no x11grab i think [02:27] <norbert_> Unknown input format: 'x11grab' [02:27] <norbert_> right [02:27] <klaxa> you could do some weird piping, but that might reduce performance heavily [02:27] <klaxa> not too sure how well pipes play in this [02:28] <norbert_> any idea why such static builds do not include x11grab? [02:28] <klaxa> actually i don't know [02:28] <klaxa> i know too little about X and ffmpeg to answer that question [02:28] <norbert_> ok [02:28] <klaxa> it will probably have to do something with shared libraries and runtime stuff [02:29] <klaxa> x11grab accesses the pixels over a shared memory segment with X [02:29] <klaxa> as far as i understand [02:29] <norbert_> do you know a nice configure string I can use to get the ffmpeg I need with both x11grab and libx264? [02:31] <norbert_> I don't think Ubuntu has x264 support either, last time I used Ubuntu it didn't [02:31] <norbert_> Debian doesn't either, and I'm on Mint so Mint doesn't either [02:32] <norbert_> Unknown encoder 'libx264' [02:33] <buu> --enable-libx264 enable H.264 encoding via x264 [no] [02:33] <norbert_> yeah, and --enable-x11grab [02:33] <norbert_> default [no], yeah [02:34] <norbert_> weird "libx264 is gpl and --enable-gpl is not specified." [02:34] <norbert_> I'd expect that to say not gpl, and --disable-gpl [02:34] <klaxa> well the configure line i use for my custom build is: [02:34] <klaxa> --enable-gpl --enable-nonfree --enable-libass --enable-libfdk-aac --enable-libvorbis --enable-libx264 --enable-librtmp --enable-libvpx --enable-libopus --enable-shared --enable-x11grab --enable-pic [02:35] <klaxa> i think that covers pretty much everything i need and use [02:35] <klaxa> x264, vpx, ass, aac, vorbis, opus, x11grab [02:35] <klaxa> and well rtmp if i ever need it [02:35] <norbert_> looks good [02:35] <norbert_> it's running [02:38] <klaxa> oh hmm... libpulse maybe too if that's needed as an input dev? :x [02:38] <norbert_> libfdk_aac seems a bit weird in there [02:38] <norbert_> I guess I could compile it from: git clone --depth 1 git://github.com/mstorsjo/fdk-aac.git [02:38] <norbert_> but it's not in the apt repos [02:39] <norbert_> well, I'm not recording audio, so libpulse isn't necessary [02:39] <norbert_> so I guess I can remove the AAC audio encoder as well [02:40] <klaxa> sure [02:55] <norbert_> hm... it says: ./ffmpeg: error while loading shared libraries: libavdevice.so.55: cannot open shared object file: No such file or directory [02:56] <norbert_> even though "libavdevice53 is already the newest version." [02:56] <norbert_> it seems that ffmpeg from git is relying on 55, while my system has 53 [02:58] <norbert_> I'm not going to recompile more than ffmpeg, so this isn't working [02:58] <norbert_> I need to try another video codec that my system's ffmpeg supports [03:00] <norbert_> klaxa: something else I could try instead of ffvhuff (or libx264) to lower the IO load? http://pastebin.com/Rky6dS2G [03:16] <Stelpa> hullo! i am trying to set up a twitch.tv stream on linux using this great lil script (https://github.com/wargio/Twitch-Streamer-Linux), and it's ALMOST working, but its segfaulting, after an error that says "Incompatible pixel format 'bgra' for codec 'libx264', auto-selecting format 'yuv420p'" [03:17] <Stelpa> a separate script i tried also gave a libx264 error [03:17] <Stelpa> why would libx264 not be working properly? [03:17] <sacarasc> Can you paste the full output to a pastebin? [03:18] <Stelpa> sacarasc, absolutely, gimmee one second [03:21] <Stelpa> this is the complete output of the program, sacarasc. it's not a really complicated program, but i assume it's just the end part that'll be of use, since the rest is just setup messages (after i start streaming i'm supposed to be able to set audio sources in the mixer, but i can't really do that because of the segfault... the script just ends itself as if i ended it manually) [03:21] <Stelpa> http://pastebin.com/82fXajMX [03:26] <Stelpa> my avconv is a very recent version (october 11th build) [03:28] <sacarasc> You were asked to do the command outside of the script, but anyway, avconv is not from ffmpeg, but from libav. Go to #libav for help with it. [03:29] <Stelpa> oh [03:29] <Stelpa> i see, sorry :X [03:29] <Stelpa> i dont really know how to do it separate from the script [03:29] <Stelpa> i'm kinda a noob at this [03:29] <Stelpa> but i'll try at libav [03:30] <Stelpa> i assumed that avconv was part of ffmpeg [03:30] <Stelpa> sorry :X [03:30] <Stelpa> bye! [03:35] <Ulfalizer> av_rescale_q(a, b, c) computes a*b/c, right? [03:38] <norbert_> yes av_rescale_q(a,b,c) is a function that will rescale a timestamp from one base to another. It basically computes a*b/c but this function is required because that calculation could overflow. AV_TIME_BASE_Q is the fractional version of AV_TIME_BASE. They're quite different: AV_TIME_BASE * time_in_seconds = avcodec_timestamp and AV_TIME_BASE_Q * avcodec_timestamp = time_in_seconds (but note that AV_TIME_BASE_Q is actually an AVRational obj [03:38] <norbert_> ect, so you have to use special q functions in avcodec to handle it). [03:38] <norbert_> (from http://dranger.com/ffmpeg/tutorial07.html ) [03:57] <Ulfalizer> ok, thanks [03:59] <Ulfalizer> currently trying to make sense of ffmpeg.c. i'm not sure what the best practice for dealing with a/v synchronization in a "generic" way (like for output-example.c) is, so that's what i'm trying to glean. [04:00] <Ulfalizer> it's for an emulator movie recording feature. i have video working (via an add_video_frame() function), but not sure how to deal with a/v synchronization if i add a corresponding add_audio_frame(). [04:00] <Ulfalizer> just in case you have any input :) [04:02] <Ulfalizer> could set PTS values on both video and audio frames, but i don't know if all encoders respect those for audio frames [04:03] <Ulfalizer> i'm not sure how syncing on just the sample rate with video PTS values only would work. seems like it'd be tricky to get exactly right. [04:05] <norbert_> I personally know nothing about it [04:05] <Ulfalizer> ok, i'll keep digging then :) [05:09] <COBadger> I'm looking for an FFMPEG expert to help me structure a system to create small clips from .mp4 and AVCHD .mts files, then combine them into high-quality .mp4 output files. Can someone point me in the right direction? [07:38] <Ulfalizer> does mpeg have timestamps for the audio stream too, or is the timing purely based on sample rate there? [07:38] <Ulfalizer> i.e., is the audio PTS inferred from the number of samples that have been played? [09:50] <seece> hi i'm trying to stream h264 in a mpegts through rtp to ffplay, but it segfaults [09:50] <seece> here's what happens: http://pastebin.com/raw.php?i=CuE7FGZg [09:51] <seece> any advice? [11:40] <zth_studiocomp> i want to change a videofile from 50fps to 25fps, but peserve the quality. how would i go about doing that? [11:40] <zth_studiocomp> preserve* [11:41] <Apic> Sounds pervert! [11:42] <zap0> zth_studiocomp, why would quality change? [11:42] <JEEB> because if he's using a non-intra format he'd have to re-encode :) [11:42] <zth_studiocomp> zap0, absolutely no clue! but it did. $ ffmpeg -i test.mov -r 25 outfile.avi <- that's what i did [11:42] <JEEB> yes [11:42] <JEEB> welcome to ffmpeg defaults [11:43] <zth_studiocomp> JEEB, thanks i guess ;) [11:43] <JEEB> ffmpeg -i test.mov -r 25 -c:v libx264 -crf 23 -preset medium -c:a copy out.mov [11:44] <zth_studiocomp> JEEB, thank you very much! [11:44] <JEEB> uses the libx264 H.264 encoder, uses the CRF rate control, which is closest to "constant quality", sets the medium preset (speed vs compression) which is also the default [11:44] <JEEB> and copies the audio [11:44] <JEEB> you should encode short parts (A few thousand frames) with this crf and see if it looks good enough for you [11:44] <JEEB> if it does, raise it [11:44] <JEEB> if it doesn't, lower it [11:44] <JEEB> find the highest crf value that is good enough looking for you :) [11:44] <JEEB> and that's it [11:45] <JEEB> then encode the whole thing with that [11:45] <zth_studiocomp> JEEB, thanks a bunch! so i should take note of the crf i use for the future encoding? [11:46] <JEEB> yes, and you probably will want to use a different CRF value for SD and HD content, as SD content is more often upscaled to a higher resolution during playback, so it might need a higher quality level. That said, it's all up to your eyes :) [11:47] <JEEB> 23 is the default crf value for x264, and then you go up or down or use it as-is depending on how the end result looks :) [11:50] <zth_studiocomp> JEEB, thank you very much for your help. i will get to work! :) [11:54] <JEEB> shouldn't be too hard :) [14:06] <Jaken> Hello, How can I broadcast audio on Linux? I'd like to broadcast a music-track. [16:01] <zybil> hi [21:19] <Mattias> So, I got this script for streaming with ffmpeg to twitch.tv. Here it is: http://pastebin.com/fGX2wzMX Now, I got a new line, 100mbit up and down. But if I try to change to full outres at 19200x1200, the stream "lags", I tried with 15 fps and it doesn't help either. I've also tried upping the maxrate to 100mbit, no change. above 1mbit doesn't seem to make a diffrence. How can I optimize this script for my [21:19] <Mattias> connection and send the full resolution while streaming? Not possible? [21:19] <Mattias> the outres in the paste works fine, about half the size of inres I think [21:20] <Mattias> I guess the tweaks to get this to work has to do with the encoding parts [21:21] <Mattias> This will stream all from fps games with fast moving frames to dwarf fortress which has hardly any changes on screen [21:50] <Mattias> JEEB: If you are experienced in this area of ffmpeg, please let me know when you see this :) (the 5 lines above this one) [21:52] <klaxa> Mattias, what's your CPU load during that? [21:53] <Mattias> klaxa: haven't checked, testing now [21:55] <cbsrobot> Mattias: try ultrafast, instead of fast [21:57] <Mattias> ok, got stuff setup, time to try, both with fast and ultrafast :) [21:57] <fazias> better test first to save to disk I think? [21:58] <fazias> ie. offline test, to see if you have bottlenecks [21:58] <fazias> like whats the maximum fps x11grab can do. [21:59] <klaxa> x11grab should be able to do way more fps than you can save [21:59] <klaxa> because of either too slow disks or too slow CPU [21:59] <Mattias> ssd disk [21:59] <Mattias> well, the actual game isn't on the ssd :P just the operating system [22:00] <fazias> lets just say I had problems with keeping high enough fps with i7-3770k@4,5ghz nvidia gtx480 and I was playing Heroes of newerth which does run on a very shitty computer [22:01] <fazias> input res 2560x1600 does also have alot to do with that, yeah [22:01] <Mattias> I have a gtx 670, with a very recent i5 cpu at 4ghz~ [22:01] <Mattias> 1920x1200 inres, and outres [22:01] Action: Mattias has downgraded from an old first gen i7 :P [22:02] <fazias> graphically heavy game + x11grab = problems, was my experience [22:02] <Mattias> http://www.twitch.tv/mattiasjp <-- here is the stream, right now the maxrate is at 1mbit [22:02] <Mattias> game limits to 20fps when I'm not focusing it [22:03] <Mattias> wops, tabbed wrong :D [22:03] <Mattias> anyways, 100% cpu :/ [22:03] <Mattias> seems to run smoothly today. testing ultrafast now [22:03] <Mattias> ultrafast + 10mbit maxrate limit now [22:05] <Mattias> ok, now it's "lagging" on the stream, and 1 cpu is at 100% and the rest avg on 50% [22:05] <Mattias> seems all on 50% ~ now [22:06] <Mattias> testing 1mbit up again [22:07] <Mattias> ugh, that looks terrible :P [22:09] <Mattias> cbsrobot: ultrafast makes a lot of boxy artifacts [22:09] <Mattias> trying at 3mbit now, still boxes, and 10mbit seems is too much for the PC, even though I have the bandwidth for it :/ [22:10] <Mattias> trying fast at 3mbit again [22:12] <Mattias> still lags, hm, boxes without lag, or nice stream with lag :P tough choice [22:21] <cbsrobot> Mattias: Did you read: http://trac.ffmpeg.org/wiki/StreamingGuide ? [22:22] <Mattias> cbsrobot: yes, a long time ago when creating this script [22:23] <klaxa> you can do ultrafast with a lower crf [22:23] <klaxa> oh wait... [22:23] <klaxa> nvm [22:23] <klaxa> different quality... thing [22:25] <Mattias> testing the other settings from that page again [22:25] <Mattias> maybe they work better for my new connection [22:25] <asherawelan> I am using ffmpeg to push an mp3 stream to a web sockets server, and I'm told i need to increase the chunk size - i've looked at the -chunk_size flag, but not sure what value to give it. It seems the decoder on the server I'm streaming to needs more information to decode? Any advise? [22:26] <asherawelan> Current command: ffmpeg -re -i talking_heads.avi -chunk_size 64k -f mp3 http://127.0.0.1:8081; [22:26] <Mattias> cbsrobot: actually, my "script" is added on that page, since I've added it, the third example [22:26] <Mattias> very long time ago [22:27] <cbsrobot> maybe you find some info that could help you [22:27] <cbsrobot> f.ex. -tune zerolatency [22:27] <cbsrobot> or stuff like that [22:31] <Mattias> everything I change keeps making it worse now :P [22:31] <Mattias> VBV underflow [22:32] <Mattias> llogan: already have, scroll up [22:33] <llogan> i arrived after you pasted it [22:33] <Mattias> the underflow was because I accidently did (1mbit)*0.2 [22:33] <Mattias> now it's 10mbit * 0.2 [22:34] <Mattias> http://pastebin.com/fGX2wzMX llogan basically trying to optimize this for streaming. to get 1920x1200 outres to stream flawlessly (I have 100mbit up and down, shouldn't be any problem) [22:42] <Mattias> Stream Configuration Quality: Acceptable [22:42] <Mattias> Last Checked: less than a minute ago [22:42] <Mattias> er, wrong copy :( [22:42] <Mattias> Max keyframe interval is currently at 6.224 seconds. Please set it to 2 seconds. <-- what influences this in my command above? [22:42] <Mattias> twitch.tv complains about this [22:46] <Mattias> and it also wants a constant cbr now O.o [22:48] <Mattias> great, got it to excellent. no warnings from twitch. I set it to 2 seconds with the -g switch [22:54] <sacarasc> -g I think, Mattias, but I'm not sure. [22:58] <Mattias> sacarasc: yeah, it was -g :) now to get rid of the "lag", no idea what causes it [22:58] <Mattias> frame=12670 fps= 30 q=31.0 size= 524214kB time=00:07:02.96 bitrate=10152.9kbits/s is the output I get [22:59] <Mattias> I set it to min/max at 10mbit [22:59] <Mattias> is the bitrate too high for my cpu to handle? [23:00] <Mattias> testing at 5mbit now [23:16] <Mattias> works much better at lower outres, no idea what's causing the bad framerate at higher outres [23:31] <Mattias> seems I can't have higher outres than 854x480, otherwise it lags.. [23:39] <Mattias> found https://github.com/wargio/Twitch-Streamer-Linux going to try it now :P [23:44] <llogan> looks like that script uses -b twice and -qscale [23:45] <llogan> Mattias: i never did see a console output from you. are you even using ffmpeg? [23:46] <Mattias> llogan: yeah, ffmpeg with libx264 the full command is in that paste I did. It sends the encoded video directly to twitch.tv [00:00] --- Mon Oct 28 2013
participants (1)
-
burek