VideoHelp Forum
+ Reply to Thread
Results 1 to 11 of 11
Thread
  1. Member
    Join Date: Apr 2013
    Location: Italy
    Search PM
    Hi

    considering my usual source https://dl.dropboxusercontent.com/u/39871584/C0020.mxf

    I do: ffmpeg -i c0020.mxf -vcodec mjpeg -pix_fmt yuvj422p -q:v 0 -an ffmpeg.avi

    this produce:

    General
    Complete name : D:\ffmpeg.avi
    Format : AVI
    Format/Info : Audio Video Interleave
    File size : 536 MiB
    Duration : 36s 600ms
    Overall bit rate : 123 Mbps
    Writing application : Lavf55.37.100

    Video
    ID : 0
    Format : JPEG
    Codec ID : MJPG
    Duration : 36s 600ms
    Bit rate : 123 Mbps
    Width : 1 920 pixels
    Height : 1 080 pixels
    Display aspect ratio : 16:9
    Frame rate : 25.000 fps
    Color space : YUV
    Bit depth : 8 bits
    Compression mode : Lossy
    Bits/(Pixel*Frame) : 2.370
    Stream size : 536 MiB (100%)


    If I try to do the same in Virtualdub, encoding in FFDSHOW (and then rename with the hex editor the tag ffds in "mjpg")

    this is the result:

    General
    Complete name : D:\vdffd.avi
    Format : AVI
    Format/Info : Audio Video Interleave
    File size : 9.11 MiB
    Duration : 4s 0ms
    Overall bit rate : 19.1 Mbps
    Writing library : VirtualDub build 35491/release

    Video
    ID : 0
    Format : JPEG
    Codec ID : MJPG
    Duration : 4s 0ms
    Bit rate : 19.1 Mbps
    Width : 1 920 pixels
    Height : 1 080 pixels
    Display aspect ratio : 16:9
    Frame rate : 25.000 fps
    Color space : YUV
    Chroma subsampling : 4:2:0
    Bit depth : 8 bits
    Compression mode : Lossy
    Bits/(Pixel*Frame) : 0.368
    Stream size : 9.10 MiB (100%)

    So if I try open it (vdffd.avi) in virtualdub with the internal mjpg decompressor, it don't load and get error.

    An error appear in virtualdub also if I try open the ffmpeg' one (ffmpeg.avi)

    If I try encode, in virtualdub, with the accusoft Pic Mjpeg in 422 mode:

    General
    Complete name : D:\pic.avi
    Format : AVI
    Format/Info : Audio Video Interleave
    File size : 33.1 MiB
    Duration : 4s 0ms
    Overall bit rate : 69.4 Mbps
    Writing library : VirtualDub build 35491/release

    Video
    ID : 0
    Format : JPEG
    Codec ID : MJPG
    Duration : 4s 0ms
    Bit rate : 69.4 Mbps
    Width : 1 920 pixels
    Height : 1 080 pixels
    Display aspect ratio : 16:9
    Frame rate : 25.000 fps
    Color space : YUV
    Chroma subsampling : 4:2:2
    Bit depth : 8 bits
    Scan type : Interlaced
    Scan order : Top Field First
    Compression mode : Lossy
    Bits/(Pixel*Frame) : 1.338
    Stream size : 33.1 MiB (100%)

    so virtualdub open correctly the PIC.avi and it is declared 422 by mediainfo

    If I try encode in pic in 4:2:0 (4:1:1) mode this is the results:

    General
    Complete name : D:\pic420.avi
    Format : AVI
    Format/Info : Audio Video Interleave
    File size : 29.4 MiB
    Duration : 4s 0ms
    Overall bit rate : 61.7 Mbps
    Writing library : VirtualDub build 35491/release

    Video
    ID : 0
    Format : JPEG
    Codec ID : MJPG
    Duration : 4s 0ms
    Bit rate : 61.6 Mbps
    Width : 1 920 pixels
    Height : 1 080 pixels
    Display aspect ratio : 16:9
    Frame rate : 25.000 fps
    Color space : YUV
    Chroma subsampling : 4:2:0
    Bit depth : 8 bits
    Scan type : Interlaced
    Scan order : Top Field First
    Compression mode : Lossy
    Bits/(Pixel*Frame) : 1.189
    Stream size : 29.4 MiB (100%)

    = virtualdub don't read the file pic420.avi !

    Exactly the same thing happens with mencoder: when the output file are not declared in 4:2:2 by mediainfo is unopenable by virtualdub with the interal mjpeg decompressor.

    Supporting the thesis that the problem is the lack of encoding in 4:2:2 I wonder if there is possibility of encoding with ffmpeg (and also in virtualdub with the ffdshow plugin) so that the output file is expressly 4:2:2. Thanks
    Quote Quote  
  2. Member
    Join Date: Sep 2007
    Location: Canada
    Search Comp PM
    Then there is probably something in the metadata signalling the file is 4:2:2 that vdub's internal jpeg decoder requires , since other mjpeg decoders correctly decode at 4:2:2

    So your question isn't the lack of encoding 4:2:2, but rather some metadata or signalling that indicates file is 4:2:2 for mediainfo or internal vdub mjpeg decoder (because file is 4:2:2 according to other decoders)

    You still haven't answered why you want to use internal vdub jpeg decoder ?
    Quote Quote  
  3. Member
    Join Date: Apr 2013
    Location: Italy
    Search PM
    because with internal decoder is greatly reduced the risk of making messes, greatly reduced the risk that some parameters has changed depending on windows settings and VFW or DirectShow decoder installed or not installed or changed by mistake or perhaps from other programs. In general the use of the internal decompressor is a point of grip and safety in order to avoid shambles
    Quote Quote  
  4. Member
    Join Date: Sep 2007
    Location: Canada
    Search Comp PM
    What are you using vdub for ? What tasks do you need it for ?
    Quote Quote  
  5. Member
    Join Date: Apr 2013
    Location: Italy
    Search PM
    Virtualdub is the intermediary to do a thousand things, from the encoding H264 then the reduction hd/sd, convert mxf -> mjpg. I enjoy to shoot videos of my cats, not for serious things

    Name:  GIANT.JPG
Views: 173
Size:  40.3 KB
    Quote Quote  
  6. Member
    Join Date: Apr 2013
    Location: Italy
    Search PM
    Originally Posted by poisondeathray View Post
    So your question isn't the lack of encoding 4:2:2, but rather some metadata or signalling that indicates file is 4:2:2
    mm is Jagabo the expert of avi files?
    Quote Quote  
  7. Member
    Join Date: Sep 2007
    Location: Canada
    Search Comp PM
    Yes PM jagabo, he know all this stuff about AVI header etc... I don't know if the 4:2:2 is signalled in the header or RIFF tree, or if it's somewhere else in the actual video bitstream

    That's a big cat , but I like your Mr. Tribble better
    Quote Quote  
  8. As far as I can tell, ffdshow VFW's mjpeg mode does't support interlaced YUY2 properly. It always down-samples to YV12 and it treats the interlaced chroma as progressive (or maybe VirtualDub was down-sampling, but I suspect not because I had VirtualDub set to output YUY2 to the codec). The only way I could get it to encode interlaced video correctly is to feed it interlaced YV12 with VirtualDub in Fast Recompress mode. Try this script as input to VirtualDub if you want to experiment for yourself:

    Code:
    ColorBars(pixel_type="yuy2")
    top=PointResize(width, height/2)
    bot=top.Invert()
    Interleave(top,bot)
    AssumeFieldbased()
    Weave()
    #ConvertToYV12(interlaced=true) # enable for interlaced YV12 output
    Trim(0,10)
    If you open that script in VirtualDub and apply the Bob Doubler filter you'll see the output pane swap back and forth between normal colors and inverted colors.
    Last edited by jagabo; 24th Apr 2014 at 20:28.
    Quote Quote  
  9. Member
    Join Date: Apr 2013
    Location: Italy
    Search PM
    so I think there is no solution to have, with ffmpeg, a regular mjpeg YUV/4:2:2 file output?
    Quote Quote  
  10. Member racer-x's Avatar
    Join Date: Mar 2003
    Location: 3rd Rock from the Sun
    Search Comp PM
    Why not import the mxf file into Virtualdub via FFInputDriver, it keeps 4:2:2. Do what you have to do, then export to mjpg or whatever.
    Attached Images  
    The memories of a man in his old age, are the deeds of the man in his prime.......
    Quote Quote  
  11. Member
    Join Date: Apr 2013
    Location: Italy
    Search PM
    because I'm forced to the mjpeg
    Quote Quote