Please excuses my mode of expression, but my English is not the best.
I use for adaptation of films Virtaldub with avisynth. For the compression I use DivX (tests also with Xvid).
If I convert a DivX film into H.264/MPEG-4 AVC, I always lose the two last frames. Then at the beginning of the film there are 2 undefined frames. Therefore I must always delay the audio around these 2 frames.
I have tested different Encoder (x264, x264VFW) and programmes, always the same problem.
What I make wrong or what must I use to solve this problem.
regards
walfri
+ Reply to Thread
Results 1 to 20 of 20
-
-
Problem is due to the B-frame lag in avi, which is required to handle b-frames.
-> try another source filter e.g. ffmpegsource2 -
Many Thanks for your info.
I downloaded FFmpegSource2 v2.17 cplugin.
I used 1st:
source = "F:\test.avi"
FFmpegSource2(source)
Always 2 lost frames
2nd I used:
source = "F:\test.avi"
FFIndex(source)
FFVideoSource(source=source, track=-1, cache=true, cachefile=source+".ffindex", seekmode=1, rffmode=0, width=-1, height=-1)
Always 2 lost frames
I started the conversion with the following batch file (x264.nl):
F:\x264_x86_2230.exe --tune film --preset medium --level 4 --pass 1 --bitrate 2100 --stats "x264stat" --output NUL --b-pyramid strict --keyint 25 --min-keyint 2 --vbv-maxrate 15000 --vbv-bufsize 15000 --aud --nal-hrd vbr "x264z.avs"
F:\x264_x86_2230.exe --tune film --preset medium --level 4 --pass 2 --bitrate 2100 --stats "x264stat" --output "E:\Tst7.mp4" --sar 1:1 --b-pyramid strict --keyint 25 --min-keyint 2 --vbv-maxrate 15000 --vbv-bufsize 15000 --aud --nal-hrd vbr "x264z.avs"
FFmpegSource2 does not seem to be the solution. -
Try the following:
1. open the avi with MPEG4 Modifier
2. enable Packed Bitstream ->Pack
3. save it under a new name
4. try the conversion with the new file
Cu Selur -
Many thanks for the fast info.
I used MPEG4 Modifier and converted the avi-file (new file size = 55%).
Then I converted the file with 6 variants (incl. FFmpegSource2) to an AVC file .
Unfortunately, the last two frames are still absent (I checked this with MPC-HC).
regards
walfri -
I think myself the following expiry for the production of a file MPEG4:
1.
Source filte for AVI files (DivX, Xvid, ...)
2.
Encoder for MPEG4 files
3.
Source filter for view the MPEG4 file
Considerations to the expiry:
1.
Source filter for avi must be ok. All views and converts (not to MPEG4) are correct. Also the avi file should be correct.
2.
I tested several MPEG4 encoder. x264, x264VFW, converted file with VLCplayer, several Programms (DVDFab, AnyVideo, etc.). I cannot check directly the encoder.
3.
For view the MPEG4 file I used MPC-HC, VLCPlayer, Windows Media Player, Vitualdub plugin source filter, Vitualdub and Xvid-h264, ffdshow and of course Haali Media Splitter. Here could be also the problem. But why do show all the same result with the two lost frames and the undefined 2 frames at the start ?
At last:
If I downloaded a testfile from http://download.wavetlan.com/SVV/Media/HTTP/http-mp4.htm .
And I have the same bad result.
I do not know whether are absent the two last frames, but the two undefined frames at the beginning exist.
walfriLast edited by walfri; 31st Mar 2013 at 07:24. Reason: Correction
-
Which test file did you download from
http://download.wavetlan.com/SVV/Media/HTTP/http-mp4.htm
This result doesn't seem to happen to other people -
-
-
I wonder if it's a player issue rather than an encoding issue? Well it seems to be for me. I opened the AVI poisondeathray uploaded for encoding with this script:
LoadPlugin("C:\Program Files\MeGUI\tools\ffms\ffms2.dll")
FFVideoSource("E:\1.avi", cachefile="D:\1.avi.ffindex", threads=1)
When I opened the encoded file with MPC-HC the first frames were definitely there but the last three didn't show up. VLC seemed to be the same.
I opened the encoded file using basically the same script as above though, and I could see the last three frames in the preview so they were there, just not being shown on playback. As an experiment I disabled MPC-HC's internal h264 decoder and used DirectShow instead. Now I could see the last three frames in the encoded file. A little further experimenting seems to indicate it's the video card's fault... or drivers, or something odd about DXVA in general. With DXVA decoding disabled, I could play the encoded video with MPC-HC's internal decoder and still see the last three frames.
I even tried adding audio to the encoded video and while it was longer in duration than the video, MPC-HC would stop on frame 476 if DXVA decoding was enabled, even though it'd keep right on playing the audio.
In my case though, no matter what I did, I could always see frame 000 in the encoded file. I tried using VirtualDub rather than MeGUI and never had a problem with the first or last frames being dropped, or extra frames being added to the beginning, but I don't have the vfv version of x264 installed so I was just converting to RGB.
I'd be opening the encoded file with ffmsindex to see if the missing frames are actually missing or whether it's a playback problem. If the beginning frames are still not correct, then maybe try using the same script with the CLI version of x264.Last edited by hello_hello; 31st Mar 2013 at 11:15.
-
Many, many thanks for your work !
Yes, I have problems.
Check with vdub:
1. ffdshow: --> problem
open, the 1st frame = green
frame 0 to 4 = 0003,0000,0001,0002,0003
and the last frame = 0478
2. avisynth AviSource(...): --> problem
same problems as 1.
3. avisynth FFmegSource2(...): --> Ok
frame 0 to 4 = 0000,0001,0002,0003,0004
and the last frame = 0479
- I have installed ffdshow v1.1.4096 [2011-11-29].
I converted your XVID-File to MPEG4 with 'avisynth FFmegSource2':
Script:
LoadCplugin("C:\Program Files (x86)\AviSynth 2.5\plugins\ffms2.dll")
source = "F:\1.avi"
FFmpegSource2(source)
The result is negative. -
I think you have playback filter , decoder or splitter problems
1. ffdshow: --> problem
open, the 1st frame = green
frame 0 to 4 = 0003,0000,0001,0002,0003
and the last frame = 0478
With xvid, I can see all frames, no problems in "1.avi" . This is VFW subsystem in vdub, not DirectShow
To test directshow, you can use graphstudio (file=>render media file) push play. All frames are there "1.avi" , but "1_h264.mp4" has a green frame at the beginning, is missing last frame (probably misordered green frame)
Which filters are you using for directshow according to graphstudio ? (what does filter graph look like)
BUT I think there is a problem with "1_h264.mp4" . Did you try threads=1 for FFVIdeoSource()? Are you sure the preview was correct before ENcoding ? I suspect you had a green frame at the beginning.
3. avisynth FFmegSource2(...): --> Ok
frame 0 to 4 = 0000,0001,0002,0003,0004
and the last frame = 0479
Here is "x264.mp4" encoded with AVISource (xvid VFw decoder), and x264 cli , there is no problemLast edited by poisondeathray; 31st Mar 2013 at 11:31.
-
file=>file information-->Decompressor: 'ffdshow Video Codex (XVID)'
I will test with graphstudio in next time.
Script:
LoadCplugin("C:\Program Files (x86)\AviSynth 2.5\plugins\ffms2.dll")
source = "F:\1.avi"
#FFIndex(source)
FFVideoSource(source=source, track=-1, threads=1, cache=true, cachefile=source+".ffindex", seekmode=1, rffmode=0, width=-1, height=-1)
#FFmpegSource2(source)
open with green frame, next frames = 0000,0001,0002,0003,... the last frame is 0478.
I view this file:
with MPC-HC: the last frame ist 0476 !?
with avisynth FFVideoSource(...) --> vdub: all Ok. Decompressor: 'Internal DIB decoder (YV12)'
Yes, it must be this.
I have Installed actuell in Windows 7 x64:
ffdshow v1.1.4096 [2011-11-29]
x264vfw - H.264/MPEG-4 AVC codex (installed by XVID v1.32)
DivX 6.8.2
Haali Media Splitter
MPC-HC and VCL are portable
walfriLast edited by walfri; 31st Mar 2013 at 12:22. Reason: correction
-
To summarize, you have 2 problems
1) something is wrong with your decoding "1.avi" . FFVideoSource should give proper decode but doesn't in your case. Because you have 1 green frame ...478 , the encode is like that too . Have to look at this farther. Try using vanilla ffms2.dll build , instead of Cplugin
2) something in your directshow playback configuration is causing you to drop frames . See hello_hello's post above.
MPCHC, haali splitter, ffdshow, DXVA OFF (ie software decoding only) sees all 0-479, no green frames on "x264.mp4"
Use graphstudio to diagnose your directshow filter chain. You also have to configure MPCHC internal options if you are using MPCHC as a player -
I have already carried out some changes. Afterwards I have tested once again and everything is Ok - fantastically.
poisondeathray, what can I do for you? Unfortunately, I can say (write) to you only many, many thanks for your work.
Also many thanks to Selur and hello_hello !
Best regards
walfri -
Can you summarize what was the problem with your configuration (or what caused the problem - was it ffms2.dl cplugin, and mpchc configuration) ? So other people having similar problems can have help
-
Summary of my problem:
The primary problem for the lost Frames (see post #1) was the source filter. My ffdshow version worked not correct with some video files (deinstalled).
Then the second problem was the correct call of FFVideoSource() by script. I needed the value threads=1.
I have downloaded the ffms2.dll into the tip of Selur. Then readed very fast the attached doc and written in a script. Unfortunately, too fast. Now topically I use the vanilla version.
With the player- and DXVA-problems I will occupy tomorrow.
walfri
PS:
Still I had a third problem, my English. Reading is not a problems, but huge problems with the writing and speech. -
I didn't try decoding poisondeathray's avi with ffdshow/DirectShow/AVISynth so I don't know if it'd give me the same problem with the first frame being green, but several times I've had a random frame from somewhere in the video being added as the first frame when decoding via DirectShow/ffdshow, and of course it throws the frame count out by one, and probably causes the last frame to be dropped as a result.
Anyone know what causes VirtualDub to open video with a green frame at times? I've seen it often enough but I've never known why. I don't think it's ever been included when encoding so I've just ignored it, but I've seen it quite a bit when opening h264 video via DirectShow with VirtualDub. I'm not sure I've seen the green frame when using any other program though. -
There is still a second effect with green frame in Virtualdub.
If the green frame is not encoded hard, one cannot properly step a frame back and step a frame before at every place in the video.
It seems, as if the index of the frames can be determined not properly (B frames?).
Addition:
Still a third effect.
If you go to a frame somewhere in the video and then jump directly to the first frame (vdub = Go beginning) then the last used frame is indicated.Last edited by walfri; 1st Apr 2013 at 07:09.
Similar Threads
-
Slow playback @ MPEG4/AVC
By leandro in forum Video ConversionReplies: 2Last Post: 30th Jan 2013, 12:17 -
Convert AVI (AVC?) to DVD - or anyhting... using ffmpeg
By hornetster in forum Video ConversionReplies: 1Last Post: 13th Jan 2013, 04:41 -
RipBot can't process mpeg4 AVC Sources
By nikemouse in forum Blu-ray RippingReplies: 17Last Post: 25th Mar 2010, 17:21 -
mpeg4 AVC issues with RipBot
By nikemouse in forum Video ConversionReplies: 1Last Post: 17th Mar 2010, 03:57 -
PS3 MPEG4-AVC: Just what is it, what are the limitations, how can I create?
By Colmino in forum Newbie / General discussionsReplies: 5Last Post: 29th Jun 2008, 04:37