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

burek burek021 at gmail.com
Fri May 31 03:05:02 EEST 2019


[00:26:51 CEST] <bencc> when I generate animated gif from mp4 it looks very pixelated:
[00:26:53 CEST] <bencc> ffmpeg -i test.mp4 -vf "crop=620:680:330:20" -q:v 1 test.gif
[00:27:13 CEST] <bencc> isn't "-q:v 1" best quality? or maybe the problem is with colors and not quality?
[00:27:38 CEST] <BtbN> A gif only has 256 colors
[00:27:43 CEST] <BtbN> it's bound to look horrible
[00:28:03 CEST] <kepstin> bencc: you should be using the palettegen/paletteuse filters, they provide more control over the colour reduction/dithering and should give better results
[00:28:09 CEST] <BtbN> There is some 2pass palettegen magic that does the best it can, but it's still far from great
[00:28:24 CEST] <kepstin> yeah, it's best to just not use gif
[00:28:40 CEST] <BtbN> Luckily, gifs are pretty dead, since every browser can just play videos now
[00:29:10 CEST] <kepstin> pretty much every online "gif" host actually serves up video files since they're smaller :)
[00:29:17 CEST] <bencc> trying palettegen
[00:29:28 CEST] <kepstin> (often converting uploaded gif to mp4 or webm)
[00:32:10 CEST] <bencc> with palettegen/paletteuse the quality is great
[00:32:45 CEST] <bencc> how can I crop and use paletteuse together?
[00:32:51 CEST] <bencc> this gives me an error:
[00:32:53 CEST] <bencc> ffmpeg -i test.mp4 -vf "crop=620:680:330:20" -i palette.png -filter_complex "[0:v][1:v] paletteuse" -q:v 1 test.gif
[00:41:25 CEST] <kepstin> bencc: need to combine the two filter expressions into one. something like this would work: `-filter_complex "[0:v]crop=620:680:330:20[cropped]; [cropped][1:v]paletteuse"
[00:46:19 CEST] <bencc> kepstin: works great. I'll read about [0:v] and [1:v]. thanks
[09:44:19 CEST] <dongs> hmm so
[09:44:48 CEST] <dongs> Video: HVC1 7680x4320 59.94fps [V: hevc main 10, yuv420p10le, 7680x4320 [default]]
[09:44:54 CEST] <dongs> this actually plays OK at full speed on RTX2080
[09:45:06 CEST] <dongs> but goes at like 15fps on Quadro P2000
[09:46:03 CEST] <dongs> https://developer.nvidia.com/video-encode-decode-gpu-support-matrix the only difference between pascal and rtx is addition of 4:4:4 HEVC support
[09:52:42 CEST] <dongs> Turings new NVDEC decoder has also been updated to support decoding of HEVC YUV444 10/12b HDR at 30 fps, H.264 8K, and VP9 10/12b HDR.
[09:52:45 CEST] <dongs> i guess thats why
[09:52:49 CEST] <dongs> ref: https://devblogs.nvidia.com/nvidia-turing-architecture-in-depth/
[09:52:59 CEST] <dongs> so pascal nvdec is only up to 4K
[09:53:02 CEST] <dongs> cc: JEEB
[10:36:09 CEST] <an3k> Weird, it says even Turing is limited to 4K 8-Bit https://developer.nvidia.com/nvidia-video-codec-sdk
[10:36:45 CEST] <an3k> forget that, got a splitsecond confused with H.264 :)
[10:41:07 CEST] <Dachande663> Hi, is this the correct channel to ask filter questions?
[10:41:12 CEST] <durandal_1707> yes
[10:41:22 CEST] <an3k> Maybe you have the issue because the P2000 is GTX1050/GTX1060 level (GP106) while the RTX2080 it Quadro 5000/4000 level (TU104)
[10:43:27 CEST] <an3k> uh hi durandal_1707. Regarding that zscale threading. About what price we approx. talk about? And what if we want zscale to be real multi-threaded? :)
[10:46:49 CEST] <furq> i assume frame threading in lavfi would cost a pretty penny
[10:47:01 CEST] <dongs> an3k: right, but someone on GTX1070/80 also cannot decode anywhere realtime.
[10:48:11 CEST] <dongs> ohh, i see 8k on the link
[10:48:12 CEST] <dongs> neat
[10:48:24 CEST] <an3k> Is there a sample somwhere I could test?
[10:48:31 CEST] <dongs> my file? sec.
[10:48:41 CEST] <dongs> https://drive.google.com/open?id=1IV6C4CpD4k7lIhO0-TxqNjVOuLXZrcqX
[10:48:44 CEST] <dongs> its a bit big
[10:49:09 CEST] <dongs> so Pascal NVDEC is 8192 x 8192**
[10:49:16 CEST] <dongs> where ** = Max resolution support is limited to selected Pascal chips
[10:49:42 CEST] <an3k> yeah, the lower tier chips can't do it
[10:49:43 CEST] <Dachande663> Great. I'm trying to do something which sounds fairly simple in my head, but I've gotten lost trying to merge filter options etc as this is my first time using ffmpeg for anything complex.
[10:49:43 CEST] <Dachande663> I have an image and an mp4. I want to stitch the image to the start of the video as a single frame (not 1 second, literally just one frame). The image is the same size as the video, but sometimes it's out by a fractional amount which is giving me SAR issues. Audio should be used from video, obviously skipping that first frame with silence. So far, I have something that stitches an image to the video.
[10:49:43 CEST] <Dachande663> Issue a) I can't seem to get the image to appear for less than one second.
[10:49:43 CEST] <Dachande663> Issue b) I can't get the aspect ratios to be matched (it's okay to resize image to match as they're very close).
[10:49:43 CEST] <Dachande663> What I have so far:
[10:49:44 CEST] <Dachande663> ffmpeg -loop 1 -t 0.1 -i "cover.jpg" -i "video.mp4" -f lavfi -t 1 -i anullsrc\=channel_layout\=stereo\:sample_rate\=44100 -filter_complex "[0:v] [2:a] [1:v] [1:a] concat=n=2:v=1:a=1 [v] [a]" -c:v libx264 -c:a aac -pix_fmt yuv420p -strict -2 -y -map "[v]" -map "[a]" output.mp4
[10:49:44 CEST] <Dachande663> What I'm trying (unsuccessfully) to merge:
[10:49:44 CEST] <dongs> but no mention of which ones, i would have expected 1070/1080 class to work it.
[10:49:45 CEST] <Dachande663> ffmpeg -i "video.mp4" -loop 1 -t 1 -i "cover.jpg" -f lavfi -t 1 -i anullsrc\=channel_layout\=stereo\:sample_rate\=44100 -filter_complex "[1:v]scale=1080x608:force_original_aspect_ratio=decrease,pad=1080:608:'(ow-iw)/2':'(oh-ih)/2'[i];[0:v][0:a][i][2:a] concat=n=2:v=1:a=1[v][a]" -c:v libx264 -c:a aac -pix_fmt yuv420p -map "[v]" -map "[a]" -y output.mp4
[10:49:45 CEST] <Dachande663> Any ideas?
[10:49:56 CEST] <dongs> an3k: yeah but how is 1080/1080ti "low"?
[10:50:00 CEST] <dongs> you mean like titan or someshit?
[10:50:06 CEST] <dongs> or quadro P5k ttype stufF?
[10:50:33 CEST] <an3k> I don't mean the 1080/1080ti is low
[10:50:48 CEST] <dongs> well above sample plays at around 10-15fps on ti with 100% nvddec utilaizaiton
[10:50:56 CEST] <dongs> 60fps on 2080 with 64% nvdec utikl
[10:51:03 CEST] <an3k> Like I said, the P2000 is GTX1050/GTX1060 level (GP106 chip) while the RTX2080 it Quadro 5000/4000 level (TU104 chip)
[10:51:14 CEST] <dongs> correct
[10:51:44 CEST] <an3k> I'll test with 1080ti and 1050ti. I think my 1050ti will instantly die
[10:53:03 CEST] <dongs> oh damn, P2000 really is only GP104. so its the "3gb" 1060 class
[10:53:17 CEST] <dongs> and 6gb 1060 is prolly the GP106
[10:55:13 CEST] <an3k> P2000 is GP104
[10:55:26 CEST] <dongs> yes, right
[10:55:29 CEST] <dongs> so thats really trash
[10:55:44 CEST] <an3k> oh sorry. I'm wrong
[10:55:44 CEST] <an3k> https://developer.nvidia.com/video-encode-decode-gpu-support-matrix
[10:56:25 CEST] <dongs> there seems to be 2 variations of 1050/ti as well
[10:56:36 CEST] <dongs> theres 106 and 104 listed for 1060
[10:56:44 CEST] <dongs> which i assume is the 3/6gb versions
[10:57:00 CEST] <Dachande663> Anyone know how to set -t option to be less than one second?
[10:57:17 CEST] <an3k> Ok, I can play the file fine on both 1080ti and 1050ti. I don't get 60fps but definitely much more than 24fps
[10:57:29 CEST] <dongs> hmm
[10:57:38 CEST] <an3k> Both cards got utilized to 100%
[10:57:46 CEST] <dongs> ah, 100%. right.
[10:57:48 CEST] <dongs> what OS?
[10:57:54 CEST] <an3k> Win10 x64
[10:58:15 CEST] <dongs> and 1050ti is ~same? or worse
[10:58:47 CEST] <an3k> slightly worse
[10:59:43 CEST] <dongs> the video renderer says its outputting at 30fps but its definitely worse than that
[10:59:46 CEST] <dongs> with lots of dropped frames
[10:59:54 CEST] <dongs> visually it looks more liek 15-ish for me
[11:04:48 CEST] <an3k> Before I tested with MPC-HC DXVA2 and 1080Ti went up to 100% Video Decode and playback had only a few drops.
[11:05:17 CEST] <an3k> Now tested with ffplay with hevc_cuvid and boy the video is laggy as hell.GPU is at 30% ish
[11:05:28 CEST] <dongs> yes, cuvid sucks at this
[11:05:32 CEST] <dongs> i also tried same
[11:05:41 CEST] <dongs> cuvid i was getting around uh... < 5fps
[11:06:01 CEST] <dongs> i think cuvid is dependent on number of actual cuda cores for decode
[11:09:36 CEST] <an3k> Meanwhile I don't think so anymore. nVIDIA is artificially limiting the cards capabilities.
[11:10:06 CEST] <dongs> hehe, well they certainly are on quadro vs consumer
[11:10:13 CEST] <dongs> like the 'number of nevnc sessions'
[11:10:17 CEST] <dongs> that is definitely a driver limitation
[11:10:26 CEST] <an3k> Just found yesterday an extremely tiny patch (it basically changes a byte) that removes the nvenc limit on non-Quadro cards.
[11:10:33 CEST] <dongs> haha :)
[11:15:44 CEST] <an3k> 35 fps on 1050Ti and 45 fps on 1080Ti both MPC-HC x64 DXVA2
[11:18:31 CEST] <an3k> I get 35 fps on 1050Ti and 50 fps on 1080Ti both MPC-HC x64 CUVID
[11:20:26 CEST] <an3k> With CUVID the 1080Ti is utilized ~50% CUDA, 90% NVDEC, 20% 3D. With DXVA2 it's just 100% NVDEC
[11:20:44 CEST] <dongs> hmm my cuvid setup is fucked then
[11:20:53 CEST] <dongs> bceause it uses very little nvdec and just plays at garbage fps
[11:23:20 CEST] <an3k> Hmm, maybe it's the RAM on the card.
[11:24:08 CEST] <an3k> My 1050Ti (4GB) utilizes ~25% CUDA, 25% NVDEC and lags like hell but RAM is utilized 100%
[11:26:46 CEST] <durandal_1707> i have patch for slice threaded zscale filter on ffmpeg-devel mailing list
[11:46:22 CEST] <an3k> awesome, thank you very much! I'll test asap
[12:01:04 CEST] <dongs> fwif, VLC 3.0.5 crashes almost instantly on that 8k video :p
[12:01:13 CEST] <dongs> i downloaded .6 but didnt try
[12:01:14 CEST] <dongs> so whatevr
[12:01:30 CEST] <dongs> does vlc these days also use libavcodec for decoe?
[12:01:34 CEST] <dongs> or they still rollin their own shit
[12:12:43 CEST] <Dachande663> Any help? :(
[12:13:17 CEST] <pink_mist> Dachande663: your question seems odd ... -t 0.1 should work just fine
[12:13:35 CEST] <Dachande663> I tried that, but the frame still appears for 1 second
[12:14:10 CEST] <pink_mist> it matters where in the commandline you place your -t
[12:14:12 CEST] <Dachande663> (using VLC to step through slowly, unless there's a better way to confirm)
[12:17:23 CEST] <Dachande663> the command is as per my message, do I need to move that argument?
[12:28:41 CEST] <Dachande663> Okay, I've found a hacky way around by seeking to 0.95 in output to cut all but last frame. Just working on resizing the image now so it always matches the videos aspect ratio. Any idea how to merge "[0:v] [2:a] [1:v] [1:a] concat=n=2:v=1:a=1 [v] [a]" with "[1:v]scale=1080x608:force_original_aspect_ratio=decrease,pad=1080:608:'(ow-iw)/2':'(oh-ih)/2':setsar=1"?
[12:34:01 CEST] <durandal_1707> Dachande663: where to put scale and others, before concat or after it?
[12:34:14 CEST] <Dachande663> before
[12:34:22 CEST] <Dachande663> I'm trying to scale the image so that it matches the video
[12:34:39 CEST] <durandal_1707> Dachande663: you can use scale2ref
[12:34:42 CEST] <durandal_1707> filter
[12:35:35 CEST] <Dachande663> assume I'm an idiot who sees the filter syntax as voodoo, do I put that fitler after [1:v] ?
[12:38:21 CEST] <durandal_1707> if you can not uderstand filter syntax after carefully reading and looking at documentation and still trying its way by monkeying around - get some mothly payware gui software instead
[12:39:00 CEST] <durandal_1707> *monthly
[12:42:48 CEST] <Dachande663> I spend most of my day in vcl and python, so I'm still learning the filter syntax. This job will run on a headless server so a GUI isn't an option. I won't rise to your bait, don't worry.
[12:57:32 CEST] <durandal_1707> Dachande663: well, if you gonna rescale each input of concat filter that will make very long command
[12:58:11 CEST] <Dachande663> I only need to resize the image to match the video.
[12:58:19 CEST] <Dachande663> and that's assuming this is the problem:
[12:58:35 CEST] <Dachande663> `Input link in1:v0 parameters (size 540x304, SAR 2204:2205) do not match the corresponding output link in0:v0 parameters (540x304, SAR 2567:2565)`
[12:58:49 CEST] <Dachande663> it's the SAR which differs, even though the dimensions are the same?
[12:58:58 CEST] <durandal_1707> yes
[12:59:55 CEST] <Dachande663> would setsar work?
[13:00:46 CEST] <durandal_1707> so basically use: [0:v]scale,setsar[a];[1:v]scale,setsar[b];[a][b][1:a]concat.....
[13:01:55 CEST] <durandal_1707> or [2:a] ... depending what you really need
[13:03:15 CEST] <Dachande663> amazing! that was the last bit I needed
[13:03:32 CEST] <Dachande663> I have it working now based on that
[13:03:37 CEST] <Dachande663> thank you for your help
[15:14:29 CEST] <kingmoses> Hi. I am getting error -11 (Resource temporarily unavailable) when i do AvcodecReceiveFrame for mp4 file of h264 high. The h264 main are working just fine. What can i do?
[15:17:21 CEST] <JEEB> kingmoses: are you jsing sw decoding and are you oushing enough packets into the decoder?
[15:17:41 CEST] <JEEB> both frame threads and bframes require delay until the decoder can output frames
[15:18:05 CEST] <kingmoses> A delay of how long?
[15:19:20 CEST] <JEEB> depends, keep feeding and attempting to receive until you get a ftame out
[15:20:17 CEST] <JEEB> both main and high profile stuff should not have any difference with it. just that high profile more likely also does bframes
[15:20:43 CEST] <kingmoses> Okay. Let me check on it.
[15:37:00 CEST] <kingmoses> JEEB: that has worked. Do you links where i can read about possible errors? It will help me determine whether i need to keep feeding the frames.
[19:01:38 CEST] <mifritscher> moin
[19:02:13 CEST] <mifritscher> is there a option to avformat_open_input() to let it ignore audio alltogether?
[19:16:44 CEST] <mifritscher> ffmpeg has the option -an - it seems - what is the equivalent option for avformat_open_input?
[20:28:49 CEST] <DHE> mifritscher: there is no specific option. examine the opened input and just ignore audio streams that you find
[20:29:30 CEST] <mifritscher> ok, then the data from this stream of the e.g. network stream is simply discarded?
[20:55:48 CEST] <kepstin> mifritscher: when you read from the avformat it'll return all packets received, you must explicitly discard packets for streams you are not interested in
[20:59:18 CEST] <mifritscher> else I'll have a big memory leak I assume?
[20:59:36 CEST] <kepstin> you'll have to unref the packets to avoid a memory leak, yes.
[21:03:29 CEST] <mifritscher> ah, ok, this is done
[21:03:51 CEST] <mifritscher> (I'm using libav not directly, but vja JavaCV)
[21:08:19 CEST] <mifritscher> its of the structure
[21:08:24 CEST] <mifritscher> while (true) {
[21:08:24 CEST] <mifritscher> av_read_frame(oc,pkt);
[21:08:24 CEST] <mifritscher> if (pkt.stream_index() == video_st.index()) { avcodec_decode_video2(video_c, picture, got_frame, pkt);)
[21:08:24 CEST] <mifritscher> if (pkt.stream_index() == audio_st.index()) { avcodec_decode_audio4(audio_c, samples_frame, got_frame, pkt2);) <- I can simply remove this line and get no side effects? (*)
[21:08:25 CEST] <mifritscher> av_packet_unref(pkt);
[21:08:26 CEST] <mifritscher> }
[21:08:52 CEST] <mifritscher> is (*) right?
[21:09:56 CEST] <mifritscher> (I've omitted some details to get to the core ;) )
[21:12:46 CEST] <mifritscher> this would help me very much
[21:20:41 CEST] <kepstin> mifritscher: seems correct.
[21:20:51 CEST] <mifritscher> very good :-)
[21:20:56 CEST] <mifritscher> thanks for your help!
[21:28:35 CEST] <jeaye> I'm trying to encode an mp4 for viewing on mobile. Every single one of these works on Android (Pixel XL), but none of them do on iOS (tried with SE and X). Videos: http://73.223.67.2:3449/
[21:28:40 CEST] <jeaye> I've specifically followed the iOS-specific docs here: https://trac.ffmpeg.org/wiki/Encode/H.264
[21:28:50 CEST] <jeaye> What am I missing?
[21:31:33 CEST] <jeaye> Info on my ffmpeg and the source file used: https://gist.github.com/jeaye/6da9255a4b5d3036f3ff9382c043bc05
[21:32:49 CEST] <kepstin> codecs etc. seem fine. did you use "-movflags faststart" when making the files? I'm not sure if ios requires that but it certainly wouldn't hurt.
[21:34:20 CEST] <jeaye> Nope. The exact command used is included above each video. I can give it a shot.
[21:36:14 CEST] <kepstin> I dunno what the exact issue you're having is, but here's a few more odd things: your webserver is using "video/mp4; charset=utf-8" as the mime type, that charset shouldn't be present
[21:36:47 CEST] <kepstin> also most mobile browsers block autoplay. you might need to add controls to the tag so that they actually get a play button.
[21:37:25 CEST] <jeaye> Ah, good point on the controls.
[21:37:51 CEST] <kepstin> if you're seeing just the first frame displayed as a still image on ios, that's probably the issue.
[21:40:51 CEST] <jeaye> Lots of good info. Thanks so much. Looking into it all now.
[22:33:47 CEST] <jeaye> kepstin: Turns out they _all_ work on iOS. I had originally encoded the MP4 from a WebM file, which doesn't work on iOS, but then it didn't work either. That's what lead me to try all of these different profiles, but it turned out none of them did either.
[22:35:02 CEST] <jeaye> After all of it, every single MP4 works fine on both the iOS devices. The issue was the original HTTP server and how it was serving them up. The one I showed you worked (which has charset for mp4, which is odd). The other one, which doesn't work, didn't have charset and also responded somewhat differently.
[22:35:31 CEST] <jeaye> Anyway, turns out it has nothing to do with encoding or ffmpeg, but your tips were helpful. Thank you!
[23:12:31 CEST] <an3k> Is there anything interesting? https://github.com/DolbyLaboratories/dolby-encoding-engine/tree/master/plugins/code They have x265 and ffmpeg stuff in there
[23:39:47 CEST] <kepstin> an3k: nothing really that exciting, it's just an app that encodes/decodes videos and links to various open source libraries to do so. I don't see any ffmpeg/x265 code in there, just stuff that uses it, so I assume they use unmodified upstream versions.
[23:41:12 CEST] <furq> anything that takes their attention away from pushing AC-4 is fine by me
[23:41:41 CEST] <kepstin> they released that code under BSD license which is fine, but unless they're shipping a commercially licensed libx264 then their shipped binaries would be GPL v2, fwiw.
[23:44:08 CEST] <kepstin> lol, their docs have dolby encoding engine users build the x265 plugin themselves, presumably to sidestep this issue.
[23:45:19 CEST] <kepstin> https://developer.dolby.com/globalassets/professional/product-manuals/dolbyencodingenginehevcencoderinstallationguide.pdf - "Note: Dolby Encoding Engine does not include an HEVC encoder but requires such an encoder to be installed"
[23:45:52 CEST] <kepstin> I haven't checked, but as long as they're shipping a dynamically linked lgpl build of ffmpeg there shouldn't be any issues there.
[00:00:00 CEST] --- Fri May 31 2019


More information about the Ffmpeg-devel-irc mailing list