SageTV Community  

Go Back   SageTV Community > General Discussion > General Discussion
Forum Rules FAQs Community Downloads Today's Posts Search

Notices

General Discussion General discussion about SageTV and related companies, products, and technologies.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 03-18-2008, 07:36 PM
bluenote bluenote is offline
Sage Aficionado
 
Join Date: Nov 2004
Location: Vancouver, canada
Posts: 336
mencoder and FFmpeg - splitting video files

I have some pretty laborious make-work file splitting to do, and I was hoping to script something up to make it a little less intensive. So, I have a couple questions on mencoder and/or ffmpeg -- but I find it akin to voodoo. Lots of cut n paste too :/

One: can either ffmpeg or mencoder split a WMV / AVI / MPG into chunks without re-encoding? If so how would I go about doing that?

Two: If not the above, whats the easiest/fastest most automated way to do so and which program?

I much prefer something with a CLI so I can batch around it.
thanks for any and all input,

Cory

EDIT: I was unclear .. ideally I'd like to be able to handle WMV3 files, and i guess thats why Im not getting great results so far with ffmpeg.

Last edited by bluenote; 03-18-2008 at 09:02 PM.
Reply With Quote
  #2  
Old 03-26-2008, 09:46 AM
lobosrul's Avatar
lobosrul lobosrul is offline
Sage Expert
 
Join Date: Aug 2005
Location: Albuquerque, NM
Posts: 573
Quote:
Originally Posted by cnovak View Post
I have some pretty laborious make-work file splitting to do, and I was hoping to script something up to make it a little less intensive. So, I have a couple questions on mencoder and/or ffmpeg -- but I find it akin to voodoo. Lots of cut n paste too :/

One: can either ffmpeg or mencoder split a WMV / AVI / MPG into chunks without re-encoding? If so how would I go about doing that?

Two: If not the above, whats the easiest/fastest most automated way to do so and which program?

I much prefer something with a CLI so I can batch around it.
thanks for any and all input,

Cory

EDIT: I was unclear .. ideally I'd like to be able to handle WMV3 files, and i guess thats why Im not getting great results so far with ffmpeg.
I know mkvmerge can split a file "into chunks" without re-encoding. You'll need to take all those files and mux them into mkvmerge first though (a quick and trivial process). I'm not sure it can handle wmv though.
Reply With Quote
  #3  
Old 03-26-2008, 10:26 AM
bcjenkins bcjenkins is offline
SageTVaholic
 
Join Date: Jan 2006
Posts: 3,764
have you tried the copy codec?

B
__________________
Running SageTV on unRAID via Docker
Tuning handled by HDHR3-6CC-3X2 using OpenDCT
Reply With Quote
  #4  
Old 03-26-2008, 11:50 AM
evilpenguin's Avatar
evilpenguin evilpenguin is offline
SageTVaholic
 
Join Date: Aug 2003
Location: Seattle, WA
Posts: 3,696
Code:
mencoder -oac copy -ovc copy -ss #START_TIME# -endPos #DURATION#  input.avi -o clip.avi
So if you used -ss 60 and -endPos 60 you'ed get a clip that goes from 60-120 seconds from the original video.

Fair warning, you're milage may vary from container type and some containers may require special -of options. Google is your friend for those.
Reply With Quote
  #5  
Old 03-26-2008, 12:11 PM
lobosrul's Avatar
lobosrul lobosrul is offline
Sage Expert
 
Join Date: Aug 2005
Location: Albuquerque, NM
Posts: 573
Quote:
Originally Posted by evilpenguin View Post
Code:
mencoder -oac copy -ovc copy -ss #START_TIME# -endPos #DURATION#  input.avi -o clip.avi
So if you used -ss 60 and -endPos 60 you'ed get a clip that goes from 60-120 seconds from the original video.

Fair warning, you're milage may vary from container type and some containers may require special -of options. Google is your friend for those.
I've never had much luck trying to split mpg's that way. There are some -of options out there to try but I always seemed to have timeline/sync issues.
Reply With Quote
  #6  
Old 03-30-2008, 02:31 PM
bluenote bluenote is offline
Sage Aficionado
 
Join Date: Nov 2004
Location: Vancouver, canada
Posts: 336
So I must have spent a dogs age messing around with this, including figuring out how to compile my own ffmpeg with dependencies, and I was only able to get lukewarm results. I'm afraid its all just a blur so I can't recall exactly what disqualified each different approach I took with each tool. I wish I had taken better notes. I may go back and have a look at my test outsputs again though.

What it came down to in the end was, each had a fatal flaw as far as I was concerned. In different areas, so that if their *working* features were put together, I could have done everything i needed. :/

If I'm remembering right, mencoder's -ss flag doesn't work properly. (or it may be endpos). I ended up creating EDL files to be used with hr-edl-seek, but then ran into other problems. (as if creating EDL's on the fly, and seeking through the whole file to the end because we're skipping the remainder of the file but mencoder doesn't figure that out, wasn't enough ugliness).

ffmpeg -ss worked well, but -t (duration) was completely fubar'd, but I could copy a certain number of frames, which did work approximately, and again, I cant remember what the final nail in the coffin was here.

Anyways, at the end of the day I ended up finding some commercial products that do what I want, no muss no fuss, but are somewhat more limited. I was really disappointed after delving into this as deeply as I did to find the extremely inconsistent, poorly documented, basically slipshod state of some of this stuff.

That being said, I'm still hopeful and I do use these tools for other things without problems. Unfortunately for this job, it was just a big bloody nightmare (primarily using the copy codec, but I did experiement with transcoding on the fly too ... with a speed penalty, and no wmv3 output).

If any of you guys have thoughts about the above I'd love hints on how I might *actually* solve this problem, because I was quite invested with getting to a final solution.

EP: Im using hr-edl-seek with mencoder as we speak (commercial cutting), and as far as I can tell, it's never ever worked properly with mpg files, yet occasionalyl I can produce a file that has not had everything past the first skip start point skipped. (ie: it begins skipping, and never stops). Care to comment? I know you use hr-edl-seek but not sure if you are using mpgs at that point?

Cory
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
STV Import: SageMC Video Tools v3.0 evilpenguin SageMC Custom Interface 799 08-28-2009 02:20 PM
STV Import: SageTV DVD Burning v2.0d (12/5/06) evilpenguin SageTV Customizations 263 01-24-2009 11:21 AM
Mencoder instead of FFmpeg TechBill SageTV Beta Test Software 1 02-10-2008 11:23 PM
aspect ratio on imported videos simonen SageTV Software 19 10-18-2007 03:35 PM


All times are GMT -6. The time now is 03:29 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, vBulletin Solutions Inc.
Copyright 2003-2005 SageTV, LLC. All rights reserved.