CN117998045A - Method and device for transmitting multimedia file, electronic equipment and storage medium - Google Patents

Method and device for transmitting multimedia file, electronic equipment and storage medium Download PDF

Info

Publication number
CN117998045A
CN117998045A CN202211371802.4A CN202211371802A CN117998045A CN 117998045 A CN117998045 A CN 117998045A CN 202211371802 A CN202211371802 A CN 202211371802A CN 117998045 A CN117998045 A CN 117998045A
Authority
CN
China
Prior art keywords
multimedia
video
field
video data
determining
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.)
Pending
Application number
CN202211371802.4A
Other languages
Chinese (zh)
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.)
Zhejiang Uniview Technologies Co Ltd
Original Assignee
Zhejiang Uniview Technologies 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 Zhejiang Uniview Technologies Co Ltd filed Critical Zhejiang Uniview Technologies Co Ltd
Priority to CN202211371802.4A priority Critical patent/CN117998045A/en
Publication of CN117998045A publication Critical patent/CN117998045A/en
Pending legal-status Critical Current

Links

Landscapes

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

Abstract

The invention provides a transmission method, a device, electronic equipment and a storage medium of a multimedia file, and relates to the technical field of video transmission, wherein the method comprises the following steps: determining a replacement memory in video equipment, wherein the replacement memory is used for storing multimedia subfiles; generating multimedia subfiles matched with the size of the replacement memory according to the field sequence of the multimedia files based on video data in the replacement memory, wherein the video data are stored in a non-file system format in the video equipment; transmitting the multimedia subfiles to a target device; and repeatedly generating the multimedia subfiles, and transmitting until the transmission of the multimedia files is completed. The invention can realize the transmission of video recording files on the small-memory video recording equipment.

Description

Method and device for transmitting multimedia file, electronic equipment and storage medium
Technical Field
The present invention relates to the field of video transmission technologies, and in particular, to a method and apparatus for transmitting a multimedia file, an electronic device, and a storage medium.
Background
In the field of video monitoring, video recording files are generally transmitted by using MP4 (MPEG-4) format files, that is, the video recording device imports the generated MP4 files into a memory and transmits the MP4 files to a target device through a network, so that various video playing software in the target device can play the received video recording files conveniently.
In the prior art, video recording files are usually stored in a hard disk of an embedded device such as a video recorder in a streaming media video GOP (Group of Pictures) frame group mode, and before transmission, the video recording files are required to be converted into complete MP4 files, and the complete MP4 files are imported into a memory of the video recording device for transmission. However, the complete MP4 file occupies a relatively large memory, and in case of insufficient memory of the embedded device such as the video recorder, the transmission of the MP4 file cannot be completed, so how to transmit the video file on the small memory video recording device in a network transmission manner is a technical problem to be solved.
Disclosure of Invention
The invention provides a method, a device, electronic equipment and a storage medium for transmitting multimedia files, which are used for solving the defect that MP4 files occupy a large memory in the prior art and realizing the transmission of video recording files on small memory video recording equipment.
The invention provides a transmission method of a multimedia file, which comprises the following steps:
determining a replacement memory in video equipment, wherein the replacement memory is used for storing multimedia subfiles;
generating multimedia subfiles matched with the size of the replacement memory according to the field sequence of the multimedia files based on video data in the replacement memory, wherein the video data are stored in a non-file system format in the video equipment;
transmitting the multimedia subfiles to a target device;
and repeatedly generating the multimedia subfiles, and transmitting until the transmission of the multimedia files is completed.
According to the method for transmitting the multimedia file provided by the invention, the method for determining the replacement memory in the video equipment comprises the following steps:
determining a storage space corresponding to the video data;
under the condition that the video equipment runs at full load, determining the maximum available memory;
and determining the minimum value of the storage space and the maximum available memory as a replacement memory.
According to the method for transmitting a multimedia file provided by the invention, the determining the storage space corresponding to the video data includes:
Based on the video data, determining video duration, code rate and I frame data corresponding to the video data;
And determining a storage space corresponding to the video data based on the video duration, the code rate and the I frame data.
According to the method for transmitting the multimedia file provided by the invention, the method for generating the multimedia subfiles matched with the size of the replacing memory according to the field sequence of the multimedia file in the replacing memory based on video data comprises the following steps:
creating a blank subfile in the replacement memory;
determining at least one target field corresponding to the blank subfile based on the field sequence of the multimedia file or the field sequence of the multimedia file and the last frame data of the last multimedia file;
And determining video information corresponding to the target field based on the video data, and continuously writing the video information into the blank subfile until the blank subfile is stopped writing under the condition that the size of the blank subfile is equal to the size of the replacement memory, so as to obtain the multimedia subfile.
According to the transmission method of the multimedia file provided by the invention, the target field comprises a header field, a video data field and an index field;
the determining, based on the video data, video information corresponding to the target field includes:
When the target field comprises a header field, determining a starting offset, a file specification and a file type corresponding to the video data as video information corresponding to the header field;
When the target field comprises a video data field, determining the video data as video information corresponding to the video data field;
And under the condition that the target field comprises an index field, determining index information corresponding to the video data as video information corresponding to the index field.
According to the method for transmitting the multimedia file provided by the invention, the method further comprises the following steps:
Determining the file specification of the header field and the storage space corresponding to the video data which are transmitted under the condition that the target field comprises the video data field and the video information corresponding to the video data field is completely written into the blank subfiles;
And writing preset characters into the blank subfiles under the condition that the storage space is smaller than the file specification until the sum of the storage space and the data storage quantity of the preset characters is equal to the file specification.
The invention also provides a device for transmitting the multimedia file, which comprises:
the determining module is used for determining a replacement memory in the video equipment, wherein the replacement memory is used for storing the multimedia subfiles;
The generation module is used for generating multimedia subfiles matched with the size of the replacement memory according to the field sequence of the multimedia files in the replacement memory based on video data, wherein the video data are stored in a non-file system format in the video equipment;
the first transmission module is used for transmitting the multimedia subfiles to target equipment;
And the second transmission module is used for repeatedly generating the multimedia subfiles and transmitting until the transmission of the multimedia files is finished.
The invention also provides an electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the method for transmitting the multimedia file according to any one of the above when executing the program.
The present invention also provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements a method of transmitting a multimedia file as described in any of the above.
The invention also provides a computer program product comprising a computer program which when executed by a processor implements a method of transmitting a multimedia file as described in any one of the above.
According to the method, the device, the electronic equipment and the storage medium for transmitting the multimedia file, the replacement memory is determined in the video equipment with the small memory, the multimedia subfiles matched with the size of the replacement memory are sequentially generated according to the field sequence in the multimedia file based on the video data, and each generated multimedia subfile, namely the generated multimedia subfiles are transmitted until the transmission of the complete multimedia file is completed, so that only the memory with the fixed size in the video equipment is occupied in the transmission process of the multi-generated segment type multimedia subfiles, the resource occupation of the video equipment with the generation of the complete multimedia file is greatly reduced, the transmission capacity and the transmission efficiency of the video equipment with the small memory for transmitting the multimedia file are improved, and the transmission of the multimedia file which cannot be completed due to the insufficient memory of the video equipment is avoided.
Drawings
In order to more clearly illustrate the invention or the technical solutions of the prior art, the following description will briefly explain the drawings used in the embodiments or the description of the prior art, and it is obvious that the drawings in the following description are some embodiments of the invention, and other drawings can be obtained according to the drawings without inventive effort for a person skilled in the art.
Fig. 1 is a flow chart of a method for transmitting a multimedia file according to the present invention;
FIG. 2 is a schematic diagram of an MP4 file according to the present invention;
FIG. 3 is a schematic diagram of a flow for transmitting MP4 files according to the present invention;
FIG. 4 is a schematic diagram of an MP4 file according to the present invention;
FIG. 5 is a second schematic diagram of an MP4 file according to the present invention;
Fig. 6 is a schematic structural diagram of a multimedia file transmission device according to the present invention;
fig. 7 is a schematic structural diagram of an electronic device provided by the present invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the present invention more apparent, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings, and it is apparent that the described embodiments are some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
Aiming at the problem that the transmission of the multimedia file cannot be completed due to insufficient memory of the small memory video equipment in the prior art, the invention provides a transmission method of the multimedia file, and fig. 1 is a flow chart of the transmission method of the multimedia file, as shown in fig. 1, the method comprises the following steps:
step 110, determining a replacement memory in video equipment, wherein the replacement memory is used for storing multimedia subfiles;
Step 120, generating multimedia subfiles matched with the size of the replacement memory according to the field sequence of the multimedia files based on video data in the replacement memory, wherein the video data are stored in a non-file system format in the video equipment;
step 130, transmitting the multimedia subfiles to a target device;
and 140, repeatedly generating the multimedia subfiles, and transmitting until the transmission of the multimedia files is completed.
Specifically, since the video recording data in the non-file system format is stored in the hard disk of the video recording device, before the video recording data is transmitted, the video recording data stored in the non-file system format is first converted into a multimedia file and then imported into the memory of the video recording device, so that the transmission of the multimedia file cannot be completed because the size of the converted multimedia file is often larger than that of the memory of the small memory video recording device. Therefore, in the embodiment of the present invention, a replacement memory is applied in a small-memory video device, and compared with directly generating a complete multimedia file, in the embodiment of the present invention, according to the field sequence of the multimedia file, a multimedia sub-file matched with the replacement memory is continuously generated in the replacement memory, where the multimedia sub-file is a segment in the complete multimedia file and is transmitted to a target device through a network, then the replacement memory is emptied, and according to the field sequence, the multimedia sub-file is generated again and is transmitted to the target device through the replacement memory, and the generation and transmission of the multimedia sub-file are repeated until the multimedia file is completely transmitted to the target device and then stopped. The method comprises the steps of equally dividing a complete multimedia file by taking a replacement memory as a reference to obtain a plurality of fragments, and transmitting the fragments to target equipment through the replacement memory when one fragment is generated.
Alternatively, the video recording device may be a small-memory embedded video recording device. The multimedia file may be an MP4 file.
Optionally, the above-mentioned non-file system format may be a streaming video GOP (Group of Pictures) frame group mode, and the GOP refers to a video frame group, that is, each GOP is a group of consecutive pictures, and the GOP frame group data may include a plurality of frame packets, and at the same time, the first picture of the GOP must be an I-frame, so that the GOP can realize independent decoding without referring to other pictures.
Optionally, the video data may be an alarm video, or a pre-alarm video, an in-alarm video, and a post-alarm video of the alarm video, or may be a scheduled video of a preset duration.
Optionally, the transmission manner of the multimedia subfiles may be FTP (FILE TRANSFER Protocol) based on FTP (file transfer Protocol) Protocol.
Optionally, the determining the replacement memory in the video recording device includes:
determining a storage space corresponding to the video data;
under the condition that the video equipment runs at full load, determining the maximum available memory;
and determining the minimum value of the storage space and the maximum available memory as a replacement memory.
Specifically, in the embodiment of the present invention, by determining the storage space P of video data to be transmitted and the maximum available memory M1 of the video device in the full-load operation state, and determining the minimum value of the two as the replacement memory M, so that the determined replacement memory M can satisfy the memory of the video device, if the storage space P of the video data is greater than the maximum available memory M1 of the video device, the maximum available memory M1 is determined as the replacement space, and after dividing the multimedia file after the video data is converted, the replacement space is utilized for transmission, that is, the converted multimedia file occupies only the replacement memory M for transmission, so as to realize the transmission of the multimedia file by the small-memory video device; if the storage space P of the video data is smaller than the maximum available memory M1 of the video device, the storage space P is determined as the replacement memory M, so that the video data can be directly converted into a complete multimedia file, and the complete multimedia file is transmitted through the replacement memory M.
Optionally, the determining the storage space corresponding to the video data includes:
Based on the video data, determining video duration, code rate and I frame data corresponding to the video data;
And determining a storage space corresponding to the video data based on the video duration, the code rate and the I frame data.
Specifically, the size of the storage space P is further determined by determining the recording duration T, the code rate and the I-frame data of the recording data, where the determination of the storage space P is shown in formula (1), and formula (1) is as follows:
P=t code rate+v
Wherein, T represents the video recording time of video recording data, the code rate is the sampling rate of the video recording data, and V represents the size of one I frame data.
Optionally, generating, in the replacement memory, a multimedia sub-file matching the size of the replacement memory according to a field sequence of the multimedia file based on video data, including:
creating a blank subfile in the replacement memory;
determining at least one target field corresponding to the blank subfile based on the field sequence of the multimedia file or the field sequence of the multimedia file and the last frame data of the last multimedia file;
And determining video information corresponding to the target field based on the video data, and continuously writing the video information into the blank subfile until the blank subfile is stopped writing under the condition that the size of the blank subfile is equal to the size of the replacement memory, so as to obtain the multimedia subfile.
Specifically, before determining the multimedia subfile, firstly creating a blank subfile in the replacement memory, wherein the size of the blank subfile is smaller than or equal to the replacement memory M, if the blank subfile is determined for the first time, determining a first field as a target field according to the field sequence of the multimedia file, determining video information corresponding to the target field, and continuously writing the video information into the generated blank subfile, if the size of the video information corresponding to the first field is smaller than the replacement memory, continuously determining a second field, and writing part of the video information corresponding to the second field into the blank subfile until the size of the blank subfile is equal to the replacement memory, thereby obtaining the multimedia subfile; if the multimedia sub-file is not determined for the first time, the corresponding target field can be determined according to the field sequence of the multimedia file and the last frame data of the last multimedia file, and the video information corresponding to the target field is written into the blank sub-file.
Optionally, the target field corresponding to each multimedia sub-file may be one field or two fields, that is, the multimedia sub-file may only transmit video information corresponding to one field, or may perform splice transmission on video information corresponding to two fields.
Optionally, the target field includes a header field, a video data field, and an index field;
the determining, based on the video data, video information corresponding to the target field includes:
When the target field comprises a header field, determining a starting offset, a file specification and a file type corresponding to the video data as video information corresponding to the header field;
When the target field comprises a video data field, determining the video data as video information corresponding to the video data field;
And under the condition that the target field comprises an index field, determining index information corresponding to the video data as video information corresponding to the index field.
Specifically, in the embodiment of the present invention, the video information corresponding to each target field is different, and if the target field includes a header field, the starting offset, the file specification and the file type corresponding to the video data are used as the video information; if the target field comprises a video data field, taking video data as video information, and reading the video data from a hard disk of video equipment every time and writing the video data into a blank subfile; if the target field comprises an index field, reading a hard disk storage position corresponding to the video data, and taking the obtained index information of each frame of picture as video information.
Optionally, the video information corresponding to the video data field needs to be consistent with the video information corresponding to the index field, and the file specification in the header field needs to be consistent with the video information corresponding to the video data field.
Optionally, the method further comprises:
Determining the file specification of the header field and the storage space corresponding to the video data which are transmitted under the condition that the target field comprises the video data field and the video information corresponding to the video data field is completely written into the blank subfiles;
And writing preset characters into the blank subfiles under the condition that the storage space is smaller than the file specification until the sum of the storage space and the data storage quantity of the preset characters is equal to the file specification.
Specifically, in the multimedia file, the file specification in the header field needs to be consistent with the video information of the corresponding video data field, so in the embodiment of the invention, after the file specification has been determined and the video information corresponding to the file specification is sent to the target device, the size of the video information of the video data field to be subsequently transmitted needs to be consistent with the file specification, if the video information corresponding to the video data field has been completely written into the blank subfile, but the sum of the video information corresponding to the video data field which is already transmitted and not transmitted is still smaller than the file specification, the preset character needs to be continuously supplemented after the video information corresponding to the video data field until the sum of the storage space corresponding to the video data and the data storage space of the preset character is equal to the file specification, so that the target device can conveniently play after receiving all the multimedia subfiles.
Optionally, the preset character may be 0, that is, all 0 data is added after the video data, so that the size of the video information of the video data field transmitted later is consistent with the file specification of the header field.
Optionally, if the multimedia file is an MP4 file, the GOP frame group data is converted into a plurality of MP4 subfiles, and the MP4 subfiles are transmitted to the target device through the replacement memory, and the plurality of MP4 subfiles form a complete MP4 file. Fig. 2 is a schematic structural diagram of an MP4 file according to the present invention, where, as shown in fig. 2, the MP4 file includes: ftyp (File Type Box) field, moov (Movie Box) field and mdat (MEDIA DATA Box) field, the ftyp field is a header field of an MP4 file, and is used for indicating related information such as MP4 specification and version to which the file conforms, and may include: start offset, file size Box size, file type Box type. The mdat field is used to store video data, and there may be multiple ones in the MP4 file. The moov field is used to store index information of video data, and there is one and only one MP4 file, where the moov field includes, but is not limited to: mvhd (Movie Header Box) fields and trak (Track Box) fields, wherein the mvhd fields comprise the whole information of the MP4 file, such as creation time, video duration and the like; the trak field includes track-related information. Meanwhile, the field sequence of the MP4 file is as follows: ftyp field, mdat field, and moov field.
For example, fig. 3 is a schematic flow chart of transmitting an MP4 file according to the present invention, as shown in fig. 3, taking transmission of the MP4 file by FTP protocol as an example, the video data to be transmitted is an alarm video of the 1 st channel of the video recorder, the video duration is 1 minute 45 seconds, the start time is 2022, 5, 30, 20, 36 minutes 04 seconds, the end time is 2022, 5, 30, 20, 37 minutes 49 seconds, and the video data is named: d1_s20220530203604_e20220530203749.mp4, the transmission process of the alarm video includes the following steps:
1) Starting a main thread MAIN THREAD of alarm linkage uploading video data in video equipment, and estimating the storage space size of the alarm video according to the formula (1) by inquiring the code rate, video duration and I frame data of the alarm video, namely converting the size into the size of mdat field after MP4 files;
2) The main thread MAIN THREAD determines the maximum available memory in the full-load running state of the video equipment, determines the minimum value in the maximum available memory and the storage space as the size of the replacement memory, and applies for a memory in the video equipment as the replacement memory;
3) The main thread MAIN THREAD reads the alarm video and related information in the hard disk, generates an MP4 subfile matched with the size of the replacement memory according to the field sequence of the MP4 file, if the size of the replacement memory is 5M, the size of the MP4 subfile generated each time is smaller than or equal to 5M, the MP4 subfile can comprise video information corresponding to ftyp field, video information of mdat field, index information of moov field and video information spliced by two fields;
4) After generating MP4 subfiles, the main Thread MAIN THREAD creates a Sub Thread as an FTP client, and establishes FTP connection with a target device FTP server through an FTP protocol;
5) The Sub Thread starts FTP file transmission, the sum of the sizes of all MP4 Sub files transmitted is the sum of video information corresponding to the ftyp field, the mdat field and the moov field, and the FTP server is informed of the file size and the file naming of the alarm video transmitted at the time;
6) The Sub Thread continuously transmits the data of the ftyp field until the video information transmission of the ftyp field is completed, and then the control Sub Thread continuously reads the alarm video corresponding to the mdat field in the hard disk and transmits the part of data to the FTP server until the transmission is completed;
7) FIG. 4 is a schematic diagram of an MP4 file provided in the present invention, as shown in FIG. 4, if the alarm video corresponding to the mdat field is transmitted and the alarm video is consistent with the size determined by the Box size of the file specification in the ftyp field, executing step 8); FIG. 5 is a second schematic diagram of an MP4 file provided in the present invention, as shown in FIG. 5, if the alarm video corresponding to the mdat field is transmitted, but the size determined by the file size Box in the ftyp field is not reached, then the transmission of all 0 data is continued until the size determined by the file size Box in the ftyp field is reached;
8) The control Sub Thread reads the storage position information of the alarm video in the hard disk, records and updates the index information of each frame of data in the alarm video, generates an MP4 subfile corresponding to the moov field, and continuously transmits the MP4 subfile to the FTP server until the transmission of the index information corresponding to the moov field is completed.
According to the transmission method of the multimedia file, the replacement memory is determined in the video equipment with the small memory, the multimedia subfiles matched with the size of the replacement memory are sequentially generated according to the field sequence in the multimedia file based on the video data, and each generated multimedia subfile is transmitted until the transmission of the complete multimedia file is completed, so that only the memory with the fixed size in the video equipment is occupied in the transmission process of the multi-time generated segmented multimedia subfiles, the resource occupation of the video equipment for generating the complete multimedia file is greatly reduced, the transmission capacity and the transmission efficiency of the multimedia file transmitted by the video equipment with the small memory are improved, and the transmission of the multimedia file can not be completed due to the insufficient memory of the video equipment is avoided.
The transmission device of the multimedia file provided by the invention is described below, and the transmission device of the multimedia file described below and the transmission method of the multimedia file described above can be referred to correspondingly.
Fig. 6 is a schematic structural diagram of a multimedia file transmission device provided by the present invention, and as shown in fig. 6, the present invention also provides a multimedia file transmission device, where a multimedia file transmission device 600 includes: a determining module 601, a generating module 602, a first transmitting module 603 and a second transmitting module 604, wherein:
a determining module 601, configured to determine a replacement memory in a video recording device, where the replacement memory is used to store a multimedia sub-file;
A generating module 602, configured to generate, in the replacement memory, a multimedia sub-file matching the size of the replacement memory according to a field sequence of the multimedia file based on video data, where the video data is stored in the video device in a non-file system format;
a first transmission module 603, configured to transmit the multimedia subfile to a target device;
and the second transmission module 604 is configured to repeatedly generate a multimedia sub-file, and transmit the multimedia sub-file until the transmission of the multimedia file is completed.
According to the transmission device of the multimedia file, the replacement memory is determined in the video equipment with the small memory, the multimedia subfiles matched with the size of the replacement memory are sequentially generated according to the field sequence in the multimedia file based on the video data, and each generated multimedia subfile is transmitted until the transmission of the complete multimedia file is completed, so that only the memory with the fixed size in the video equipment is occupied in the transmission process of the repeatedly generated segmented multimedia subfiles, the resource occupation of the video equipment for generating the complete multimedia file is greatly reduced, the transmission capacity and the transmission efficiency of the multimedia file transmitted by the video equipment with the small memory are improved, and the transmission of the multimedia file cannot be completed due to the insufficient memory of the video equipment is avoided.
Optionally, the determining module 601 is specifically configured to:
determining a storage space corresponding to the video data;
under the condition that the video equipment runs at full load, determining the maximum available memory;
and determining the minimum value of the storage space and the maximum available memory as a replacement memory.
Optionally, the determining module 601 is specifically configured to:
the determining the storage space corresponding to the video data comprises the following steps:
Based on the video data, determining video duration, code rate and I frame data corresponding to the video data;
And determining a storage space corresponding to the video data based on the video duration, the code rate and the I frame data.
Optionally, the generating module 602 is specifically configured to:
creating a blank subfile in the replacement memory;
determining at least one target field corresponding to the blank subfile based on the field sequence of the multimedia file or the field sequence of the multimedia file and the last frame data of the last multimedia file;
And determining video information corresponding to the target field based on the video data, and continuously writing the video information into the blank subfile until the blank subfile is stopped writing under the condition that the size of the blank subfile is equal to the size of the replacement memory, so as to obtain the multimedia subfile.
Optionally, the target field includes a header field, a video data field, and an index field.
Optionally, the generating module 602 is specifically configured to:
the determining, based on the video data, video information corresponding to the target field includes:
When the target field comprises a header field, determining a starting offset, a file specification and a file type corresponding to the video data as video information corresponding to the header field;
When the target field comprises a video data field, determining the video data as video information corresponding to the video data field;
And under the condition that the target field comprises an index field, determining index information corresponding to the video data as video information corresponding to the index field.
Optionally, the generating module 602 is specifically configured to:
Determining the file specification of the header field and the storage space corresponding to the video data which are transmitted under the condition that the target field comprises the video data field and the video information corresponding to the video data field is completely written into the blank subfiles;
And writing preset characters into the blank subfiles under the condition that the storage space is smaller than the file specification until the sum of the storage space and the data storage quantity of the preset characters is equal to the file specification.
Fig. 7 is a schematic structural diagram of an electronic device according to the present invention, and as shown in fig. 7, the electronic device may include: processor 710, communication interface (Communications Interface) 720, memory 730, and communication bus 740, wherein processor 710, communication interface 720, memory 730 communicate with each other via communication bus 740. Processor 710 may invoke logic instructions in memory 730 to perform a method of transferring a multimedia file, the method comprising:
determining a replacement memory in video equipment, wherein the replacement memory is used for storing multimedia subfiles;
generating multimedia subfiles matched with the size of the replacement memory according to the field sequence of the multimedia files based on video data in the replacement memory, wherein the video data are stored in a non-file system format in the video equipment;
transmitting the multimedia subfiles to a target device;
and repeatedly generating the multimedia subfiles, and transmitting until the transmission of the multimedia files is completed.
Further, the logic instructions in the memory 730 described above may be implemented in the form of software functional units and may be stored in a computer readable storage medium when sold or used as a stand alone product. Based on this understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a usb disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
In another aspect, the present invention also provides a computer program product, the computer program product including a computer program, the computer program being storable on a non-transitory computer readable storage medium, the computer program, when executed by a processor, being capable of executing a method of transmitting a multimedia file provided by the above methods, the method comprising:
determining a replacement memory in video equipment, wherein the replacement memory is used for storing multimedia subfiles;
generating multimedia subfiles matched with the size of the replacement memory according to the field sequence of the multimedia files based on video data in the replacement memory, wherein the video data are stored in a non-file system format in the video equipment;
transmitting the multimedia subfiles to a target device;
and repeatedly generating the multimedia subfiles, and transmitting until the transmission of the multimedia files is completed.
In yet another aspect, the present invention also provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, is implemented to perform a method of transmitting a multimedia file provided by the above methods, the method comprising:
determining a replacement memory in video equipment, wherein the replacement memory is used for storing multimedia subfiles;
generating multimedia subfiles matched with the size of the replacement memory according to the field sequence of the multimedia files based on video data in the replacement memory, wherein the video data are stored in a non-file system format in the video equipment;
transmitting the multimedia subfiles to a target device;
and repeatedly generating the multimedia subfiles, and transmitting until the transmission of the multimedia files is completed.
The apparatus embodiments described above are merely illustrative, wherein the elements illustrated as separate elements may or may not be physically separate, and the elements shown as elements may or may not be physical elements, may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art will understand and implement the present invention without undue burden.
From the above description of the embodiments, it will be apparent to those skilled in the art that the embodiments may be implemented by means of software plus necessary general hardware platforms, or of course may be implemented by means of hardware. Based on this understanding, the foregoing technical solution may be embodied essentially or in a part contributing to the prior art in the form of a software product, which may be stored in a computer readable storage medium, such as ROM/RAM, a magnetic disk, an optical disk, etc., including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method described in the respective embodiments or some parts of the embodiments.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present invention, and are not limiting; although the invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims (10)

1. A method for transmitting a multimedia file, comprising:
determining a replacement memory in video equipment, wherein the replacement memory is used for storing multimedia subfiles;
generating multimedia subfiles matched with the size of the replacement memory according to the field sequence of the multimedia files based on video data in the replacement memory, wherein the video data are stored in a non-file system format in the video equipment;
transmitting the multimedia subfiles to a target device;
and repeatedly generating the multimedia subfiles, and transmitting until the transmission of the multimedia files is completed.
2. The method for transmitting a multimedia file according to claim 1, wherein determining the replacement memory in the video recording device comprises:
determining a storage space corresponding to the video data;
under the condition that the video equipment runs at full load, determining the maximum available memory;
and determining the minimum value of the storage space and the maximum available memory as a replacement memory.
3. The method for transmitting a multimedia file according to claim 2, wherein said determining a storage space corresponding to the video data comprises:
Based on the video data, determining video duration, code rate and I frame data corresponding to the video data;
And determining a storage space corresponding to the video data based on the video duration, the code rate and the I frame data.
4. A method of transmitting a multimedia file according to any one of claims 1 to 3, wherein generating, in the transposed memory, multimedia subfiles matching the size of the transposed memory in field order of the multimedia file based on video data, comprises:
creating a blank subfile in the replacement memory;
determining at least one target field corresponding to the blank subfile based on the field sequence of the multimedia file or the field sequence of the multimedia file and the last frame data of the last multimedia file;
And determining video information corresponding to the target field based on the video data, and continuously writing the video information into the blank subfile until the blank subfile is stopped writing under the condition that the size of the blank subfile is equal to the size of the replacement memory, so as to obtain the multimedia subfile.
5. The method according to claim 4, wherein the target field includes a header field, a video data field, and an index field;
the determining, based on the video data, video information corresponding to the target field includes:
When the target field comprises a header field, determining a starting offset, a file specification and a file type corresponding to the video data as video information corresponding to the header field;
When the target field comprises a video data field, determining the video data as video information corresponding to the video data field;
And under the condition that the target field comprises an index field, determining index information corresponding to the video data as video information corresponding to the index field.
6. The method of transmitting a multimedia file according to claim 4, further comprising:
Determining the file specification of the header field and the storage space corresponding to the video data which are transmitted under the condition that the target field comprises the video data field and the video information corresponding to the video data field is completely written into the blank subfiles;
And writing preset characters into the blank subfiles under the condition that the storage space is smaller than the file specification until the sum of the storage space and the data storage quantity of the preset characters is equal to the file specification.
7. A multimedia file transmission apparatus, comprising:
the determining module is used for determining a replacement memory in the video equipment, wherein the replacement memory is used for storing the multimedia subfiles;
The generation module is used for generating multimedia subfiles matched with the size of the replacement memory according to the field sequence of the multimedia files in the replacement memory based on video data, wherein the video data are stored in a non-file system format in the video equipment;
the first transmission module is used for transmitting the multimedia subfiles to target equipment;
And the second transmission module is used for repeatedly generating the multimedia subfiles and transmitting until the transmission of the multimedia files is finished.
8. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements a method of transferring a multimedia file according to any of claims 1 to 6 when executing the program.
9. A non-transitory computer readable storage medium having stored thereon a computer program, wherein the computer program when executed by a processor implements a method of transmitting a multimedia file according to any of claims 1 to 6.
10. A computer program product comprising a computer program, characterized in that the computer program, when executed by a processor, implements a method of transmission of a multimedia file according to any of claims 1 to 6.
CN202211371802.4A 2022-11-03 2022-11-03 Method and device for transmitting multimedia file, electronic equipment and storage medium Pending CN117998045A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211371802.4A CN117998045A (en) 2022-11-03 2022-11-03 Method and device for transmitting multimedia file, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211371802.4A CN117998045A (en) 2022-11-03 2022-11-03 Method and device for transmitting multimedia file, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN117998045A true CN117998045A (en) 2024-05-07

Family

ID=90896060

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211371802.4A Pending CN117998045A (en) 2022-11-03 2022-11-03 Method and device for transmitting multimedia file, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117998045A (en)

Similar Documents

Publication Publication Date Title
KR101702562B1 (en) Storage file format for multimedia streaming file, storage method and client apparatus using the same
CN107231581B (en) Method and system for video playing and streaming media playing control server
CN101867796B (en) Method and device for monitoring video
US8806048B2 (en) Method and apparatus for transmitting and receiving streaming data based on real-time streaming protocol (RTSP) session
JP2007173987A (en) Multimedia data transmission/reception system and device, or program
CN107484011B (en) Video resource decoding method and device
US11968246B2 (en) Playback mode determining method and apparatus
EP2689581A1 (en) System and method for transmitting real-time images
US10277652B2 (en) Transmission apparatus, transmission method, and program
CN112584194A (en) Video code stream pushing method and device, computer equipment and storage medium
CN111436009B (en) Real-time video stream transmission and display method and transmission and play system
CN110602515B (en) Data processing method based on block chain, server and storage medium
CN117998045A (en) Method and device for transmitting multimedia file, electronic equipment and storage medium
US20160134674A1 (en) Communication apparatus, communication method, and program
CN104092982A (en) Peer-to-peer real-time video transmission method and system
CN112449209B (en) Video storage method and device, cloud server and computer readable storage medium
EP1943804A1 (en) Method and devices for the transfer of a data flow from a data source to a data sink
US10171545B2 (en) System for transferring real-time audio/video stream
CN110636368B (en) Media playing method, system, device and storage medium
CN115250266B (en) Video processing method and device, streaming media equipment and storage on-demand system
JP2005110024A (en) Data transmitter, data transmission/reception system, and data transmission/reception method
JP2019054505A (en) Video monitoring method, server, and video monitoring system
CN115589506A (en) MP4 format audio/video file generation method, system and computer storage medium
CN105915935A (en) Video transmission control method and video transmission control device
CN117676202A (en) Audio and video transcoding playing method and audio and video transcoding playing system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination