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. |
27th March 2008, 02:30 | #261 | Link |
Professional Code Monkey
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,555
|
WRITE TIMECODES TO A FILE. Fix it yourself using that. This was also very harshly answered earlier in the thread.
For the <edit mod: removed profanity> of you trying to compile ffmpeg source this is what you need and what will happen: A recent gcc compile like 4.2.3. Have fun compiling it yourself with mingw. A recent ffmpeg. Straightforward IF it compiles. Uneventfully compile zlib but forget --prefix=/mingw and confuse yourself. Make an empty dll project in vs2005 and add all files. Also add a list of obscure gcc include libraries to appease ffmpeg. Compile. You are now likely to be the proud owner of a miscompiled ffmpegsource. Order a pizza and watch tv instead.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet Last edited by Wilbert; 28th March 2008 at 18:58. |
27th March 2008, 03:09 | #262 | Link | |
Excessively jovial fellow
Join Date: Jun 2004
Location: rude
Posts: 1,100
|
Quote:
|
|
27th March 2008, 19:52 | #263 | Link |
Registered User
Join Date: Feb 2003
Posts: 14
|
@Myrsloik: Thanks for the loud and extremly confusing answer.
@TheFluff: Thx for the slightly more helpful one. After fixing a small problem running sh-scripts with exe-extension in msys (in ./configure) and adding a missing #define to rtsp.c, I was finally able (about 3 hours) to compile ffmpeg. The compiling of ffmpegsource (I tried this using precompiled ffmpeg libs, but this results in a very small ffmpegsource.dll (292 kBytes), which was obviously crap) was just (re-)linking. So, if someone is interessted in a VS2005 project (including ffmpegsource and zlib sources and the ffmpeg libs compiled by me), you may send me a PM. .oO(Now, lets see, what can I do to make the filter returning frames with cfr on vfr videos)° |
28th March 2008, 17:48 | #264 | Link |
Registered User
Join Date: Feb 2003
Posts: 14
|
Current source and a bug?
Is the source at https://spaceboyz.net/svn/aegisub/trunk/FFmpegSource the current version (1.16)?
The file ffmpegsource.html holds only changelog entries until 1.14... Also, in matroskacodecs.cpp lines 137++: Code:
case MAKEFOURCC('Z', 'L', 'I', 'B'): return CODEC_ID_FLV1; case MAKEFOURCC('F', 'L', 'V', '1'): return CODEC_ID_ZLIB; Code:
case MAKEFOURCC('Z', 'L', 'I', 'B'): return CODEC_ID_ZLIB; case MAKEFOURCC('F', 'L', 'V', '1'): return CODEC_ID_FLV1; |
28th March 2008, 22:16 | #265 | Link |
Professional Code Monkey
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,555
|
That's a really obscure bug. Why were you reading the whole codec list anyway?
Version 1.16 + that fix is now in the svn.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet |
29th March 2008, 12:07 | #266 | Link | |
Registered User
Join Date: Feb 2003
Posts: 14
|
Quote:
But another thing. I really don't understand the whole video decoding stuff completely yet, so don't be mad if I understood it wrong. In ffmpegsource.cpp & ffmatroskasource.cpp: Code:
// Flush the last frame if (CurrentFrame == VI.num_frames - 1 && VideoCodecContext->has_b_frames) Ret = avcodec_decode_video(VideoCodecContext, AFrame, &FrameFinished, NULL, 0); Code:
// Flush the last frames if (CurrentFrame <= VI.num_frames - 1 && VideoCodecContext->has_b_frames) Ret = avcodec_decode_video(VideoCodecContext, AFrame, &FrameFinished, NULL, 0); |
|
29th March 2008, 12:26 | #267 | Link | |
Excessively jovial fellow
Join Date: Jun 2004
Location: rude
Posts: 1,100
|
Quote:
|
|
29th March 2008, 13:05 | #268 | Link |
Professional Code Monkey
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,555
|
Due to b-frame reordering decodign will never lag more than one frame. Example:
Shown: IBPBPI Stored: IPBPBI Shown: IBBPBBPI Stored: IPBBPBBI Meaning that you will never have more than a one frame lag (indicated by has_b_frames). Thus there are no more frames to flush. As thefluff pointed out that part is also only triggered if all the other logic failed which is for the last frame with decoding lag OR for very unusual decoding errors and then only for the last frame. FFBase::SaveTimecodesToFile - The whole DTS relation is a bit special. That function only sorts them because mkvmerge expects it as input (historical note: old versions used unsorted). The reason ffmpegsource doesn't care about it being sorted or not is that the position of keyframes is independent of the reordering. As the only value extracted from it is "what frame number does this DTS correspond to?" and we know that seeking always goes to keyframes (minus bugs and that stuff). So the only thing the other DTS values in between are really used for are placeholders.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet |
29th March 2008, 13:06 | #269 | Link |
Registered User
Join Date: Feb 2003
Posts: 14
|
For videos with only one b-frame your right, but I found a video that seems to have 2 frames left to decode after reaching EOF.
Using this code... Code:
// Flush the last frames if (CurrentFrame <= VI.num_frames - 1 && VideoCodecContext->has_b_frames) Ret = avcodec_decode_video(VideoCodecContext, AFrame, &FrameFinished, NULL, 0); FILE* err=fopen("err.txt", "a"); if(err) { fprintf(err, "%d %d %d %d %d\r\n", CurrentFrame, VI.num_frames-1, Ret, FrameFinished, VideoCodecContext->has_b_frames); fclose(err); } Code:
90286 90287 0 200 2 90287 90287 0 200 2 |
29th March 2008, 13:37 | #270 | Link |
Professional Code Monkey
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,555
|
To debug these things it's usually much easier to encode a clip with similar settings and clearly number every frame. Does your clip by any chance have open GOPs?
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet |
29th March 2008, 13:55 | #271 | Link | |||
Registered User
Join Date: Feb 2003
Posts: 14
|
Maybe it has something to do with this:
(From the german wikipedia on h264) Quote:
Quote:
Quote:
|
|||
29th March 2008, 14:26 | #273 | Link |
Professional Code Monkey
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,555
|
Seeking in h264 should be limited to IDR frames which means the assumption is still true (I is just another letter in between). Find some place to upload the file to and I will look at it.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet |
29th March 2008, 21:39 | #275 | Link |
Registered User
Join Date: Jan 2002
Location: France
Posts: 2,856
|
The one-frame lag implied by bframes is valid for all codecs prior to H264. For h264, the possibility to create b-reference (and thus pyramidal b-gops) may create longer lags (one level of byramid is commonly used with x264 and creates a two frame lag)
__________________
|
30th March 2008, 16:42 | #276 | Link |
Professional Code Monkey
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,555
|
Bug fixed and put in the svn. As Manao hinted it only applied to h264 with pyramid stuff and would usually result in the last frame being dropped and the now second to last frame duplicated.
No new compile today though, ffmpeg svn is having one of those broken weeks it seems.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet |
31st March 2008, 17:50 | #278 | Link |
Professional Code Monkey
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,555
|
So I've read the AR from the stream, now what? Return it in a variable with a user specified name? Rescale the video and kill kittens?
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet |
4th April 2008, 16:30 | #280 | Link |
Professional Code Monkey
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,555
|
How aspect ratio reporting is done now:
FFSAR_NUM, FFSAR_DEN and FFSAR are set to the container values for mkv and the video decoder values for all other filetypes. The problem: Several mp4 files report a SAR of 0/1 which isn't right or very helpful. Should the cases with 0 be converted to 1/1 or left as it is?
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet |
Thread Tools | Search this Thread |
Display Modes | |
|
|