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

burek burek021 at gmail.com
Sun Dec 16 03:05:02 EET 2018


[00:00:08 CET] <birdboy88> kepstin: it varies. usually unnoticable, but sometimes 0.5 sec ca
[00:00:34 CET] <kepstin> main thing i can think of there is that you might be getting accumulated rounding error in the trims, since they can only trim to frame accuracy
[00:00:49 CET] <kepstin> so finding a way to work with absolute instead of relative timings could help
[00:00:57 CET] <birdboy88> kepstin: yes, that's an interesting thought
[00:01:11 CET] <monery> I had that problem with cuda accelerated encoding some time back, solution for me back then was to make lots of smaller videos then splice them together at the end
[00:01:54 CET] <birdboy88> monery: you mean when you recorded with a video card? how did you make many small videos from that? Shadowplay has almost no settings...
[00:02:08 CET] <monery> i use ffmpeg from the linux terminal
[00:02:13 CET] <monery> so I did it via the command line
[00:02:38 CET] <kepstin> well, that's a very different use case from live windows game capture...
[00:02:47 CET] <monery> ffmpeg website had the infomation on how to extract a specific part of the video out of a large file
[00:03:19 CET] <monery> its a file not a stream right?
[00:03:25 CET] <monery> arg door
[00:03:25 CET] <monery> brb
[00:03:28 CET] <birdboy88> yes, its a file
[00:03:41 CET] <birdboy88> output of NVIDIA shadowplay, ca 1 hour gameplay
[00:03:49 CET] <birdboy88> default shadowplay settings
[00:03:58 CET] <kepstin> birdboy88: note that it *is* possible to do all of your work from multiple commands with a single ffmpeg command and complex filter chain, but it would probably be a pain to write.
[00:04:35 CET] <kepstin> (and i'm not sure whether or not it would help with a/v sync)
[00:04:41 CET] <birdboy88> kepstin: do you think that would resolve the sync issue?
[00:04:54 CET] <birdboy88> ok
[00:05:58 CET] <monery> not even sure how to script it in Windows, I know there is some syntax errors...
[00:06:04 CET] <monery> not errors, differences
[00:06:24 CET] <kepstin> birdboy88: first thing i'd try is adding a "fps=30" (or something) filter in the filter chain when extracting the clips, which might workaround issues due to large frame timing gaps when calculating the trims
[00:07:10 CET] <kepstin> use a fps value that matches what you want the final rendered video to be
[00:07:39 CET] <monery> kepstin, is there anything you don't know about ffmpeg?
[00:07:40 CET] <monery> lol
[00:08:36 CET] <birdboy88> kepstin: could you please tell me where excately I should put fps=30?
[00:09:06 CET] <kepstin> birdboy88: it would have to be added to the -filter_complex, with [0:v] as input
[00:09:29 CET] <kepstin> (you'd also want to give the output pad a name and -map that)
[00:09:54 CET] <kepstin> although note that this means you can't use -vcodec copy...
[00:10:00 CET] <kepstin> oh, wait, you're using -vcodec copy
[00:10:04 CET] <kepstin> that explains everything.
[00:10:51 CET] <kepstin> when you're using -vcodec copy, the start time (set with -ss) is rounded to the nearest keyframe
[00:10:54 CET] <kepstin> it's not exact
[00:11:07 CET] <kepstin> depending on the keyframe interval, this will result in possibly quite large shifts
[00:11:37 CET] <kepstin> (also, your commands are applying audio filters on commands with -an, which is confusing/contradictory)
[00:12:13 CET] <Skandalist> Why do I get inaccurate video bitrate. For example, while using -b:v 1000k, I get 997kbit/s?
[00:12:23 CET] <kepstin> Skandalist: looks pretty accurate to me
[00:12:29 CET] <birdboy88> so the problem is that the audio temporary clips are not being extracted from the same excat timepoints?
[00:13:21 CET] <Skandalist> <kepstin> yes, but in kdenlive it is exact
[00:13:47 CET] <kepstin> birdboy88: yeah, your audio is being re-encoded to wav so it's being cut sample-accurate, but the video's not being precisely cut.
[00:15:13 CET] <kepstin> Skandalist: you didn't say anything about codecs, but in general using the -b:v option sets a target "average" bitrate, and it's up to the encoder to try to get as close as possible over longer intervals but raising/lowering quality. It's basically impossible to hit right on with a single-pass encode, although most encoders can get pretty close with 2-pass.
[00:15:28 CET] <Skandalist> h264
[00:16:21 CET] <birdboy88> kepstin: so I need to use slow seek (?) to extract video accurately? Or somehow extract audio only where there are video keyframes?
[00:17:19 CET] <kepstin> birdboy88: i don't know how to extract audio starting at video keyframes with ffmpeg cli. You're already doing slow seek, which doesn't help (you should move the -ss option to before the -i option to speed it up)
[00:17:35 CET] <kepstin> if you want accurate video cutting when saving to a file, you have to re-encode the video
[00:17:58 CET] <kepstin> (doing this in a single ffmpeg command means you don't have to save to a file, so you can avoid the issue)
[00:18:29 CET] Action: kepstin is off for a bit now
[00:18:33 CET] <birdboy88> kepstin:
[00:18:36 CET] <birdboy88> Ok thanks!
[00:19:09 CET] <monery> kepstin, you don't have insight to my issue by chance do ya?
[00:19:23 CET] <monery> [h264_nvenc @ 0x55b3c30d5540] Cannot load libnvidia-encode.so.1
[00:20:51 CET] <stephenwithav> monery: do you have a libnvidia-encode.so.1 file?
[00:22:32 CET] <monery> I thought I did
[00:22:40 CET] <monery> let me search the machine real quick
[00:24:13 CET] <stephenwithav> If not, apt-file search it, then install that package.
[00:24:27 CET] <monery> slow disk...
[00:24:46 CET] <monery> hmm
[00:24:48 CET] <monery> wtf
[00:24:57 CET] <stephenwithav> Not found?
[00:24:57 CET] <monery> oh, I know why I thought it was there... crap
[00:25:10 CET] <monery> I think I was in the wrong ssh when I did the search...
[00:27:03 CET] <monery> ...
[00:27:08 CET] <monery> I am such a spoon
[00:27:41 CET] <monery> ... so its encoding now...
[00:27:52 CET] <monery> thanks stephenwithav for making me look a 2nd time
[00:28:41 CET] <stephenwithav> yw.  You were simply on the wrong server the entire time?
[00:30:24 CET] <monery> ya
[00:30:34 CET] <monery> I built one out of some scrap just to make the work go faster
[00:30:44 CET] <monery> so I got two of em currently
[00:31:33 CET] <stephenwithav> Been there myself many times.
[00:32:17 CET] <monery> ...
[00:32:27 CET] <monery> thats what I get for not smoking enough weed
[00:33:06 CET] <Skandalist> <kepstin> Thank you
[03:01:28 CET] <d3bug> having trouble converting from h.264 to hevc.  Command: ffmpeg -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -hwaccel_output_format vaapi -autorotate 0 -i infile.mkv -vf crop=1920:800:0:140 -vcodec hevc_vaapi -qp 20 -map_chapters 0 -bf 0 -acodec libvorbis outfile.mp4
[03:01:47 CET] <d3bug> result: "Impossible to convert between the formats supported by the filter 'graph 0 input from stream 0:0' and the filter 'auto_scaler_0'"
[03:02:02 CET] <d3bug> when I remove the crop parameter it works.
[03:02:08 CET] <d3bug> but i want to crop it
[03:02:41 CET] <iive> d3bug, you need filter that can work with hardware surfaces, especially the ones used by vaapi
[03:02:51 CET] <iive> maybe somebody here will know more
[03:03:00 CET] <d3bug> thats what i am hoping
[03:04:31 CET] <furq> d3bug: it's not ideal but -vf hwdownload,crop=1920:800:0:140,hwupload
[03:05:04 CET] <d3bug> furq: why is that not ideal?  does it do something nasty with the result?
[03:05:16 CET] <furq> it copies everything from vram to system memory and back again
[03:05:47 CET] <Niklink> I'm trying to install libvmaf for use with ffmpeg, but I haven't been able to do so. I can't find any suitable instructions anywhere
[03:05:47 CET] <d3bug> aaah
[03:05:53 CET] <d3bug> so a performance hit
[03:05:55 CET] <furq> there's a scale_vaapi filter that does it on the gpu but i don't see a crop_vaapi
[03:06:05 CET] <furq> i've never used vaapi though so shrug
[03:07:47 CET] <iive> d3bug, https://trac.ffmpeg.org/wiki/Hardware/VAAPI has some transcoding options, it uses vaapi_scale, instead of hwdownload/upload
[03:07:48 CET] <d3bug> furq:  I get this "[hwupload @ 0x563b93efc7a0] A hardware device reference is required to upload frames to. [Parsed_hwupload_0 @ 0x563b93efbf40] Query format failed for 'Parsed_hwupload_0': Invalid argument"
[03:08:29 CET] <furq> -filter_hw_device
[03:09:17 CET] <furq> https://trac.ffmpeg.org/wiki/Hardware/VAAPI#DeviceSelection
[03:09:29 CET] <furq> or maybe you can just use -vaapi_device instead of -hwaccel_device
[03:14:31 CET] <d3bug> I just tried this command:  "ffmpeg -init_hw_device vaapi=gpu:/dev/dri/renderD128 -hwaccel vaapi -hwaccel_device gpu -hwaccel_output_format vaapi -autorotate 0 -i infile.mkv -filter_hw_device gpu -filter_complex hwdownload,crop=1920:800:0:140,hwupload -vcodec hevc_vaapi -qp 20 -map_chapters 0 -bf 0 -acodec libvorbis outfile.mp4"
[03:14:49 CET] <d3bug> it seems to have locked up
[03:15:29 CET] <d3bug> i had to kill the process
[03:17:09 CET] <jafa> ffmpeg cli - what is the preferred way to map 2 audio channels from the input audio track to create a stereo output track. the input track is 4 channel and I want to grab 0.0.0 and 0.0.1... drop the other two channels
[03:17:43 CET] <jafa> i have run tests mapping a single channel and that works
[03:25:06 CET] <d3bug> I guess nobody has any ideas... lol
[03:33:26 CET] <d3bug> anyone here use vaapi and crop together?
[03:40:46 CET] <d3bug> such a simple task.... you would think other people have figured this out...
[08:56:29 CET] <logicWEB> hey :-) I was just poking through some on video and found a file captured from a PVR over Firewire many years ago, and when I play it back, it looks like all the fields throughout the file are shifted by one, i.e. the first frame's top field is missing, and its bottom field gets interpreted as its top field and combined with the second frame's top field, and then the second frame becomes the second bottom plus the third top, etc.
[08:56:39 CET] <logicWEB> I haven't investigated super closely but going through frame by frame that's what it looks like
[08:58:36 CET] <logicWEB> is there a filter that can correct this? the closest I saw in the docs was fieldhint, but that would require me to hint _every single frame_, if I'm reading correctly, so for this video it looks like that'd be a file with over 40,000 identical lines in it
[09:00:58 CET] <logicWEB> *poking through some _old_ video
[09:09:13 CET] <furq> logicWEB: separatefields?
[09:12:40 CET] <furq> oh wait there's a filter specifically for this
[09:12:43 CET] <furq> https://www.ffmpeg.org/ffmpeg-filters.html#phase
[09:13:04 CET] <logicWEB> hmm, that seems like it would get it half-way there -- it turns a frame with two fields into two frames with one field each, so then if the first one were discarded and then they were recombined... but there's no "combinefields" filter??
[09:13:16 CET] <logicWEB> oh neat, checking that out
[09:13:16 CET] <furq> well you'd do separatefields and then tinterlace or something
[09:13:19 CET] <furq> but yeah phase looks better
[09:13:28 CET] <furq> you probably also want to force your player tff/bff
[09:13:35 CET] <furq> just to make sure that you actually have the problem you think you do
[09:15:06 CET] <logicWEB> sweet, `phase=b` fixes the problem :-D
[09:15:27 CET] <logicWEB> single-stepping, the fields are perfectly lined up even under high motion
[09:15:35 CET] <logicWEB> so that's exactly what I needed, thanks! :-D
[12:11:41 CET] <ed8> hello, I'm working on a project where I have to extract hundred of small clips from a source video
[12:12:08 CET] <ed8> to do so I use time from a subtitle file (to get start and end)
[12:13:00 CET] <ed8> my extracted files do not seems to strcitly respect the duration [begin,end] time I gave
[12:15:06 CET] <ed8> To extract I use  -acodec copy -vcodec copy as seen here: https://github.com/parlr/lsf-data/blob/master/scripts/split-laura-video.bash#L38-L51
[12:15:28 CET] <furq> ed8: you can only cut on keyframes if you're stream copying
[12:17:01 CET] <ed8> furq: I should apologize as I have little to no knowledge about video editing
[12:18:20 CET] <furq> some video frames are keyframes, most (usually) aren't
[12:18:26 CET] <furq> and a video has to start on a keyframe
[12:18:50 CET] <furq> so when you cut a clip out, if you're not reencoding, ffmpeg will just seek to the nearest keyframe to the timestamp you gave with -ss
[12:19:06 CET] <JEEB> there's keyframes and then there's random access points. difference being about the promises made for frames after ;)
[12:19:25 CET] <JEEB> if you cut at a keyframe there's no promise of you being able to decode the frames that pop up later
[12:19:29 CET] <furq> yeah i strictly mean IDR/IRAP/whatever
[12:19:48 CET] <JEEB> yea, the FFmpeg API using the wording "keyframe" for it is unfortunate
[12:19:56 CET] <JEEB> and thus leads to me always commenting from the side like this :P
[12:20:17 CET] <JEEB> or well, "keyframe" I think was OK to use in the MPEG-2 and early MPEG-4 (Part 2) era?
[12:20:21 CET] <furq> anyway the summary is you either have to live with inaccurate cuts or reencode the video
[12:20:28 CET] <furq> you should be able to copy the audio
[12:20:29 CET] <JEEB> then after MPEG-4 AVC it became less simple
[12:20:51 CET] <JEEB> since you got IDR and you got SEI+I for open gop
[12:21:24 CET] <ed8> furq: so no way to do it in 2 steps (clip out, then encode) if I want to precisely respect the specified time point ?
[12:22:04 CET] <furq> well you could just do that in one step
[12:41:45 CET] <ed8> furq: ok, I'm refactoring my tests to update my code
[12:42:24 CET] <furq> also you might want to look into the segment muxer
[12:42:34 CET] <furq> specifically -segment_times
[15:07:20 CET] <pink_mist> so, I'm trying to use ffmpeg to mux an audio stream and a video stream downloaded from youtube with youtube-dl ... youtube-dl failed at making ffmpeg mux them, and I'm not having any better luck ... ffprobe of the audio file says: https://p.0au.de/b66e715
[15:08:32 CET] <pink_mist> is ffmpeg unable to deal with this format? or do I simply need to install an optional library and recompile ffmpeg?
[15:11:59 CET] <relaxed> mux into which container?
[15:12:27 CET] <durandal_1707> pink_mist: recompile with libaom or libdav1d for decoding that
[15:12:43 CET] <pink_mist> ahh, thanks!
[15:12:52 CET] <pink_mist> relaxed: mkv
[15:13:24 CET] <relaxed> right, I forgot we don't have a native decoder
[15:14:12 CET] <pink_mist> seems libdav1d is not available, so libaom it is
[15:16:03 CET] <furq> pink_mist: mkvmerge will do it as of about two months ago
[15:18:07 CET] <pink_mist> furq: has that version been released? I downloaded the latest windows version of mkvtoolnix just 15 minutes ago, and it did not work either ... perhaps that version is older than 2 months though?
[15:19:03 CET] <kepstin> wait, google's putting av1 stuff on youtube now? wow.
[15:19:20 CET] <kepstin> i guess they're the only people with enough compute power to actually encode a whole video with it :/
[15:19:33 CET] <pink_mist> it's just the audio
[15:20:02 CET] <pink_mist> according to the youtube-dl format list at least
[15:20:02 CET] <kepstin> that's the video file in your ffprobe
[15:20:22 CET] <kepstin> you might need a newer youtube-dl, it might have the format wrong because av1 is very new
[15:20:50 CET] <pink_mist> ah, that would be annoying
[15:20:54 CET] <pink_mist> let me try
[15:21:40 CET] <kepstin> pink_mist: for reference, https://github.com/rg3/youtube-dl/issues/17506
[15:21:52 CET] <kepstin> fixed nov 8
[15:23:36 CET] <pink_mist> right, my youtube-dl is certainly older than that :P
[15:23:57 CET] <pink_mist> thanks, guess I'll need to redownload an actual audio format then =)
[15:29:17 CET] <pink_mist> ok, new youtube-dl solved it :P
[15:29:26 CET] <pink_mist> thanks kepstin :)
[15:29:56 CET] <kepstin> yep, important to keep youtube-dl updated, because sites change all the time :)
[15:39:31 CET] <pink_mist> (I got libaom installed anyway, so might as well recompile ffmpeg with it too)
[15:59:29 CET] <Niklink> I'm trying to install libvmaf for use with ffmpeg, but I haven't been able to do so. I can't find any suitable instructions anywhere
[16:00:51 CET] <JEEB> I'm not sure if the vmaf people broke compilation again. they've been sending patches every now and then when they break their API
[16:01:21 CET] <Niklink> I didn't get to the 'compilation' part
[16:02:51 CET] <Niklink> or if you know of any other tool to score videos based on perceptual quality, that could also work
[16:05:33 CET] <JEEB> even VMAF can't be blindly re-used since it's been 100% trained on netflix's content and use case
[16:05:46 CET] <JEEB> of course it's a +1 metric, and that's great
[16:06:00 CET] <JEEB> also metrics you always have to remember are not really ever "perceptional"
[16:06:14 CET] <Niklink> what if I had a bunch of similar videos
[16:41:37 CET] <relaxed> Niklink: if you're using linux my static builds have libvmaf 1.3.9  https://www.johnvansickle.com/ffmpeg/
[16:42:24 CET] <Niklink> thanks, that's helpful
[16:42:27 CET] <Niklink> linux is free, right?
[20:40:43 CET] <pfloyd> I have a voicemail in .amr format, which I'd like to make into a video so I can upload to youtube. Is there a way to just pack the audio into a video container and put a static image as the video layer?
[20:45:29 CET] <ariyasu> maybe just "ffmpeg -i image.jpg -i audio.amr -vcoded libx264 -acodec aac out.mkv"
[20:45:43 CET] <ariyasu> it might work or it might display the jpg for 1 frame heh
[20:45:46 CET] <ariyasu> worth a try though
[21:36:01 CET] <kerio> ariyasu: just put it however you want, youtube will ffmpeg it out into its own format anyway
[21:36:32 CET] <kerio> just -c:v copy -c:a copy
[21:39:40 CET] <ed8> I'm iterating over a file content to clip out part of a single source to multiple output using bash: https://gist.github.com/edouard-lopez/e928ac0e05c283aca66509488cc1ef4f#file-extract-and-encode-bash-L53-L56
[21:40:19 CET] <ed8> earlier furq advice to look at ` -segment_times` but I'm not sure it fit my need
[22:05:36 CET] <Nosomy> I use ffmpeg to find discontinuities in files and generate hashes of the blocks of these, should I make a more appropriate program for this?
[23:27:52 CET] <kingsley> Do you happen to know how to
[23:27:56 CET] <kingsley> a.) brighten,
[23:28:08 CET] <kingsley> b.) stretch the contrast and
[23:28:16 CET] <kingsley> c.) make less grainy
[23:28:24 CET] <kingsley> video taken in low light?
[23:29:49 CET] <kingsley> I can imagine something like GIMP's white balance and HSV stretch filter combined with something like ffmpeg's minterpolate filter that compares adjacent frames to average their color and reduce graininess.
[23:29:55 CET] <kingsley> What do you think?
[23:39:13 CET] <kingsley> Bonus points for explaining how with kdenlive.
[23:40:05 CET] <durandal_1707> kingsley: minterpolate does not average colors across frames it interpolates motion
[23:40:28 CET] <kingsley> durandal_1707: I agree.
[23:40:42 CET] <iive> kingsley, check `man ffmpeg-filters` for these colorlevels, curves, eq ...
[23:41:25 CET] <durandal_1707> there are numerous types of grainy - so that needs more info
[23:42:52 CET] <kingsley> durandal_1707: OK. I'd like to fix the graininess at
[23:43:00 CET] <kingsley> http://loaner.com/2018_winter_Taekwondo_belt_ceremony.webm
[23:43:35 CET] <kingsley> iive: I'm reading the man page now...
[23:46:50 CET] <durandal_1707> that is from bad encoding, nothing much you can do about it, filters are for unprocessed data not transcoding miracles
[23:47:50 CET] <kingsley> durandal_1707: Maybe. Or maybe we just don't know how. Yet.
[23:48:24 CET] <iive> there is also "histogram" filter, that might be useful...
[23:49:08 CET] <iive> hum... if you have the source , you may try "spp" filter. set quant parameter manually.
[23:49:10 CET] <Nosomy> VHS cap?
[23:49:43 CET] <iive> it looks like mpeg1 encode of VHS
[23:49:53 CET] <Nosomy> Yeah
[23:50:08 CET] <iive> and low bitrate one on top of that...
[23:51:10 CET] <Nosomy> I hope has been extremely cheap.
[23:53:31 CET] <kingsley> iive: I searched the ffmpeg-filters man page for the "histogram" filter. It led me to the "histeq" filter, which evidently it can correct degraded or poorly captured source video.
[23:54:38 CET] <iive> well, if it works for you :D
[23:54:47 CET] <durandal_1707> histeq is for histogram equalization it will not fix those artefacts...
[23:55:07 CET] Action: kingsley also notes the "hqdn3d" filter, which is evidently a denoiser.
[23:55:22 CET] <Nosomy> Some transcoding miracles can be happens, but only for audio.
[23:55:24 CET] <durandal_1707> you can try that one
[23:56:12 CET] <durandal_1707> Nosomy: transcoding (lossy) does nothing
[23:56:25 CET] <durandal_1707> nothing good to video and audio
[23:56:43 CET] <kingsley> iive: I agree that the "spp" filter may be worth trying. Thank you.
[23:57:49 CET] <durandal_1707> none of filters are designed for those type of artefacts
[23:58:19 CET] <durandal_1707> you can only try nlmeans with some special options and hope details are not lost
[00:00:00 CET] --- Sun Dec 16 2018


More information about the Ffmpeg-devel-irc mailing list