My TV is old and for some reason clips some content off of the left edge. I'm trying to show a video on it in which the left edge is vital to the presentation.

Is there some way (with iMovie/ffmpeg/Gimp etc) that I can shrink the video size and surround it with a thick black border, so that this border is clipped when viewing it on my TV, rather than the content?

In other words, I want to go from this:

enter image description here

to this:

enter image description here

But I want to do that with a video (in mp4 format).

  • Is it an option to just adjust the size any way desired during playback? that way the video does not have to be re-encoded. What is the OS that it is being played back with? or is this dvd bluray or something? – Psycogeek Jan 25 '15 at 3:54
  • The file is being accessed over the DLNA protocol. I'm using the Plex server to serve the files to my Sony media player (a TV top box) over Wi-Fi. Unfortunately, my TV does not have a setting for scaling or moving the video, and the only setting that my SONY player has is to fix the aspect ratio to 4:3. – AmadeusDrZaius Jan 25 '15 at 4:06
  • Can you give some more information about the TV? The type and model would really help. Also, tell us about your video card please. – krowe Jan 25 '15 at 4:29
  • Sorry dont know FFMpeg but in virtualDub and other video programs it is often found in the resize options, as you resize the video and plop it on the specified size "canvas" , Framing options. – Psycogeek Jan 25 '15 at 4:47

Method 1: Fixed size scale with padding:

ffmpeg -i inputfile.mov -filter_complex 'scale=578:462, pad=720:576:71:57' outputfile.mp4

This assumes SD PAL size input and output. This simply uses a fixed size pad.

Method 2: Percentage scaling with overlay on top of black generated by filter:

ffmpeg -y -i inputfile.mov -f lavfi -i color=c=black:s=1920x1080 \
  -filter_complex "[0:v]scale=w=0.80*iw:h=0.80*ih[scaled]; \
    [1:v][scaled]overlay=x=0.10*main_w:y=0.10*main_h:eof_action=endall[out]; \
    [0:a]anull[aud]" \
  -map "[out]" -map "[aud]" \
  -strict -2 \

This assumes input and output size to be full HD (1920x1080). The scaling is by 80 percent. So the overlay position is 20 percent inside- but since this 20 is divided on both sides equally, the overlay uses 10 percent of main width and adds that to x position.

The eof_action is required so that when the video file ends processing can stop. Else the generated black (background) from -f lavfi will just keep on going.

  • My file is an mp4 and I got this message when running your method 2: The encoder 'aac' is experimental but experimental codecs are not enabled, add '-strict -2' if you want to use it. I tried adding the -strict -2 to the end, but it didn't change the error message. Any ideas? – AmadeusDrZaius Jan 25 '15 at 6:22
  • @AmadeusDrZaius I added the -strict -2 parameter. – Rajib Jan 25 '15 at 7:46
  • 1
    @AmadeusDrZaius No far from it. Just a happy user. Look here for filters. Stackexchange Superuser and StackOverflow are great resources. – Rajib Jan 25 '15 at 10:19
  • 2
    @AmadeusDrZaius trac.ffmpeg.org/wiki, blog.superuser.com/2012/02/24/… (shameless plug), otherwise, just ask a question here. We have a handful of people around here who know their way around ffmpeg. – slhck Jan 26 '15 at 14:54
  • 2
    @AmadeusDrZaius If the input audio is compatible with the output container format, then consider stream copying it with -c:a copy instead of re-encoding. – llogan Jan 26 '15 at 19:06

I found a video explaining how to put a border over a video in iMovie. Here's how you can do it:

  1. Use Gimp (or another tool) to create an image with black borders around it. Make sure that this image is larger than the size of the video you want to put a border around.

  2. Open iMovie and import both the clip and the border image.

  3. Open iMovie > Preferences and check the box "Show Advanced Tools".

  4. Drag the border image into the project panel and use the gear to extend the time of the clip to the length of the video. The limit of an image clip is 10 minutes, so copy and paste the image background clip as many times as necessary to match the length of the movie.

  5. Drag the movie clip from the import into the project pane and align it with the beginning of the background image. You should see a menu pop up with options for how to combine the image and movie clips. Choose "Picture-in-Picture".

  6. Adjust the movie size in the upper-right-window until only the desired amount of border is showing.

  7. Export the movie as desired.

Just a note: this will probably take a long time (took about an hour of exporting for me, and my movie was 30 minutes long), so there's probably a more efficient way to do this.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.