Gelöst: MNG Film mit QT4 schreiben problem fuer QMovie

Alles rund um die Programmierung mit Qt
Antworten
patrik08
Beiträge: 746
Registriert: 27. Februar 2006 10:48
Wohnort: DE Freiburg

Gelöst: MNG Film mit QT4 schreiben problem fuer QMovie

Beitrag von patrik08 »

Ich habe heute eine class gefunden die mir sehr nutzlich sein kann
qt-x11-opensource-4.0.0-b2/tools/qvfb/qanimationwriter.cpp
tools/ qvfb/ ist eigentlich nur fuer linux

aber doch nicht nmg animations file schreiben...

ich habe es etwas umgeschrieben auf
http://fop-miniscribus.googlecode.com/s ... writer.cpp

er schreibt die film file fehlerlos aber wenn ich sie mit QMovie oeffnen will
sagt die mng lib :

MNG error 4097: Image is larger than defined maximum; chunk MHDR; subcode 0:0
MNG error 1028: Chunk-length is invalid; chunk MOVE; subcode 0:0


Code: Alles auswählen


void writeMHDR( const QSize& size, int framerate )
{
	dev->writeBlock("\212MNG\r\n\032\n", 8);

	struct {
	    int width;
	    int height;
	    int framerate;
	    int a,b,c;
	    int profile;
	} chunk;
	chunk.width = htonl(size.width());
	chunk.height = htonl(size.height());
	chunk.framerate = htonl(framerate);
	chunk.a=0;
	chunk.b=0;
	chunk.c=0;
	chunk.profile= htonl(0x00000003);
  /*     FRAM  , MHDR       */
	png_write_chunk(png_ptr, (png_byte*)"MHDR", (png_byte*)&chunk, sizeof(chunk));
}

liegt es vielleicht an htonl das ich auf window so geschrieben habe
eigentlich muss ja nur

chunk.profile= htonl(0x00000003);
chunk.profile zu int gehen ...

Code: Alles auswählen


unsigned long
htonl(unsigned long a)
{
	return (a);
}

Zuletzt geändert von patrik08 am 23. Mai 2008 10:29, insgesamt 1-mal geändert.
.........................
speack português italiano deutsch english castellà qt
patrik08
Beiträge: 746
Registriert: 27. Februar 2006 10:48
Wohnort: DE Freiburg

Beitrag von patrik08 »

Ich habe es gelöst ...

Un merke das APNG viel leichter ist als GIF oder sogar Flash
und gegenuber GIF mit millionen von farben... und alpha naturlich

Das MNG Bild / video format wird von Mozilla nicht mehr unterstutz..

Zitat zu MNG von http://de.wikipedia.org/wiki/Multiple-I ... k_Graphics;
Die Entwickler des MNG-Formates hoffen, dass MNG beginnen wird, GIF für animierte Bilder im World Wide Web zu ersetzen, wie es PNG bereits teilweise für nicht animierte Bilder getan hat. Dazu kam es jedoch bis heute (Januar 2008) nicht, da MNG von den meisten Webbrowsern nicht (oder nicht mehr) unterstützt wird.
Zitat zu APNG von http://en.wikipedia.org/wiki/Animated_P ... k_Graphics :

Code: Alles auswählen

The PNG group officially rejected APNG as an official extension on April 20, 2007.[2] There have been several subsequent proposals for a simple animated graphics format based on PNG using several different approaches.[3] Among the maintainers of the PNG and MNG formats, APNG was not received well for several reasons. MNG provides all the features APNG provides, but is not supported at all by PNG-only decoders. APNG uses a technically feasible solution for storing any frames except the first, but the majority of the PNG group thinks this conflicts with the purpose of the PNG format – which is to store a single image. APNG would be compatible to this vision with alterations to its signature and intended MIME type, but these would break the desired backwards compatibility.

Also in gewisserweise ist APNG illegal und MNG legal nach PNG etwickler..

ABER:


Kein browser unterstutzt MNG bilder oder filme..
Jedoch macht sich APNG breit da es viel besser ist und animiert,
und falls der browser dass nicht untertutzt sieht er wenigstens das erste bild frame ... und die kompression ist gewaltig!!

Heute unterstutzed diese browser das APNG format

* Mozilla Firefox as of version 3 alpha 3 (23 March 2007)[4]
* Opera as of version 9.5 alpha (September 14, 2007)[5]
* KSquirrel as of version 0.7.2 (October 3, 2007)
* XnView as of version 1.92 (December 19, 2007)


Alle animierte bilder im vergleich....

http://www.miwa-immobilien-allgaeu.de/p ... if2swf.htm

Somit habe ich das APNG mit QT geschrieben

http://fop-miniscribus.googlecode.com/s ... assembler/

aber qt kann es noch nicht lesen....

QT hat 2 bilder von je 30KB gemacht
und die APNG lib hat diese 2 frame zu 1.59 KB gepresst das resultat:
Bild
Sichtbar mit firefox 3 oder Opera auch das 2° bild.


Also Animierte bilder Frame fuer die beste kompression und qualitat

Kann QT es schreiben....
mit eine gepatsche extra libpng ...
http://www.qt-apps.org/content/show.php ... tent=81573
.........................
speack português italiano deutsch english castellà qt
patrik08
Beiträge: 746
Registriert: 27. Februar 2006 10:48
Wohnort: DE Freiburg

Beitrag von patrik08 »

Nun trolltech ueberlegt ob sie dass bessere APNG/PNG format uebernehmen
Dann wuerden viele exe und resource file viel weniger wiegen...

Task Tracker - Entry
http://trolltech.com/developer/task-tra ... thod=entry
.........................
speack português italiano deutsch english castellà qt
Antworten