How do you inject metadata into a f4v file? - actionscript

I was wondering how do you inject metadata into an f4v file with quepoints? I've been reading somewhere that it's either during encoding or a custom actionscript that embeds when the file runs.

An F4V file is merely a renamed MP4 file. By and large, any tools, tips and technologies that work on MP4 file will do so for F4V files.
Seeking into MP4 files is non-trivial, and much more difficult than FLV files, which I assume you are thinking about. (But maybe I am wrong?)
That said, the meta data you are after is probably already in the MP4 in the MOOV atom. (MP4 files are composed of atoms. The MOOV atom is the meta data atom.) There probably is no need to inject it. But, to get quick starts and have a player be able to seek through out a file, then you need to have the MOOV 'atom' at the front of the file. There are tools to do this on existing files, and it can be done when encoding the file.
I've never heard of AS doing any of this.

Related

Parse WRL file to X3D

Well the problem I have is that I need to transform a WRL file to a X3D xml file, but for this I can't find API's that can get code from the file.
Well first I manually saw what tags were needed for the X3D file, and then I was trying with open source software to modify it by exporting it to that file, but in some cases it doesn't work and I would like to do it by code.
view3dscene https://castle-engine.io/view3dscene.php is a part of the Castle Game engine project. view3dscene by itself is a very capable viewer of both .wrl files -- also known as VRML encoding -- and X3D files. WRL files read by view3dscene can be saved as X3D

Ignore known header of video file

i have video uncompressed .avi video files. however they come with a known 2048kb header at the beginning of the file, such that no video program (Vlc player) recognises the file as video files. can i force VLC to ignore the first 2048kb? how?
what would be the easiest way to remove this header?
Unfortunately there is no known to me way of getting vlc to use a larger "probesize" or somehow just skip to byte X.
Also unfortunately there is no known to me way to add some "camouflage" or even add an empty chunk to the front of an avi container. Next approach could be to genereate a reference movie but also no automatic usage tools available at the best of my knowledge. And as there is also no way to just "set or change" the start offset of a file, we have to copy it.
My recommendation for copying parts of files is this sourceforge project: skf
https://sourceforge.net/projects/swissfileknife/?source=typ_redirect
some examples

How to download HLS stream into a local machine?

Sometimes it is useful to download a stream into our local machine.
Reasons could be
To make a manual modification to the manifest
For getting fast access to files of a server with poor networking.
If we try to use curl or wget to download the asset which is pointed by the URL for the stream, we end up downloading a small text file. It is surely not the video asset.
So how can we download the stream itself?
The actual script which does the download is given in the link at the bottom of my answer. But before we proceed to the how-to, let's first understand the steps for downloading a stream.
Without going into too much details, the URL pointing to the stream is typically named with the m3u8 extension. That file is called the manifest of the stream and is actually a text file containing, among other things, a list of pairs: a bitrate and a corresponding URL for the matching playlist file. Here is an excerpt from a manifest file:
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=380600,CODECS="avc1.4d00c,mp4a.40.2",RESOLUTION=320x180
http://f24hls-i.akamaihd.net/hls/live/221193-b/F24_EN_LO_HLS/master_250.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=655600,CODECS="avc1.77.30,mp4a.40.2",RESOLUTION=640x360
http://f24hls-i.akamaihd.net/hls/live/221193/F24_EN_LO_HLS/master_500.m3u8
A playlist file is another text file which tell the player which TS file is to be playing on each position of the playback head.
Here is the beginning of a typical playlist file:
#EXTM3U
#EXT-X-VERSION:3
#EXT-X-TARGETDURATION:10
#EXT-X-MEDIA-SEQUENCE:303165
#EXTINF:10.000,
20170216T114458/master_500/00151/master_500_01165.ts
#EXTINF:10.000,
20170216T114458/master_500/00151/master_500_01166.ts
So after downloading the playlist file for each of the bitrates, we can start downloading the TS files required to play the stream at each of the possible bitrates.
All this is done using a quite simple and self-explaining script which I was putting in GitHub: https://github.com/ishahak/HLS_Downloader
I hope it will be useful for others.
You can simply use ffmpeg. Like this:
fmpeg -i "http://somewhere.com/video.m3u8" -c copy -bsf:a aac_adtstoasc output.mp4

how separate files from an uncompressed zlib stream

I have buffered a zlib stream in a std:vector.
I have uncompressed programmatically this stream in a new std:vector named "UncompressedZlibStream".
I know that my stream contains multiple files.
I would like to knwo how "cut" (separate) my files in the stream.
I think zlib use a separator ? but why caracter or sequence !?
Anyone have any informations about this ?
Thanks a lot,
best regards,
CrashOverHead
Zlib itself is only a compression library. It is typically only used to compress a single file. Putting multiple files into zlib requires that you use a format like tar and then compress the result. Zlib compressed tar files are pretty common in the Unix world. You may want to have a look at LibTar. If it's anything else it's likely proprietary and you're kind of on your own for how to dice the stream.

Can you add ActionScript or other code to an flv

I'm curious if it's possible for an flv file to contain code like ActionScript or if it can only contain the audio/video data for the video.
I'm specifically asking related to the security of allowing an FLV file to be uploaded a site.
Edit: assume that the contents have been validated to be a real "flv" - the question is whether the format natively supports code inside of the flv.
the question is whether the format natively supports code inside of
the flv.
To that question, the answer is no. For further security discussions, see the other answers.
FLV files are for video/audio: http://en.wikipedia.org/wiki/Flash_Video. but I can rename any executable file of course and add the .FLV extension to it. so I believe you will need to read the uploaded files and check whether they are FLV indeed.
FLV is only a video format. Like akonsu said, you should check if the file is really a FLV file, not just checking it's extension.
You should check if the file's mime type is "video/x-flv".
More info about FLV: http://osflash.org/flv

Resources