Faster TAG avi, mkv, mp4, etc ....

Just starting out? Need help? Post your questions and find answers here.
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5349
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Faster TAG avi, mkv, mp4, etc ....

Post by Kwai chang caine »

Hello at all

I search to read/write the most faster possible a short TXT tag in a video file.
I have found and try some console exe for do that, FFMPEG, EXIFTOOL, but apparently the soft is forced to recomplile or copy each the video for adding the tag inside (Title, Subtitle, Comment, Date, etc ...) and it's really long :shock:

So i have the idea to do like the virus, put text at the end of the file, that works perfectly and more faster i think it's not possible, so i hope :D
It's just for read, not modify or save the video, because i know the video software like VLC, virtualDub etc ..., surely erase this text when it save the new video :wink:

I need your advice about this method :

Is it dangerous or safe ?
I have try several time to read with VLC, the video works perfectly and my TAG is not cleared 8)
Have you a better and more safe method ?

Code: Select all

Film1$ = "D:\Video\TheMovie.avi"

Canal = ReadFile(#PB_Any, Film1$)

If Canal
 
 TailleFichier = Lof(Canal)
 *Buffer = AllocateMemory(TailleFichier)
 Debug ReadData(Canal, *Buffer, TailleFichier)
 CloseFile(Canal) 

EndIf
 
RefDateHeure.s = FormatDate("%yy%mm%dd", Date()) + FormatDate("%hh%ii%ss", Date())
Film2$ = "D:\Video\TheMovie_" + RefDateHeure + ".avi"

Canal = CreateFile(#PB_Any, Film2$)

If Canal
 
 Debug WriteData(Canal, *Buffer, TailleFichier)
 Commentaire$ = "Hello i'm the tag at the end of the video"
 Debug WriteString(Canal, Commentaire$, #PB_Ascii)
 CloseFile(Canal)

EndIf
 
Have a good day
ImageThe happiness is a road...
Not a destination