SageTV Community  

Go Back   SageTV Community > SageTV Products > SageTV Software
Forum Rules FAQs Community Downloads Today's Posts Search

Notices

SageTV Software Discussion related to the SageTV application produced by SageTV. Questions, issues, problems, suggestions, etc. relating to the SageTV software application should be posted here. (Check the descriptions of the other forums; all hardware related questions go in the Hardware Support forum, etc. And, post in the customizations forum instead if any customizations are active.)

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 10-11-2011, 09:39 PM
Gustovier Gustovier is offline
Sage Aficionado
 
Join Date: Nov 2010
Location: Chicago
Posts: 460
Custom conversion settings

All,

Has anybody created a custom conversion that creates 2 audio tracks? It looks like Sage is using ffmpeg to do this (what handbrake uses). So i have a custom conversion setting that I use in handbrake that allows me to have audio track #1 as 2 channel AAC and then a second audio track for 5.1 AC3. This allows me to play my video file on the iphone4/ipad and then also still get surround sound when playing back through an apple tv 2.

The problem is I just can quite figure out how to map my handbrake settings to the sage settings. I'm pretty sure Sage can do this as it's all based on ffmpeg I'm just not sure how Sage is expecting the parameters. The documentation around this part of sage is not extensive enough.

edit:

Actually I think handbrake is using x264 for the encode, what sage is doing I dunno. But I think if I put 2 [bf\=aud; etc etc] sections in the custom definition that might add my second track. I'm trying it now

edit 2: Handbrake actually lets you use x264 OR ffmpeg for the encode..

Last edited by Gustovier; 10-16-2011 at 11:44 AM.
Reply With Quote
  #2  
Old 10-12-2011, 12:43 PM
Gustovier Gustovier is offline
Sage Aficionado
 
Join Date: Nov 2010
Location: Chicago
Posts: 460
Ok, so that didn't work out, even though it looks like it should. I'm really hoping this isn't going to end up being a bug that will never get fixed.

I used the following to define the audio tracks of the output file

Code:
[bf\=aud;f\=aac;sr\=48000;ch\=2;br\=128000;][bf\=aud;f\=ac3;sr\=48000;bsmp\=16;br\=384000;]
This looked like it was going to work due to this line in the sage log

Code:
Wed 10/12 0:13:21.046 [Ministry@130a6a0] Set Transcode format source=MPEG2-TS 0:04:57 3140 kbps [#0 Video[MPEG2-Video 59.94006 fps 1280x720 16:9 progressive id=0800]#1 Audio[AC3 48000 Hz 6 channels 448 kbps MAIN idx=1 id=0801 eng]#2 Audio[AC3 48000 Hz 2 channels 192 kbps idx=2 id=0802 spa]{ScrapedBy=Phoenix, IMDBID=, MediaType=TV, ScrapedDate=1318302011294, MediaProviderDataID=248682, MediaTitle=New Girl, SeriesInfoID=1419203, DiscNumber=0, UserRating=73, MediaProviderID=tvdb}] dest=mp4 0:00:00 0 kbps [#0 Video[h264 29.97 fps 1280x720 16:9 4500 kbps progressive]#1 Audio[aac 48000 Hz 2 channels 128 kbps]#2 Audio[ac3 48000 Hz 384 kbps]{CompressionDetails=-coder 0 -flags +loop -cmp +chroma -partitions +parti8x8+parti4x4+partp8x8+partb8x8 -me_method umh -subq 8 -me_range 16 -g 250 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -b_strategy 2 -qcomp 0.6 -qmin 10 -qmax 51 -qdiff 4 -bf 0 -refs 1 -directpred 3 -trellis 1 -flags2 -wpred-dct8x8 -wpredp 0 -rc_lookahead 50 -level 30 -maxrate 12000000 -bufsize 12000000}]
As you can see it looked like it was going to create 2 tracks, with the Track #1 being the 2 channel AAC and Track #2 being the AC3


Update:

Alright team ( I think I'm actually talking to myself since no one is replying in this thread..lol), sagetvtranscoder.exe really is just ffmpeg, and after some messing around and using the following ffmpeg line gives a conversion with great quality with 2 audio tracks.. Audio Track #1 is streo AAC and Audio track #2 is 5.1 AC3. This allows it to be played on iphone4/ipad and do 5.1 via ac3 passthru on appletv2 if you are gonna play there.

(FYI as other members have posted their are jailbreak options that allow you to play different formats and some of this might not be necessary. But with one of the main jailbreak hackers defecting to apple and IOS5 out who knows how long it will be before an unteathered jailbreak-- a teathered one is out already I think)

Code:
-v 3 -y -threads 2 -sn -vsync 1 -async 100 -stdinctrl -i INPUTFILE.ts -threads 4 -f mp4 -map 0:0 -map 0:1 -map 0:1 -vcodec libx264 -b 4500000 -s 1280x720 -r 29.97 -aspect 16:9 -acodec libfaac -ab 384000 -ac 2 -ar 48000 -coder 0 -flags +loop -cmp +chroma -partitions +parti8x8+parti4x4+partp8x8+partb8x8 -me_method umh -subq 8 -me_range 16 -g 250 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -b_strategy 2 -qcomp 0.6 -qmin 10 -qmax 51 -qdiff 4 -bf 0 -refs 1 -directpred 3 -trellis 1 -flags2 -wpred-dct8x8 -wpredp 0 -rc_lookahead 50 -level 30 -maxrate 12000000 -bufsize 12000000 OUTPUTFILE.m4v -acodec copy -newaudio
Now we just have a couple of more challenges.

1. For some reason using the m4v type ("-f m4v" ffmpeg argument) resulted in files that wouldn't play. So that meant resulting to using mp4 (-f mp4). iDevices do not like mp4 files with multiple audio tracks only .m4v. They are basically the same so you can simply rename the .mp4 to .m4v in the filename. The issue is in how sage handles the conversion. Sage creates a .tmp file of your video and there's some logic somewhere that tells it to rename the extension I think based on the -f parameter,(I think). Somehow we need to have this saved as an .m4v file..

2. I'm not sure of the flexibility Sage is going to allow me to use those ffmpeg settings above for the conversion. Sage abastracts a lot of that into it's own little format that they want you to follow (and was NEVER documented). Even worse it adds in some non-configerable arguments that will get passed no matter what to ffmpeg, but it's pretty close so I'm hoping i can get it to work. At worse might have to have a fake sagetvtranscoder.exe that intercepts so i have complete control. This would also allow for a newer version of ffmpeg aka sagetvtranscoder.exe to be used as well, but its more work.
Reply With Quote
  #3  
Old 10-12-2011, 02:45 PM
wayner wayner is offline
SageTVaholic
 
Join Date: Jan 2008
Location: Toronto, ON
Posts: 7,491
Would it be easier to just use Handbrake or ffmpeg directly rather than the Sage built-in converter? It is pretty easy to use SJQ to kick off a conversion and to do other stuff as well, like copy the file to other locations, etc.
__________________
New Server - Sage9 on unRAID 2xHD-PVR, HDHR for OTA
Old Server - Sage7 on Win7Pro-i660CPU with 4.6TB, HD-PVR, HDHR OTA, HVR-1850 OTA
Clients - 2xHD-300, 8xHD-200 Extenders, Client+2xPlaceshifter and a WHS which acts as a backup Sage server
Reply With Quote
  #4  
Old 10-12-2011, 02:55 PM
Gustovier Gustovier is offline
Sage Aficionado
 
Join Date: Nov 2010
Location: Chicago
Posts: 460
Quote:
Originally Posted by wayner View Post
Would it be easier to just use Handbrake or ffmpeg directly rather than the Sage built-in converter? It is pretty easy to use SJQ to kick off a conversion and to do other stuff as well, like copy the file to other locations, etc.
I thought about that too.. But there's one thing I guess I need a better understanding of. When you use the built in converter, There's the option to add to library, delete the original and sage treats the converted file just like a recording (actually preserves the metadata and is by all means a recording, not an import). I think this is what's happening, and what I like. How would you be able to do the same utilizing SJQ once I have the file converted to some location? I don't think there's away to get it re added to the library with all the same metadata and have it be treated as a recording, or is there?
Reply With Quote
  #5  
Old 10-12-2011, 03:02 PM
wayner wayner is offline
SageTVaholic
 
Join Date: Jan 2008
Location: Toronto, ON
Posts: 7,491
Thta's a good point. If you kept the same filename after conversion then you might be ok with the metadata but that might not make sense if you want to convert an MPG file to a MP4 file so that it can work on an iPad. Slugger may know if it is possible to do this.

I was thinking more of converting for non-Sage purposes such as to use on an iDevice or PC based video players when you are not connected to a Sage server, like a laptop on an airplane.

edit - I have asked Slugger how to do this is the SJQ4 thread.
__________________
New Server - Sage9 on unRAID 2xHD-PVR, HDHR for OTA
Old Server - Sage7 on Win7Pro-i660CPU with 4.6TB, HD-PVR, HDHR OTA, HVR-1850 OTA
Clients - 2xHD-300, 8xHD-200 Extenders, Client+2xPlaceshifter and a WHS which acts as a backup Sage server

Last edited by wayner; 10-12-2011 at 03:05 PM.
Reply With Quote
  #6  
Old 10-12-2011, 06:34 PM
BobPhoenix BobPhoenix is offline
SageTVaholic
 
Join Date: Oct 2004
Posts: 3,152
If you move the converted recording to an import directory and delete the old file then all you have to do is cause an imported files scan and you will get back your recording just like the SageTV built in converter. The advantage of the built in one is that you can add the conversion to the database with the EPG data WITHOUT having to delete the original. You will loose which tuner recorded the file and you may (doesn't always happen) loose the channel it was recorded on when moving files to imported directories this way.
Reply With Quote
  #7  
Old 10-13-2011, 12:05 PM
wayner wayner is offline
SageTVaholic
 
Join Date: Jan 2008
Location: Toronto, ON
Posts: 7,491
It seems like Sage is smart enough to retain the metadata if you only change the extension on a file. Here is Slugger's reply on the issue which is pretty much what BobPhoenix said as well: http://forums.sagetv.com/forums/show...&postcount=977
__________________
New Server - Sage9 on unRAID 2xHD-PVR, HDHR for OTA
Old Server - Sage7 on Win7Pro-i660CPU with 4.6TB, HD-PVR, HDHR OTA, HVR-1850 OTA
Clients - 2xHD-300, 8xHD-200 Extenders, Client+2xPlaceshifter and a WHS which acts as a backup Sage server
Reply With Quote
  #8  
Old 10-16-2011, 11:34 AM
Gustovier Gustovier is offline
Sage Aficionado
 
Join Date: Nov 2010
Location: Chicago
Posts: 460
Ok, so I was experimenting with this over the weekend. It seems like this functionality works with only given set of video extensions. It doesn't work when the file has the "m4v" extension. Within the Sage.properties file there is the "seeker/video_library_import_filename_extensions=" that I'm assuming lets you specify all the video extensions sage should deal with and "m4v" is in there, but I don't think that parameter applies to this "recording file switch" process sage has built in.. If it see's the filename the with the same name as the original .TS recording but with an .m4v extension the seeker will ignore it.

If you are wondering why I want .m4v instead of .mp4 its that iDevices don't know how to handle .mp4 files with multiple audio streams. They need the .m4v extension (doesn't make too much sense..i know)
Reply With Quote
  #9  
Old 10-16-2011, 02:37 PM
Gustovier Gustovier is offline
Sage Aficionado
 
Join Date: Nov 2010
Location: Chicago
Posts: 460
So I'm figuring this out slowly but surely and yes sage will not do the automatic replacement if the file ends with .m4v but this seems to only be the case if the m4v is stored in the recording directory location. If you put it in the import location it will assign it mostly all the metadata as what was posted before you will lose some things as which tuner was used,etc. But nothing too important. If use use a .mp4 file you CAN store it in the recording directory and you won't lose any of the metadata. I wonder why sage won't let you use m4v in the recording directory....
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
Custom Conversion schemes? Fuzzy SageTV Studio 6 11-29-2010 01:15 PM
Is there any reference for Automatic Conversion quality settings? grison SageTV Beta Test Software 2 09-21-2010 11:03 AM
custom conversion - audio only zzmystique SageTV Australia/New Zealand 4 09-23-2009 07:50 PM
Custom Recording Settings??? zoundz SageTV Software 0 12-30-2004 12:35 PM
Custom STV Settings Lost on Reboot Snuffy2 SageTV Beta Test Software 11 12-17-2004 07:47 AM


All times are GMT -6. The time now is 11:13 PM.


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