перекодировка видео
перекодировка видео
вот решил посмотреть видео на завре.
на лаптопе у меня откомпилированн mplayer/mencoder
поискал в нете, нашел инструкции
http://www.cs.unc.edu/~hensley/zaurus/encode.html
но по их инструкциям не перекодируеться - mencoder с ошибками падает.
как делать правильно, кто подскажет? не хотелось бы терять кучу времени на поиски и пробы.
на лаптопе у меня откомпилированн mplayer/mencoder
поискал в нете, нашел инструкции
http://www.cs.unc.edu/~hensley/zaurus/encode.html
но по их инструкциям не перекодируеться - mencoder с ошибками падает.
как делать правильно, кто подскажет? не хотелось бы терять кучу времени на поиски и пробы.
нашел где-то скрипт и изменил его (новый мплайер другие аргументы в командной строке использует). все срабатывает.
на лаптопе видео и аудио а на завре - только аудио.
мплайер из cacko feed, mplayer-w100.
что не так?
скрипт цепляю..
на лаптопе видео и аудио а на завре - только аудио.
мплайер из cacko feed, mplayer-w100.
что не так?

скрипт цепляю..
Код: Выделить всё
#!/bin/sh
ENCODE_RATE=22050
AV_DELAY=200
VIDEO_BITRATE=150
OUTPUT_FPS=15
BRIGHTNESS=15
AUDIO_QUALITY=2
X_RESOLUTION=320
Y_RESOLUTION=240
#Check the command line arguments
if [ -z "$1" ]; then
echo "Usage is 'createogm <inputfile> <outputfile>' "
exit
fi
if [ -z "$2" ]; then
echo "Usage is 'createogm <inputfile> <outputfile>' "
exit
fi
if [ -f "$2" ]; then
echo "The file $2 exists. Aborting "
exit
fi
#find $1 2>/dev/null
#if [ $? = 1 ]; then
# echo "Cannot find source file. Aborting"
# exit
#fi
#Check the source audio rate
AUDIO_RATE=$(mplayer -vo null -ao null -frames 0 -identify $1 2>/dev/null | grep "ID_AUDIO_RATE" | sed "s/ID_AUDIO_RATE=//g")
echo " ***************************************** 1 "
if [ -z $AUDIO_RATE ]; then
echo "Cannot detect audio in source file. Aborting"
exit
fi
#Delete log files from previous encodes
if [ -f divx2pass.log ]; then
rm divx2pass.log
fi
if [ -f audiotmp.wav ]; then
rm audiotmp.wav
fi
if [ -f videotmp.avi ]; then
rm videotmp.avi
fi
if [ -f audiotmp.ogg ]; then
rm audiotmp.ogg
fi
#Encode the video
#First Pass
nice -19 mencoder -nosound -ovc lavc -lavcopts vcodec=mpeg4:trell:mbd=2:vqmin=2:vqmax=31:v4mv:vmax_b_frames=1:cmp=2:subcmp=2:precmp=2:predia=1:dia=1:vme=4:vqcomp=0.6:vlelim=9:vcelim=-4:idct=7:lumi_mask=0.05:dark_mask=0.01:vstrict=-1:cbp:vfdct=1:vbitrate=$VIDEO_BITRATE:keyint=150:vpass=1 -vop expand=$X_RESOLUTION:$Y_RESOLUTION,pp=hb/vb/dr,eq=$BRIGHTNESS,scale=$X_RESOLUTION:-2,hqdn3d=8:6:12:lavcdeint -ofps $OUTPUT_FPS -zoom -sws 2 -o /dev/null $1
echo " ***************************************** 2 "
#Second Pass
nice -19 mencoder -nosound -ovc lavc -lavcopts vcodec=mpeg4:trell:mbd=2:vqmin=2:vqmax=31:v4mv:vmax_b_frames=1:vb_strategy=0:cmp=2:subcmp=2:precmp=2:predia=1:dia=1:vme=4:vqcomp=0.6:vlelim=9:vcelim=-4:idct=7:lumi_mask=0.05:dark_mask=0.01:vstrict=-1:cbp:vfdct=1:vbitrate=$VIDEO_BITRATE:keyint=150:vpass=2 -vop expand=$X_RESOLUTION:$Y_RESOLUTION,pp=hb/vb/dr,eq=$BRIGHTNESS,scale=$X_RESOLUTION:-2,hqdn3d=8:6:12:lavcdeint -ofps $OUTPUT_FPS -zoom -sws 2 -o ./videotmp.avi $1
echo " ***************************************** 3 "
#Extract the audio
nice -n 19 mplayer -vc dummy -vo null -ao pcm:file=./audiotmp.wav $1 2>/dev/null
echo " ***************************************** 4 "
#Convert to ogg
if [ $AUDIO_RATE -eq $ENCODE_RATE ]; then
nice -n 19 oggenc -r -C 2 -R $AUDIO_RATE -B 16 -q $AUDIO_QUALITY -o audiotmp.ogg audiotmp.wav
else
nice -n 19 oggenc -r -C 2 -R $AUDIO_RATE -B 16 -q $AUDIO_QUALITY --resample $ENCODE_RATE -o audiotmp.ogg audiotmp.wav
fi
echo " ***************************************** 5 "
#Multiplex the audio and video streams
nice -n 19 ogmmerge -o $2 videotmp.avi --sync $AV_DELAY audiotmp.ogg
echo " ***************************************** 6 "
#Delete the temporary files
rm audiotmp.ogg
rm audiotmp.wav
rm videotmp.avi
rm divx2pass.log
- Вложения
-
- createogm2.sh.gz
- (1.03 КБ) 300 скачиваний
Далал как в ссылке:
http://www.cs.unc.edu/~hensley/zaurus/encode.html
Только стерео, а не моно (-lameopts preset=15:mode=0)
Исходный файл:
723 042 304 байт
AVI, 512 x 384, ~24 fps, video: DivX 3 Low-Motion, audio: MPEG-1 Layer 3 (stereo, 48000 Hz)
За 22 минуты на P4 прямо с CDROM
получил:
114 285 192 байт
VI, 320 x 240, ~15 fps, video:, audio: MPEG-1 Layer 3 (stereo, 24000 Hz)
2 прохода делать не к чему.
mencoder /cdrom/VideoOut.avi -srate 24000 -vop scale=320:240 -o Shrek.avi -oac mp3lame -lameopts preset=15:mode=0 -ovc lavc -lavcopts vcodec=mpeg4:vhq:vbitrate=150 -ofps 15 -sws 2
http://www.cs.unc.edu/~hensley/zaurus/encode.html
Только стерео, а не моно (-lameopts preset=15:mode=0)
Исходный файл:
723 042 304 байт
AVI, 512 x 384, ~24 fps, video: DivX 3 Low-Motion, audio: MPEG-1 Layer 3 (stereo, 48000 Hz)
За 22 минуты на P4 прямо с CDROM
получил:
114 285 192 байт
VI, 320 x 240, ~15 fps, video:, audio: MPEG-1 Layer 3 (stereo, 24000 Hz)
2 прохода делать не к чему.
mencoder /cdrom/VideoOut.avi -srate 24000 -vop scale=320:240 -o Shrek.avi -oac mp3lame -lameopts preset=15:mode=0 -ovc lavc -lavcopts vcodec=mpeg4:vhq:vbitrate=150 -ofps 15 -sws 2
у меня почему-то мплайер на дебиане скомпилился без lame и mp3lame. на такие опции он сразу ругаеться.
файл могу приложить он 3.5мб. на десктопе играет с видео а на завре - только аудио
вывоод на завре:
$ mplayer DjQuicksilverAmeno.ogm
MPlayer dev-CVS--3.4.3 (C) 2000-2005 MPlayer Team
CPU: ARM
Failed to open /dev/rtc: Device or resource busy (it should be readable by the user.)
Playing DjQuicksilverAmeno.ogm.
Ogg file format detected.
VIDEO: [FMP4] 320x262 24bpp 15.000 fps 0.0 kbps ( 0.0 kbyte/s)
==========================================================================
Opening audio decoder: [libvorbis] Ogg/Vorbis audio decoder
AUDIO: 22050 Hz, 2 ch, 16 bit (0x9), ratio: 7000->88200 (56.0 kbit)
Selected audio codec: [vorbis] afm:libvorbis (OggVorbis Audio Decoder)
==========================================================================
SDL: Initializing of SDL failed: Unable to open a console terminal.
==========================================================================
Cannot find codec matching selected -vo and video format 0x34504D46.
Read DOCS/HTML/en/codecs.html!
==========================================================================
Can't restore text mode: Invalid argument
Checking audio filter chain for 22050Hz/2ch/16bit -> 22050Hz/2ch/16bit...
AF_pre: af format: 2 bps, 2 ch, 22050 hz, little-endian 16-bit signed int
AF_pre: 22050Hz 2ch little-endian 16-bit signed int
AO: [oss] 22050Hz 2ch little-endian 16-bit signed int (2 bps)
Building audio filter chain for 22050Hz/2ch/16bit -> 22050Hz/2ch/16bit...
Video: no video
Starting playback...
A: 166.8 (02:46.7) 6.4%
Exiting... (End of file)
$
файл могу приложить он 3.5мб. на десктопе играет с видео а на завре - только аудио
вывоод на завре:
$ mplayer DjQuicksilverAmeno.ogm
MPlayer dev-CVS--3.4.3 (C) 2000-2005 MPlayer Team
CPU: ARM
Failed to open /dev/rtc: Device or resource busy (it should be readable by the user.)
Playing DjQuicksilverAmeno.ogm.
Ogg file format detected.
VIDEO: [FMP4] 320x262 24bpp 15.000 fps 0.0 kbps ( 0.0 kbyte/s)
==========================================================================
Opening audio decoder: [libvorbis] Ogg/Vorbis audio decoder
AUDIO: 22050 Hz, 2 ch, 16 bit (0x9), ratio: 7000->88200 (56.0 kbit)
Selected audio codec: [vorbis] afm:libvorbis (OggVorbis Audio Decoder)
==========================================================================
SDL: Initializing of SDL failed: Unable to open a console terminal.
==========================================================================
Cannot find codec matching selected -vo and video format 0x34504D46.
Read DOCS/HTML/en/codecs.html!
==========================================================================
Can't restore text mode: Invalid argument
Checking audio filter chain for 22050Hz/2ch/16bit -> 22050Hz/2ch/16bit...
AF_pre: af format: 2 bps, 2 ch, 22050 hz, little-endian 16-bit signed int
AF_pre: 22050Hz 2ch little-endian 16-bit signed int
AO: [oss] 22050Hz 2ch little-endian 16-bit signed int (2 bps)
Building audio filter chain for 22050Hz/2ch/16bit -> 22050Hz/2ch/16bit...
Video: no video
Starting playback...
A: 166.8 (02:46.7) 6.4%
Exiting... (End of file)
$
а вот тот же файл на десктопе как проигрался:
mplayer -vo x11 DjQuicksilverAmeno.ogm
MPlayer 1.0pre7try2-3.3.5 (C) 2000-2005 MPlayer Team
CPU: Transmeta Crusoe TM3x00,TM5x00 (Family: 5, Stepping: 3)
Detected cache-line size is 128 bytes
CPUflags: MMX: 1 MMX2: 0 3DNow: 0 3DNow2: 0 SSE: 0 SSE2: 0
Compiled for x86 CPU with extensions: MMX
85 audio & 196 video codecs
Linux RTC init error in ioctl (rtc_irqp_set 1024): Permission denied
Try adding "echo 1024 > /proc/sys/dev/rtc/max-user-freq" to your system startup scripts.
Playing DjQuicksilverAmeno.ogm.
[Ogg] stream 0: video (FOURCC FMP4), -vid 0
[Ogg] stream 1: audio (Vorbis), -aid 0
Ogg file format detected.
VIDEO: [FMP4] 320x262 24bpp 15.000 fps 0.0 kbps ( 0.0 kbyte/s)
==========================================================================
Opening audio decoder: [libvorbis] Ogg/Vorbis audio decoder
AUDIO: 22050 Hz, 2 ch, s16le, 56.0 kbit/7.94% (ratio: 7000->88200)
Selected audio codec: [vorbis] afm:libvorbis (OggVorbis Audio Decoder)
==========================================================================
vo: X11 running at 1280x600 with depth 16 and 16 bpp (":0.0" => local display)
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
Selected video codec: [ffodivx] vfm:ffmpeg (FFmpeg MPEG-4)
==========================================================================
Checking audio filter chain for 22050Hz/2ch/s16le -> 22050Hz/2ch/s16le...
AF_pre: 22050Hz/2ch/s16le
AO: [oss] 22050Hz 2ch s16le (2 bps)
Building audio filter chain for 22050Hz/2ch/s16le -> 22050Hz/2ch/s16le...
Starting playback...
VDec: vo config request - 320 x 262 (preferred csp: Planar YV12)
VDec: using Planar YV12 as output csp (no 0)
Movie-Aspect is 1.22:1 - prescaling to correct movie aspect.
VO: [x11] 320x262 => 320x262 Planar YV12
SwScaler: using unscaled Planar YV12 -> BGR 16-bit special converter
A: 167.0 V: 167.1 A-V: -0.168 ct: -0.413 2499/2499 12% 4% 6.6% 9 0
Exiting... (End of file)
mplayer -vo x11 DjQuicksilverAmeno.ogm
MPlayer 1.0pre7try2-3.3.5 (C) 2000-2005 MPlayer Team
CPU: Transmeta Crusoe TM3x00,TM5x00 (Family: 5, Stepping: 3)
Detected cache-line size is 128 bytes
CPUflags: MMX: 1 MMX2: 0 3DNow: 0 3DNow2: 0 SSE: 0 SSE2: 0
Compiled for x86 CPU with extensions: MMX
85 audio & 196 video codecs
Linux RTC init error in ioctl (rtc_irqp_set 1024): Permission denied
Try adding "echo 1024 > /proc/sys/dev/rtc/max-user-freq" to your system startup scripts.
Playing DjQuicksilverAmeno.ogm.
[Ogg] stream 0: video (FOURCC FMP4), -vid 0
[Ogg] stream 1: audio (Vorbis), -aid 0
Ogg file format detected.
VIDEO: [FMP4] 320x262 24bpp 15.000 fps 0.0 kbps ( 0.0 kbyte/s)
==========================================================================
Opening audio decoder: [libvorbis] Ogg/Vorbis audio decoder
AUDIO: 22050 Hz, 2 ch, s16le, 56.0 kbit/7.94% (ratio: 7000->88200)
Selected audio codec: [vorbis] afm:libvorbis (OggVorbis Audio Decoder)
==========================================================================
vo: X11 running at 1280x600 with depth 16 and 16 bpp (":0.0" => local display)
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
Selected video codec: [ffodivx] vfm:ffmpeg (FFmpeg MPEG-4)
==========================================================================
Checking audio filter chain for 22050Hz/2ch/s16le -> 22050Hz/2ch/s16le...
AF_pre: 22050Hz/2ch/s16le
AO: [oss] 22050Hz 2ch s16le (2 bps)
Building audio filter chain for 22050Hz/2ch/s16le -> 22050Hz/2ch/s16le...
Starting playback...
VDec: vo config request - 320 x 262 (preferred csp: Planar YV12)
VDec: using Planar YV12 as output csp (no 0)
Movie-Aspect is 1.22:1 - prescaling to correct movie aspect.
VO: [x11] 320x262 => 320x262 Planar YV12
SwScaler: using unscaled Planar YV12 -> BGR 16-bit special converter
A: 167.0 V: 167.1 A-V: -0.168 ct: -0.413 2499/2499 12% 4% 6.6% 9 0
Exiting... (End of file)
Добавить: format 0x34504D46 в файл codecs.conf секция: videocodec ffodivx
videocodec ffodivx
info "FFmpeg MPEG-4"
status working
fourcc DIVX,divx
fourcc DIV1,div1 divx
fourcc MP4S,mp4s ; ISO MPEG-4 Video V1
fourcc M4S2,m4s2
fourcc xvid,XVID,XviD,XVIX
fourcc DX50,dx50,BLZ0 DX50
fourcc mp4v,MP4V
format 0x4
fourcc UMP4
fourcc 3IV2,3iv2 ; 3ivx Delta 4
format 0x34504D46
format 0x10000004 ; mpeg 4 es
driver ffmpeg
dll mpeg4 ;opendivx
out YV12,I420,IYUV
videocodec ffodivx
info "FFmpeg MPEG-4"
status working
fourcc DIVX,divx
fourcc DIV1,div1 divx
fourcc MP4S,mp4s ; ISO MPEG-4 Video V1
fourcc M4S2,m4s2
fourcc xvid,XVID,XviD,XVIX
fourcc DX50,dx50,BLZ0 DX50
fourcc mp4v,MP4V
format 0x4
fourcc UMP4
fourcc 3IV2,3iv2 ; 3ivx Delta 4
format 0x34504D46
format 0x10000004 ; mpeg 4 es
driver ffmpeg
dll mpeg4 ;opendivx
out YV12,I420,IYUV
Может версия mplayer?
У меня:
MPlayer 1.0pre7-3.4.2 (C) 2000-2005 MPlayer Team
for Zaurus 1.1.5 (C) 2004-2005 AGAWA Koji (atty)
Я сейчас сконвертирую в ogm и проверю с разными версиями mplayer на зауре.
У меня на десктопе почему-то mencoder не берет ключ
-vf pp=hb/vb/dr/al (-vop)
Запустил без него.
Рекомендую все же:
mencoder Input.avi -srate 24000 -vop scale=320:240 -o Output.avi -oac mp3lame -lameopts preset=15:mode=0 -ovc lavc -lavcopts vcodec=mpeg4:vhq:vbitrate=150 -ofps 15 -sws 2
Гораздо быстрее
У меня:
MPlayer 1.0pre7-3.4.2 (C) 2000-2005 MPlayer Team
for Zaurus 1.1.5 (C) 2004-2005 AGAWA Koji (atty)
Я сейчас сконвертирую в ogm и проверю с разными версиями mplayer на зауре.
У меня на десктопе почему-то mencoder не берет ключ
-vf pp=hb/vb/dr/al (-vop)
Запустил без него.
Рекомендую все же:
mencoder Input.avi -srate 24000 -vop scale=320:240 -o Output.avi -oac mp3lame -lameopts preset=15:mode=0 -ovc lavc -lavcopts vcodec=mpeg4:vhq:vbitrate=150 -ofps 15 -sws 2
Гораздо быстрее
У заведующего фидом буржуя щас подруга беременна на последних месяцах, соотвественно некогда ему фидом заниматьсяsvs57 писал(а):Вобщем mplayer из цаско фида не воспроизводит видео ogm.
Также не воспроизводит звук 3gp (нет amr_nb 0x726D6173 в libavcodec )
С atty воспроизводит и то и то
Я уже просили положить в цаско фид версию mplayer'а с atty.
Мне ответили, что после выхода новой версии Кино2.

- longshadow
- Профессор (5 lvl)
- Сообщения: 529
- Зарегистрирован: Вт ноя 11, 2003 16:17
- longshadow
- Профессор (5 lvl)
- Сообщения: 529
- Зарегистрирован: Вт ноя 11, 2003 16:17
Готово. Для желающих воспользоваться этим "зеркалом":longshadow писал(а):Щас осуществим.maslovsky писал(а):Пусть longshadow зеркало у себя обновит, заложит в него свежего kino2 и mplayer...
- url "зеркала" http://zaurus.mol.ru/feed
- стандартный фид (http://cacko.biz/cacko/feed) надо закомментировать в ipkg.conf; лично у меня пэкейдж менеджер вис, если оба фида были прописаны; а может просто тормозил, разбираясь, где что новее - все равно неприятно.
SL-C3000 / 8GB internal CF storage