VideoHelp Forum




+ Reply to Thread
Page 1 of 2
1 2 LastLast
Results 1 to 30 of 39
  1. Member vhelp's Avatar
    Join Date
    Mar 2001
    Location
    New York
    Search Comp PM
    is there an updated version of rawsource() that i don't know about ?

    i used:

    RawSource("video.y4m", width=720, height=480, pixel_type="yv12")
    or
    RawSource("video.y4m", width=720, height=480, pixel_type="i420")

    but the picture comes out with wrong uv (swapuv does not it) and tares, for lack of proper term for this.

    Last edited by vhelp; 24th Sep 2013 at 22:50.
    Quote Quote  
  2. This worked:

    Code:
     RawSource("example.y4m", width=384, height=288, pixel_type="yv12")
    with the sample from this site: http://wiki.multimedia.cx/index.php?title=YUV4MPEG2

    Since that sample has the header data all it needs is:
    Code:
     RawSource("example.y4m")
    Oh, you may need to manually skip over the header bytes. Or trim them with a hex editor. I think that's the reason your luma channel is shifted and the chroma channels don't line up with the luma.

    Can you provide a sample?
    Last edited by jagabo; 23rd Sep 2013 at 21:09.
    Quote Quote  
  3. Member vhelp's Avatar
    Join Date
    Mar 2001
    Location
    New York
    Search Comp PM
    in the begining, i used .yuv to encode with x265. could also preview in avisynth/virtualdub. however, i went to .y4m so i wouldn't have to enter w/h/fps to the encoder. been using that for a while now, and videos encode properly. now i need to review some of the files quicky because i am naming them shorter, like video1.y4m, video2.y4m, ... well, that's how i work at this point.
    Quote Quote  
  4. Member vhelp's Avatar
    Join Date
    Mar 2001
    Location
    New York
    Search Comp PM
    i would post a sample, but over DSL, still to slow, and the smallest file i have is 61mb.
    Quote Quote  
  5. DECEASED
    Join Date
    Jun 2009
    Location
    Heaven
    Search Comp PM
    Another possibility --- that's just another symptom/indicator of how much vhelp's XP setup is screwed.
    Quote Quote  
  6. Member vhelp's Avatar
    Join Date
    Mar 2001
    Location
    New York
    Search Comp PM
    as long as i can watch tv and code on computer at same time, i'm happy
    Quote Quote  
  7. Originally Posted by vhelp View Post
    i would post a sample, but over DSL, still to slow, and the smallest file i have is 61mb.
    Just trim it down to a few frames worth.

    AviSynth and RawSource() work just fine on XP.
    Quote Quote  
  8. Member vhelp's Avatar
    Join Date
    Mar 2001
    Location
    New York
    Search Comp PM
    just rethinking about it some more.. there are two ways to convert videos to .y4m using avs2yuv and ffmpeg. i'm pretty sure i used ffmpeg in all these videos.

    edit: correction made: avs2yuv
    Quote Quote  
  9. Member vhelp's Avatar
    Join Date
    Mar 2001
    Location
    New York
    Search Comp PM
    what do you recommend to trim ? i never trimed yuv sources before.
    Quote Quote  
  10. Member vhelp's Avatar
    Join Date
    Mar 2001
    Location
    New York
    Search Comp PM
    let me try avs2yuv and see what happens.
    Quote Quote  
  11. Originally Posted by vhelp View Post
    what do you recommend to trim ? i never trimed yuv sources before.
    Someone mentions a file cutter here every now and then. I use a hex editor. An old version of this:
    http://www.hhdsoftware.com/free-hex-editor
    Image Attached Files
    Quote Quote  
  12. Member vhelp's Avatar
    Join Date
    Mar 2001
    Location
    New York
    Search Comp PM
    solved... short answer, change the param in ffmpeg..read on, for details..

    these are the methods i've used to convert avs videos to .y4m for x265 encoding:

    ffmpeg -i video.avs -an -pix_fmt yuv420p -f yuv4mpegpipe -y video3.y4m

    avs2yuv c:\dgavc.avs g:\video3.y4m

    both above methods cause the same problem in original post.

    however, when i change to this (just learned this via help)

    avs2yuv c:\dgavc.avs -raw g:\video3.y4m

    then the video decodes correctly in virtualdub, using the same script:

    x = "g:\video3.y4m"
    LoadPlugin("c:\plugins\rawsource.dll")
    RawSource(x, width=720, height=480, pixel_type="yv12")

    there's no -raw param in ffmpeg, perhaps someone knows equiv.

    edit: i found the solution to the ffmpeg conversion to .y4m and correct playback via avisynth/virtualdub:
    (replace -f yuv4mpegpipe to rawvideo)

    ffmpeg -i video.avs -an -pix_fmt yuv420p -f rawvideo -y video3.y4m

    result: plays successfully in virtualdub using the above avs script.
    Last edited by vhelp; 23rd Sep 2013 at 21:52.
    Quote Quote  
  13. DECEASED
    Join Date
    Jun 2009
    Location
    Heaven
    Search Comp PM
    For the record: on my XP machine, RawSource() on a y4m file doesn't require the workarounds you used.
    Specifying the parameters width, height and pixel type makes no difference, since the plugin can read this whole info from the Y4M headers.
    When you tell avs2yuv or ffmpeg to generate a raw output, then the resulting file has no headers, regardless of the y4m file extension.

    So it seems that the "fishy factor" is not letting your copy of Rawsource.dll work as it should.
    Quote Quote  
  14. Originally Posted by vhelp View Post

    ffmpeg -i video.avs -an -pix_fmt yuv420p -f yuv4mpegpipe -y video3.y4m (doesn't work)
    ffmpeg -i video.avs -an -pix_fmt yuv420p -f rawvideo -y video3.y4m (works)
    So the difference is the first command produces a raw YV12 video file with a Y4M header, the second command produces simply a raw video file. You can clearly see the Y4M header in a hex editor:

    Click image for larger version

Name:	y4m.png
Views:	1587
Size:	18.3 KB
ID:	20153

    The first four lines is the Y4M header. The rawvideo command doesn't include them. Also each frame in the try Y4M video has "FRAME(0x0a)" at the start of each frame:

    Click image for larger version

Name:	frame.png
Views:	1482
Size:	19.5 KB
ID:	20154

    In short, the first command produces a true Y4M file, the second command produces a raw video file. And RawSource() doesn't understand the Y4M header that ffmpeg produced. ffmpeg's header includes more information than the Y4M sample I was working with:

    Click image for larger version

Name:	other.png
Views:	1086
Size:	6.9 KB
ID:	20155
    Last edited by jagabo; 24th Sep 2013 at 06:36.
    Quote Quote  
  15. Member vhelp's Avatar
    Join Date
    Mar 2001
    Location
    New York
    Search Comp PM
    @ jagabo, i d/l'ed the hex editor, but it didn't have a cutter or trim? that you mentioned.

    so, of course, you guys are correct. the method i used defeats the .y4m purpose.

    ok. so today i learned that the .y4m file would not encode in x265 because it was missing the header info (res, fps, etc) and stop the encode.

    it turns out that i need to resolve the original problem. so, getting back to the original problem. i thought that it might be a decoder problem, somehow. so i am wondering how is avisynth decoding internally or is it calling a decoder to process the .y4m data. maybe if calling a decoder, i can change it somehow.
    Quote Quote  
  16. AviSynth is calling rawsource.dll to do the decoding. Unfortunately, rawsource.dll can't handle the longer headers that ffmpeg creates in Y4M files. I looked at the source code and it appears that the first "FRAME" must be within the first 64 bytes of the file. It should be easy to change that but I don't know if I have the tools to build it. I'll take a closer look tomorrow.
    Quote Quote  
  17. Member vhelp's Avatar
    Join Date
    Mar 2001
    Location
    New York
    Search Comp PM
    great. or else.. is there anything i can do to the .y4m files. oh, but avs2yuv also has the same probem. did you check that one too ?

    and, by first "frame", do you mean, just that frame, or all frames ?

    ps: i wonder how/why this got overlooked on doom9 as a posible fix being that it is still being maintained.

    http://forum.doom9.org/showthread.php?t=39798&page=8
    Last edited by vhelp; 24th Sep 2013 at 22:48.
    Quote Quote  
  18. DECEASED
    Join Date
    Jun 2009
    Location
    Heaven
    Search Comp PM
    Originally Posted by vhelp View Post
    great. or else.. is there anything i can do to the .y4m files. oh, but avs2yuv also has the same probem. did you check that one too ?
    I doubt avs2yuv "has the same problem". Over here, even an outdated build (the last one written by akupenguin) produces y4m files that are readily accepted by Rawsource.dll.

    OTOH, when I create a y4m file through the following command-line:

    Code:
    ffmpeg -i video.avs -an -pix_fmt yuv420p -f yuv4mpegpipe -y video3.y4m
    all I get in VirtualDub is:

    Avisynth open failure:
    YUV4MPEG2 header error.
    Last edited by El Heggunte; 24th Sep 2013 at 22:59. Reason: .....
    Quote Quote  
  19. Member vhelp's Avatar
    Join Date
    Mar 2001
    Location
    New York
    Search Comp PM
    at least the hex tool has that nice Ctrl+Tab toggle feature from excel. i used it to compare the ffmpeg vs. avs2yuv, and both are slighly different.

    but vdub never opened raw yuv/y4m files. i've never been able to.

    ffplay will play all y4m created files.
    Quote Quote  
  20. Member vhelp's Avatar
    Join Date
    Mar 2001
    Location
    New York
    Search Comp PM
    i just double-checked the ffmpeg / avs2yuv methods in x265. both encode perfectly fine. so it must have something to do with the way y4m files are processed by decoders. x265 decodes it correctly. avisynth plugin, rawsource, does not.

    also, if you feed each y4m version into avs script -> vdub, each frame is off by a few pixels. the ffmpeg version has 24 additional bytes to the file than avs2yuv's y4m file.

    i will try a few different ffmpeg versions to see if there are any differences in each.
    Quote Quote  
  21. DECEASED
    Join Date
    Jun 2009
    Location
    Heaven
    Search Comp PM
    Just as an apparently-nonsensical idea: 1) do you have ReClock installed on your XP rig?
    2) if the answer is "no", then please give a try to it.
    3) you don't have to use it, just install and configure. Because it MAY compensate what is broken in your DirectX setup Worked for me before I moved from a b0rked XP Home to a clean XP Pro, so it's not impossible the remedy works for you too ^.^;;
    Last edited by El Heggunte; 25th Sep 2013 at 01:07. Reason: edit :-)
    Quote Quote  
  22. Member vhelp's Avatar
    Join Date
    Mar 2001
    Location
    New York
    Search Comp PM
    will give a look at tomorrow.

    do you know how to get mencoder to output y4m ?

    i want to try and see if it will work, just curious. i tried googling, but man, i get very little hits if any. and you have read so much before you realize its not related. very tiring. anyway. i found this, but i can't get it to work.

    mplayer -vo yuv4mpeg:file="g:\video5mplayer.y4m" -i "c:\DGAvc.avs"
    mencoder -vo yuv4mpeg:file="g:\video5mplayer.y4m" -i "c:\DGAvc.avs"

    none work.

    ps: i'm beat. tomorrow's another day.
    Quote Quote  
  23. Originally Posted by vhelp View Post
    great. or else.. is there anything i can do to the .y4m files.
    You can use the hex editor to cut out unneeded parts of the header. For example, mark a section like " XYSCSS=420JPEG" and cut it out (Edit -> Cut, or press the Delete key). Then File -> Save.

    Before:
    Click image for larger version

Name:	marked.png
Views:	1177
Size:	19.7 KB
ID:	20178

    After:
    Click image for larger version

Name:	after.png
Views:	1203
Size:	18.3 KB
ID:	20177

    That should now open with RawSource().
    Last edited by jagabo; 25th Sep 2013 at 07:02.
    Quote Quote  
  24. Oh, I should mention, that old hex editor can't work with files over 4 GB.
    Quote Quote  
  25. Member vhelp's Avatar
    Join Date
    Mar 2001
    Location
    New York
    Search Comp PM
    just wanted to say, using my netbook, xp home, clean, i loaded up both y4m versions and they failed. same issue. so it is not on account of my current state of my desktop pc with xp.
    Quote Quote  
  26. Member vhelp's Avatar
    Join Date
    Mar 2001
    Location
    New York
    Search Comp PM
    jagabo, i will try your suggestion next. ty.
    Quote Quote  
  27. Member vhelp's Avatar
    Join Date
    Mar 2001
    Location
    New York
    Search Comp PM
    did not work. note that both files were slighly different from each files start position to FRAME position. the video previews in the same way in post 1.

    i would post pics but it is just too much of a hassle to do..let alone on a netbook.
    Quote Quote  
  28. Can you upload a sample with the first several frames? With the hex editor mark a section from the start to a few MB into the file, then select Edit -> Copy To File. Alternatively, you can start a few MB into the file, then use CTRL+SHIFT+END to mark from there to the end of the file, then press DELETE, then File -> Save As a new file.
    Last edited by jagabo; 25th Sep 2013 at 18:02.
    Quote Quote  
  29. Member vhelp's Avatar
    Join Date
    Mar 2001
    Location
    New York
    Search Comp PM
    i will upload two videos, re- avisynth-ffmpeg-y4m and avisynth-avs2yuv-y4m, 10 frames, shortly.
    Quote Quote  
  30. Member vhelp's Avatar
    Join Date
    Mar 2001
    Location
    New York
    Search Comp PM
    this site is no longer accepting my files. keeps rejecting them. i've had trouble before U/L'ing files recently. something must have changed since. and DSL is too slow for me to keep posting test uploads. sorry.

    i will try and work on the issue with y4m decoding, later.
    Quote Quote  



Similar Threads

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