Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Howto:Encode & transfer videos to your ipod - thinliquidfilm
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
Dumbkiwi
n00b
n00b


Joined: 30 Jan 2005
Posts: 45

PostPosted: Sat Jan 20, 2007 9:55 pm    Post subject: Howto:Encode & transfer videos to your ipod - thinliquid Reply with quote

What is thin liquid film

thin liquid film (TLF) is an application which allows linux users to quickly and easily convert video files into a format suitable for playing on the video capable ipods. TLF uses the ffmpeg engine to do the encoding. It is written in pyqt, so it should work with a default kde installation, and is very easy to install.

howto install thin liquid film ...

requirements ...

thin liquid film (TLF) requires:

* pyqt - these are the python bindings for qt. These are now part of the standard kde modules. If you don't have it, you will need to emerge kde-base/kdebindings-meta;

* ffmpeg - You need to make sure that ffmpeg has been compiled with support for xvid and h264 codecs. See below for details on how to tell;

* libgpod python bindings - this is not essential for the enocoding part of the application. However, without it, you will not be able to upload to your ipod. These python bindings are part of the libgpod package, which is a dependency of both gtkpod and amarok. If you don't have these, emerge media-libs/libgpod. Make sure you have the python use flag enabled.

* mplayer - this is not essential, but allows you to preview encoded video files before encoding them;

* a 5G ipod - although, you can use TLF without an ipod, I'm not sure why you would bother :), unless you want to convert your home videos for your friends :).

the trouble with ffmpeg ...

As I said above, you need a version of ffmpeg that has been compiled with support for the aac, mpeg4 and h264 codecs. You can work this out with the following command:

Code:
ffmpeg -formats | grep h264

and
Code:
ffmpeg -formats | grep xvid


Code:
ffmpeg - formats | grep aac


If they are supported, you will get output that looks like:

Code:
FFmpeg version SVN-rUNKNOWN, Copyright (c) 2000-2004 Fabrice Bellard
  configuration:  --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-x264
  libavutil version: 49.0.0
  libavcodec version: 51.11.0
  libavformat version: 50.5.0
  built on Jan 18 2007 19:00:22, gcc: 4.1.2 20060928 (prerelease)
 DE h264            raw H264 video format
 DEV DT h264

and
Code:
FFmpeg version SVN-rUNKNOWN, Copyright (c) 2000-2004 Fabrice Bellard
  configuration:  --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-x264
  libavutil version: 49.0.0
  libavcodec version: 51.11.0
  libavformat version: 50.5.0
  built on Jan 18 2007 19:00:22, gcc: 4.1.2 20060928 (prerelease)
  EV    xvid
and
Code:
FFmpeg version SVN-rUNKNOWN, Copyright (c) 2000-2004 Fabrice Bellard
  configuration:  --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-x264
  libavutil version: 49.0.0
  libavcodec version: 51.11.0
  libavformat version: 50.5.0
  built on Jan  7 2007 17:02:21, gcc: 4.1.2 20060928 (prerelease)
 D  aac             ADTS AAC
 DEA    aac
 D A    mpeg4aac


If you don't have ffmpeg compiled with support for one or other of the aac, h264 or xvid codecs, you will need to change your use flags. Add the following line to your /etc/portage/package.use file:
Code:
media-video/ffmpeg aac x264 xvid

Then you will need to download TLF from http://thinliquidfilm.org. You will then need to untar the file. You can do that with this command:
Code:
tar -jxpf tlf-version.tar.bz2

You'll need to replace version with the correct version number of the tarball you downloaded. Then change to the resulting directory. TLF comes with an installation script called install.py so you'll need to run the script as root like this:
Code:
su
Password:
./install.py

The install script does not require any input. It installs all the files necessary for TLF to /usr/local/thinliquidfilm. It will create an executable file called thinliquidfilm in /usr/local/bin, which should be in your path, and will install a TLF servicemenu entry for konqueror. You will have to manually add a menu entry to TLF in kde or gnome.

Opening video files in thinliquidfilm ...

You can add video files to TLF in any one of three ways:

* command line - when you launch TLF, you can add any number of files for encoding as command line arguments, for example:
Code:
thinliquidfilm /full/pathto/file1.avi relative/pathto/file2.avi


* Konqueror - you can right click on any supported video file in konqueror, and there should be an option to add those files to TLF for encoding under the Actions submenu.

* "Add Files" button - once TLF is open, click on the Add Files button to open a file dialog, and add one or more files to either the encoding or transfer list in the usual way. TLF will then add the files to the file list in the encoding or transfer file list (depending on which is showing), together with some information about the video - like filetype, number of frames, aspect ratio and bitrate.

settings for encoding video files ...

Check out this screenshot to assist with the following explanation of the encoding settings: http://thinliquidfilm.org/images/screenie.png

You set the output parameters for encoding videos in the Output Settings tab.

* Passes - this sets the number of passes the encoder will use to encode the video file. Two pass encoding should produce a better quality video file, but has to pass over the file twice, so will take longer.

* Size/Quality - choose whether you want to create a video that is suitable for the Ipod only, or for both the Ipod and TV. The ipod supports two video widths: 320 and 640. The 320 width will look great on an ipod and will produce a small file and will encode faster, but if you want to watch it on TV, it will look crappy and pixelated. So if you want to watch the video on TV as well as the ipod, use the Ipod and TV option. The aspect ratio of your source video will be preserved.

* Video Codec - set which of the ipod supported video codecs you want to use. h264 should theoretically give you better quality at lower bitrates and therefore produce a smaller file, but will take longer to encode.

* Audio Quality - high quality will encode the audio at 160 kb/s (the maximum permitted on the ipod). Low quality encodes at 128kb/s, which provides acceptable quality, but a smaller file size.

* Destination - set the destination path for the encoded video file. You can either enter the path, or click on the browse button to find the right directory.

* Save As Default Settings - press this button to save the settings currently displayed in the settings panel, so that TLF opens with these settings as the defaults the next time.

You can preview what the encoded video will look like using the preview button.

upload information

Check out this screenshot to assist with the following explanation of the transfer settings: http://thinliquidfilm.org/images/screenie2.png

You set the file information for uploading to your ipod in the Output Settings tab.

* Title - set the name for the file that will appear on your ipod.

* Artist, Album, Genre - you can set these if you want, although I'm not sure what use they really are.

* Playlist - this allows you to set an existing playlist, or a new one. Enter the name of an existing video playlist, or a new one altogether. When uploaded, the video files will appear in the specified playlist.

* Ipod Mountpoint - this is where your ipod is, or will be mounted. You an save this as a permanent setting by clicking on the Save Mountpoint button.

batch settings

You can change the settings for multiple files by selecting the files you want to change, and then making the changes in the settings panel. The settings displayed in the settings panel will then be applied to all of the highlighted files.

help/support

If you want help or support for thinliquidfilm, post on the forums at http://thinliquidfilm.org/forum
_________________
Cheers

Matt


Last edited by Dumbkiwi on Sun Jan 21, 2007 9:57 am; edited 1 time in total
Back to top
View user's profile Send private message
nickrout
Apprentice
Apprentice


Joined: 06 Oct 2002
Posts: 208
Location: New Zealand

PostPosted: Sun Jan 21, 2007 9:18 am    Post subject: Reply with quote

Thought I'd try this out (even if I don't have an ipod).

Firsttime it starts, it tells me there is a new version available, even though I downloaded the latest from the web site DUH.

Every file I try to add to it, it tells me in the user interface :
Quote:
There was a problem loading filename.avi. This file may be corrupt or may not be a valid video file.
The command line output shows:

Quote:
Input #0, mpeg, from '/home/nick/media/REV_OS_trailer.mpg':
Duration: 00:01:51.9, start: 0.340078, bitrate: 1412 kb/s
Stream #0.0[0x1e0], 29.97 fps: Video: mpeg1video, yuv420p, 352x240, 1150 kb/s
Stream #0.1[0x1c0]: Audio: mp2, 44100 Hz, stereo, 224 kb/s
Unable for find a suitable output format for '/dev/null'
Values:
parsing error


Well DUH, they clearly are valid video files.

Also why do your instructions suggest installing kubuntu-desktop. This si gentoo. emerge pyqt.

Having been a little sarcastic above, this does look like a useful app, if it would work!
Back to top
View user's profile Send private message
Dumbkiwi
n00b
n00b


Joined: 30 Jan 2005
Posts: 45

PostPosted: Sun Jan 21, 2007 10:10 am    Post subject: Reply with quote

It seems that your version of ffmpeg is outputing the video information differently from the version I've been testing this app on. The same video file works fine on my system, but that's because the information gets parsed correctly. I'll rejig the parsing code, and upload a new version tomorrow (it's late here).

I'll fix the version notification issue as well.
_________________
Cheers

Matt
Back to top
View user's profile Send private message
nickrout
Apprentice
Apprentice


Joined: 06 Oct 2002
Posts: 208
Location: New Zealand

PostPosted: Sun Jan 21, 2007 11:24 am    Post subject: Reply with quote

Its late here too. You have got me interested in pyqt now and I am trying tp make a tutorial work, but its not!
G'night fellow kiwi.
Back to top
View user's profile Send private message
Dumbkiwi
n00b
n00b


Joined: 30 Jan 2005
Posts: 45

PostPosted: Sun Jan 21, 2007 7:53 pm    Post subject: Reply with quote

These issues are now fixed (hopefully) in version 0.92. Let me know if they're not.
_________________
Cheers

Matt
Back to top
View user's profile Send private message
nickrout
Apprentice
Apprentice


Joined: 06 Oct 2002
Posts: 208
Location: New Zealand

PostPosted: Mon Jan 22, 2007 7:58 am    Post subject: Reply with quote

Dumbkiwi wrote:
These issues are now fixed (hopefully) in version 0.92. Let me know if they're not.


0.92 seems to work fine here. Nice simple app.

I don't have any sort of portable video player, if I did i'd probably buy one that didn't need trasncoding to work.

However I have thought about a PSP and I wonder if you had considered adding support for that?

EDIT: actuyally I have noticed what appears to be a bug - I get the same file, right down to the md5sum, whether I choose xvid or h264 as the video codec.
Back to top
View user's profile Send private message
Dumbkiwi
n00b
n00b


Joined: 30 Jan 2005
Posts: 45

PostPosted: Mon Jan 22, 2007 8:53 am    Post subject: Reply with quote

nickrout wrote:


0.92 seems to work fine here. Nice simple app.

I don't have any sort of portable video player, if I did i'd probably buy one that didn't need trasncoding to work.

However I have thought about a PSP and I wonder if you had considered adding support for that?


Yep, just want to get ipod working (and all the file management/UI stuff working, and then I'll add support for other devices (including PSP, Archos, Gp2X, and iaudio/iriver)

nickrout wrote:

EDIT: actuyally I have noticed what appears to be a bug - I get the same file, right down to the md5sum, whether I choose xvid or h264 as the video codec.


Are you sure you're not using the same codec for both videos? Check you've set a different codec for both. If you select all, then the same settings get applied to all video files.
_________________
Cheers

Matt
Back to top
View user's profile Send private message
jettjunker
Apprentice
Apprentice


Joined: 10 Sep 2005
Posts: 267

PostPosted: Mon Feb 19, 2007 8:18 am    Post subject: Re: Howto:Encode & transfer videos to your ipod - thinli Reply with quote

Dumbkiwi wrote:
thin liquid film (TLF) requires:

* pyqt - these are the python bindings for qt. These are now part of the standard kde modules. If you don't have it, you will need to emerge kde-base/kdebindings-meta;


Gnome user here... So, does it really need kdebindings-meta, or can I just emerge PyQt and PyQt4? Second, how can I get it to install without konqueror? The install script wont work without it (nor did it fall for me just putting a blank script as /us/bin/konqueror).

Thanks -- I don't want to install a million kde dependencies to run this :/
_________________
Core2Duo T7100 1.8 ghz mini-itx, Nvidia FX220: Gentoo/Gnome/CompizFusion:XGL
CoreDuo 1.83 ghz 13" Macbook, GMA 950: Ubuntu/Gnome/CompizFusion:AIGLX
Back to top
View user's profile Send private message
Dumbkiwi
n00b
n00b


Joined: 30 Jan 2005
Posts: 45

PostPosted: Mon Feb 19, 2007 8:39 am    Post subject: Reply with quote

You should be able to do it with just PyQt, but you will also need sip if this is not installed as a dependency.

To run tlf, you don't need to actually "install" it. If you run the thinliquidfilm.py file from the untarred thinliquidfilm directory, it will run fine.
_________________
Cheers

Matt
Back to top
View user's profile Send private message
Mattwolf7
n00b
n00b


Joined: 14 Mar 2004
Posts: 73

PostPosted: Tue Mar 13, 2007 5:24 am    Post subject: Reply with quote

Anyone made an ebuild for this program? It looks amazing, but I hate installing things from tarballs because if anything updates it's hard to keep track of all the files.
Back to top
View user's profile Send private message
Dumbkiwi
n00b
n00b


Joined: 30 Jan 2005
Posts: 45

PostPosted: Tue Mar 13, 2007 5:32 am    Post subject: Reply with quote

This shouldn't need an ebuild. There is an install script, which will install it. The programme itself should advise you of any updates. When you install after an update, the previous install is deleted and replaced with the updated one.
_________________
Cheers

Matt
Back to top
View user's profile Send private message
Mattwolf7
n00b
n00b


Joined: 14 Mar 2004
Posts: 73

PostPosted: Tue Mar 13, 2007 6:06 am    Post subject: Reply with quote

How often does it phone home to check for new versions? I'd rather not have it check every time I open the program...

Edit: I assume you're the author?
Back to top
View user's profile Send private message
Dumbkiwi
n00b
n00b


Joined: 30 Jan 2005
Posts: 45

PostPosted: Tue Mar 13, 2007 9:26 am    Post subject: Reply with quote

It checks everytime you open the program. It downloads a 4 byte file which contains the version number. If it's higher than the current version, then the first time it finds an update, it tells you after that, it shouldn't warn you until there's another update.

Checking on each start seems to be the only reliable way of checking for updates.
_________________
Cheers

Matt
Back to top
View user's profile Send private message
javock
Tux's lil' helper
Tux's lil' helper


Joined: 01 Jan 2004
Posts: 106
Location: Babeland... yeah! I wish!

PostPosted: Wed Apr 11, 2007 3:14 pm    Post subject: Reply with quote

Hey Nice app!

I've been trying to use it to upload videos to the iPod but ran into some trouble (I am using v1.0):

* Whenever I try to add the video file (already in iPod format .m4v etc etc) I get an exception on line 21 of the file uploadFileInfo.py (forced cast to str makes it work)
* I do not get the available space on the iPod
* Finally the video hangs the iPod and i Need to reset it

Also I would recommend that you use the python loggin module instead of prints, it is much nicer and you could redirect it's output to a log window or something..

Regards
_________________
The heart has reasons that the reason will never understand.

-- La Renga. El final es donde partí
Back to top
View user's profile Send private message
thawn
n00b
n00b


Joined: 31 Aug 2004
Posts: 41

PostPosted: Mon Apr 07, 2008 9:31 am    Post subject: Reply with quote

I tried to install using the install script.
I am not using kde so I don't have konqueror installed.
the script first says that it will not install the konqueror extensions, but then throws an error later on about an undefined variable. kdedir
script otput:
Code:
*************************************
      installing thinliquidfilm
*************************************


-------------------------
Checking dependencies ...
-------------------------

pyqt is present

ffmpeg is present

ffmpeg supports xvid

ffmpeg supports h264

using bash as shell

libgpod python bindings are present

mplayer is present

which: no konqueror in (/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin:/usr/x86_64-pc-linux-gnu/gcc-bin/4.1.2:/usr/qt/3/bin)
Couldn't find konqueror.  Servicemenus will not be installed.

--------------------------------------------
Checking permissions for install process ...
--------------------------------------------

Permissions OK

------------------------------
Clearing old installations ...
------------------------------
Traceback (most recent call last):
  File "install.py", line 104, in ?
    if os.path.isfile(kdedir + '/share/apps/konqueror/servicemenu/thinliquidfilm.desktop'):
NameError: name 'kdedir' is not defined


this can be fixed by adding kdedir = '' in line 85 of install.py.
afterwards lines 82-90 should look like this:
Code:
except:
    print 'Couldn\'t find konqueror.  Servicemenus will not be installed.'
    havekonq = 0
    kdedir = ''
print ''
print '--------------------------------------------'
print 'Checking permissions for install process ...'
print '--------------------------------------------'
print ''


thanks for this great app!
Back to top
View user's profile Send private message
thawn
n00b
n00b


Joined: 31 Aug 2004
Posts: 41

PostPosted: Mon Apr 07, 2008 1:33 pm    Post subject: Reply with quote

Now I have another problem:
with ffmpeg-0.4.9_p20070616
I get unknown codec errors for xvid and aac (yes i have the appropriate use flags enabled)
this is probably because ffmpeg has changed the command line arguments from xvid to libxvid and from aac to libfaac:
https://forums.gentoo.org/viewtopic-t-575036-highlight-unknown+codec+aac.html?sid=ff0ccec979b43c7ed8efe18a3b4abf64
https://forums.gentoo.org/viewtopic-t-529718-view-previous.html?sid=9fa6d17387a77fca9d953eef6a62ea60
I had to select video codec h264 and replace the strings acodec aac to acodec libfaac in main.py:
Code:
su -
cd /usr/local/thinliquidfilm
sed -e "s/acodec aac/acodec libfaac/" main.py > main1.py
mv main1.py main.py

if you want to use xvid, you need to change xvid to libxvid in thinliquidfilm.py and everywhere in main.py where it checks for the xvid option.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum