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

burek burek021 at gmail.com
Wed Dec 19 03:05:03 EET 2018


[00:08:59 CET] <atoms118> does anybody know how I might stream using FFMpeg so that clients can connect/disconnect adhoc style?
[00:10:26 CET] <kepstin> by using a streaming server that ffmpeg can send input to :/
[00:10:54 CET] <atoms118> ok well yes but aside from that
[00:11:18 CET] <kepstin> other than that? by writing a multi-client server application that uses ffmpeg libraries internally
[00:11:31 CET] <atoms118> ok then
[00:11:37 CET] <atoms118> streaming server it is
[00:11:56 CET] <kepstin> anyways, if you want some choices for the first option, something like nginx-rtmp might work well, or you can even have ffmpeg generate HLS or DASH directly and serve it with any plain webserver
[00:13:34 CET] <atoms118> sounds good, thanks
[03:01:13 CET] <Wiiplay123> Am I supposed to be able to do "ffmpeg -i %d.png -framerate 30 test.gif" to make an animated gif with transparent background if the PNGs have transparent background, or do I need to do something extra to make it work?
[03:01:34 CET] <Wiiplay123> I just updated to the latest nightly Windows build in hopes that it would work but I can't figure it out.
[03:23:26 CET] <Wiiplay123> I had to manually sort the layers in GIMP :(
[09:00:29 CET] <quint> I'm trying to set the ouput bitrate using h264_vaapi, however, the -b:v option only changes the input bitrate to the intel chip, and the bitrate of the resulting output file never changes. How can I set the *output* bitrate of the stream from the chip?
[09:01:50 CET] <pink_mist> input bitrate? 0_o is that a thing that exists?
[09:01:54 CET] <quint> * when I set the bitrate, the video will show many compression artifacts, but the size of the output file does not reflect the quality whatsoever
[09:02:10 CET] <quint> if that makes any sense
[09:04:03 CET] <quint> pink_mist: by "input bitrate" I guess I mean to say the bitrate of the video as it goes into the encoder, as opposed to the "output bitrate" as it leaves the encoder... not even sure I'm correct in that assumption
[09:04:46 CET] <pink_mist> but the input bitrate depends on the actual video source in question .. it's not a setting you can set
[09:06:02 CET] <quint> well, I may be describing it poorly.
[09:06:07 CET] <quint> I'm using the following command:
[09:06:33 CET] <quint> ffmpeg -hwaccel vaapi -vaapi_device /dev/dri/renderD128 -i bbb_sunflower_1080p_60fps_normal.mp4 -t 30 -vf 'format=nv12,hwupload' -c:v h264_vaapi -c:a copy file.mp4 -y
[09:07:58 CET] <quint> when I add -b:v 1M, the bitrate that ffmpeg is encoding at is about 4-5M
[09:08:25 CET] <quint> Mind you this is a 1080p video at 60fps so that certainly could be a factor
[09:19:56 CET] <furq> where are you putting -b:v 1M
[09:22:53 CET] <quint> furq: as the last option before the output filename
[09:23:57 CET] <quint> As it turns out the bitrate is affected by this. qp seems to be the appropriate option to use in this case
[10:40:43 CET] <Adcock> Hello
[10:40:50 CET] <Adcock> Anybody here?
[10:41:07 CET] <Adcock> ..._ _ _...
[10:41:42 CET] <Adcock> I want to capture the whole desktop.
[10:41:59 CET] <Adcock> But I don't want to tell ffmpeg the size of the video.
[10:42:14 CET] <Adcock> I want full desktop to be recorded.
[10:42:20 CET] <Adcock> How to do that?
[11:21:17 CET] <justinasvd> Hi guys. Out of your experience, what's the minimum time interval that's worth seeking (as opposed to just do playing the frames normally)?
[12:01:13 CET] <sybariten> Hey
[12:01:27 CET] <Mavrik> o/
[12:02:40 CET] <sybariten> is there a way you can think of, that i could cut down say a 60 minute video to a few minutes, by having ffmpeg cut out portions evenly spread out alkl over it?
[12:03:38 CET] <sybariten> I dont know how to explain this in a good way  :)   Sort of like a "supercut" but no real intelligence behind the cuts, i just want to "speed it up", but not by speeding the frame speed or antying, its more like "for each five minute segment just leave the first ten seconds"
[12:05:04 CET] <relaxed> sybariten: you may be able to do it with aselect/select filter
[12:05:55 CET] <sybariten> aha aha
[12:07:10 CET] <relaxed> you could also stream copy segments and concat
[12:08:00 CET] <relaxed> the latter being lossless
[12:08:47 CET] <sybariten> phew, i'm gonna have to google a bit about this after lunch, but at least now i have a idea of way in, thanks
[12:08:57 CET] <sybariten> i also saw something about ffconcat
[12:09:53 CET] <sybariten> be back latger
[12:11:27 CET] <relaxed> https://trac.ffmpeg.org/wiki/Concatenate
[15:07:47 CET] <oliv3> hi there, i can't find a way to achieve CFR :( my program takes any video as input (with a pipe), converts to PPM, does things, then sends the output (also through a pipe) to another ffmpeg process for reencoding, output video is slower than the original, maybe i missed something ? commands are there: https://pastebin.com/RChAdyjv - any suggestion would be appreciated, thanks !
[15:13:16 CET] <furq> oliv3: add -framerate 30 before -i in the second command
[15:18:49 CET] <oliv3> furq: thanks, will try this and let you know
[15:24:45 CET] <Adcock> can I grab video from video card instead of x11?
[15:24:57 CET] <Adcock> Or something....
[15:28:55 CET] <oliv3> furq: it's working perfectly now, thank you !
[15:36:42 CET] <Adcock> Please help.
[15:36:57 CET] <Adcock> X11 Grab is slow and lagging.
[15:36:57 CET] <BtbN> Define video cards. There are a few capture cards with linux support. Decklink and Magewell has a few, but they are on the expensive side.
[15:36:59 CET] <Adcock> :(
[15:37:17 CET] <Adcock> Oh.
[15:37:38 CET] <BtbN> x11grab is the best you'll get for desktop capture I think
[15:37:57 CET] <BtbN> Sure, you can loop your output through a capture card, but that's expensive
[15:38:47 CET] <Adcock> Is there any other standard video grab device for desktop grabbing.
[15:38:50 CET] <Mavrik> Also I doubt it's X11 that's the problem.
[15:39:13 CET] <Adcock> Hmmm.......
[15:39:24 CET] <Adcock> I think I get.
[15:39:32 CET] <Adcock> But I am so......
[15:39:37 CET] <Adcock> Sorry guys.
[15:40:00 CET] <Adcock> Forgive me if I wasted your time.
[15:44:53 CET] <EEVV> hi, how do I fix `ERROR: nvenc requested, but not all dependencies are satisfied: ffnvcodec`? I tried to compile the git `nv-codec-headers` and install it but it still doesn't work
[15:48:38 CET] <BtbN> You didn't install it correctly then. Cause that's what it's asking for.
[16:09:28 CET] <debianuser> Adcock: "X11 Grab is slow and lagging" -- it should be fine unless you use it with some high fps on a slow pc. To test the performance of x11grab itself try: time ./ffmpeg -f x11grab -r 60 -s 1280x1024 -i :0 -t 30 -f null -
[16:09:45 CET] <debianuser> Adcock: Also it could be it's not x11grab but pixfmt conversion being slow. To test that try:    time ./ffmpeg -f x11grab -r 60 -s 1280x1024 -i :0 -vf format=yuv420p -t 30 -f null -
[16:10:51 CET] <debianuser> (adjust resolution and fps to your needs)
[16:13:16 CET] <BtbN> x11grab is pretty slow on some GPUs that are bad at copying back data
[16:17:18 CET] <debianuser> Adcock: And IF it's the pixfmt conversion slowing down your encoding, I have some 3-years-old patch that sort of fixes that (it implements a shortcut for 0RGB32->YUV420P conversion)... Not sure if that's still needed, but if it is and you're willing to try - I can probably update it to current git. :)
[16:19:09 CET] <JEEB> my condolences if you poked swscale
[16:19:50 CET] <debianuser> Not much. I basically just copypasted "bgr24ToYv12Wrapper" into "bgr32ToYv12Wrapper" and adjusted some offsets.
[16:20:03 CET] <JEEB> :)
[16:20:29 CET] <JEEB> also I love it how the wording "Y12" still lives
[16:25:22 CET] <debianuser> I don't even remember the exact format. I've read about it years ago when I was writing a patch, but I mostly forgot what exactly those subsampling numbers mean since then. :)
[16:34:54 CET] <kepstin> the '12' comes from the 4:2:0 subsampling averaging 12 bits per pixel, iirc.
[16:37:27 CET] <JEEB> yes
[16:37:39 CET] <JEEB> the joke of course is that people tend to call it yv12 even if it's I420 :P
[16:37:56 CET] <JEEB> since the only difference in MS systems between the two are the order of pointers to buffers
[16:37:59 CET] <JEEB> Cb and Cr
[16:52:00 CET] <Adcock> No guyz.
[16:52:12 CET] <Adcock> I am trying to record stellaris.
[16:52:19 CET] <Adcock> That is the culprit.
[16:54:43 CET] <BtbN> Use OBS
[16:57:14 CET] <Adcock> OBS?
[16:58:06 CET] <Adcock> BtbN: ^^^
[17:01:48 CET] <TheAMM> Adcock: https://www.google.com/search?q=obs > https://obsproject.com/
[17:31:11 CET] <Mavrik> So you're trying to capture an OpenGL rendered game via X11 ?
[17:31:17 CET] <Mavrik> On Linux?
[17:32:45 CET] <debianuser> SimpleScreenRecorder was also good at capturing opengl games (and it uses ffmpeg for encoding anyway)...
[17:35:41 CET] <BtbN> Isn't that the one that preload an OpenGL shim?
[18:17:43 CET] <GuiToris> hello, which version of ffv1 codec should I use for intermediate files?
[18:51:33 CET] <durandal_1707> GuiToris: last one
[18:52:08 CET] <GuiToris> that's version 3, isn't it
[18:55:09 CET] <GuiToris> I guess I should notice much difference as both version are lossless
[19:04:02 CET] <InvisibleRasta> hello guys i am trying to convert amkv to avi so i can play it on the tv
[19:04:13 CET] <InvisibleRasta> i saw on google i can ffmpeg -i foobar.mkv -vcodec copy -acodec copy foobar.mp4  but it gives me error
[19:05:25 CET] <InvisibleRasta> https://paste.pound-python.org/show/EM03sdauaWL0qJSEA6Me/
[19:06:07 CET] <durandal_1707> which ffmpeg version?
[19:06:24 CET] <InvisibleRasta> 1:4.1-1
[19:07:02 CET] <InvisibleRasta> https://paste.pound-python.org/show/zrfaIdhIZqm49fidg7Le/
[19:12:00 CET] <Adcock> Guys need help with watermark.
[19:12:37 CET] <durandal_1707> InvisibleRasta: have you tried with that bitstream filter inserted?
[19:14:35 CET] <InvisibleRasta> yeah it actually worked
[19:14:44 CET] <InvisibleRasta> durandal_1707: id have onemore question
[19:14:50 CET] <InvisibleRasta> how can i cut a video in two parts?
[19:15:00 CET] <InvisibleRasta> without reencoding if possible
[19:15:44 CET] <durandal_1707> -ss  and -t with -c copy ?
[19:16:32 CET] <InvisibleRasta> how sorry?
[19:17:09 CET] <InvisibleRasta> can i jsut make it so it splits it in half
[19:19:48 CET] <durandal_1707> InvisibleRasta: unfortunately there is not simple command to do that
[19:21:48 CET] <InvisibleRasta> durandal_1707: so like this ? ffmpeg -i input.avi -vcodec copy -acodec copy -ss 00:00:00 -t 00:30:00 output1.avi
[19:23:13 CET] <InvisibleRasta> ffmpeg -i input.avi -vcodec copy -acodec copy -ss 00:30:00 -t 00:30:00 output2.avi
[19:24:15 CET] <durandal_1707> yes, did not tried
[19:39:25 CET] <Adcock> Can watermarks be hard coded?
[19:41:36 CET] <durandal_1707> yes
[20:06:27 CET] <Adcock> durandal_1707: How?
[20:12:24 CET] <durandal_1707> Adcock: with filters
[20:12:54 CET] <Adcock> durandal_1707: I applied filters.
[20:13:14 CET] <Adcock> Does it mean there is no way to separate the watermark ?
[20:13:48 CET] <Adcock> Like they are one image.
[20:14:07 CET] <Adcock> Not two video channels.
[20:15:18 CET] <durandal_1707> you apply overlay filter and reencode video
[20:16:38 CET] <Adcock> durandal_1707: https://ptpb.pw/j8NZ
[20:16:47 CET] <Adcock> Will that work?
[20:17:00 CET] <Adcock> http://ksloan.net/watermarking-videos-from-the-command-line-using-ffmpeg-filters/
[20:17:08 CET] <Adcock> This is where I got it.
[20:17:55 CET] <durandal_1707> that will overlay watermark in midddle of video
[20:18:21 CET] <Adcock> Is it hard coded?
[20:18:37 CET] <durandal_1707> off course it is
[20:18:44 CET] <Adcock> :)
[20:18:54 CET] <Adcock> Thank you.
[22:50:34 CET] <Keshl> Quick sanity check: I've been googling about how to enable VFR for x265. I am aware of the risks of doing this, and I plan to do a lot of experiments first to make sure that the footage plays back as expected in the players that I want to ensure compatibility with. Googling how to enable this just turns up losts of angry posts about people telling other people not to do it because it's questionably compatible, and not actually how to do
[22:50:35 CET] <Keshl> it and test these claims for myself. Is it possible to do VFR with x265?
[22:52:35 CET] <Keshl> (See, normally I wouldn't care that much, but the source video outright pauses for a good 5-10 minutes at times, during which I can still see the file size increasing with ffmpeg. I figure VFR'll address a lot more with my particular input than it would with more typical input.)
[22:56:52 CET] <kepstin> Keshl: shouldn't be any issues from the ffmpeg point of view to do vfr with x265, as long as you're writing to a container that supports it properly.
[22:57:59 CET] <Keshl> Okay, thajk'ye, I'll keep trying to find useful resources, then. (Unless you'd be so kind as to hand me some. <É<' -- Seriously, I can't find /squat/ on this.)
[22:59:43 CET] <kepstin> well, there's nothing really that special about vfr, it's just when the timestamps change by different amounts between frames instead of the same amount every time. Unless you add other options, the ffmpeg cli tool should preserve relative frame timing (aka vfr) by default.
[23:00:30 CET] <kepstin> although some particular choices of output container, or misdetection of the input as cfr when it's actualy vfr, might cause issues
[23:00:43 CET] <Keshl> Okay, that makes sense, and I just found https://superuser.com/questions/908295/ffmpeg-libx264-how-to-specify-a-variable-frame-rate-but-with-a-maximum which made something click.
[23:00:49 CET] <Keshl> Turns out, I have a problem. <.<'
[23:01:33 CET] <Keshl> So, the input stream really is VFR. I'm recording a game. When I tab out, it actually quits producing frames. Like, ffmpeg just legitinimately gets no input. Since I'm streaming as well as recording, I have to use CFR for that, so ffmpeg inserts duplicate frames to keep things sane. That part's fine.
[23:01:49 CET] <kepstin> hmm, you're using obs or something for that?
[23:01:50 CET] <Keshl> What isn't so happy for me is that, now I have a CFR recording full of duplicate frames that I need to drop.
[23:01:53 CET] <Keshl> (OBS, yeah.)
[23:02:41 CET] <Keshl> So basically, I have an .mkv file, CFR, with duplicate frames up the wazoo, that I want to take and make into VFR so I don't have duplicate frames for 10+ minutes at times. If I just do -vsync 2, it'll still have duplicate frames, right?
[23:03:11 CET] <kepstin> yeah, you have to filter the video to remove the duplicated frames
[23:03:19 CET] <kepstin> handily, ffmpeg has a filter that does that - "mpdecimate"
[23:03:25 CET] <Keshl> Okay, that's where I kept getting hung up on. Okay. Was Googling for the wrong term.
[23:03:33 CET] <Keshl> Thank. You. o_o
[23:03:59 CET] <kepstin> https://www.ffmpeg.org/ffmpeg-filters.html#mpdecimate is the docs
[23:04:23 CET] <kepstin> Keshl:  you might have to adjust the dropping thresholds a bit - the defaults look for "similar" frames, and it might drop too many
[23:04:27 CET] <Keshl> See, I kept doing that -vsync stuff and was like "...The file size is almost identical. There's no way the ME is /that/ good with CFR in this situation. Something's gotta be wrong.".
[23:04:48 CET] <Keshl> (Honestly, if I can make it drop similar frames, I'll do a happydance.)
[23:05:11 CET] <Keshl> (Sometimes I'll pull an inventory up but not pause the game, so there's a very subtle background animation. I'd /love/ to just utterly nuke that, too.)
[23:06:09 CET] <kepstin> if you have multi-minute gaps this'll probably reduce file size a bit, but at the expense of players having difficulty seeking near the gap.
[23:06:33 CET] <kepstin> for shorter gaps, it'll probably make very little difference in file size (codecs are already really good at compressing similar/same frames)
[23:06:49 CET] <Keshl> The gaps are truly massive, and frequent in some of the videos.
[23:06:53 CET] <kepstin> it should make encoding faster, at least.
[23:07:11 CET] <Keshl> I figure seeking will be a nightmare with all this, but I'm fine. I'll just turn playback speed up instead to get to where I want to go.
[23:07:55 CET] <Keshl> Thank you so much. Seriously. o_o
[23:07:58 CET] <kepstin> do you need to keep the audio from these sections? it might be best to trim these sections out of the video completely instead of having a long gap in the file
[23:08:23 CET] <kepstin> (but that's probably a bit more work, ffmpeg won't be able to automatically do that)
[23:08:28 CET] <Keshl> In some cases I do, some I don't. The only way I'll know for sure is if I actually watch the whole thing, which I don't wanna do.
[23:08:51 CET] <Keshl> I can give you a full run-down of what I have and what I'm trying to achieve if you want, but I don't want to drag you into something deeper than you planned on.
[23:09:06 CET] <Keshl> (Seriously, none of this is terribly "normal".)
[23:09:36 CET] <Keshl> Heh, I was about to ask if it can be done automatically. <É<'
[23:09:56 CET] <kepstin> anyways, if all you want to do is drop similar frames and get a vfr video back, just add "-vf mpdecimate" to your ffmpeg command line.
[23:10:11 CET] <Keshl> I don't need -vsync 2? Just -vf?
[23:10:42 CET] <kepstin> -vsync 2 is unrelated, it can help in some cases where you have vfr input that's not handled correctly otherwise. You shouldn't normally need iot
[23:11:36 CET] <Keshl> Okay, thank'ye. One other question before I forget, hold on.. Gotta remember the specifics..
[23:11:38 CET] <kepstin> Anyways, you'll probably want to adjust some of the dropping threshold options on the mpdecimate filter depending on your content, if it's dropping too much or too little. You can also set a max number of frames in a row to drop if you just want low framerate output instead of no frames - this might help seeking.
[23:14:24 CET] <Keshl> I'll experiment. Okay, there it is..
[23:15:00 CET] <Keshl> So, unsurpriswengly, I also have long stretches in my audio where there's utter and complete silence (Again, actual output just *stops*.). Clearly VBR would help there. I already know how to do that with mp3.
[23:15:17 CET] <Keshl> My concern is, with VBR audio and VFR video, would things become unsynced? Would "-af "aresample=async=1:min_hard_comp=0.100000:first_pts=0"" help fix anything?
[23:16:07 CET] <Keshl> (You might wonder why I don't just cut the recording when I know these input drops are happening. Well, see, I forget to do that.)
[23:19:48 CET] <kepstin> Keshl: vbr codecs keep sync just fine. In fact, most codecs ffmpeg supports are vbr.
[23:19:59 CET] <kepstin> mp3's one of the rare ones that actually supports non-vbr mode
[23:21:15 CET] <Keshl> Oh. In that case, how can I check if the audio's already vbr or not? I recorded in aac.
[23:22:06 CET] <kepstin> it's probably vbr then, most aac encoders are?
[23:23:37 CET] <Keshl> Still. <É<'
[23:24:02 CET] <Keshl> Due to how OBS' settings work, I have high reason to suspect it's CBR.
[23:28:47 CET] <Keshl> https://trac.ffmpeg.org/wiki/Encode/AAC#NativeFFmpegAACEncoder Fwee. <.<' I don't have the "good" one, so VBR's gunna stink. D: Oh well.
[23:30:36 CET] <Keshl> ...Oh. Works totally fine. I don't hear a difference. Okay. Cool. o.=.o. And the audio track's like half the size it was before.
[23:31:59 CET] <Keshl> Now all I want is some way to automatically detect "empty" audio streams (there's four in each file, and at least one will always be populated, but the others may be silent but present) and then remove them if they're dead-silent the entire time.
[23:32:29 CET] <Keshl> Then again, with VBR, maybe it won't matter. Let's see..
[23:32:45 CET] <Keshl> Yeah, okay, 1.5 meg/hour, I can live with that.
[23:39:13 CET] <Keshl> Does     ffmpeg -i "Original.mkv" -vcodec libx265 -preset veryslow -crf 28 -movflags faststart -pix_fmt yuv420p -acodec aac -q:a 2 -map 0 -tune grain -vf mpdecimate=0=61*12=64*5=0.75 "Archive.mkv"     seem sane? I can never remember the syntax for specifying paramaters for filters.
[23:44:08 CET] <Keshl> Nope. Decimate doesn't like that input. Without any input though, holy living bagels, it encodes incredibly fast. o_o'
[23:46:33 CET] <Keshl> -vf mpdecimate=max=0:hi=61*12:lo=64*5:frac=0.75     -- There we go. Okay. All happy.
[00:00:00 CET] --- Wed Dec 19 2018


More information about the Ffmpeg-devel-irc mailing list