encoding

c# Registry System.Byte[] to string

让人想犯罪 __ 提交于 2020-08-25 08:02:51
问题 I am currently writing a program that will read part of the windows system registry however some of the values of these keys are of type System.Byte[] when i try and decode these values I can produce a string that has some readable characters that makes but mostly the string is jiberish. I have tried several encoding types but none seem to produce the correct results. I am just wondering if there is anything that is known to fix this. this is the code i have public void getMRU() { String mru

Invalid data when creating mkv container with h264 stream because extradata is null

坚强是说给别人听的谎言 提交于 2020-08-24 09:22:29
问题 I need to encode raw frames into an h264 stream inside an mkv container using ffmpeg's c api. All the examples I could find copy existing codec parameters from a decoder so I had to modify it a bit. #include <cstdio> #include <cstring> #include <iostream> extern "C" { #include <libavformat/avformat.h> #include <libavutil/avutil.h> #include <libavutil/imgutils.h> #include <libavutil/opt.h> #include <libswscale/swscale.h> } static char error_msg[4096] = ""; int main(int argc, char **argv) { int