PDA

View Full Version : Cmd Line MPEG4 Encoder - ffmpeg


Pages : [1] 2

mlbdude
06-27-2004, 10:51 AM
Anyone know of a good DivX encoder that either has an API or good command line options?

I am looking into doing some kind of re-compression that integrates into the Sage UI. I have done a little looking and don't see anything good.

If I can't find something as good as the current tools out there to do it manually, I probably won't bother :(.

There must be something :).

nielm
06-27-2004, 12:16 PM
I was (unpleasantly) surprised about how few 'decent' avi encoders there are... This coupled with how few 'decent' VFW mpeg2 decoders makes mpeg2->avi quite a pain...

The fastest I have found so far seems to be the Gknot solution of Mpg(video)->DGindex->d2V->GKnot/AviSynth->VirtualDubMod; together with Mpg(audio)->BeSweet->mp3; for audio, and then in VirtualDubMode.

VirtualDubMod does read mpeg2 video, and seems to be scriptable, but cannot recode the mpeg2 audio stream, and it's video decompresser seems to be very slow, incomparison with the Gknot solution...

I have not actually tried AutoGK (http://www.autogk.net/web/) yet, maybe this is more suitable, but it appeared to be only for DVD->DivX than MPEG2->DivX : and AutoGK FAQ says no CLI mode, ever!...

In any case, the www.Doom9.org forums are full of information like this, and thir Download page (http://www.doom9.org/software.htm) seems to have every video software ever imagened!

thatdude90210
06-27-2004, 12:43 PM
I've used AutoGK, it's very nice. It's easy to use and the results are fantastic. The only thing I have to set is 350MB for a 1 hour show, and 512pixel width, and the results look almost as good on tv as the original mpeg.

But right now, AutoGK seems to only accept input from folders that looks like ripped dvd stucture. So usually I just use TMPGenc dvd author to edit out commercials and author to a folder, then use AutoGK. I started doing it this way because the first time I tried Gknot, it just looked too confusing.

cgrey
06-27-2004, 04:06 PM
Originally posted by thatdude90210
I've used AutoGK, it's very nice. It's easy to use and the results are fantastic. The only thing I have to set is 350MB for a 1 hour show, and 512pixel width, and the results look almost as good on tv as the original mpeg.

But right now, AutoGK seems to only accept input from folders that looks like ripped dvd stucture. So usually I just use TMPGenc dvd author to edit out commercials and author to a folder, then use AutoGK. I started doing it this way because the first time I tried Gknot, it just looked too confusing.

I don't want to take this too far off-topic, since no matter what, AutoGK is still not a command-line solution - but, the current (1.35b) version does support MPG file input, you just need to enable it (check the FAQ - I think it's CTRL-F12).

thatdude90210
06-27-2004, 04:49 PM
Originally posted by cgrey
I don't want to take this too far off-topic, since no matter what, AutoGK is still not a command-line solution - but, the current (1.35b) version does support MPG file input, you just need to enable it (check the FAQ - I think it's CTRL-F12).
Thanks for the heads-up, I just checked my version and I'm way behind with v1.23b, heh. Looks like they have 1.42beta out now.

mlbdude
06-28-2004, 06:00 AM
At this point I can't seem to find anything good to use that even comes close to the quality of the manual tools out there. I will keep on eye on this thread for awhile, though, but I feel this project may never happen :(.

edbmdave
06-28-2004, 07:03 AM
Dr. DivX is supposed to release a new version in July that will have increased batch capablities. You might want to check with thekidd at the forums on www.divx.com. He might be willing to spill the beans to a developer working on a module for SageTV than to us commoners. But there was some hinting that CLE might be available.

dmidtbo
06-30-2004, 07:20 AM
In another thread someone suggested HGRip as a command line compressor. I havn't tried it myself, but it looks promising for integration with SageTV. It sounds similar to autoGK, but has command line options.

Other Thread (http://forums.freytechnologies.com/forums/showthread.php?s=&threadid=6063)

Here is the link:

HGRip (http://xoomer.virgilio.it/jbgenov/)

clavinniu
06-30-2004, 03:49 PM
Screw DivX. XVID has much better quality and compression and it's open source.

mlbdude
06-30-2004, 04:00 PM
I would love to use XVid too. Same questions for it as well. I don't see any decent MPEG4 cmd line tools.

I will check out HGRIp.

justme
06-30-2004, 04:04 PM
I personally prefer Xvid as well. I think the quality is better especially for anime. But you do have to admit that if you just want to do something quick and dirty then Dr Divx is good(too bad it lacks CLI ATM). Which ever(Divx/Xvid) is used the trick is getting a app that has good CLI support(read functions and documentation) and doesn't need much info from us to get going. Without that I can't see MlbDude going anyhwere with this. There's no need for him to have to re-invent GK or any of other apps of that style. I'll never understand why so many developers leave off CLI support, when it's such a usefull thing. :nono: Here's hoping HGRIp is a winner. :)

/justme

dmidtbo
06-30-2004, 05:54 PM
I just tested HGRip and I think we have a winner for 3rd party integration with Sage. It only works with XVID (not DIVX) but I like XVID better anyway.

The command line options are simple and it has a decryptor built in, unlike AutoGK which required DVDDecryptor to run separately before compression.

The command line is simple, for (ac3 audio / high quality video):

HGRip ac3high

Read the advancedoptions.txt that comes with it to see other useful command line commands.

It took about 3 hours to convert a DVD->AVI(Mpeg4/xvid) on an XP1800+. It went from 5.7gigs to 1.3gigs. Watched the movie afterwards and it looked and sounded good.

A simple batch file could move the .avi file it generates to the library after it finishes running.

One minor problem is that by default it brings up a couple small windows during processing. It should be possible to have them start minimized so they won't be in the way.

JUC
07-01-2004, 07:23 AM
Will we be able to use this to compress MPEGs recorded by Sage as well?
JUC

Crashless
07-01-2004, 11:54 AM
I was doing some digging and it seems Virtualdub has command line options.

The Scripting Doc (http://virtualdub.com/docs/vdscript.txt)

Scripted Job Creation (http://www.ericphelps.com/scripting/samples/VirtualDub/)

VirtualDubMPEG-2 Upgrade (my favorite) (http://fcchandler.home.comcast.net/stable/)

VirtualDub Forums (http://virtualdub.everwicked.com/index.php?)

I hope these help. This would be such a great feature. Let me know if you need someone to help test/develop it.

Jason
07-04-2004, 03:42 PM
FFMpeg is also out there... It is command line based as well.

FFmpeg is a complete solution to record, convert and stream audio and video. It is a command line tool to convert one video file format to another. It also supports grabbing and encoding in real time from a TV card.

http://www.videohelp.com/tools?tool=263

http://ffmpeg.sourceforge.net/

When you couple this with changing the priority of the actual program, you can eliminate most of the drag on the system...

-Jason

mlbdude
07-05-2004, 10:25 AM
Originally posted by Jason
FFMpeg is also out there... It is command line based as well.



http://www.videohelp.com/tools?tool=263

http://ffmpeg.sourceforge.net/

When you couple this with changing the priority of the actual program, you can eliminate most of the drag on the system...

-Jason

ffmpeg seems perfect. I may go with this one. Only thing is it seems to only do MPEG4 ISO and not Divx or Xvid. Not sure this is a bad thing yet as the files will work great with Sage and won't require updating codecs.

edbmdave
07-05-2004, 02:22 PM
Does anyone know what the pros / cons of using MPEG4 vs. XVID?

I really like the compression and quality I have gotten from using DIVX and XVID but have no MPEG4 experience.

Do we know if the project is actively moving and supported? It looks like the last release was 9/2003 (almost a year ago).

stanger89
07-05-2004, 02:46 PM
Originally posted by edbmdave
Does anyone know what the pros / cons of using MPEG4 vs. XVID?

I really like the compression and quality I have gotten from using DIVX and XVID but have no MPEG4 experience.

Do we know if the project is actively moving and supported? It looks like the last release was 9/2003 (almost a year ago).

DivX and XviD are variants of MPEG-4 or "MPEG-4 compatible"

from the Xvid FAQ
XviD is an ISO MPEG-4 compliant video codec. It's no product, it's an open source project which is developed and maintained by lots of people from all over the world.

from About DivX
DivX technology is compatible with the MPEG-4 video compression standard...

edbmdave
07-05-2004, 02:56 PM
Sorry, let me better qualify my question. Does anyone know what type of compression and quality are rendered by the ffmpeg product, and do we know what type of ongoing support it has?

mlbdude
07-08-2004, 09:03 AM
OK, just an update on this. I now have the UI modified with a "Compress" option in the recording details section for a recording. This will dump out an XML file to a configurable location.

The XML file contains all information needed for encoding (source path, dest path, video bit-rate, audio bit-rate, and show information).

What I had planned on doing is developing another application that a user can schedule and configure on any machine (not just the SageTV server box) that would poll this directory and process those jobs. Since the user would have to schedule this job themselves in Windows Scheduler the user could define when and how often the job would run.

The program would compress each MPEG2 to MPEG4 using ffmpeg to the destination folder plus title subdirectory. I envision the destination folder to be somewhere under the SageTV servers video library structure. The program would also output an appropriate .my file that would contain the meta data for the show (title, description) that would be visible in the SageTV video library.

Here is my immediate problem. I am out of time :). I am building a house so my free time is limited for the next month or so. Do I have any volunteers I can work with to do the compression program?

Thanks!

Alex0230
07-08-2004, 07:06 PM
I'll take a crack at it if no one else wants to, so let me get this straight:

-The UI will basically create an XML dump file that gets places in to a folder (configurable location through sage.props?).
-You want a scheduled task that will just pick up all the xml files (configurable location) and compress each mpeg2 to mpeg4 that are found in the various xml files (deletes them after processing correct?).
-The .my file comes from the scheduled task which gets it data from the xml...the format for the .my file can be found in your other thread right?

It doesn't sound too bad, and since the weekend it coming up...perfect timeing. :) I will most likely write this in java, should be fun.

One question.....this UI is based on show level right, meaning user selects the show/recording to compress (not the file)? How will a show be handled that happened be broken up in to multiple mpeg2 files? Will there be multiple sourcepaths and multiple destpaths or does ffmpeg have the ability to splice as well?

mlbdude
07-08-2004, 07:28 PM
Originally posted by Alex0230
I'll take a crack at it if no one else wants to, so let me get this straight:

-The UI will basically create an XML dump file that gets places in to a folder (configurable location through sage.props?).
-You want a scheduled task that will just pick up all the xml files (configurable location) and compress each mpeg2 to mpeg4 that are found in the various xml files (deletes them after processing correct?).
-The .my file comes from the scheduled task which gets it data from the xml...the format for the .my file can be found in your other thread right?

It doesn't sound too bad, and since the weekend it coming up...perfect timeing. :) I will most likely write this in java, should be fun.

One question.....this UI is based on show level right, meaning user selects the show/recording to compress (not the file)? How will a show be handled that happened be broken up in to multiple mpeg2 files? Will there be multiple sourcepaths and multiple destpaths or does ffmpeg have the ability to splice as well?

Here is the XML format:

<?xml version="1.0" encoding="ISO-8859-1" ?>
<Airing>
<Title>Stephen King's Kingdom Hospital</Title>
<Episode>Seizure Day</Episode>
<Description>After having seizures, two patients begin to have visions of the living dead haunting the hospital.</Description>
<ActualStartTime>1088730000000</ActualStartTime>
<StartDate>Jul 1, 2004</StartDate>
<StartTime>9:00:00 PM</StartTime>
<EndTime>10:01:00 PM</EndTime>
<File>W:\SageTV\StephenKingsKingdomHospitalSeizureDay-2037013-0.mpg</File>
<TargetRoot>m:\Compressed</TargetRoot>
<VideoBitrate>1800</VideoBitrate>
<AudioBitrate>192</AudioBitrate>
<DeleteWhenComplete>true</DeleteWHenComplete>
<FirstRun>true</FirstRun>
<Favorite>true</Favorite>
<Manual>false</Manual>
<Watched>false</Watched>
</Airing>

Here is the current .my format:

title=Stephen Kinds Kingdom Hospital::Seizure Day
overview=After having seizures, two patients begin to have visions of the living dead haunting the hospital.
released=Jul 1, 2004 9:00:00 PM

Here is a ffmpeg cmd line: (the video and audio bitrates match the XML above)

ffmpeg -i W:\SageTV\StephenKingsKingdomHospitalSeizureDay-2037013-0.mpg -deinterlace -y -f avi -vcodec mpeg4 -b 1800 -g 300 -bf 2 -acodec mp2 -ab 192 m:\compressed\Stephen Kings Kingdom Hospital\StephenKingsKingdomHospitalSeizureDay-2037013-0.avi

<DeleteWhenComplete>true</DeleteWHenComplete> will tell the compressor if it can delete the source when it is complete or not.

No solution for the multi-part files. I was thinking of generating an error dialog in Sage if a user tries to compress one of them. Generally it is hard to get one of those anyway.

It would be nice if the compressor allowed the user to select the priority of the ffmpeg jobs as well. By default though they should all be IDLE or Low just in case this is run on a SageTV machine.

It should also be assumed, that just like a network encoder, the machine doing the compressing needs to have drive letters matching what is on the SageTV server.

Deadbolt
07-08-2004, 07:34 PM
One big benefit to DivX is the higer level of support right now...like in the MediaMVP, pocket video players, etc.

mlbdude
07-08-2004, 07:36 PM
The nice thing about this method though is that if there is ever a DivX or Xvid command line tool or API a new compressor can be created for it and nothing needs to change in Sage.

Heck, someone could write one for WMV too if they did not use Sage for watching them.

I would assume any ISO MPEG4 files ffmepg genrates will be compatible with any DivX or Xvid player.

Alex0230
07-08-2004, 09:55 PM
btw did you or has anyone gone through and try to get ffmpeg running? GOODNESS!! I'm trying to build an ffmpeg installer so no one has to go through what I'm going through... : ) If anyone has already done so....I'd appreciate them posting it. Basically you have to compile the source, but you gotta download like 4 different packages first. : )

Jason
07-08-2004, 10:52 PM
Originally posted by Alex0230
btw did you or has anyone gone through and try to get ffmpeg running? GOODNESS!! I'm trying to build an ffmpeg installer so no one has to go through what I'm going through... : ) If anyone has already done so....I'd appreciate them posting it. Basically you have to compile the source, but you gotta download like 4 different packages first. : )

Try this link.

http://www.videohelp.com/tools?tool=263

There is a link to the pre-compiled windows version. It is based on the CVS release of 2-26 (ver 0.4.8), but it works!

-Jason

Alex0230
07-08-2004, 11:38 PM
I just ran some ffmpeg conversion comparisons, here are some results:

30min Recording on Default Quality (1GB/Hr)

1800 - 192 -- saved ~50MB
1700 (input bitrate) - 192 -- saved ~ 71MB
1300 - 192 -- saved ~150MB

Each conversion takes about 20-30 mins and runs anywhere between 60-90% CPU on my 1.6GHz Centrino. Either in Java or in the scheduler, hopefully the priority can be dropped from normal to low...if in Java, I'll allow it to be configured.

mlbdude
07-09-2004, 05:38 AM
If you can't drop the priority in Java, look into doing a a CMD line approach including:

start /wait /low ffmpeg.......

In my last testing I took a 15 minute 3.2GB/hr recording from 880MB to 248MB using 1800/192. Quality was almost the same.

JUC
07-09-2004, 08:45 AM
This will be AWESOME!!! Thanks so much for the effort :)
JUC

Alex0230
07-09-2004, 04:12 PM
Originally posted by mlbdude
If you can't drop the priority in Java, look into doing a a CMD line approach including:

start /wait /low ffmpeg.......

In my last testing I took a 15 minute 3.2GB/hr recording from 880MB to 248MB using 1800/192. Quality was almost the same.

I couldn't seem to use the start command when creating a process in java, nor in vb. I think this is because "start" is a part of the command line shell and not really an executable on your machine (atleast I couldn't find it). I have a windows api work around I'm attempting though..

I'm really closed to be finished guys...just gotta iron out some last minute things with MlbDude and I'll post RC1.

edbmdave
07-16-2004, 10:40 AM
DIVX 5.2 and DrDivx 1.05 Released


http://www.divx.com

mlbdude
07-16-2004, 11:08 AM
We are going into private beta testing with this feature using ffmpeg any moment. This feature will work similar to how I did the Weather menu in that other external encoders could be created if someone finds a better encoder or has the knowhow to write one directly for DivX or XVid.

We are having a couple of issues with ffmpeg though that may stall the entire project. This may be my last Sage project for awhile though so I want to do it as best as possible :).

Ryokurin
07-16-2004, 03:13 PM
Originally posted by edbmdave
DIVX 5.2 and DrDivx 1.05 Released


http://www.divx.com

Did you notice how in the readme they claim that you can now encode using the fastest setting in real time and it equals the same quality as standard? I kind of find it hard to believe. will be nice if so however.

Ryokurin
07-16-2004, 03:24 PM
Originally posted by edbmdave
Does anyone know what the pros / cons of using MPEG4 vs. XVID?

Do we know if the project is actively moving and supported? It looks like the last release was 9/2003 (almost a year ago).

http://forum.doom9.org/showthread.php?threadid=79469 ffmpeg is still being worked on however the builds are similar to ffdshow in that they dont put them on sourceforge. In fact I think you have to build this on your own.

mlbdude
07-18-2004, 08:39 AM
Howdy all,

Alex and I are ready to start to get this project tested out on a few other machines. We are seeing some issues that are hard to reproduce so we would like a larger test group.

Known possible issues:
ffmpeg may not work well with large files. I notice audio cuts out after a few seconds. Might need some ffmpeg experts to help with this one.

Spawned ffdshow sessions may not be started in Idle priority.

Some Favorites are not being captured for auto-re-compress.

Source being deleted even though I have not requested it to.

Audio bitrate is not being set in STV (this is fixed for next release).


Part 1:

Here is how the STV works...

The user will specify a compression job dump folder. This folder will collect all XML job requests.

The user will specify a compression root folder. This folder should be under the users Library path somewhere. All compressed shows will go under this folder with another sub-folder matching its title. A .my file will be auto created for each job.

For a manual compress request, a user will simply hit the Compress button in the Recording Details menu. The user can also cancel this request if it has not started already.

A Favorite has a new Advanced setting. Under there you will see "Auto Compress". Set this to enabled to flag this Favorite for auto compression. When this is set, a new folder under the compression job folder that matched the description of the Favorite. Verify that this happens. At some point I will also store Favorite specific compression settings in this folder as well.

Whenever the RecordingScheduleChanged hook gets called Sage will look at your recent recordings and see if a matching folder exists under the Job folder. If it does, an XML compression job is created for that recording. Verify that this happens.

Compression options can be configured in Detailed Setup\Enhancements\Compress Options. They are limited right now but should get the job done.

STV:
http://download.sage.tv/~mlbdude/MlbDude2_Beta.zip

Part 2:

External compression program.

Alex has gone ahead and developed a nice program that will process these jobs using ffmpeg (the only command line tool we could find).

The install this program unzip it to the computer you want to handle the compression process. I use a client PC, but if the Idle issue is corrected you should be able to run it fine on the SageTV Server.
You can install this on multiple computers if you want all polling the same job folder for a more distributed setup.

To configure the compression program the following files must be updated for your setup.

ffmpeg_convert.properties - make sure the path to Java.exe is correct (or if it is in your path it should be fine)

There is one other property you need to modify that is in a file with the compressor. Modify the file properties.xml.

Configure the property:

<Pickup_Location>m:\compress_jobs</Pickup_Location>

P.S. The pickup job makes a log file in its directory called ffmpegPickup.log. Might be useful for debugging :).

You can either run this manually at some time after some jobs are created, or you can do as I did and schedule it to run at some point overnight.

NOTE: The machine running this program must be able to see the SageTV MPEG files the same way Sage does. Just like SageRecorder, if on the Sage server a file is created at w:\sage\file.mpg this program will look for it at w:\sage\file.mpg.
So make sure you setup the machine accordingly.

http://download.sage.tv/~mlbdude/ffmpeg_pickup.zip

edbmdave
07-18-2004, 10:08 AM
How does the FFMPEG job know where to look for files to process, does it check the Sage.Properties or the SageClient.Properties files?


I installed and can use the UI fine. The XML is created correctly in the Dump Job Folder. I can't tell that the Pickup job is running. I have manually invoked it and don't see anything. Java is in my path, and i also put the full path in the .properties file.

PS. Once you get this going, how about a folder for favorites that then breaks down into the episodes . .. IE. Simpons as a folder then all the Simpsons episode are under that?

mlbdude
07-18-2004, 11:12 AM
Sorry, there is one other property you need to modify that is in a file with the compressor. Modify the file properties.xml.

Configure the property:

<Pickup_Location>m:\compress_jobs</Pickup_Location>

P.S. The pickup job makes a log file in its directory called ffmpegPickup.log. Might be useful for debugging :).

edbmdave
07-18-2004, 11:16 AM
With my limited Java skills (none) I can't reverse engineer enough of this to figure out why it isn't working. The STV portions appear to work fine. I can't get the ffmpeg_compress.exe to do anything. Again java is in my path,and I tried it by modifing the ffmpeg_convert.properties file (below)

C:\Program Files\Frey Technologies\SageTV\Convert>type ffmpeg_convert.properties

Java_Executable_Path=C:\Program Files\Java\j2re1.4.2_04\bin\java.exe
Class_path_to_use=.
Class_to_run=ffmpegPickup
Args_if_any=
Java_run_minimized_no_focus=true
Extern_run_minimized_no_focus=true


I have attached the .xml file created in the drop directory.
(in zip)

What am I not doing or doing wrong?

mlbdude
07-18-2004, 11:18 AM
Your post is long so you may have been typing it when I posted above. If that still does not work, post your ffmpegPickup log file here.

Thanks for testing!

edbmdave
07-18-2004, 11:21 AM
You were dead on. We cross posted. It looks like it is chugging away. Will report on the results.

mlbdude
07-18-2004, 04:18 PM
Warning: This STV may cause shows that are recorded to be deleted right away and NOT added to your Sage Recordings list. I noticed this over the last couple of days. Can't find a patten for it yet nor can I confirm it is something with the STV but It seems to be new behavior.

Alex0230
07-18-2004, 09:39 PM
Originally posted by mlbdude
Warning: This STV may cause shows that are recorded to be deleted right away and NOT added to your Sage Recordings list. I noticed this over the last couple of days. Can't find a patten for it yet nor can I confirm it is something with the STV but It seems to be new behavior.

I have yet to experience this but I can not confirm nor deny my poor programming skillz... :( If you absolutely want to overried the delete, you should be able to in the properties.xml file.

<Delete_Source_On_Success>
<Value>False</Value>
<Enabled>True</Enabled>
</Delete_Source_On_Success>

Enabling the individual properties will allow you to override what's in the recording's xml file.

MlbDude...do you have all your shows set to delete from source or just some? Maybe I coded a condition wrong....I'll check it out.

JUC
07-19-2004, 05:03 AM
mlbdude, you mentioned we need to configure the properties.xml file.

"<Pickup_Location>m:\compress_jobs</Pickup_Location>"

-what exactly to we need to configure in this line...the drive letter or pickup_location (is this the root directory or something else)

sorry this is a really bad question but I would love to try this new feature out. I'm not all too familiar with XML but I should be able to edit the file if I can find out what to change.
Thanks for both your efforts,

JUC

mlbdude
07-19-2004, 06:12 AM
Originally posted by Alex0230
I have yet to experience this but I can not confirm nor deny my poor programming skillz... :( If you absolutely want to overried the delete, you should be able to in the properties.xml file.

<Delete_Source_On_Success>
<Value>False</Value>
<Enabled>True</Enabled>
</Delete_Source_On_Success>

Enabling the individual properties will allow you to override what's in the recording's xml file.

MlbDude...do you have all your shows set to delete from source or just some? Maybe I coded a condition wrong....I'll check it out.

I think this has to do with the STV. But I am not sure. For some reason, a couple of shows that were recording (I saw them) were gone the next day. However, these were shows that were NOT setup for compression. It could just be a coincidence but that has never happened to me before.

mlbdude
07-19-2004, 06:14 AM
Originally posted by JUC
mlbdude, you mentioned we need to configure the properties.xml file.

"<Pickup_Location>m:\compress_jobs</Pickup_Location>"

-what exactly to we need to configure in this line...the drive letter or pickup_location (is this the root directory or something else)

sorry this is a really bad question but I would love to try this new feature out. I'm not all too familiar with XML but I should be able to edit the file if I can find out what to change.
Thanks for both your efforts,

JUC

That should match the location you setup Sage to use as the dump location for the XML jobs. I think I forgot to list the two sage.properties that you use for this (it defaults to something). If someone can post them I would appreciate it. If not I will do it when I get home.

One for Job dump location, the other for compressed target root.

JUC
07-19-2004, 06:31 AM
Also, If someone can post an example of what their configured pickup location line to that would help me out alot. As mentioned previously I know very little about XML and don't know whether to include the <>'s and _'s (I'm thinking the _'s are for spaces).

-lets try an example. If my dump location is M:\Videos\SageCompress
would I enter
"<M:\Videos\SageCompress>m:\compress_jobs</M:\videos\sagecompress>"

-Thanks, I don't expect a tutorial on XML but any help would be appreciated. This feature will finish out my needs and requests for Sage and I would LOVE to get it going.
JUC

edbmdave
07-19-2004, 06:39 AM
Originally posted by JUC
Also, If someone can post an example of what their configured pickup location line to that would help me out alot. As mentioned previously I know very little about XML and don't know whether to include the <>'s and _'s (I'm thinking the _'s are for spaces).

-lets try an example. If my dump location is M:\Videos\SageCompress
would I enter
"<M:\Videos\SageCompress>m:\compress_jobs</M:\videos\sagecompress>"

-Thanks, I don't expect a tutorial on XML but any help would be appreciated. This feature will finish out my needs and requests for Sage and I would LOVE to get it going.
JUC


The correct way would be:
"<Pickup_Location>m:\videos\sagecompress</Pickup_Location>"

JUC
07-19-2004, 06:44 AM
Ah...wonderful. Thanks a bunch!!
JUC

edbmdave
07-19-2004, 06:44 AM
MlbDude: I have not seen any errant deletions you warned about. So far everything is working as I would expect.

I am a little disappointed with the compression ratio. (This perhaps is from my expectations based on DivX). I am seeing about a 50% reduction in size. Is there some way to better this? Will we be able to choose MP3 for the Audio? It would seem there would be some additional size savings there.. But all that aside all is working as I would expect it. I am going to configure a couple favorites to use the autocompression and deletion when done. Will report back on that.

mlbdude
07-19-2004, 06:47 AM
Originally posted by edbmdave
MlbDude: I have not seen any errant deletions you warned about. So far everything is working as I would expect.

I am a little disappointed with the compression ratio. (This perhaps is from my expectations based on DivX). I am seeing about a 50% reduction in size. Is there some way to better this? Will we be able to choose MP3 for the Audio? It would seem there would be some additional size savings there.. But all that aside all is working as I would expect it. I am going to configure a couple favorites to use the autocompression and deletion when done. Will report back on that.

I have found I still get good results by dropping my bit-rate to 1200 and audio to 128. MP3 with ffmpeg requires some additional configuration that we want to avoid for now, but you would be surprised how small those MP2 audio parts are.

There is a bug that won't let you change the audio bitrate but try setting the video bitrate lower.

I am hoping the deletions are just a coincidence, but I wanted to warn you all just in case :).

gbutters
07-19-2004, 07:24 AM
Originally posted by Alex0230
I couldn't seem to use the start command when creating a process in java, nor in vb. I think this is because "start" is a part of the command line shell and not really an executable on your machine (atleast I couldn't find it). I have a windows api work around I'm attempting though..

I'm really closed to be finished guys...just gotta iron out some last minute things with MlbDude and I'll post RC1.

See this article for using the start command.

http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html

Alex0230
07-19-2004, 07:42 AM
Originally posted by gbutters
See this article for using the start command.

http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html

I'll look in to that...that makes send to pass command line args in to it. : ) I just didn't think about it, I should actually give you guys more control over that too.

Ryokurin
07-19-2004, 08:38 AM
Ok, I have the STV installed and I know its the correct one as it has the compression options I also have ffmpeg_convert in the sage tv folder. I went and changed the convert.properties file to point to java at 'C:\program files\java\j2re1.4.2_of\bin\java.exe' with everything else in it not touched. The Pickup location in properties.xml has been set to E:\

However im not seeing where you can set the location for where the STV will create the xml job or even the auto compress option. Also if I try to run ffmpeg_convert manually you see the program enter the taskbar for a second then it just exits. What exactly am I doing wrong?

Alex0230
07-19-2004, 10:11 AM
I've added a new flag to the properties.xml along with a new var to the code:

//default value is the original program
String starting_program = "ffmpeg_convert.exe";

Add to the properties.xml the following element above the </properties> tag for example:

<Starting_Program>
<Value>cmd.exe /c start /wait /low</Value>
<Enabled>True</Enabled>
</Starting_Program>
</properties>

If enabled is True, then the program will use whatever is in <Value> in place of "starting_program = "ffmpeg_convert.exe";". Otherwise, the program will default to what is currently being used.... :)

The start command sets the priority better than my api attempt does in ffmpeg_pickup. You have to use "cmd.exe /c" to get to the command prompt from java and then you can use the "start /wait /low" command. It is VERY IMPORTANT that you use the /wait command as right now the program waits for the process to finish before going on to the next recording to compress.

I'm attaching a new version of the ffmpegProcess.class as well as the source and a sample of my properties.xml.

BTW: Here are the formats available for ffmpeg:

Output audio/video file formats:
mpeg vcd vob mpegts crc image imagepipe ac3 h263 m4v h264 mpeg1video mjpeg s16le s16be u16le u16be s8 u8 mulaw alaw rawvideo null mp2 rm asf asf_stream avi wav swf au gif mov 3gp mp4 mpjpeg singlejpeg dv flvyuv4mpegpipe nut

Input audio/video file formats: mpeg mpegts image imagepipe ac3 h263 m4v h264 mpegvideo mjpeg s16le s16be u16le u16be s8 u8 mulaw alaw rawvideo mp3 rm asf avi wav swf au gif mov dv 4xm flv psxstr RoQ ipmovie wc3movie yuv4mpegpipe nut

Output image formats: pbm pgm ppm pam pgmyuv yuv jpeg gif
Input image formats: pnm pam pgmyuv yuv jpeg gif

Codecs:
Encoders:
ac3 mp2 mpeg1video mpeg2video h263 h263p flv rv10 mpeg4 msmpeg4v1 msmpeg4v2 msmpeg4 wmv1 wmv2 mjpeg ljpeg huffyuv asv1 asv2 ffv1 rawvideo pcm_s16le pcm_s16be pcm_u16le pcm_u16be pcm_s8 pcm_u8 pcm_alaw pcm_mulaw adpcm_ima_qt adpcm_ima_wav adpcm_ima_dk3 adpcm_ima_dk4 adpcm_ms adpcm_4xm

Decoders:
rawvideo h263 mpeg4 msmpeg4v1 msmpeg4v2 msmpeg4 wmv1 wmv2 h263i flv rv10 svq1 svq3 wmav1 wmav2 indeo3 mpeg1video mpeg2video dvvideo dvaudio mjpeg mj
pegb mp2 mp3 mace3 mace6 huffyuv ffv1 cyuv h264 vp3 asv1 asv2 vcr1 cljr 4xm mdec roqvideo interplayvideo xan_wc3 real_144 real_288 roq_dpcm interplay_dpcm xan_d
pcm pcm_s16le pcm_s16be pcm_u16le pcm_u16be pcm_s8 pcm_u8 pcm_alaw pcm_mulaw adp cm_ima_qt adpcm_ima_wav adpcm_ima_dk3 adpcm_ima_dk4 adpcm_ms adpcm_4xm

Supported file protocols: file: pipe:

Frame size, frame rate abbreviations: ntsc pal qntsc qpal sntsc spal film ntsc-film sqcif qcif cif 4cif

Motion estimation methods: zero(fastest) full(slowest) log phods epzs(default) x1
--------------------

Also thanks again to gbutters for the "cmd.exe" in java information... :goodjob:

Edit
Updated files 7/19/2004 10:55AM (-7 GMT)

JUC
07-19-2004, 10:59 AM
okay, I am having trouble getting the compression to start. Sage outputs a valid XML file for me to where I set the dump file c:\ . I edited the properties.xml file to note that c:\ is where it will pickup. Java is also directed into the right place. I edited sages properties and specified the root folder as well. I tell sage to compress, it outputs the xml file but then nothing happens. I am fairly certain it is not compressing in the background because I am getting no CPU usage either.
thanks
JUC

mlbdude
07-19-2004, 11:02 AM
Originally posted by JUC
okay, I am having trouble getting the compression to start. Sage outputs a valid XML file for me to where I set the dump file c:\ . I edited the properties.xml file to note that c:\ is where it will pickup. Java is also directed into the right place. I edited sages properties and specified the root folder as well. I tell sage to compress, it outputs the xml file but then nothing happens. I am fairly certain it is not compressing in the background because I am getting no CPU usage either.
thanks
JUC

Post your ffmpegpickup.log (located in the folder you put the compressor) file and we can troubleshoot it.

JUC
07-19-2004, 11:17 AM
I think that's the problem. There is no log. I put the compressor in the sagetv folder. My Java path is set to c:\program files\java\j2rel.4.2_04\bin\java.exe
which should be correct.
My compressor properties.xml file is copied below: Let me know if you need any more info. Thanks

<?xml version="1.0" encoding="UTF-8" ?>
- <properties>
- <!-- Use . to specify the application path
-->
<Pickup_Location>c:\</Pickup_Location>
<Pickup_File_Extension>.xml</Pickup_File_Extension>
<Create_MY_File>True</Create_MY_File>
<Activity_Log>.\activity_log.xml</Activity_Log>
- <Exe_Command>
- <!-- The @symbols are for dynamic settings
-->
- <!-- DO NOT CHANGE THE CASE OF THE SYMBOLS, ie @INPUT does not equals @input
-->
- <!--
Original Value
<Value>ffmpeg -i @INPUT -deinterlace -y -f @OUTPUT_FORMAT -vcodec @VCODEC -b @VIDEO_RATE -g 300 -bf 2 -acodec @ACODEC -ab @AUDIO_RATE @OUTPUT_FORMAT</Value>
/Original Value

-->
<Value>ffmpeg -i @INPUT -deinterlace -y -f @OUTPUT_FORMAT -vcodec @VCODEC -b @VIDEO_RATE -g 300 -bf 2 -acodec @ACODEC -ab @AUDIO_RATE @OUTPUT_FORMAT</Value>
<Enabled>False</Enabled>
</Exe_Command>
- <Output_Format>
<Value>avi</Value>
<Enabled>False</Enabled>
</Output_Format>
- <VCodec>
<Value>mpeg4</Value>
<Enabled>False</Enabled>
</VCodec>
- <ACodec>
<Value>mp2</Value>
<Enabled>False</Enabled>
</ACodec>
- <Video_Rate>
<Value>600</Value>
<Enabled>False</Enabled>
</Video_Rate>
- <Audio_Rate>
<Value>128</Value>
<Enabled>False</Enabled>
</Audio_Rate>
- <Library_Path>
<Value>.\Library</Value>
<Enabled>False</Enabled>
</Library_Path>
- <Delete_Source_On_Success>
<Value>False</Value>
<Enabled>False</Enabled>
</Delete_Source_On_Success>
- <Starting_Program>
<Value>cmd.exe /c start /wait /low</Value>
<Enabled>True</Enabled>
</Starting_Program>
</properties>

Alex0230
07-19-2004, 11:59 AM
I made the fixes here:

http://forums.freytechnologies.com/forums/showthread.php?postid=50171#post50171

There were some unhandled exceptions causing the problem....the problem really was not designed to be run from "C:\" directly or any folder that may have conflicting xml files.

I HIGHLY recommend creating a folder called "pickup" or something where you can dump the xml files too so that the program will be assured that only the proper xml files will be in that folder. This will avoid issue with a possible infinite cycle because the program rechecks for xml files that are still in the folder after each execution.

Also, if you use the favorites compression option...additional folders are created for keep track of the favorites.... This may be confusing if you visit your C: drive and see all those folders and start deleting them.

edbmdave
07-19-2004, 01:00 PM
Should we open another thread for this?

I have now encoded/compressed 8 files. and seen some blockiness when there is fast action/transitions in serveral cartoons (South Park, Sealab 2021). Are there any FFMPEG experts that can help get the quality of the compressions working? Should cartoons, fastaction/sports/, and other categories have different profiles for compression to obtain good quality?

mlbdude
07-19-2004, 01:03 PM
Any single pass MPEG4 encoding will have that. I think ffmpeg may support two pass encoding though which would help. It is just a matter of having enough bits to render the frame properly. I would not expect the quality to match the source.

Something else that will help is we will be adding output size to the configuration. If you output to something like 512x??? the bits will go farther.

JUC
07-19-2004, 02:16 PM
Hey Guys, I am having a few issues getting this going.
1. I can't change the location of the dump job or root in the sage properties file.
mlbdude/compress_job_folder=
mlbdude/compress_target_root=

If I change these to anything other than leaving it blank I can't select 'compress' in the sage recordings page. So, for now I am leaving them blank and I think they default to C:\.

2. Because of the above issue I have to manually place the XML file created into my 'pickup' folder. But, when I do this nothing happens...the compressor doesn't start.

3. So, as a result of this, I go into the ffmpeg_pickup folder and manually click on ffmpeg_convert
-this starts the process up and dos opens up. But, after about 10 seconds it stops BUT I at least get a log file. Here it is...
(BTW-don't laugh at the show being compressed--it was just a test file I recorded this morning).

Log File:
[Listing of .xml to be processed]
C:\pickup\TheNannyTheWill-349155-0.mpg.xml

================================================================
STARTED: 2004-07-19 15:59:09
[Input Directory]
E:\\My Videos\\TV\\TV
[Input Filename]
TheNannyTheWill-349155-0.mpg
[Output Directory]
\\The Nanny
[Output Filename]
TheNannyTheWill-349155-0.avi

[Video Rate]
1800kbs
[Video Codec]
mpeg4
[Audio Rate]
192kbps
[Audio Codec]
mp2

[Executing Command]
ffmpeg -i "E:\My Videos\TV\TV\TheNannyTheWill-349155-0.mpg" -deinterlace -y -f avi -vcodec mpeg4 -b 1800 -g 300 -bf 2 -acodec mp2 -ab 192 "The Nanny\TheNannyTheWill-349155-0.av_"

[Success]
The conversion process appears to have completed successfully!!
[Error]
The movie file was not actually created like anticipated, it will be attempted next time around.
COMPLETED: 2004-07-19 15:59:17



-Unfortunately, to me, it doesn't seem to give me any valuable information. So, to recap
1. How do I edit the sage.properties file to let me select the pickup and root locations. (I am trying to set 'pickup' as target job location and 'e:\my videos\tv\tv' as the root
2. When I put the XML file in the 'pickup' folder, why doesn't the ffmpeg compressor start (I can post my ffmpeg xml file again if needed-this might be the culpret)
3. Why isn't the file being compressed correctly.
Really sorry this is long.
thanks a bunch
JUC

mlbdude
07-19-2004, 02:32 PM
I looks like it is all related to not setting the properties.

mlbdude/compress_job_folder=e\:\\my videos\\jobs
mlbdude/compress_target_root=e\:\\my videos\\tv\\tv

Make sure Sage is closed when you make the edits and make sure the path's are escaped properly.

If someone has a working setup please post these lines. I will post mine when I get home.

edbmdave
07-19-2004, 02:34 PM
mlbdude/compress_job_folder=c\:\\media\\tmp\\compress
mlbdude/compress_target_root=c\:\\media\\video\\shows

These are mine.. They are working..

edbmdave
07-19-2004, 02:37 PM
Just another thought, Could we use UNCs for the paths? if so what should they look like... say I wanted my path to be

\\server\share\shows

what would the correct format be for the properties file?

JUC
07-19-2004, 03:33 PM
Got it working...its encoding as we speak. Thanks. I wasn't using the \\'s.
One more question. Is there a way to set ffmpeg to start once a xml file is placed in the pickup location? The only way I was able to start it was to manually click on the program?
thanks
JUC

mlbdude
07-19-2004, 03:42 PM
Originally posted by JUC
Got it working...its encoding as we speak. Thanks. I wasn't using the \\'s.
One more question. Is there a way to set ffmpeg to start once a xml file is placed in the pickup location? The only way I was able to start it was to manually click on the program?
thanks
JUC

I set it up in Windows Scheduler to run at midnight every night. You can set it up to run every couple of minutes if you want.

Alex0230
07-19-2004, 03:52 PM
Originally posted by mlbdude
I set it up in Windows Scheduler to run at midnight every night. You can set it up to run every couple of minutes if you want.

Just to further this: Scheduling tasks (atleast for WinXP) is available by going to "Start -> Programs -> Accessories -> System Tools -> Scheduled Tasks".

I have mine set up to run at 3am...this is when my last recording ends and it's nice to wake up the next morning and have all my shows from the previous day compressed and organized for me.

JUC
07-19-2004, 03:56 PM
Thanks. Now that I got this working I have a few more questions.
First off, I was amazed at how fast this thing compressed the files--it took only 9 minutes to compress a 474mb file down to around 250mb (this was for a 1gb/hr recording of a 1/2 hour show!!! But, the quality is only so so--at every scene change I get blocks. I will try later with some different settings. Please post if you have a good one.
Questions/issues:
1. Is there anyway to make the new file show up in the recordings page?
Right now I need to refresh and it shows up only when I go to the video library.
2. I opted not to delete the original for now. Here's the strange behavior--if I play the original from the recordings page--it is fine. It has a timestamp of 30:00 and all is good. If I play the new compressed file from my video library--it is good--right timestamp and info. But, if I play the original file from my video library--there is no info and when I start to play it it plays...but I can't FF or it will stop playing (the timestamp shows up as only 1 minute). Can anyone reproduce this? I guess it doesn't really matter if it plays fine in the recordings page and since I will probably be automatically deleting these files anyway but it seemed strange.
Thats it for now.
Thanks
JUC

mlbdude
07-19-2004, 03:56 PM
Has anyone encoded a movie or something 2 hours or longer? I loose audio after about 10 seconds when I encode my 3.2 per/hr movies. I want to know if it is just me or not :).

mlbdude
07-19-2004, 03:59 PM
1. Is there anyway to make the new file show up in the recordings page?
Not in this version of Sage.

But, if I play the original file from my video library--there is no info and when I start to play it it plays...but I can't FF or it will stop playing (the timestamp shows up as only 1 minute).
Explain this more. If you don't delete the origional you should still see the origional in Sage Recordings and the compressed one in the Video Library. You should not see the origional in the Video Library.

Is it possible you have your Library and Video directories overlapping?

Once we are confidant all is working at the level, we will look into more options to allow for a better use of the selected bitrate. For now though you can raise the bitrate to kill the blocks.

Alex0230
07-19-2004, 04:01 PM
Originally posted by edbmdave
Just another thought, Could we use UNCs for the paths? if so what should they look like... say I wanted my path to be

\\server\share\shows

what would the correct format be for the properties file?

There seemed to be an issue with UNC and using it in Java....to get around this I mapped the drives.

I'm using the File class to get at the folder and the components of the folders.

Here is a quote from getting thie fileList method:


The canonical pathname of a file that resides on some other machine and is accessed via a remote-filesystem protocol such as SMB or NFS may or may not begin with one of the roots returned by this method. If the pathname of a remote file is syntactically indistinguishable from the pathname of a local file then it will begin with one of the roots returned by this method. Thus, for example, File objects denoting the root directories of the mapped network drives of a Windows platform will be returned by this method, while File objects containing UNC pathnames will not be returned by this method.

JUC
07-19-2004, 04:02 PM
Yes, I do have them overlapping--should I not be doing this? I can't remember why I did that anyway.
JUC

mlbdude
07-19-2004, 04:04 PM
You don't want to do that :). In fact, if possible, you would want the Sage Video folders to be on their own partition. If not different root folders should get you by.

JUC
07-19-2004, 04:11 PM
Good to know. Thanks a bunch, and if you or anyone has had good luck with different settings for the compression please post.
JUC

Crashless
07-19-2004, 04:13 PM
Has anyone tried playing the FFMPEG files on a MVP?

mlbdude
07-19-2004, 04:17 PM
Originally posted by Crashless
Has anyone tried playing the FFMPEG files on a MVP?

I know the MVP does not support MPEG4 by itself, but I did hear about it coming out with some kind of real-time trans-coding back into MPEG2. Can anyone find the spec sheet on that?

edbmdave
07-19-2004, 04:18 PM
Originally posted by mlbdude
Has anyone encoded a movie or something 2 hours or longer? I loose audio after about 10 seconds when I encode my 3.2 per/hr movies. I want to know if it is just me or not :).

I did (It took about 2.5 hours to encode. I have not watched it yet, but will tonight. Will let you know if I have the audio problem.

JUC
07-19-2004, 05:20 PM
Is anyone able to watch TV through sage while compressing videos? I'm guessing probably not...hence using scheduled tasks to run at night. I just get a black screen--no lockups and I can close out of sage but... I probably won't be able to rip and encode a DVD and watch Sage either huh?
JUC

mlbdude
07-19-2004, 05:24 PM
If anyone can figure out how to do 2 pass encoding let us know. It would allow much greater quality if it work like it does in XVid or Divx. We could probably talk Alex into updating his compressor to do it :).

http://ffmpeg.sourceforge.net/ffmpeg-doc.html

mlbdude
07-19-2004, 05:26 PM
Originally posted by JUC
Is anyone able to watch TV through sage while compressing videos? I'm guessing probably not...hence using scheduled tasks to run at night. I just get a black screen--no lockups and I can close out of sage but... I probably won't be able to rip and encode a DVD and watch Sage either huh?
JUC

Make sure you are using the latest update to the compressor posted here
http://forums.sage.tv/forums/showthread.php?postid=50171#post50171
This should allow you to use Sage while it is going. However, I would still recommend having it run overnight.

cgrey
07-19-2004, 05:27 PM
Originally posted by mlbdude
If anyone can figure out how to do 2 pass encoding let us know. It would allow much greater quality if it work like it does in XVid or Divx. We could probably talk Alex into updating his compressor to do it :).

http://ffmpeg.sourceforge.net/ffmpeg-doc.html

Call it twice using the 'pass' parameter. 1 for the first pass, 2 for the second:

`-pass n'
select the pass number (1 or 2). It is useful to do two pass encoding. The statistics of the video are recorded in the first pass and the video at the exact requested bit rate is generated in the second pass.

`-passlogfile file'
select two pass log file name to file.

JUC
07-19-2004, 05:40 PM
how would that get enterred in the ffmpeg properties.XML file (if that's where its going)?
JUC

mlbdude
07-19-2004, 05:42 PM
Here is what I get when I do that....


G:\ffmpeggui02c>ffmpeg -i w:\Sagetv\AquaTeenHungerforceTheShaving-2016573-0.mpg
-pass 1 -passlogfile pass.log -hq -s 540x360 -deinterlace -y -f avi -vcodec mpeg
4 -b 1000 -g 300 -bf 2 -acodec mp2 -ab 128 test.avi
Input #0, mpeg, from 'w:\Sagetv\AquaTeenHungerforceTheShaving-2016573-0.mpg':
Duration: 00:17:59.0, bitrate: 7096 kb/s
Stream #0.0: Video: mpeg2video, 720x480, 29.97 fps, 8000 kb/s
Stream #0.1: Audio: mp2, 48000 Hz, stereo, 384 kb/s
Output #0, avi, to 'test.avi':
Stream #0.0: Video: mpeg4 (hq), 540x360, 29.97 fps, q=2-31, pass 1, 1000 kb/s
Stream #0.1: Audio: mp2, 48000 Hz, stereo, 128 kb/s
Stream mapping:
Stream #0.0 -> #0.0
Stream #0.1 -> #0.1
frame=32351 q=5.0 size= 149137kB time=1079.2 bitrate=1132.1kbits/s

G:\ffmpeggui02c>ffmpeg -i w:\Sagetv\AquaTeenHungerforceTheShaving-2016573-0.mpg
-pass 2 -passlogfile pass.log -hq -s 540x360 -deinterlace -y -f avi -vcodec mpeg
4 -b 1000 -g 300 -bf 2 -acodec mp2 -ab 128 test.avi
Input #0, mpeg, from 'w:\Sagetv\AquaTeenHungerforceTheShaving-2016573-0.mpg':
Duration: 00:17:59.0, bitrate: 7096 kb/s
Stream #0.0: Video: mpeg2video, 720x480, 29.97 fps, 8000 kb/s
Stream #0.1: Audio: mp2, 48000 Hz, stereo, 384 kb/s
Output #0, avi, to 'test.avi':
Stream #0.0: Video: mpeg4 (hq), 540x360, 29.97 fps, q=2-31, pass 2, 1000 kb/s
Stream #0.1: Audio: mp2, 48000 Hz, stereo, 128 kb/s
Stream mapping:
Stream #0.0 -> #0.0
Stream #0.1 -> #0.1
statistics are damaged at line 32349, parser out=0
Error while opening codec for stream #0.0 - maybe incorrect parameters such as b
it_rate, rate, width or height

edbmdave
07-19-2004, 06:12 PM
Originally posted by mlbdude
Has anyone encoded a movie or something 2 hours or longer? I loose audio after about 10 seconds when I encode my 3.2 per/hr movies. I want to know if it is just me or not :).


I can confirm. About 7 seconds in 120 minute movie, audio was lost.

:(

:(

edbmdave
07-19-2004, 06:18 PM
Originally posted by Alex0230
I just ran some ffmpeg conversion comparisons, here are some results:

30min Recording on Default Quality (1GB/Hr)

1800 - 192 -- saved ~50MB
1700 (input bitrate) - 192 -- saved ~ 71MB
1300 - 192 -- saved ~150MB

Each conversion takes about 20-30 mins and runs anywhere between 60-90% CPU on my 1.6GHz Centrino. Either in Java or in the scheduler, hopefully the priority can be dropped from normal to low...if in Java, I'll allow it to be configured.


Alex0230: There is a new version of FFMPEG out there 049, I don't know if you compiled the one you distributed on your own or not. If so Can you compile the 049 version and make available? It may solve the blockiness of cartoons. Since this is all testing anyway....

mlbdude
07-19-2004, 06:41 PM
Originally posted by edbmdave
I can confirm. About 7 seconds in 120 minute movie, audio was lost.

:(

:(

Well, unless we can get past this I think we are at a wall. Maybe the new beta version has this fixed. If someone can find a binary version of it or can compile it let us know and we will try.

Alex0230
07-19-2004, 06:43 PM
http://www.videohelp.com/tools?tool=263

Try this...

mlbdude
07-19-2004, 06:44 PM
Originally posted by Alex0230
http://www.videohelp.com/tools?tool=263

Try this...

Looks like only the source for .49 is there.

Alex0230
07-19-2004, 06:59 PM
Last time I don't check a link before posting it...lol... : ) I sent a binary copy of the file to mlbdude for him to post because it to too large to post on the forums.

WARNING!!! I got a lot of variable unitialized warnings compiling this, plus remember this is in an alpha release of ffmpeg. I haven't even tried it to see if it converts...I just know the program "works" when running it.

mlbdude
07-19-2004, 07:06 PM
I am testing it now. If it works I will update all the packages tomorrow. Keep your fingers crossed ;).

Ryokurin
07-19-2004, 07:45 PM
im recording something now that will be a 2hr movie if it creates the xml file at the end like I think it will it should be around a 4gig file. at least thats what I hope. I dont know if I have everything setup correctly yet.

mlbdude
07-20-2004, 04:51 AM
Originally posted by mlbdude
I am testing it now. If it works I will update all the packages tomorrow. Keep your fingers crossed ;).

Test failed. No audio at 10 second marker. Does anyone know a developer for ffmpeg?

lovingHDTV
07-20-2004, 07:05 AM
I thought Virtual Job could be run from the command line. There is a mpeg2 version of it available. Would this work instead?

http://fcchandler.home.comcast.net/stable/

Not sure if this will work, but thought I'd mention it.

Alex0230
07-20-2004, 07:29 AM
Originally posted by mlbdude
Test failed. No audio at 10 second marker. Does anyone know a developer for ffmpeg?

My test passed....I think it depends on the file size. I had a movie (Life), that is 2 hours long but it was recorded at the default quality (1GB/HR)....so it comes out to 2GB. It then compresses down to ~860MB and the sound was there throughout.

Alex0230
07-20-2004, 07:42 AM
Originally posted by lovingHDTV
I thought Virtual Job could be run from the command line. There is a mpeg2 version of it available. Would this work instead?

http://fcchandler.home.comcast.net/stable/

Not sure if this will work, but thought I'd mention it.

good news is....to try this should not require a code change, only properties.xml. :D

If you're going to try this, change the "EXE_COMMAND" in the properties.xml and also enable it. All the following values come from the recording's xml and most can be set to override the recordigns xml in the properties.xml by setting a value and "enabling" the property:

@INPUT -- refers to the input file name
@AUDIO_RATE -- refers to the audio rate (128/192/etc)
@VIDEO_RATE -- refers to the video rate (1700/700/etc)
@OUTPUT_FORMAT -- refers to what format you'd like to compress to, it also dictates the output extension (avi/rm/etc)
@OUTPUT -- refers to the output file (this is generated by the program)
@VCODEC -- refers to the video codec to use (mpeg4/etc)
@ACODEC -- refers to the audio codec to use (mp2/etc)
@QUALITY -- refers to the quality flag (-hq/etc)
@SIZE -- refers to the flag + size (640x480/etc) == "-s 640x480"

For quality and size, if they are left blank, there are no defaults so they will not be included as part of the command line. If there is a size given, the default flag in the program is "-s"...this can be overwritten in the properties.xml.

These '@' values allows you to specify your own command line in the program and rearrange the position of the parameters that come in.

I won't be able to try out Virtual Job for another 12 hours or so, but I thought I'd pass on the info on how to try it out.

mlbdude
07-20-2004, 07:53 AM
Virtual Dub from what I know does not support command line operation. However, I think it does support some kind of scripting language. If someone can write us some of those scripts that we can use that would be great. It needs to run completely silent and the scripts need to be runnable from the command line.

RedCoat999
07-20-2004, 08:20 AM
There is a post on their forum about Command Line Options HERE (http://virtualdub.everwicked.com/index.php?act=ST&f=4&t=5610&hl=command,and,line,and,options&) . Hopefully this link works. Just search for "command AND line AND options" and select ALL DATES.

Jason
07-20-2004, 08:24 AM
Originally posted by mlbdude
Virtual Dub from what I know does not support command line operation. However, I think it does support some kind of scripting language. If someone can write us some of those scripts that we can use that would be great. It needs to run completely silent and the scripts need to be runnable from the command line.

These pages may be helpful.

http://virtualdub.everwicked.com/index.php?act=ST&f=5&t=6114&hl=&

http://virtualdub.everwicked.com/index.php?act=ST&f=16&t=6966&hl=script+file&

http://dubman.sourceforge.net/

and maybe...

http://virtualdub.everwicked.com/index.php?act=ST&f=4&t=6589&hl=scriptfile&

-Jason

mikejaner
07-20-2004, 08:27 AM
Virtualdub is a very good program. I would suggest doing the encoding with Virtualdub.

mlbdude
07-20-2004, 08:54 AM
Well if someone can come up with some Virtual Dub scripts that work and that Alex can manipulate dynamically then we might be able to get him to redo his program.

edbmdave
07-20-2004, 09:25 AM
Virtual Dub would be AWESOME. We could then use either / both DIVX and XVID based on personal preferences....


:jump: :jump:

Alex0230
07-20-2004, 12:01 PM
If someone came up with a skeleton for a vdub script with the data we currently have access to...I could enable a flag in the props file that would create these scripts and use vdub for the compression instead of ffmpeg.

That shouldn't be too hard to do, the hardest part, like mlbdude said, would be to come up with the scripts in the first place.

Ryokurin
07-20-2004, 01:16 PM
Originally posted by mlbdude
Has anyone encoded a movie or something 2 hours or longer? I loose audio after about 10 seconds when I encode my 3.2 per/hr movies. I want to know if it is just me or not :).

Confirmed. The file I had was a 4.1 gig file. Dropped out after 10 seconds. For those wondering the size otherwise however, it was a 1.6 gig file.

justme
07-20-2004, 01:29 PM
This audio issue can't be common to ffmpeg, without going un-noticed.:bang: Did all the people who get the audio error get their ffmpeg.exe build from the same source(place not code). I just wondering if it's an error in the compiled exe being used. I remember the file size numbers correctly it seems like going over 2GB causes audio issues, and if true 2GB can't be a coincidence. I've seen errors like that pop up in other ealry ports of Linux based apps.
I can't believe we don't have at least one Doom9/MP4 "expert" in our SageTV community.(This was not meant, in any way, to put down the great work done so far. Thanks guys.:))

/justme

mlbdude
07-20-2004, 01:59 PM
I have tried two builds each a different version myself. I would agree it should have been something noticed though. I would like to see if someone can get a version of ffmpeg put together that supports MP3 audio instead of MP2. That might help.

edbmdave
07-20-2004, 02:27 PM
Actually I had the same thought. Given that they (FFMPEG) are using the LAME encoder and I have been using it successfully for years. I would think that a good test as well. (I wish I new enough to compile this stuff... or even had a compiler to try...)

mlbdude
07-20-2004, 02:34 PM
In case anyone is interested, here is a feature comparison between the different MPEG4 variants. Surprisingly ffmpeg holds up well. If only we could figure out how to use it better :)

http://www.mplayerhq.hu/%7Emichael/codec-features.html

Alex0230
07-20-2004, 02:35 PM
You can make your own compiler for ffmpeg.....you have to download MSYS and install it. Then within there you can do it, it's pretty much like a linux shell. I would recommend copying the source into the msys directory for each directory access. Then you just "./configure" and then "make"...and the executable is made. The instructions are on the ffmpeg site.

edbmdave
07-20-2004, 04:15 PM
I won't be able to give this a try until tomorrow (travelling today) but will try tomorrow...

JUC
07-20-2004, 06:14 PM
Hey All, I am trying to add the lines in the properties.xml file to lower the priority ffmpeg. I added the lines:

<Starting_Program>
<Value>cmd.exe/c start /wait /low</Value>
<Enabled>True</Enabled>
</Starting_Program>
</properties>

I am using Open XML editor and when I go to save it gives me this error:
[Fatal Error] properties.xml[5:3-12]: End-tag without Start-Tag

-I assume this has to to with the last </properties> entry but I don't know why. Any help?
thanks
JUC

Alex0230
07-20-2004, 07:45 PM
I only gave </properties> in the example to show that it needs to be above </properties> for those who do not understand xml that well.

This is the actual data you want to add only:

<Starting_Program>
<Value>cmd.exe/c start /wait /low</Value>
<Enabled>True</Enabled>
</Starting_Program>

Sorry for the confusion....in my properties xml, all the elements are sub elements of the big element <properties></properties>. So everything to add to the xml file needs to be between these tags.

JUC
07-20-2004, 08:50 PM
Thanks, I was just putting it above the <properties> rather than between them
saves fine now.

gbutters
07-21-2004, 04:33 AM
Originally posted by Alex0230
I only gave </properties> in the example to show that it needs to be above </properties> for those who do not understand xml that well.

This is the actual data you want to add only:

<Starting_Program>
<Value>cmd.exe/c start /wait /low</Value>
<Enabled>True</Enabled>
</Starting_Program>

Sorry for the confusion....in my properties xml, all the elements are sub elements of the big element <properties></properties>. So everything to add to the xml file needs to be between these tags.

You need to add /min for it to start hidden. Like this

<Starting_Program>
<Value>cmd.exe /c start /wait /low /min</Value>
<Enabled>True</Enabled>
</Starting_Program>

justme
07-21-2004, 11:18 AM
Anyone built a ffmpeg.exe with MP3/lame support yet? I'm also curious to see if mp3 audio would have the drop out issue on large files like the mp2 appears. I don't have the skills(or even access ATM) to build a exe from source. But here's a quick quote from the ffmpeg doc site.Also the audio stream is MP3 encoded so you need LAME support which is enabled using --enable-mp3lame when configuring. The mapping is particularly useful for DVD transcoding to get the desired audio language.

If building a ffmpeg.exe with mp3/lame support is an issue... What if we just processed the original mpg's audio stream with lame and then muxed in the video from ffmpeg(having ffmpeg process the stream video only).? I realize this is not as neat, so native mp3 encoding in ffmpeg would be best.

Also has anyone tried using the copy* stream command(for audio) on one of the files that's had audio droput issues. I believe that this would supposedly just copy the mp2 audio stream untouched. I haven't had a chance to actually try the Sage STv compressor, so I don't know exactly which params you're doing, if any to the audio. I'm just going by some of the docs I've read online. I'm no expert at this so sorry if any of these ideas are pointless or stupid.

* -acodec copy

davey_fl
07-21-2004, 01:44 PM
also guys will this work if you install it with the sage client - or is it the sage server only?

mlbdude
07-21-2004, 01:59 PM
Originally posted by davey_fl
also guys will this work if you install it with the sage client - or is it the sage server only?

I only run it with on my client machine with the client dumping out the XML jobs.

Alex0230
07-21-2004, 06:41 PM
http://geocities.com/avimedic/

Here's something that says it can "fix" avi files. One of the fixes is missing audio...someone want to give it a go?

lovingHDTV
07-21-2004, 08:37 PM
Ok,
Here is a virtualDub script I worked up. Now I'm no virtualDub expert, but I did find a nice little VBscript that will create this run file for you if you have a vcf file to control what you want virtualdub to do.

I used the mpeg2-virtualdub from here:
http://fcchandler.home.comcast.net/

After installing this virtualDub I ran the attached script in a cmd window like:
VirtualDub.exe /svirtualdub.jobs /x

This will run virtualdub execute the file, then exit.

It worked on my test clip. I don't claim that I used the best encoding methods, I just put something in there to see if it would work. I used DivX5.2, slow and audio mp3 at some bit rate.

I figure if this works, then we can worry about what parameters to run in order to get the "best" encoding.

I hope this makes sense to someone.

lovingHDTV
07-21-2004, 08:49 PM
Hmm lost my attached file.

Here goes again.

rename it to .jobs and remove the .txt had to change it to get it to upload.

davey_fl
07-22-2004, 12:11 AM
man it would be fantastic to get virtualdubmpeg2 working, that's currently what I use to convert.

Crashless
07-22-2004, 02:12 AM
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!:coffee:

Bubster
07-22-2004, 06:42 AM
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 (http://homepages.nildram.co.uk/~nstewart/ffmpeg.zip)

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.

mlbdude
07-22-2004, 06:53 AM
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?

Bubster
07-22-2004, 07:02 AM
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.

Alex0230
07-22-2004, 07:35 AM
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/forums/showthread.php?postid=50336#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>

Alex0230
07-22-2004, 08:27 AM
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. :coffee: 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>

davey_fl
07-22-2004, 12:16 PM
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...

Ryokurin
07-22-2004, 12:52 PM
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?

edbmdave
07-22-2004, 08:20 PM
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?

Alex0230
07-22-2004, 09:29 PM
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;).

mlbdude
07-23-2004, 04:53 AM
Using the last build with MP3 I still get audio dropouts at around the 10 second mark :(.

Bubster
07-23-2004, 04:56 AM
Which codecs are actually being chosen to play the file on your system?

mlbdude
07-23-2004, 05:11 AM
As reported by Media Player...

Audio decoder: MPEG Layer-3 Decoder

Video decoder: DivX Decoder Filter

Bubster
07-23-2004, 06:01 AM
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.

Alex0230
07-23-2004, 08:13 AM
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.

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;).

Bubster
07-23-2004, 08:26 AM
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.

salsbst
07-23-2004, 08:32 AM
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/api/org/w3c/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]

edbmdave
07-23-2004, 05:28 PM
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....

gbutters
07-24-2004, 01:24 AM
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.

Bubster
07-24-2004, 03:17 AM
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?

mlbdude
07-25-2004, 09:37 AM
Just an update. I have compiled a bunch of VirtualDub scripts and done some testing. As normal compression works fine, but no matter what I don't see a way to get VDub to go silent. It still pops up a window when opening the file and if an error occurs another modal dialog pops up waiting for user interaction.

Seems like we may be at an end on this for now. If anyone comes up with something let me know.

Thanks for all the efforts!

Bubster
07-25-2004, 10:25 AM
Erm, haven't we given up on ffmpeg a bit too easily? I mean, it works perfectly for some people (myself included), so there's a good chance we can figure out what isn't working for the others.

On a side note, I got the XviD patch building, so we can use ffmpeg for both DivX and XviD if we can sort out this niggly sound dropout issue.

If ffmpeg does prove to be a bust, then I could have a go at removing the windows stuff from VirtualDub, but ffmpeg seems the better, faster option if we can get it working for everyone.

- Neil.

mikejaner
07-26-2004, 07:56 AM
Um, I don't know if this was mentioned before, to lazy to look, but has anybody looked into mpeg2avi? I don't think it's been developed for a while, but I remember doing command line encoding with it a few years back.

Crashless
07-26-2004, 10:22 AM
Originally posted by mlbdude
Just an update. I have compiled a bunch of VirtualDub scripts and done some testing. As normal compression works fine, but no matter what I don't see a way to get VDub to go silent. It still pops up a window when opening the file and if an error occurs another modal dialog pops up waiting for user interaction.

Seems like we may be at an end on this for now. If anyone comes up with something let me know.

Thanks for all the efforts!

Is there maybe a way to run it from within Alex's java starter? That has settings for priority and starting minimized. Which window are you having problems supressing? The loading status? Which error boxes are you seeing? Maybe we can try convincing the developers to implement a /supress flag to write a log file on errors.

mlbdude
07-26-2004, 10:43 AM
Originally posted by Crashless
Is there maybe a way to run it from within Alex's java starter? That has settings for priority and starting minimized. Which window are you having problems supressing? The loading status? Which error boxes are you seeing? Maybe we can try convincing the developers to implement a /supress flag to write a log file on errors.

It is definitely possible to run from the java program but it won't keep all the windows hidden. So until we get the pop-ups removed It would not work on a SageTV server, but could work on a PC not being used. Unless an error comes up then a dialog pops up and waits till you say "OK" before execution continues.

Bubster
07-26-2004, 10:58 AM
Originally posted by mikejaner
Um, I don't know if this was mentioned before, to lazy to look, but has anybody looked into mpeg2avi? I don't think it's been developed for a while, but I remember doing command line encoding with it a few years back.

I had a quick look at mpeg2avi and it seems that it doesn't handle audio. They suggest that you use VirtualDub to multiplex your audio back into your avi once you have used mpeg2avi to compress the video stream, so this brings us back to the issue of hiding VirtualDub while it is processing.

mikejaner
07-26-2004, 06:20 PM
Ahh, forgot about the no audio thing.

Bubster
07-26-2004, 06:37 PM
Has anyone managed to generate a small output file using ffmpeg, with the sound dropout issue?

The ffmpeg dev mailing list seems to be pretty active, and the maintainer will look at problems if he is given enough info to work on, if we can't figure it out ourselves.

Crashless
07-26-2004, 10:43 PM
Originally posted by mlbdude
snip...Unless an error comes up then a dialog pops up and waits till you say "OK" before execution continues.

I found a setting in VirtualDubMpeg2 that allows you to set your error preference. You must set it under both video and audio menus, and it is called 'error mode' and set to 'decode even if reslt may be garbled'. Set for both audio and video, and it seems that as long as the 3rd party plugins don't crash, we'll be fine.

At least that's what it seems. I have never had a crash from within the virtual dub program to know what happens.

That said, I've experimented with another program called DubMan (http://dubman.sourceforge.net/) it makes a MUCH easier execution of the virtualdub script, and it seems to be much more robust, also, its script uses XML so we may be able to create those files on the fly. I say we only by habit, I can't code my way out of a paper bag, only hack together other people's code. Does this help anyone?

It probably would be easier for most to just create a new 'wildcard' template than to modify mine, but basically you need to replace the input and output files in the template with the appropriate paths, then put it and the bat file in the dubman directory and run. You must setup dubman first with the needed paths to virtualdub. If you make your own job template for DM, click the 'bulk settings' button in the bottom left then set 'wildcard' then in the input and output files of the job configuration screen, set the full path of your source/destination directory, as *.mpg for source and *.avi for output. I got stuck here and only put *.mpg/*.avi without paths, and it didn't do anything.

It ran VDub minimized, the only popup was dubman and the 'loading' window from VDub. I haven't tried the java wrapper, but I don't see why it wouldn't hide dubman.

One problem though, it quit VDub like it was supposed to, but then sat and waited on a 'I'm done!" dialogue box. Dumbass, I put /q on the command line, what gives? I don't have an answer to this one yet.

Oh, yeah, it also has a setting to delete source file when done. It did this as advertised.

Dubman has the ability to execute external command line programs as a script as well as run VDub, so you could feasibly create an XML template file for dubman that would do all the copying, encoding, deleting, automatically. with no need for the extra steps I took by replacing alex's ffmpeg with xcopy (see previous post)

Am I just complicating things? It seems to work though.

Also, the strength to using this script is that you can apply as comlicated of an encoding job as you want. You could package it neatly with default settings, vcfs, & dubman templates, and the 'set and forget' crowd would be happy, then the L337 crowd could run through multipass xvid/ogg bliss. Just a thought.

Sorry for long post, I guess I rambled a bit....I'm just excited, that's all....
:jump: :jump: :jump: :jump:

Crashless
08-04-2004, 10:05 PM
Is anyone still interested in this? My method seems to work. I have it running on my server that uses a pvr350, so the windows poping up all over the place never bothered me, but it has been working.

If hope has been abandoned, will the 'compress' option be dumped in future releases of this stv? That would be a shame as I know many people are interested in this functionality.

I guess I'm asking: Am I alone in my desire to have this work?

Thanks for listening.

edbmdave
08-04-2004, 10:38 PM
Originally posted by Crashless
Is anyone still interested in this? My method seems to work. I have it running on my server that uses a pvr350, so the windows poping up all over the place never bothered me, but it has been working.

If hope has been abandoned, will the 'compress' option be dumped in future releases of this stv? That would be a shame as I know many people are interested in this functionality.

I guess I'm asking: Am I alone in my desire to have this work?

Thanks for listening.

Crashless: Yes I think people are interested. MlbDude is out of touch until either this weekend or start or next week, so things have just gone silent for a while. Keep the faith.

Crashless
08-04-2004, 11:11 PM
Ahhh, the world makes sense again. Didn't know he was out of town (or whatever) thought it was kinda strange that he was MIA.

Thanks.

Bubster
08-05-2004, 03:19 AM
I'm still very keen to get this working as well, although I do think ffmpeg is the more useful option, if we can get it working for everyone. Unfortunately, no-one has been forthcoming with any info that I can use to debug the sound dropout problems, so there's nothing I can do about it, as it seems to work OK here.

The main issues with using VirtualDub for me are that it seems to be slower than ffmpeg (including the enormous amount of time it spends just parsing the MPEG2 file), and the windows popping up are a problem for me since I'm using the displays on all my PCs.

While I'm sure it should be possible to modify VirtualDub to keep the windows from appearing, I did spend quite a bit of time getting a decent build of ffmpeg with mp3 and XviD support working, only to have virtually no feedback, so I'm reluctant to spend any time on a VirtualDub modification in case that runs out of steam as well.

- Neil.

RedCoat999
08-05-2004, 05:53 AM
Bubster,
I am very interested in this. I haven't tried it yet since I try to wait until more people have had a stab (and my box is only a PII 450, so a little apprehensive as to how long these things will take to encode).

But if no-one else is trying this then I will have a go. Do you have a build, or instructions, any particular posts I should look at, etc?

Thanks for all you and others hard work.

davey_fl
08-05-2004, 07:51 AM
After countless tests with ffmpeg I have to say that I'm not happy with the compress quality. Looking through the fourcesorge forum it would appear that it should be a reliable mpeg4 compressor. My main issues are that I have to up the bitrate to 1900kb/s to remove the artifacting from scene changes, which in turn reduces the compression ratio to a point where it's not worth using. With VirtualDub and the Divx codec running at its default 900kb/s I get excellent picture quality and very good compression ratio. Also with ffmpeg I also (as everyone else does) get audio loss with 2 hour shows. I have tried the - t 30 and this makes no difference, the audio loss is still present. Maybe we need to keep trying different settings with ffmpeg...

my 2 c.

davey

Bubster
08-05-2004, 08:03 AM
Originally posted by RedCoat999
Bubster,
I am very interested in this. I haven't tried it yet since I try to wait until more people have had a stab (and my box is only a PII 450, so a little apprehensive as to how long these things will take to encode).

But if no-one else is trying this then I will have a go. Do you have a build, or instructions, any particular posts I should look at, etc?

Thanks for all you and others hard work.

You can get the version of ffmpeg I built here (http://homepages.nildram.co.uk/~nstewart/ffmpeg.zip).

Here's a sample command line to use with it:

ffmpeg -y -hq -i INFILE.mpg -f avi -b 1200 -vcodec mpeg4 -acodec mp3 -ab 128 -deinterlace -async 1 OUTFILE.avi

The main issue people are having is that, if they compress a very large mpeg2 file (e.g. a 2-hour show from Sage at 3GB/hour), the sound disappears after 10 seconds or so.

What I was hoping to do was find out where the problem was, e.g. by swapping broken/working files between people (chopped versions of course) to see if there's a pattern.

One way to test this is to put "-t 30" in the command line, which forces it to only convert 30 secs of video, and if you get sound dropout, send it to me or someone else who doesn't have the problem and see if it works there. If there are people willing to do this, I'll put up some ftp details where they can put/get files.

- Neil.

Bubster
08-05-2004, 08:26 AM
Originally posted by davey_fl
After countless tests with ffmpeg I have to say that I'm not happy with the compress quality. Looking through the fourcesorge forum it would appear that it should be a reliable mpeg4 compressor. My main issues are that I have to up the bitrate to 1900kb/s to remove the artifacting from scene changes, which in turn reduces the compression ratio to a point where it's not worth using. With VirtualDub and the Divx codec running at its default 900kb/s I get excellent picture quality and very good compression ratio.

The problem with scene changes is probably due to the "group of pictures" setting (-g 300), if you are using a similar command line to the ones given earlier on this thread. If you remove this (and the bframe one, "-b") then scene changes should work properly at lower bit rates.

This is because the group of pictures setting is forcing the compressor to only use an I frame every 300 frames. You can't really represent a scene change with P or B frames, so if the change doesn't occur very near the end of a group (unlikely, as a group of 300 is 10 seconds long for NTSC), you will see a pile of blocks as the P/B frames try to compensate, which they can't.

Also with ffmpeg I also (as everyone else does) get audio loss with 2 hour shows. I have tried the - t 30 and this makes no difference, the audio loss is still present. Maybe we need to keep trying different settings with ffmpeg...

Well, I did ask people to come back with the results of the -t 30 test and we could take it from there, but no-one did. Also, it's not true that everyone is having this issue. I am not, for one.

If you, and any others who are getting the problem are willing to upload the resulting files (the -t 30 ones, of course) to my ftp server, then we can see if the files play ok for other people. Conversely, I (and others who get it to work) could upload files which work for us, and people who are having problems can get them and see if they work. By doing this, we may be able to determine if the fault is in compression or decompression. We can also provide the ffmpeg maintainer with faulty files and see if he can debug the problem.

- Neil.

davey_fl
08-05-2004, 09:16 AM
I thought it had something to do with the number of reference frames used and changes in between, I'll give that a try. I'm not at home now, but will create another -t 30 file and PM you for the upload.


thx

davey

Bubster
08-05-2004, 10:12 AM
Originally posted by davey_fl
I thought it had something to do with the number of reference frames used and changes in between, I'll give that a try. I'm not at home now, but will create another -t 30 file and PM you for the upload.

OK, cheers. And I'll put a file that works OK for me there, so you could try that and see if the sound is ok on your machine. I'll post the ftp details here, so others can post/try stuff if they want.

- Neil.

Crashless
08-05-2004, 10:14 AM
I'll give your xvid a try, but won't be able to until next week. I'd still prefer divx, as I have an MVP that I'd like to be able to play the resulting videos on. But since I have a solution I'm happy with for now, I don't mind helping you guys out. But unfortunately, I can't until next week. :(

Bubster, please don't give up on us. I've recently realized that this community is much less excited (in general) about beta testing complex solutions than say, the Meedio community. Not that that's bad, it's just a result of the people that are drawn to different solutions. Once you get a solution though, and streamline it for newb-friendly installation, people will love you. I guarantee it.

Bubster
08-05-2004, 10:20 AM
Meant to say, it's probably best to set the video/audio bitrates to 600/64 (or lower if your eyes/ears can take it) for the -t 30 test, just to keep the file sizes down for uploading/downloading. The ffmpeg maintainer also doesn't like people uploading huge files to his server, so we'll need to keep them small if we want any help from him.

- Neil.

Ryokurin
08-05-2004, 01:39 PM
sorry, but I didnt even notice that you had a version to try. ill try it when I get home on something.

Bubster
08-05-2004, 02:03 PM
OK, I've set up a folder on my ftp site to exchange (small) test files on.

The address is: r0x0rz.shacknet.nu (or use this link (ftp://r0x0rz.shacknet.nu)).

The test videos should go in the "Sage" folder. Within that, I suggest using a folder per person, with a "working" or "non-working" label added to the name, depending on whether the tests work for the originator of the files.

I've put my first example in there. It's a "working" example, as in it works for me. There's a text file alongside it (of the same name but with a .txt extension) which gives the command line that was used to make it. If some of the people who are having sound dropout issues can get this file and see if the sound works for the full 30 secs, that would be good. Remember to post your results here, either way - a negative is every bit as useful as a positive at this stage.

- Neil.

Bubster
08-05-2004, 02:28 PM
Originally posted by Crashless
I'll give your xvid a try, but won't be able to until next week. I'd still prefer divx, as I have an MVP that I'd like to be able to play the resulting videos on. But since I have a solution I'm happy with for now, I don't mind helping you guys out. But unfortunately, I can't until next week. :(

The verison I gave a link to doesn't have the xvid stuff in it (at least, I don't _think_ I updated it), mainly because I didn't want to confuse things while the sound issue was still going on. I'll put it on my ftp server if anyone wants to try it out.

Bubster, please don't give up on us. I've recently realized that this community is much less excited (in general) about beta testing complex solutions than say, the Meedio community. Not that that's bad, it's just a result of the people that are drawn to different solutions. Once you get a solution though, and streamline it for newb-friendly installation, people will love you. I guarantee it.

No worries. I wasn't giving up, but there wasn't much more I could do without other people doing some tests. The first rule of debugging is to recreate the problem, but I can't do that here as it always seems to work for me. Sometimes there's nothing worse than having a thing go and always work on you, no matter how much you want it to break. ;)

BTW, my impression was that there was a fairly mixed group of people in here, including a fair few with lots of technical know-how. I just assumed everyone was too busy and/or not interested enough in this. Hopefully it's the former, and there'll be a flurry of new activity soon.

- Neil.

RedCoat999
08-05-2004, 06:42 PM
Bubster
I have downloaded Test1 and Test2 and found watching Sky thoroughly enjoyable for all 30 seconds. Audio good.

I have uploaded one folder with a file that was originally 1hr 52 min (only first 30 secs encoded). Worked for me.

Bubster
08-05-2004, 07:03 PM
Nice one, works here too. Is that some dating show? I do hope that's a random selection and not something you want to compress and keep for posterity. :eek:

Hopefully some people who were having problems will be able to test these files soon and upload some broken ones too.

BTW, have you tried compressing the whole video yet? Based on what people have been seeing (no change between a full compress and a 30 second one), I suspect it will be fine for you, but there's one thing you can be sure of: that you can't be sure of anything. :p

- Neil.

RedCoat999
08-05-2004, 07:27 PM
That was the wonderfully tacky and yet watchable Amish in the City (http://www.upn.com/shows/amish_in_the_city/). Boy those Amish women have good bods!:D

davey_fl
08-06-2004, 01:32 PM
Bubster: After reloading my machine with Xp Pro, downloading the latest version of ffmpeg and trying your command from your test1.txt I no longer have the audio dropout of the atrifacts due to frameloss :)

So now I'm trying to intergrate this command back into the properties file for ffmpeg pickup and running into some problems. The EXE_Command is set to false, so where does the program pickup the commands from? If I set this to true for testing purposes it works, but doesn't create files in the proper directories with correct names etc.

Thanks for your work on this fellow Glasgonian!

davey

Alex0230
08-06-2004, 08:05 PM
Originally posted by davey_fl
Bubster: After reloading my machine with Xp Pro, downloading the latest version of ffmpeg and trying your command from your test1.txt I no longer have the audio dropout of the atrifacts due to frameloss :)

So now I'm trying to intergrate this command back into the properties file for ffmpeg pickup and running into some problems. The EXE_Command is set to false, so where does the program pickup the commands from? If I set this to true for testing purposes it works, but doesn't create files in the proper directories with correct names etc.

Thanks for your work on this fellow Glasgonian!

davey

If exe_command "enabled" is set to false, then it uses a default internal command which is basically the same as the original value that was in the props file when you downloaded it. : )

I'm back checking the forums a bit more now...the last few weeks I've been looking/moving and haven't really been able to work on this. Hopefully this weekend I can invest some time and maybe find a compressor that is command line friendly and easy to call.

Bubster
08-07-2004, 11:18 AM
Originally posted by davey_fl
Bubster: After reloading my machine with Xp Pro, downloading the latest version of ffmpeg and trying your command from your test1.txt I no longer have the audio dropout of the atrifacts due to frameloss :)

Interesting... So you were getting the audio dropout before, but it's gone now? Question is: was it your reinstallation of XP or the version of ffmpeg that made the difference?

So now I'm trying to intergrate this command back into the properties file for ffmpeg pickup and running into some problems. The EXE_Command is set to false, so where does the program pickup the commands from? If I set this to true for testing purposes it works, but doesn't create files in the proper directories with correct names etc.

When you set it to true, are you still using the @INPUT and @OUTPUT fields in the command? These get replaced with the correct names, so it's vital that they are there.

Also make sure you've got "-i " in front of @INPUT, and put it right after the "ffmpeg" at the start of the command line (parameters to ffmpeg affect the next file mentioned on the command line, and you want all of them to affect the output file, so you shouldn't have much before the input file is specified).

Here's a simple example that works, with only @INPUT and @OUTPUT being used:

ffmpeg -i @INPUT -hq -deinterlace -y -f avi -vcodec mpeg4 -b 1600 -async 1 -acodec mp3 -ab 192 @OUTPUT

If you look in "ffmpegPickup.log" after running the job processor, you can see the commandline that was constructed. It's worth checking this to make sure it's doing what you expect.

Thanks for your work on this fellow Glasgonian!

Cheers, but I can't really take any credit. Most of it has been done by mlbdude and Alex0230, so three cheers to them...

- Neil.

davey_fl
08-10-2004, 10:50 AM
Well then thanks to Alex and mlbdude also. I think the issue was more using an old version of ffmpeg. Once I got the update, and the 7/22/04 grabber, everything works. It processes much faster than virtualdubmpeg2 as it doesn't have to parse the file first. Let's hope this option stays around in futuer releases of mlbdude's stv!

davey

edbmdave
08-10-2004, 01:45 PM
Could someone document (In one spot) the working solution with links to the appropriate software/files?

I will try and validate it and it can serve as a reference for others who want to get compression working.

Thanks

mlbdude
08-14-2004, 01:02 PM
Been out for awhile, notice some positive posts. Has anyone gotten this working with ffmpeg yet? If so how?

Bubster
08-15-2004, 09:15 AM
Originally posted by edbmdave
Could someone document (In one spot) the working solution with links to the appropriate software/files?

I will try and validate it and it can serve as a reference for others who want to get compression working.

I suppose the first thing you want to try is running ffmpeg on a large Sage recording and see if it works ok for you. I posted a simplified command line on page 8 of this thread, about 5 posts from the bottom, as well as a link to the version of ffmpeg I built from the most recent code in their CVS depot.

If you want to save some time, try adding "-t 30" to the command line, which will limit the output to 30 seconds, and see if you get audio for the full clip. If you do, it's very likely that you won't get any audio problems if you compress the entire clip, but it's worth testing that as well if you have time to spare.

The setting up of the Sage job processing stuff is a little involved, and should probably be re-documented in one place again, but it's kind of jumping the gun if people are still having ffmpeg problems and there's no alternative solution that suits everyone either.

Bubster
08-15-2004, 09:43 AM
Originally posted by mlbdude
Been out for awhile, notice some positive posts. Has anyone gotten this working with ffmpeg yet? If so how?

It works fine for me (but then it did from the start, so that doesn't say much), but there was a change in fortunes for davey_fl who managed to eliminate the sound dropout. The only problem is that he made several changes (reinstalling XP, using my build of ffmpeg, and using the same command line I have been using), so we don't know which of these fixed the issue for him.

I believe you tried my build of ffmpeg and still got the sound dropout, so that would suggest that it was the XP re-install or the different command line that helped, but it's hard to be certain at this stage. If you can try that version of ffmpeg and that command line and see if it works for you, without an XP re-install, and see if it works, we might be a bit closer to an answer.

Another thing worth trying is downloading the working test movies people have uploaded to my ftp server and see if they work for you. If these don't work for you, it suggests some sort of decoder problem, rather than an issue with ffmpeg itself, although it could be that ffmpeg is generating data which some decoders don't like. It would be really useful if we could establish this to be the case, as we would then have the option of avoiding certain decoders, or seeing if ffmpeg can be "fixed" to produce data more friendly to the decoders that aren't working.

So far, we haven't had anyone post a broken movie, or had anyone who was having problems test a "working" one, so there's a whole lot of potentially useful info we're missing until someone does this.

edbmdave
08-17-2004, 05:05 PM
Originally posted by Bubster
I suppose the first thing you want to try is running ffmpeg on a large Sage recording and see if it works ok for you. I posted a simplified command line on page 8 of this thread, about 5 posts from the bottom, as well as a link to the version of ffmpeg I built from the most recent code in their CVS depot.

If you want to save some time, try adding "-t 30" to the command line, which will limit the output to 30 seconds, and see if you get audio for the full clip. If you do, it's very likely that you won't get any audio problems if you compress the entire clip, but it's worth testing that as well if you have time to spare.

The setting up of the Sage job processing stuff is a little involved, and should probably be re-documented in one place again, but it's kind of jumping the gun if people are still having ffmpeg problems and there's no alternative solution that suits everyone either.

The link to your version of ffmpeg does not work. is the file still there? I was able to get to you web page, just not the ffmpeg.zip

Bubster
08-17-2004, 06:05 PM
Originally posted by edbmdave
The link to your version of ffmpeg does not work. is the file still there? I was able to get to you web page, just not the ffmpeg.zip
Sorry, I managed to delete it by mistake. It's back up there now.

falchulk
08-18-2004, 09:15 AM
Personally, I have been using windows media encoder to renecode. Works well with scripting support. The only problem is that I have to launch an external player to watch them!

edbmdave
08-23-2004, 12:24 PM
Originally posted by Bubster
I suppose the first thing you want to try is running ffmpeg on a large Sage recording and see if it works ok for you. I posted a simplified command line on page 8 of this thread, about 5 posts from the bottom, as well as a link to the version of ffmpeg I built from the most recent code in their CVS depot.

If you want to save some time, try adding "-t 30" to the command line, which will limit the output to 30 seconds, and see if you get audio for the full clip. If you do, it's very likely that you won't get any audio problems if you compress the entire clip, but it's worth testing that as well if you have time to spare.

The setting up of the Sage job processing stuff is a little involved, and should probably be re-documented in one place again, but it's kind of jumping the gun if people are still having ffmpeg problems and there's no alternative solution that suits everyone either.


IT WORKS. I was definately having the audio drop out at around 10 seconds. I have (using the command line you referenced in your post on page 8) successfuly encoded and played back a 30 second, 60 second, 5 minute, 20 minutes, 1 hour, and 2.5 hour MPG2. Works beautifully. What do we have to do to get the compress java thing to use that command sequence? It works!!!

Muchacho
08-23-2004, 02:37 PM
To start I wanted to thank everyone involved for the hard work. I too have been having success with ffmpeg. I have only done a 30 sec test on a long recording and there was no audio dropout ( I did it from the commandline as well). I also have the mlbdude skin making xml files and the compressor tool picking them up and compressing. Works pretty slick I must say! Unfortunately my sage box is packed up for a few days while I paint the basement, but I am looking forward to more testing (i.e. using the tools and not the commandline) and would be glad to assist in anyway that I can. I have only played the longer show back with MPC so I dont know if it works with other players. I was thinking that the differences that people are having may have to do with the codec that is doing the decoding? I am using the latest ffdshow and have never installed any of the DIVX codecs if that helps. Also I thought that people who are having the dropouts may want to try playing them in MPC as Bubster has mentioned. Thanks for all the hard work- I cant wait to set the sage box back up....

Bubster
08-23-2004, 05:15 PM
Originally posted by edbmdave
IT WORKS. I was definately having the audio drop out at around 10 seconds. I have (using the command line you referenced in your post on page 8) successfuly encoded and played back a 30 second, 60 second, 5 minute, 20 minutes, 1 hour, and 2.5 hour MPG2. Works beautifully. What do we have to do to get the compress java thing to use that command sequence? It works!!!

Nice, another success. I'll post some (hopefully) complete instructions shortly.

- Neil.

Bubster
08-23-2004, 05:20 PM
Originally posted by Muchacho
I was thinking that the differences that people are having may have to do with the codec that is doing the decoding? I am using the latest ffdshow and have never installed any of the DIVX codecs if that helps.

That's the theory I was leaning towards at one point, but it does seem that a couple of people who were having trouble before are getting it to work now with a different ffmpeg version/command-line.

Mind you, it could be that they were using fussier codecs, and the new command-line is causing ffmpeg to output slightly better behaved data. Or something.

- Neil.

Bubster
08-23-2004, 05:47 PM
OK, here's what I hope are a set of complete, all in the one place, instructions on setting up the compressor.

Stage 1 - Get the bits
[list=1] Get MlbDude's beta STV (http://download.sage.tv/~mlbdude/MlbDude2_Beta.zip)

Get FFMPEG Pickup/Compressor (http://homepages.nildram.co.uk/~nstewart/FFMPEG_Pickup_Compressor.zip)[/list=1]
The pickup/compressor is a combination of Alex0230's latest pickup processor, my build of ffmpeg (with mp3 and XviD support), my pickup properties file, and a slight modification I made to Alex's processor to remove any ":"s from programme names, as this was causing the output directory not to be created (I need to add a couple of other illegal chars in there at some point).

Stage 2 - Install the bits
[list=1] Make sure Sage is not running.

Replace your "MlbDude2.stv" with the one from "MlbDude2_Beta.zip".

Extract the contents of "FFMPEG_Pickup_Compressor.zip" into a folder called "Compressor" in your Sage program dir (usually "C:\Program Files\Frey Technologies\SageTV" unless you changed it at install time). When you have done this, the "Compressor" dir should contain "ffmpeg.exe" and a few other files.
[/list=1]

Stage 3 - Set up the STV
[list=1] Make sure Sage is still not running.

Edit your Sage properties file and add the following 2 lines, modifying as required:

mlbdude/compress_job_folder=C\:\\Program Files\\Frey Technologies\\SageTV\\Compressor\\Jobs
mlbdude/compress_target_root=V\:\\Video-Library

The first line should be ok if you installed Sage at the default location - change it if not. The second line needs to give the location where you want the output videos to go (this should normally be one of the paths you have in the Sage video library paths in the settings, if you want to play them later in Sage).

*Important* Make sure you pay careful attention to the start of these paths. They should start "X\:\\", where X is the drive letter you want.

To test this, start Sage and go to Recordings. Pick a recording (not the one currently recording) and hit "Compress". You should now find an XML file in the "pickup" dir, with a name very similar to the recording you just selected.
[/list=1]

Stage 4 - Set up the compressor
[list=1] The "properties.xml" file in the "Compressor" dir should work as-is. It uses the video library output dir passed to it in the job XML file from MlbDude's STV (which you edited in stage 3).

Open the "ffmpeg_convert.properties" file in your favorite text editor.

The first line will look like this:

Java_Executable_Path=java.exe

This should be OK, as the Java exe should be in your path. If it is not, however, locate it and modify this line as required.
Here's an example using a full path:

Java_Executable_Path=C:\Program Files\Java\j2re1.4.2\bin\java.exe

To test this, make sure you have a job XML in the "Compressor/Jobs" dir (you would have created one when testing the STV in stage 3), and run "ffmpeg_convert.exe". You should see two "DOS" boxes appear in the taskbar (they start minimised so you can run this while watching TV). Open them up and you will see that one is running FFMPEG to compress your recording, and the other is the pickup program, which is waiting for the compressor to finish before starting the next job (if there are any).

If you don't get two "DOS" boxes, or get them and then they disappear quite quickly, then you probably have an incorrect path somewhere. Assuming you have followed these instructions exactly, the likely candidates are the Java exe path and the video library path in your Sage properties file.

If you're feeling adventurous, add "ffmpeg_convert.exe" as a scheduled task in Windows, so it runs automatically at night, or even a few times a day.
[/list=1]

End

OK, I'm pretty sure that's it. If anyone finds any problems with these instructions, I can fix them and re-post until they are correct.

Fingers crossed...

- Neil.

Muchacho
08-23-2004, 07:12 PM
To make thing simpler I would tell people that they need to d/l mlbdudes full beta stv and then add just the .stv file over the one from the full installation.

Also how do you get the xvid ffmpg to use xvid? Is it better than the default mpeg4 encoder and is it as fast?

Bubster
08-23-2004, 07:36 PM
Originally posted by Muchacho
To make thing simpler I would tell people that they need to d/l mlbdudes full beta stv and then add just the .stv file over the one from the full installation.

Yes, might be an idea. I'll store up any suggestions for a bit before posting updated instructions - just in case there's a fair few to do.

Also how do you get the xvid ffmpg to use xvid? Is it better than the default mpeg4 encoder and is it as fast?

To make it use XviD, just change the "mpeg4" to "xvid" for the "-vcodec" command-line option.

I haven't done any comparisons, so I couldn't really say if it gets better results than the mpeg4 encoder, or if it runs as quickly. Maybe someone else has done some tests and can post them here?

- Neil.

invisible_ink
08-23-2004, 08:11 PM
You may want to file this under better late than never, but...

Has anyone tried to adapt the newest version of vidomi (vidomi.com)? It has some command line switches, seems to have been built for batch jobs, default output is xviD and when all else fails has a half-decent GUI.

Just a thought.

ink.

falchulk
08-24-2004, 05:48 AM
Originally posted by invisible_ink
You may want to file this under better late than never, but...

Has anyone tried to adapt the newest version of vidomi (vidomi.com)? It has some command line switches, seems to have been built for batch jobs, default output is xviD and when all else fails has a half-decent GUI.

Just a thought.

ink.

Actually, I did. I was unable to find the command line documentation. I did find the -encoder but no way to specify bitrates or any other settings.

JUC
08-24-2004, 12:36 PM
Alright, I am having trouble setting this up. I had the previous version of ffmpeg working but I decided to try this one. I am having the java.exe boxes disappear on me so one of my lines must be wrong. Here's what I got:

mlbdude/compress_job_folder=C:\\Program Files\\Frey Technologies\\SageTV\\Compressor\\Jobs

mlbdude/compress_target_root=E:\\My Videos\\SageFiles


-Sage dumps the file correctly into the Jobs folder. I then run the compressor program and the promps show up briefly and disapear.

My Java is set to:

C:\Program Files\Java\j2rel.4.2_04\bin\java.exe
this is where my java is located and should work

-So, everything seems to be set correctly but I am not sure what's going on. I think it may have to do with the properties XML file. In there, it says that my pickup location is: .\pickup

-should I change this to point to the jobs folder instead. What would the line start with--ie. would it be c:\ or do I use .\
thanks
JUC

RedCoat999
08-24-2004, 01:26 PM
From instructions in previous message:

*Important* Make sure you pay careful attention to the start of these paths. They should start "X\:\\", where X is the drive letter you want.

edbmdave
08-24-2004, 02:27 PM
Ok, now that it seems to be working. How do we get a two pass method for optimal quality??

falchulk
08-24-2004, 02:47 PM
Originally posted by edbmdave
Ok, now that it seems to be working. How do we get a two pass method for optimal quality??

Actually, the one pass looks to be better quality. The 2nd pass results in a smaller file size.

beautye350
08-24-2004, 04:01 PM
Originally posted by RedCoat999
From instructions in previous message:

*Important* Make sure you pay careful attention to the start of these paths. They should start "X\:\\", where X is the drive letter you want.

I'm having the same problem as JUC and my paths ARE in the correct form. I'm trying this on my sage client and my path is a mapped network drive.

here's mine:

mlbdude/compress_job_folder=C\:\\Program Files\\Frey Technologies\\SageTV\\Compressor\\Jobs
mlbdude/compress_target_root=M\:\\

Possible that the files were changed? I just downloaded last night.


Regards,

Beau


EDIT: I forgot to mention that I have altered the xml properties to allow xvid. This was in the hopes it would fix the problem as it was not working in standard form. Thought maybe I was missing a codec or something. I know I've got xvid installed.

Bubster
08-24-2004, 04:25 PM
Originally posted by JUC
-So, everything seems to be set correctly but I am not sure what's going on. I think it may have to do with the properties XML file. In there, it says that my pickup location is: .\pickup


Sorry, my fault. I uploaded the zip to my webpage, changed the properties file, updated the zip... and then forgot to upload the new zip.

Fortunately, the only difference between the two is that the pickup location is wrong. It should be ".\Jobs", as you guessed. The rest of the zip file is identical, but I have uploaded the proper one to avoid catching anyone else out.

- Neil.

Bubster
08-24-2004, 04:34 PM
Originally posted by beautye350
I'm having the same problem as JUC and my paths ARE in the correct form. I'm trying this on my sage client and my path is a mapped network drive.

Hopefully you're just having the same problem that JUC pointed out, with the incorrect pickup folder in the properties.xml I uploaded at first.

So line 4 in properties.xml should be:

<Pickup_Location>.\Jobs</Pickup_Location>

I forgot to mention that I have altered the xml properties to allow xvid. This was in the hopes it would fix the problem as it was not working in standard form. Thought maybe I was missing a codec or something. I know I've got xvid installed.

I'm pretty sure the XviD codec also supports DivX decoding, so if you've got that installed, both should work for you. Most people end up with 3 or 4 codecs that can play DivX files, which can cause no end of confusion.

- Neil.

Bubster
08-24-2004, 05:53 PM
Originally posted by falchulk
Actually, the one pass looks to be better quality. The 2nd pass results in a smaller file size.

The whole fixed bitrate (1/2-pass) thing exists mainly to allow people to fit the output file onto a CD.

Depending on the codec, the 1-pass method will get you pretty close to the desired output size, but may be smaller (which wastes perfectly good CD space), or too big (which means you have to guess again and re-encode it). I believe the XviD codec tends to overshoot more than the DivX one, but don't quote me on that. ;)

The 2-pass method can use stats from the 1st pass to give results much closer to the desired output size. And, as I understand it, these stats can also be used to distribute the bitrate a bit more intelligently, so "cheap" frames will use a little less bitrate to leave a bit more for more expensive frames, resulting in overall better quality and cleaner scene changes.

Another reason for the fixed bitrate method is that you may be transmitting the movie over a slow medium (e.g. network), so you never want the bitrate to go too high, even if there's some saved up from cheap frames in a 2-pass encode, so there's a limit to how much redistribution of bitrate that goes on. For example, the average bitrate over 3-4 seconds must be under the desired rate, or something like that.

Now, there is another option, and this is the one I use, although I didn't put in in the properties.xml I uploaded to minimise confusion.

Ffmpeg supports quality-estimated encoding, which basically lets you set some arbitrary quality level you want to maintain, and it will use however much bitrate is required to achieve this. The big advantage of this is that you know you'll get decent results every time (which is a nice property for a fire-and-forget recompressor for Sage). The downside is that you don't know how big the final file will be. If it's a smooth, easy-going programme, the file could be quite a bit smaller than what you'd get with your default fixed bitrate, but if it's a pretty noisy affair with lots of random movement, you might get something rather larger.

If it's "quality with a bit of space-saving" you're after, this is your option. :)

The commandline parameter is: "-qscale E", where E is the level of error you want to allow in the output stream. Lower values mean less error and higher quality, but larger files. I've been using 5 so far, and it _seems_ to give size/quality similar to a bitrate of 1600 with average TV programmes, but will of course scale up or down depending on the content.

For example, I've got a clip with lots of penguins moulting their feathers in the wind. All those feathers floating on screen really hurts, even at a fixed bitrate of 1600, but -qscale 5 sorts them out pretty well, albeit with a noticable increase in bitrate for that scene. The rest of the programme encodes at around 1200-1300, so the gain in size for the moulting scene is compensated for in this case by a drop in size for the rest of the programme. The end result is a slightly smaller file than fixed-1600, but with the moulting scene intact.

Oh, make sure you remove the "-b" option if you use this. You obviously can't have both at the same time.

- Neil.

JUC
08-24-2004, 07:13 PM
allright, I actually DID have the correct paths in my sage properties file, I just typed them in wrong when I posted my question. So, I just need to change the .\pickup to .\jobs and all should be working. Ill get to it first thing in the morning and hopefully all is well.
Thanks
JUC

beautye350
08-24-2004, 09:12 PM
Originally posted by Bubster
Hopefully you're just having the same problem that JUC pointed out, with the incorrect pickup folder in the properties.xml I uploaded at first.

So line 4 in properties.xml should be:

<Pickup_Location>.\Jobs</Pickup_Location>



I'm pretty sure the XviD codec also supports DivX decoding, so if you've got that installed, both should work for you. Most people end up with 3 or 4 codecs that can play DivX files, which can cause no end of confusion.

- Neil.

Thanks, Bubster. It works now!

I agree about the codecs though. That's why I have only installed xvid as it will do divx also.

Here's hoping it works for JUC as well.


Regards,

Beau

edbmdave
08-25-2004, 08:34 AM
Do you need a special version of FFMPEG to run XVID? If so were do you get it? If not if you have XVID installed can you just change the video codec to XVID to use it?

Bubster
08-25-2004, 09:47 AM
Originally posted by edbmdave
Do you need a special version of FFMPEG to run XVID? If so were do you get it? If not if you have XVID installed can you just change the video codec to XVID to use it?

The compressor zip I gave the link to in my "complete" instructions has a version of ffmpeg with XviD support built-in. You don't need XviD on your system to use it within that version of ffmpeg, but you will need it to play an XviD movie back.

- Neil.

JUC
08-25-2004, 07:25 PM
Got it working! Thanks. What encoding quality are you all using and how much of a compression are you achieving--before and after?
thanks
JUC

Crim
08-25-2004, 11:00 PM
I'm giving this a test, I was just wondering how I know it's working? I tried it and let it run for about 10 minutes and didn't notice anything (recording was 1 hour) but Ill have some time tommorow to do a full test.

Crim
08-26-2004, 10:51 AM
Okay I've tried getting it to work (made sure I followed the directed too) but so far no joy. When I click on "Compress" it changes to "Cancel Compression" but nothing else happens, on top of that I can't even find the orginal MPEG file I was working with, it just disapeared.

I sounds great but I can't get it too work.:(

Any suggestions?

JUC
08-26-2004, 11:53 AM
Just clicking compress won't do it for you. That only dumps the file into the jobs folder you set up. You then need to manually run the ffmpeg compressor program to get it working. You will know if it is running if you see two dos prompts at the bottom of your screen. If they show up briefly then go away--you have a problem with your paths somewhere. Also, while you are testing it out, make sure you that in the compress options in the advanced tab that you have it set NOT to delete the original after the compress. Hope this helps
JUC

Crim
08-26-2004, 11:59 AM
So clicking Compress creates an XML file in the jobs folder, then you have to start FFMPEG (or is it ffmpeg_convert?) which reads that file and then creates the new Xvid file? Is that right?

It's not set to delete the orginal, I just don't know what happened too it. lol

Thanks for the help.

JUC
08-26-2004, 12:04 PM
yea, off the top of my head I'm not sure what type of file it creates in the jobs folder but you just run the ffmpeg_convert program and it should work. If not, your paths are probably incorrect.
JUC

Crim
08-27-2004, 12:18 PM
Okay I click "compress" a job file is created, I start ffmpeg_convert and a DOS box starts for only a second and then clears itself, no other windows open.

The ffmpeg_convert properties file looks like this:

Java_Executable_Path=C:\Program Files\Java\jre1.5.0\bin\java.exe
Class_path_to_use=.
Class_to_run=ffmpegPickup
Args_if_any=
Java_run_minimized_no_focus=true
Extern_run_minimized_no_focus=true

and I'm sure (after checking a dozen times) that my other properties file is setup correctly so is it the fact that I'm using Java 1.5.0 the problem?

Bubster
08-27-2004, 01:04 PM
Originally posted by Crim
Okay I click "compress" a job file is created, I start ffmpeg_convert and a DOS box starts for only a second and then clears itself, no other windows open.

The ffmpeg_convert properties file looks like this:

and I'm sure (after checking a dozen times) that my other properties file is setup correctly so is it the fact that I'm using Java 1.5.0 the problem?

I would hope it's not the Java version, but then, Java always has been a bit volatile in that respect.

Are you getting a single DOS box popping up quickly, or two of them?

If it's only one, that means it's not even getting to the stage where it runs ffmpeg yet.

Try the following:

1. Make sure you have a job file sitting in the Jobs dir.
2. In the compressor dir, delete the "ffmpegPickup.log" file (if there is one).
3. Run ffmpeg_convert.
4. See if the log file ("ffmpegPickup.log") is generated. If not, the path to the Jobs dir in your "properties.xml" file is probably wrong. If one is generated, post the contents here (although there may not be much in there).

- Neil.

Crim
08-27-2004, 01:20 PM
It's a single DOS box.

1.) Yeah I always check on that
2.) I'm not seeing an ffmpegPickup.log
3 and 4.) Yeah it's not getting created. :(

I haven't messed with the Compressor Prop file:

<Pickup_Location>.\Jobs</Pickup_Location>
<Pickup_File_Extension>.xml</Pickup_File_Extension>
<Create_MY_File>True</Create_MY_File>
<Activity_Log>.\activity_log.xml</Activity_Log>


Heres my ffmpeg_convert file:

Java_Executable_Path=C:\Program Files\Java\jre1.5.0\bin\java.exe
Class_path_to_use=.
Class_to_run=ffmpegPickup
Args_if_any=
Java_run_minimized_no_focus=true
Extern_run_minimized_no_focus=true


And my Sage file:

mlbdude/compress_job_folder=C\:\\Program Files\\Frey Technologies\\SageTV\\Compressor\\Jobs
mlbdude/compress_target_root=E\:\\Compressed


And yes I only edit them when Sage is not loaded.

Bubster
08-27-2004, 01:52 PM
OK, try this:

1. Open a command window and "cd" into the Compressor dir.
2. Type "java ffmpegPickup" and hit RETURN. If it says it can't find java, you'll need to provide the full path to your java.exe instead of just "java" on its own.
3. This will show you what the program in the DOS box was trying to do before disappearing.
4. Post the output (if any) here.

- Neil.

Crim
08-27-2004, 02:23 PM
Okay heres what I get:

Bubster
08-27-2004, 02:35 PM
The lines in your output which read:

Pick up location:
Pick up file extension:

Should read:

Pick up location: .\Jobs
Pick up file extension: .xml

Or something very similar.

Can you post the properties.xml file you're using?

I also notice that your ffmpeg parameters have the -g and -bf flags set, which weren't in the stuff I just posted (at least I don't think they were). Are you using that stuff, or a setup from stuff posted previously?

- Neil.

Crim
08-27-2004, 02:40 PM
I posted my stuff a few posts up (or atleast I think I did).

I haven't edited the ffmpeg file so thats how I got after it was DLed.

jcato
08-27-2004, 02:42 PM
I have a problem with ffmpeg crashing right after it starts up. When I run ffmpeg_convert, I get the 2 DOS boxes. A folder for my compressed file is created. It contains the my file and a av_ file that is about 8Kb big. So it appears to start compressing and then I get that MS send/don't send crash box.

I tried it on both my HTPC and my main computer with the same results.

Any idea on where I can start looking to find the problem?

Thanks

Bubster
08-27-2004, 02:43 PM
Can you list the files/dirs in your Compressor dir (but not the contents of any sub-dirs)?

Crim
08-27-2004, 02:49 PM
Okay heres a screen cap of the compressor folder

Bubster
08-27-2004, 02:55 PM
Ah, I see the problem. You're running on a Mac. Sage doesn't work on a Mac; get a real computer. ;)

Can you post the actual properties.xml, rather than a snippet?

Crim
08-27-2004, 02:58 PM
Win XP Home SP2, don't know where the Mac thing comes in (since I don't even have one) lol.

Okay heres the whole file:

<?xml version = "1.0" ?>
<properties>
<!-- Use . to specify the application path -->
<Pickup_Location>.\Jobs</Pickup_Location>
<Pickup_File_Extension>.xml</Pickup_File_Extension>
<Create_MY_File>True</Create_MY_File>
<Activity_Log>.\activity_log.xml</Activity_Log>
<Exe_Command>
<!-- The @symbols are for dynamic settings -->
<!-- DO NOT CHANGE THE CASE OF THE SYMBOLS, ie @INPUT does not equals @input -->

<!-- Original Value
<Value>ffmpeg -i @INPUT -deinterlace -y -f @OUTPUT_FORMAT -vcodec @VCODEC -b @VIDEO_RATE -g 300 -bf 2 -acodec @ACODEC -ab @AUDIO_RATE @OUTPUT_FORMAT</Value>
/Original Value -->
<Value>ffmpeg -i @INPUT @QUALITY @SIZE -deinterlace -y -f @OUTPUT_FORMAT @VSYNC -vcodec @VCODEC -b @VIDEO_RATE @ASYNC -acodec @ACODEC -ab @AUDIO_RATE @OUTPUT</Value>
<Enabled>True</Enabled>
</Exe_Command>
<Output_Format>
<Value>avi</Value>
<Enabled>False</Enabled>
</Output_Format>
<VCodec>
<Value>mpeg4</Value>
<Enabled>False</Enabled>
</VCodec>
<ACodec>
<Value>mp3</Value>
<Enabled>True</Enabled>
</ACodec>
<Video_Rate>
<Value>600</Value>
<Enabled>False</Enabled>
</Video_Rate>
<Audio_Rate>
<Value>128</Value>
<Enabled>False</Enabled>
</Audio_Rate>
<Library_Path>
<Value></Value>
<Enabled>False</Enabled>
</Library_Path>
<Delete_Source_On_Success>
<Value>False</Value>
<Enabled>False</Enabled>
</Delete_Source_On_Success>
<Starting_Program>
<Value>cmd.exe /c start /wait /low /min</Value>
<Enabled>True</Enabled>
</Starting_Program>
<Viewing_Size>
<Value>640x480</Value>
<Flag>-s</Flag>
<Enabled>True</Enabled>
</Viewing_Size>
<Quality>
<Value>-hq</Value>
<Enabled>True</Enabled>
</Quality>
<ASync>
<Value>1</Value>
<Flag>-async</Flag>
<Enabled>True</Enabled>
</ASync>
<VSync>
<Value>0</Value>
<Flag>-vsync</Flag>
<Enabled>False</Enabled>
</VSync>
</properties>

Bubster
08-27-2004, 03:02 PM
Originally posted by jcato
I have a problem with ffmpeg crashing right after it starts up. When I run ffmpeg_convert, I get the 2 DOS boxes. A folder for my compressed file is created. It contains the my file and a av_ file that is about 8Kb big. So it appears to start compressing and then I get that MS send/don't send crash box.

I tried it on both my HTPC and my main computer with the same results.

Any idea on where I can start looking to find the problem?

Thanks

The first thing to try is running ffmpeg on its own, with a command line like the following on one of your MPGs in your Sage video dir:

ffmpeg -y -hq -i INFILE.mpg -f avi -b 1600 -vcodec mpeg4 -acodec mp3 -ab 128 -deinterlace -async 1 OUTFILE.avi

Replace INFILE with the name of one of your Sage MPGs, and OUTFILE with a name of your choosing.

- Neil.

Bubster
08-27-2004, 04:34 PM
Originally posted by Crim
Win XP Home SP2, don't know where the Mac thing comes in (since I don't even have one) lol.

You have some windows theme that looks like a Mac from a couple of years ago, so I felt obliged to poke fun at it. :)

I've attached a replacement ffmpegProcessor.class which give a little more debug output. Can you put it in place of the one you have just now, and then use the following command:

java ffmpegPickup >out.txt

This will stick the output in a file called out.txt. If you post that here, I might have a better idea of the problem.

- Neil.

Muchacho
08-27-2004, 06:32 PM
I had it working well, but updated to Bubsters builds and set it up his way so I was using the same set up. Now I am havign audio sync issues- the video is like 1 second behind. I dont know what the problem is- I figured it had to do with -async so I set it up manually and still have the issue. Here is the settings file- Any ideas? Thanks for the help.

<Value>ffmpeg -i @INPUT @QUALITY @SIZE -deinterlace -y -f @OUTPUT_FORMAT @VSYNC -vcodec @VCODEC -b @VIDEO_RATE -async 1 -acodec @ACODEC -ab @AUDIO_RATE @OUTPUT</Value>
<Enabled>True</Enabled>
</Exe_Command>
<Output_Format>
<Value>avi</Value>
<Enabled>True</Enabled>
</Output_Format>
<VCodec>
<Value>mpeg4</Value>
<Enabled>True</Enabled>
</VCodec>
<ACodec>
<Value>mp3</Value>
<Enabled>False</Enabled>
</ACodec>
<Video_Rate>
<Value>1200</Value>
<Enabled>True</Enabled>
</Video_Rate>
<Audio_Rate>
<Value>128</Value>
<Enabled>True</Enabled>
</Audio_Rate>
<Library_Path>
<Value></Value>
<Enabled>False</Enabled>
</Library_Path>
<Delete_Source_On_Success>
<Value>False</Value>
<Enabled>False</Enabled>
</Delete_Source_On_Success>
<Starting_Program>
<Value>cmd.exe /c start /wait /low /min</Value>
<Enabled>True</Enabled>
</Starting_Program>
<Viewing_Size>
<Value>640x480</Value>
<Flag>-s</Flag>
<Enabled>True</Enabled>
</Viewing_Size>
<Quality>
<Value>-hq</Value>
<Enabled>True</Enabled>
</Quality>
<ASync>
<Value>1</Value>
<Flag>-async</Flag>
<Enabled>True</Enabled>
</ASync>
<VSync>
<Value>0</Value>
<Flag>-vsync</Flag>
<Enabled>False</Enabled>
</VSync>

Bubster
08-27-2004, 07:29 PM
Originally posted by Muchacho
I had it working well, but updated to Bubsters builds and set it up his way so I was using the same set up. Now I am havign audio sync issues- the video is like 1 second behind. I dont know what the problem is- I figured it had to do with -async so I set it up manually and still have the issue. Here is the settings file- Any ideas? Thanks for the help.

What happens if you enable the mp3 flag in the properties file?

It will use mp2 if that's not enabled. Which should work, but I haven't really used it in mp2 mode, so I can't say for certain.

jcato
08-27-2004, 08:09 PM
Originally posted by Bubster
The first thing to try is running ffmpeg on its own, with a command line like the following on one of your MPGs in your Sage video dir:

ffmpeg -y -hq -i INFILE.mpg -f avi -b 1600 -vcodec mpeg4 -acodec mp3 -ab 128 -deinterlace -async 1 OUTFILE.avi

Replace INFILE with the name of one of your Sage MPGs, and OUTFILE with a name of your choosing.

- Neil.

Thanks! That line worked. The other one had the flag -s 640x480 and that seemed to be causing the problem. I disabled that and the program now it works.

Thanks again!

Muchacho
08-27-2004, 08:40 PM
I changed it back to mp2 to see if I could fix it... I gives me the async problem both ways.

Bubster
08-27-2004, 09:13 PM
Originally posted by Muchacho
I changed it back to mp2 to see if I could fix it... I gives me the async problem both ways.

Might be worth trying "-vsync 0"...

Crim
08-27-2004, 09:31 PM
Okay I'll give the new file a try tomorrow since I'll sometime for it then.

Muchacho
08-28-2004, 06:48 PM
Well I figured out that my audio synch issues are related to the recorded file. Sometimes it seems that when my HD has to turn on the first few seconds are a bit funny. This is not a problem for me usually b/c I usually have a decent padding. The mpg regains synch and plays fine, but the encoded mpeg4 is off. It doesent matter if async, vsync are on, or what codec I am using to encode video or sound. I guess if I edited out the initial problemed part it may work clean, but that sorta defets the purpose....

Also I have the audio drop out on long files. It is not always noticible on the -t 30 test either. Bubster if you want me to upload some of it to the ftp let me know. It doesent seem to be up or something.

I will keep trying things, but I am running out of ideas. Thanks for the hep!

Bubster
08-29-2004, 05:00 AM
Originally posted by Muchacho
Well I figured out that my audio synch issues are related to the recorded file. Sometimes it seems that when my HD has to turn on the first few seconds are a bit funny. This is not a problem for me usually b/c I usually have a decent padding. The mpg regains synch and plays fine, but the encoded mpeg4 is off. It doesent matter if async, vsync are on, or what codec I am using to encode video or sound. I guess if I edited out the initial problemed part it may work clean, but that sorta defets the purpose....

Hmm. The -async flag in ffmpeg is for this exact purpose. Did you try it with "-async 1 -vsync 0" (i.e async on but vsync off)? AFAIK, you don't want both enabled at the same time, but one or the other.

Also I have the audio drop out on long files. It is not always noticible on the -t 30 test either. Bubster if you want me to upload some of it to the ftp let me know. It doesent seem to be up or something.

When you say it's not always noticable on the 30 sec test, do you mean the problem sometimes goes away when the output size is reduced, or that the audio dropout sometimes happens after 30 secs? If it's the latter, then people can always use -t 60 or whatever to ensure they reach the dropout point. The 30 was only chosen because people were getting dropouts at around the 10 second mark, so it seemed like a decent level of margin.

My ftp server failed to start when I rebooted it, but it's back up now. It would be good if you could upload a small test output with the audio dropout in it so other people can try it and see if it happens to them.

Also, if you can chop one of your Sage MPEG2 files down to a decent size (or do a very short recording or something), one which has the synch problem, and upload that as well, I can try it here, or even post it to the ffmpeg list and see if the maintainer can figure out why it isn't synching properly. If you're going to be uploading something pretty big, PM me and let me know so I don't reboot while you're uploading. :)

- Neil.

Muchacho
08-29-2004, 06:12 AM
I will let you know when I have all the files ready to go- I have deleted them seeing as they were unwatchable. I will make sure that the problem still is there when I reduce the bitrate and resolution to make the files small.

Muchacho
08-29-2004, 08:26 AM
I am uploading examples of the audio synch issue. I guess I should upload a segment of the origional mpg, but need to get a utility to cut it... I found a simple workaround if I use -ss to skip forward 30 sec (the messed up part of the video is only the first 10-20 sec) the audio synch is fine. It would be nice if I could fine a ffmpeg command to actually just start the encoding 30 sec into the file so that the initial part is just not there.

The audio dropout issue is odd- I having a hard time recreating it with short tests (ie t -60, t- 120). What is interesting is that the output file is like 5 seconds longer than the -t specified and those last 5 sec do not have sound. So it I make it -t 60 the audio drops out 5 sec before the end of the video, and if I do t -120 it looses sound 5 sec before the video. When I do the whole file it goes out at like 30 sec. Makes me wonder if I manually specified the -t to do the whole show, that it may work. I will let you know. Thanks

Tej
08-29-2004, 03:22 PM
Originally posted by Muchacho
... It would be nice if I could fine a ffmpeg command to actually just start the encoding 30 sec into the file so that the initial part is just not there....
`-ss position'
seek to given time position. hh:mm:ss[.xxx] syntax is also supported.

Muchacho
08-30-2004, 11:47 AM
I am noticing now that even if I fix the audio asynch in the beginning, it again looses synch later in the video. Odd thing is is that the same thing happens in autoGK. Makes me wonder if it has to do with my recording properties. I just have it set the the Best setting. What recoedign settings are you all using?

JUC
08-31-2004, 08:34 AM
I just compressed a 3 gig file down to a 1.25 gigs but I lost audio after 5 seconds. This was a 1.5 hour show. This was the largest file I have compressed so far and all others have worked fine (they were all 30 minute shows). Any thoughts. I am using the current versions of the ffmpeg_compress.
thanks
JUC

Crashless
08-31-2004, 10:37 AM
Originally posted by Muchacho
I am noticing now that even if I fix the audio asynch in the beginning, it again looses synch later in the video. Odd thing is is that the same thing happens in autoGK. Makes me wonder if it has to do with my recording properties. I just have it set the the Best setting. What recoedign settings are you all using?

How fast is your computer? Is the CPU usage maxed out? I have found on my laptop (PIII400) that I have to turn the playback quality slider all the way down in order to play full sized divx without the video going out of sync.

Bubster
08-31-2004, 01:56 PM
Originally posted by JUC
I just compressed a 3 gig file down to a 1.25 gigs but I lost audio after 5 seconds. This was a 1.5 hour show. This was the largest file I have compressed so far and all others have worked fine (they were all 30 minute shows). Any thoughts. I am using the current versions of the ffmpeg_compress.
thanks
JUC

Can you compress the same file using the same parameters, but with "-t 30" (or 60), and see if that short clip still drops sound after 5 secs? If it does, can you upload it to my ftp server and I'll see if it works here?

- Neil.

JUC
08-31-2004, 03:09 PM
Neil, I tried to insert the '-t 30' into the line posted below but I am unclear where it goes. You'll see where I put it but I couln't get ffmpeg_compressor to run with it where it is. Do I need to delete something? Here's the line:

<Value>ffmpeg -i @INPUT @QUALITY @SIZE -deinterlace -y -f -t 30 @OUTPUT_FORMAT @VSYNC -vcodec @VCODEC -b @VIDEO_RATE @ASYNC -acodec @ACODEC -ab @AUDIO_RATE @OUTPUT</Value>

Thanks
JUC

Bubster
08-31-2004, 03:13 PM
Originally posted by JUC
Neil, I tried to insert the '-t 30' into the line posted below but I am unclear where it goes. You'll see where I put it but I couln't get ffmpeg_compressor to run with it where it is. Do I need to delete something? Here's the line:

<Value>ffmpeg -i @INPUT @QUALITY @SIZE -deinterlace -y -f -t 30 @OUTPUT_FORMAT @VSYNC -vcodec @VCODEC -b @VIDEO_RATE @ASYNC -acodec @ACODEC -ab @AUDIO_RATE @OUTPUT</Value>

Thanks
JUC

The "-f" and the "@OUTPUT_FORMAT" are tied together, so you can't put it between them. Just move the "-t 30" before the "-f" and you should be fine.

- Neil.

JUC
09-01-2004, 04:42 AM
alright, I got the 30 second clip to work fine. I am now in the middle of compressing the original 1:30 minute show again to see if it works. I noticed that with the one that didn't work, the timeline only showed it being 1:11 (not 1:30). Well see...

Muchacho
09-01-2004, 01:12 PM
Originally posted by Crashless
How fast is your computer? Is the CPU usage maxed out? I have found on my laptop (PIII400) that I have to turn the playback quality slider all the way down in order to play full sized divx without the video going out of sync.

1.6 GHz, I dont think it is the problem. It may be by MB which is one of the first athlon XP MB made or excesive HD fragmentation. I think I am going to try another MB and see what happens. I am pretty confident that the origional mpg file is currupt.

JUC
09-02-2004, 04:56 AM
Well, I tried to compress my 1 hour and 30 minute file again hopeing that the audio woudln't drop out after 5 secs....But it did again!!! The 30 sec. clip worked fine however but the 1:30 clip drops out and is only showing up as 1:11 minutes? That seems a little odd. The original works great though. I think I will try compressing another file of around the same length and see what happens. Any help. Thanks
juc

Bubster
09-02-2004, 05:20 AM
Originally posted by JUC
Well, I tried to compress my 1 hour and 30 minute file again hopeing that the audio woudln't drop out after 5 secs....But it did again!!! The 30 sec. clip worked fine however but the 1:30 clip drops out and is only showing up as 1:11 minutes? That seems a little odd. The original works great though. I think I will try compressing another file of around the same length and see what happens. Any help. Thanks
juc

OK, so when you compress the entire file, you get audio dropout after 5 secs. When you compress it with "-t 30", you get audio for the full 30 secs (or pretty close to it). Is that right?

Can you try the same movie with larger "-t" values (e.g. 300 might be a good test), to see if the dropout starts happening? It would be interesting to know how long the clip needs to be before the 5-10 second dropout kicks in. Assuming you can get a short(ish) clip that drops out after a few secs, it would be good if you could stick it on my ftp server so I can try it here.

- Neil.

JUC
09-02-2004, 05:55 AM
I'll try it with -t 300 and see if I can get it to drop out. I have however, compressed 30 minute clips with no dropouts.

JUC
09-02-2004, 06:22 AM
Hey Bubster, BTW thanks for helping me through this. Anyway, I got the 5 minute clip to work fine. So, something is happening later down the compression. I know I won't be able to upload it but should I try compressing an hour clip from the same recording?
JUC

JUC
09-03-2004, 05:19 AM
bump

Bubster
09-07-2004, 05:28 PM
Originally posted by JUC
Hey Bubster, BTW thanks for helping me through this. Anyway, I got the 5 minute clip to work fine. So, something is happening later down the compression. I know I won't be able to upload it but should I try compressing an hour clip from the same recording?
JUC

Hi, sorry, wasn't paying attention for the last week or so.

I'm a bit out of ideas on this. How long (roughly) does the recording have to get before the sound starts dropping out near the start? You'll probably have to try a few experiments to figure that out, if you've got some time (and lots of patience).

I'm now at the stage where a question to the ffmpeg mailing list is probably required. Any info you can provide about the above would be very useful. They're quite "terse" on the ffmpeg list, so I might not get very far without plenty of info to give them.

- Neil.

JUC
09-08-2004, 05:04 AM
alright, ill do some 'test' compressions tonight and see where I get. I tried another 2 hour file and the same thing happened--sound dropped out after 5 or 6 sec. and it only showed up as 1 hour 11 minutes. I also tried a 30 minute clip and the audio worked fine for the whole thing, but it was only showing up as 27 minutes and 33 sec.---kind of weird. I am using the default settings for compression. I will try an hour show and see where that gets me to give you some more info. Let me know what else you may need. Thanks
JUC

Bubster
09-08-2004, 05:24 AM
Originally posted by JUC
alright, ill do some 'test' compressions tonight and see where I get. I tried another 2 hour file and the same thing happened--sound dropped out after 5 or 6 sec. and it only showed up as 1 hour 11 minutes. I also tried a 30 minute clip and the audio worked fine for the whole thing, but it was only showing up as 27 minutes and 33 sec.---kind of weird. I am using the default settings for compression. I will try an hour show and see where that gets me to give you some more info. Let me know what else you may need. Thanks
JUC

Just to check, when you talk about a 30 min clip, you do mean a 2 hour source video compressed with the "-t" flag to restrict output to 30 mins, is that right?

- Neil.

JUC
09-09-2004, 06:25 AM
actually, I just meant a 30 minute source file being compressed without the "-t" flag. I was just trying this to see if it worked--and it did, because the 2 hour file without the "-t" flag didn't. I will try a 2 hour file and keep trying different "-t" values so I can pinpoint for you where the sound is dropping out. This may help.
JUC

JUC
09-10-2004, 08:38 AM
alright, I did some testing with a 2 hour source file. Using the -t values set to compress the first 30 minutes, 60 minutes, 90 minutes this is what i found. The 30 minute clip worked fine. The 60 minute clip worked fine. The 90 minute clip did NOT and resulted in the same 1:11 minute file as the 2 hour show (and the audio drops out completely after 5-6 sec.. So, something is happening between 1 hour and 2 hours in my compression. Let me know what else you may need. Thanks
JUC

Bubster
09-10-2004, 09:01 AM
So, as well as losing sound after 5-6 secs, the total time of the video is coming out at 1:11 (as in 1 minute, 11 secs), is that right?

Does that always happen to you, or have you ever had the audio dropout, but a reasonable sized video length (not exactly the same as the source, but close)?

- Neil.

JUC
09-10-2004, 09:48 AM
Neil, sorry I wan't clearer, the video is coming out at 1 hour 11 minutes. Everytime I had the audio drop out (which so far is only for shows over 1 hour) the time stamp indicates 1 hour 11 minutes. This is for both 1 hour and 30 minute clips as well as 2 hour clips (this is all from a 2 hour show compressed using different -t values to control how much is compressed). Hope this helps
JUC