分页: 1 / 1

在Linux上自己制作供智能手机播放的视频文件

发表于 : 2006-03-16 13:06
id_sonic
最近买了一个 NOKIA 3230 ,没有WINDOWS, 所以不能用 smart moive 的pc端来自己制作供 smart moive 或者 dvdplayer 播放的视频文件(电影,MV之类的),不过现在找到了办法,没有问题了!在LINUX下就可以自己把机器上的视频文件制作成供你的智能手机播放的文件!

方法:

首先确定你安装了以下软件包

代码: 全选

mencoder, mplayer, lame, ffmpeg, and w32codecs
然后用下面这个脚本转换吧,注意自己调整适合你手机屏幕大小的参数,或者自己调整脚本中的其他参数让文件在你的手机上播放有最好效果,这个就自己去TRY哦……

代码: 全选

#!/bin/bash
#convert Video to avi format for Nokia playing with DVDPlayer
FName=$1
# extract the movie, scale and resample with 15 fps
mencoder -nosound -ovc lavc -lavcopts vcodec=xvid -vop expand=320:200,scale=-2:200 -o movie.avi -ofps 15 "$FName"
#extract the audio from the movie, resample with 16 kHz and store it to audiodump.wav
mplayer -vo null -ao pcm -af resample=16000 "$FName"
#encode audiofile with 16KHz / 16 kbit/sec to mp3
lame -m m -b 16 -B 16 -F audiodump.wav audiodump.mp3
#mix audio and Video into an avi - audio mp3, video xvid
ffmpeg -i movie.avi -i audiodump.mp3 -b 120 -ac 1 -ab 16 -acodec mp3 -vcodec xvid -map 0.0 -map 1.0 "$FName.avi"
rm movie.avi
rm audiodump.wav
rm audiodump.mp3

发表于 : 2006-03-17 14:23
种草得草
不错.
不过mencoder一个命令不能搞定吗?
NOKIA的屏幕应该是176*208的

发表于 : 2006-03-17 16:20
id_sonic
种草得草 写了:不错.
不过mencoder一个命令不能搞定吗?
NOKIA的屏幕应该是176*208的
应该不可以,不过可以尝试一下。我的那个是 176*208, 有的不是。

发表于 : 2007-10-19 19:07
炎羽
顶楼主,希望在详细一点~

发表于 : 2007-11-02 17:27
mrzcs
请教一个问题,我运行时出现以下问题。

FFmpeg version SVN-rUNKNOWN, Copyright (c) 2000-2007 Fabrice Bellard, et al.
configuration: --enable-gpl --enable-pp --enable-swscaler --enable-pthreads --enable-libvorbis --enable-libtheora --enable-libogg --enable-libgsm --enable-dc1394 --disable-debug --enable-shared --prefix=/usr
libavutil version: 1d.49.3.0
libavcodec version: 1d.51.38.0
libavformat version: 1d.51.10.0
built on Jun 3 2007 20:59:25, gcc: 4.1.3 20070528 (prerelease) (Ubuntu 4.1.2-9ubuntu2)
Input #0, avi, from 'movie.avi':
Duration: 00:01:06.2, start: 0.000000, bitrate: 540 kb/s
Stream #0.0: Video: mpeg4, yuv420p, 320x200, 15.00 fps(r)
Input #1, mp3, from 'audiodump.mp3':
Duration: 00:01:06.2, start: 0.000000, bitrate: 16 kb/s
Stream #1.0: Audio: mp3, 16000 Hz, mono, 16 kb/s

Unknown codec 'xvid'

无法识别xvid编码,这是哪里的问题捏?

发表于 : 2007-11-02 17:35
eexpress
mencoder可以吧。那分辨率等,都可以定义的啊。解码器选择正确而已。一般音频也是lame