arrbee99 1817 Posted September 3, 2020 Posted September 3, 2020 I ripped the boxset of The Last Ship. Season 1 has the video, audio track 1 and audio track 2. Every episode, except the first, has audio track 2 about 3 minutes longer than the video track. Would anyone know how to shorten the whole episode, or just audio track 2, down to the length of the video ? I tried just loading an episode into Avidemux and just saving with everything set to copy, but it just wouldn't save. I tried using this ffmpeg command - ffmpeg -i "%%m" -ss 00:00:00.0 -to 00:42:12.0 -c copy "%%~nm_shorter.mkv" to hopefully save everything up to the end of the video track (42m12sec in this case) into a new file. This kind of works, in that the result is 42m12sec long, but audio track 2 disappears completely, and I'd prefer to keep it. Any thoughts ?
sooty234 266 Posted September 3, 2020 Posted September 3, 2020 I would be curious to see if lip sync remains consistent throughout the video. Does it start correctly, and progressively get worse?
arrbee99 1817 Posted September 3, 2020 Author Posted September 3, 2020 Haven't got the patience to just sit and watch, but skipping through it looks perfectly fine.
PenkethBoy 2068 Posted September 3, 2020 Posted September 3, 2020 if you play the original - does having a longer audio track create a problem? If not why do you care as it will make only a small diff to the file size? or is this an ocd thing as for the ffmpeg command try changing -c copy to.... -map 0:a -c:a copy or this might be enough -c:a copy both should copy all audio tracks can do the same for subs -map 0:s? -c:s copy the ? means only if they exist - otherwise ffmpeg complains that it cant find subs when not present and has a strop
PenkethBoy 2068 Posted September 3, 2020 Posted September 3, 2020 @arrbee99 my first episode of the last ship has a 4 second longer audio than the video
arrbee99 1817 Posted September 3, 2020 Author Posted September 3, 2020 Thanks for the help and well yes its mostly ocd, with a bit of - it plays and stops fine with the first audio track in vlc, but with the second track it gets to the end and just sits there, not playing, so the playing time isn't changing, but not stopping either. Don't need the subs thing btw. I tried your first suggestion, and it does indeed copy both audio tracks, but there's no video. Thats- ffmpeg -i "%%m" -ss 00:00:00.0 -to 00:42:12.0 -map 0:a -c:a copy "%%~nm_shorter.mkv" The second suggestion created the file, but 0 bytes in size. Thats- ffmpeg -i "%%m" -ss 00:00:00.0 -to 00:42:12.0 -c:a copy "%%~nm_shorter.mkv" But it seems like this works - ffmpeg -i "%%m" -ss 00:00:00.0 -to 00:42:12.0 -map 0:v -c:v copy -map 0:a -c:a copy "%%~nm_shorter.mkv" Its actually like its taken the length of the first episode, which seems to be fine, and applied that to all the other episodes in the series, which are all several minutes shorter. Of course, for the episode I'm testing, applying this ffmpeg thing makes the version it produces start off a bit weird. It seems to start playing at 7 seconds. Something to do with key-frames maybe? (there's always something...)
PenkethBoy 2068 Posted September 4, 2020 Posted September 4, 2020 yep you wont get audio with this as you have told ffmpeg to just copy the audio " ffmpeg -i "%%m" -ss 00:00:00.0 -to 00:42:12.0 -c:a copy "%%~nm_shorter.mkv" and yes this will work as now you are adding for it to copy the video as well as the audio " ffmpeg -i "%%m" -ss 00:00:00.0 -to 00:42:12.0 -map 0:v -c:v copy -map 0:a -c:a copy "%%~nm_shorter.mkv" if you have run the above on each episode then yes they will all be 42:12 long as thats what you have specified - so only apply the time limit to the first episode not sure about the 7 second thing depends what else you have done or the original rips need doing again...? 1
arrbee99 1817 Posted September 4, 2020 Author Posted September 4, 2020 I've checked the video duration for each episode and adjusted the 42:12 to whatever time I found. All the episodes have been compressed in Handbrake and they all just start. They've all had the lengths adjusted after that but there's only one episode that does the starting at 7 seconds thing. Maybe I'll re-Handbrake it or re-rip it or something. Mind you I think the messing around with this is beginning to trump the ocd aspect. i.e. its getting close to the Oh bugger it point...
PenkethBoy 2068 Posted September 4, 2020 Posted September 4, 2020 yep re rip ep1 and check it before putting through handbrake
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