Jump to content

One small step for ffmpeg... one giant leap for Emby! (Looking for C developer(s) to help with transcode throttling)


jluce50

Recommended Posts

jluce50

look for the 'q' key in the documentation and put it there. if you can't find that, ask him. good sign though :)

 

And now he's getting snarky...

 

somewhere hmm, in the ffmpeg docs, doc/ffmpeg.texi seems the obvious option

 

Well no sh*t, Sherlock! :rolleyes: Seems like it'd be easier to give just a little direction than potentially have to go back and forth because he doesn't like what I submit.

Link to comment
Share on other sites

dark_slayer

Finally got some attention. Looks like some line breaks got introduced somehow (Gmail?). I'll just save it to a diff file and attach that next time.

 

He also wants me to update the documentation, but I don't see the keyboard interaction documented anywhere but in the source code. Looking at the doc for the main ffmpeg tool, I don't see an appropriate place for this info (maybe under "Tips"?). Any suggestions?

 

 

I  would think they belong here https://www.ffmpeg.org/ffmpeg.html#Advanced-Video-options along with some of the other options in that section like n and t

Link to comment
Share on other sites

jluce50

I was thinking of adding a section between Tips and Examples called "Keyboard Interaction". I thought about putting it under Advanced Video options, but it's not specific to video. And since they're not command line params, like everything else, I think they're deserving of their own section.

Link to comment
Share on other sites

dark_slayer

I thought it was only applied during a transcode making it video specific

 

That stuff is really a combination of "mostly" for devs and "sometimes" for a few casual users, so whatever makes most sense for you guys is best

Link to comment
Share on other sites

FredipusRex

People have been whinging about ffmpeg not having documentation on their keyboard interaction since 2006 (http://ffmpeg.org/pipermail/ffmpeg-devel/2006-August/008232.html), so it's a little rich for that kind of snark. Still, it would be useful, especially as it's supposed to be a nice new feature we want adopted.

 

If you look at the documentation for ffplay (https://www.ffmpeg.org/ffplay.html), they put their keyboard interactions under Options (3.6 While playing). I'd suggest creating "5.13 While transcoding" under the ffmpeg doc (aka doc/ffmpeg.lexi). Might as well dump all the existing keystrokes in the section - might make them happier to add it.

Link to comment
Share on other sites

jluce50

You don't say... ;-)

 

I like the "While Transcoding" idea. I've already got all the existing keystrokes in ffmpeg.texi, but I'll check out ffplay and use that as a template for the formatting. I've got a busy weekend, so it might be a day or two until I can get this submitted...

Link to comment
Share on other sites

jluce50

I got everything fixed and submitted and this was the response:

 

it seems any key unpauses transcoding

also theres no vissual feedback that ffmpeg is paused or how the user can unpause it
this is bad in case the user pressed p by mistake

also the c and C keys already effectivly pause ffmpeg p should not be implemented entirely differently than how they work. If c/C have problems these problems should be fixed

 

 

So it sounds like he's not a fan of this change. I suppose it's worth playing with the 'c' command and seeing if that will work with what we need...

Link to comment
Share on other sites

I got everything fixed and submitted and this was the response:

 

 

 

So it sounds like he's not a fan of this change. I suppose it's worth playing with the 'c' command and seeing if that will work with what we need...

 

interesting. can you try that out?

Link to comment
Share on other sites

Ok, i tried lowercase c. i think there is something else needed

frame= 1014 fps= 48 q=22.0 size=   32068kB time=00:00:42.58 bitrate=6169.3kbits/s    

Enter command: <target>|all <time>|-1 <command>[ <argument>]
Parse error, at least 3 arguments were expected, only -1 given in string ''
frame= 1038 fps= 48 q=22.0 size=   32068kB time=00:00:43.60 bitrate=6024.5kbits/s    
Link to comment
Share on other sites

techywarrior

Wouldn't that be sort of funny (and also sort of not) if the functionality already existed in ffmpeg. ROFL

Link to comment
Share on other sites

jluce50

Wouldn't that be sort of funny (and also sort of not) if the functionality already existed in ffmpeg. ROFL

 

I am really trying not to think about that... :angry::wacko:

Link to comment
Share on other sites

so it's a general command key. so we're going to have to learn that

    if (key == '?'){
        fprintf(stderr, "key    function\n"
                        "?      show this help\n"
                        "+      increase verbosity\n"
                        "-      decrease verbosity\n"
                        "c      Send command to first matching filter supporting it\n"
                        "C      Send/Que command to all matching filters\n"
                        "D      cycle through available debug modes\n"
                        "h      dump packets/hex press to cycle through the 3 states\n"
                        "q      quit\n"
                        "s      Show QP histogram\n"
        );
    }

Link to comment
Share on other sites

jluce50

 

Ok, i tried lowercase c. i think there is something else needed

frame= 1014 fps= 48 q=22.0 size=   32068kB time=00:00:42.58 bitrate=6169.3kbits/s    

Enter command: <target>|all <time>|-1 <command>[ <argument>]
Parse error, at least 3 arguments were expected, only -1 given in string ''
frame= 1038 fps= 48 q=22.0 size=   32068kB time=00:00:43.60 bitrate=6024.5kbits/s    

 

Yeah, I just tried it too. I suppose it could work by sending 'c' to pause and then 'Enter' to unpause. We'd need to add some sort of exception case for handling that particular error message. I'm not sure how MBS handles ffmpeg errors now, but is that not feasible?

Link to comment
Share on other sites

considering nothing can be found in docs or gooogle, can you ask him for an example?

Link to comment
Share on other sites

jluce50

Can we not just "eat" the output in that case? Getting the "Enter command" prompt is all we really want since that's when ffmpeg is effectlive "paused". Why do we need to send a command?

Link to comment
Share on other sites

i don't think you understand. it's not pausing at all with c because need to pass more than just c as it is a general command key.

Link to comment
Share on other sites

jluce50

Perhaps I'm not understanding, but it looks to me like it is pausing while waiting for the command.

frame= 529 fps=211 q=9.8 size= 1828kB time=00:00:22.57 bitrate= 663.4kbits/s dup=1 drop=0
Enter command: <target>|all <time>|-1 <command>[ <argument>]       <==== I let it sit here for a few minutes and when resumed it had only advanced by 46 frames
Parse error, at least 3 arguments were expected, only -1 given in string ''
frame= 575 fps= 15 q=18.9 size= 2006kB time=00:00:24.49 bitrate= 67

If I hit 'c' and let it sit at "Enter command" for 5 seconds or 5 minutes, the next line has only advanced one step's worth of frames (which is what I saw with our 'p' pause method). That tells me that it was paused while waiting for the command. What am I missing here?

Edited by jluce50
Link to comment
Share on other sites

Perhaps I'm not understanding, but it looks to me like it is pausing while waiting for the command.

frame= 529 fps=211 q=9.8 size= 1828kB time=00:00:22.57 bitrate= 663.4kbits/s dup=1 drop=0
Enter command: <target>|all <time>|-1 <command>[ <argument>]       <==== I let it sit here for a few minutes and when resumed it had only advanced by 46 frames
Parse error, at least 3 arguments were expected, only -1 given in string ''
frame= 575 fps= 15 q=18.9 size= 2006kB time=00:00:24.49 bitrate= 67

If I hit 'c' and let it sit at "Enter command" for 5 seconds or 5 minutes, the next line has only advanced one step's worth of frames (which is what I saw with our 'p' pause method). That tells me that it was paused while waiting for the command. What am I missing here?

 

you hit c all by itself, or c + enter?

Link to comment
Share on other sites

jluce50

frame= 529 fps=211 q=9.8 size= 1828kB time=00:00:22.57 bitrate= 663.4kbits/s dup=1 drop=0

 

>> hit 'c'

 

Enter command: <target>|all <time>|-1 <command>[ <argument>]

 

>> wait (paused)

 

>> hit 'Enter'

 

Parse error, at least 3 arguments were expected, only -1 given in string ''
frame= 575 fps= 15 q=18.9 size= 2006kB time=00:00:24.49 bitrate= 67

Link to comment
Share on other sites

Ok, great stuff, it's working :)

 

cpu doesn't drop quite as much as the process suspension method, but it's still a nice win.

Link to comment
Share on other sites

MSattler

Ok, great stuff, it's working :)

 

cpu doesn't drop quite as much as the process suspension method, but it's still a nice win.

 

When this is finally added, should we have an option to enable or disable it?  This way we can add the capability, and allow people to test, and see what the response is without having to uninstall/reinstall for testing purposes?

Link to comment
Share on other sites

Vidman

That is exactly why there are dev ,beta, and stable update options, people that want to test these features can use the dev or betas and those that just want something that works can stay on stable releases. But an option to choose to throttle or not would be good

Edited by Vidman
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...