Category : encode

I record audio using wasapi. And get BYTE array. Capture samples made by: DWORD AudioCapture::RecordAudio() { HRESULT hr; hr = CoInitializeEx(NULL, COINIT_MULTITHREADED); Sleep(hnsActualDuration / REFTIMES_PER_MILLISEC / 2); hr = pCaptureClient->GetNextPacketSize(&packetLength); if (FAILED(hr)) { printf("Faild to get next data packet sizen"); return hr; } while (packetLength != 0) { hr = pCaptureClient->GetBuffer(&pData, &numFramesAvailable, &flags, NULL, NULL); ..

Read more

I get samples with wasapi as BYTE *. Then I want to write them to a file using FFmpeg. I get samples like this: DWORD AudioCapture::recordAudio() { HRESULT hr; hr = CoInitializeEx(NULL, COINIT_MULTITHREADED); Sleep(hnsActualDuration / REFTIMES_PER_MILLISEC / 2); hr = pCaptureClient->GetNextPacketSize(&packetLength); if (FAILED(hr)) { printf("Faild to get next data packet sizen"); return hr; } while ..

Read more

I am trying to encode KLV metadata (MISB 0601) with a regular video stream. I am using the ffmpeg examples and hove come up with this to start a klv stream: int Streamer::add_klv_stream(){ this->klv_stream = avformat_new_stream(this->output_context, NULL); this->klv_stream->codec->codec_type = AVMEDIA_TYPE_DATA; this->klv_stream->codec->codec_id = AV_CODEC_ID_SMPTE_KLV; this->klv_stream->codec->codec_tag = 1096174667; //some magic number? this->klv_stream->time_base = AVRational{ 1, 30 }; ..

Read more

hw1.cpp char * hwidmgr::HhhHHh() { std::string str = ""; str = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; return "WSAStart"; } Base64.h #ifndef _MACARON_BASE64_H_ #define _MACARON_BASE64_H_ #include <string> namespace macaron { class Base64 { public: static std::string Encode(const std::string data) { static constexpr char sEncodingTable[] = { ‘A’, ‘B’, ‘C’, ‘D’, ‘E’, ‘F’, ‘G’, ‘H’, ‘I’, ‘J’, ‘K’, ‘L’, ‘M’, ‘N’, ..

Read more

I’m trying to encode and then decode CERT_AUTHORITY_KEY_ID_INFO structure. But I’m getting an error and I couldn’t find an example online. How to do the round trip properly? CERT_AUTHORITY_KEY_ID_INFO info; info.KeyId.cbData = 10; info.KeyId.pbData = new BYTE[10]{ 1,2,3,4,5,1,2,3,4,5 }; info.CertIssuer.cbData = 10; info.CertIssuer.pbData = new BYTE[10]{ 2,4,6,8,10,2,4,6,8,10 }; info.CertSerialNumber.cbData = 10; info.CertSerialNumber.pbData = new BYTE[10]{ ..

Read more