I would like to make Sony MPEG EX, a proprietary but compliant MPEG-1. I searched, but could not find a video-editing tool that can take into account it's specifics.
I'm looking for the most simple and best way or tool on the Windows platform to accomplish this by software. Any constructive ideas are welcome!
I studied the MPEG EX file structure and did not take into account the layer-2 audio yet. That will follow later. For the video I found 3 IPP GOP's per physical block. At 320x240 the size of this block is 32Kb, at 160x112 this is 8Kb. (This physical block size takes into account the formatting of the Sony Memory Stick.) The 3 IPP GOP's are not enough to fill up the block. Therefore padding is used (with FF (HEX) values for each byte). The 2 P-frames are in fact both dummy (empty) frames (really!), only referencing the I-frame, so no changes at all! I was able to manually isolate I-frames, replace them, fix pointers and padding and even display the altered MPEG EX on Sony hardware (PHD-A55 Cyberframe or digital camera) to prove my findings!
I think it should be quiet straightforward to make such a file, by using the following building blocks:
- fixed length binary file with mpeg header
- binary files with I-frames
- fixed length binary file with 2 dummy P-frames
- variable length binary file with a pointer value
- variable length binary file with multiple FF's (256) for padding
... and just concatenate them in the right order by using some kind of programming.
I studied 'good old' DOS batch programming, but this is not good at numbers, which must be used for constructing the variable length binary files and looping (pointers and especially padding).
I'm an experienced programmer, but not on frameserving, scripting, C, Perl or BASIC. Before I go in a long and possible deadend street, I would like to have some advice on which tool/programming language is best to use for this.
The requirements for this tool follow from above description:
- handle binary files
- concatenate binary files (to intermediate ones)
- work with variables and constants for numbers
- basic calculation (add and subtract)
- write binary file
- process control file (on each line a filename of the jpeg/I-frame to
process)
- the input should be a list of same sized/quality JPEG's (from a directory)
Thanks in advance for reading!
+ Reply to Thread
Results 1 to 11 of 11
-
-
I know PL/SQL (Oracle) and Informatica PowerCenter very well, thank you. I want to learn something when I need it (for my job). I didn't need that C or BASIC knowledge before. Learning C would be to heavy for such a small requirement. Perhaps later ...
As far as AVISYNTH is concerned: I have had a look at it before.
But I don't only want to make a sequence of pictures. I want to have control about the bytes being produced. After each processed JPEG (to MPEG-I), I want to concatenate specific strings/files. Can AVISYNTH do intermediate calculations and read in (sometimes) big proprietary binary files and concatenate in sequence?
There are 3 parts that are Sony proprietary bits:
a. bits representing 2 dummy P-frames (they consume bytes, believe me)
b. (calculated)relative pointer bits (where does the next set of 3 GOP's start)
c. (calculated) variable length binary file with padding (FF's), to pad to the end of the physical block
If I do not adhere to the exact format and bytestream/locations the Sony firmware (in their hardware) expects to read specific information, the MPEG EX file is invalid and will not display! -
No, Avisynth won't do that.
What you want to do requires a serious language that can deal with
low-level data. C would be the very best for that. C++ wouldn't help
any and would be harder to learn.
Basic might be easier to learn but is somewhat awkward with
binary data. I think you have misjudged the difficulty of your
project. -
I did not misjudge the difficulty of my project. That's why I asked advice for which tool to use. I know the details, design and pseudocode, but no C syntax (yet). I needed advice, thanks!
-
Seems like the tools you need to use to do this, C/C++, you currently dont know how to use. My advice, learn C.
Ejoc's CVD Page:
DVDDecrypter -> DVD2AVI -> Vobsub -> AVISynth -> TMPGEnc -> VCDEasy
DVD:
DVDShrink -> RecordNow DX
Capture:
VirualDub -> AVISynth -> QuEnc -> ffmpeggui -> TMPGEnc DVD Author -
OK the next trick is where to find a free C compiler
If you installed CYGWIN you could use the UNIX C complier for
free. -
This looks pretty good
I tried it
http://www.cs.virginia.edu/~lcc-win32/ -
There's also djgpp
Ejoc's CVD Page:
DVDDecrypter -> DVD2AVI -> Vobsub -> AVISynth -> TMPGEnc -> VCDEasy
DVD:
DVDShrink -> RecordNow DX
Capture:
VirualDub -> AVISynth -> QuEnc -> ffmpeggui -> TMPGEnc DVD Author -
FOO and Ejoc: thank you for your contribution! You were most helpfull.
I will study C and use djgpp for my 'little' project.
But I first need to know exactly what the relation is between Sony captured JPEG and an MPEG-1 I-frame.
There is probably a possibility to analyze this relation. Sony says they can produce JPEG's with 5 seconds of audio ... That is impossible, I know, but ... What results when you use this feature is a JPEG and a still MPEG EX MPEG-1 (with sound). The still MPEG EX is much smaller when displayed than the JPEG. Due to the Memory Stick architecture, a Sony display can show the JPEG and let hear the layer-2 audio from the MPEG-1 in parallel. Nice! Now, the big question is: is the MPEG-1 I-frame based on the JPEG bytes (a recompression) or is it done before that?
There are a few reasons why I want to produce MPEG EX:
1. Extend the use of my Sony PHD-A55 Cyberframe
(display ANY video source on it, based on JPEG input)
2. Become independent from Sony capturing hardware
3. Help some people who also wished to convert to MPEG EX
4. It is a Sony USP ('unlimited' length MPEG-1 capture on Memory Stick) ...
5. A challenge! -
I found THE answer: Tcl and Dali
Remember my project: baseline JPEG to proprietary MPEG-1 transcoding.
Remember my request: the most simple and best way or tool on the Windows platform to accomplish this by software.
There are several approaches possible:
1. use a tool that does the conversion I need (no option: no such tools available)
2. do low-level programming from scratch (C, C++, or ...) (no real option for me: to much time wasted on only learning a low-level programming language)
3. reuse as much as possible existing C/C++ sources and rewrite (better option, however ...)
I was lucky to have discovered the following:
4. use a scripting language with an excellent library that supports multimedia types like images and video (best option for my situation)
I found the Dali library from Cornell: http://www.cs.cornell.edu/dali/
These guys did a really good job!
Dali is an extension for Tcl (a scripting language). Tcl and Dali are open source and seem to be very powerfull, portable, and also available for Windows. Dali's library has support for JPEG, MPEG-1 amongst others. Besides Dali, there are also MPEG-2 extensions for Tcl.
Scripting may have some disadvantages, but for my project, speed of processing and large files are not a requirement. Fast to learn and compact/simple/flexible coding is. So, I will start learning Tcl and use elements of the Dali library where needed.
First I will do a high-level design and pseudocode and anticipate for support for other proprietary output formats and UI usage.
Later, I will pick up the UI with perhaps SpecTcl.
I'm very glad I found it and I will GO 4 IT.
Similar Threads
-
Possible To Make A VDub Script To Cut Segment From Video?
By onesikgypo in forum ProgrammingReplies: 1Last Post: 17th Jun 2011, 20:02 -
To Script or Not To Script, that is the Question... (Custom Videos)
By TheMcD in forum EditingReplies: 2Last Post: 21st Oct 2010, 10:11 -
programm which can make frameserving for Avisynth script
By Yury Perschin in forum Capturing and VCRReplies: 0Last Post: 20th Jan 2009, 11:19 -
Programming in C...where to get PICO or use on PC?
By Rudyard in forum ComputerReplies: 13Last Post: 14th Mar 2008, 07:29 -
programming?
By php111 in forum ProgrammingReplies: 6Last Post: 7th Aug 2007, 07:52