Use mencoder to solve the problem of converting FFMPEG to WMV/ASF to FLV screen, and support RM/rmvb

Source: Internet
Author: User
Tags flv file
In SS/XS, we use FFMPEG as an example. However, when converting wmv and ASF, the image is often displayed on the screen. I checked the information on the Internet and found that the parameter adjustment was invalid.
Later, I used mencoder, and the conversion was slow, but the quality was good. I tried at least a dozen WMV/ASF screens, unexpectedly, the converted FLV file is smaller than that transferred from FFMPEG.

It is worth mentioning that mencoder is slower than FFMPEG and occupies a relatively large amount of system resources. Maybe the quality of the parameters I use is relatively high. If you have time, you can adjust the parameters.

The convert. Bat Implementation of SS/Xs can be automatically converted according to the original scheduled task.

Copy the following content to the clipboard:
Code:

@ Echo off
For/R % 1 \ video \ Temp % I in (*. mov *. Avi *. mpg *. MPEG) Do call: Convert % 1% % ~ I % ~ Ni
For/R % 1 \ video \ Temp % I in (*. RM * rmvb *. wmv *. asf) Do call: convert1 % 1% % ~ I % ~ Ni
Goto: End
: Convert sitepath fullfile filename
Setlocal enableextensions
Set file = % 3
Set Path = % file :~ -14,6%
If not exist % 1 \ video \ % PATH % mkdir % 1 \ video \ % PATH %
C: \ ffmpeg.exe-I % 2-y-AB 56-ar 11025-AC 2-B 1500-qscale 9-R 15-s 320 * 240% 1 \ video \ % PATH % \ % 3.flv
C: \ ffmpeg.exe-I % 2-y-F image2-SS 8-sameq-T 0.001-s 320 x 240% 1 \ video \ % PATH % \ % 3.jpg
Del % 2
Endlocal
: Convert1 sitepath fullfile filename
Setlocal enableextensions
Set file = % 3
Set Path = % file :~ -14,6%
If not exist % 1 \ video \ % PATH % mkdir % 1 \ video \ % PATH %
C: \ mencoder.exe % 2-o % 1 \ video \ % PATH % \ % 3.flv-of lavf-lavfopts audio-OAC mp3lame-lameopts ABR: BR = 56-OVC lavc-lavcopts vcodec = FLV: vbitrate = 200: mbd = 2: mv0: trell: v4mv: White: last_pred = 3: Dia = 4: CMP = 6: vb_strategy = 1-VF scaling = 320: 240-ofps 12-srate 22050
C: \ ffmpeg.exe-I % 2-y-F image2-SS 8-sameq-T 0.001-s 320 x 240% 1 \ video \ % PATH % \ % 3.jpg
Del % 2
Endlocal
: End

In addition, mencoder supports RM and rmvb formats, so it is added to this batch.

Mencoder download:
Http://www.llbbll.com /? Uid-1145-action-viewspace-itemid-990
Or extract from mplayer:
Http://www5.mplayerhq.hu/MPlayer... -mingw32-1.0rc1.zip
Official resource address:
Http://www5.mplayerhq.hu/MPlayer/releases/win32/

 

However, the following statement is used for testing.

C: \> mencoder.exe D: \ website \ MySpace \ video \ temp \ JHB. rm-o d: \ website \ MySpace \ vide
O \ temp3.flv-of lavf-lavfopts I _certify_that_my_video_stream_does_not_use_ B _fr
Ames-OAC mp3lame-lameopts ABR: Br = 56-OVC lavc-lavcopts vcodec = FLV: vbitrate = 20
0: mbd = 2: mv0: trell: v4mv: White: last_pred = 3: Dia = 4: CMP = 6: vb_strategy = 1-VF scale = 320: 2
40-ofps 12-srate 22050
Mencoder 1.0rc1-3.4.2 (c) 2000-2006 mplayer team
CPU: Intel (r) Celyn (r) CPU 2.40 GHz (Family: 15, model: 3, stepping: 4)
Cpuflags: Type: 15 MMX: 1 mmx2: 1 3 dnow: 0 3dnow2: 0 SSE: 0 sse2: 0
Compiled with runtime CPU detection.
Success: Format: 0 data: 0x0-0x815b5
Real file format detected.
Stream Description: Video Stream
Stream mimetype: Video/X-PN-realvideo
Stream Description: audio stream
Stream mimetype: Audio/X-PN-RealAudio
Stream mimetype: logical-fileinfo
Video: [rv40] 632x420 24bpp 29.000 FPS 0.0 kbps (0.0 Kbyte/s)
[V] filefmt: 11 fourcc: 0x30345652 size: 632x420 FPS: 29.00 ftime: = 0.0345
========================================================== ========================================
Opening audio decoder: [FFMPEG] FFMPEG/libavcodec audio decoders
Audio: 44100Hz, 2 CH, s16le, 44.1 kbit/3.12% (ratio: 5512-> 176400)
Selected audio codec: [ffcook] IBS: FFMPEG (FFMPEG cook audio decoder)
========================================================== ========================================
** Muxer_lavf ************************************* ****************************
You have certified that your video stream does not contain B frames.
Remember: mencoder's libavformat muxing is presently broken and will 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 = 320 H = 240]
========================================================== ========================================
Opening Video Decoder: [realvid] realvideo Decoder
Error loading DLL
Error: cocould not open required DirectShow codec drvc. So.
Read the realvideo section of the docs!
Vdecoder init failed
Opening Video Decoder: [realvid] realvideo Decoder
Error loading DLL
Error: cocould not open required DirectShow codec drv4.so. 6.0.
Read the realvideo section of the docs!
Vdecoder init failed
Opening Video Decoder: [realvid] realvideo Decoder
Error loading DLL
Error: cocould not open required DirectShow codec drv43260.dll.
Read the realvideo section of the docs!
Vdecoder init failed
Opening Video Decoder: [realvid] realvideo Decoder
Error loading DLL
Error: cocould not open required DirectShow codec drvc. Bundle/contents/MACOs/drvc.

Read the realvideo section of the docs!
Vdecoder init failed
Cannot find codec matching selected-vo and video format 0x30345652.
Read docs/html/en/codecs.html!
========================================================== ====================

I used black bold to indicate the error.

The solution isHttp://www.mplayerhq.hu/design7/dload.htmlDownload the binary codec package

Uncompress the package and copy the drv43260.dll to the Windows/system32/directory.

Then start-> RUN regsvr32 drv42360.dll. The output is successful !!!! You can enable FLV.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.