Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I would like to convert videos I download to the iPhone format on my server and be able to access and play them on my iPhone.

I looked into Handbrake, but I wasn't sure if it would work on the server.

Any suggestions you may have to set this up would be much appreciated.

Please and thank you.

share|improve this question
add comment

2 Answers 2

up vote 2 down vote accepted

There is a command line version of handbrake that should work on your server. Below are instructions for installing from a PPA and converting the files using the command line.

$ sudo apt-get install python-software-properties
$ sudo add-apt-repository ppa:stebbins/handbrake-snapshots
$ sudo apt-get update
$ sudo apt-get install handbrake-cli
$ HandBrakeCLI --preset "iPhone & iPod Touch" -i input.xxx -o output.mp4
share|improve this answer
    
no such command add-apt-repository –  myusuf3 Aug 29 '10 at 23:25
    
could you also tell me where you got the cli interface for handbrake? –  myusuf3 Aug 29 '10 at 23:26
    
@garbagecollector What version server do you have? –  Marco Ceppi Aug 29 '10 at 23:26
    
10.10 i know that command only works with 9.10 –  myusuf3 Aug 29 '10 at 23:27
    
Not true - that command should work on 9.10 and 10.04 (at least those are the two I've tested) Make sure you have python-software-properties package installed –  Marco Ceppi Aug 29 '10 at 23:31
show 4 more comments

I don't have an iPhone anymore, but back when I had one, I made a little script to do just that. Here it is :

#!/bin/bash
if "$1" == ""
then
    echo This script this script takes a video file as parameter, and tries
    echo to convert it to MPEG-4 in an iPhone-compatible format.
    echo A file list, or wildcards caracters can be used as parameters.
    exit 0
fi

for file in $@
do
    ffmpeg -i $file -f mp4 -vcodec mpeg4 -maxrate 1000 -b 700 -bufsize 4096 -g 300 -acodec aac -ab 192 -s 480x320 $file.mp4
done

You can copy it and paste it as a new text file. Then make this file executable (chmod +x [filename]) and run it from the commandline, with the source video file as parameter (multiple files can be put as parameters, for multiple conversions, and wildcards are accepted).

The resulting file will be named the same as the source, with the ".mp4" extension added to it.

Looking at it, it seems you only need ffmpeg to use it. Maybe some codecs also, but I guess you have them already if you already played with video conversion :)

If you don't already have it installed, try :

sudo apt-get install ffmpeg

Hope this helps.

share|improve this answer
    
I would have used this but; i managed to get handbrake working. –  myusuf3 Aug 30 '10 at 13:36
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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