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 12-24-2007, 11:05 PM
bcjenkins bcjenkins is offline
SageTVaholic
 
Join Date: Jan 2006
Posts: 3,764
Mencoder for Dummies?

I need help with a command line to use with mencoder. I am trying to remove sections of the video based on an edl file. This seemingly works on SD content, but failed on the first HD show I threw at it.

Does anyone have an easy way to explain what the command syntax is for deinterlacing and ivtc for a tv show?

The show is Las Vegas which seems to be recorded in 24000/1001 but telecined to 30000/1001. It is also broadcast in 1080i.

TIA

B

PS Please feel free to correct my wording
__________________
Running SageTV on unRAID via Docker
Tuning handled by HDHR3-6CC-3X2 using OpenDCT
Reply With Quote
  #2  
Old 12-25-2007, 12:33 PM
evilpenguin's Avatar
evilpenguin evilpenguin is offline
SageTVaholic
 
Join Date: Aug 2003
Location: Seattle, WA
Posts: 3,696
Unfortunately, cutting commercials straight from the mpegs with mencoder is pretty shaky. A lot of the times, especially with HD shows, there are issues with the timeline that prevent it from working. On windows there are a few good GUI tools that can handle this, but on linux, i'm not sure what's available. Honestly, I just convert the video first and then cut the commercials afterwards.

As for 1080i/720p IVTC, here's a good post from lobolsrul on the topic...

http://forums.sagetv.com/forums/show...6&postcount=11

Also, here's a PM he sent me with more information...

Quote:
Originally Posted by lobosrul
Heres the exact chain if I was encoding a 1080i30 show to 1080p24 (reverse telecine).

E:\ is my recording drive, E:\new\ is just a working temp directory. "start /b /low /wait" Has nothing to do with encoding, its just for running mencoder in low priority mode.

Code:
1 "C:\Sagemen\vp.vbs" "E:\HowIMetYourMother-HowIMetEveryoneElse-2561111-0.vprj" "E:\new\HowIMetYourMother-HowIMetEveryoneElse-2561111-0-clean.mpg"  
2 start /b /low /wait C:\Sagemen\mencoder.exe  "E:\new\HowIMetYourMother-HowIMetEveryoneElse-2561111-0-clean.mpg"   -vf pullup,softskip,crop=1728:972:96:54,scale=1152:648,harddup -ofps 23.976  -oac copy  -ovc x264 -x264encopts deblock:qcomp=.65:bframes=3:turbo=2:threads=2:b_pyramid:pass=1:bitrate=3000 -of rawaudio -o "E:\new\HowIMetYourMother-HowIMetEveryoneElse-2561111-0.ac3"
3 start /b /low /wait C:\Sagemen\mencoder.exe  "E:\new\HowIMetYourMother-HowIMetEveryoneElse-2561111-0-clean.mpg"   -vf pullup,softskip,crop=1728:972:96:54,scale=1152:648,harddup -ofps 23.976  -oac lavc -lavcopts acodec=mp2   -ovc x264 -x264encopts deblock:qcomp=.65:subq=5:8x8dct:frameref=2:bframes=3:b_pyramid:weight_b:threads=2:pass=2:bitrate=3000 -of rawvideo -o "E:\new\HowIMetYourMother-HowIMetEveryoneElse-2561111-0.264"
4 "C:\Sagemen\Besweet\besweet.exe" -core( -input  "E:\new\HowIMetYourMother-HowIMetEveryoneElse-2561111-0.ac3" -output "E:\new\HowIMetYourMother-HowIMetEveryoneElse-2561111-0.wav" -6chwav )
5 "C:\sagemen\neroAacEnc.exe" -cbr 192000 -ignorelength -if "E:\new\HowIMetYourMother-HowIMetEveryoneElse-2561111-0.wav" -of "E:\new\HowIMetYourMother-HowIMetEveryoneElse-2561111-0.aac"
6 "C:\sagemen\MP4Box.exe" -add "E:\new\HowIMetYourMother-HowIMetEveryoneElse-2561111-0.aac " -add "E:\new\HowIMetYourMother-HowIMetEveryoneElse-2561111-0.264" "E:\new\HowIMetYourMother-HowIMetEveryoneElse-2561111-0.avi" -fps 23.976
Line one is removing commercials with videoredo.

Yes, mencoder is creating a raw 264 and raw ac3 file. Note that I am creating the 264 file in the second pass, thats very important. I also found that for some reason encoding audio in both passes sometimes helped keep audio sync, even though its discarded; mp2 encoding is very quick.

Mp4box requires that your 264 and ac3 files have those exact file extensions BTW.

After this comes cleanup of all the temp files, running touch.exe on the final avi file, and the original mpg with it. I'm sure you know how to do that so I'll leave it out.

I'm using an avi extension because it seemed like SageTV was deleting .mp4's for some reason.

For 1080i30 to 1080p30 (de-interlacing) replace lines 2 and 3 with:

Code:
start /b /low /wait C:\Sagemen\mencoder.exe  "E:\new\HowIMetYourMother-HowIMetEveryoneElse-2561111-0-clean.mpg"   -vf yadif,crop=1728:972:96:54,scale=1152:648,harddup -ofps 29.97  -oac copy  -ovc x264 -x264encopts deblock:qcomp=.65:bframes=3:turbo=2:threads=2:b_pyramid:pass=1:bitrate=3000 -of rawaudio -o "E:\new\HowIMetYourMother-HowIMetEveryoneElse-2561111-0.ac3"
 start /b /low /wait C:\Sagemen\mencoder.exe  "E:\new\HowIMetYourMother-HowIMetEveryoneElse-2561111-0-clean.mpg"   -vf yadif,crop=1728:972:96:54,scale=1152:648,harddup -ofps 29.97  -oac lavc -lavcopts acodec=mp2   -ovc x264 -x264encopts deblock:qcomp=.65:subq=5:8x8dct:frameref=2:bframes=3:b_pyramid:weight_b:threads=2:pass=2:bitrate=3000 -of rawvideo -o "E:\new\HowIMetYourMother-HowIMetEveryoneElse-2561111-0.264"
For 720p60 to 720p24:

Code:
start /b /low /wait C:\Sagemen\mencoder.exe  "E:\new\House-GuardianAngels-2561915-0-clean.mpg"   -vf decimate=2:1000:1600:.001,scale=0:0,harddup -ofps 23.976 -oac copy  -ovc x264 -x264encopts deblock:qcomp=.65:bframes=3:turbo=2:threads=2:b_pyramid:pass=1:bitrate=3000 -of rawaudio -o "E:\new\House-GuardianAngels-2561915-0.ac3"
 start /b /low /wait C:\Sagemen\mencoder.exe  "E:\new\House-GuardianAngels-2561915-0-clean.mpg"   -vf decimate=2:1000:1600:.001,scale=0:0,harddup -ofps 23.976 -oac lavc -lavcopts acodec=mp2   -ovc x264 -x264encopts deblock:qcomp=.65:subq=5:8x8dct:frameref=2:bframes=3:b_pyramid:weight_b:threads=2:pass=2:bitrate=3000 -of rawvideo -o "E:\new\House-GuardianAngels-2561915-0.264"
Sometimes the frame pattern in 720p gets jumbled, leading to messy encodes. So I generally just leave it as 720p60. This takes a lot longer to encode but the end result isn't really less efficient.

For 720p60:

Code:
start /b /low /wait C:\Sagemen\mencoder.exe  "E:\new\House-GuardianAngels-2561915-0-clean.mpg"   -vf crop=1152:648:64:36,scale=0:0,harddup  -oac copy  -ovc x264 -x264encopts deblock:qcomp=.65:bframes=3:turbo=2:threads=2:b_pyramid:pass=1:bitrate=3000 -of rawaudio -o "E:\new\House-GuardianAngels-2561915-0.ac3"
 start /b /low /wait C:\Sagemen\mencoder.exe  "E:\new\House-GuardianAngels-2561915-0-clean.mpg"   -vf crop=1152:648:64:36,scale=0:0,harddup  -oac lavc -lavcopts acodec=mp2   -ovc x264 -x264encopts deblock:qcomp=.65:subq=5:8x8dct:frameref=2:bframes=3:b_pyramid:weight_b:threads=2:pass=2:bitrate=3000 -of rawvideo -o "E:\new\House-GuardianAngels-2561915-0.264"
Don't forget, the fps used with mencoder must match with mp4box (or any other muxer you use). Thats actually 59.94 in 720p60.

Scale is set at 0:0. Thats the same as leaving the scale tag out.

If you want 2 channel audio, regardless if the source is 5.1 or 2.0 (those are the only 2 I've seen on TV). Replace lines 4 and 5 with:

Code:
"C:\Sagemen\Besweet\besweet.exe" -core( -input  "E:\new\House-GuardianAngels-2561915-0.ac3" -output "E:\new\House-GuardianAngels-2561915-0.wav" -2ch )
 "c:\sagemen\neroAacEnc.exe" -cbr 64000 -ignorelength -if "E:\new\House-GuardianAngels-2561915-0.wav" -of "E:\new\House-GuardianAngels-2561915-0.aac"
Of course you can change the bitrate to whatever.

Hope that helps you out.

Last edited by evilpenguin; 12-25-2007 at 12:36 PM.
Reply With Quote
  #3  
Old 12-25-2007, 08:32 PM
bcjenkins bcjenkins is offline
SageTVaholic
 
Join Date: Jan 2006
Posts: 3,764
I found this while looking for an answer. I will have to try this out.

B

http://www.mit.jyu.fi/mweber/blog/In...s_streams.html
__________________
Running SageTV on unRAID via Docker
Tuning handled by HDHR3-6CC-3X2 using OpenDCT
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: SageMC Video Tools v2.0.1a (2/02/07) evilpenguin SageMC Custom Interface 501 04-06-2009 05:13 PM
STV Import: SageTV DVD Burning v2.0d (12/5/06) evilpenguin SageTV Customizations 263 01-24-2009 11:21 AM
RIP DVD to MPEG2, Edit, Convert to DivX davephan General Discussion 8 10-30-2006 07:38 AM
automating editing and compression with mencoder bluenote SageTV Customizations 3 06-26-2005 07:53 AM


All times are GMT -6. The time now is 02:02 AM.


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