VideoHelp Forum




+ Reply to Thread
Results 1 to 20 of 20
  1. Member
    Join Date
    Mar 2013
    Location
    Austria
    Search Comp PM
    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
    Quote Quote  
  2. Problem is due to the B-frame lag in avi, which is required to handle b-frames.
    -> try another source filter e.g. ffmpegsource2
    Quote Quote  
  3. Member
    Join Date
    Mar 2013
    Location
    Austria
    Search Comp PM
    Originally Posted by Selur View Post
    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.
    Quote Quote  
  4. 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
    Quote Quote  
  5. Member
    Join Date
    Mar 2013
    Location
    Austria
    Search Comp PM
    Originally Posted by Selur View Post
    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
    Quote Quote  
  6. Member
    Join Date
    Mar 2013
    Location
    Austria
    Search Comp PM
    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.

    walfri
    Last edited by walfri; 31st Mar 2013 at 07:24. Reason: Correction
    Quote Quote  
  7. Originally Posted by walfri View Post
    At last:
    If I downloaded a testfile from http://download.wavetlan.com/SVV/Med...P/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.
    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
    Quote Quote  
  8. Member
    Join Date
    Mar 2013
    Location
    Austria
    Search Comp PM
    Originally Posted by poisondeathray View Post
    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 had downloaded 'H.264 Content - File9'

    walfri
    Quote Quote  
  9. Originally Posted by walfri View Post
    Originally Posted by poisondeathray View Post
    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 had downloaded 'H.264 Content - File9'

    walfri


    This isn't AVI, nor is it XviD or DivX file....

    Do you have a sample so others can check and try to reproduce your problem ?
    Quote Quote  
  10. Here is an XviD AVI test file 480x360, 23.976 fps, 0 to 479 = 480 frames. Frames are numbered so you can see if problem occurs

    1) Do you have problems with the preview (e.g. in vdub, avspmod), and what is your script ?

    2) Do you have problems encoding this to AVC ?
    Image Attached Files
    • File Type: avi 1.avi (1.93 MB, 81 views)
    Quote Quote  
  11. 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.
    Quote Quote  
  12. Member
    Join Date
    Mar 2013
    Location
    Austria
    Search Comp PM
    Many, many thanks for your work !

    Originally Posted by poisondeathray View Post
    1) Do you have problems with the preview (e.g. in vdub, avspmod), and what is your script ?
    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].

    Originally Posted by poisondeathray View Post
    2) Do you have problems encoding this to AVC ?
    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.
    Image Attached Files
    Quote Quote  
  13. 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
    In vdub, with "1.avi" opened directly in vdub , file=>file information , does it say you are using ffdshow ?

    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
    Are you sure about that ^^ before encoding ?




    Here is "x264.mp4" encoded with AVISource (xvid VFw decoder), and x264 cli , there is no problem
    Image Attached Files
    Last edited by poisondeathray; 31st Mar 2013 at 11:31.
    Quote Quote  
  14. Member
    Join Date
    Mar 2013
    Location
    Austria
    Search Comp PM
    Originally Posted by poisondeathray View Post
    In vdub, with "1.avi" opened directly in vdub , file=>file information , does it say you are using ffdshow ?
    file=>file information-->Decompressor: 'ffdshow Video Codex (XVID)'

    Originally Posted by poisondeathray View Post
    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)
    I will test with graphstudio in next time.


    Originally Posted by poisondeathray View Post
    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.
    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.

    Originally Posted by poisondeathray View Post
    Here is "x264.mp4" encoded with AVISource (xvid VFw decoder), and x264 cli , there is no problem
    I view this file:
    with MPC-HC: the last frame ist 0476 !?
    with avisynth FFVideoSource(...) --> vdub: all Ok. Decompressor: 'Internal DIB decoder (YV12)'

    Originally Posted by poisondeathray View Post
    I think you have playback filter , decoder or splitter problems
    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

    walfri
    Last edited by walfri; 31st Mar 2013 at 12:22. Reason: correction
    Quote Quote  
  15. 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
    Quote Quote  
  16. Member
    Join Date
    Mar 2013
    Location
    Austria
    Search Comp PM
    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
    Quote Quote  
  17. 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
    Quote Quote  
  18. Member
    Join Date
    Mar 2013
    Location
    Austria
    Search Comp PM
    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.
    Quote Quote  
  19. 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.
    Quote Quote  
  20. Member
    Join Date
    Mar 2013
    Location
    Austria
    Search Comp PM
    Originally Posted by hello_hello View Post
    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.
    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.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!