Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Video Encoding > MPEG-4 AVC / H.264

Reply
 
Thread Tools Search this Thread Display Modes
Old 19th September 2013, 10:52   #1  |  Link
mavrick_264
Registered User
 
Join Date: Sep 2013
Location: Pune
Posts: 14
Error while compling X264

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/20...n-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
Attached Images
  
mavrick_264 is offline   Reply With Quote
Old 19th September 2013, 11:12   #2  |  Link
Groucho2004
 
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
Here 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.
__________________
Groucho's Avisynth Stuff
Groucho2004 is offline   Reply With Quote
Old 19th September 2013, 12:09   #3  |  Link
mavrick_264
Registered User
 
Join Date: Sep 2013
Location: Pune
Posts: 14
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.
mavrick_264 is offline   Reply With Quote
Old 19th September 2013, 12:16   #4  |  Link
filler56789
SuperVirus
 
filler56789's Avatar
 
Join Date: Jun 2012
Location: Antarctic Japan
Posts: 1,448
Quote:
Originally Posted by mavrick_264 View Post
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

Code:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment
filler56789 is offline   Reply With Quote
Old 19th September 2013, 12:35   #5  |  Link
mavrick_264
Registered User
 
Join Date: Sep 2013
Location: Pune
Posts: 14
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.
mavrick_264 is offline   Reply With Quote
Old 19th September 2013, 21:21   #6  |  Link
filler56789
SuperVirus
 
filler56789's Avatar
 
Join Date: Jun 2012
Location: Antarctic Japan
Posts: 1,448
^ There should already exist a REG_EXPAND_SZ string named "Path" But if it doesn't exist, then something very-wrong has gone on, IMHO

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

Code:
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.

Last edited by filler56789; 20th September 2013 at 00:51.
filler56789 is offline   Reply With Quote
Old 20th September 2013, 13:11   #7  |  Link
mavrick_264
Registered User
 
Join Date: Sep 2013
Location: Pune
Posts: 14
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.
mavrick_264 is offline   Reply With Quote
Old 20th September 2013, 13:20   #8  |  Link
Groucho2004
 
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
Quote:
Originally Posted by mavrick_264 View Post
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?
__________________
Groucho's Avisynth Stuff
Groucho2004 is offline   Reply With Quote
Old 21st September 2013, 13:37   #9  |  Link
komisar
Registered User
 
komisar's Avatar
 
Join Date: Aug 2008
Location: Minsk, Belarus
Posts: 235
Quote:
Originally Posted by mavrick_264
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
__________________
..::[I am live here]..::..[My x264 CLI/VFW builds and tools]::..
komisar is offline   Reply With Quote
Old 25th September 2013, 09:25   #10  |  Link
mavrick_264
Registered User
 
Join Date: Sep 2013
Location: Pune
Posts: 14
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:
  1. Error writing registry key: HKEY_LOCAL_MACHINE\software\Classes\.gitmodules RegSetValueEx failed; code 5. Access is denied
  2. 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
Code:
./configure
and then
Code:
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?
Attached Images
 
mavrick_264 is offline   Reply With Quote
Old 25th September 2013, 10:56   #11  |  Link
filler56789
SuperVirus
 
filler56789's Avatar
 
Join Date: Jun 2012
Location: Antarctic Japan
Posts: 1,448
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.

All a "normal user" needs is have the following files:

Code:
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.
Quote:
i tried it in the initial commit window and committed but it says that i should add name and email.
0_o

Last edited by filler56789; 26th September 2013 at 23:32. Reason: ...
filler56789 is offline   Reply With Quote
Old 25th September 2013, 11:30   #12  |  Link
mavrick_264
Registered User
 
Join Date: Sep 2013
Location: Pune
Posts: 14
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)?
Quote:
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.
Attached Files
File Type: rar Error.rar (84.0 KB, 32 views)
mavrick_264 is offline   Reply With Quote
Old 26th September 2013, 20:59   #13  |  Link
filler56789
SuperVirus
 
filler56789's Avatar
 
Join Date: Jun 2012
Location: Antarctic Japan
Posts: 1,448
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...

Quote:
(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:

Code:
#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 , then "study carefully" the 8th page of that Doom10 thread

Hope this helps.

Last edited by filler56789; 27th September 2013 at 16:34.
filler56789 is offline   Reply With Quote
Old 27th September 2013, 13:19   #14  |  Link
mavrick_264
Registered User
 
Join Date: Sep 2013
Location: Pune
Posts: 14
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.

Quote:
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:
Code:
;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
Attached Images
 
mavrick_264 is offline   Reply With Quote
Old 27th September 2013, 13:32   #15  |  Link
Groucho2004
 
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
If you have trouble following the guide on Doom10 I pointed to in the second post you can try this thread which has a link to another guide in the first post.
Groucho2004 is offline   Reply With Quote
Old 1st October 2013, 09:35   #16  |  Link
mavrick_264
Registered User
 
Join Date: Sep 2013
Location: Pune
Posts: 14
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.
Code:
#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/set...r-email-in-git
https://help.github.com/articles/set...sername-in-git
Code:
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 :
Code:
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
Code:
$ cd /c/x264/x264
then
Code:
./configure
then
Code:
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.
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)?
Attached Files
File Type: txt my_log.txt (40.4 KB, 25 views)
mavrick_264 is offline   Reply With Quote
Old 1st October 2013, 13:12   #17  |  Link
sneaker_ger
Registered User
 
Join Date: Dec 2002
Posts: 5,565
Quote:
Originally Posted by mavrick_264 View Post
However, is it normal to have .exe of 2 MB only?
It's normal if you don't compile with ffms/lavf input.
sneaker_ger is offline   Reply With Quote
Old 1st October 2013, 13:32   #18  |  Link
mavrick_264
Registered User
 
Join Date: Sep 2013
Location: Pune
Posts: 14
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?
mavrick_264 is offline   Reply With Quote
Old 1st October 2013, 15:53   #19  |  Link
LoRd_MuldeR
Software Developer
 
LoRd_MuldeR's Avatar
 
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,262
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...
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊

Last edited by LoRd_MuldeR; 1st October 2013 at 15:57.
LoRd_MuldeR is offline   Reply With Quote
Reply

Tags
mingw, x264

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 06:33.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.