View Full Version : Error while compling X264
mavrick_264
19th September 2013, 10:52
Hi,
i am a newbee to the x264. i had successfully complied the H.264 on MSVS. JM 18.0 was fairly simple to build and work on. i now want to use the x264 in MSVS environment and later want to port the x264 code on a DSP platform and try my hands on it.
i was following this post: http://mediaretriever.blogspot.fr/2011/05/compile-x264-on-windows.html
i currently have MSVS 2010. i have installed MinGW with base packages like mingw developer kit, GNU c++ complier and msys-base etc.
i did not understand this part:
Add the path to MingW/bin to system path.
Where and how m i supposed to add this path?
i later opened the msys.bat (windows batch file) and tried to put command: $ cd/work/x264 . But it gives error as 'no such file or directory found'.
where am i going wrong?
May be my questions and mistakes are extremely dumb but i desperately need to get started with this.:(
Thanks.
Regards,
MD
Groucho2004
19th September 2013, 11:12
Here (http://doom10.org/index.php?topic=26.0) is everything you need to know.
For x264 (or libx264) you need a C99 compliant compiler like GNU or Intel. VS2010 does not support C99.
mavrick_264
19th September 2013, 12:09
hi Groucho2004,
thanks for your prompt reply.
i of course saw the post. i am trying it with (MSVS+MinGW+YASM). the MinGW already has the compilers for C99, i hope. and YASM should take care of the asm files in x264.
what would i need to remove that error? or compile the x264 using MinGW?
Regards.
filler56789
19th September 2013, 12:16
Add the path to MingW/bin to system path.
Where and how m i supposed to add this path?
Run regedit.exe, and edit the entry named
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment
mavrick_264
19th September 2013, 12:35
Thanks filler56789,
i have lots of entries there under the folder 'environment' with attributes: name, type and data; like windir, CLASSPATH etc.
which entry do i need change/edit (or add) and what should be put under those attributes?
Regards.
filler56789
19th September 2013, 21:21
^ There should already exist a REG_EXPAND_SZ string named "Path" :rolleyes: But if it doesn't exist, then something very-wrong has gone on, IMHO :confused:
Anyway --- as a generic and unrequested advice, one should always learn fist things first, and again IMHO, the "how-tos" of an operating system are "firster" :) than the "how-tos" of a compiler, for example ;)
http://en.wikipedia.org/wiki/Environment_variable#Microsoft_Windows
Also, I generally mistrust "installers", and the MinGW one is not an exception to this rule --- I myself use one of the "GCC full packages" from Xhmikosr's site. As for MSVC, I know nearly-nothing about it, except that it is a "necessary evil" (too much of a P.I.T.A. in my opinion). I mean, unless you have a very-good reason for using it, you really shouldn't want to use it at all.
mavrick_264
20th September 2013, 13:11
hi filler56789,
Thanks for your post.
i could now add the directory paths
(;C:\MinGW\bin;C:\MinGW\msys\1.0\bin) in the PATH value data.
but still the msys.bat is giving me the same error of file or directory not found.
Does it mean that MinGW does not have the necessary complier?
Actually, reason behind using MinGW is, i have been asked to use MinGW.
Finally at the end of the project, i am supposed to run the x264 on some DSP processor. But my guide has a say that first i have to take the code and separate out all the platform based functions
(those which do actual video processing) and system based functions(like fprintf etc.). so that it can be ported to a DSP platform by just using the libraries which have platform based stuff and removing/not including system dependent libraries.
Well, i have a question, as X264 is so popular somebody must have put this code onto DSP platform. Can i not get such code and cut off this MSVS issues of separating platform and
system dependency stuff? and work ahead on ME and prediction?
And i am newbee so really don't what comes first. I did followed your advice and read the wiki page info u adviced.
Regards.
Groucho2004
20th September 2013, 13:20
msys.bat is giving me the same error of file or directory not found.
Did you download the source with git?
Did you follow the instructions from the link I gave you in post #2?
komisar
21st September 2013, 13:37
i later opened the msys.bat (windows batch file) and tried to put command: $ cd/work/x264 . But it gives error as 'no such file or directory found'.
where am i going wrong?
try 'cd_/c/work/x264'
_ — space
mavrick_264
25th September 2013, 09:25
Hi Komisar,
Thanks for pointing out the mistake. The space thing worked!
Now i can see the path in msys window.
I was following Groucho2004's sugggestion from the scratch.
i downloaded the your (Komisar's) GCC build: mingw-w64.gcc481.ml.20130604 and i followed steps till GPAC.
But while installing Git, i got few errors which say that i don't have access to the registry. I am logged on as admin user only and i can set the permissions. But, i am not able to understand how to deal with this.
Errors are:
Error writing registry key: HKEY_LOCAL_MACHINE\software\Classes\.gitmodules RegSetValueEx failed; code 5. Access is denied
Error writing registry key: HKEY_LOCAL_MACHINE\software\Classes\.gitattributes RegSetValueEx failed; code 5. Access is denied
However, i continued installation for Git with errors.
i am not really sure where to write:
git clone git://git.videolan.org/x264.git "C:/path/to/x264folder".
i tried it in the initial commit window and committed but it says that i should add name and email.
i am not sure where to put this:
$ git config --global user.name "abc"
$ git config --global user.email abc@example.com
i tried it with initial commit window but seems that i am doing it wrong.
However, instead of using getting the code using Git, i directly downloaded it from VideoLAN.[http://www.videolan.org/developers/x264.html] and extracted it to folder path: C:\X264. (i hope that won't create any issues.)
Now i should be using the command ./configure and then make fprofiled VIDS="/path/to/downloadedYUV/file" right?
This is giving me error as shown in the image attached.
Why the config.make and config.h error might be coming?
have i done something wrong?
filler56789
25th September 2013, 10:56
While your attachment is not approved...
well, I have no idea of why the creators of GIT keep messing around with "installers" and unnecessary stuff. :mad:
All a "normal user" needs is have the following files:
getcp.exe
git-receive-pack.exe
git-upload-archive.exe
git-upload-pack.exe
git.exe
gitk
libiconv2.dll
perllocal.pod
and make sure they are in a folder included in the PATH environment-variable.
i tried it in the initial commit window and committed but it says that i should add name and email.
0_o
mavrick_264
25th September 2013, 11:30
Hi,
the image attached is of .jpg format and within 200KB only. Do i need fulfill any other criteria also for approval?
or just it will take some time?
However, i am reattaching the images. 'Rar'ed this time.
Can i add these files directly in the GIT setup(somehow to make GIT work)?
getcp.exe
git-receive-pack.exe
git-upload-archive.exe
git-upload-pack.exe
git.exe
gitk
libiconv2.dll
perllocal.pod
And will 'manually downloading of the X264 code' pose any problem?
The 'Clone' command would anyway be creating the only a copy of the code from the VideoLAN link, right?
Can i skip the GIT part then?
Or is there any solution to work with GIT?
And, most importantly, how to get rid of the config.mak and config.h error?
(Actually, i am more interested in getting the code complied than making the revisions of it through GIT.)
Thanks.
filler56789
26th September 2013, 20:59
The yasm-related error message means what it says --- you've gotten an outdated and unsuitable version of yasm. Yes, the opening post of that Doom10's thread needs an overdue update, a mod or an admin should have done it already...
(Actually, i am more interested in getting the code complied than making the revisions of it through GIT.)
Then I recommend that you undo/uninstall all that MinGW/GCC/Msys stuff, and start a clean setup. As I said before, first get one of the "GCC full packages" from Xhmikosr's site
( http://xhmikosr.1f0.de/tools/ OR http://xhmikosr.1f0.de/tools/old/ ),
they already include an up-to-date yasm.exe.
Decompress the downloaded archive, and then locate and edit the file "etc\fstab".
IF it doesn't already exist, THEN create it :) Just as an example:
#You can use a # as the first character on the line as a comment indicator.
#Blank lines are ignored.
#Win32_Path Mount_Point
E:/GCC481/mingw /mingw
E:/GCC481/at-home /home
#fstab.sample
#This is a sample file for /etc/fstab.
#Currently /etc/fstab is only read during dll initialization.
#I will eventually watch the directory for changes and reread the file.
#The line format is simple in that you give the Win32 path, followed by one or
#more space or tab delimiter, followed by the mount point. Mount points in
#typical UNIX environments must be a physical name on a drive before it can
#actually be used as a mount point. In this implementation the "must exist"
#requirement isn't enforced, however, it will be an aide to such programs as
#find and readline's tab completion if it does exist.
Those GIT-files can be placed anywhere on your HDD, as long as their folder is "in the PATH".
Create the folder where you want to store the x264 source-code.
Open a command prompt on that folder.
Type and enter this command-line:
git clone git://git.videolan.org/x264.git
After the download is complete, type msys and press Enter.
Change the working directory to "Path-To/x264".
Now you can enter the command ./configure --help. If you don't want to change the default settings, or if you have no idea of what the non-default options mean, then you can go straight to ./configure. Wait, and
finally, run the command "make fprofiled VIDS="/path/to/downloadedYUV/file".
IF you would like a "full-featured" build, with all the bells and whistles :D , then "study carefully" the 8th page of that Doom10 thread ;)
Hope this helps.
mavrick_264
27th September 2013, 13:19
Hi filler56789,
i am trying to follow your suggestions on another PC.
i had fstab.sample file in my msys folder.
It has:
#Win32_Path Mount_Point
c:/mingw /mingw
c:/ActiveState/perl /perl
(Hence, i am assuming that fstab is not equal to fstab.sample. I have Not deleted it. Please inform me if i am supposed to edit the fstab.sample only without creating a new one.) i had created a new fstab file and written in it as:
#Win32_Path Mount_Point
C:\MSYS\mingw /mingw
C:\Users\Admin /home
Here home should be what? i have used home path as per the path in 'Environmental Variable':HOME.
Is it right? Or should it be where i shall be putting my X264 GIT files from VideoLAN?(C:/x264 in my case.)
i have created a folder as C:/x264 for cloning the files from VideoLAN.
Those GIT-files can be placed anywhere on your HDD, as long as their folder is "in the PATH".
Here GIT files means the files from VideoLAN, Right? Please, correct me if it is wrong.
i have following values in PATH at registry editor:
;C:\Program Files\Git\cmd;C:\Program Files\Git\bin;C:\X264;C:\MSYS\bin;C:\MSYS\mingw\bin
So C:/X264 is "in the PATH"??? i hope it is!!
While Cloning, i have got error(image attached)
Fatal error: unable to connect to git.videolan.org
i have a proxy server at my institute with a username, password authentication.
So i think that might be issue.
To overcome it i tried to add a new system variable with:
Variable Name: http_proxy
Variable Value: my_username:my_pass@10.1.101.150:3128
But nothing worked! :(
i still have the same error and X264 folder empty.
Can a extract X264 manually there and move ahead with further suggestions?
My questions might be very naive. And i apologize for them. But i am really trying to figure out how to make this work
...and i won't stop till it works!
i really appreciate help of all of you.
Thanks!
Regards,
DM
Groucho2004
27th September 2013, 13:32
If you have trouble following the guide on Doom10 I pointed to in the second post you can try this thread (http://forum.doom9.org/showthread.php?t=165350) which has a link to another guide in the first post.
mavrick_264
1st October 2013, 09:35
Finally, i could create the X264.exe file!
Here's What i did(it might be useful for someone like me.):
Got the package from Xhmikosr's site. Decompressed them and edited the fstab.sample.
Wrote this:
e.g.
#Win32_Path Mount_Point
C:/MSYS /msys
C:/X264 /X264
From cmd i changed the path to C:/X264.
Added the username and email to git using these links:
https://help.github.com/articles/setting-your-email-in-git
https://help.github.com/articles/setting-your-username-in-git
git config --global user.email "me@here.com"
git config --global user.email
git config --global user.name "my_name_here"
git config --global user.name
and then run command :
git clone git://git.videolan.org/x264.git
And the code was cloned from VideoLAN!!
(No proxy internet connection was used.)
Then from the command prompt only, i opened the msys.bat file.
Changed it's the path to C:/X264/X264 using
$ cd /c/x264/x264
then ./configure
then
make fprofiled VIDS="foreman_176x144_fps15op_300.yuv".
And after much of the stuff(file attached) on cmd i got X264.exe created in the same folder.
The .exe is working.
:thanks: to all!
However, is it normal to have .exe of 2 MB only?
And now, i want to give configuration parameters to encoder like what profile to be used while encoding etc. in the form of text file.
(So that i change many parameters on-the-fly without changing them in code itself.) What changes would i need to do in code?
Also if i am going edit this code which debugger should be used (so that i can see step-wise execution)?
sneaker_ger
1st October 2013, 13:12
However, is it normal to have .exe of 2 MB only?
It's normal if you don't compile with ffms/lavf input.
mavrick_264
1st October 2013, 13:32
Alright!
About passing parameters through text file:
I have seen H.264 before this, in that a configuration file is passed.
e.g. encoder.cfg and no parameter is then taken from code, all are taken from default cfg file.
But, in X264 all parameters are written in the code itself.
So if i pass parameters from text file will it create any issue in execution?
LoRd_MuldeR
1st October 2013, 15:53
Nope, in x264 the (user-configurable) parameters are not hardcoded, but taken from the command-line. Only the default parameters are written in the program code.
AFAIK, x264 itself does not provide a way to read the encoding parameters from a "configuration" file, but you can simply use a script/batch file to call x264 with the desired parameters in an automated way.
This is more or less the same as using a "configuration" file...
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.