"vidxtractor" utility to save portion of mp4, mov, avi or flv video.

Moderator: Forum moderators

User avatar
greengeek
Posts: 1354
Joined: Thu Jul 16, 2020 11:06 pm
Has thanked: 495 times
Been thanked: 184 times

"vidxtractor" utility to save portion of mp4, mov, avi or flv video.

Post by greengeek »

Under development.
Further refinement to follow.

Prerequisite - Requires ffmpeg.
_________________________

Do you have a video from dashcam or similar?
Want to save a portion of that video?
This utility helps to extract a segment of an .mp4, .mov, .avi or .flv video - just provide "start seconds" and "duration seconds" values and let ffmpeg do the rest.

Definitely not the equal of top end editors that work frame by frame - but quite quick and handy for basic usage.
(You may have to experiment a little with start/duration parameters - due to different videos having different timing/placement of reference frames - but in general it works well for me..)

Comes in 3 formats:
(Only need to choose the format that suits your usage)

1) pet version (gtkdialog gui installable via .pet):
(Look in multimedia menu to run)

vidxtractor_gg-0.2.pet
(1.4 KiB) Downloaded 21 times

(This is v2 and allows spaces in filenames and runs on more gtkdialog versions - thanks @vektor_alian )
.
____________________________________________________________________
2) Clickable script version (gtkdialog gui direct from script):
(Make executable and place wherever you wish to run it from)
(Then just click the script to run)

vidxtractor.false.gz
Remove .false.gz suffix, make excutable, and click to run.
(1.99 KiB) Downloaded 22 times

(This is v2 and allows spaces in filenames and runs on more gtkdialog versions - thanks @vektor_alian )
.
____________________________________________________________________
3) Non-gui script for cli usage :

NOTE : I have deleted my original cli version as it was poorly coded. Please see MochiMoppel's update here regarding the non-gui script version. He has provided a much better script for cli users.

(This cli functionality was requested in a previous thread by @Clarity. Thanks Clarity for that idea)

The new version of the cli non-gui script is available here:
viewtopic.php?p=127477#p127477

Last edited by greengeek on Tue Jul 30, 2024 8:11 am, edited 13 times in total.
User avatar
mikewalsh
Moderator
Posts: 6024
Joined: Tue Dec 03, 2019 1:40 pm
Location: King's Lynn, UK
Has thanked: 733 times
Been thanked: 1896 times

Re: "vidxtractor" utility to save portion of mp4, mov, avi or flv video.

Post by mikewalsh »

@greengeek :-

Neat idea, Ian, but.......for me, at least (can't speak for anyone else), it doesn't actually output a "trimmed" file.

Am I getting the input correct? What format is the utility expecting the start-time & duration to be entered as?

I tried to cut a short section out of a 'test video' I use. I entered the start-time as

Code: Select all

1:52

.....and the duration as just

Code: Select all

28

Is that the correct format? I realise ffmepg is a finicky beast at the best of times; this is WHY I'm asking... :lol:

(I'm using the GUI script here).

~~~~~~~~~~~~~~~~~~~~~~~~~~~~

I'd suggest adding a check to see if the output file has in fact been created BEFORE popping-up the 'Success' message..? It also might not be a bad idea to add a small 'Help' file with just some basic instructions; gxmessage will handle that, too. (Ffmpeg is a mystery to 99% of folks, so some explanation of how to use it in your app can't hurt).

I learnt some years ago that you shouldn't publish stuff without trying it with at least a handful of different Pups. It doesn't pay to assume that because something works for you, it will work for others. I've ended up with egg on my face on several occasions due to being "over-enthusiastic"..! :oops: :D.

I realise it's 'early days', so these are simply suggestions to help create a more 'complete' package, that's all. No compulsion to have to take ANY notice if ya don't want! :D

I'd LIKE to see this working - 100% fool-proof - for everyone. It's a neat, basic, functional utility, especially for anyone who works with any amount of media.....which I do myself.

Mike. ;)

Semme
Posts: 40
Joined: Wed Jul 22, 2020 12:44 am
Location: Ground Zero
Has thanked: 1 time
Been thanked: 6 times

Re: "vidxtractor" utility to save portion of mp4, mov, avi or flv video.

Post by Semme »

That would be start time in ;) *seconds," Mike. 1:52 becomes 112.

~ Few things move as quietly as the future ~

vektor_alian
Posts: 48
Joined: Thu Apr 01, 2021 12:36 am
Been thanked: 12 times

Re: "vidxtractor" utility to save portion of mp4, mov, avi or flv video.

Post by vektor_alian »

Hi greengeek.

The cli version works great. I needed to remove the spaces from the name first.

Thanks

Vektor

vektor_alian
Posts: 48
Joined: Thu Apr 01, 2021 12:36 am
Been thanked: 12 times

Re: "vidxtractor" utility to save portion of mp4, mov, avi or flv video.

Post by vektor_alian »

I just tried the script. Needed to remove the "3" from line 84 gtkdialog3 to match my version.

Works great on my Porteux OS.

Thanks again

Vektor

User avatar
greengeek
Posts: 1354
Joined: Thu Jul 16, 2020 11:06 pm
Has thanked: 495 times
Been thanked: 184 times

Re: "vidxtractor" utility to save portion of mp4, mov, avi or flv video.

Post by greengeek »

mikewalsh wrote: Sun Jul 21, 2024 1:09 pm

I learnt some years ago that you shouldn't publish stuff without trying it with at least a handful of different Pups.

Fair cop Mike. I do tend to get over excited and trip over my own feet.
I should have made the note that I've only used it in Fossa64 9.5, Bookwormpup64, and Dpup32Stretch7.5 so far.
Have added a note to the first post to clarify that it is still under development.

User avatar
mikewalsh
Moderator
Posts: 6024
Joined: Tue Dec 03, 2019 1:40 pm
Location: King's Lynn, UK
Has thanked: 733 times
Been thanked: 1896 times

Re: "vidxtractor" utility to save portion of mp4, mov, avi or flv video.

Post by mikewalsh »

Semme wrote: Sun Jul 21, 2024 4:49 pm

That would be start time in ;) *seconds," Mike. 1:52 becomes 112.

@Semme :-

Mm-hm. 'Kay, that worked (as far as it went).

vektor_alian wrote: Sun Jul 21, 2024 5:07 pm

Hi greengeek.

The cli version works great. I needed to remove the spaces from the name first.

Thanks

Vektor

Mm.....'kayyyy. Doing both this AND taking Semme's suggestion into account finally yielded an output file, but.....it's a bit of a faff to have to convert all times into seconds AND to have to rename things as well (tedious & time-consuming when you have a long title with several words in it.......even more so if you're working with multiple files named the same way.).

I thought I could get around this by enclosing the title between quotation marks.....but ffmpeg STILL reads just the first word and quits ("no match found").

This is what I mean when I say about making it usable for everyone. The ffmpeg functionality works great - does just what you want it to! - but the way it's achieved here isn't very "user-friendly", is all I'm saying. We all know of ways around it, but noobs would quickly get frustrated.....

Like I said above; I KNOW it's still "early days". :) Cheers for the results so far; very encouraging!

greengeek wrote: Sun Jul 21, 2024 6:49 pm

Fair cop Mike. I do tend to get over excited and trip over my own feet.

Hey! no worries. It's a common trait, especially with us hobby devs; it's only natural to get excited when you've achieved something you really wanted to do, and you're chuffed with the results. I've done it no end of times, though by now I'm starting to get wise to WHERE I tend to go wrong.

You're not the first, Ian (not by a long chalk).......and I very much doubt you'll be the last! :D

Mike. ;)

User avatar
greengeek
Posts: 1354
Joined: Thu Jul 16, 2020 11:06 pm
Has thanked: 495 times
Been thanked: 184 times

Re: "vidxtractor" utility to save portion of mp4, mov, avi or flv video.

Post by greengeek »

vektor_alian wrote: Sun Jul 21, 2024 5:07 pm

The cli version works great. I needed to remove the spaces from the name first.

Thank you for pointing out this limitation.
I have gone back and been able to fix that issue in the pet version and clickable script version - but I remain unable to cure it when running the cli version as I see no way for cli to know where the filename (with spaces) ends - and the parameters (arguments) begin.

vektor_alian wrote: Sun Jul 21, 2024 6:16 pm

I just tried the script. Needed to remove the "3" from line 84 gtkdialog3 to match my version.

Many thanks for the tip!
This mod is now included in v2 of the pet and clickable script. Hopefully that mod will let it run in more Pups.
Cheers!

User avatar
greengeek
Posts: 1354
Joined: Thu Jul 16, 2020 11:06 pm
Has thanked: 495 times
Been thanked: 184 times

Re: "vidxtractor" utility to save portion of mp4, mov, avi or flv video.

Post by greengeek »

mikewalsh wrote: Sun Jul 21, 2024 8:44 pm

but.....it's a bit of a faff to ... have to rename things as well (tedious & time-consuming when you have a long title with several words in it.......even more so if you're working with multiple files named the same way.).

I thought I could get around this by enclosing the title between quotation marks.....but ffmpeg STILL reads just the first word and quits ("no match found").

Yes the cli method is stuck with this limitation - but that problem is now fixed in the pet and clickable script versions.

- but the way it's achieved here isn't very "user-friendly", is all I'm saying. We all know of ways around it, but noobs would quickly get frustrated.....

Yes - perhaps a mistake to have included the cli method. (Although at least it prompted some answers to help me improve...).
I take your point about noobies. Probably would be better with a nice yad gui. Above my pay grade unfortunately! 8-)
(Most of my stuff is focused on cut down pups like Fossa64Mini at present. Nothing fancy for me...)

User avatar
MochiMoppel
Posts: 1196
Joined: Mon Jun 15, 2020 6:25 am
Location: Japan
Has thanked: 19 times
Been thanked: 415 times

Re: "vidxtractor" utility to save portion of mp4, mov, avi or flv video.

Post by MochiMoppel »

greengeek wrote: Sun Jul 21, 2024 9:36 pm

Yes the cli method is stuck with this limitation

You need quotation marks in your cli version:
ffmpeg -ss $STARTSECONDS -i "$SOURCEVIDEO" -t $DURATIONSECONDS -vcodec copy -acodec copy "$BASE"_"$STARTTIME"."$SUFFIX"

This still requires that the user puts also quotation marks around the filename when it contains spaces. I assume that this is common knowledge and practice when dealing with the command line, but there are several ways to avoid even this requirement.

vektor_alian
Posts: 48
Joined: Thu Apr 01, 2021 12:36 am
Been thanked: 12 times

Re: "vidxtractor" utility to save portion of mp4, mov, avi or flv video.

Post by vektor_alian »

I am usually in the habit of renaming ALL files and folders so that the only special characters are hyphens or underscores. There are many programs in linux that have problems with spaces and other stuff.

It seems to me easier to change my ways than to fix all the software out there.

Thanks again for the cool stuff greengeek.

Vektor

User avatar
mikewalsh
Moderator
Posts: 6024
Joined: Tue Dec 03, 2019 1:40 pm
Location: King's Lynn, UK
Has thanked: 733 times
Been thanked: 1896 times

Re: "vidxtractor" utility to save portion of mp4, mov, avi or flv video.

Post by mikewalsh »

@greengeek :-

Thanks for v2 of the GUI script, Ian. With the addition of @MochiMoppel 's simple "fix", that's already made this a lot more usable.

I can now just drag'n'drop a video in from anywhere in my rather extensive collection, and after figuring out the seconds (!) I know it'll just 'work'.

Cheers, both of you. :thumbup:

Now, what would make it even more usable would be a way to enter start time as any media player would display it, i.e., as "h:mm:ss".......for example, "1:12:47", or "0:04:53".......and for the script to convert that into all seconds so the ffmpeg command would accept it. I can see how some of that could be done, but I suspect it would involve the need for either 'sed' or 'awk'..? Neither of which I've yet had any need to learn about...

Or can the time BE entered direct into the command syntax? Will ffmpeg let you do that..?

Mike. ;)

User avatar
mikewalsh
Moderator
Posts: 6024
Joined: Tue Dec 03, 2019 1:40 pm
Location: King's Lynn, UK
Has thanked: 733 times
Been thanked: 1896 times

Re: "vidxtractor" utility to save portion of mp4, mov, avi or flv video.

Post by mikewalsh »

@greengeek :-

Now then; how about this?

Found it over at StackOverflow. The following command allowed me to cut out a 55-second section from my 'test' video SteadyEddie.mp4 (no; don't ask! :lol: ). You can specify a start time AND an end time (using the format 'hh:mm:ss') :-

Code: Select all

ffmpeg -i input.mp4 -ss 00:00:00 -to 00:00:00 -c:v copy -c:a copy output.mp4

.....which for me translated as:-

Code: Select all

ffmpeg -i /root/SteadyEddie.mp4 -ss 00:00:53 -to 00:01:48 -c:v copy -c:a copy /root/SteadyEddie_C.mp4

...and StackOverflow linked me to here for the explanation:-

https://www.arj.no/2018/05/18/trimvideo/

Straightforward 'copy' (for both video & audio).....hence no re-encoding, and thus very fast. And specifying exact start & end times is a wee bit simpler than needing to work out the duration of your 'cut'. I'd advise trying it from the terminal to start with. You'll soon see what it's doing.

(Where ffmpeg's concerned, I much prefer searching for "real-life" examples.....as opposed to browsing the documentation on the official ffmpeg site and trying to figure out the appropriate command for myself).

This is using John van Sickle's 'static' 5.1.1 ffmpeg build, from mid 2022.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

I leave it to you to incorporate that into a script + GUI, etc.....which will (hopefully) result in being able to drag'n'drop a video into the entry box, entering start & end times, and hitting the 'Extract' OR 'Trim' button (or something similar). Gotta leave ya SOME of the "fun"....!! :D

(Might be an idea to specify in the GUI about the "00:00:00" time layout - "hh:mm:ss". Just so folks know what's expected, like...)

Over to you... :thumbup:

Mike. :P

User avatar
greengeek
Posts: 1354
Joined: Thu Jul 16, 2020 11:06 pm
Has thanked: 495 times
Been thanked: 184 times

Re: "vidxtractor" utility to save portion of mp4, mov, avi or flv video.

Post by greengeek »

mikewalsh wrote: Mon Jul 22, 2024 1:23 am

I leave it to you to incorporate that into a script + GUI, etc.....which will (hopefully) result in being able to drag'n'drop a video into the entry box...

You can already drag'n'drop into the file entry box. :thumbup:

mikewalsh wrote: Mon Jul 22, 2024 12:28 am

Now, what would make it even more usable would be a way to enter start time as any media player would display it, i.e., as "h:mm:ss".......for example, "1:12:47", or "0:04:53".......and for the script to convert that into all seconds so the ffmpeg command would accept it. ...

Or can the time BE entered direct into the command syntax? Will ffmpeg let you do that..?

Yes, ffmpeg tolerates that format for the start time. No requirement for manual conversion BUT it is important to avoid the idea that such a timestamp is accurate. The handling of reference frames means that times are approximate. (Also different video players handle the timestamps differently depending on the source of the file. High end video editors can MAKE the timestamps accurate if you do it right - but many other video manipulations can mess up the timestamps)
I just figured specifying "seconds" allows the user to make changes easily just based on what they eyeball.

With regard to the "duration" - yes you CAN use your preferred format to enter it into the gui - but in my script it is only a duration not an "end time"
(If I try to rewrite the script to allow both choice of "duration" and/or an "end time" using the "to" syntax you suggested then I will just confuse myself or make the gui more heavyweight than currently. I prefer it to be as minimalist as it can be).

So if you wanted to start at 1hr 24minutes and extract the next 30 minutes you could enter this into the gui:

vidxtractor_alternative_time_format.jpg
vidxtractor_alternative_time_format.jpg (17.84 KiB) Viewed 1292 times

.
Personally - I prefer to work with "seconds" alone - but maybe that is because I am generally working with videos from my dashcam that are typically only 3minutes long.

User avatar
MochiMoppel
Posts: 1196
Joined: Mon Jun 15, 2020 6:25 am
Location: Japan
Has thanked: 19 times
Been thanked: 415 times

Re: "vidxtractor" utility to save portion of mp4, mov, avi or flv video.

Post by MochiMoppel »

mikewalsh wrote: Mon Jul 22, 2024 12:28 am

With the addition of @MochiMoppel 's simple "fix"

It's not a "fix", it's a fix - without quotation marks, please :lol:

User avatar
mikewalsh
Moderator
Posts: 6024
Joined: Tue Dec 03, 2019 1:40 pm
Location: King's Lynn, UK
Has thanked: 733 times
Been thanked: 1896 times

Re: "vidxtractor" utility to save portion of mp4, mov, avi or flv video.

Post by mikewalsh »

MochiMoppel wrote: Mon Jul 22, 2024 4:39 am
mikewalsh wrote: Mon Jul 22, 2024 12:28 am

With the addition of @MochiMoppel 's simple "fix"

It's not a "fix", it's a fix - without quotation marks, please :lol:

Touché, mon ami...! :lol: :lol:

Mike. :thumbup:

vektor_alian
Posts: 48
Joined: Thu Apr 01, 2021 12:36 am
Been thanked: 12 times

Re: "vidxtractor" utility to save portion of mp4, mov, avi or flv video.

Post by vektor_alian »

Welp, as usual I modded your script to my liking. Added some xtra stuff.

I use Porteux KDE so the programs will be in need of changing for another DE.

I hope it is ok to post it here but I will be glad to start another thread.

The GDrive link is here ---

https://drive.google.com/drive/folders/ ... sp=sharing for anyone interested.

Thanks again greengeek

Vektor

User avatar
greengeek
Posts: 1354
Joined: Thu Jul 16, 2020 11:06 pm
Has thanked: 495 times
Been thanked: 184 times

Re: "vidxtractor" utility to save portion of mp4, mov, avi or flv video.

Post by greengeek »

vektor_alian wrote: Mon Jul 22, 2024 11:09 am

..as usual I modded your script to my liking. Added some xtra stuff.

Just had a quick look and I think the script may be based on v1 of vidxtractor?
- Seems to lack the quotes around $SOURCEVIDEO

(Just viewing on a small phone screen though, so not sure I am seeing all files on the google drive...)

Ahh, you have corrected the help link. Very good :)

vektor_alian
Posts: 48
Joined: Thu Apr 01, 2021 12:36 am
Been thanked: 12 times

Re: "vidxtractor" utility to save portion of mp4, mov, avi or flv video.

Post by vektor_alian »

I do not need the ability to deal with spaces since I remove them and other stuff from everything.

I found a time conversion website that works from a local folder, so seconds as an input still is ok.

All the files in GDrive need to be in 1 folder for the extra stuff to work.

I included a text help file to be expanded as I get more info.

Thanks for the effort you put into making this little program. It has been fun to mod for my use.

Vektor

User avatar
greengeek
Posts: 1354
Joined: Thu Jul 16, 2020 11:06 pm
Has thanked: 495 times
Been thanked: 184 times

Re: "vidxtractor" utility to save portion of mp4, mov, avi or flv video.

Post by greengeek »

vektor_alian wrote: Mon Jul 22, 2024 8:47 pm

I found a time conversion website that works from a local folder, so seconds as an input still is ok.

Just gave that a try - it's handy. Cheers!

vektor_alian_gui_mod.jpg
vektor_alian_gui_mod.jpg (16.75 KiB) Viewed 1138 times

.

TimeCalc.jpg
TimeCalc.jpg (33.53 KiB) Viewed 1138 times
User avatar
greengeek
Posts: 1354
Joined: Thu Jul 16, 2020 11:06 pm
Has thanked: 495 times
Been thanked: 184 times

Re: "vidxtractor" utility to save portion of mp4, mov, avi or flv video.

Post by greengeek »

vektor_alian wrote: Mon Jul 22, 2024 11:09 am

Welp, as usual I modded your script to my liking. Added some xtra stuff.
I use Porteux KDE so the programs will be in need of changing for another DE.
I hope it is ok to post it here but I will be glad to start another thread.

The GDrive link is here ---

https://drive.google.com/drive/folders/ ... sp=sharing for anyone interested.

Your modified gui incorporates some of what @mikewalsh was suggesting ("success" popup and time format prompt etc).

As you mentioned you set it up for kde - so I have modded it slightly for use on Puppy (leafpad instead of kwrite and defaultbrowser instead of firefox) so if anyone here wants to give it a try all the gui features should work.
(Still necessary to download the helpfile and html time calc converter from your link - but running this modded gui instead of the original)

Hope you don't mind my tinkering with your work :)
(Interested in the way you structured the gui. I know very little about best practice with gtkdialog so trying to learn all the time..)

Here is Vektor alian's modded gui, with minor adjustment for Puppy programs:
See vektor's posts above re sourcing the TIMECALC and help text files from his google drive.
Remove .false.gz suffiz. Place in directory alongside vektor alian's TIMECALC folder. Set exec permissions and click to run.

vektor_alian_vidxtractor_mod02.false.gz
Remove .false.gz suffiz. Place in directory alongside vektor alian's TIMECALC folder. Set exec permissions and click to run.
(2.5 KiB) Downloaded 15 times
vektor_alian
Posts: 48
Joined: Thu Apr 01, 2021 12:36 am
Been thanked: 12 times

Re: "vidxtractor" utility to save portion of mp4, mov, avi or flv video.

Post by vektor_alian »

Hi again greengeek.

Mind tinkering with MY work? Try the other way around. I stole your idea and mutilated it. Ha!

On my side of the fence, the text
Browse, Drag-n-Drop & Clear
is spaced evenly across the top so they line up with the buttons and entry field directly below.

Screenshot_20240722_195133.png
Screenshot_20240722_195133.png (25.09 KiB) Viewed 1123 times

Just add some spaces in the script to fix that.

I also inserted hyphens into the bottom buttons because there is no border with the black theme I use.

The layout of the UI is just a personal preference thing. If I can do it anyone can.

Have fun

Vektor

vektor_alian
Posts: 48
Joined: Thu Apr 01, 2021 12:36 am
Been thanked: 12 times

Re: "vidxtractor" utility to save portion of mp4, mov, avi or flv video.

Post by vektor_alian »

I forgot to mention during testing while using MPV video player the time display bar can show 3 places to the right of the decimal point.

I entered a random value xxx.xxx seconds and a clip was produced with no error msg. I did not verify if it actually did those 3 to the right.

Vektor

User avatar
greengeek
Posts: 1354
Joined: Thu Jul 16, 2020 11:06 pm
Has thanked: 495 times
Been thanked: 184 times

Re: "vidxtractor" utility to save portion of mp4, mov, avi or flv video.

Post by greengeek »

mikewalsh wrote: Sun Jul 21, 2024 1:09 pm

I tried to cut a short section out of a 'test video' I use. I entered the start-time as

Code: Select all

1:52

.....and the duration as just

Code: Select all

28

I think the options for start time would have been 112 (seconds as Semme said) or 00:01:52

1:52 looks as if it would confuse ffmpeg.

User avatar
MochiMoppel
Posts: 1196
Joined: Mon Jun 15, 2020 6:25 am
Location: Japan
Has thanked: 19 times
Been thanked: 415 times

Re: "vidxtractor" utility to save portion of mp4, mov, avi or flv video.

Post by MochiMoppel »

greengeek wrote: Tue Jul 23, 2024 5:55 am

1:52 looks as if it would confuse ffmpeg.

That's 6720 seconds (1hour 52 minutes)
Syntax is h:m:s . so 0:1:52 (=112 seconds) would work
This syntax allows a maximum value of 23:59:59 (=86399 seconds). Should be sufficient for most cases.

User avatar
greengeek
Posts: 1354
Joined: Thu Jul 16, 2020 11:06 pm
Has thanked: 495 times
Been thanked: 184 times

Re: "vidxtractor" utility to save portion of mp4, mov, avi or flv video.

Post by greengeek »

MochiMoppel wrote: Tue Jul 23, 2024 7:06 am

This syntax allows a maximum value of 23:59:59 (=86399 seconds). Should be sufficient for most cases.

That is an interesting limitation. I suppose it is possible that a net cam or web cam used as a security camera might produce a video that is longer than 24 hours.
What limits the maximum "hour" value to 23?
And do you think that "seconds" values higher than the 86399 value you've mentioned would be acceptable? Or would that fail for the same reasons as "24" hour value?

User avatar
mikewalsh
Moderator
Posts: 6024
Joined: Tue Dec 03, 2019 1:40 pm
Location: King's Lynn, UK
Has thanked: 733 times
Been thanked: 1896 times

Re: "vidxtractor" utility to save portion of mp4, mov, avi or flv video.

Post by mikewalsh »

greengeek wrote: Wed Jul 24, 2024 9:17 am

That is an interesting limitation. I suppose it is possible that a net cam or web cam used as a security camera might produce a video that is longer than 24 hours.

@greengeek :-

Possible.....but doubtful. Most security cam setups don't tend to record continuously at full, normal frame rate. usually, a very low frame rate - perhaps 1 or 2 fps - gets used.....and a session will only record 'x' number of hours, then loop back and record over itself again. At least, this is how things were done back in the days of VHS video recorders (I used to work for a security firm, some 25 years back).

However, in this day & age of digital everything AND endless amounts of cheap storage, I wouldn't like to say HOW things are done in this sector nowadays. Your premise could very well hold water! :D

Mike. ;)

User avatar
MochiMoppel
Posts: 1196
Joined: Mon Jun 15, 2020 6:25 am
Location: Japan
Has thanked: 19 times
Been thanked: 415 times

Re: "vidxtractor" utility to save portion of mp4, mov, avi or flv video.

Post by MochiMoppel »

greengeek wrote: Wed Jul 24, 2024 9:17 am

What limits the maximum "hour" value to 23?

The ffmpeg specification (see https://ffmpeg.org/ffmpeg-utils.html#ti ... ion-syntax)

And do you think that "seconds" values higher than the 86399 value you've mentioned would be acceptable? Or would that fail for the same reasons as "24" hour value?

I assume that more than 86399 seconds are acceptable - at least to a maximum of the current "Epoch" time (seconds since 1970-01-01), i.e. 1721819912 seconds or more than 54 years. Would this be sufficient?

vektor_alian
Posts: 48
Joined: Thu Apr 01, 2021 12:36 am
Been thanked: 12 times

Re: "vidxtractor" utility to save portion of mp4, mov, avi or flv video.

Post by vektor_alian »

From the website https://ffmpeg.org/ffmpeg-utils.html#ti ... ion-syntax

"There are two accepted syntaxes for expressing time duration.
[-][HH:]MM:SS[.m...]
HH expresses the number of hours, MM the number of minutes for a maximum of 2 digits, and SS the number of seconds for a maximum of 2 digits. The m at the end expresses decimal value for SS.
or
[-]S+[.m...][s|ms|us]
S expresses the number of seconds, with the optional decimal part m. The optional literal suffixes ‘s’, ‘ms’ or ‘us’ indicate to interpret the value as seconds, milliseconds or microseconds, respectively.
In both expressions, the optional ‘-’ indicates negative duration. "

I get the impression that there are no limits other than the quantity of characters.
2 characters each for minutes and seconds but the hours category does not specify a limit other than the implied 2 characters in [HH:]

We bought a microwave oven with a digital display and I can enter 99 seconds even though the format displays hh:mm:ss. Weird.

So 99:99:99 seems to be possible. And the hours [HH:] category does not specify a character limit so 9999:99:99 or more may be possible.

Time for some testing.

Vektor

vektor_alian
Posts: 48
Joined: Thu Apr 01, 2021 12:36 am
Been thanked: 12 times

Re: "vidxtractor" utility to save portion of mp4, mov, avi or flv video.

Post by vektor_alian »

Welp, using greengeek's program, I was not allowed to breach the 59 min 59 sec barrier for both the start and duration inputs. I refuse to attempt the 24 hour thing. Sorry.

Vektor

Post Reply

Return to “Multimedia”