He is suffering from excessive desire and he wants to masturbate or watch porn movies to relieve that, and he is asking which of them is less sinful?
Question

Sexual desire has taken control of me to a very great extent, and indeed a very far-reaching extent, and I have been trying to fight it by various means, such as fasting, but after breaking the fast I find myself falling into sin again, or I swear to myself that I will not do it for a certain amount of time, so that it will be extinguished, but I find myself doing it again after the end of that period for which I swore not to do it. I am confused and I am looking for what is known as the lesser of two evils; sometimes I find myself compelled to watch movies and sometimes to masturbate. I am always thinking of various ways and means, but they do not succeed except for a limited time and it is not long before I go back to it again.
I have decided to ask: which of them is less harmful to my religious commitment – watching movies or masturbation? Which of them is the greater sin? I know that both of them are sins.
Praise be to Allah.We are well aware – in sha Allah – of the extent to which you are suffering from stress, pain and anxiety, and we know the conflict you are living through between either striving to control desires or submitting to them and falling prey to them, between either blaming yourself for doing it or giving yourself free rein to indulge in it, so that you can find relief from this anxiety. 
But we also know that you have not been able to bear the bitterness of the remedy with patience, and hence you soon give up on it and go back to your problem as soon as you taste the bitterness of the remedy. 
The Prophet (blessings and peace of Allah be upon him) said: “Fasting is a shield,” i.e., a protection. Narrated by al-Bukhari (7492). But that does not mean that you can a put a worn-out shield with holes in it on your arm, then expect it to protect you on the battlefield! Rather we may say that you are taking it off, and thinking that you are still under its protection. 
The Prophet (blessings and peace of Allah be upon him) also said: “O young men, whoever among you can afford it should marry, and whoever cannot afford it should fast, for it will be a shield for him.”
Narrated by al-Bukhari (5065) and Muslim (1400). 
One of the effects of fasting is that it weakens desire and reduces it, but there is no way you can achieve that result if you try in only one way to weaken it, but you do not pursue the matter wholeheartedly to the end, rather you strengthen it again in other ways. 
Al-Hafiz Ibn Hajar (may Allah have mercy on him) said: 
What we learn from this hadeeth is that fasting suppresses sexual desire. 
However, there may be a problem in that fasting increases heat in the body, and this stirs up desires.
But that only occurs in the beginning, then when one persists in fasting and gets used to it, that settles down.
End quote from Fath al-Bari, 4/119 
Do you not see that you have not completed the course; rather you were content to take one step, then you began to fall back? 
You need to be patient with the remedy and put up with its bitterness, and strive to overcome your nafs all the way. 
You want to choose between two things: the secret habit or watching movies. 
Well, suppose we tell you to go ahead and watch the movies; will that solve your problem and weaken your desire, or will it make it worse?
 It may be possible to accept such a choice if in both options, or one of them, there is a solution to your problem. However, one of them is the problem, or is one type of the problem, and the other is a way that will surely lead to it. Are you, perhaps, jumping out of the frying pan into the fire? Or do you want to treat the disease with the thing that is itself the disease, then you want us to choose for you which is best for you or is the least sinful? 
You will never find healing or relief in either of these two options. 
Reflect upon this hadeeth that was narrated by al-Imam Muslim in his Saheeh (1984): Tariq ibn Suwayd al-Ju’fi asked the Prophet (blessings and peace of Allah be upon him) about khamr, and he forbade him or expressed his disapproval of his making it. He said: I only make it as a remedy. He said: “It is not a remedy, but it is a disease.” 
In this case the Sahabi thought what many people think, that there is some benefit in khamr (alcohol) for treating some diseases, and he asked for a concession allowing him to make it for that reason. 
But the Prophet (blessings and peace of Allah be upon him) explained to him that something that is itself a disease cannot bring healing from a disease; rather it will only make the disease worse. 
So what you must do is strive to keep yourself chaste by means of marriage at the earliest possible opportunity. You do not have to be restricted by traditional social requirements; rather you should try to reduce these restrictions as much as possible and hasten to marry someone who will keep you chaste. Until you are able to do that, you must keep away from movies completely, lower your gaze, and refrain from this secret habit. You should also fast a great deal and strive hard therein and in other acts of worship and all kinds of permissible deeds that will benefit you in this world and in the Hereafter. Do not allow yourself any free time, because if you do not keep your nafs busy with the truth, it will keep you busy with falsehood. 
This is no more than a passing desire and transient pleasure, but what will be left is regret and remorse. One wishes that this sense of sorrow would be limited to this world and would end with our death, but it is regret that never dies; it will follow us to the grave, the gathering (on the Day of Resurrection) and the standing before the Judge. Why should we lose our Hereafter for something which, if we sought the help of Allah against it, asked Him to make us steadfast in keeping away from it, and strove to overcome our nafs, we would overcome it by His grace. 
There follow some ways and means that may help you, by the grace and power of Allah, to keep away from these sins: 
-Hasten to repent and strive against your nafs in order to do so.
-Sincerely turn to Allah, and ask Him to help you against the evil of your nafs and to overcome your desires, and to make it easy for you to find ways to direct your desires in permissible ways, and to divert away from you that which is haram (forbidden) and that which leads to haram.
-Strive to offer prayers on time, and offer a lot of nawafil (supererogatory) prayers.
-Strive to fast and read Quran regularly.
-Always bear in mind that Allah is watching you, and that He is Most Noble and Generous, the One Who conceals sins, may He be glorified. So beware of showing audacity in committing sin, lest Allah then expose your sins
-Strive to find good friends who will help you to do good and will guide you to it.
-Try to exercise regularly and spend time in useful pursuits such as reading. 
For more information, please see the answers to questions no.  329, 26985. 
We ask Allah to guide you and to keep you away from evil and immorality, and to make you one of His sincere slaves. 
And Allah knows best.