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 > Video Encoding > MPEG-4 AVC / H.264
Register FAQ Calendar Today's Posts Search

Reply
 
Thread Tools Search this Thread Display Modes
Old 25th April 2007, 11:32   #1  |  Link
DangeR!
Registered User
 
Join Date: Feb 2006
Posts: 18
Changing fps from 60 to 30.

Hi,
I have fraps footage that I put together in Virtualdub and saved as an .avi file (non compressed). Basically so its just one file. Its about 30GB in total and is shot at 640x512 @ 60fps, 20 mins long.

based on this thread http://forum.doom9.org/showthread.php?t=125079 (great work btw)

Now I am encoding it into x264 using a batch file I created (attached) with switches. Could some of the more experienced look over it and see if its ok. It encodes the file down to 300MB and the quality is excellent, took 3 hours for one pass (first), but it doesn't seem to change the fps from 60 to 30fps. I am assuming it will reduce the file size further if its @ 30fps so I need to convert it. Is the --fps switch broken or am I missing something?

This is my very first time doing this sort of thing. Ripping from DVD's is easy, point and click lol. But doing this from scratch with avi files etc requires me to get some advice.

Code:
@ECHO OFF
ECHO.     ------------------------------
ECHO.         Setting Variables.
ECHO.     ------------------------------
SET bitrate=2000
SET threads=2
SET fps=30.00
SET input=frapScript.avs
SET output=output.mp4
ECHO.     ------------------------------
ECHO.         Encode First Pass
ECHO.     ------------------------------
x264.exe --fps %fps% --trellis 2 --me umh --bime --merange 64 --no-fast-pskip --partitions all --8x8dct --pass 1 --bitrate %bitrate%  --subme 7 --bframes 16 --b-pyramid --ref 5 --b-rdo --aq-strength 0.5 --mixed-refs --direct auto --weightb --progress --deblock 1:-1 --threads %threads% -o %output% %input%
ECHO.     ----------------------------------
ECHO.         Encode Second Pass
ECHO.     ----------------------------------
x264.exe --fps %fps% --trellis 2 --me umh --bime --merange 64 --no-fast-pskip --partitions all --8x8dct --pass 2 --bitrate %bitrate%  --subme 7 --bframes 16 --b-pyramid --ref 5 --b-rdo --aq-strength 0.5 --mixed-refs --direct auto --weightb --progress --deblock 1:-1 --threads %threads% -o %output% %input%
ECHO.     ------------------------------
ECHO.         Finished Encoding
ECHO.     ------------------------------
PAUSE
CLS
EXIT
Thanks,
D.

EDIT: once I have done 2 passes, what software can i use to put music and title screens in. Will I have to encode it again? won't it loose quality.
Attached Files
File Type: zip ENC.zip (482 Bytes, 30 views)

Last edited by DangeR!; 25th April 2007 at 13:03.
DangeR! is offline   Reply With Quote
Old 25th April 2007, 15:42   #2  |  Link
AVmaniac
Registered User
 
AVmaniac's Avatar
 
Join Date: Mar 2005
Location: Germany
Posts: 27
hi .. what about using avisynth internal conversion of fps ?

convertfps(30) ... but the value choosen can be max. 2/3
of source fps.
so if you want to perhaps go convert to 25fps you can combine
multiple convertfps
convertfps(30).convertfps(25)

see also avisynth docs ConvertFPS().

About audio:
try ...
Code:
video = yourvideosource
audio = wavsource("your.wav") 
#or directshowsource("your.something.soundfile")

audiodub(video,audio)

convertfps(30)
... you can extract a *.wav file using virtualdub and loading your *.avs .

Last edited by AVmaniac; 25th April 2007 at 15:51.
AVmaniac is offline   Reply With Quote
Old 25th April 2007, 15:57   #3  |  Link
akupenguin
x264 developer
 
akupenguin's Avatar
 
Join Date: Sep 2004
Posts: 2,392
Multiple calls to convertfps? That's just asking for trouble. The convertfps doc even says so.
akupenguin is offline   Reply With Quote
Old 25th April 2007, 17:00   #4  |  Link
DangeR!
Registered User
 
Join Date: Feb 2006
Posts: 18
Hi,
thanks for the replys.

this is whats in my .avs file
Code:
DirectShowSource("video.avi")
ConvertToYV12()
so just add convertfps(30) to the end of it?

didn't realise .avs files could do that (don't really know what they do tbh lol.)

This is a good site for x264 commands, witch I have followed http://aflux.deltaanime.net/Zero1/MP4/x264.html

Also, does my x264 settings look ok + will 30fps reduce the file size by half, if any?
DangeR! is offline   Reply With Quote
Old 25th April 2007, 17:12   #5  |  Link
LoRd_MuldeR
Software Developer
 
LoRd_MuldeR's Avatar
 
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,248
Quote:
Originally Posted by DangeR! View Post
didn't realise .avs files could do that (don't really know what they do tbh lol.)
Avisynth is one of the most powerful softwares for video editing.
With Avisynth scripts you can do almost everything (some additional Plugins might be necessary though)

You might like to read this:
http://avisynth.org/YourFirstScript
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊
LoRd_MuldeR is offline   Reply With Quote
Old 25th April 2007, 18:41   #6  |  Link
DangeR!
Registered User
 
Join Date: Feb 2006
Posts: 18
Thanks LoRd_MuldeR, I'll have a read of that soon.

I have a problem. x264 cannot open my avs file, any ideas why?

my error:
avis [error]: unsupported input format (DIB )
x264 [error]: could not open input file 'frapScript.avs'

Last edited by DangeR!; 25th April 2007 at 18:58.
DangeR! is offline   Reply With Quote
Old 25th April 2007, 19:19   #7  |  Link
DangeR!
Registered User
 
Join Date: Feb 2006
Posts: 18
VLC doesn't play my original .avi file now :/. WMP and virtualDub do though, very strange.
DangeR! is offline   Reply With Quote
Old 25th April 2007, 19:26   #8  |  Link
Blue_MiSfit
Derek Prestegard IRL
 
Blue_MiSfit's Avatar
 
Join Date: Nov 2003
Location: Los Angeles
Posts: 5,989
It might be a lot faster if you re-encode to HuffYUV, or a similar universal lossless codec. It will save space and time.

~Misfit
__________________
These are all my personal statements, not those of my employer :)
Blue_MiSfit is offline   Reply With Quote
Old 25th April 2007, 20:31   #9  |  Link
DangeR!
Registered User
 
Join Date: Feb 2006
Posts: 18
how do i solve my error?

is HuffYUV as good quality as x264?

Last edited by DangeR!; 25th April 2007 at 20:37.
DangeR! is offline   Reply With Quote
Old 25th April 2007, 20:52   #10  |  Link
LoRd_MuldeR
Software Developer
 
LoRd_MuldeR's Avatar
 
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,248
Quote:
Originally Posted by DangeR! View Post
how do i solve my error?

is HuffYUV as good quality as x264?
HuffYUV is lossless, x264 usually is not (except you use CQ=0)

But don't expect HuffYUV to achieve a decent compression-ratio, it's more intended for real-time capturing and intermediate storage!
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊
LoRd_MuldeR is offline   Reply With Quote
Old 25th April 2007, 22:57   #11  |  Link
Shinjite
Registered User
 
Join Date: Aug 2005
Posts: 66
Quote:
Originally Posted by DangeR! View Post
Hi,
thanks for the replys.

this is whats in my .avs file
Code:
DirectShowSource("video.avi")
ConvertToYV12()
so just add convertfps(30) to the end of it?

didn't realise .avs files could do that (don't really know what they do tbh lol.)

This is a good site for x264 commands, witch I have followed http://aflux.deltaanime.net/Zero1/MP4/x264.html

Also, does my x264 settings look ok + will 30fps reduce the file size by half, if any?
to reduce the size of the output clip is depends on the target bitrate you want in the x264 settings.
Shinjite is offline   Reply With Quote
Old 25th April 2007, 23:19   #12  |  Link
DangeR!
Registered User
 
Join Date: Feb 2006
Posts: 18
Quote:
Originally Posted by LoRd_MuldeR View Post
HuffYUV is lossless, x264 usually is not (except you use CQ=0)

But don't expect HuffYUV to achieve a decent compression-ratio, it's more intended for real-time capturing and intermediate storage!
do you mean use virtualdub to record my game play using HuffYUV (using VD as a fraps substitute)?

I take it no one knows why this error has come up when the file used to encode fine before.

I also thought that reducing the fps would also reduce the overall size of the footage when encoded. less frames less size.

Last edited by DangeR!; 25th April 2007 at 23:23.
DangeR! is offline   Reply With Quote
Old 25th April 2007, 23:29   #13  |  Link
DangeR!
Registered User
 
Join Date: Feb 2006
Posts: 18
I figured out my error, or at least why it wouldn't open properly. its the command ConvertFPS(30). I took this out and it started to encode as it should.

If reducing the fps isn't going to reduce the file size, then there is no need to change it. I'm fine with 2000 bitrate, though I may experiment with it to get the file size down a bit.
DangeR! is offline   Reply With Quote
Old 25th April 2007, 23:39   #14  |  Link
ballofsnow
Registered User
 
Join Date: Oct 2005
Posts: 6
Why not just use selecteven()? By using ConvertFPS(30) you're removing half the frames, same as selecting every other frame.

edit- whoops, nevermind. Confused this with changefps. You may be looking to use changefps instead!

Last edited by ballofsnow; 25th April 2007 at 23:44.
ballofsnow is offline   Reply With Quote
Old 25th April 2007, 23:40   #15  |  Link
DangeR!
Registered User
 
Join Date: Feb 2006
Posts: 18
ok read a bit more.

Because the source file is at 60 fps and I have to do 2/3 of that, the convertfps will have to be 40fps.
DangeR! is offline   Reply With Quote
Old 25th April 2007, 23:42   #16  |  Link
DangeR!
Registered User
 
Join Date: Feb 2006
Posts: 18
Quote:
Originally Posted by ballofsnow View Post
Why not just use selecteven()? By using ConvertFPS(30) you're removing half the frames, same as selecting every other frame.
I'm new to this (1 day lol) and reading allot of info on the subject... haven't come across that command yet, thanks for the heads up. I will look into it.
DangeR! is offline   Reply With Quote
Old 25th April 2007, 23:55   #17  |  Link
DangeR!
Registered User
 
Join Date: Feb 2006
Posts: 18
The encoded footage wont play on WMP or QuickTime, but it plays in VCL. How can I make it more compatable? is it to do with --merange should I use 64 or 32, as I hear 32 allows it to be played in quicktime/ipod.

sorry for all the questions and thanks for the help so far.
DangeR! is offline   Reply With Quote
Old 26th April 2007, 00:06   #18  |  Link
ballofsnow
Registered User
 
Join Date: Oct 2005
Posts: 6
You may have missed my edit above. You should look into both selecteven(), and ChangeFPS(30). Changefps will delete or duplicate frames to meet the desired framerate. In your case it'd delete half of them, which I'm pretty sure is what you want.

To make it Quicktime 7 compatible, in MeGUI you'd select main profile, and make sure that bpyramid is off. Not sure what the exact command line would be though.
ballofsnow is offline   Reply With Quote
Old 26th April 2007, 00:08   #19  |  Link
DangeR!
Registered User
 
Join Date: Feb 2006
Posts: 18
what about windows media player... thanks for reply
DangeR! is offline   Reply With Quote
Old 26th April 2007, 00:08   #20  |  Link
LoRd_MuldeR
Software Developer
 
LoRd_MuldeR's Avatar
 
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,248
Quote:
Originally Posted by DangeR! View Post
I also thought that reducing the fps would also reduce the overall size of the footage when encoded. less frames less size.
When compressing video, you usually select the target bitrate (when not using Constant Quantizer mode)
Bitrate is selected as "Kilobits per Second" and not "Bits per Frame" or something
This means the resulting Filesize will be the same, no matter which Framerate the video has!
Of course if the video has a lower Framerate, then you can usually encode at a lower Bitrate and still get a decent quality.
So reducing the Framerate will not make your file any smaller, as long as you don't adjust the Bitrate too!
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊

Last edited by LoRd_MuldeR; 26th April 2007 at 00:14.
LoRd_MuldeR is offline   Reply With Quote
Reply


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 04:02.


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