Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Video Encoding > High Efficiency Video Coding (HEVC)

Reply
 
Thread Tools Search this Thread Display Modes
Old 27th September 2022, 19:18   #1  |  Link
excellentswordfight
Lost my old account :(
 
Join Date: Jul 2017
Posts: 322
decode at realtime?

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?

Last edited by excellentswordfight; 27th September 2022 at 19:25.
excellentswordfight is offline   Reply With Quote
Old 27th September 2022, 19:37   #2  |  Link
VoodooFX
Banana User
 
VoodooFX's Avatar
 
Join Date: Sep 2008
Posts: 985
I don't understand why you need to limit decoding, then you are limiting encoding too.
VoodooFX is offline   Reply With Quote
Old 27th September 2022, 20:46   #3  |  Link
excellentswordfight
Lost my old account :(
 
Join Date: Jul 2017
Posts: 322
Quote:
Originally Posted by VoodooFX View Post
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.
excellentswordfight is offline   Reply With Quote
Old 27th September 2022, 21:26   #4  |  Link
VoodooFX
Banana User
 
VoodooFX's Avatar
 
Join Date: Sep 2008
Posts: 985
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".
VoodooFX is offline   Reply With Quote
Old 27th September 2022, 21:45   #5  |  Link
excellentswordfight
Lost my old account :(
 
Join Date: Jul 2017
Posts: 322
Quote:
Originally Posted by VoodooFX View Post
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.
excellentswordfight is offline   Reply With Quote
Old 27th September 2022, 22:25   #6  |  Link
rwill
Registered User
 
Join Date: Dec 2013
Posts: 343
Quote:
Originally Posted by excellentswordfight View Post
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.
rwill is offline   Reply With Quote
Old 2nd October 2022, 01:19   #7  |  Link
FranceBB
Broadcast Encoder
 
FranceBB's Avatar
 
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 2,883
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...
FranceBB is offline   Reply With Quote
Old 2nd October 2022, 09:40   #8  |  Link
excellentswordfight
Lost my old account :(
 
Join Date: Jul 2017
Posts: 322
Quote:
Originally Posted by FranceBB View Post
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.

Last edited by excellentswordfight; 2nd October 2022 at 09:43.
excellentswordfight is offline   Reply With Quote
Old 2nd October 2022, 12:29   #9  |  Link
rwill
Registered User
 
Join Date: Dec 2013
Posts: 343
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.

Last edited by rwill; 2nd October 2022 at 18:10.
rwill is offline   Reply With Quote
Old 2nd October 2022, 18:08   #10  |  Link
rwill
Registered User
 
Join Date: Dec 2013
Posts: 343
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
rwill is offline   Reply With Quote
Old 2nd October 2022, 20:04   #11  |  Link
kolak
Registered User
 
Join Date: Nov 2004
Location: Poland
Posts: 2,843
Simple:
Quote:
ffmpeg -re -i source ...
does realtime decoding.
kolak is offline   Reply With Quote
Old 2nd October 2022, 20:22   #12  |  Link
rwill
Registered User
 
Join Date: Dec 2013
Posts: 343
ok, kolak wins.
rwill is offline   Reply With Quote
Old 2nd October 2022, 20:40   #13  |  Link
excellentswordfight
Lost my old account :(
 
Join Date: Jul 2017
Posts: 322
Quote:
Originally Posted by kolak View Post
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!

Quote:
Originally Posted by rwill View Post
ok, kolak wins.
I'm still gonna give you a huge A for effort
excellentswordfight is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 18:59.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.