View Full Version : decode at realtime?
excellentswordfight
27th September 2022, 19:18
Hi,
This is surly the wrong section for this, but I wasnt sure were to post this as its more of a ffmpeg question. But as I'm going to to use HEVC endcoders i might as well try to post it here. Please feel free to move it if there is a more appropriate section for it.
I wanna do some tests with real time encoding for HEVC-encoders, I usually use ffmpeg and pipe the decoded video to the encoder. Is it possible to limit the decode speed to the source framerate of the video file with ffmpeg? And that way limit the encoding speed to real time. I know its possible when doing different types of capture with ffmpeg, but it should be possible with file input as well, right?
VoodooFX
27th September 2022, 19:37
I don't understand why you need to limit decoding, then you are limiting encoding too.
excellentswordfight
27th September 2022, 20:46
I don't understand why you need to limit decoding, then you are limiting encoding too.
Yes and thats the kind of the point, i wanna lock the encoding speed at realtime to research performance metrics.
VoodooFX
27th September 2022, 21:26
I'd use fastest decoding possible [something like MagicYUV] and let encoding to run full speed.
Faster encoding in full speed = better performance in "realtime".
excellentswordfight
27th September 2022, 21:45
I'd use fastest decoding possible [something like MagicYUV] and let encoding to run full speed.
Faster encoding in full speed = better performance in "realtime".
Performance metrics here would be power consumption, system resources etc to, for example encode an 1080p60 stream in realtime.
rwill
27th September 2022, 22:25
Hi,
I wanna do some tests with real time encoding for HEVC-encoders, I usually use ffmpeg and pipe the decoded video to the encoder. Is it possible to limit the decode speed to the source framerate of the video file with ffmpeg? And that way limit the encoding speed to real time. I know its possible when doing different types of capture with ffmpeg, but it should be possible with file input as well, right?
Well you either use source or sink as a clock.
As input is a file I would not use that as a clock, I would limit the speed by blocking the encoder output and not accept further data from the encoder until a certain time has passed.
FranceBB
2nd October 2022, 01:19
Well, it's gonna be easy to limit it to real time: you just need a live feed.
For instance, if you have a capture card like a BlackMagic Decklink, you can use that input and re-encode that, otherwise if you don't have anything like that, you can always grab the video from the webcam (assuming you have one) and encode that.
It's all easily doable with FFMpeg, so you can easily grab the input and pipe it to x265.
If you don't have anything like that, you can still grab the desktop and encode the desktop...
excellentswordfight
2nd October 2022, 09:40
Well, it's gonna be easy to limit it to real time: you just need a live feed.
For instance, if you have a capture card like a BlackMagic Decklink, you can use that input and re-encode that, otherwise if you don't have anything like that, you can always grab the video from the webcam (assuming you have one) and encode that.
It's all easily doable with FFMpeg, so you can easily grab the input and pipe it to x265.
If you don't have anything like that, you can still grab the desktop and encode the desktop...
Yes, I was thinking about that option as well as I have access to a lot of decklink products. But I was thinking that it would made the test-setup a lot easier if I can use file-based media as a input and just loop that to simulate a similar scenario. I was hoping that it was something that would be rather easy to achieve and that it was just a setting that I wasn't finding.
rwill
2nd October 2022, 12:29
Are you planning to do this within ffmpeg, with audio or some other high level stuff after or around the h.265 encoder or can you pipe the bitstream from the h.265 encoder to somewhere ?
So my question is, is it something simple like this:
ffmpeg.exe <args> | x265.exe <args> -o out.265
Or is it something like this:
handbrake.exe
*edit*
Reading the initial post again reminds me to go and have my long term memory looked at.
rwill
2nd October 2022, 18:08
I got interested into power consumption and CPU load @ realtime as well due to this post. So I threw together this:
https://github.com/rwillenbacher/piclimiter
kolak
2nd October 2022, 20:04
Simple:
ffmpeg -re -i source ...
does realtime decoding.
rwill
2nd October 2022, 20:22
ok, kolak wins.
excellentswordfight
2nd October 2022, 20:40
Simple:
does realtime decoding.
Well I feel stupid now, that was the first thing i tried, and when I piped it to QSVEncC64 I saw that it started at 200fps and I canceled it and moved on... I can see now that it goes down to around 60 rather fast so it does indeed seem to be working! Thank you!
ok, kolak wins.
I'm still gonna give you a huge A for effort :)
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.