var Bytes: TBytes; Stream: TBytesStream; begin with System.NetEncoding.TBase64Encoding.Create do try Bytes := Decode(System.IOUtils.TFile.ReadAllBytes('video.txt')); finally Free; end; Stream := TBytesStream.Create(Bytes); try Stream.SaveToFile('video.mp4'); finally FreeAndNil(Stream); end; end;