SageTV Community  

Go Back   SageTV Community > SageTV Development and Customizations > SageTV Customizations
Forum Rules FAQs Community Downloads Today's Posts Search

Notices

SageTV Customizations This forums is for discussing and sharing user-created modifications for the SageTV application created by using the SageTV Studio or through the use of external plugins. Use this forum to discuss customizations for SageTV version 6 and earlier, or for the SageTV3 UI.

Reply
 
Thread Tools Search this Thread Display Modes
  #121  
Old 07-22-2004, 02:12 AM
Crashless's Avatar
Crashless Crashless is offline
Sage Icon
 
Join Date: Oct 2003
Location: Los Angeles, CA
Posts: 1,224
Partial success...

I'm tired, and have to work tomorrow, so I'm uploading my work.

Check out my changes to:
properties.xml
batch.bat

I basically took advantage of the external program capability of the ffmpeg_convert and used it to copy the desired file to a directory so a vbs script I found (http://www.ericphelps.com/scripting/samples/VirtualDub/) could run on the directory.

That script (slightly streamlined by me) creates another script that can be read by virtualdub mpeg (the version mentioned above.)

To use, change the paths to your specs in the above files, run ffmpeg_convert, then batch.bat. And here's where I get hung up because I know virtually nothing about scripting, java, or programming.

I can't get virtual dub to automatically run the script. Tried everything and can't get it to do it, but I know it should work. Maybe I'm just tired and my computer is tired of me messing with it.

This is a very ugly solution, and I realize that. Hopefully someone that knows this stuff better than I do can streamline this.

Notice in my batch file that I rename the resulting files from .mpg to .avi. This is because of a limitation of the vbs script, since I don't know how to mess with it, or change it, this was my hackjob solution.

Oh yeah, everything included has to be in a directory with virtualdub mpeg. I didn't include it because I don't konw if I can redistribute it. I don't want to get sued. The VBS script is public domain, so do with it what you like.

I'll be checking this thread while at work, so please ask questions if you have any.

Thanks for the ground work from the STV, and the hooks guys. I'd be lost at sea without them.

SOOOO CLOSE!
Attached Files
File Type: zip testing.zip (72.9 KB, 225 views)
Reply With Quote
  #122  
Old 07-22-2004, 06:42 AM
Bubster's Avatar
Bubster Bubster is offline
Sage Advanced User
 
Join Date: Feb 2004
Location: Glasgow, UK
Posts: 114
I managed to build the latest CVS snapshot of ffmpeg here with Lame MP3 support, after much messing around (someone really needs to sort out their build setup).

So I tried it on a large mpeg (from Sage at 3.25GB/hour) of just under 6GB, at 1600/128, using mp3 for the audio. The resulting file was ~1.5GB. When I tried to play it in Zoomplayer, it dropped the sound at exactly 12 secs. I then tried it in Media Player Classic, Windows Media Player and Sage, and the sound was there for the entire duration of the video. I went back into Zoomplayer and disabled the customised filter setup, and it too played the movie with sound all the way through, so it seems that my custom filter setup is screwy in some way.

What I'm not sure about is if this is in any way related to the dropped sound issues other people have been getting. What players have people tried their compressed videos in?

I then realised that the sound wasn't in sync with the video and, after looking on the ffpmeg mailing list archives for a bit, found out about the "-async" flag which can be used to solve audio sync issues. I re-compressed the movie with this flag and the audio was now synced correctly with the video. This appears to be a fairly new flag, so it might not be in the 0.48 binary that's kicking around.

So I have something here which appears to work for me, but I have no idea if it will fix the audio problem other people are getting.

I've hidden a copy on my website, if anyone wants to try it:

ffmpeg built from latest CVS

BTW, I also had a look at VirtualDub and various discussions about it, and haven't managed to find a way to keep it silent yet. There may be no way to do it without modifying the source, or writing some sort of windows hook that brushes all its windows "under the carpet" before they get a chance to appear.

Oh, someone mentioned VirtualDub being handy so we can also use XviD. It appears that someone has created a patch for ffmpeg which provides XviD encoding, so that might be worth looking at...

- Neil.
Reply With Quote
  #123  
Old 07-22-2004, 06:53 AM
mlbdude's Avatar
mlbdude mlbdude is offline
Moderator
 
Join Date: May 2003
Location: Melbourne, Florida
Posts: 4,174
Great work! I will try this out tonight. For the previous files that had no sound I tried them in Sage and Windows Media player.

Alex, I know you mentioned we can easily modify your application to use new command line options. Can you post the necessary XML changes we need to add this new -async option?
Reply With Quote
  #124  
Old 07-22-2004, 07:02 AM
Bubster's Avatar
Bubster Bubster is offline
Sage Advanced User
 
Join Date: Feb 2004
Location: Glasgow, UK
Posts: 114
Meant to say, the async flag needs a value after it, so the command line I used had "-async 1" in it.

The "1" is apparently the audio sync mode, but I have no idea what the modes are. In fact, there may only be one at the moment, but there's not much in the way of info on this that I can see.

- Neil.
Reply With Quote
  #125  
Old 07-22-2004, 07:35 AM
Alex0230 Alex0230 is offline
Sage Advanced User
 
Join Date: Mar 2004
Location: AZ
Posts: 203
Quote:
Originally posted by mlbdude
Great work! I will try this out tonight. For the previous files that had no sound I tried them in Sage and Windows Media player.

Alex, I know you mentioned we can easily modify your application to use new command line options. Can you post the necessary XML changes we need to add this new -async option?
Refer to this post for the values:
http://forums.freytechnologies.com/f...0336#post50336

Basically in the properties.xml it will be the "EXE_COMMAND" you want to changed and also you want to "ENABLE" it. Currently it is disabled and the program has an internal "exe command" it uses.

I will make modifications to the program to make ASYNC available like @QUALITY and @SIZE were. I'll post that shortly...

But before my update:

<Exe_Command>
<Value>ffmpeg -i @INPUT @QUALITY @SIZE -deinterlace -y -f @OUTPUT_FORMAT -vcodec @VCODEC -b @VIDEO_RATE -g 300 -bf 2 -acodec @ACODEC -ab @AUDIO_RATE -async 1 @OUTPUT</Value>
<Enabled>True</Enabled>
</Exe_Command>
__________________
ECS K7VTA3 + AthlonXP2400XP+ = $70
250 GB 7200 RPM HD = $160
512 MB Kingston DDR 333 = $80
Hauppage 350 Bundle = $220
SageTv = PriceLess

Last edited by Alex0230; 07-22-2004 at 08:29 AM.
Reply With Quote
  #126  
Old 07-22-2004, 08:27 AM
Alex0230 Alex0230 is offline
Sage Advanced User
 
Join Date: Mar 2004
Location: AZ
Posts: 203
Here it is, now supporting @ASYNC and @VSYNC...

Here is the command that is internal to the program:
ffmpeg -i @INPUT @QUALITY @SIZE -deinterlace -y -f @OUTPUT_FORMAT @VSYNC -vcodec @VCODEC -b @VIDEO_RATE -g 300 -bf 2 -acodec @ACODEC -ab @AUDIO_RATE @ASYNC @OUTPUT

You should be able to manipulate this command any which way you want in the <EXE_COMMAND> section of the properties.xml. The @ symbols are dynamic properties and get there values from certain places...please reference the post above.

@ASYNC/VSYNC

These get there values from the properties.xml and by default are blank in the program. The value of @ASYNC/VSYNC is dependent upon the <FLAG></FLAG>. If the flag is blank, then the whole property is considered to be blank and nothing will be used for this property. So what this means is that you can have a flag specified and no value, but not a value and no flag....if you wish to use it.

With the ffmpeg that Bubster posted, you can change your codec in the properties.xml from "mp2" to "mp3" to encode the sound in mp3 if you wish. You have to "Enabled" that property as well if you wish to use it. By default the program uses mp2.

Edit
I forgot to post the xml this morning, I did this all just when I woke up. There are two new elements and they need to be "enabled" in order to bed used.

<ASync>
<Value>1</Value>
<Flag>-async</Flag>
<Enabled>False</Enabled>
</ASync>
<VSync>
<Value>1</Value>
<Flag>-vsync</Flag>
<Enabled>False</Enabled>
</VSync>
Attached Files
File Type: zip ffmpegprocessor_update_7_22_2004.zip (15.2 KB, 185 views)
__________________
ECS K7VTA3 + AthlonXP2400XP+ = $70
250 GB 7200 RPM HD = $160
512 MB Kingston DDR 333 = $80
Hauppage 350 Bundle = $220
SageTv = PriceLess

Last edited by Alex0230; 07-22-2004 at 10:00 AM.
Reply With Quote
  #127  
Old 07-22-2004, 12:16 PM
davey_fl davey_fl is offline
Sage Aficionado
 
Join Date: Dec 2003
Posts: 418
Where is it that you guys were losing audio? I've encoded a dozen 1 hour shows, each were recorded at 5.6GB per hour (my default recording quality) using the default setting. ffmpeg brings the file size down to 800mb, quality is fantastic and no audio drops. I'm in the process of encoding a 2hour movie. I'll post the results...
Reply With Quote
  #128  
Old 07-22-2004, 12:52 PM
Ryokurin's Avatar
Ryokurin Ryokurin is offline
Sage Aficionado
 
Join Date: May 2004
Posts: 455
Send a message via ICQ to Ryokurin Send a message via AIM to Ryokurin Send a message via Yahoo to Ryokurin
Quote:
Originally posted by davey_fl
Where is it that you guys were losing audio? I've encoded a dozen 1 hour shows, each were recorded at 5.6GB per hour (my default recording quality) using the default setting. ffmpeg brings the file size down to 800mb, quality is fantastic and no audio drops. I'm in the process of encoding a 2hour movie. I'll post the results...
im beginning to think that its an issue with the potential size of the file. 60m shows are fine, but two hour shows are not. And before its asked about if I tried other players I did it in normal WMP 9 as well as Zoomplayer..

Lets see if theres anything to do with size of the file? I had dropouts when the filesize was 1.6 gigs but didnt when the file was an 900 meg hour file. anyone else want to add?
Reply With Quote
  #129  
Old 07-22-2004, 08:20 PM
edbmdave edbmdave is offline
Sage Aficionado
 
Join Date: Apr 2004
Location: Dallas
Posts: 365
How about adding COMPRESS to the Archived Shows Menu

I would love to use COMPRESS from the Archived Shows section. That way I could archive the shows I want to keep, then target them for ultimatee archival and compress them?


Just a Thought....

I am in process of compressing a 2 hour show into MPEG4/MP3. Will report back on results. Has there been any update on allowing a 2 pass for better quality/compression yet?
Reply With Quote
  #130  
Old 07-22-2004, 09:29 PM
Alex0230 Alex0230 is offline
Sage Advanced User
 
Join Date: Mar 2004
Location: AZ
Posts: 203
I'll test out a 1 pass / 2pass conversion....if it works, then I'll integrate that ability. ACTUALLY...you "should" have that ability right now...you have have to be a little creative though. I'm hoping it would work like this...no gaurantees though...

If you have the latest version of my ffmpegProcess.class, change your <EXE_COMMAND> value to reflect the following..and all on one line:

ffmpeg -i @INPUT @QUALITY @SIZE -pass 1 -deinterlace -y -f @OUTPUT_FORMAT @VSYNC -vcodec @VCODEC -b @VIDEO_RATE -g 300 -bf 2 -acodec @ACODEC -ab @AUDIO_RATE @ASYNC @OUTPUT &amp; ffmpeg -i @INPUT @QUALITY @SIZE -pass 2 -deinterlace -y -f @OUTPUT_FORMAT @VSYNC -vcodec @VCODEC -b @VIDEO_RATE -g 300 -bf 2 -acodec @ACODEC -ab @AUDIO_RATE @ASYNC @OUTPUT

If you have the one that doesn't natively support @VSYNC and @ASYNC, then don't include those peices of the overall command. You will also have to change the "<STARTING_PROGRAM>" value to "cmd.exe /c start /wait /low /min" and enable this as well.

The most important part of the EXE_COMMAND is the & symbol, that allows you to chain the two ffmpeg commands back to back....if and only if you are running them through the "cmd.exe" as your "starting_program".

EDIT
Thinking about it....you might ahve to do this...because you might not actually be able to chain within the start command itself....I'll run this myself and test it out and let you know.

ffmpeg -i @INPUT @QUALITY @SIZE -pass 1 -deinterlace -y -f @OUTPUT_FORMAT @VSYNC -vcodec @VCODEC -b @VIDEO_RATE -g 300 -bf 2 -acodec @ACODEC -ab @AUDIO_RATE @ASYNC @OUTPUT &amp; start /wait /low /min ffmpeg -i @INPUT @QUALITY @SIZE -pass 2 -deinterlace -y -f @OUTPUT_FORMAT @VSYNC -vcodec @VCODEC -b @VIDEO_RATE -g 300 -bf 2 -acodec @ACODEC -ab @AUDIO_RATE @ASYNC @OUTPUT

ALSO!!!

This is important, but the forums keep masking it.....you can not just put '&' in the XML, because it is a special character in xml. You have to use & amp; (no space between the & and the amp;).
__________________
ECS K7VTA3 + AthlonXP2400XP+ = $70
250 GB 7200 RPM HD = $160
512 MB Kingston DDR 333 = $80
Hauppage 350 Bundle = $220
SageTv = PriceLess

Last edited by Alex0230; 07-23-2004 at 07:50 AM.
Reply With Quote
  #131  
Old 07-23-2004, 04:53 AM
mlbdude's Avatar
mlbdude mlbdude is offline
Moderator
 
Join Date: May 2003
Location: Melbourne, Florida
Posts: 4,174
Using the last build with MP3 I still get audio dropouts at around the 10 second mark .
Reply With Quote
  #132  
Old 07-23-2004, 04:56 AM
Bubster's Avatar
Bubster Bubster is offline
Sage Advanced User
 
Join Date: Feb 2004
Location: Glasgow, UK
Posts: 114
Which codecs are actually being chosen to play the file on your system?
Reply With Quote
  #133  
Old 07-23-2004, 05:11 AM
mlbdude's Avatar
mlbdude mlbdude is offline
Moderator
 
Join Date: May 2003
Location: Melbourne, Florida
Posts: 4,174
As reported by Media Player...

Audio decoder: MPEG Layer-3 Decoder

Video decoder: DivX Decoder Filter
Reply With Quote
  #134  
Old 07-23-2004, 06:01 AM
Bubster's Avatar
Bubster Bubster is offline
Sage Advanced User
 
Join Date: Feb 2004
Location: Glasgow, UK
Posts: 114
Seems fairly sensible, and identical to what I'm using here, although maybe they are different versions.

I think we'll need to take some steps to nail down where the issue is actually happening. First off, we probably need to try and eliminate encoding from the equation.

The obvious way to do this is for someone who is having problems to encode a file and send it to someone who isn't having problems, but this is slightly impractical, considering the file sizes involved.

So perhaps we can try and recreate the problem with a smaller output file, but with a large input file. If you add "-t 30" to the ffmpeg command line to limit encoding to 30 secs, and possibly even reduce the video bit rate to around 600-800, the resulting file will only be a few megs big. If the 10 second audio problem still occurs, give the file to someone who isn't getting the problem and see if it works for them.

If the 10 second problem doesn't happen with smaller output files for the original creator, this doesn't tell us a whole lot (could still be an encoding or decoding problem) but it does tell us that the output file size is a problem in some way.

If the problem still happens for the creator, but doesn't happen for someone else with the same file, this suggests a decoding problem or some file-system issue we're not aware of yet.

I don't expect the issue will be solved at this first stage, but it's a start, if someone wants to give it a go...

- Neil.
Reply With Quote
  #135  
Old 07-23-2004, 08:13 AM
Alex0230 Alex0230 is offline
Sage Advanced User
 
Join Date: Mar 2004
Location: AZ
Posts: 203
UPDATE
This doesn't work....because of the XML issue. You have to use the special & amp; symbol in the xml to make it a valid document...but when reading it in by DOM...it doesn't automatically convert it back to an & for me. This would require a code change to make it work...so till then, in theory it would work and it wouldn't be hard to make a two pass flag that would just spawn to processes one after the other. If there is interest in this...I can add that ability natively.

Quote:
Originally posted by Alex0230
I'll test out a 1 pass / 2pass conversion....if it works, then I'll integrate that ability. ACTUALLY...you "should" have that ability right now...you have have to be a little creative though. I'm hoping it would work like this...no gaurantees though...

If you have the latest version of my ffmpegProcess.class, change your <EXE_COMMAND> value to reflect the following..and all on one line:

ffmpeg -i @INPUT @QUALITY @SIZE -pass 1 -deinterlace -y -f @OUTPUT_FORMAT @VSYNC -vcodec @VCODEC -b @VIDEO_RATE -g 300 -bf 2 -acodec @ACODEC -ab @AUDIO_RATE @ASYNC @OUTPUT &amp; ffmpeg -i @INPUT @QUALITY @SIZE -pass 2 -deinterlace -y -f @OUTPUT_FORMAT @VSYNC -vcodec @VCODEC -b @VIDEO_RATE -g 300 -bf 2 -acodec @ACODEC -ab @AUDIO_RATE @ASYNC @OUTPUT

If you have the one that doesn't natively support @VSYNC and @ASYNC, then don't include those peices of the overall command. You will also have to change the "<STARTING_PROGRAM>" value to "cmd.exe /c start /wait /low /min" and enable this as well.

The most important part of the EXE_COMMAND is the & symbol, that allows you to chain the two ffmpeg commands back to back....if and only if you are running them through the "cmd.exe" as your "starting_program".

EDIT
Thinking about it....you might ahve to do this...because you might not actually be able to chain within the start command itself....I'll run this myself and test it out and let you know.

ffmpeg -i @INPUT @QUALITY @SIZE -pass 1 -deinterlace -y -f @OUTPUT_FORMAT @VSYNC -vcodec @VCODEC -b @VIDEO_RATE -g 300 -bf 2 -acodec @ACODEC -ab @AUDIO_RATE @ASYNC @OUTPUT &amp; start /wait /low /min ffmpeg -i @INPUT @QUALITY @SIZE -pass 2 -deinterlace -y -f @OUTPUT_FORMAT @VSYNC -vcodec @VCODEC -b @VIDEO_RATE -g 300 -bf 2 -acodec @ACODEC -ab @AUDIO_RATE @ASYNC @OUTPUT

ALSO!!!

This is important, but the forums keep masking it.....you can not just put '&' in the XML, because it is a special character in xml. You have to use & amp; (no space between the & and the amp;).
__________________
ECS K7VTA3 + AthlonXP2400XP+ = $70
250 GB 7200 RPM HD = $160
512 MB Kingston DDR 333 = $80
Hauppage 350 Bundle = $220
SageTv = PriceLess
Reply With Quote
  #136  
Old 07-23-2004, 08:26 AM
Bubster's Avatar
Bubster Bubster is offline
Sage Advanced User
 
Join Date: Feb 2004
Location: Glasgow, UK
Posts: 114
Quote:
Originally posted by Alex0230
UPDATE
This doesn't work....because of the XML issue. You have to use the special & amp; symbol in the xml to make it a valid document...but when reading it in by DOM...it doesn't automatically convert it back to an & for me. This would require a code change to make it work...so till then, in theory it would work and it wouldn't be hard to make a two pass flag that would just spawn to processes one after the other. If there is interest in this...I can add that ability natively.
If you need to change the code anyway, why not add the ability to specify multiple <Exe_Command>s, to be run one after the other?

This would allow people to run other processes over their videos, either before or after any compression is done, as well as allowing two passes to be done. You never know, might be handy...

- Neil.
Reply With Quote
  #137  
Old 07-23-2004, 08:32 AM
salsbst's Avatar
salsbst salsbst is offline
SageTVaholic
 
Join Date: Jun 2003
Posts: 2,592
Andy, I haven't looked at your code too deeply, but I think you should be able to get the decoded text from a node by getting the child of the Element and casting it to a Text interface.

http://java.sun.com/j2se/1.4.2/docs/.../dom/Text.html

Might be able to use that instead of the stripXml function. If this information is random and useless, please excuse me.

Regards,
Stuart

[edit: fixed url]

Last edited by salsbst; 07-23-2004 at 08:36 AM.
Reply With Quote
  #138  
Old 07-23-2004, 05:28 PM
edbmdave edbmdave is offline
Sage Aficionado
 
Join Date: Apr 2004
Location: Dallas
Posts: 365
Quote:
Originally posted by mlbdude
Using the last build with MP3 I still get audio dropouts at around the 10 second mark .
Same. Even using Windows Media Player or moving the file to a different machine. (Both my laptop and wifes computer) Same results..


Curses Batman....
Reply With Quote
  #139  
Old 07-24-2004, 01:24 AM
gbutters gbutters is offline
Sage User
 
Join Date: Jun 2004
Posts: 8
Quote:
Originally posted by mlbdude
Using the last build with MP3 I still get audio dropouts at around the 10 second mark .
It plays with sound for me in DivX Player but sound drops out after 6 seconds in Sage, WinDVD, Sonic Cineplayer and Windows Media Player. With Winamp it just keeps replaying the first 6 seconds.
Reply With Quote
  #140  
Old 07-24-2004, 03:17 AM
Bubster's Avatar
Bubster Bubster is offline
Sage Advanced User
 
Join Date: Feb 2004
Location: Glasgow, UK
Posts: 114
Do you guys fancy trying it with the "-t 30" flag I mentioned earlier and see what happens when the output file is small, but the input file is big?
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


All times are GMT -6. The time now is 05:48 PM.


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