#Credits fast-forwarding

1 messages · Page 1 of 1 (latest)

neon storm
#

You know how when movies are shown on TV, the credits are usually played super fast so they finish in around 20 seconds?
You know how with Plex Pass, Plex will automatically detect where the credits are in each video?

I frankly have no idea how feasible this suggestion is, and it sounds pretty difficult even if it is possible - but yeah. Is it feasible to have an option in Tunarr to tell it to play credits at super-speed, so they take at most a set maximum amount of time to complete? Something like an option for a channel to "Compress credits to 30s"?

hard merlin
#

for Plex at least, the markers for detected intro/credits are included in the API, so the info is there (along with chapter markers). i think the bigger piece of work here is integrating that info into Tunarr; first cut would probably just be utilizing that info at stream time, instead of persisting it to the DB, but I'm not sure how feasible that is, since we'd need the "true" duration (i.e. minus intro/outro) when constructing the guide

neon storm
#

Given that Plex does share the info, it seems theoretically doable - like if the video is 2:18:14 long, with credits starting at 2:08:27, then couldn't Tunarr aim to have the video run in exactly 2:08:57, by running the last 9m47s at 19.566x speed?

hard merlin
#

of course, there's just all of the actual backing implementation of how to do it

#

so definitely possible in theory; actually integrating this all into the system is another thing altogether

#

on the streaming side i think it would be even simpler than that

neon storm
#

With how to present it to the user? Or moreso backend stuff?

hard merlin
#

backend

#

but maybe it isn't as complex as my initial thought. i'm thinking moreso about the guide building end of things, since we're messing with durations. i think actually changing the duration of the video based on start/end time offsets would be simpler than solvingn it at stream time

neon storm
#

Granted I have no clue how Tunarr works, but yeah - I was thinking the duration could be calculated at the time the guide schedule is created, based on the user's settings here - so (duration of video up to start of credits) + (chosen duration for credits to last)

#

To be clear, I wasn't thinking of it as a dynamic thing where like, a button appears at the start of credits asking if you'd like to skip them, like happens when watching Plex properly

#

Moreso a channel setting that makes the credits run at super speed without user interaction while watching

#

I think we were on the same page there?

hard merlin
#

Yea definitely. I don’t think it would be technically feasible to expose a skip option without also being in control of the client / player code.

Not sure exactly how a super speed thing would work, I was thinking more like, the show would just end at the credits marker that plex gives us

neon storm
#

Tunarr uses ffmpeg to create the stream, right? I don't know the exact specifics of how ffmpeg is utilized, so this example might not be as useful as I'm hoping, but it does have the ability to speed up videos by arbitrary amounts - for example, the times I gave in my earlier message from 35 minutes past the hour were actually from Harry Potter and the Order of the Phoenix. This ffmpeg command:

ffmpeg -ss 7707 -i "Harry Potter and the Order of the Phoenix (2007) [Bluray-1080p].mkv" -filter_complex \
"[0:v]setpts=PTS/19.566[v]; [0:a]atempo=19.566[a]" \
-map "[v]" -map "[a]" credits.mkv

does create a video starting when the credits do at 7707 seconds in, which contains the full credit sequence, sped up by a factor of 19.566, lasting for 30 seconds

#

It also speeds up the audio by 19.566 times, though I'm honestly unsure if that's the best way to handle things since that will probably never not sound silly. It sounds... okay

#

Here's a page which goes over a couple different methods for achieving the effect

hard merlin
#

Yea the speeding up portion is sorta simple, but I was hoping to not have to introduce a transition (spinning up a whole new ffmpeg invocation) just for this. There are probably ways to do this with a single command; it would most likely involve two input files both pointing to the same video, where the first is played out at normal speed and the second starts at credits and plays out fast… there are other considerations there so maybe a whole new ffmpeg invocation would be simpler, but there’s some cost to that at well. Is there a reason to have sped up credits rather than just omitting them entirely?

neon storm
#

The sole reason is just "Because that's what they do on actual TV and I kinda like it" ¯_(ツ)_/¯

hard merlin
#

Fair enough!

neon storm
#

Though on actual TV they'd usually mute the credits audio and play an ad or start the next movie simultaneously

#

Which seems kinda implausible here

#
ffmpeg \
-i "Harry Potter and the Order of the Phoenix (2007) [Bluray-1080p].mkv" \
-i "Harry Potter and the Order of the Phoenix (2007) [Bluray-1080p].mkv" \
-filter_complex "
[0:v]trim=end=7707[v1];
[0:a]atrim=end=7707[a1];
[1:v]trim=start=7707,setpts=PTS/19.566[v2];
[1:a]atrim=start=7707,atempo=19.566[a2];
[v1][v2]concat=n=2:v=1:a=0[v];
[a1][a2]concat=n=2:v=0:a=1[a]
" -map "[v]" -map "[a]" output.mkv

Is that the kind of command you had in mind? Two inputs both pointing to the same video, making the new video file in a single go?

hard merlin
#

And yes that’s sorta what I was thinking

#

Could also just drop the audio from the credits part

#

Or even just play the audio at normal speed and have the video end early. All possible

neon storm
#

For sure - maybe have it as an option: "Speed up credits audio too (may sound funny)" vs. "Keep credits audio unchanged" vs. "Mute credits audio" vs. "Play this audio file during credits: ____", etc

neon storm
#

Movies with mid- and end-credit scenes do present another complication, though after testing, Plex does handle them gracefully: Skipping credits will resume playing if a mid-credits scene starts, and after it, it'll let you skip credits again, until an end-scene credit starts

#

In the case of Doctor Strange, my test movie for this, which has both, I suppose that would mean needing 5 video inputs all pointing to the same file?

#

That also complicates how much to speed things up by though. If it were me I might add up the total length of both chunks of credits and figure out the speed factor needed to make them a cumulative 30 seconds (or whatever), then apply that speed factor to both chunks?

#

I wonder if there are any weird edge-cases that could turn out poorly, like movies with credits in the middle or at the start (either actually, or erroneously detected by Plex)?

hard merlin
#

yea it looks like the Plex API denotes the last credits sequence with final=1, so we could utilize that. not sure how to handle speeding up with that though... not sure we'd wanna spin up a command with 5 inputs. two already feels like a hack lol. i'll think on it

#

the simplest answer is to only speed up final=1 credits