Click here to Skip to main content
16,019,873 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have Two problems. I should change a resolution of a video and clip some part of a video.

In detail, I want to change a ratio of video to 640 x 480 from 720 x 480.
Now I used libvlc in C++. I showed the 720 x 480 video in a panel that was size of 640 x 480,
but black bars were showed at the upper side and the bottom side.
I must show 640 x 480 size, So it is a big problem to me.


Also the viedo include originally a black bar at the right side.
I will remove the black bar using overlapping other video or a box.
But I hope to clip video.


How to solve this problems...?
Could you give me comment or reference site.. etc plz.


Thank you for reading my question.

What I have tried:

I search... but I can not solve...
Posted
Updated 8-Dec-16 22:19pm

1 solution

Depending on your source data (which you havent mentioned) you can only output the lines you want.
C++
inc cut = (720 - 640) / 2;
for(int y = cut; y < 640; y++ ) {
  for(int x = 0; x 480; x++ ) { 
   draxPixel(x,y);
  }
}

But that could be slow. Better is to use this logic with some of your internal libraries like openGL.
A HACK could be to make the output control bigger, and plac some dummy controls over the unwanted parts. ;-)

Tip: if you dont want to display the pixels, dont copy that data around. Make that cut in or after the decoding.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900