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.

Domains: forum.doom9.org / forum.doom9.net / forum.doom9.se

 

Go Back   Doom9's Forum > Video Encoding > MPEG-4 AVC / H.264

Reply
 
Thread Tools Search this Thread Display Modes
Old 14th January 2010, 08:24   #81  |  Link
buzzqw
HDConvertToX author
 
Join Date: Nov 2003
Location: Cesena,Italy
Posts: 6,552
Quote:
It really goes beyond my comprehension why an author of multiple x264 GUI's [buzzqw] would have requested such useless option...
because personally i don't use gui, only command line and notepad

BHH
__________________
HDConvertToX: your tool for BD backup
MultiX264: The quick gui for x264
AutoMen: The Mencoder GUI
AutoWebM: supporting WebM/VP8
buzzqw is offline   Reply With Quote
Old 14th January 2010, 10:30   #82  |  Link
roozhou
Registered User
 
Join Date: Apr 2008
Posts: 1,181
Can someone provide a compilation guide on lavf and ffms for x264?
roozhou is offline   Reply With Quote
Old 14th January 2010, 13:11   #83  |  Link
kypec
User of free A/V tools
 
kypec's Avatar
 
Join Date: Jul 2006
Location: SK
Posts: 826
Quote:
Originally Posted by buzzqw View Post
because personally i don't use gui, only command line and notepad
BHH
<IRONICMOOD>Well, in that case I encourage you to try another amazing tool which could help you a lot -> calculator.</IRONICMOOD>
kypec is offline   Reply With Quote
Old 14th January 2010, 13:40   #84  |  Link
ACoolie
Registered User
 
Join Date: Mar 2008
Posts: 30
I'm sure size/duration works for the general case, but if you've ever looked at the code for the MeGUI bitrate calculator (which, in my experience has been somewhat more accurate than my own calculations), its not that simple. I'm not sure if it got into this patch, but someone suggested output.write_frame return the amount of new data written (or the written size of the frame?), which would make a --size option most accurate to implement, although I probably wouldn't want it committed.
Anyways, congrats on getting this done
ACoolie is offline   Reply With Quote
Old 14th January 2010, 13:41   #85  |  Link
elguaxo
Registered User
 
elguaxo's Avatar
 
Join Date: Jun 2006
Posts: 260
Quote:
Originally Posted by roozhou View Post
can someone provide a compilation guide on lavf and ffms for x264?
+1
elguaxo is offline   Reply With Quote
Old 14th January 2010, 14:12   #86  |  Link
VFR maniac
Spinner of yarns
 
VFR maniac's Avatar
 
Join Date: May 2009
Posts: 164
MSYS/MinGW32 (for static build)

pthreads-win32 (2.9.0.0 autostatic)
Patch this.
Code:
make clean GC-autostatic
cp libpthreadGC2.a /usr/local/lib
cp pthread.h sched.h semaphore.h /usr/local/include

ffmpeg (rev21392) and libswscale (rev30392)
Note: If you didn't build pthreads-win32 as autostatic, remove --enable-pthreads. If you built it as autostatic, patch this.
Code:
./configure --enable-pthreads --enable-gpl --enable-postproc --enable-memalign-hack --enable-runtime-cpudetect --disable-devices --disable-filters --disable-encoders --disable-muxers --disable-network --disable-decoder=aac,ac3,adpcm_*,alac,als,ape,atrac?,cook,dca,dsicinaudio,dxa,eac3,flac,interplay_dpcm,mlp,mp1,mp2,mp3,mp3*,mpc?,pcm_*,qcelp,ra_*,sipr,truehd,truespeech,tta,vorbis,wavpack,wma*,twinvq --disable-demuxer=aac,ac3,pcm_*,ape,amr,ass,au,avs,dts,eac3,flac,mp3,mpc,mpc8,truehd,tta,w64,wav,wv --disable-parser=aac,ac3,dca,mlp,mpegaudio --prefix=/usr/local --extra-cflags="-I/usr/local/include" --extra-ldflags="-L/usr/local/lib"
make
make install

ffms2 (rev262)
Requirments: zlib, bzip2, cmake <--- install them in /usr/local
Patch this.
Code:
cmake -G "MSYS Makefiles"
make
cp include/ffms.h /usr/local/include
cp libFFMS2.a /usr/local/lib

x264
Code:
./configure --extra-cflags="-I/usr/local/include" --extra-ldflags="-L/usr/local/lib"
make
__________________
僕と契約して、L-SMASH developerになってよ!
L-SMASH | L-SMASH Works | Opus-in-ISOBMFF specification and reference software

Last edited by VFR maniac; 24th January 2010 at 06:44.
VFR maniac is offline   Reply With Quote
Old 14th January 2010, 17:21   #87  |  Link
LoRd_MuldeR
Software Developer
 
LoRd_MuldeR's Avatar
 
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,275
Quote:
Originally Posted by roozhou View Post
--size should work in 2nd pass.
You need to specify a target bitrate also for the first pass if a 2-Pass encode, so you'd need to know the total number of frames before the first pass.
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊
LoRd_MuldeR is offline   Reply With Quote
Old 14th January 2010, 17:26   #88  |  Link
Selur
.
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 7,853
Since 'LAVF/FFMS input support, native VFR timestamp handling' made it into the git repository I wanted to ask:
Does this feature provide any benefit over piping to x264 with ffmpeg/mencoder? (aside from the point of not needing an external decoder to pipe to x264)
__________________
Hybrid here in the forum, homepage, its own forum
Selur is offline   Reply With Quote
Old 14th January 2010, 17:26   #89  |  Link
Dark Shikari
x264 developer
 
Dark Shikari's Avatar
 
Join Date: Sep 2005
Posts: 8,666
Quote:
Originally Posted by Selur View Post
Since 'LAVF/FFMS input support, native VFR timestamp handling' made it into the git repository I wanted to ask:
Does this feature provide any benefit over piping to x264 with ffmpeg/mencoder? (aside from the point of not needing an external decoder to pipe to x264)
Piping loses timestamps.
Dark Shikari is offline   Reply With Quote
Old 14th January 2010, 18:21   #90  |  Link
Selur
.
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 7,853
yes, but does x264 profit from the timestamps? iirc (not too sure) decoding a vfr source with ffmpeg/mencoder should result in a cfr output with duplicated frames and since the frames should be exact duplicates it shouldn't harm compression so it seems like it might be the question is x264 can detect duplicate frames and 'create vfr output' (not code duplicates and adjust the timestamps accordingly).

Cu Selur
__________________
Hybrid here in the forum, homepage, its own forum
Selur is offline   Reply With Quote
Old 14th January 2010, 18:22   #91  |  Link
Dark Shikari
x264 developer
 
Dark Shikari's Avatar
 
Join Date: Sep 2005
Posts: 8,666
Quote:
Originally Posted by Selur View Post
yes, but does x264 profit from the timestamps? iirc (not too sure) decoding a vfr source with ffmpeg/mencoder should result in a cfr output with duplicated frames and since the frames should be exact duplicates it shouldn't harm compression so it seems like it might be the question is x264 can detect duplicate frames and 'create vfr output' (not code duplicates and adjust the timestamps accordingly).

Cu Selur
ffmpeg does not duplicate frames unless you use -r to tell it to.
Dark Shikari is offline   Reply With Quote
Old 14th January 2010, 18:25   #92  |  Link
Selur
.
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 7,853
Assuming I use -r FRAMERATE for the output (which I normally do when piping to x264), will it make a difference for the output if x264 is fed via ffmpeg&pipe or directly with the file?
__________________
Hybrid here in the forum, homepage, its own forum
Selur is offline   Reply With Quote
Old 14th January 2010, 18:31   #93  |  Link
Dark Shikari
x264 developer
 
Dark Shikari's Avatar
 
Join Date: Sep 2005
Posts: 8,666
Quote:
Originally Posted by Selur View Post
Assuming I use -r FRAMERATE for the output (which I normally do when piping to x264), will it make a difference for the output if x264 is fed via ffmpeg&pipe or directly with the file?
No. Using -r forces CFR by duplicating or dropping frames.

Do note that using --fps in x264 does not force CFR at the moment when dealing with VFR input: we will change that in a future patch.

Also note that x264 WILL NEVER DROP FRAMES currently: it has no internal sync system, so you can't convert VFR->CFR. "Forcing CFR" just changes the timestamps on existing frames, potentially losing sync.
Dark Shikari is offline   Reply With Quote
Old 14th January 2010, 18:32   #94  |  Link
Selur
.
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 7,853
Thanks for clearing that up.
__________________
Hybrid here in the forum, homepage, its own forum
Selur is offline   Reply With Quote
Old 14th January 2010, 18:46   #95  |  Link
roozhou
Registered User
 
Join Date: Apr 2008
Posts: 1,181
Hi DS,
Code:
-        pic.i_pts = (int64_t)i_frame * param->i_fps_den;
+        if( !param->b_vfr_input )
+            pic.i_pts = i_frame;
Why? MP4, flv and mkv muxer can assume all streams vfr (timestamp based) and easily handle them. But now they have to treat cfr and vfr differently.
roozhou is offline   Reply With Quote
Old 14th January 2010, 18:54   #96  |  Link
Dark Shikari
x264 developer
 
Dark Shikari's Avatar
 
Join Date: Sep 2005
Posts: 8,666
Quote:
Originally Posted by roozhou View Post
Hi DS,
Code:
-        pic.i_pts = (int64_t)i_frame * param->i_fps_den;
+        if( !param->b_vfr_input )
+            pic.i_pts = i_frame;
Why? MP4, flv and mkv muxer can assume all streams vfr (timestamp based) and easily handle them. But now they have to treat cfr and vfr differently.
Huh? That code you quoted is synthesizing timestamps for the muxers, AFAIK.
Dark Shikari is offline   Reply With Quote
Old 14th January 2010, 22:50   #97  |  Link
kemuri-_9
Compiling Encoder
 
kemuri-_9's Avatar
 
Join Date: Jan 2007
Posts: 1,348
Quote:
Originally Posted by Dark Shikari View Post
Huh? That code you quoted is synthesizing timestamps for the muxers, AFAIK.
yes, that synthesizes timestamps for CFR input (which is exactly how it reads :P)
__________________
custom x264 builds & patches | F@H | My Specs
kemuri-_9 is offline   Reply With Quote
Old 15th January 2010, 03:22   #98  |  Link
roozhou
Registered User
 
Join Date: Apr 2008
Posts: 1,181
Really confused on this. What is the real PTS for each frame (in seconds)?

A) i_pts * i_fps_den / i_fps_num
B) i_pts * i_timebase_num / i_timebase_den
roozhou is offline   Reply With Quote
Old 15th January 2010, 03:25   #99  |  Link
Dark Shikari
x264 developer
 
Dark Shikari's Avatar
 
Join Date: Sep 2005
Posts: 8,666
Quote:
Originally Posted by roozhou View Post
Really confused on this. What is the real PTS for each frame (in seconds)?

A) i_pts * i_fps_den / i_fps_num
B) i_pts * i_timebase_num / i_timebase_den
The timebase is fps_den / fps_num.

This means that if the pts of frames are:

0, 1, 2, 3, 4, 5...

And the fps is:

24000/1001

The frames' times, in seconds, are:

0/24000, 1001/24000, 2002/24000, 3003/24000, 4004/24000, 5005/24000...
Dark Shikari is offline   Reply With Quote
Old 15th January 2010, 03:37   #100  |  Link
roozhou
Registered User
 
Join Date: Apr 2008
Posts: 1,181
Quote:
Originally Posted by Dark Shikari View Post
The timebase is fps_den / fps_num.

This means that if the pts of frames are:

0, 1, 2, 3, 4, 5...

And the fps is:

24000/1001

The frames' times, in seconds, are:

0/24000, 1001/24000, 2002/24000, 3003/24000, 4004/24000, 5005/24000...
CFR input module should let i_timebase_num = i_fps_num and i_timebase_den = i_fps_den, and leave i_pts unchanged

VFR input module should let i_timebase_num = 1 and i_timebase_den = i_fps_den, and let each i_pts = real_timestamp * i_timebase_den

Right?
roozhou is offline   Reply With Quote
Reply

Tags
beta, ffmpegsource, libavformat, test, x264

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 07:55.


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