How to write flv from h264 frame byte data?

729 views Asked by At

I've got a capture card that captures HDMI source, the SDK of this card support a function that will return a pointer to H.264 frame pbFrame and frame_info pbFrameInfo.

The SDK support only MP4 files, but the recorded file is very important and it is not allowed to lose it in any situation so I need FLV instead of MP4.

So is there any way to store FLV File using the H.264 frame and frame_info

More Info:

  • Resolution = 1920 x 1080
  • Frame duration = 381000
  • This is a snapshot of frame and frame_info converted to hex, frame not complete because of it huge to paste here :

Frame 1

frame_info 01000000cccccccc718401000000000071840100000000000000000000000000

frame 0000000109100000000127640032ac2b300f0044fcb80880000003008000001a70200005b8d800005b8d85ef7c1da1c326800000000128ee3cb000000001060007815f900000030040010700003c00000300048000000125888023fff39c85543f1e0187a9af7c227549ca46a5e974c4d5f565be125d1f7d2f69ff55b7b40a18cebeb3dbaddb7cc612d8929147db0bc40315e9c27e5dba105adf8e2bb73013e9c98367ba34566f99cca8dfd65a70db98a015c2514c497a3bda07f538c60c6ae3ba0a87d201a7d56e3f2a72620266e51786c79240db3c0e5f5963356a8412b8f59c21b07e49b178a0d029eecb28be4e934d08f5c2205ea4dfc58748b0c2bac87b87ac658283eb89d2b5d4e50ddc088ec98a73e428f2481a35f7d635fc4a023cd226e07ce50333d16cbfd9887fcc9b7bd5c7be7ef8cf23beab6373d0409ff46a64de1e642bec5afb5da1bce340da837f9803ac1f7e0ed749650c9a012d1cd625e9249a57ae49f726e71e04d74d34662716c9dfda4d0477c38bef271b7c1304845e851dd6a42e095522bab7daba3b90a45e038e24d7da58733cdf0fff939c5b3472e6d8950130662fcf7ec29cb6a464864d08e5f5822f2ce08b7c915fa8de5aea9b54fec9502a81d933717d1c02cc080a14097cdd361baea4d35f212f0569bcb4576a9a3898fa87abda5e90dca709eeefbaeed6ca72476b0fdc47c53ca1b45ba9fe65a17bfcab3be843282a04cf7825f200aec8e0dc37028b3ec1315f4913c526276c7e095dc00ec56b409a7b2abbb693110d9f88503d65b9e80380910e39d8f1786a44aa78433bad9159928cd81ae6064a233ed72d34cbc8d60f0ca736185752fa2a8acf5a0c8010bbed8099fdfbcb106e2b56af4503d990aac9aaeed07c101d95fe3c78ff08f690cd78d7930779094f82a35b66a7669f3b0e51359782ea08057c957da2d631e296b13578f9d0df689ed6197569aa40ecb34898d5824ce029e04085d8618cdf7d4f43d188f8c6af3a8506ded87754728bb8f0d8ecf1d74574a576bc0705bf165d6f145b5c2c041a28ff949408cd4d7856ab75844e84ae50d5e6c3366aa8a2eaea2609e6ec4305df23b327186851ce433942e59ad0f66e963ec60d01bb1b0ee62e6076d992f9b20581e866f20ed820c5c0d8997f121ca80585807ee7f996c620566c7441b4bf0f01f1ef8bf82b718d574c190256ff3be1a85ec4140a8a3f1edf4a33e84d1e853f893d8a037bdb6f13ac84c6f259b2254073859a80d87ccb3b9985a2442141b70586a6fe0c232fbb5e72a1135463a1091dd3b988e264535644bba8d40d64a3458d692fad516f9c87ea2720503aa4355276248110ec62a7fdf517fa6d42d1251fa0ddda121ca01db85b3e284337878464814a99649324cdf8b31cc8e68106b599d43b216440ff480e315dd0a2e1b943a998c6377e596537e89fdf2081a0303e6cf7daef6e49e3825d820436fd9255b954d83cf25b77b2bf2921cb76183179420d65bdf761b23af78197e367c8d9b83efebe82e1cadac6fbb71a0816aae44facbf40927df2ee522fdca9521652b2d62558211bb6a53bcfdad637944d3d7e0a2acd757fc77c672c1267f5480f8c9e4 .... etc

Frame 2

frame_info 00000000cccccccc0c770100000000000c770100000000000000000000000000

frame 0000000109300000000128ee3cb00000000106010700003a000003000480000001219a3b29ff251f6b4307509f0d989d9f989718cdb7260bb95e320d9407345df3de862adef3ba273933c4a9d136d4ac3f97ad5d96c6cb45811f7f8ffbfee76b1e54eedc32dfe54432eff1acca6ef8d81fc2ae66663a2273ce3c7aa98f453a4316d651b4e4629fa2c4b7df895491bbd6154b3d0dde75779bdb4eb8aa223d21c401c390b13155596466ec83e643d100b18a745dde1a59cae75665c7017e84f7091e518453c0b7b38fa0376068e50e9ea4da4dacb8b1108f32e04afebbf76180e457c5eb90b0c81f665735cab1d6dc860ffd94d7b9e8616dfb79aeac6a02d423c6e2b0429d9a64ea899eaafeab02aa2cbbefc50617ea222a731e5d1dd8cbe1d92c0097776253f97db1f22950e9ebee3bd4f82f47a8717bae34558522959387a5e44ac18600350fc67446c21d8c794f337d77a6fcc2c685ab546d51108f23f7533cffcbb808d1116b44c995ffa34993f1f951005907f2d4bd94e25c700282e085ecc7e9156ae9c060e16d8a973366e0dc143b38e4b1f247e0664f10cbf934d49d16eefb22cf6715e882c119fefe898b7309c7ce5c752ec2471751ce1de42cc1d08d3104219b3b2e6904d27ef4466f47bfee06f51830ff4ad61bd1895e8666eb8cd4f8bc040e3953c077da255f475128b6dec97552719b9ad6d649199e6d757dc2de67eae481c3958cbd82fd71f6e0d3a6552fae6f98a47a91eee8678653984c21294496690fa95c50fea2196af00e6882a995c9ab30e0853da06b0039e8ce0e22b94b7d51c58454a4adfdbfdf5cd50fded4f8859edcf12fdb6b6308a633a85bcef66f5a45f842c6f5f2f68ff88cc519ecacc5c52907694a9ac79cd2e49b2cc248357190901f91e2aea2642b32c6039589061c78735f6bd378b31d1751dc4112aa48e934b9114c75a15f548a7c6e7a5f41a7d0fb2f7b7f1e472e8d159238426da9b3909e3100d2e3f213df7167d17caf12f4e34771b7e95d987e267351cff461f4 .... etc

Frame 3

frame_info 00000000ccccccccd691010000000000d6910100000000000000000000000000

frame 0000000109300000000128ee3cb00000000106010700000302000003000480000001219a023f50412166342051000cf461669d028ca88a7b5d4ea2b199d42a448806e7efc39b27bf678be058061f3b0559b683699173d709c8667028c4a3929a3a5a61c772faee300bbabfcbe8a511bc6d2c0e617db9edeb64cf62e1770491aab49ad213da7017e2fdab1527767cb58585eabdb7011fe8e1245caf8a65a2a3bff9390f871bf141db99820936eeaad5c705434dfc2ec273776c3a65fc115432867d171a43681e55c89b6039c3e8d8e22124629b71432b1d9b99a4afd094aeab121aba7cc4edf8fa34c8e1871b8b3c82438ece2024c1832e76600622f0829d9826be6727d5751c005ee6bd0fb626df426aab54c672eff36e357af8c1011ea573cc8cb743fa089ca73d65d5551362dd3f5cb7fe71039e7cb2c2afd43477c3eeba89a96b6b95a0357a6cca97f12b798dba47b90241f8f05f26a053920df20e9f4059f38ddaad7e8b55747dcdf2aadab61e1327ed829eceb74f744de3c8d60bf9de416e76f501366638a4fdeb8b3900b88d0dbfdf994b3ed227a8f17b795949e272cf601e5c3dac630499dd86d2b22a4df2ab7e071236155158dd2c0156fb556c94ac04ebca725eb8539be68c6db80e548b0f557e3d045233b36c5d375e2a7d03db787b697c2b15f97e1cd579e38ce42221afdc0fafc0790a1e01f54ea9a40397d72c99dac3780bff781f0702b1a5631fc8898a2b8130a80f0727d24c3da8 ... etc

Edit

  • I've written a row file that contains the frames as is arrived you can see the file here
  • An FLV file that created from the raw file above here
  • A 2 sec MP4 file here.
0

There are 0 answers