Adding encode duration to file naming

General questions or discussion about HandBrake, Video and/or audio transcoding, trends etc.
Post Reply
encodie
Posts: 4
Joined: Sat Feb 18, 2023 5:17 am

Adding encode duration to file naming

Post by encodie »

Description of problem or question:
Is it possible to add the duration of the encode to the automatic file naming?
there is - {creation-date} {creation-time} {date} {time}.
I feel like {encode-duration}, especially for 10-60 second test videos would be more helpful than the one's above...

something like...
TestVideo (1h 14m 37s).mp4

and hopefully one day...
{video-encoder} {framerate} {encoder-preset}{encoder-tune}{encoder-profile}{encoder-level} {filters} {resolution} & others for Audio & Subtitles.



Steps to reproduce the problem (If Applicable):




HandBrake version (e.g., 1.0.0):
1.6.1 (2023012300)



Operating system and version (e.g., Ubuntu 16.04 LTS, macOS 10.13 High Sierra, Windows 10 Creators Update):
Windows 10 Pro 22H2



HandBrake Activity Log ***required*** (see How-to get an activity log)

Code: Select all

Please replace this text with the contents of your log file between the two code tags - OR -  provide a pastebin URL in place of these 3 lines.
If you are unable to do so, please state why so we can help you.
Woodstock
Veteran User
Posts: 4614
Joined: Tue Aug 27, 2013 6:39 am

Re: Adding encode duration to file naming

Post by Woodstock »

Do you have an accurate way of determining the length before the encode is complete, without someone typing it in?

Reading a part of a video does not definitively determine the length of it in time. The file name is set when the job is created, not when it's done, so setting the name before that is not "perfect". Especially when there are variable frames within the video.
Deleted User 11865

Re: Adding encode duration to file naming

Post by Deleted User 11865 »

Do you mean the source file's duration?
encodie
Posts: 4
Joined: Sat Feb 18, 2023 5:17 am

Re: Adding encode duration to file naming

Post by encodie »

The encode duration (how long it took to complete the job).

I did another test just for this and in the preferences added {source}-Q{quality_bitrate}-{creation-date}-{creation-time}-{date}-{time}
normally it's {source}-Q{quality_bitrate}

AV1Test-Q30_23-02-2023_15-00_23-02-2023_15-39 - AV1-1 (so much useless date & time info added to filename - when it can be viewed in file explorer...)

AV1Test-Q30 (4m7s) <this is what I want as you can see in the statistics tab in the queue, one of the videos took 4 minutes & 7 seconds to complete, {quality_bitrate} adds "30" to the file name, I'm hoping for something like {encode_duration} that could add "00:04:07" or "04m07s"

Image[/img]

Image[/img]

Image[/img]
encodie
Posts: 4
Joined: Sat Feb 18, 2023 5:17 am

Re: Adding encode duration to file naming

Post by encodie »

Deleted User 11865

Re: Adding encode duration to file naming

Post by Deleted User 11865 »

encodie wrote: Thu Feb 23, 2023 5:41 am https://i.postimg.cc/Jnd9DLgv/queue.jpg
That's only known at the end of the encode, and the file name is set when the encode starts. So it would need to be renamed at the end, which makes implementing the feature more complex than a simple change to auto-naming.
encodie
Posts: 4
Joined: Sat Feb 18, 2023 5:17 am

Re: Adding encode duration to file naming

Post by encodie »

OK, makes sense.
Although, today I realised that the log could include the encode duration at the end...
the logs (I have a copy saved to destination) have "_encode_02.27.2023 20-59-38" placed at the end...

It could look something like "_encode_02.27.2023 20-59-38_[23m47s]"
Deleted User 11865

Re: Adding encode duration to file naming

Post by Deleted User 11865 »

The log file name is also created at the start of the encode.

The contents of the log do feature a duration, albeit in seconds only:

Code: Select all

encoded 63126 frames in 21295.51s (2.96 fps), 5313.74 kb/s, Avg QP:22.46
Post Reply