Log in

View Full Version : sx264 - qt based x264 gui (Linux&Windows)


Pages : 1 2 3 4 [5] 6 7 8 9 10 11 12 13 14 15

Selur
24th April 2009, 13:39
rev518

*changed*
- calculating framecount if mediaInfo analyser missed it but has frame rate and length
- keeping temp files if output was not created during muxing
- behaviour when target bitrate collides with restrictions
- .m2ts overhead calculation (lower video, higher audio overhead)
- using lavcopts again, which should help multihreading when filtering
- audio delay handling

*cosmetics*
- changed job manager view

*fixed*
- mplayer analyser audio and .dvr-ms handling
- .stats file naming
- problem when muxing with tsmuxer

*added*
- drag&drop support for video input
- mutlifile input support (using settings selected for 1st file)
- option to downsample dts-hd to dts when using tsmuxer as muxer
- option to automatically create the outputname: 'default output path'+'input filename'+"."+'default extension'
- 'default output path' can be set under: Misc -> Paths
- 'default extension' can be set under: Misc->Encoding, Compatibility and Output->Output Settings->Standard output container
- additional framerates for framerate convertion

-> updated downloads in first post

Riki
24th April 2009, 20:31
Amazing! I cant tell you how much time this saves me, I highly recommend this app.

On a side note, I attached the settings I use for streaming on the web if anyone wants to check them out. I found them to work very well.

Could you or anyone take a look and let me know if there is anymore I could do to improve my output?

My goal is: Smallest filesize possible, Highest Quality possible, and fast playback. I dont care about encoding time because I have a mac pro with 8 cores and it seems to encode very fast, around 20fps with my current settings.

Here are a few things I did and would like some advice on because some of this I dont quite understand.

1. I decreased the reference frames and bframes because there were some playback issues in quicktime (image would get all messed up during playback) and also to increase playback speed.

2. Im going with a 28.00 constant rate because its hard to choose a bitrate and have it fit all the different types of videos. Some have tons of fullscreen motion and others have none and even others are mixed.

3. Increasing Chroma Boost to 12 seemed to make the filesize go down, and I dont seem to see any quality differences.

4. I went with main profile 3.1 to increase playback speed. This actually made a HUGE difference compared to high.

5. I dont understand settings like Quantizer min/max, Quantfactor I P and B, Max quantizer different, Deadzone, and all the Rate Control Settings. Perhaps there are some tweaks in there to help?

Selur
24th April 2009, 20:35
About the settings: it might helpt if you open x264 commandline view and post your settings. ;) (so others don't have to wait for a moderator to approve the attachment ;))

Cu Selr

Riki
24th April 2009, 21:13
oops, Im not sure if this is correct but..


x264 --crf 28 --level 3.1 --ref 3 --keyint 250 --min-keyint 25 --scenecut 40 --bframes 10 --b-bias 0 --b-pyramid --weightb --direct spatial --b-adapt 2 --cplxblur 20 --qcomp 0.6 --qblur 0.5 --qpmin 1 --qpmax 51 --qpstep 4 --ipratio 1.4 --pbratio 1.3 --chroma-qp-offset 12 --partitions i4x4,p4x4,p8x8,b8x8 --me esa --merange 16 --mvrange 512 --subme 9 --mixed-refs --trellis 2 --no-fast-pskip --no-dct-decimate --aq-mode 1 --aq-strength 1 --deadzone-inter 11 --vbv-maxrate 14000 --vbv-bufsize 14000 --threads auto --filter -1,-1 --no-psnr --no-ssim --progress --fps 12 --output

Selur
24th April 2009, 21:27
here some comments from me:
"-me esa" is probably overkill umh (multi-hexagonal) should be fine and a lot faster :) (for most sources one really can't tell the difference when viewing)
"--direct spatial" personally I would select 'auto'
I would also set "--psy-rd" to "1:0.3" (Psy RD/trellis strength)
You can also try to enable 'Allow P4x4 for all levels' under misc->compatibility + p4x4 under Macroblock settings, which might help a bit and will probably cause no problem with quicktime (haven't tested).

Cu Selur

Riki
24th April 2009, 21:38
Thanks, Ill try that and let you know the results

Selur
24th April 2009, 22:38
rev519

*fixed*
- delay moved to muxing when using neroaacenc
- collision when multiInput met parallel encodings

-> updated downloads in first post

Riki
25th April 2009, 03:34
Thanks, all of that is great, except for this

I would also set "--psy-rd" to "1:0.3" (Psy RD/trellis strength)

That made the fielsize significantly bigger.

I found a small bug. When loading a profile the resize only resizes the height, and the auto width doesn't get propagated. I have to toggled the mod setting to get it to update.

Do you accept donations?

Selur
25th April 2009, 06:53
Do you accept donations?
Thanks, but none needed (software is not even beta;)) atm.
When loading a profile the resize only resizes the height, and the auto width doesn't get propagated. I have to toggled the mod setting to get it to update.
Will have a look at it tomorrow. (got a lot to do today, so won't probably find any time ;))
Would be nice If you could specify a bit more what you did and may be send me a profile with the problem via PM.
It's probably only a small bug. -> think I would the problem, will send you a pm

Cu Selur

Riki
25th April 2009, 16:28
Thanks, Im doing a huge test right now with compressing around 200 files. One thing that would help me but it is a minor thing, is to be able to select an output folder and have the files get dumped into there, but inherit the filename.

The reason is some of the files I encode are already mp4 so I get the _reencode suffix.
Its not really a huge deal because I use Directory Opus as my explorer and it has a renaming function to remove characters.

Ill send you a pm about the other fix you sent. :)

Riki
26th April 2009, 03:22
Im not sure if I asked this already but is there a way to set the audio to be mono? I dont seem to see the option and not sure if it has been removed or was never there.

Selur
26th April 2009, 08:44
you can select the output folder by setting a default ouput folder. ;)
void X264Model::autoNameOutput(){
if(this->isClone || !this->findChild<NBoolValue *>("autoOutput")->boolValue()) return;
emit sendMessage(DEBUG, "autoNameOutput called");
if(!this->findChild<NBoolValue *>("dvdInput")->boolValue()){
QString path = this->findChild<NValue *>("defaultOutputPath")->value();
QString input = this->findChild<NValue *>("videoInput")->value();
QString videoInput = input;
emit sendMessage(DEBUG, "autoNameOutput input: "+input);
input = input.replace("\\", "/");
input = input.remove(0, input.lastIndexOf("/")+1);
input = input.remove(input.lastIndexOf("."),input.size());
input = QDir::toNativeSeparators(path+QString((path.isEmpty()) ? QString("") : QDir::separator()))+input;
input +=".";
QString container;
switch(this->findChild<NRangeValue *>("outputContainer")->intValue()){
case 1 : container = "mkv"; break;
case 2 : container = "m2ts"; break;
case 3 : container = "264"; break;
default : container= "mp4"; break;
}
input += container;
if(QFile::exists(input)){
input = input.replace("."+container, "_reencode."+container);
}
emit sendMessage(DEBUG, "autoNameOutput output: "+input);
this->findChild<NValue *>("out")->setValue(input);
}
}

Im not sure if I asked this already but is there a way to set the audio to be mono?
haven't implemented any downmix since ffmpeg can't downmix audio and mencoder normally doesn't handle audio raw well. (it's possible but kind of a pain)

Emess
26th April 2009, 12:41
Im not sure if I asked this already but is there a way to set the audio to be mono? I dont seem to see the option and not sure if it has been removed or was never there.You should be able to demux your audio from your source and open it in say, Audacity, downmix to mono, and then add it as an external audio file.

Haven't found the time to investigate how to write a .desktop file with an icon. :)
iirc the .desktop file should look like e.g.:
[Desktop Entry]
Exec=sx264
Type=Application
Icon=sx264.png
but I'm not sure where to but the png file or if a .png file is even allowed as icon ;)

Cu SelurWindows won't like it (unless it's changed since win2k) but *nix is fine with PNG icons. The default location iirc is /usr/share/icons, however you can use a full path in the .desktop file like $sx264dir/icon.png where sx264dir is the directory where profiles and whatnot are in ~/.sx264. If using /usr/share/icons, be aware that it generally likes multiple sized copies of your icons in the hicolor directory, at least last I checked.

Request: Ability to open named pipes as video sources. I like to use avs2yuv for example to load avisynth scripts in x264 or mencoder, or sometimes I use mplayer and -vo yuv4mpeg:file=mypipe.y4m, is there a way sx264 could maybe buffer the first frame to get the resolution? Obviously there would be no audio and the user would need to set the framerate themselves.

E~

Selur
26th April 2009, 12:47
resolution wouldn't be enough, length, framerate, par, famecount would also be needed, if mplayer an open such a pipe through 'mplayer and -vo yuv4mpeg:file=mypipe.y4m' and it's able to provide all the needed infos via mplayer -identify -vo yuv4mpeg:file=mypipe.y4m, integration into sx264 would probably not much of a problem.

Riki
26th April 2009, 15:53
The strange thing about the audio is the input source is already mono, and the nero encoder converts it to stereo, is there any way to leave it mono?

As for the output path, thanks! When I saw it greyed out I thought it wasnt an option, now I see the checkbox at the top. :p

Selur
26th April 2009, 16:52
Strange, does sx264 recognize the file as mono? (audio channels = ?)
Got no mono file here, but if you upload it somewhere and send me link via pm I'll look into it tomorrow. ;)

Riki
26th April 2009, 21:28
yeah sx26 says 1 audio channel. I did a test with an existing mono audio file and the filesize ended up being exactly the same, so Im not worried about it. I was getting the info from mediainfo. I thought it may have been forcing it to 2 channels and bloating the filesize, but its not.

Riki
26th April 2009, 22:34
Here is something else interesting. I unchecked MP4 hinting and it made the filesize lower and still works just the same on a streaming server. I thought for sure this was needed but I guess its not.

Selur
27th April 2009, 07:43
@Riki: if you need mp4 hinting or not depends on the streaming server you need, some hint the content on the fly iirc. ;)

just tested the mono audio thing with neroaacenc:
got no problem here, reencoding the mono audio creates a mono aac output,..-> if your system gives stereo output it's probably the fault of the decoder used. ;)

@Emess: About y4m pipe/input: The problem is mplayer doesn't give any infos about length or framecount. Without framecount or length size calculation, showing progress during muxing/encoding etc. isn't possible. I probably could write some workarounds to force mplayer as analyser, mencoder as decoder, only allow 1pass encoding, showing no process and ignoring the missing length and frame count, but would it be worth the effort?
Since I don't use wine under linux I'm not sure, but if mplayer can playback avisynth files as input I can tweak sx264 to accept .avs input under linux too. (might even work atm., with some small bugs, when selecting mplayer as analyser and mencoder as decoder) ;)

Cu Selur

Selur
27th April 2009, 09:11
rev520

*fixed*
- auto adjusting resolution on profile load (with auto adjust hieght/width)
- mkv delay handling

-> updated downloads in first post

Emess
27th April 2009, 10:30
@Emess: About y4m pipe/input: The problem is mplayer doesn't give any infos about length or framecount. Without framecount or length size calculation, showing progress during muxing/encoding etc. isn't possible. I probably could write some workarounds to force mplayer as analyser, mencoder as decoder, only allow 1pass encoding, showing no process and ignoring the missing length and frame count, but would it be worth the effort?
Since I don't use wine under linux I'm not sure, but if mplayer can playback avisynth files as input I can tweak sx264 to accept .avs input under linux too. (might even work atm., with some small bugs, when selecting mplayer as analyser and mencoder as decoder) ;)

Cu Selur
MPlayer cannot load avs files, but what I do at the moment is run avs2yuv via wine, and output that to a pipe. I then load that in x264. Sometimes I do a similar thing with mplayer, but either way, once it starts reading from the pipe, I do not think it can seek to go back, so opening info from it would require reinitialising it as far as I can tell. Maybe have a check on the input extention, if it fits one of the standard pipe extentions (usually .y4m or .yuv,) then have a small popup asking the user to fill in info like the resolution, the par, the framerate, the framecount, etc?

E~

Selur
27th April 2009, 10:48
MPlayer cannot load avs files,..
:( (damn, works under windows ;))

have a small popup asking the user to fill in info like the resolution, the par, the framerate, the framecount, etc?
Nope, not a way to go for me. ('Only trust the user if you definitely have to.' ;))

Another idea: could you test if avsinfo works through wine? If avsInfo would work, it should be able to provide the infos needed. When getting a .y2m/.yuv file sx264 could then look for the .avs file (assuming it's in the same dir as the pipe) and analyse the .avs file with avsInfo (wine avsInfo.exe input.avs).
Assuming avsInfo does work through wine, I patched the sources (http://www.selur.info/sx264Source.zip) to check on .y2m/.yuv input if a .avs file exists an if so to call 'wine avsInfo.exe input.avs' to analyze the content.

Cu Selur

Emess
27th April 2009, 18:37
I haven't got a copy of avsInfo to test with, but it sounds like it'd be mostly for avs scripts rather than any old yuv pipe, not that I can find a webpage for it or anything. From what you said though, how would it proceed if there is no avs script, and instead it's being generated from mplayer?

Seeing as I can't find it, are you able to link me a binary of avsInfo from somewhere, or at least a link to a thread or page about it? :3

E~

Selur
27th April 2009, 20:10
here you go http://www.selur.info/sx264/avsInfo.zip ;)
and yes it's ment for .avs input wouldn't help with 'any old yuv pipe' and unless there's an automated way to get framecount/length I don't see me integrating support for it in sx264.

Selur
28th April 2009, 09:13
Assuming all .yuv/.y4m files start with something like:
YUV4MPEG2 W640 H352 F25:1 Ip A1:1
and frame count can be determined by counting the occurrence of "FRAME" in the input, I implemented a simple method that parses the input and should analyse such files. ;)
Updated the test sources (http://www.selur.info/sx264Source.zip), would be nice if someone could post if this works. ;) (tested it only with a small raw file and not with a pipe)
-> seems like only YUV4MPEG2 output is that easy to analyse -> only analysing y4m input ;)

Cu Selur

Riki
29th April 2009, 14:14
Ive been doing many more tests and one idea that I think could benefit some people is the ability to change the parallel jobs number from the job control. So for example if you have many encodes sometimes you need to limit it to 1 encode while you work, and when you leave to crank it up to 4 or so.

Selur
29th April 2009, 14:45
adding an additional control isn't a problem, will send you a pm with a test version,...

roozhou
30th April 2009, 08:12
Hi Selur,

Here is how to add Lagarith support to mplayer/mencoder
Add the following lines to mplayer/codecs.conf and put lagarith.dll inside mplayer's directory or C:\WINDOWS\system32

videocodec lagarith
info "Lagarith Lossless Video Codec"
comment "http://lags.leetcode.net/codec.html, requires an MMX2 CPU."
status working
fourcc LAGS
driver vfw
dll "lagarith.dll"
out BGR32,BGR24 flip

Selur
30th April 2009, 08:37
thought about adding support to other codecs, that are not natively supported but went against it, since I would end up having to check:
a. license issues that might arise
b. add each additional .dll to the downloads (iirc LorD_MuldeR got a nice collection of .dlls that come with SMPlayer)
-> this might come on a later note, but since the user base is rather small atm. and most people that need more exotic codecs normally now how to add mencoder support on their own, it's easier to not add a .dll package +(.conf file) to the downloads. ;)

Cu Selur

Ps.: Personally I use CanopusHQ as an additional codec.

Emess
30th April 2009, 16:44
I'll test that y4m thing when I install the new machine. Lagarith is an awesome codec, but it doesn't run natively in Linux, at least not last I tried. I'd assume the aim of sx264 using Qt would be for multi platform compatibility, so that kind of defeats the purpose.

E~

Selur
30th April 2009, 16:49
One can decode Lagarith under linux very similar to the way roozhou posted for windows, .dlls normally lie in /usr/lib/codecs and codecs.conf in /etc/mplayer, but yes one of the main goals is multi platform compatibility. ;)

Cu Selur

Riki
30th April 2009, 19:38
Would you know why I get messed up audio playback in quicktime when I use sx264? It pops and pauses and stuff like that.

Selur
30th April 2009, 19:44
1st guess: high CPU usage (on windows I use SetPriority which sets all processes to idle and under linux I leave it to the OS)

Riki
30th April 2009, 19:47
I thought about that too, but I did alot of tests and used multiple computers and its definitely a problem with the encoding. It doesn't do it with my other encodes. I have an 8-core mac pro so I know the computer can handle it. The other encodes I have are from megui, super, adobe media encoder, etc.

Riki
30th April 2009, 19:48
Also, the playback is fine in media player classic, just messes up in quicktime.

Selur
30th April 2009, 19:53
To get this right:
Do you have problems playing material created with sx264 or are you having problems with playback in quicktime while encoding?

If it's playing back content which is created by sx264 do a quick test with audio disabled to check if it's an audio problem.
If it's an audio problem: post which settings you selected in the audio register. :)

Cu Selur

Riki
30th April 2009, 19:57
Basically its an audio only problem with content encoded with sx264 and played back in quicktime. (if that makes since :p)

The audio settings are:
aac
32 kb
22050
everything else is default

I just noticed the mp3 option, I could try that too and see if it fixes it.

Selur
30th April 2009, 20:04
strange, when you would have said you selected NeroAACEnc the problem would be that quicktime sucks at aac-he, but ffmpeg/mencoder both should use faac which afaik only uses aac-lc,...
-> yo could try to:
a. use a higher sample rate e.g. 48000
b. use a higher bitrate e.g. 128 kb

Cu Selur

Riki
30th April 2009, 20:07
I dont see nero as an option. I did put the nero encoder into the root of the sx264 folder. The problem is I need the filesize as small as possible, hopefully mp3 will help with this, or another aac encoder? (are you referring about about mencoder/ffmpeg?)

Selur
30th April 2009, 20:11
I dont see nero as an option.
between the 'Audio format' DropDown and the 'Save'-Button, should be a 'Nero AAC' checkbox,...
sx264 uses NeroAACEnc as aac encoder when 'Nero AAC' is checked, otherwise it uses faac which is a part of mencoder/ffmpeg.

Cu Selur

Riki
30th April 2009, 20:13
Ahh! I didnt notice it because its greyed out. How do I ungrey it so I can test it out? All my other tests were with nero encoder so it should help.

Riki
30th April 2009, 20:16
I figured it out I just had to toggle to mp3 and back to aac. Now it works!

Selur
30th April 2009, 20:17
hmmm,.. another bug, it shouldn't be grayed out if aac audio is selected ;)

Riki
30th April 2009, 20:31
I was able to check it after toggling audio format but after I submit the job it greys itself out again. Im not sure if its even using nero at all. The popping was still there with Nero AAC checked.

I also tried mp3 and every time after the encode I double click the mp4 file and get this error:

Error -2041: an invalid sample description was found in the movie

Selur
30th April 2009, 20:36
Since can't reproduce the effect here, enabled debug output under misc and send me the debug file via pm, if you got a small sample of a file you can't properly reencode it might also be helpful if you could provide such a sample and the settings you used.

Cu Selur

Riki
30th April 2009, 20:38
sure, Ill send you a pm :)

Selur
1st May 2009, 07:22
rev521

*added*
- support for .y4m input (YUV4MPEG2)

*fixed*
- mix-up when forcing PAR-typ, ITU-601 and MPEG were switched
- neroaacenc wrongfully greyed out when audio input format was .aac

*changed*
- maximum parallel jobs setting adjustable in Job Control
- removed the lagarith warning so that people who want it can add support manually see: http://forum.doom9.org/showthread.php?p=1279783#post1279783

*updated*
- windows package (found a bug: delete the mplayer folder that comes with the package)

-> updated downloads in first post

Selur
7th May 2009, 20:24
rev525

*fixed*
- looping when redoing analysis
- handling of dvd with pcm stream
- vbv Buffer/max rate error that prevented encoding in some cases (on default vs. profile conflicts)
- switching to 1pass abr not changing to bitrate configuration

*changed*
- using mediaInfo to grab audio delay
- instead of 'disable auto deinterlace' and 'force deinterlace', now using 'enabled auto deinterlace' and 'enable deinterlace'

*cosmetics*
- showing current audio input info in the audio register
- showing current audio&video input info in the log register
- removed removed info-popup showing collected audio/video infos
- show info current scan type in filter register

-> updated downloads in first post

Selur
8th May 2009, 08:48
rev526

*fixed*
- tsmuxer audio handling (wrong audioId)

-> updated downloads in first post

Emess
14th May 2009, 08:07
Selur, any chance of a field for entering manual cli options, or a "super advanced" tab for all the stuff not covered elsewhere? Example being colormatrix setting or no-asm options.

E~