CN102902525A - Method and device for modifying frame frequency of small web format (swf) files in batches - Google Patents

Method and device for modifying frame frequency of small web format (swf) files in batches Download PDF

Info

Publication number
CN102902525A
CN102902525A CN2012103141337A CN201210314133A CN102902525A CN 102902525 A CN102902525 A CN 102902525A CN 2012103141337 A CN2012103141337 A CN 2012103141337A CN 201210314133 A CN201210314133 A CN 201210314133A CN 102902525 A CN102902525 A CN 102902525A
Authority
CN
China
Prior art keywords
file
swf
frame frequency
former
files
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN2012103141337A
Other languages
Chinese (zh)
Other versions
CN102902525B (en
Inventor
肖显斌
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
4399 NETWORK Co Ltd
Original Assignee
4399 NETWORK Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 4399 NETWORK Co Ltd filed Critical 4399 NETWORK Co Ltd
Priority to CN201210314133.7A priority Critical patent/CN102902525B/en
Publication of CN102902525A publication Critical patent/CN102902525A/en
Application granted granted Critical
Publication of CN102902525B publication Critical patent/CN102902525B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The invention provides a method for modifying frame frequency of swf files in batches. The method includes S1, original swf files with frame frequency needed to be modified are uploaded to a server; S2, the server reads the original swf files with binary streams; S3, the server analyzes file headers of the original swf files, and the original swf files are judeged whether the swf files are compressed files according to the analyzed file headers of the swf files, wherein if the swf files are compressed files, the swf files are decompressed and S4 is performed, and if the swf files are not compressed files, S4 is performed directly; S4, frame frequency of the original swf files is analyzed, and the frame frequency of the original swf files is replaced by novel frame frequency in batches; and S5, the frame-frequency replaced swf files are compressed and stored into a local folder again. According to the method and a device for modifying frame frequency of swf files in batches, the swf files with frame frequency needed to be modified are modified by users, the efficiency is improved, the processing difficulty is reduced, and the modifying is rapid and simple and easy.

Description

A kind of swf files in batch is revised method and the device of frame frequency
Technical field
The present invention relates to the video playback technical field, relate in particular to method and device that a kind of swf files in batch is revised frame frequency.
Background technology
Frame frequency refers to the broadcasting speed of swf file, and the frame number of playing take per second is as tolerance.The swf file is the professional format of Flash, is the animation file form of a kind of support vector and dot pattern, is widely used in webpage design, the fields such as cartoon making, and the swf file is also referred to as the Flash file usually.At present to swf file modification frame frequency mainly by following two kinds of methods:
1. adopt the single modification of software swf file frame frequency, as use ASV software, ASV software is the win32 application program of a swf file reverse compiling, can check the action script of swf file the inside by the ASV software function, can extract the source documents such as bitmap, audio frequency, video, font, can browse the inside structure of swf file, can rebuild the FLA file of swf file, derive source material file and a JSFL order of swf file, thereby can make amendment to single swf file frame frequency;
2. the swf file of oneself being write is directly revised frame frequency.
In sum, prior art is revised the method complicated operation of swf file frame frequency, and efficient is lower.
Summary of the invention
The object of the invention is to design a kind of swf files in batch and revise method and the device of frame frequency, can batch modification swf file frame frequency, improve operating efficiency.
To achieve these goals, the technical solution used in the present invention is as follows:
A kind of swf files in batch is revised the method for frame frequency, comprising:
S1 revises the former swf File Upload of frame frequency to server with needs;
S2, described server reads described former swf file with binary stream;
S3, the file header of the described former swf file of described server parses is judged whether compressed file of described former swf file according to the file header of the described former swf file of resolving, if so, then the described former swf file of decompress(ion) is carried out S4; If not, directly carry out S4;
S4 resolves described former swf file frame frequency number, replaces in batches the frame frequency number of described former swf file with new frame frequency number;
S5 again compresses and is saved in local directory replacing swf file behind the frame frequency.
Preferably, the file header of described former swf file begins with three identifiers, and described three identifiers are that 0x46,0x57 and 0x53 or described three identifiers are 0x46,0x57 and 0x43.
Preferably, the described former swf file of the judgement described in the described S3 is compressed file whether, is specially: if three identifiers of the file header of former swf file are 0x46,0x57 and 0x53, then be compressed file not; If three identifiers of the file header of former swf file are 0x46,0x57 and 0x43, then are compressed file.
Preferably, the frame frequency number that the usefulness described in the described S4 is new is replaced the frame frequency number of described former swf file, is specially: by resolving former swf file layout, determine the frame frequency position, revise the frame frequency number.
Preferably, the method for described definite frame frequency position is specially, and calculates the position at frame frequency place by the wide high rectangular configuration of stage.
Another technical scheme of the present invention is:
A kind of swf files in batch is revised the device of frame frequency, comprising:
Upper transmission module is used for former swf File Upload to the batch processing server;
Described batch processing server is used for the described former swf file that receives is carried out the processing of batch modification frame frequency, replaces the frame frequency book of former swf file with new frame frequency number, generates new swf file;
Memory module, the new swf file that is used for generating is saved in local directory.
Preferably, described batch processing server also comprises:
Receiver module is used for receiving the former swf file that the user uploads;
Judge module is used for judging whether described former swf file is compressed file;
Decompress files is used for described judge module is judged as the described former swf file decompression of non-decompress files;
Parsing module, the form for resolving described former swf file generates new swf file;
Compression module, the new swf compressing file that is used for generating becomes compressed file.
Preferably, described receiver module receives the former swf file that the user uploads with the binary stream form.
Preferably, described judge module is used for judging whether described former swf file is compressed file, be specially: judge three forms of identifier of the file header of former swf file, if three identifiers of the file header of former swf file are 0x46,0x57 and 0x53, then be compressed file not; If three identifiers of the file header of former swf file are 0x46,0x57 and 0x43, then are compressed file.
Preferably, described parsing module is used for resolving the form of former swf file, is specially: determine the frame frequency position, revise the frame frequency number.
Beneficial effect of the present invention can be summarized as follows:
The present invention carries out the operation of batch processing modification frame frequency by the swf file that allows the user that needs are revised frame frequency, has improved efficient and has reduced intractability, reaches quick, easy purpose.
Description of drawings
Fig. 1 is structural representation of the present invention;
Fig. 2 is apparatus structure schematic diagram of the present invention.
Embodiment
In order to make technical matters solved by the invention, technical scheme and beneficial effect clearer, below in conjunction with drawings and Examples, the present invention is further elaborated.
Referring to Fig. 1, the method for batch modification swf file frame frequency of the present invention specifically may further comprise the steps:
S1 revises the former swf File Upload of frame frequency to server with needs;
When the user need to revise the frame frequency of former swf, needs are revised the former swf File Upload of frame frequency to carrying out the batch processing server, the frame frequency of the former swf file of described batch processing server batch modification.
S2, described batch processing server reads described former swf file with binary stream;
Byte in the binary stream is written in file or the equipment according to the programming form, and be read into the program from the form that file or equipment read according to them, data in the binary stream are to come storing documents according to binary-coded mode, binary stream need not transform newline, can accelerate the speed of data stream, raise the efficiency.
S3, the file header of the described former swf file of described server parses is judged whether compressed file of described former swf file according to the file header of the described former swf file of resolving, if so, then the described former swf file of decompress(ion) is carried out S4; If not, directly carry out S4;
The file header of described former swf file begins with three identifiers, described three identifiers are that 0x46,0x57 and 0x53 or described three identifiers are 0x46,0x57 and 0x43, if three identifiers of the file header of former swf file are 0x46,0x57 and 0x53, then be compressed file not; If three identifiers of the file header of former swf file are 0x46,0x57 and 0x43, then are compressed file.
S4 determines described former swf file frame frequency number, replaces in batches the frame frequency number of described former swf file with new frame frequency number, generates new swf file;
By resolving the file layout of swf, find the position of frame frequency, first three byte of swf file is leader will, and version number is a byte, and file size is four bytes, calculates the position at frame frequency place by the wide high rectangular configuration of stage, revises the frame frequency number.
The wide height of described stage is broadcast width and the height of frame frequency.
S5 again compresses described new swf file and to be saved in local directory.
When the user need to play the swf file, directly call new swf file.
The present invention carries out the operation of batch processing modification frame frequency by the swf file that allows the user that needs are revised frame frequency, has improved efficient and has reduced intractability, reaches quick, easy purpose.
Referring to Fig. 2, swf files in batch of the present invention is revised the device of frame frequency, comprising:
Upper transmission module is used for former swf File Upload to the batch processing server; Described batch processing server is used for the described former swf file that receives is carried out the processing of batch modification frame frequency, replaces the frame frequency book of former swf file with new frame frequency number, generates new swf file; Memory module, the new swf file that is used for generating is saved in local directory.
Wherein, described batch processing server also comprises:
Receiver module is used for receiving the former swf file that the user uploads.When the user need to revise the frame frequency of former swf, needs are revised the former swf File Upload of frame frequency to carrying out the batch processing server, the module of accepting of described batch processing server receives described former swf file.
Described receiver module receives the former swf file that the user uploads with the binary stream form.
Judge module is used for judging whether described former swf file is compressed file;
Be specially: judge three forms of identifier of the file header of former swf file, if three identifiers of the file header of former swf file are 0x46,0x57 and 0x53, then be compressed file not; If three identifiers of the file header of former swf file are 0x46,0x57 and 0x43, then are compressed file.
Decompress files is used for described judge module is judged as the described former swf file decompression of non-decompress files;
Parsing module, the form for resolving described former swf file generates new swf file;
Wherein, the swf file layout is:
Figure BDA00002070627700041
Wherein first three byte of swf file is leader will, and version number is a byte, and file size is four bytes, calculates the position at frame frequency place by the wide high rectangular configuration of stage.
By resolving the file layout of swf, find the position of frame frequency, revise the frame frequency number.
The wide height of described stage is broadcast width and the height of frame frequency.
Compression module, the new swf compressing file that is used for generating becomes compressed file, and is kept under the local directory, when the user need to need to play the swf file, directly calls the new swf file of production from local directory.
The present invention carries out the operation of batch processing modification frame frequency by the swf file that allows the user that needs are revised frame frequency, has improved efficient and has reduced intractability, reaches quick, easy purpose.
More than by the detailed description of concrete and preferred embodiment the present invention; but those skilled in the art should be understood that; the present invention is not limited to the above embodiment; within the spirit and principles in the present invention all; any modification of doing, be equal to replacement etc., all should be included within protection scope of the present invention.

Claims (10)

1. the method for a swf files in batch modification frame frequency is characterized in that, comprising:
S1 revises the former swf File Upload of frame frequency to server with needs;
S2, described server reads described former swf file with binary stream;
S3, the file header of the described former swf file of described server parses is judged whether compressed file of described former swf file according to the file header of the described former swf file of resolving, if so, then the described former swf file of decompress(ion) is carried out S4; If not, directly carry out S4;
S4 resolves described former swf file frame frequency number, replaces in batches the frame frequency number of described former swf file with new frame frequency number;
S5 again compresses and is saved in local directory replacing swf file behind the frame frequency.
2. swf files in batch according to claim 1 is revised the method for frame frequency, it is characterized in that, the file header of described former swf file begins with three identifiers, and described three identifiers are that 0x46,0x57 and 0x53 or described three identifiers are 0x46,0x57 and 0x43.
3. swf files in batch according to claim 1 and 2 is revised the method for frame frequency, it is characterized in that, the described former swf file of judgement described in the described S3 is compressed file whether, be specially: if three identifiers of the file header of former swf file are 0x46,0x57 and 0x53, then be compressed file not; If three identifiers of the file header of former swf file are 0x46,0x57 and 0x43, then are compressed file.
4. swf files in batch according to claim 1 is revised the method for frame frequency, it is characterized in that, the frame frequency number that the usefulness described in the described S4 is new is replaced the frame frequency number of described former swf file, is specially: by resolving former swf file layout, determine the frame frequency position, revise the frame frequency number.
5. swf files in batch according to claim 4 is revised the method for frame frequency, it is characterized in that, the method for described definite frame frequency position is specially, and calculates the position at frame frequency place by the wide high rectangular configuration of stage.
6. the device of a swf files in batch modification frame frequency is characterized in that, comprising:
Upper transmission module is used for former swf File Upload to the batch processing server;
Described batch processing server is used for the described former swf file that receives is carried out the processing of batch modification frame frequency, replaces the frame frequency book of former swf file with new frame frequency number, generates new swf file;
Memory module, the new swf file that is used for generating is saved in local directory.
7. swf files in batch according to claim 6 is revised the device of frame frequency, it is characterized in that, described batch processing server also comprises:
Receiver module is used for receiving the former swf file that the user uploads;
Judge module is used for judging whether described former swf file is compressed file;
Decompress files is used for described judge module is judged as the described former swf file decompression of non-decompress files;
Parsing module, the form for resolving described former swf file generates new swf file;
Compression module, the new swf compressing file that is used for generating becomes compressed file.
8. swf files in batch according to claim 7 is revised the device of frame frequency, it is characterized in that, described receiver module receives the former swf file that the user uploads with the binary stream form.
9. swf files in batch according to claim 7 is revised the device of frame frequency, it is characterized in that, described judge module is used for judging whether described former swf file is compressed file, be specially: three forms of identifier judging the file header of former swf file, if three identifiers of the file header of former swf file are 0x46,0x57 and 0x53, then be compressed file not; If three identifiers of the file header of former swf file are 0x46,0x57 and 0x43, then are compressed file.
10. swf files in batch according to claim 7 is revised the device of frame frequency, it is characterized in that, described parsing module is used for resolving the form of former swf file, is specially: determine the frame frequency position, revise the frame frequency number.
CN201210314133.7A 2012-08-29 2012-08-29 A kind of method of swf files in batch amendment frame frequency Active CN102902525B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210314133.7A CN102902525B (en) 2012-08-29 2012-08-29 A kind of method of swf files in batch amendment frame frequency

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210314133.7A CN102902525B (en) 2012-08-29 2012-08-29 A kind of method of swf files in batch amendment frame frequency

Publications (2)

Publication Number Publication Date
CN102902525A true CN102902525A (en) 2013-01-30
CN102902525B CN102902525B (en) 2016-08-03

Family

ID=47574772

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210314133.7A Active CN102902525B (en) 2012-08-29 2012-08-29 A kind of method of swf files in batch amendment frame frequency

Country Status (1)

Country Link
CN (1) CN102902525B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103235733A (en) * 2013-04-22 2013-08-07 四三九九网络股份有限公司 Method and device for parsing flash mini-game into byte code
CN103761006A (en) * 2014-01-17 2014-04-30 桂林医学院 Modifiable medical digital specimen three-dimensional demonstration system
CN106919656A (en) * 2017-01-25 2017-07-04 百度在线网络技术(北京)有限公司 The generation method and device of self-defined compressed file

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110131548A1 (en) * 2005-03-11 2011-06-02 Aptana Incorporated System And Method For Creating Target Byte Code
CN102368247A (en) * 2011-09-16 2012-03-07 杭州典能科技有限公司 Method for executing SWF (Small Web Format) file on handheld terminal

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110131548A1 (en) * 2005-03-11 2011-06-02 Aptana Incorporated System And Method For Creating Target Byte Code
CN102368247A (en) * 2011-09-16 2012-03-07 杭州典能科技有限公司 Method for executing SWF (Small Web Format) file on handheld terminal

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
崔胜: "运用JavaBean实现多文件上传", 《科协论坛(下半月) 》, no. 4, 25 April 2007 (2007-04-25), pages 221 *
鲁云飞等: "基于MFC的SWF动画文件解析设计", 《微型机与应用》, vol. 30, no. 17, 10 September 2011 (2011-09-10), pages 40 - 43 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103235733A (en) * 2013-04-22 2013-08-07 四三九九网络股份有限公司 Method and device for parsing flash mini-game into byte code
CN103235733B (en) * 2013-04-22 2015-12-02 四三九九网络股份有限公司 A kind of batch resolves the method and apparatus that flash trivial games is byte code
CN103761006A (en) * 2014-01-17 2014-04-30 桂林医学院 Modifiable medical digital specimen three-dimensional demonstration system
CN106919656A (en) * 2017-01-25 2017-07-04 百度在线网络技术(北京)有限公司 The generation method and device of self-defined compressed file

Also Published As

Publication number Publication date
CN102902525B (en) 2016-08-03

Similar Documents

Publication Publication Date Title
CN104540000B (en) The generation method and terminal of a kind of dynamic thumbnail
CN105025319B (en) A kind of video pushing method and device
CN102841901A (en) Web page display method and device
CN103593196A (en) Page layout self-adaptation method and device
CN103531218B (en) A kind of online multimedia file editing method and system
CN104581171A (en) Method and device for playing videos on browser as well as mobile terminal
CN106776677A (en) Document conversion method, device and document transmission system
CN104426896A (en) Method and device for producing topic pages
CN112035706A (en) Encoding method, decoding method, computer device, and readable storage medium
CN105677259A (en) Method for storing file in mobile terminal and mobile terminal
CN103297729A (en) Video processing method and device
CN102902525A (en) Method and device for modifying frame frequency of small web format (swf) files in batches
CN112487763A (en) SVG-based OFD file online display method, server side and system
US20110202509A1 (en) Efficient extraction and compression of data
CN102883232B (en) Method for adding watermarks in swf documents in batches and device thereof
US9432489B2 (en) Systems and methods for processing encoded data streams
CN113873013B (en) Offline package reorganization method and system
CN102821322A (en) Display apparatus having virtual machine and method of controlling the same
CN105740298A (en) File processing method and apparatus, and server-side equipment
CN103138871A (en) Server data processing system and method of application program of mobile communication system
CN103780656A (en) Configuration-based settable and reusable mobile monitoring system
CN105704215B (en) Shared file system and corresponding document sending method and device
CN104980817A (en) Video stream frame extraction method and device
CN102866882A (en) Media file playing method under resource-constrained condition
CN103139757B (en) A kind of data transmission system of application program for mobile terminal is unified method

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant