Avidemux Forum

Avidemux => Main version 2.6 => Topic started by: Khyinn on March 18, 2013, 11:49:41 AM

Title: Allow us to use --force-cfr in x264
Post by: Khyinn on March 18, 2013, 11:49:41 AM
Hi,

Sorry if i'm wrong but i can't find that option in avidemux x264 settings.

It could be great if we can use --fps 24000/1001 (wich implies --force-cfr) like in other software like MeGUI.

I've tried two things :

- convert a 23.976 fps mp4 to 23.976 fps with avidemux (using resamplefps);
- convert the same video using MeGUI (--fps 24000/1001).

MeGUI produces a perfect constant framerate 23.976 fps video (wich i can use in aegisub 3.0.2 to sync subs).
Avidemus produces a variable framerate 23.977 fps (wich produces gap between rendering subs in aegisub 3.0.2 and vlc 2.0.5).

So the solution can be let us use --fps 24000/1001 for constant framerate.

Is this possible or am i totally wrong ?

Sorry for my bad english...
Title: Re: Allow us to use --force-cfr in x264
Post by: Khyinn on March 22, 2013, 07:56:06 AM
So... Anybody can make a patch for this ?
Title: Re: Allow us to use --force-cfr in x264
Post by: mean on March 22, 2013, 10:08:29 AM
The root problem might be not that
Title: Re: Allow us to use --force-cfr in x264
Post by: Khyinn on March 22, 2013, 01:28:45 PM
But i don't have this problem if i encode the video with x264 cli (with --fps 24000/1001) so that's why i ask this.

And i'm not alone asking this as this has already been asked before.

Is it really difficult to add a checkbox with this param in avidemux (checkbox for constant framerate and select list [24000/1001, 24, 25, 30000/1001] ?
Title: Re: Allow us to use --force-cfr in x264
Post by: mean on March 22, 2013, 01:35:28 PM
I'm not sure that would work
What output format are you using ? mkv ?
Title: Re: Allow us to use --force-cfr in x264
Post by: Khyinn on March 22, 2013, 01:41:46 PM
MP4 (v1 and v2 have been tested without success).

Tried with MKV : same result.
Title: Re: Allow us to use --force-cfr in x264
Post by: mean on March 22, 2013, 06:20:37 PM
did you try with 2.6.2
If not the link is in the windows subforum
Title: Re: Allow us to use --force-cfr in x264
Post by: Khyinn on March 23, 2013, 09:20:43 AM
I'm on Linux, i will try r8502 as soon as possible, i'll inform you when it will be done.
Title: Re: Allow us to use --force-cfr in x264
Post by: Khyinn on March 26, 2013, 09:28:26 AM
Hi,

Tried with 2.6.2 (r8513), same results... I can't understand why this happens but it's really a cfr problem i think.
Title: Re: Allow us to use --force-cfr in x264
Post by: Khyinn on March 27, 2013, 05:17:32 PM
Tried 2.6.3, with MKV, MP4, MP4v2 => Same result... Output is 23.971564 when selecting 23.976 (resampleFPS(23.976)).
Title: Re: Allow us to use --force-cfr in x264
Post by: mean on March 27, 2013, 07:45:29 PM
ok, it might be a rounding issue
Title: Re: Allow us to use --force-cfr in x264
Post by: Khyinn on March 28, 2013, 07:32:50 PM
So, will you fix this ?

I think it can be usefull to add --force-cfr (or --fps) parameter to x264 in avidemux config, avoiding the use of the ResampleFPS() filter but if you can correct this little bug, i will already be happy to use avidemux again.

Actually, i'm using this script instead of avsproxy + avidemux (i'm on linux) :

#!/bin/sh
#
# Usage:
#
# ./encodage.sh [input] [bitrate]
#
# input:   input .avs script without extension
# bitrate: bitrate
echo "Encoding Audio"
WINEDEBUG=-all wine avs2pipe audio "$1.avs" | WINEDEBUG=-all wine neroAacEnc -lc -cbr 160000 -if - -of "$1.m4a"
echo "Encoding Video - Pass 1"
fil="$1.avs"
info="$(WINEDEBUG=-all wine avs2pipe info "$fil")"
frames="$(echo -n "$info" | sed -ne 's/^v:frames\(.*\)$/\1/p' | sed 's|[\r ]||g')"
WINEDEBUG=-all wine avs2pipe video "$1.avs" | x264 - --output /dev/null --stdin y4m --frames "$frames" --level 4.1 --tune animation --pass 1 --bitrate $2 --stats "$1.stats" --b-adapt 2 --rc-lookahead 50 --me umh --subme 9 --fps 24000/1001
echo "Encoding Video - Pass 2"
WINEDEBUG=-all wine avs2pipe video "$1.avs" | x264 - --output "$1.h264" --stdin y4m --frames "$frames" --level 4.1 --tune animation --pass 2 --bitrate $2 --stats "$1.stats" --b-adapt 2 --rc-lookahead 50 --me umh --subme 9 --fps 24000/1001
echo "Muxing Video and Audio"
MP4Box -fps 23.976 -hint -add "$1.h264" -add "$1.m4a" -new "$1-muxed.mp4"
echo "Encode ended"


This works great but if i can use avidemux again... ;)
Title: Re: Allow us to use --force-cfr in x264
Post by: mean on March 29, 2013, 06:41:02 PM
x264 is properly setup
It is a rounding issue that propagates
So instead of avidemux 10 10 10 10 10
you have 10 10 9 10 11 10 10
hence the slightly variable framerate
Title: Re: Allow us to use --force-cfr in x264
Post by: mean on March 30, 2013, 07:47:44 AM
After checking deeper
Avidemux setup fps as 24000/1001 => 23.976 fps
but at least for mkv & mp4 it gets overwritten to 24000/1000 => 24 fps
and the variable framerate
Fixing it....
Title: Re: Allow us to use --force-cfr in x264
Post by: Khyinn on March 30, 2013, 02:59:37 PM
OK :)

Glad to see that this will be fixed soon (tm).
Title: Re: Allow us to use --force-cfr in x264
Post by: mean on March 30, 2013, 05:20:52 PM
For mp4 (not mp4v2) it should be ok in the nightly
Checking for mkv & mp4v2

Nightly should be available in 30 mn
Title: Re: Allow us to use --force-cfr in x264
Post by: bo122081 on June 02, 2013, 01:28:39 AM
I, am trying to convert a variable frame rate file to a cfr file, also using Resample FPS, but it's not working, the output file is staying Variable frame rate (checking in mediainfo), is this the same problem, or am I doing something wrong?
Title: Re: Allow us to use --force-cfr in x264
Post by: mean on June 03, 2013, 12:00:28 PM
you need a svn version of avidemux
http://www.avidemux.org/nightly/win32