FastNetMon

Saturday 27 November 2010

Конвертирование DVD Video в формат flv на Debian 5 Linux

Ствим mencoder: http://phpsuxx.blogspot.com/2009/11/mencoder-debian5-lenny.html

Далее открываем наш DVD в файловом менеджере и идем в папку VIDEO_TS и ищем там файлик с расширением VOB большого размера, например:
ls -la
total 1711056
dr-xr-xr-x 8 nrg staff 272 24 июн 2008 .
drwxr-xr-x 4 nrg staff 136 16 ноя 13:08 ..
-r-xr-xr-x 1 nrg staff 14336 24 июн 2008 VIDEO_TS.BUP
-r-xr-xr-x 1 nrg staff 14336 24 июн 2008 VIDEO_TS.IFO
-r-xr-xr-x 1 nrg staff 294912 24 июн 2008 VIDEO_TS.VOB
-r-xr-xr-x 1 nrg staff 22528 24 июн 2008 VTS_01_0.BUP
-r-xr-xr-x 1 nrg staff 22528 24 июн 2008 VTS_01_0.IFO
-r-xr-xr-x 1 nrg staff 875681792 24 июн 2008 VTS_01_1.VOB

В этом случае это файл VTS_01_1.VOB, он нам и нужен. В общем случае таких файлов может быть несколько штук, но как быть в этом случае - я не знаю, возможно, придется склеивать. Итак, если работаете не на локальной машинке, как я, грузите файлик на сервер для последующей обработки.

Запускаем конвертацию:
mencoder VTS_01_1.VOB -of lavf -ovc lavc -lavcopts vcodec=flv:vbitrate=150 -ofps 25 -oac mp3lame -lameopts abr:br=32 -srate 22050 -vf scale=720 -o outputfile.flv

В процессе конвертации видим вот такие красоты:
MEncoder dev-SVN-r26940 (C) 2000-2008 MPlayer Team
CPU: Intel(R) Core(TM) i7 CPU X 980 @ 3.33GHz (Family: 6, Model: 44, Stepping: 2)
CPUflags: Type: 6 MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1 SSE2: 1
Compiled with runtime CPU detection.
success: format: 0 data: 0x0 - 0x3431d800
MPEG-PS file format detected.
VIDEO: MPEG2 720x576 (aspect 2) 25.000 fps 9610.0 kbps (1201.2 kbyte/s)
[V] filefmt:2 fourcc:0x10000002 size:720x576 fps:25.000 ftime:=0.0400
==========================================================================
Opening audio decoder: [dvdpcm] Uncompressed DVD/VOB LPCM audio decoder
AUDIO: 48000 Hz, 2 ch, s16be, 1536.0 kbit/100.00% (ratio: 192000->192000)
Selected audio codec: [dvdpcm] afm: dvdpcm (Uncompressed DVD/VOB LPCM)
==========================================================================
** MUXER_LAVF *****************************************************************
REMEMBER: MEncoder's libavformat muxing is presently broken and can generate
INCORRECT files in the presence of B-frames. Moreover, due to bugs MPlayer
will play these INCORRECT files as if nothing were wrong!
*******************************************************************************
OK, exit.
Opening video filter: [expand osd=1]
Expand: -1 x -1, -1 ; -1, osd: 1, aspect: 0.000000, round: 1
Opening video filter: [scale w=720]
==========================================================================
Opening video decoder: [mpegpes] MPEG 1/2 Video passthrough
VDec: vo config request - 720 x 576 (preferred colorspace: Mpeg PES)
The selected video_out device is incompatible with this codec.
Try appending the scale filter to your filter list,
e.g. -vf spp,scale instead of -vf spp.
VDecoder init failed :(
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
Selected video codec: [ffmpeg2] vfm: ffmpeg (FFmpeg MPEG-2)
==========================================================================
MP3 audio selected.
VDec: vo config request - 720 x 576 (preferred colorspace: Planar YV12)
VDec: using Planar YV12 as output csp (no 0)
Movie-Aspect is 1.33:1 - prescaling to correct movie aspect.
[swscaler @ 0xa1e8d0]using unscaled yuv420p -> yuv420p special converter
videocodec: libavcodec (720x576 fourcc=31564c46 [FLV1])
New_Face failed. Maybe the font path is wrong.n 0mb A-V:0.000 [0:0]
Please supply the text font file (~/.mplayer/subfont.ttf).
subtitle font: load_sub_face failed.
New_Face failed. Maybe the font path is wrong.
Please supply the text font file (~/.mplayer/subfont.ttf).
subtitle font: load_sub_face failed.
VIDEO CODEC ID: 22
AUDIO CODEC ID: 15001, TAG: 0
Writing header...

1 duplicate frame(s)!
Pos: 0.9s 22f ( 0%) 0.00fps Trem: 1min 201mb A-V:0.084 [0:7]
Skipping frame!
Pos: 1.2s 32f ( 0%) 0.00fps Trem: 1min 279mb A-V:0.084 [2085:7]
Skipping frame!
Pos: 1.6s 42f ( 0%) 0.00fps Trem: 2min 363mb A-V:0.084 [2099:7]
Skipping frame!
Pos: 720.0s 18002f (99%) 194.66fps Trem: 0min 39mb A-V:0.081 [410:34]
Skipping frame!
Pos: 720.3s 18012f (99%) 194.70fps Trem: 0min 39mb A-V:0.081 [410:34]
Skipping frame!
Pos: 720.7s 18022f (99%) 194.75fps Trem: 0min 38mb A-V:0.081 [410:34]
Skipping frame!
Pos: 721.0s 18032f (99%) 194.81fps Trem: 0min 38mb A-V:0.081 [410:34]
Skipping frame!
Pos: 721.4s 18042f (99%) 194.85fps Trem: 0min 38mb A-V:0.081 [410:34]
Skipping frame!
Pos: 721.8s 18052f (99%) 194.91fps Trem: 0min 38mb A-V:0.081 [410:34]
Skipping frame!
Pos: 722.1s 18062f (99%) 194.96fps Trem: 0min 38mb A-V:0.081 [409:34]
Skipping frame!
Pos: 722.5s 18072f (100%) 195.00fps Trem: 0min 38mb A-V:0.081 [409:34]
Skipping frame!
Pos: 722.8s 18082f (100%) 195.07fps Trem: 0min 39mb A-V:0.081 [409:34]
Skipping frame!
Pos: 723.2s 18092f (100%) 195.13fps Trem: 0min 39mb A-V:0.081 [409:34]
Skipping frame!
Pos: 723.6s 18102f (100%) 195.20fps Trem: 0min 39mb A-V:0.081 [409:34]
Flushing video frames.
Writing index...

Video stream: 409.259 kbit/s (51157 B/s) size: 37015413 bytes 723.560 secs 18102 frames

Audio stream: 34.900 kbit/s (4362 B/s) size: 3152879 bytes 722.730 secs

И в итоге наш огромный 800 мегабайтный файл DVD Video превращается в аккуратные 40 мегабайт flv:
ls -lah outputfile.flv
-rw-r--r-- 1 root root 40M Nov 27 12:54 outputfile.fldvd

Но, к слову, полученный мною файл не читался даже плейером VLC, что странно. Но при заливке на YouTube все хорошо смотрелось и слушалось :)

Источник: http://wiki.soslug.org/wiki/vob_to_flv

No comments :

Post a Comment

Note: only a member of this blog may post a comment.