convert H264 video to raw YUV format

Yes you can, you just have to specific the pixel format. To get the whole list of the format: ffmpeg -pix_fmts | grep -i pixel_format_name For example if you want to save the 1st video track of an mp4 file as a yuv420p (p means planar) file: ffmpeg -i video.mp4 -c:v rawvideo -pix_fmt yuv420p out.yuv

Python & MySql: Unicode and Encoding

I think that your MYSQLdb python library doesn’t know it’s supposed to encode to utf8, and is encoding to the default python system-defined charset latin1. When you connect() to your database, pass the charset=”utf8″ parameter. This should also make a manual SET NAMES or SET character_set_client unnecessary.

Python encoded message with HMAC-SHA256

If you want to execute in python3 you should do the following: #python 3 import hmac import hashlib nonce = 1 customer_id = 123456 API_SECRET = ‘thekey’ api_key = ‘thapikey’ message=”{} {} {}”.format(nonce, customer_id, api_key) signature = hmac.new( bytes(API_SECRET, ‘latin-1’), msg=bytes(message, ‘latin-1’), digestmod=hashlib.sha256 ).hexdigest().upper() print(signature)

Encoding nested python object in JSON

my previous sample, with another nested object and your advices : import json class Identity: def __init__(self): self.name=”abc name” self.first=”abc first” self.addr=Addr() def reprJSON(self): return dict(name=self.name, firstname=self.first, address=self.addr) class Addr: def __init__(self): self.street=”sesame street” self.zip=”13000″ def reprJSON(self): return dict(street=self.street, zip=self.zip) class Doc: def __init__(self): self.identity=Identity() self.data=”all data” def reprJSON(self): return dict(id=self.identity, data=self.data) class ComplexEncoder(json.JSONEncoder): def … Read more