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

burek burek021 at gmail.com
Thu Dec 20 03:05:03 EET 2018


[04:51:11 CET] <bemeurer> Hi, I was wondering: If I am receiving an RTSP stream in one process, is there some way for me to send the AVPacket's to another process (I'm using a shared memory ringbuffer.) I looked into the AVPacket struct, but it looks like it contains pointers, which would obviously be invalidated on the receiver proc. How can I do this?
[04:51:48 CET] <bemeurer> FWIW: I just need the other process to be able to use the data to decode it's AVPackets, so that the sender works pretty much as a simple forwarder
[11:32:51 CET] <visub> I calculated the PSNR and SSIM values of a set of videos using ffmpeg and also using VMAF. I see inconsistencies in the values calculated by both. Has someone experienced something similar or know why this could be the case?
[11:35:49 CET] <durandal_1707> because vmaf use different algo to measure PSNR/SSIM
[11:45:59 CET] <justinasvd> Is there any way to copy from a smaller AVFrame to a bigger one, leaving horizontal and vertical padding?
[11:46:02 CET] <visub> durandal_1707 Thank you! By different algo, do you mean that vmaf computes something like the PSNR-HVS-M instead of the regular formula that one would use or something else? Would you explain a bit more?
[11:46:58 CET] <justinasvd> What I wanted to do is to fill my bigger frame with black, and then to copy the small frame and have a bigger frame with the same content and the black border.
[14:54:57 CET] <LigH> Hi.
[14:55:23 CET] <LigH> Current HEAD of aomedia builds as separate applications, but libaomenc fails in libavcodec / ffmpeg.
[14:55:33 CET] <LigH> Which bug tracker shall I report that best to?
[14:55:39 CET] <LigH> Tail of make log: https://pastebin.com/SvEiLA5E
[15:00:08 CET] <durandal_1707> LigH: only releses are supportted
[15:00:25 CET] <durandal_1707> we can not fix wrapper if people break things all the time
[15:00:42 CET] <LigH> So, probably a fault of aomedia's progress.
[15:01:25 CET] <durandal_1707> it could get fixed if change is going to be stable
[15:01:26 CET] <LigH> Well, that narrows it for now, thank you
[15:01:54 CET] <LigH> Bye
[17:13:57 CET] <sybariten> very vague question but can the select filter do things like cutting out many portions of a video, but without explicitly defining each of those intervals? I mean maybe with some sort of function, instead
[17:30:55 CET] <kepstin> sybariten: the select filter doesn't modify the timestamps of the frames it passes through, so it can't really "cut" video (it'll leave a bit timestamp gap)
[17:31:38 CET] <kepstin> (if the content is constant rate, you can work around this by using a setpts filter afterwards)
[17:31:44 CET] <kepstin> constant frame rate*
[17:32:22 CET] <kepstin> so i guess the answer is "yes, if your video is constant framerate and you rewrite the timestamps afterwards"
[17:33:13 CET] <kepstin> (note that you'll have to separately cut the audio, possibly with aselect. It might be tricky to preserve a/v sync)
[17:43:14 CET] <sybariten> kepstin: for this specific case i might even skip the audio then. Someone else needs to take a quick look at several hours of lecture video that i filmed, and i figured i would like to make "time compressed" versions. By periodically taking out chunks, if you understand
[17:44:30 CET] <sybariten> i didnt completely understand the timestamp issue but ive realized that the select filter takes a little bit of ffmpeg knowledge
[17:57:25 CET] <sybariten> basicly, what i'd like to do , in pseudo command line would be something like this   ./ffmpeg -i input.mp4 -ss "every 100th second" -c copy -t 5 sliced-output.mp4
[17:58:12 CET] <furq> -vf select=eq(mod(t\,100)\,0)
[17:58:14 CET] <furq> or something
[17:58:50 CET] <furq> maybe lt(mod(t\,100)\,1) because i don't remember how that deals with float timestamps
[17:59:37 CET] <kepstin> if the input's cfr (and it hopefully is, since you'll need to use something like setpts to remove the timestamp gaps), you can also go on frame count, which is a bit easier since it's integers
[18:08:50 CET] <sybariten> so you think it's actually doable?
[18:09:11 CET] <sybariten> It comes straight from a camcorder so i'd definitely imagine CFR, prolly 25 fps
[18:14:14 CET] <aruns> Hey guys, using FFMPEG on Windows to record some activity on Google Chrome.
[18:14:54 CET] <aruns> I am using FFMPEG 2.8.4 - if I use FFMPEG to record a specific window specified by title, is it possible to show other windows that overlay on top?
[18:15:07 CET] <aruns> For instance, I want to show a DevTools window that displays in front of the window.
[18:16:20 CET] <kepstin> aruns: first of all, upgrade your ffmpeg, 2.8 is *really* old.
[18:16:51 CET] <kepstin> aruns: but anyways, when using the 'gdigrab' capture method selecting a window, it gets that window (and only that window), it will not capture things drawn over it.
[18:17:29 CET] <kepstin> aruns: if you want to capture overlapping windows, you need to capture the full screen, or a section of the screen (you can choose what region to select by pixels)
[18:17:52 CET] <kepstin> aruns: but note that ffmpeg's screen capture on windows is kinda slow, depending on the application you might consider using OBS instead.
[18:19:38 CET] <aruns> kepstin: Yeah, I might specify the X and Y coordinates, but wasn't sure if it was easy to get or not from the Windows command line.
[18:20:24 CET] <kepstin> aruns: you could always just capture the full screen and crop the video later when editing it.
[18:21:37 CET] <sybariten> Just chiming in that I've used OBS a little and been quite satisfied with the result, once you get the hang of it it's a very good tool. I never did something like taking things that display in front of a specific window though
[18:22:41 CET] <kepstin> (also, in many browsers you can configure devtools to open in the same window as the page content, which might work for you)
[18:23:34 CET] <aruns> kepstin: I can, but I'm highlighting a bug on a friend's website and wanted it to be unobstrusive.
[18:24:48 CET] <aruns> Oh, apparently window information is stored in the registry.
[18:25:00 CET] <kepstin> note that ffmpeg has an option to draw a rectangle around the selected screen area - you might do something like capture some size area, then just move the windows you want into the rectangle so they're in the video.
[18:26:59 CET] <aruns> In terms of editing, my laptop doesn't have the greatest specs, so I just want to be able to record the video in the selected area.
[18:27:22 CET] <aruns> I'll fish around for the coordinate data in the registry, if I can't find it in there, I'll try another of your suggestions.
[18:28:51 CET] <kepstin> yeah, that's one of the benefits of obs - it uses a lower-cpu-overhead method of screen capture, (and it might be easier to configure to use hardware encoder if your laptop has one - most recent stuff does)
[18:29:46 CET] <BtbN> On Windows it uses pretty much the same window capture method that ffmpeg uses
[18:30:17 CET] <kepstin> hmm? i thought it had some directx hooks to pull frames from the compositor in vram, or something like that
[18:30:28 CET] <BtbN> That's Game Capture
[18:30:39 CET] <BtbN> Only works for games that use one of the 3D APIs to render
[18:30:53 CET] <BtbN> And is frequently blocked by Anti-Cheat, or gets people banned
[18:31:16 CET] <kepstin> ffmpeg's windows capture (gdigrab) uses some ancient windows apis, pre-xp stuff, that has to copy stuff out of vram and convert it into a windows BMP image in system ram :/
[18:31:48 CET] <kepstin> (admittedly, I think it's not really any worse than what e.g. chrome or firefox use for screen capture)
[18:32:01 CET] <BtbN> Depends what you mean. For Fullscreen-Capture OBS uses Desktop Duplication when available
[18:32:10 CET] <BtbN> For capturing individual windows, it uses that exact GDI api
[18:32:57 CET] <kepstin> hmm, then it would do the same thing as ffmpeg when capturing individual windows, where it wouldn't include overlapping windows
[18:33:10 CET] <kepstin> so aruns would have to use the fullscreen capture anyways
[18:33:26 CET] <BtbN> Of course it doesn't include overlapping Windows. It used to do that in old Pre-Win8 days, but it was fixed
[18:33:46 CET] <kepstin> and i bet the desktop duplication fullscreen capture and crop is faster than ffmpeg's gdigrab fullscreen subregion capture.
[18:34:05 CET] <BtbN> It only uses Desktop Duplication for actual fullscreen capture
[18:34:11 CET] <BtbN> not for individual Windows
[18:34:34 CET] <kepstin> right, but in this case the individual windows option can't be used, because the point is to capture overlapping windows.
[18:34:47 CET] <BtbN> You will only ever get that with Fullscreen Capture
[18:34:56 CET] <kepstin> great, we agree then :)
[18:35:10 CET] <TheAMM> Gimme a cool witty name for the desktop duplication capture (ala gdigrab) and I'll try to throw a PR before new year
[18:35:32 CET] <BtbN> Desktop Duplication Capture is far from trivial to implement
[18:35:34 CET] <TheAMM> Something that's both obviously descriptive and short
[18:35:48 CET] <TheAMM> Oh, no, I've had it for way too long locally
[18:35:58 CET] <aruns> I see, thanks kepstin and everyone else.
[18:36:14 CET] <aruns> Couldn't see any information on Chrome windows in either the Windows Registry or in AppData.
[18:36:16 CET] <TheAMM> I'm sure it'll be torn to pieces but it works for me and IMO the code is fine-ish
[18:36:16 CET] <BtbN> You need to do weird things with tracking changes, as it doesn't just give you images, but a list of changes to the previous image
[18:36:23 CET] <aruns> So I suppose I'll just have to experiment with different coords.
[18:36:28 CET] <BtbN> And then pull the image from the GPU
[18:36:33 CET] <TheAMM> No problem
[18:36:37 CET] <TheAMM> Done and dealt with
[18:36:45 CET] <BtbN> So it needs to integrate with the d3d11va infra of ffmpeg
[18:36:53 CET] <TheAMM> It already is
[18:37:00 CET] <TheAMM> For some hw decoder or something
[18:37:07 CET] <TheAMM> Even configure is set up with it
[18:37:28 CET] <BtbN> Send it to the list then if it's so easy
[18:37:39 CET] <TheAMM> <TheAMM> Gimme a cool witty name for the desktop duplication capture (ala gdigrab) and I'll try to throw a PR before new year
[18:38:04 CET] <TheAMM> The issue is that handling rotated or special DPI displays is a bother, and I haven't done that
[18:38:23 CET] <TheAMM> But it's certainly a whole lot better than gdigrab if you want dem frames
[18:39:32 CET] <TheAMM> Actually another issue is the whole realtime input thing, because ffmpeg will request a frame and then warm up the encoders
[18:40:16 CET] <TheAMM> So you'll get the first frame stuck for some amount of time (most visible with nvenc)
[18:40:58 CET] <TheAMM> I've considered threads and rtbufsize but I really don't know how the mailing list will react to such things
[18:45:10 CET] <aruns> Thanks, I got it working for my needs now.
[19:21:23 CET] <capelino> hi all!
[19:21:26 CET] <capelino> trying to build the latest version com github, getting this: "ERROR: libvpx decoder version must be >=0.9.1" on humble-video-captive. it says to report this error here. can anyone help me?
[19:22:06 CET] <JEEB> that just means that the libvpx required for FFmpeg is higher than the version you have?
[19:22:12 CET] <JEEB> I don't see a bug
[19:22:58 CET] <JEEB> you can look at the details of how the check failed from ffbuild/config.log
[19:24:07 CET] <kepstin> fixing that sort of thing is os-dependent, but a likely cause on many linux distros is that you don't have the libvpx-dev (or similar) package installed.
[19:58:10 CET] <llogan> relaxed: is your lame compiled with --enable-nasm?
[20:59:11 CET] <saml> if ffprobe says key_frame=1   does this mean the frame is I frame?
[21:00:31 CET] <saml> ffprobe -select_streams v -show_frames -of json=compact=1  a.mkv |grep '"key_frame": 1'
[21:00:47 CET] <kepstin> saml: there's a separate field that indicates the frame type
[21:01:13 CET] <kepstin> but I think in pretty much all popular video codecs, key frames will by I frames (or IDR frames, but ffmpeg doesn't expose that)
[21:01:52 CET] <saml> ah i see. thanks
[21:04:38 CET] <saml> if there's a key frame roughly every 5 seconds,  I cannot cut video at different boundary?
[21:04:53 CET] <kepstin> saml: not without decoding and re-encoding the video.
[21:06:11 CET] <__gh0st> Hi! Is it possible to get the AVPictureType from AVPacket, without decoding the packet? i.e I need to get the frame type of a packet.
[21:06:55 CET] <saml> ffmpeg -f concat -i /tmp/concat.txt  -c:a aac -c:v libx264 /tmp/combined.mp4
[21:07:03 CET] <saml> [mp4 @ 0x5595dd065ac0] Non-monotonous DTS in output stream 0:1; previous: 723380, current: 637086; changing to 723381. This may result in incorrect timestamps in the output file.
[21:07:09 CET] <saml> I see a lot of these warnings
[21:07:32 CET] <saml> even if I re-encode.  concat.txt aren't necessarily at key frames
[21:07:33 CET] <kepstin> saml: the concat *demuxer* that you are using is basically doing file cutting/joining without re-encoding, and therefore suffers from the limit that it can only cut on keyframes
[21:08:04 CET] <saml> so i'll try concat filter
[21:08:04 CET] <kepstin> you need to switch to use multiple individually decoded inputs then the concat filter if you want to cut/join at arbitrary points
[21:09:01 CET] <saml> what is a decoded input?
[21:09:34 CET] <kepstin> __gh0st: There's "parsers" available for a variety of codecs that can read data from the frames without decoding them. You might be able to get the info you want that way.
[21:09:48 CET] <kepstin> saml: I'm just referring to a normal input specified with -i
[21:11:47 CET] <__gh0st> kepstin: Thanks, I only need a h.264 parser, I think I can use libx264?
[21:14:05 CET] <Hello71> x264 is only an encoder
[21:14:07 CET] <kepstin> __gh0st: no, that's an encoder... libavcodec in ffmpeg includes an h264 parser. I'm not sure how to use it via the api, that's not something i've used before.
[21:14:15 CET] <saml> hrm, so I need to extract hundreds of segments from a video and concat them.  Maybe I need to write my own tool linking to ffmpeg libraries. the ffmpeg commandline will be long
[21:15:16 CET] <__gh0st> kepstin: Okay, thanks! I'll go dig into that then. )
[21:15:45 CET] <kepstin> saml: one thing to try is to use -filter_complex_script with an input file, and then use the 'movie' filter to do inputs: https://www.ffmpeg.org/ffmpeg-filters.html#movie-1
[21:16:55 CET] <saml> wow i didn't know about filter_complex_script
[21:17:51 CET] <saml> ah yeah hrm that could work.  movie filter also has seek_point  whoa
[21:18:37 CET] <kepstin> Note that unlike the ffmpeg cli "-i" option, the movie filter doesn't reset timestamps to start at 0 when seeking. If you want to do this manually, add a "setpts=PTS-STARTPTS" filter after the movie filter.
[21:18:52 CET] <kepstin> and you can use the 'trim' filter to cut the end point of your clips
[21:19:39 CET] <saml> hrm it doesn't have -t  equivalent
[21:20:11 CET] <kepstin> saml: <kepstin> and you can use the 'trim' filter to cut the end point of your clips
[21:26:11 CET] <kepstin> saml: i'd expect a (video only) script for this would look like https://gist.githubusercontent.com/kepstin/7e67d3d75339517423d494b124134954/raw
[21:26:51 CET] <kepstin> it's a bit more complex if you add audio too, since you need more options to the movie filter to pull the audio+video together, and the audio has to be trimmed separately with atrim.
[21:29:41 CET] <llogan> trim will require setpts before feeding it to concat filter
[21:39:08 CET] <saml> kepstin, thanks.  I did it https://gist.github.com/saml/312f3a11b8db3a64c0ab1a17b4b6b6d4   resulting out.mkv is sorta weird. it's duration is a lot longer
[21:40:01 CET] <saml> oh i'll try moving setpts  before concat, not before trim
[21:40:18 CET] <kepstin> before trim is fine, in fact i'd expect issues after trim
[21:40:28 CET] <kepstin> you're not using movie inputs tho?
[21:40:41 CET] <kepstin> where's your inputs?
[21:41:01 CET] <raytiley> can the concat filter work with subtitle streams? I'm getting `s` is not an option?
[21:42:02 CET] <kepstin> raytiley: no. There's very few filters that can do anything with subtitle streams, iirc this is due to some general limitations in the filter framework
[21:42:33 CET] <raytiley> kepstin: thanks
[21:43:10 CET] <saml> kepstin, ffmpeg -i a.mkv -filter_complex_script filter.txt -map '[v]' -map '[a]' out.mkv
[21:43:13 CET] <saml> i did it that way
[21:43:24 CET] <saml> and use [0]  in filter graph  https://gist.github.com/saml/312f3a11b8db3a64c0ab1a17b4b6b6d4
[21:43:33 CET] <saml> using setpts after trim works perfect
[21:43:41 CET] <kepstin> saml: ok, with that particular setup you have you would need setpts after trim, yeah
[21:43:56 CET] <kepstin> tbh i'm kind of surprised that sending a single input to multiple filters like that works properly
[21:44:10 CET] <saml> i feel like a video engineer
[21:44:29 CET] <saml> now i can make video a lot shorter :P
[21:47:31 CET] <Alina-malina> please help: [mov,mp4,m4a,3gp,3g2,mj2 @ 0000000000662de0] moov atom not found
[21:47:40 CET] <Alina-malina> test.mp4: Invalid data found when processing input
[21:48:39 CET] <kepstin> Alina-malina: your input file is truncated (incomplete download or cancelled encode, maybe) or otherwise corrupt, and therefore can't be played.
[21:48:55 CET] <Alina-malina> omg is there a way to fix this?
[21:48:59 CET] <Alina-malina> i was working on it so hard
[21:49:01 CET] <Alina-malina> to create
[21:49:49 CET] <kepstin> First - make sure that this doesn't happen again: When possible, use formats other than mp4 that can survive this type of error.
[21:50:15 CET] <Alina-malina> its 8GB file
[21:50:29 CET] <kepstin> In some cases it can be repaired - if you have another video from the same encoder/camera/whatever, or with tools that attempt to guess the right parameters
[21:50:44 CET] <kepstin> but it's easier to just restore your backup copy, tbh.
[21:50:54 CET] <Alina-malina> there is no backup copy
[21:50:56 CET] <Alina-malina> thats the single file
[21:52:09 CET] <kepstin> anyways, if you have another *working* video generated by the same program or device, you can try using https://github.com/ponchio/untrunc to repair it
[21:52:59 CET] <kepstin> i think there's some proprietary tools around that can guess some repairs without a working sample file, but I don't have experience with any of them
[21:55:01 CET] <kepstin> anyways, please take the lesson to heart: backup important stuff that you've put a lot of time into, and use formats other than mp4 (mkv is a good option) for long-running edits/encodes so that partial files can be recovered.
[22:00:50 CET] <Alina-malina> kepstin, lmao, dude it was a desktop record itself, you cant make a backup from the stream you making from....
[22:01:01 CET] <Alina-malina> kek
[22:01:41 CET] <kepstin> well, the second half of my statement covers that case.
[00:00:00 CET] --- Thu Dec 20 2018


More information about the Ffmpeg-devel-irc mailing list