arrbee99 1551 Posted October 28, 2022 Share Posted October 28, 2022 Am perfectly happy with Avidemux for chopping unnecessary bits off the beginning and end of recordings, except that when it saves the result it looses any subs. Anyone know of a simple (free...) alternative that'll keep subs intact ? Thanks. Link to comment Share on other sites More sharing options...
arrbee99 1551 Posted December 24, 2022 Author Share Posted December 24, 2022 Same problem - any thoughts anyone ? Link to comment Share on other sites More sharing options...
Luke 37007 Posted December 24, 2022 Share Posted December 24, 2022 Maybe try with ffmpeg? Link to comment Share on other sites More sharing options...
arrbee99 1551 Posted December 24, 2022 Author Share Posted December 24, 2022 I've done that. The only way I know how to do that to, say, remove some of the ending in a series is to find the right point in episode 1, edit my ffmpeg batch file, save it, run it for that one episode, find the right spot in episode 2, edit my fffpeg batch file again, save it, run it for that one file, etc etc. Link to comment Share on other sites More sharing options...
arrbee99 1551 Posted December 24, 2022 Author Share Posted December 24, 2022 I got this off the interweb (I think). It uses fflmeg and will cut off x seconds from the front and y seconds from the end - @Echo Off SetLocal Set "ext=mp4" Set "opts=-v quiet" Set "opts=%opts% -print_format "compact=print_section=0:nokey=1:escape=csv"" Set "opts=%opts% -show_entries "format=duration"" If Exist *.%ext% (If Not Exist "Trimmed\" MD Trimmed) For %%a In (*.%ext%) Do Call :Sub "%%~a" Exit/B :Sub For /f "Tokens=1* Delims=." %%a In ( 'FFProbe %opts% %1') Do (Set/A "ws=%%a-020.00" & Set "ps=%%b") rem If %ws% Lss 20 GoTo :EOF Set/A hh=ws/(60*60), lo=ws%%(60*60), mm=lo/60, ss=lo%%60 If %hh% Lss 10 Set hh=0%hh% If %mm% Lss 10 Set mm=0%mm% If %ss% Lss 10 Set ss=0%ss% FFMpeg -i %1 -ss 00:00:10.0000 -to %hh%:%mm%:%ss%.%ps:~,3% -map 0:a? -map 0:s? -map 0:v -c:v copy -c:a copy -c:s copy "Trimmed\%~1" It seems to mostly work except that it seems to not reset the length of the video properly. So, if you cut 10 seconds off the start and 20 off the end, then the resulting file is 10 seconds shorter, not 30. When played, it seems to cut the 10 seconds off the start and 20ish seconds off the end so near the end the video stops with the time line showing about 20 seconds still to go. Now if I take that file and put it in Avidemux and just save it without doing anything to it, it magically gets about 20 seconds shorter, which would I guess be OK, except doing that looses the subtitles. Don't suppose anyone knows why the .bat file above doesn't get the video length right ? Link to comment Share on other sites More sharing options...
arrbee99 1551 Posted December 24, 2022 Author Share Posted December 24, 2022 Unless I'm very much mistaken, and i usually am, looks like Lossless-Cut might just possibly be the answer I'm looking for... Link to comment Share on other sites More sharing options...
jasonmcroy 315 Posted December 28, 2022 Share Posted December 28, 2022 It may work for you. I have tried it and it will do the job, but you will get a warning when loading .ts files that it doesn't support them or something like that. It will still work, just may have to convert it after cutting. I have only tried a couple of files myself but went back to avidemux because it is much faster and I don't care about subtitles so never even knew it didn't retain them. Link to comment Share on other sites More sharing options...
arrbee99 1551 Posted December 28, 2022 Author Share Posted December 28, 2022 I need to play some more but I think while Lossless-Cut will remove the beginning and end OK and keep the subtitles, it doesn't adjust the length properly, and when you try to fix up the length, the subtitles get lost... Hopefully there's a good combination in there somewhere. Link to comment Share on other sites More sharing options...
visproduction 122 Posted December 30, 2022 Share Posted December 30, 2022 On 12/23/2022 at 11:50 PM, arrbee99 said: It seems to mostly work except that it seems to not reset the length of the video properly. So, if you cut 10 seconds off the start and 20 off the end, then the resulting file is 10 seconds shorter, not 30. When played, it seems to cut the 10 seconds off the start and 20ish seconds off the end so near the end the video stops with the time line showing about 20 seconds still to go. Try remuxing the file using copy audio and video to reset the duration. 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now