Page 1 of 72 1231151 ... LastLast
Results 1 to 10 of 711

Thread: HowTo: Encode Video for iPod Video

  1. #1
    Join Date
    Oct 2005
    Location
    Dallas
    Beans
    620
    Distro
    Ubuntu 7.04 Feisty Fawn

    HowTo: Encode Video for iPod Video

    ------Last Update------
    January 1, 2008: Started the New Year off with minor changes. Modified the installed packages for Gutsy and the FFMPEG SVN configure commands for the latest SVN.
    ------------------------

    After much searching and about a week of on and off again attempts, I finally got video to encode for my iPod Video. So, I thought I'd share with you how.

    This HowTo is broken up into three sections:
    Vive
    Transferring Video to the iPod Video
    Encoding Video to the iPod Video

    Vive

    Vive is the project that stemmed out of this HowTo. It is a GUI for ffmpeg, but has presets already loaded for the iPod (just for you!). Downloads can be found here.

    Currently, 2.0.0-beta1 is released, or you can use the SVN version. I always make sure that it runs before I commit to the SVN, so that would be the recommended way to go about it. Here's how to install it (you need to install ffmpeg first, so see below for it):

    Code:
    sudo apt-get install vobcopy mplayer libgtk2.0-dev libvte-dev libgnome2-dev libgnomeui-dev
    If you want DVD support, you need to do the following. If you do not want it, you must use the --disable-dvd flag for ./configure.
    Code:
    sudo apt-get install libdvdcss2-dev libdvdnav-dev libdvdread-dev
    Next, installation is rather simple (assuming you get the package either via the released package, or via the SVN.
    Code:
    ./configure --prefix=/usr
    make
    sudo make install
    Also, if you'd like the preloaded presets, please do the following:
    Code:
    mkdir ~/.vive
    cp examples/preferences ~/.vive
    Transferring Video to the iPod Video

    You will need to use gtkpod to transfer your files to your iPod. It's only one command:

    Code:
    sudo apt-get install gtkpod-aac
    This provides the ability to load video and audio that use the AAC sound codec, and it's also built with MPEG4 support. If anybody remembers the old instructions, this is MUCH easier.

    Congratulations, you can now transfer videos to your iPod Video

    Encoding Video for the iPod Video

    Dapper Packages!!!
    SBX has been kind enough to create .deb packages for ffmpeg and Vive for Dapper. You can get them here and install them both with sudo dpkg -i packagename.deb. Thanks so much to SBX for this contribution!

    In order to encode video for the iPod Video, you need to install ffmpeg from source because it does not come with the support needed for the iPod Video format for a litany of legal reasons concerning the distribution of Ubuntu. Luckily, this is still very legal, and you are not breaking any law in the United States or anywhere else by configuring and installing ffmpeg in this way. This section of the guide is broken into two subsections:

    1. Installing ffmpeg
    2. ipodvidenc Script

    The ipodvidenc Script is a simple bash script written by me to make encoding videos for the iPod Video quick and painless. Now, without further interruption, how to encode video for the iPod Video:

    Installing ffmpeg

    First, we need to fix ffmpeg for Ubuntu. We'll build it from source...but don't worry, it won't hurt. We'll also need to install some other libraries. So, here goes:

    Code:
    sudo apt-get install liblame-dev libxvidcore4-dev libx264-dev libfaac-dev libfaad2-dev liba52-dev libdc1394-dev libgsm1-dev libtheora-dev libvorbis-dev
    sudo apt-get build-dep ffmpeg
    There are 2 ways to do this. The version in the Ubuntu repositories does not have x264 support correct. You get an error in the ffmpeg code when you try to compile it. This can be averted by using the SVN version of ffmpeg. However, there are different flags to use, so the first one is using the ffmpeg in the repos (aka no x264), and the second is via the SVN (aka with x264).

    Without x264:
    Code:
    apt-get source ffmpeg
    cd ffmpeg-*/
    ./configure --enable-gpl --enable-pp --enable-vorbis \
    	--enable-libogg --enable-a52 --enable-dts \
    	--enable-dc1394 --enable-libgsm --disable-debug --enable-mp3lame \
    	--enable-faad --enable-faac --enable-xvid --enable-pthreads --enable-shared
    make
    sudo make install
    With x264:
    Code:
    sudo apt-get install subversion
    svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg
    cd ffmpeg/
    ./configure --prefix=/usr --enable-gpl --enable-pp --enable-pthreads --enable-libdc1394 --enable-liba52 --enable-libfaac \
    --enable-libfaad --enable-libgsm --enable-libmp3lame --enable-libtheora --enable-libvorbis \
    --enable-libx264 --enable-libxvid --enable-shared --disable-debug
    make
    sudo make install
    You're done! You can now enjoy ffmpeg!

    ipodvidenc Script

    And last, but certainly not least, you can create a script for converting your videos to iPod Video format.

    Code:
    gedit
    This should pop up a blank document. Now, just copy and paste this code into it:

    Code:
    #!/bin/bash
    ## ipodvidenc - The iPod Video Encoder for Linux.
    ## Created by Eric Hewitt, January 9, 2006.
    ## Released under the GPL.  Go nuts.
    
    input_file=$1
    
    echo "What would you like to name the output file (sans extension)?"
    
    read output_file_name
    
    echo "$output_file_name will be located in $PWD. Is this acceptable? [y/n]"
    
    read output_file_loc_permis
    
    if [ $output_file_loc_permis = 'n' ] || [ $output_file_loc_permis = 'N' ]
    then
    	echo "Where would you like to store $output_file_name.mov?"
    	read output_dir
    else
    	output_dir=$PWD
    fi
    
    ffmpeg -i "${input_file}" -f mp4 -vcodec mpeg4 -maxrate 1000k -b 700k -qmin 3 -qmax 5 -bufsize 4096 -g 300 -acodec aac -ab 192 -s 320x240 -aspect 4:3 "${output_dir}/${output_file_name}.mov"
    Save as ipodvidenc in your present working directory (it will be moved, anyway). Back in the terminal, run:

    Code:
    chmod 755 ipodvidenc
    sudo mv ipodvidenc /usr/bin
    Now, when you want to encode a video to iPod format, run this command:

    Code:
    ipodvidenc video.avi
    It will run you through a few prompts and then encode the video. You can now use gtkpod to upload the video onto your iPod just like you load mp3's onto it.

    *Note: You can now use ipodvidenc to encode straight from a *.vob file. This way, you can rip your DVDs using dvd::rip, and then simply encode them by passing them through ipodvidenc. Make sure that you compile ffmpeg with a52 support in order to do this, though.

    This is a very basic script if you do not want the much larger and GUI version of ipodvidenc which can be found attached.

    Fixing Video for the 60GB iPod v1.1 Firmware

    In the new firmware for the 60GB iPods, video will play for 15 seconds, stop, and then continue without audio. If this happens to you, you need to install gpac, like this:

    Code:
    sudo apt-get install gpac
    You can then remux the video so that it will work on your iPod using the following command:

    Code:
    MP4Box -add videofile.mov videofile.mov
    A note: You can use the same name for the input and the output...it will simply overwrite the existing file.

    Happy encoding!

    Credits:
    Original Sources:


    Much thanks to:
    • Iandefor for countless suggestions, bugfixes, and corrections.
    • Dromio for corrections.
    • quietglow for corrections and the .deb support for mpeg4ip
    • pestilence4hr for corrections regarding the building of ffmpeg
    • hal pacino for the info about MP4Box
    • SBX for the Dapper packages.
    • Sir_Yaro for information about the mpeg4ip error correction.
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	main_window.png 
Views:	753 
Size:	46.4 KB 
ID:	38702   Click image for larger version. 

Name:	main_window_terminal.png 
Views:	414 
Size:	29.3 KB 
ID:	38703   Click image for larger version. 

Name:	preferences_window.png 
Views:	538 
Size:	37.2 KB 
ID:	38704  
    Attached Files Attached Files
    Last edited by endersshadow; January 1st, 2008 at 09:23 AM.

  2. #2
    Join Date
    Oct 2005
    Location
    Dallas
    Beans
    620
    Distro
    Ubuntu 7.04 Feisty Fawn

    Re: HowTo: Encode Video for iPod Video

    Update: Now on the Wiki

    I've decided to make this post the Change Log, so here it is:

    ------------------------
    Updated: January 1, 2008: Started the New Year off with minor changes. Modified the installed packages for Gutsy and the FFMPEG SVN configure commands for the latest SVN.
    Updated: July 20, 2007: Huge news! Vive 2.0.0 has finally been released! Download it here! Also, an Ubuntu Feisty package has been added. I suggest that you use the Medibuntu repository to meet the dependencies, as the Ubuntu package is compiled to allow DVD usage. Enjoy!
    Updated: July 11, 2007: Vive 2.0.0-beta2 is now available! New features include multiple file and folder support, a simplified and streamlined interface, and a lot of behind the scenes stuff that makes me sleep better at night but you won't notice unless you look at the code. So download it today!
    Updated: June 1, 2007: Fixed some legacy issues with the bitrate handling of ffmpeg (used to be in kb/s, now in b/s) for the script and ipodvidenc, which is now v1.6.
    Updated: April 20th, 2007: Major update for Feisty & Edgy - MUCH EASIER!!!
    Updated: December 12th, 2006: ffmpeg configure altered to support H.264 format.
    Updated: November 7th, 2006: Post updated with tweaks so that it will work on Edgy.
    Updated: October 2nd, 2006: Released Vive 1.0.2 as a bug-fix release. You can find it on Sourceforge.
    Updated: September 20th, 2006: Released Vive 1.0.1 to fix the configure script.
    Updated: September 18th, 2006: Released Vive 1.0.0. Check it out at http://vive.sourceforge.net! Note: It will detect a previous version of Vive and update it accordingly without deleting any of your previously saved preferences!
    Updated: June 4th, 2006: Released Vive 0.3 Beta 2 Release. Check it out at http://vive.sourceforge.net! Note: It will detect a previous version of Vive and update it accordingly without deleting any of your previously saved preferences!
    Updated: May 21st, 2006: Added error correction for mpeg4ip thanks to Sir_Yaro. Also added the shameless self promotion of Vive.
    Updated: April 30th, 2006: Okay, I know that it's been a while, but here are some updates. First, SBX gave us Dapper packages of Vive and ffmpeg. Go SBX. Second, I found out that the XML Perl Parser is in the repos...I'm an idiot...so I included it. Third, I added how to remux videos for the 60GB iPod v1.1 Firmware, and much thanks to hal pacino for that. I haven't forgotten about Vive...I'm just really busy, but it's almost ready for 0.3 to be unleashed...I went back and rewrote most of the code to make it a bit better.
    Updated: March 23rd, 2006: I've released Vive 0.2 (Beta Release), and have attached a screenshot of the main window and the preferences window!
    Updated: February 27th, 2006: I've released Vive, and have attached a screenshot!
    Updated: February 10th, 2006: Updated install script and HowTo to correct libgpod installation issues, as well as added to the HowTo and the Wiki the same information.
    Updated: January 26th, 2006: Updated iPod Video Encoder to version 1.5 to include OGM support as requested here.
    Updated: January 25th, 2006: Updated iPod Video Encoder to version 1.4. There are so many new features, that I'm just including the full change log:

    NEW: Added default videos directory option.
    NEW: Added CLI interface.
    NEW: Added support for standard size AVI encoding.
    NEW: Added support for standard size MPEG encoding.
    NEW: Added a preview feature.
    NEW: Added help file. (Access via ipodvidenc -h).
    IMPROVED: Condensed the installation to one script that automatically detects your previous level of installation.
    IMPROVED: Uninstall script updated.
    BUG FIX: Inability to remove original files with spaces in the name bug fixed.
    BUG FIX: Overwriting existing files bug fixed.
    Updated: January 24th, 2006: Updated iPod Video Encoder to version 1.3 to fix a couple of bugs and add a new feature, options, to cut down on the number of dialogs in the ripping and encoding process.
    Updated: January 23rd, 2006: Updated iPod Video Encoder and HowTo to correct some ffmpeg configuration errors. Also added some features/improvements and bug fixes to iPod Video Encoder. See attached README file for a detailed list of changes to iPod Video Encoder
    Updated: January 17th, 2006: Updated HowTo and iPod Video Encoder (to v1.1) to use dpkg-buildpackage to build ffmpeg. Much thanks to pestilence4hr, who brought this to my attention!
    Updated: January 16th, 2006: Added iPod Video Encoder (ipodvidenc), the GUI to make iPod Videos.
    Updated: January 14th, 2006: Added .deb package for mpeg4ip and updated format of the HowTo as well as the Sources. Also editted the title.
    Updated: January 13th, 2006: Added support for encoding vob files, and ipodvidenc script modified slightly for optimization. Also corrected the commands to install mpeg4ip.
    Updated: January 12th, 2006: Corrected commands associated with compiling and installing mpeg4ip.
    ------------------------
    Last edited by endersshadow; January 1st, 2008 at 09:23 AM.

  3. #3
    Iandefor is offline Grande Half-n-Half Cinnamon Ubuntu
    Join Date
    Sep 2005
    Location
    New York
    Beans
    Hidden!

    Re: HowTo: Encode Video for iPod Video

    Good guide. I'll do it someday, when I get a 5th generation iPod. Until then, I'll adapt it to my *cough* encoding needs.
    Last edited by Iandefor; January 15th, 2006 at 04:47 AM.
    This space intentionally left blank.

  4. #4
    Join Date
    Feb 2005
    Location
    Firenze
    Beans
    29
    Distro
    Kubuntu 6.10 Edgy

    Re: HowTo: Encode Video for iPod Video

    Thanks for this howto that i've aked for!!!
    You're great!!
    visit my web site: www.marcomeoni.net
    visit MGC Firenze web site!

  5. #5
    Join Date
    Oct 2005
    Location
    Dallas
    Beans
    620
    Distro
    Ubuntu 7.04 Feisty Fawn

    Re: HowTo: Encode Video for iPod Video

    Quite welcome...and trust me, I'm not that great...just a guy who was determined to get his iPod Video to work on Ubuntu

  6. #6
    Join Date
    Mar 2005
    Beans
    59

    Re: HowTo: Encode Video for iPod Video

    Thanks for the tutorial. I'm having some trouble getting the dependencies installed.

    sudo apt-get install libfaad2-dev libfaac-dev libxvidcore4-dev checkinstall fakeroot
    Reading package lists... Done
    Building dependency tree... Done
    Some packages could not be installed. This may mean that you have
    requested an impossible situation or if you are using the unstable
    distribution that some required packages have not yet been created
    or been moved out of Incoming.
    The following information may help to resolve the situation:

    The following packages have unmet dependencies:
    libxvidcore4-dev: Depends: libxvidcore4 (= 2:1.0.3-0.0) but 2:1.1.0-beta1-0.0 is to be installed
    E: Broken packages

    I don't think I've done anything to get a special version of libxvidcore4, but I suppose it is possible. Do you have any suggestions on how to fix this?

  7. #7
    Join Date
    Mar 2005
    Beans
    59

    Re: HowTo: Encode Video for iPod Video

    I got synaptic to pin the older version of libxvidcore4, so I'm ok with that now.

    But now I'm getting confused while compiling and installing mpeg4ip.

    It looks to me like
    Code:
    
    cp mpeg4ip_config.h mpeg4ip_version.h /usr/local/include
    cp include/mpeg4ip.h /usr/local/include
    should actually be
    Code:
    sudo cp mpeg4ip_config.h /usr/local/include
    
    sudo cp include/mpeg4ip.h include/mpeg4ip_version.h /usr/local/include
    (need to be superuser to copy to /usr/local/include and the mpe4ip_version.h file is actually under the include folder in the source)

    Then, you edit the makefile for the lib/mp4v2 subfolder. Do you compile within that subfolder, or go back to the root folder to compile everything? When it asks for a package name, it's suggesting mp4v2, which seems a far cry from mpeg4ip.

  8. #8
    Join Date
    Oct 2005
    Location
    Dallas
    Beans
    620
    Distro
    Ubuntu 7.04 Feisty Fawn

    Re: HowTo: Encode Video for iPod Video

    All apologies...you're right, it does need to be sudo.

    And you need to do the configure, make, and install from the main mpeg4ip directory. I'll update the HowTo.

    I apologize...as I said, it was a long time of me trying different things, and then finally getting to work, and then I had to sort through my .bash_history file to get all the correct commands...sorry for that!

  9. #9
    Join Date
    Oct 2005
    Location
    Dallas
    Beans
    620
    Distro
    Ubuntu 7.04 Feisty Fawn

    Re: HowTo: Encode Video for iPod Video

    Update: Added instructions on how to convert straight from raw vob files. Note that if you've followed this HowTo before, you just need to do:

    Code:
    sudo apt-get install liba52-0.7.4 liba52-0.7.4-dev
    Then add the line:

    Code:
    confflags += --enable-a52
    To the debian/rules file in the ffmpeg source directory. Then in the ffmpeg source directory run:

    Code:
    ./configure && make && sudo make install
    You'll be all set

  10. #10
    Join Date
    Sep 2005
    Beans
    41

    Re: HowTo: Encode Video for iPod Video

    Getting dependency problem with "sudo apt-get build-dep ffmpeg", any idea?

    Been looking for a guide like this for months, thanks man.

Page 1 of 72 1231151 ... LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •