PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV Mobile 2024 → Video Gravar
Video Gravar
Débuté par adrianoboller, 24 nov. 2014 12:47 - Aucune réponse
Membre enregistré
3 655 messages
Popularité : +175 (223 votes)
Posté le 24 novembre 2014 - 12:47
Procedure CAM_VideoGravar(LOCAL ArquivoLocal,...
LOCAL Extensao,...
LOCAL Ambiente,...
LOCAL Crypto,...
LOCAL OpcaoEscolha,...
LOCAL CodigoArquivo,...
LOCAL CodOs,...
LOCAL CodOsItem,...
LOCAL NomeArquivo,...
LOCAL Descricao,...
LOCAL VideoFoto,...
LOCAL TempoSegundos,...
LOCAL FPS,...
LOCAL DebugSN)

//Nao usados
Ambiente = Ambiente
Crypto = Crypto
OpcaoEscolha = OpcaoEscolha
CodigoArquivo = CodigoArquivo
CodOs = CodOs
CodOsItem = CodOsItem
NomeArquivo = NomeArquivo
Descricao = Descricao
VideoFoto = VideoFoto

IF gsDebugSN = "S"
DebugSN="S"
END

// Save the video sequence currently broadcasted
// in the "CAM_Camera" control as a segundos AVI

ResVideoBck is boolean = False

Arquivo = ""

gloGravacaoIniciada = 1

IF fDirectoryExist(gsAppDir) = False THEN
fMakeDir(gsAppDir)
END

IF fDirectoryExist(gsDirTempPhotos) = False THEN
fMakeDir(gsDirTempPhotos)
END

IF DebugSN = "S" THEN
NextTitle("Os")
Info("iniciando a gravação!...")
END

IF InSimulatorMode() = False THEN

//VALIDA CAMINHO
nTamanho is int = Length(ArquivoLocal)
IF Middle(ArquivoLocal,1,1) <> "/" THEN
ArquivoLocal = "/" + ArquivoLocal
END
IF Middle(ArquivoLocal,nTamanho,1) <> "/" THEN
ArquivoLocal = ArquivoLocal + "/"
END
IF Middle(Extensao,1,1) <> "." THEN
Extensao = "." + Extensao
END
IF Extensao = "" OR Extensao = ".jpg" THEN
Extensao = ".avi"
END

//CRIA DIRETORIO
IF fDirectoryExist(ArquivoLocal) = False
fMakeDir(ArquivoLocal)
END

//APAGA ARQUIVO
Arquivo = ArquivoLocal + "video" + Extensao
fDelete(Arquivo)

//GERA VIDEO
IF GloSom = "Ativado"
Sound("camera.wav",soundDefault)
END

IF INIRead("Camera","TipoTela","",AutorunPath) <> "FullScreen" THEN

ResVideoBck = VideoCapture(WIN_Camera_Desenvolvimento.CAM_Camera,...
Arquivo,...
viVideoCapture,...
TempoSegundos,...
FPS,
True)

//VERIFICA ERROS
ExecuteProcess(WIN_Camera_Desenvolvimento.BTN_Stop,trtClick)
IF ResVideoBck = False OR ErrorOccurred = True THEN
IF DebugSN = "S"
Error(ErrorInfo())
END
ELSE
ExecuteProcess(WIN_Camera_Desenvolvimento.BTN_Play,trtClick)
END

ELSE IF INIRead("Camera","TipoTela","",AutorunPath) = "FullScreen" THEN

ResVideoBck = VideoCapture(WIN_Camera_FullScreen.CAM_Camera,...
Arquivo,...
viVideoCapture,...
TempoSegundos,...
FPS,
True)

//VERIFICA ERROS
ExecuteProcess(WIN_Camera_FullScreen.BTN_Stop,trtClick)
IF ResVideoBck = False OR ErrorOccurred = True THEN
IF DebugSN = "S"
Error(ErrorInfo())
END
ELSE
ExecuteProcess(WIN_Camera_FullScreen.BTN_Play,trtClick)
END

END

ELSE
NextTitle("Os")
Info("Modo Simulador")
END