![]() |
|
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. |
![]() |
|
Thread Tools | Search this Thread | Display Modes |
#121
|
||||
|
||||
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! ![]() |
#122
|
||||
|
||||
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. |
#123
|
||||
|
||||
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? |
#124
|
||||
|
||||
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. |
#125
|
|||
|
|||
Quote:
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. |
#126
|
|||
|
|||
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. ![]() <ASync> <Value>1</Value> <Flag>-async</Flag> <Enabled>False</Enabled> </ASync> <VSync> <Value>1</Value> <Flag>-vsync</Flag> <Enabled>False</Enabled> </VSync>
__________________
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. |
#127
|
|||
|
|||
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...
|
#128
|
||||
|
||||
Quote:
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? |
#129
|
|||
|
|||
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? |
#130
|
|||
|
|||
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.
![]() 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 & 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 & 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. |
#131
|
||||
|
||||
Using the last build with MP3 I still get audio dropouts at around the 10 second mark
![]() |
#132
|
||||
|
||||
Which codecs are actually being chosen to play the file on your system?
|
#133
|
||||
|
||||
As reported by Media Player...
Audio decoder: MPEG Layer-3 Decoder Video decoder: DivX Decoder Filter |
#134
|
||||
|
||||
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. |
#135
|
|||
|
|||
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:
__________________
ECS K7VTA3 + AthlonXP2400XP+ = $70 250 GB 7200 RPM HD = $160 512 MB Kingston DDR 333 = $80 Hauppage 350 Bundle = $220 SageTv = PriceLess |
#136
|
||||
|
||||
Quote:
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. |
#137
|
||||
|
||||
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. |
#138
|
|||
|
|||
Quote:
Curses Batman.... |
#139
|
|||
|
|||
Quote:
|
#140
|
||||
|
||||
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?
|
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|