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

burek burek021 at gmail.com
Fri Jun 14 03:05:02 EEST 2019


[02:14:11 CEST] <ringo_> Hello
[02:15:04 CEST] <ringo_> I am using the latest git of ffmpeg (two days ago) ... I am trying to use ffmpeg tp decode an hevc file and output it over a decklink SDI
[02:15:47 CEST] <ringo_> I have the latest nvidia kernel driver install and both the latest nvidia headers from git and the latest cuda_sdk as well
[02:16:03 CEST] <ringo_> everything compiles and seems to load
[02:16:19 CEST] <ringo_> but I have a pixel format conversion that I cannot solve and need some guidance
[02:18:11 CEST] <ringo_> when I do NOT use hardware decoder (cuvid), ffmoeg can convert the input to AV_PIX_FMT_UYVY422 just fine
[02:18:28 CEST] <ringo_> but when I enable -hwaccel cuvid -c:v hevc_cuvid
[02:19:00 CEST] <ringo_> then it fails to find a way to convert the output pixel format (cuda or 420) to 422
[02:23:55 CEST] <ringo_> so, this works but it is not fast enough
[02:23:56 CEST] <ringo_> ./ffmpeg -re -i /data/public/media/HEVC4K60.ts -ac 2 -ar 48000 -f decklink -pix_fmt uyvy422 'DeckLink 8K Pro (1)'
[02:24:31 CEST] <ringo_> and this fails
[02:24:31 CEST] <ringo_> ./ffmpeg -re -hwaccel cuvid -c:v hevc_cuvid -i /data/public/media/HEVC4K60.ts -ac 2 -ar 48000 -f decklink -pix_fmt uyvy422 'DeckLink 8K Pro (1)'
[02:24:53 CEST] <ringo_> with this error
[02:24:53 CEST] <ringo_> Impossible to convert between the formats supported by the filter 'Parsed_null_0' and the filter 'auto_scaler_0'
[02:24:54 CEST] <ringo_> Error reinitializing filters!
[02:24:54 CEST] <ringo_> Failed to inject frame into filter network: Function not implemented
[02:25:55 CEST] <ringo_> looking at the debug log, it is clear that the hevc_cuda does not support uyvy422 and instead outputs 420 or cuda or nv12 pixel format
[02:26:14 CEST] <ringo_> and then ffmpeg cannot find a way yo do the pixel format conversion ....
[02:26:48 CEST] <ringo_> if I try this
[02:26:50 CEST] <ringo_> ./ffmpeg -re -hwaccel cuvid -c:v hevc_cuvid -i /data/public/media/HEVC4K60.ts -ac 2 -ar 48000 -f decklink 'DeckLink 8K Pro (1)'
[02:27:10 CEST] <ringo_> then, the decklink module will complain about receiving the wrong pixel format as expected
[02:27:26 CEST] <ringo_> [decklink @ 0x6f3380] Unsupported pixel format! Only AV_PIX_FMT_UYVY422 is supported.
[02:27:26 CEST] <ringo_> Could not write header for output file #0 (incorrect codec parameters ?): Input/output error
[02:28:00 CEST] <ringo_> I do not mind modifying code to fix this but need a little guidance. Should I modify the decklink module to take 420 and add a conversion to 422 inside of it?
[02:28:37 CEST] <sim590> I'm trying to change my video's framerate from 29.97 to 25. I am seeing multiple posts proposing multiple things. For instance, I have tried this https://superuser.com/a/1291513 (lossless part) but I don't get satisfying results ... My audio is just stripped at some pointin the video.
[02:49:25 CEST] <sim590> I want to keep the same length of the video, so I want to drop frames.
[03:09:50 CEST] <darkapex> haasn: welp my vlc compile broke as archlinux updated libplacebo to 1.8. should i apply your patches on my tree right now, or wait for it to get merged and downgrade my arch package?
[03:10:25 CEST] <darkapex> oops wrong channel sorry
[03:38:32 CEST] <sim590> If I want to change the framerate of some video, but keep the same time length, does that mean I am forced to reencode or I can avoid reencoding?
[03:40:12 CEST] <DHE> you must reencode in order to drop frames
[04:20:36 CEST] <sim590> DHE: Alright. Thanks.
[04:21:26 CEST] <sim590> Also, it seems like ffmpeg ignores -threads. No matter what I put (1 or 2), ffmpeg still uses 400% of CPU, so the 4 cores, hence 4 threads even though I specified -threads 2 (or 1).
[04:22:29 CEST] <sim590> May be I have to set it after some options?
[04:25:20 CEST] <another> the order of options matters
[04:25:35 CEST] <another> stuff before -i are input options
[04:25:46 CEST] <nicolas17> I thought -threads was global :o
[04:25:47 CEST] <another> stuff before an output are output options
[04:26:29 CEST] <sim590> Shouldn't this work? ffmpeg -y -i $file -threads 1 -r 25 -c:v libx264 -c:a aac -f matroska "${file%.*}_25fps.mkv
[04:27:00 CEST] <sim590> Alright. Yes. It works. I really had to put -threads after -i.
[04:28:30 CEST] <sim590> But it doesn't work if -threads cmoes after -f for instance.
[05:03:27 CEST] <sim590> I'm using my three laptops to change the framerate of my videos now. I pass them by ssh like so "ssh host 'ffmpeg -i - ...' <file.MOV >fileout.mkv". It works well. However, the resulting file doesn't seem to have its duration encoded in the file. I guess that it makes sense because ffmpeg doesn't know about it as it is processing stream. I guess I can't work around that and have my resulting file have its
[05:03:29 CEST] <sim590> duration encoded at the end, right?
[05:05:13 CEST] <nicolas17> copy whole file and then run ffmpeg on it :(
[05:35:48 CEST] <sim590> Yeah. That's what I do at the end ..
[07:56:15 CEST] <eschie> Any help with debugging this HLS encoding issue would be super grateful => https://stackoverflow.com/questions/56570754/hls-encoded-video-audio-ffmpeg-drops-when-seeking-past-buffer-on-safari
[13:18:29 CEST] <acresearch> people is ffmpeg available in flatpak or snap?
[14:29:52 CEST] <Aerroon> is it possible to burn in subtitles without reencoding the video?
[14:30:47 CEST] <TheAMM> No.
[14:31:38 CEST] <Aerroon> as in not possible with ffmpeg or not possible at all?
[14:31:43 CEST] <Aerroon> i'm guessing it's the latter
[14:32:28 CEST] <TheAMM> Burning means it's added to the video frames themselves, you have to encode to do that
[14:32:43 CEST] <Aerroon> yeah, i figured
[14:33:03 CEST] <Aerroon> but i was hoping that maybe since it's only additive there's some other possibility there
[14:34:06 CEST] <TheAMM> You can add subtitles to a video file without touching the video stream, but you're asking about modifying the video stream, so you have to modify it to modify it
[14:44:27 CEST] <ringo_> Hello
[14:45:11 CEST] <ringo_> Anyone active today? I am trying to use latest git ffmpeg with latest nvidia to decode hevc and output to decklink
[14:45:30 CEST] <ringo_> it works with software decoder but with hardware decoder it cannot perform the pixel format conversion
[14:45:56 CEST] <ringo_> it is almost as if when you use cuvid, additional pixel format conversion is not possible
[14:46:15 CEST] <ringo_> and hevc_cuvid does not support 422 which is required for decklink output
[14:51:42 CEST] <kepstin> ringo_: cuvid decodes to graphics card memory, you might have to use a 'hwdownload' filter to copy it into cpu memory so stuff like pixel format conversions can be done
[14:52:17 CEST] <kepstin> and yeah, depending on the codec and card generation, it might be limited to decoding 420 only
[14:57:56 CEST] <BtbN> cuvid/nvdec simply cannot decode anything but 420 and in some cases 444
[15:58:26 CEST] <SixEcho> trac down?
[16:04:27 CEST] <Freneticks> hey what is the purpose of -max_delay ?
[16:04:32 CEST] <Freneticks> I'm not sure to understand ?
[16:04:42 CEST] <Freneticks> "Set maximum muxing or demuxing delay in microseconds."
[16:27:54 CEST] <Freneticks> also is there a way to aac reencode in a zerolatency way ?
[16:29:00 CEST] <Freneticks> If I understand -preset veryfast and -tune zerolatency is only for x264 ?
[16:29:36 CEST] <Freneticks> since my video is -c copy
[16:38:07 CEST] <Ariyasu> -max_delay lets you add a delay to a track
[16:38:17 CEST] <Ariyasu> it's usefull for fixing out of sync issues
[16:42:07 CEST] <DHE> Is AAC even a delayed encode codec?
[18:36:20 CEST] <rmbeer> hello
[18:36:38 CEST] <rmbeer> i'm use this line for make a concatenate videos: ffmpeg -f concat -safe 0 -i /tmp/bsr3.txt video.mp4
[18:37:11 CEST] <rmbeer> but have a problem that also search videos in /tmp/ directory, how to maintain the directory for videos in the ./ ?
[18:41:33 CEST] <rmbeer> https://paste.rs/W9L.mp4
[18:41:45 CEST] <rmbeer> wrong channel, sorry...
[18:44:53 CEST] <kepstin> DHE: it has overlapped frames and requires preroll, so there's gonna be some delay
[18:48:37 CEST] <kepstin> pretty much every lossy audio coded uses overlapping frames so none of them are true "zero latency", but some of them can be configured with low delay, opus down to 5ms minimum iirc?
[18:50:46 CEST] <kepstin> and really, i don't think you can call it 0 delay unless the encoder outputs one frame for each 1 sample input ;) just collecting multiple samples into a frame introduces delay.
[20:54:29 CEST] <ringo_> kepstin, what is the correct syntax for the download filter (I am assuming I need to use scale_npp) ... and where to do I place it (right before the -pix_fmt to 422)?
[20:55:09 CEST] <kepstin> ringo_: I gave you the literal name of the filter to use
[20:56:29 CEST] <kepstin> hmm, that said, I thought ffmpeg would automatically insert it in some cases. Can you please pastebin the command you're currently running and the full output?
[20:57:08 CEST] <ringo_> full output with debug?
[20:57:40 CEST] <kepstin> "-v verbose" might be useful, since that prints some info about what the filter chain setup is doing
[21:12:42 CEST] <ringo_> here it is
[21:12:42 CEST] <ringo_> https://pastebin.com/ss9ZVqep
[21:14:01 CEST] <kepstin> ringo_: huh. I guess it should be sufficient for you to just add `-vf hwdownload` to that command to make it work
[21:14:21 CEST] <kepstin> then the auto-inserted scale filter will be put after hwdownload
[21:15:39 CEST] <ringo_> I added it to the wrong place maybe?
[21:15:39 CEST] <ringo_> https://pastebin.com/741xyR4t
[21:15:44 CEST] <ringo_> new error is
[21:15:55 CEST] <ringo_> [hwdownload @ 0x112d880] Invalid output format uyvy422 for hwframe download.
[21:16:10 CEST] <kepstin> ah, you'll probably need `-vf hwdownload,scale` then
[21:16:32 CEST] <kepstin> or maybe `-vf hwdownload,format=nv12`
[21:17:25 CEST] <ringo_> the scale one does not work .... [hwdownload @ 0x112d880] Invalid output format monow for hwframe download.
[21:18:12 CEST] <ringo_> format=nv12 works!!!
[21:19:09 CEST] <ringo_> but it behaces the same as no hardware decoder :( .... one cpu maxes out and I get dropped frames
[21:19:10 CEST] <ringo_>     Last message repeated 9 times
[21:19:10 CEST] <ringo_> [decklink @ 0x6f33c0] There are not enough buffered video frames. Video may misbehave!
[21:19:10 CEST] <ringo_> [decklink @ 0x6f33c0] There's no buffered audio. Audio will misbehave!
[21:19:11 CEST] <ringo_> [decklink @ 0x6f33c0] There are not enough buffered video frames. Video may misbehave!
[21:19:13 CEST] <ringo_> [decklink @ 0x6f33c0] There's no buffered audio. Audio will misbehave!
[21:23:07 CEST] <ringo_> here is the full log
[21:23:07 CEST] <ringo_> https://pastebin.com/ekCvMBZW
[21:25:22 CEST] <ringo_> the cpu is already a Intel(R) Core(TM) i7-7820X CPU @ 3.60GHz
[21:25:37 CEST] <ringo_> not sure anything faster would help in this case
[21:48:44 CEST] <ringo_> so, the bottleneck is either in the hwdownload or the conversion from nv12 to yuv422 ... is there anything I can do to "fix" this ... or is this a software/hardware limitation?
[21:49:25 CEST] <ringo_> a multithreaded conversion would help ... I think the pixel format conversion is single threaded and in this case the frames are very large, i.e. 4k60
[22:07:39 CEST] <kepstin> ringo_: hmm. it might actually be possible to get the gpu to do the pixel format using the scale_npp filter. could be worth a try.
[22:10:29 CEST] <kepstin> although it appears to only support yuv420p, nv12, and yuv444p, so taht doesn't help if you need 4:2:2
[22:22:39 CEST] <ringo_> kepstin, yes, I looked into scale_npp and it does not support 422
[22:23:44 CEST] <ringo_> why does this appear to work but gives me a double image?
[22:23:45 CEST] <ringo_> ./ffmpeg -re -hwaccel nvdec -hwaccel_output_format uyvy422
[22:24:01 CEST] <ringo_> and system appears to keep up
[22:25:13 CEST] <ringo_> but output image on SDI is double (side by side) and with incorrect colors
[22:45:26 CEST] <th3_v0ice> What change in frame properties require filter reinitialization? Using the API. Width, height, pixel format, what else?
[22:55:48 CEST] <kepstin> it really depends on the filter.
[22:56:02 CEST] <kepstin> like the fps filter, for example, doesn't care about any of those fields.
[22:56:37 CEST] <kepstin> where as some other filter might just save the inital values for something and segfault horribly if they change :/
[22:57:44 CEST] <kepstin> in general, for filters that manipulate video data in frames i'd go with that, and also the color range/primaries/trc
[23:40:56 CEST] <MoziM> can ffmpeg extract the raw frames of a video without duplicates or interlaced frames?
[23:42:27 CEST] <kepstin> MoziM: you get a big ol' "it depends on your requirements and your input video, but probably"
[23:45:22 CEST] <kepstin> MoziM: duplicate frames can be detected and removed by filters. interlaced frames, if correctly marked as such, can be dropped using e.g. the select filter. If the frames are unmarked, you can consider using the idet filter to look for frames with combing artifacts, but it'll require some tuning.
[23:46:28 CEST] <kepstin> are you trying to clean up a poorly detelecined video?
[23:47:24 CEST] <th3_v0ice> kepstin, thanks
[23:49:39 CEST] <MoziM> kepstin: i don't know what that would even look like :o
[23:49:53 CEST] <MoziM> kepstin: lots horizontal lines?
[23:50:15 CEST] <MoziM> kepstin: also, i'm just curious how videos in general work really
[23:51:50 CEST] <kepstin> the typical computer representation of interlaced video combines two "fields" (half-frames) from different times into a single frame. the fields are alternating lines
[23:52:10 CEST] <furq> if you're asking if dupe frames or interlaced frames are stored differently then it depends but usually no
[23:52:11 CEST] <kepstin> so if you look at it without using a deinterlacing filter, you'll see horizontal stripes of two slightly different images
[23:52:33 CEST] <kepstin> this effect is called "combing"
[23:52:41 CEST] <BtbN> Technically, they are deinterlaced. Using the weave filter.
[23:53:03 CEST] <BtbN> Without deinterlacing, they are two seperate fields.
[23:53:35 CEST] <BtbN> But the default way for ffmpeg to transport them is two fields weaved into one frame.
[23:55:15 CEST] <kepstin> when interlaced video is being transmitted as video (e.g. analog or SDI), rather than in computer memory, it'll send fields separately rather than combined into a single frame, yeah.
[23:56:03 CEST] <kepstin> there's a lot of weird stuff we have to deal with in computer video that's just leftovers from old analog transmission systems :/
[23:56:36 CEST] <BtbN> Which for some reason someome thought would be a good idea to keep using for 1080p video in purely digital transmission
[23:57:01 CEST] <kepstin> and a lot of the time, people get it wrong... https://www.kepstin.ca/dump/Screenshot%20from%202017-07-19%2023-36-08.png
[23:57:05 CEST] <furq> interlaced frames are normally encoded by frame though right
[23:57:15 CEST] <furq> like the macroblocks will span two fields
[23:57:18 CEST] <kepstin> depends on the codec and encoder
[23:57:18 CEST] <BtbN> h264 can do both
[23:57:25 CEST] <furq> i know h264 has that PAFF mode but i don't think anything supports it
[23:57:30 CEST] <furq> x264 apparently doesn't
[23:57:40 CEST] <BtbN> nvenc _only_ supports PAFF
[23:57:44 CEST] <furq> oh really
[23:57:52 CEST] <BtbN> Which is why ffmpeg can't encode interlaced content with it
[23:57:57 CEST] <kepstin> i think they added an interlaced mode to hevc that encodes fields as separate half-height frames or something?
[23:58:08 CEST] <JEEB> kepstin: that mode already was in AVC
[23:58:08 CEST] <BtbN> There is no way for ffmpeg to feed separate fields into an encoder
[23:58:10 CEST] <BtbN> which nvenc wants
[23:58:31 CEST] <JEEB> it just no longer has super special encoding modes like PAFF
[23:58:46 CEST] <JEEB> if you just flag your picture as top/bottom field and interlaced
[23:58:58 CEST] <JEEB> that should let you code field pictures in both AVC and HEVC
[23:59:28 CEST] <kepstin> JEEB: ah, so it's all just metadata, not a different encoding mode?
[00:00:00 CEST] <JEEB> yes, field pictures vs frame pictures
[00:00:00 CEST] --- Fri Jun 14 2019


More information about the Ffmpeg-devel-irc mailing list