codec

How do I write raw binary data in Python?

帅比萌擦擦* 提交于 2019-12-03 09:32:54
问题 I've got a Python program that stores and writes data to a file. The data is raw binary data, stored internally as str . I'm writing it out through a utf-8 codec. However, I get UnicodeDecodeError: 'charmap' codec can't decode byte 0x8d in position 25: character maps to <undefined> in the cp1252.py file. This looks to me like Python is trying to interpret the data using the default code page. But it doesn't have a default code page. That's why I'm using str , not unicode . I guess my

Error while using a g729 codec in SipDroid

喜你入骨 提交于 2019-12-03 09:09:15
I am developing a SIP application to make and receive a calls. And i want that application to support g729 codec. First i have tried with SipDroid an open source project and i have followed the this steps (followed the comment from 149 to 160) to add g729 codec in SipDroid . But g729 codec is not negotiated in my application.i have removed other codecs and added only g729. In my Asterisk i have added the .so file of g729 codec and in peers account i disallowed all and allowed only g729 but i am getting a error of Incompatible Codec. Click here for more information about codec configuration and

how to set the support of mp3 and ffmpeg codec libraries to cef?

泪湿孤枕 提交于 2019-12-03 03:42:51
I want to have cef lib with support of mp3 and ffmpeg codecs. How can i re-compile the library of cef with these codec features inside it. I want to learn, where should I edit inside the cef library or cefsharp? Then how to compile it to reuse it.. I am using cefsharp version 47. NOTE: PLEASE CONSIDER LEGAL ISSUES BEFORE PROCEEDING There is a way to enable MP3 support in CEF, but you'll have to modify the cef.gypi in the source distribution, regenerate the visual studio projects and rebuild. Step by step instructions: a a See this SO question: Chromium Embedded Framework MP3 support It

Planar YUV420 data layout

本秂侑毒 提交于 2019-12-03 03:10:00
In my project I use OpenH264 codec, which is said to output data in the YUV 4:2:0 planar format. After decoding I get one array with width * height * 1.5 elements, which, when displaying, looks like this image: http://o3d.googlecode.com/svn/trunk/samples_webgl/assets/shaving_cream.png Why there are four areas below the main one (which contains Y - responsible for grayscale - elements ), instead of two, like on my second picture? Is that mean that the format is different or am I wrong and my world just collapsed? I thought that the resoult should have looked like this: It is exactly the way you

HTML5 video codec support

孤街浪徒 提交于 2019-12-03 02:09:26
What codecs will be supported with the HTML5 video tag? Will it vary by browser, or is there a spec of specific codec that will be supported? According to wikipedia : The current HTML5 draft specification does not specify which video formats browsers should support in the video tag. User agents are free to support any video formats they feel are appropriate. HTML5 is in draft format though and this may change. There is an ongoing debate about the suitability of various algorithms and it seems that currently not everyone involved is able to agree on an answer. The three major contenders are Ogg

Decoding Opus audio data

旧时模样 提交于 2019-12-03 01:15:39
问题 I am trying to decode an Opus file back to raw 48 kHz. However I am unable to find any sample code to do that. My current code is this: void COpusCodec::Decode(unsigned char* encoded, short* decoded, unsigned int len) { int max_size=960*6;//not sure about this one int error; dec = opus_decoder_create(48000, 1, &error);//decode to 48kHz mono int frame_size=opus_decode(dec, encoded, len, decoded, max_size, 0); } The argument "encoded" might be larger amounts of data, so I think I have to split

How do I write raw binary data in Python?

自古美人都是妖i 提交于 2019-12-02 23:59:17
I've got a Python program that stores and writes data to a file. The data is raw binary data, stored internally as str . I'm writing it out through a utf-8 codec. However, I get UnicodeDecodeError: 'charmap' codec can't decode byte 0x8d in position 25: character maps to <undefined> in the cp1252.py file. This looks to me like Python is trying to interpret the data using the default code page. But it doesn't have a default code page. That's why I'm using str , not unicode . I guess my questions are: How do I represent raw binary data in memory, in Python? When I'm writing raw binary data out

Python library to modify MP3 audio without transcoding

痞子三分冷 提交于 2019-12-02 20:41:38
I am looking for some general advice about the mp3 format before I start a small project to make sure I am not on a wild-goose chase. My understanding of the internals of the mp3 format is minimal. Ideally, I am looking for a library that would abstract those details away. I would prefer to use Python (but could be convinced otherwise). I would like to modify a set of mp3 files in a fairly simple way. I am not so much interested in the ID3 tags but in the audio itself. I want to be able to delete sections (e.g. drop 10 seconds from the 3rd minute), and insert sections (e.g. add credits to the

Re-encode Unicode stream as Ascii ignoring errors

心不动则不痛 提交于 2019-12-02 15:57:58
问题 I'm trying to take a Unicode file stream, which contains odd characters, and wrap it with a stream reader that will convert it to Ascii, ignoring or replacing all characters that can't be encoded. My stream looks like: "EventId","Rate","Attribute1","Attribute2","(。・ω・。)ノ" ... My attempt to alter the stream on the fly looks like this: import chardet, io, codecs with open(self.csv_path, 'rb') as rawdata: detected = chardet.detect(rawdata.read(1000)) detectedEncoding = detected['encoding'] with

Decoding Opus audio data

守給你的承諾、 提交于 2019-12-02 14:32:16
I am trying to decode an Opus file back to raw 48 kHz. However I am unable to find any sample code to do that. My current code is this: void COpusCodec::Decode(unsigned char* encoded, short* decoded, unsigned int len) { int max_size=960*6;//not sure about this one int error; dec = opus_decoder_create(48000, 1, &error);//decode to 48kHz mono int frame_size=opus_decode(dec, encoded, len, decoded, max_size, 0); } The argument "encoded" might be larger amounts of data, so I think I have to split it into frames. I am not sure how I could do that. And with being a beginner with Opus, I am really