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

burek burek at teamnet.rs
Fri Oct 25 03:05:01 EEST 2019


[01:50:26 CEST] <DanielTheFox> Hello, has anybody ever written a pal8 colorspace encoder for ffmpeg?
[01:50:59 CEST] <DanielTheFox> (as far as I know, ffmpeg official sources/builds don't output pal8, although they can read and decode it)
[01:55:47 CEST] <JEEB> do you mean something specific with "encoder"
[01:56:30 CEST] <JEEB> since pal8 is a pixel format, not video format
[02:02:28 CEST] <Reinhilde> when recording to a YouTube RTMP stream, after around 7 hours the encoder goes from 15fps (the -f x11grab input framerate) to 4.5 fps (less than a third the rate).
[02:05:57 CEST] <DanielTheFox> JEEB: a pixel format, actually
[02:06:14 CEST] <DanielTheFox> normally, ffmpeg can read pal8
[02:06:17 CEST] <DanielTheFox> but can't write it
[02:06:41 CEST] <pink_mist> can't it? shouldn't it just be a matter of specifying -pix_fmt pal8 or somesuch?
[02:06:50 CEST] <DanielTheFox> has somebody been able to build or write an ffmpeg able to encode/write/output pal8 pixel format?
[02:06:57 CEST] <pink_mist> assuming the format you're encoding to supports it
[02:07:53 CEST] <DanielTheFox> pink_mist: if you execute ffmpeg -pix_fmts, you'll notice pal8 exists, but only input is supported
[02:07:53 CEST] <DanielTheFox> I..P. pal8                   1             8
[02:07:53 CEST] <DanielTheFox> there's I, but not O
[02:08:16 CEST] <pink_mist> I see
[02:08:19 CEST] <pink_mist> bummer
[02:08:52 CEST] <DanielTheFox> yeah, that's why I'm asking if someone has ever seen anything (even if unsupported/unofficial) able to output pal8 pixel format
[02:10:54 CEST] <Reinhilde> what would cause monotonically declining framerate over time?
[02:13:37 CEST] <JEEB> DanielTheFox: wouldn't be surprised if it works by converting from paletted to normal rgb or just taking in pal8 in the video encoder since I don't remember if pal8 has the palette in there as well...
[02:14:42 CEST] <JEEB> like gif, i think it generates a palette from rgb input if i recall it correctly
[04:27:54 CEST] <kingsley> Do you happen to have any good advice for how to render faster on a computer with many cores with ffmpeg, or better yet, with melt, and ideally, kdenlive?
[04:49:13 CEST] <kepstin> doesn't the palettegen/paletteuse filter set let you convert to pal8?
[04:52:05 CEST] Action: kepstin confirms that yes it does.
[05:31:20 CEST] <causasui> I have a video clip I'd like to turn into an infinite loop. I dont know the word for it. Basically take the video, reverse it, and then appened the reversed version onto the original. I've been googling this like mad and ffmpeg is hard. anyone who can help?
[05:31:36 CEST] <causasui> example: this https://media.giphy.com/media/LXfS9EGAqBI2PIo9la/giphy.gif becomes this https://i.imgur.com/wirhoyF.mp4
[05:43:22 CEST] <cptnoblivious> Not sure what I'm looking at in those examples. I've used something like this "ffmpeg -i "input.webm" -filter_complex "[0]reverse[r];[0][r]concat" -c:v libvpx -crf 4 -b:v 3000K -an "output.webm"" for foward/reverse loops
[06:00:43 CEST] <causasui> cptnoblivious: the second one is the first one except it has a loop back to the beginning. note it's precisely twice as long. anyway I'll try that, thanks
[06:01:34 CEST] <cptnoblivious> Ah I see. Yeah that should do it
[08:32:57 CEST] <Shezi> What are the side effects of setting -max_muxing_queue_size too high?
[08:34:23 CEST] <Shezi> We are getting issues like "Too many packets buffered for output...", setting this to in range between 1024 .... 9999 solves the problem. But what are the possible side effects if we are setting it manually to high value?
[08:35:44 CEST] <JEEB> memory usage and possibly the issues due to the packets ssuddenly sluuurpsing out at once if your thing requires stable output
[08:36:26 CEST] <JEEB> i would rather attempt to see wjy ffmpeg.c decides it needs to buffer
[10:54:09 CEST] <Shezi> Sorry JEEB got disconnected. Memory usage is not an issue for us but "packets suddenly sluuurpsing" I didn't get this point. About ffmpeg decision what it needs to buffer is causing the "Too many packets buffered for output" issue.
[10:54:16 CEST] <Shezi> Its in some videos, not all.
[12:28:44 CEST] <zamba> i want to continously read in .ts files and stream these as audio to an icecast server
[12:28:48 CEST] <zamba> can ffmpeg handle this?
[19:42:52 CEST] <void09> how to tell ffmpeg to respect Display aspect ratio set in the .mkv header when taking a screenshot ?
[19:42:56 CEST] <void09> snapshot*
[20:23:20 CEST] <DanielTheFox> How do I set ffmpeg to insert keyframes each X frames?
[20:24:10 CEST] <DanielTheFox> When I encode using MSV1, apparently (by default) they're one each 25 frames, I guess they're necessary for proper video seeking, but I feel like I'm going to sacrifice that and see what happens...
[20:28:51 CEST] <realies> Why do you have to specify a URI with the lv2 filter? Can't you just use something locally?
[20:33:21 CEST] <durandal_1707> realies: lv2 works that way
[20:33:52 CEST] <durandal_1707> and plugins are installed locally...
[20:38:21 CEST] <realies> oh
[20:39:11 CEST] <realies> docs example has a URL it seems lv2=p=http\\\\://calf.sourceforge.net/plugins/BassEnhancer:c=amount=2
[20:40:18 CEST] <durandal_1707> that is not URL
[20:40:30 CEST] <durandal_1707> nothing is fetched from net
[20:40:51 CEST] <DanielTheFox> no proper http:// is present
[20:41:07 CEST] <durandal_1707> run lv2ls if you have it, you will see it
[20:41:17 CEST] <durandal_1707> DanielTheFox: but no net is used....
[20:41:30 CEST] <DanielTheFox> cool
[20:41:55 CEST] Action: DanielTheFox keeps scanning the entire ffmpeg-all manpage looking for keyframe interval manipulation
[20:42:20 CEST] <durandal_1707> that is called gop code
[20:43:19 CEST] <durandal_1707> -g is option
[20:44:04 CEST] <DanielTheFox> ok
[20:44:17 CEST] <DanielTheFox> what is -keyint_min then?
[20:44:25 CEST] <DanielTheFox> something for variable GOP, I guess...
[21:14:10 CEST] <void09> how to tell ffmpeg to respect Display aspect ratio set in the .mkv header when taking a snapshot ?
[21:42:10 CEST] <kepstin> void09: ffmpeg doesn't have any functionality to "take a snapshot", what are you doing?
[21:42:29 CEST] <kepstin> (i'm pretty sure mpv, for example, does support correcting aspect ratio when taking snapshots)
[21:43:26 CEST] <kepstin> if by "taking snapshot" you mean "re-encoding a single frame from an input video to an output image", then it's up to you to write a scale filter to adjust the image size if desired.
[21:43:28 CEST] <void09> kepstin: it does, -vframes 1 -q:v 2 whatever.png
[21:44:16 CEST] <void09> yes, I was just going to do that, use the mediainfo provided value to scale it..
[21:44:53 CEST] <kepstin> scale filter has all the info available in variables, so you can write an expression in the scale filter to do it if you don't know the size/sar in advance.
[21:45:17 CEST] <void09> how :?
[21:47:15 CEST] <kepstin> depends exactly how you want to do the correction, but there's an example in the docs that scales width (preserves height).
[21:47:32 CEST] <kepstin> if you want to do it by always making the video bigger, it's a bit more work to add the conditionals
[21:48:37 CEST] <void09> well, I want it to read the display width height values from the mkv, and scale to that (1080p video scaled to 4:3 for example)
[21:49:54 CEST] <kepstin> well, if you have, say, a 1920x1080 video which you want to be snapshot at 4:3, do you want that image to be 1440x1080 or 1920x1440?
[21:50:13 CEST] <kepstin> either gotta squish it or stretch it :)
[21:50:27 CEST] <void09> squish it
[21:51:05 CEST] <void09> yeah, keep the height
[21:51:08 CEST] <kepstin> then the example in the docs will work for you, it keeps the same height and scales the width
[21:51:26 CEST] <void09> what should i google?
[21:51:58 CEST] <kepstin> you google https://www.ffmpeg.org/
[21:52:33 CEST] <kepstin> then click on Documentation, then Filters under the Components header, then the scale video filter
[21:53:33 CEST] <kepstin> you want the "Make pixels square..." example.
[21:58:05 CEST] <void09> pixels are already square in the source video
[21:58:09 CEST] <void09> internally
[21:58:29 CEST] <void09> the video is just stretched horizontally, and i want it to display at the original AR which is 4:3
[22:09:29 CEST] <void09> hmm or maybe not. just took a snapshot with mpv, which plays by the DAR, and the image is 1920x1440
[22:10:04 CEST] <void09> so I guess it kep the width, and stretched the height ;o
[22:10:26 CEST] <void09> a bit counter intuitive for me, any idea why it would do this ?
[22:15:19 CEST] <kepstin> mpv by default always makes the video to correct sar
[22:15:42 CEST] <kepstin> so if the sar >1, it'll correct it by scaling wider, if sar <1, it'll correct it by making it taller
[22:15:53 CEST] <kepstin> always makes the video bigger*
[22:17:00 CEST] <void09> but this is about dar, not sar
[22:17:12 CEST] <kepstin> sar and dar are related
[22:17:59 CEST] <kepstin> sar * (pixel width / pixel height) = dar
[22:18:04 CEST] <void09> interesting. I would have thought it's best to squeeze the pixels in width
[22:18:20 CEST] <kepstin> that would potentially lose detail
[22:18:58 CEST] <void09> lose detail, but no artefacts with stretching ?
[22:19:08 CEST] <kepstin> if you have "square pixels", that means that (pixel width / pixel height) = dar
[22:19:36 CEST] <kepstin> in other words, sar = 1
[22:21:19 CEST] <kepstin> sar is more commonly used than dar when working on video, because sar remains constant when you do things like crop video, when dar changes.
[22:21:37 CEST] <kepstin> but you can calculate one from the other if you know the video size in pixels.
[22:55:05 CEST] <kingsley> Do you happen to have any good advice for how to render the .webm format faster by using many cores with ffmpeg, or better yet, with melt, and ideally, kdenlive?
[22:55:52 CEST] <kepstin> kingsley: make sure you use vp9, not vp8. make sure you are using a recent version of libvpx. use the '-row-mt 1' option. Set '-threads', by default it only uses 1.
[22:58:57 CEST] <kepstin> hmm. the xstack filter could really use some documentation on what happens if items overlap, and what is displayed in places not covered by an image.
[22:59:21 CEST] <kingsley> kepstin: I'm researching your speed up suggestions...
[22:59:23 CEST] <kepstin> (the answers appear to be "later inputs draw over earlier ones" and "uninitialized data")
[23:09:30 CEST] <void09> kepstin: seems I have 2 possible cases, one with SAR = 1 but DAR not 1; and SAR not 1 (DAR is calculated from SAR) - like dvds
[23:09:45 CEST] <void09> is ther a scale parameter that would work for both of these ?
[23:10:09 CEST] <void09> example 1: 1920x1080 video, sar=1, dar=1.333 (4:3)
[23:10:31 CEST] <kepstin> That makes no sense
[23:10:38 CEST] <void09> example 2: 720x554 video, SAR 1.422 => DAR 1.85:1
[23:11:22 CEST] <void09> so in the first case i'd get a 1,920px × 1,440px snapshot
[23:12:18 CEST] <void09> and the second example would result in a 1024x554 snapshot
[23:12:36 CEST] <void09> what does not make sense ?
[23:13:16 CEST] <kepstin> 1920x1080 with sar=1 has dar=16/9
[23:14:27 CEST] <void09> kepstin: yes, but the dar is set manually to 4/3 cause the video is actually stretched (and appears normal only if resized to 4/3)
[23:14:36 CEST] <kepstin> 1920x1080 with dar=4/3 means sar=3/4
[23:14:48 CEST] <void09> it's a tv recording with 16:9 AR of a 4:3 movie
[23:14:58 CEST] <void09> with no black bars
[23:15:54 CEST] <void09> kepstin: sar is 1, only dvds (from what I found so far) have non 1 sar
[23:16:06 CEST] <void09> anamorphic dvds
[23:17:27 CEST] <void09> so basically i want ffmpeg to take the same kind of snapshot mpv would
[23:17:48 CEST] <void09> without having to write logic oustide ffmpeg
[23:26:11 CEST] <void09> or maybe i should just use mpv to take snapnshots
[23:26:22 CEST] <kepstin> If your 1920x1080 video has a sar of 1, it would display as 16/9.
[23:26:49 CEST] <kepstin> Anyways, ffmpeg can do that, just need some conditionals in the filter expression
[23:27:33 CEST] <void09> kepstin: it displays as 4:3, since i edited the mkv header and changed dispay width/height to 4 and 3
[23:28:37 CEST] <kingsley> kepstin: My limited research results suggest the "-row-mt 1" option to the libvpx .webm encoder spreads .webm rendering across multiple cores, and thus is faster. Thank you. If you happen to have the time, and it would be convenient, comfortable, and all those good things, I'd be happy to receive any further thoughts you care to share on:
[23:29:13 CEST] <kingsley> 1.) How recent of a version of libvpx should one use to render faster with multiple cores?
[23:29:29 CEST] <kingsley> 2.) Is it possible to specify both
[23:29:44 CEST] <kingsley> 2a.) "-row-mt 1" and
[23:29:58 CEST] <kingsley> 2b.) "-threads"
[23:30:20 CEST] <kepstin> kingsley: libvpx 1.7.0 or later. ANd you need to specify *both* -row-mt and -threads
[23:31:01 CEST] <kepstin> void09: when you changed the dar without changing image size, sar got recalculated
[23:31:14 CEST] <kingsley> in kdenlive->render->more options->the window's data entry field that contains, by default "f=webm vcodec=libvpx acodec=libvorbis crf=%quality vb=0 quality=good aq=%audioquality max-intra-rate=1000"?
[23:32:13 CEST] <void09> kepstin: oh it did ? I didn't know it works like that. Mediainfo did not display any value for sar (which means it's =1)
[23:32:38 CEST] <kingsley> 3.) Are -row-mt and -threads available when libvpx is compiled for IBM'
[23:32:45 CEST] <kepstin> void09: remember, sar * (pixel width / pixel height) = dar is the definition
[23:33:08 CEST] <kepstin> void09: if you change dar, and pixel size stays the same, then by definition that means you changed sar
[23:33:15 CEST] <kingsley> (Oops! I accidentally pressed my <enter> key...)
[23:33:36 CEST] <kingsley> 3.) Are -row-mt and -threads available when libvpx is compiled for IBM's POWER9 instruction set architecture?
[23:33:55 CEST] <kepstin> kingsley: I assume you mean IBM power processor? those options are independent of cpu arch. But note that libvpx is probably poorly optimized for power in general, and you'd probably be better off using x86
[23:34:12 CEST] <void09> kepstin: well isn't there a difference between anamorphic dvd >1 SAR, and just modifying DAR in a video with SAR=1 ?
[23:34:28 CEST] <kingsley> kepstin: Yes, you are correct. I assumed IBM's power processor.
[23:34:56 CEST] <kepstin> void09: no difference at all, really, except that different containers signal sar/dar in different ways
[23:35:18 CEST] <kepstin> void09: containers have to provide any two of (sar, resolution, dar) and the other one is calculated
[23:36:14 CEST] <kepstin> well, i suppose you can't provide both sar and dar and no resolution
[23:36:30 CEST] <kepstin> so containers have to provide either (sar, resolution) or (dar, resolution) and the missing sar or dar is calculated
[23:37:14 CEST] <kingsley> kepstin: Yes, I agree with your astute observation that video encoders are often poorly optimized for IBM's power. As a practical matter, at least without -row-mt and -threads, my humble script at
[23:38:05 CEST] <kingsley> http://loaner.com/how_fast_do_various_numbers_of_cores_run
[23:39:15 CEST] <kingsley> suggests encoding .webm with a single thread on POWER9, with its current lack of optimization, is about as fast as a 13 year old x86.
[23:39:49 CEST] <kepstin> even with -row-mt, which helps a lot, libvpx doesn't scale super well with larger number of threads
[23:40:07 CEST] <kepstin> void09: -vf 'setsar=2,scale=w=trunc(if(gte(sar\,1)\,iw*sar\,iw)/hsub)*hsub:h=trunc(if(gte(sar\,1)\,ih\,ih/sar)/vsub)*vsub,setsar=1'
[23:40:15 CEST] <kepstin> void09: should replicate mpv's behaviour
[23:40:43 CEST] <void09> ;o
[23:40:54 CEST] Action: pink_mist would just use mpv
[23:41:08 CEST] <void09> i just realized mpv has no static build for linux
[23:41:12 CEST] <void09> so probably no go
[23:41:16 CEST] <kepstin> if you have the video open in mpv anyways to find the right time, especially
[23:42:11 CEST] <kingsley> Maybe I'll ask in the #talos-workstation channel if someone could test ffmpeg with -row-mt and -threads with my humble little script and report how well render times scale with cores. I think it'd be great to find a faster way to render video on hardware that respects your privacy (POWER9 (no Intel Management Engine)).
[23:42:48 CEST] <kepstin> oh, hmm, i made a mistake, that should be 'ohsub' and 'ovsub' anywhere it says 'hsub' and 'vsub' :)
[23:43:13 CEST] <kepstin> so -vf 'setsar=2,scale=w=trunc(if(gte(sar\,1)\,iw*sar\,iw)/ohsub)*ohsub:h=trunc(if(gte(sar\,1)\,ih\,ih/sar)/ovsub)*ovsub,setsar=1'
[23:44:56 CEST] <kepstin> maybe i should make a pr to add that to the docs, since it's probably pretty generally useful.
[23:45:55 CEST] <void09> of course it is !
[23:56:41 CEST] <void09> kepstin: kinda works, 1440x554 png though, instead of the epxected 1024x554 for a wide screen dvd
[23:58:55 CEST] <void09> and 3840 x 1080 for the 1920x1080 to 1920 x 1440 one :\
[23:59:10 CEST] <void09> but let me check again from the command line, maybe there's a bug in my script
[00:00:00 CEST] --- Fri Oct 25 2019


More information about the Ffmpeg-devel-irc mailing list