VideoHelp Forum




+ Reply to Thread
Results 1 to 14 of 14
  1. Member khodam's Avatar
    Join Date
    Jun 2013
    Location
    Somewhere I belong
    Search PM
    Hi guys,

    I'm developing a recording application by capturing a camera using DirectShow filters. Do you know any video format that doesn't have file header?
    Why I ask this? Because I want to be able to play recorded file which has not beed closed correctly. I'm develping for a special device, so I should consider this.
    For example MPEG-2 is headerless but I couldn't fint a good MPEG-2 encoder
    Do you know any headerless video file container or video file format? (should have DirectShow encoder)

    Thanks
    Quote Quote  
  2. Banned
    Join Date
    Oct 2004
    Location
    Freedonia
    Search Comp PM
    I'm not saying that I am an expert so I could be wrong, but I thought that MPEG-2 had headers. The Teco Bit Rate Viewer tool from the past allowed modification of what I thought was the header information. It's been a very long time since I had to do that, but back in the days when consumer burnable DVD discs and burners were extremely expensive, a lot of us here were making SVCD because you could burn those to CD-R and to get the video files to be compliant I would have to modify the header information sometimes.

    HCenc is a free MPEG-2 encoder that is excellent. Years ago I used to use CCE and HCenc was good that I stopped using CCE.
    Quote Quote  
  3. DECEASED
    Join Date
    Jun 2009
    Location
    Heaven
    Search Comp PM
    khodam, you should harder this subject I said the old MPEG containers (mpg, and VOB/AOB, and ts) do not use GLOBAL headers. The other "well-known" containers (AVI, MP4, MKV, ASF , OGG , etc.) do use GLOBAL headers, and this is the reason why they are not suitable for a "problematic capture environment" like yours

    m1v, m2v, m4v, h264, vc1, and the nameless ETC. , are elementary streams, and well-designed elementary streams indeed use frame headers and GOP headers And keep being careful, elementary streams and containers ARE NOT the same thing

    ACTUAL "headerless" digital video means a RAW, uncompressed sequence of bytes, and I have no idea of how to deal with such beast in a DirectShow environment Of course one can store uncompressed video in containers like AVI or MKV, but as you yourself had said already, these latter are not a solution to your problem.

    Anyway, and for starters,

    http://en.wikipedia.org/wiki/Container_format_(digital)

    http://en.wikipedia.org/wiki/Comparison_of_container_formats <= this one has been corrected by ME sometimes
    Last edited by El Heggunte; 1st Jul 2013 at 07:42. Reason: aaaargh
    Quote Quote  
  4. Another option (and safer method would) might be an image sequence , the recorded frames will survive interruptions (e.g. power outages) , but various video formats will often be corrupted
    Quote Quote  
  5. Member vhelp's Avatar
    Join Date
    Mar 2001
    Location
    New York
    Search Comp PM
    by headerless, i take you to mean, avi with no RIFF, assuming an avi stream of some sort.

    you will have to write your own custom-like codec. you can do something like this using the "stream" method, whether file or memory.

    this was one approach i took in one of my screen capture (delphi) app, where i capture a certain area of the screen (for touch youtube/vemo videos) and converted screendata to raw bitmap->png->stream. no headers to identify the .strm file, so dumping into a directshow or other, player will not play the video. you have to custom make your own player and/or "convert" that stream data back to bitmap images and convert that to an avi. you can do in two-pass or single-pass as in realtime. that is up to you how you do this.

    but, if the system crashes, the file may not corrupt, however, the file can become un-readable since it didn't flush out and close completely. it would depend on how the crash occured and where in the process it crashed. so, it may read some or most of the data but only up to the point, give/take, where it crashed, for instance--and that depends on how you code the routines for this.

    so, the process was screen->bitmap->png->stream, then stream->png->bitmap->player/viewer. this is the part you decide to do in real-time or two-pass. probably best to do in real-time. in my case, i wrote two apps, one a recorder, and the other a (decoder) player.

    i am not very good with streams. that aspect of the tool i did work on was difficult for me to figure out. it was better to figure out how to write avi stream, choose a codec to write (compress) to inside this avi stream versus writing "raw" data to a stream, which is what i did in one of my screen capture apps.
    Quote Quote  
  6. Do you know any video format that doesn't have file header?
    Why I ask this? Because I want to be able to play recorded file which has not beed closed correctly.
    Wouldn't some I-Frame only format be better? I mean a format where each frame has all the headers it needs and can be decoded without the rest of the clip?
    This would allow to decode all frames except the last one if the file hasn't been closed correctly.
    Quote Quote  
  7. Member khodam's Avatar
    Join Date
    Jun 2013
    Location
    Somewhere I belong
    Search PM
    jman98:
    HCenc is a MPEG-2 encoder software (converter). I need DirectShow encoder filter.

    El Heggunte:
    Thank you for clarifying this matter. I understood details: frame header, GOP, container, etc.
    Well, with all information you provided (as a experienced in V/A), what's your suggestion about container and container format which is best for my situation?
    Thanks again

    poisondeathray:
    I can't record raw video because of storage.

    vhelp:
    Thank you for your suggestion but I don't need have such time to develop a video encoder/decoder on my own. For now I prefer to use others' encoders.
    Quote Quote  
  8. DECEASED
    Join Date
    Jun 2009
    Location
    Heaven
    Search Comp PM
    Selur's suggestion is "the best" IMHO (mpeg-2 with I-frames only). But keep in mind that a stream without P/B frames does require more bitrate, and possibly you'll need to get more storage space.

    but I couldn't find a good MPEG-2 encoder
    That sounds weird , I will check it out, and will report my findings later (or at least I hope so).
    Last edited by El Heggunte; 1st Jul 2013 at 07:59.
    Quote Quote  
  9. You can create containerless files with the DirectShow Dump filter. But without headers streams will not be easily identifiable. For example, you could write the raw PCM output of an MP3 decoder filter directly to a file. But it will not be obvious that that file contains PCM audio. The sample size, sample rate, byte order, and number of channels will also not be obvious.
    Quote Quote  
  10. Member khodam's Avatar
    Join Date
    Jun 2013
    Location
    Somewhere I belong
    Search PM
    El Heggunte:
    Thank you for your suggestion
    Yes, I couldn't find a good MPEG-2 DirectShow Encoder
    I was used to use InterVideo MPEG-2 Video Encoder but InterVideo Inc. was sold to Corel Inc. So development and support of encoder stopped
    I'll be waiting for your suggestion about DirectShow encoder. You're good at this
    Thanks

    jagabo:
    Since my video's frame-rate, height, width and other properties is fixed, I can do this but how can I play the video?
    Thanks for suggestion
    Quote Quote  
  11. Originally Posted by khodam View Post
    Since my video's frame-rate, height, width and other properties is fixed, I can do this but how can I play the video?
    Thanks for suggestion
    Some raw streams can be played by some players. For example VLC can play an h.264 elementary stream. But in other cases you'll need to mux your raw streams into a valid container. Or create your own player.
    Quote Quote  
  12. DECEASED
    Join Date
    Jun 2009
    Location
    Heaven
    Search Comp PM
    Originally Posted by khodam View Post
    I'll be waiting for your suggestion about DirectShow encoder. You're good at this
    That's just your opinion alright

    Anyway, I have found something that apparently is not that bad I think the main reason why many/most mpeg-2 DirectShow encoders suck is, they don't allow the use of custom quantization matrices Still, the products from LeadTools look reasonably stable and decent, and you can test before you buy of course:

    http://www.leadtools.com/sdk/mpeg2-transport.htm, OR

    http://www.leadtools.com/sdk/multimedia-suite.htm

    Hope this helps
    Last edited by El Heggunte; 1st Jul 2013 at 14:51. Reason: fix link
    Quote Quote  
  13. Member vhelp's Avatar
    Join Date
    Mar 2001
    Location
    New York
    Search Comp PM
    Since my video's frame-rate, height, width and other properties is fixed, I can do this but how can I play the video?
    Thanks for suggestion
    as suggested earlier, you will have to build one. or, in the case of using already made specific codec (though in raw format) you will have to add the missing container parts yourself, then you will be able to play them.

    but i think the tricky part is to first realize that you have to determine which codec of today is best for the scenario of if the capture or recording stops unexpectedly, how easily will it be to rebuild it after the crash. you may want to run a few capture-and-crash test scenarios and see which one is the easiest to rebuild the headers to. i'm thinking that an avi container might be the easiest.

    there are few mpeg-2 avi formats. matrox, for instance, has a codec suite that you can test each codec in. it also includes the mpeg-2 format. find out which container is easiest to understand (build on your own and rebuild in case of crash) and go with that. still, you want to keep the codec of choice the simplest. that's why i suggested avi in my earlier response because something like mpeg-2 for instance, has gops and other things that get tricky to play around with let alone to understand. have a look at the avi (RIFF) stream format to get an idea how the data is layed out.
    Quote Quote  
  14. Member khodam's Avatar
    Join Date
    Jun 2013
    Location
    Somewhere I belong
    Search PM
    El Heggunte:
    Thank you for your link. I contacted to sales team and waiting for response

    vhelp:
    Your solution is good and working but I can't use it. Thank you very much for your suggestion. Maybe I'll use it later
    Quote Quote  



Similar Threads

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