Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > General > Newbies

Reply
 
Thread Tools Search this Thread Display Modes
Old 4th August 2008, 12:13   #1  |  Link
CTYves
mx rider
 
Join Date: Jul 2008
Posts: 11
convert any video format to flv successfully

I'm pretty novice when it comes to mencoder and ffmpeg command lines, so I need some help or suggestions. At the moment my video sharing site is using the command line below to convert many video formats (3gp, 3gpp, mpg, mpeg, mpeg4, mp4, avi, wmv, flv, mov, asf, qt, dat) to flv files. So far I noticed it converts to flv file successfully when the input video is flv, 3pg, mov or mp4. Other formats are not tested yet. What I do know for certain is that wmv files are never successfully converted. The audio is converted propperly, but the video frames aren't. It's like there are 20 frames in total and you see them one after the other in a timespan of 20 seconds.

The bottom line is the code below isn't good enough to convert any video format to an flv successfully. What command line you think would?

I'm also open to use ffmpeg instead of mencoder. I just don't know what command line would be the optimal one to use. All help and suggestions are greatly appreciated.

Code:
/usr/local/bin/mencoder video.wmv -o video.flv -of lavf -oac mp3lame -lameopts abr:br=56 -ovc lavc -lavcopts vcodec=flv:vbitrate=800:mbd=2:mv0:trell:v4mv:cbp:last_pred=3 -vf scale=320:240 -srate 22050
__________________
Upload your mororized sports video to www.carbtube.com and earn a little money on the side from them.
CTYves is offline   Reply With Quote
Old 4th August 2008, 17:24   #2  |  Link
Red9
Registered User
 
Join Date: Jul 2008
Posts: 7
Why aren't you using Adobe Flash Encoder? It's very simple and knows a lot of video formats...
Red9 is offline   Reply With Quote
Old 4th August 2008, 17:34   #3  |  Link
Dark Shikari
x264 developer
 
Dark Shikari's Avatar
 
Join Date: Sep 2005
Posts: 8,666
You'd probably be better off using H.264, given how much better quality you'll get. FLV1/Sorenson Spark H.263 is a really old and crappy format.
Dark Shikari is offline   Reply With Quote
Old 5th August 2008, 09:55   #4  |  Link
CTYves
mx rider
 
Join Date: Jul 2008
Posts: 11
Quote:
Originally Posted by Red9 View Post
Why aren't you using Adobe Flash Encoder? It's very simple and knows a lot of video formats...
First time I hear about it. Can it run on a linux server? Where can I get more info about it?

Quote:
Originally Posted by Dark Shikari View Post
You'd probably be better off using H.264, given how much better quality you'll get. FLV1/Sorenson Spark H.263 is a really old and crappy format.
What should I do then? I have the latest mencoder and ffmpeg installed. How can I make my script work on H.263?

You see I'm a bit novice to it all. But I'm surely prepared to read up where I have to to get it done.
__________________
Upload your mororized sports video to www.carbtube.com and earn a little money on the side from them.
CTYves is offline   Reply With Quote
Old 5th August 2008, 10:21   #5  |  Link
dat720
Registered User
 
Join Date: Jan 2008
Posts: 870
As far as i can see there is no Adobe Flash Encoder available for linux, i would stick with mencoder and tweak what you have.

Try adding harddup in the filters section....

-vf harddup,scale=320:240

Sometimes wmv files have strange framerate's, i have seen wmv's with 100fps rates, that could explain why mencoder is having a spat!

Last edited by dat720; 5th August 2008 at 10:25.
dat720 is offline   Reply With Quote
Old 5th August 2008, 10:59   #6  |  Link
CTYves
mx rider
 
Join Date: Jul 2008
Posts: 11
I remember trying -vf scale=320:240,harddup but that didn't do it. You suggestions -vf harddup,scale=320:240 did. Great! You recon all video formats will now convert successfully because of the hardup parameter?

Also, I am intriged by what Dark Shikari said. "You'd probably be better off using H.264, given how much better quality you'll get."
How can I take advantage of that?

EDIT: It didn't do it perfectly. It seems the audio is faster or the video is slower (too many frames). Either one of these.
__________________
Upload your mororized sports video to www.carbtube.com and earn a little money on the side from them.

Last edited by CTYves; 5th August 2008 at 11:02.
CTYves is offline   Reply With Quote
Old 5th August 2008, 21:42   #7  |  Link
dat720
Registered User
 
Join Date: Jan 2008
Posts: 870
About the only other thing you could do is force a frame rate.

-ofps 23.976

Look at your failed videos and see what frame rate they are, this should give some idea as to what is going on....

PS mencoder did it's job perfectly, but the results are not what you want!
dat720 is offline   Reply With Quote
Old 5th August 2008, 21:51   #8  |  Link
Dark Shikari
x264 developer
 
Dark Shikari's Avatar
 
Join Date: Sep 2005
Posts: 8,666
H.264-in-flash example (280kbps video, 32kbps audio). Another one (1.5 megabit video, 128kbps audio)

For help encoding with x264 through ffmpeg, check out this page and this page.
Dark Shikari is offline   Reply With Quote
Old 6th August 2008, 00:24   #9  |  Link
Blue_MiSfit
Derek Prestegard IRL
 
Blue_MiSfit's Avatar
 
Join Date: Nov 2003
Location: Los Angeles
Posts: 5,988
.......................................

Dude.

That game makes my brain short-circuit. I've seen your Touhou samples before, but that's seriously, seriously impressive. 60p, and at 1.5mbps the only problem is a slight blurring / noise in the background. The massive numbers of bullets are perfectly preserved with no blocking anywhere.

~MiSfit
__________________
These are all my personal statements, not those of my employer :)
Blue_MiSfit is offline   Reply With Quote
Old 7th August 2008, 14:22   #10  |  Link
CTYves
mx rider
 
Join Date: Jul 2008
Posts: 11
As much as I would like to use H.264, I don't know how. The pages you showed are a bit complicated to me. And the videos you showed are, well..., impressive!

Can you help me get a command line that would be perfect in your eyes? I can uses mencoder or ffmpeg. Both are installed. Or can you setup a commandline that uses H.264 for me?
__________________
Upload your mororized sports video to www.carbtube.com and earn a little money on the side from them.
CTYves is offline   Reply With Quote
Old 7th August 2008, 14:53   #11  |  Link
Dark Shikari
x264 developer
 
Dark Shikari's Avatar
 
Join Date: Sep 2005
Posts: 8,666
Quote:
Originally Posted by CTYves View Post
As much as I would like to use H.264, I don't know how. The pages you showed are a bit complicated to me. And the videos you showed are, well..., impressive!

Can you help me get a command line that would be perfect in your eyes? I can uses mencoder or ffmpeg. Both are installed. Or can you setup a commandline that uses H.264 for me?
If you're on Windows, you can just use MeGUI and output to an mp4 file. If you're on Linux, this page might be useful, though as a general note using ffmpeg to encode H.264 is a bit of a nightmare, and further more you need to remux with mp4box or use qt-faststart after encoding to make the video ready for Flash (you can also mux to FLV instead to avoid this issue).
Dark Shikari is offline   Reply With Quote
Old 7th August 2008, 16:26   #12  |  Link
CTYves
mx rider
 
Join Date: Jul 2008
Posts: 11
Again, that's really chinese to me. I appreciate you helping me though.

What I would like if for someone to fill in parameters at the end of this commandline...

Code:
/usr/local/bin/mencoder video.wmv -o video.flv
... so that when I use that command line on (almost) any video format it outputs a propper flv. Preferably medium to high quality.

Some parameters in the commandline in post 1 must be cuasing some issues with some video formats (like wmv) and I don't know which.
__________________
Upload your mororized sports video to www.carbtube.com and earn a little money on the side from them.
CTYves is offline   Reply With Quote
Old 9th August 2008, 11:43   #13  |  Link
CTYves
mx rider
 
Join Date: Jul 2008
Posts: 11
anybody?
__________________
Upload your mororized sports video to www.carbtube.com and earn a little money on the side from them.
CTYves is offline   Reply With Quote
Old 9th August 2008, 12:18   #14  |  Link
dat720
Registered User
 
Join Date: Jan 2008
Posts: 870
Have Patience fella!!!

Not everyone sits here watching the forums 24/7.....

Here is the contents of my youtube.bat:
Code:
@echo off
"D:\VidTools\AutoMen\mencoder.exe" %1 -o "%~dpn1.youtube.flv" -of lavf -ovc lavc -oac lavc -lavcopts vcodec=flv:vbitrate=448:autoaspect:mbd=2:mv0:trell:v4mv:cbp:last_pred=3:predia=2:dia=2:precmp=2:cmp=2:subcmp=2:preme=2:turbo:acodec=libmp3lame:abitrate=56 -vf scale=320:240 -srate 22050 -af lavcresample=22050 -sws 9
This spits video out at roughly 3.6mb per minute.

Here is the Transformers trailer i did but it seems youtube totally raped the video, it looks much better from the original flv....

Last edited by dat720; 9th August 2008 at 12:30.
dat720 is offline   Reply With Quote
Old 9th August 2008, 12:34   #15  |  Link
CTYves
mx rider
 
Join Date: Jul 2008
Posts: 11
The same thing happens when trying to convert a wmv file. I'm testing to convert a 2 minute wmv file. When converted to flv and I play it, the video flashes by rapidly and ends after 5 seconds. The audio plays propperly for 2 minutes, but on a black background.
__________________
Upload your mororized sports video to www.carbtube.com and earn a little money on the side from them.
CTYves is offline   Reply With Quote
Old 9th August 2008, 12:53   #16  |  Link
dat720
Registered User
 
Join Date: Jan 2008
Posts: 870
can you host the file somewhere so i could download it and have a look

last time i had a strange video like that i used avisynth and forced the framerate......
dat720 is offline   Reply With Quote
Old 9th August 2008, 13:24   #17  |  Link
CTYves
mx rider
 
Join Date: Jul 2008
Posts: 11
82.wmv

Thanks, dat720
__________________
Upload your mororized sports video to www.carbtube.com and earn a little money on the side from them.
CTYves is offline   Reply With Quote
Old 9th August 2008, 13:51   #18  |  Link
dat720
Registered User
 
Join Date: Jan 2008
Posts: 870
Use the same command i posted ealier but put -fps 30 on the end.....
dat720 is offline   Reply With Quote
Old 9th August 2008, 13:59   #19  |  Link
CTYves
mx rider
 
Join Date: Jul 2008
Posts: 11
Ok. That worked. This is the results here... The sound is a bit stuttery though. But it is better then before. Defenatly. I guess it will do. What do you think?
__________________
Upload your mororized sports video to www.carbtube.com and earn a little money on the side from them.
CTYves is offline   Reply With Quote
Old 9th August 2008, 14:03   #20  |  Link
dat720
Registered User
 
Join Date: Jan 2008
Posts: 870
that could be because 30fps is not the actual frame rate of the video, media info told me 30fps so i just ran with that, and to be honest when i tested it i didn't have the volume loud enough to notice that, it's 11pm here and everyone else is in bed.

Hmm nope i was wrong, the problem is with libmp3lame, it seems to be killing the audio.

Wrong again.... i have absolutely no idea why the audio is doing that....

Last edited by dat720; 9th August 2008 at 14:15.
dat720 is offline   Reply With Quote
Reply

Tags
conversion, convert, flv, mencoder

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 17:50.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.