To convert some encoded data (e.g. bytes, electrical signals) to some representation ready for further processing (e.g. string, object, picture)
Questions tagged [decode]
4353 questions
20
votes
3 answers
UnicodeDecodeError: 'charmap' codec can't decode byte 0x8d in position 7240: character maps to
I am student doing my master thesis. As part of my thesis, I am working with python. I am reading a log file of .csv format and writing the extracted data to another .csv file in a well formatted way. However, when the file is read, I am getting…

Goutham Sai Siddardha
- 393
- 1
- 2
- 9
20
votes
5 answers
How to decode H.264 video frame in Java environment
Does anyone know how to decode H.264 video frame in Java environment?
My network camera products support the RTP/RTSP Streaming.
The service standard RTP/RTSP from my network camera is served and it also supports “RTP/RTSP over HTTP”.
RTSP : TCP…
user262186
19
votes
4 answers
'utf-8' codec can't decode byte 0xe2 : invalid continuation byte error
I am trying to read all PDF files from a folder to look for a number using regular expression. On inspection, the charset for PDFs is 'UTF-8'.
Throws this error:
'utf-8' codec can't decode byte 0xe2 in position 10: invalid
continuation…

Prat
- 201
- 1
- 2
- 3
19
votes
5 answers
How to Convert Pdf to base64 and Encode / Decode
OK, I have some pdf need convert to base64 by base64encoder.
finally, I use decoder to convert back to pdf format but my content is lost.
my code :
byte[] input_file = Files.readAllBytes(Paths.get("C:\\user\\Desktop\\dir1\\dir2\\test3.pdf"));
…

DKKs
- 375
- 1
- 4
- 8
19
votes
3 answers
What is the difference between and
I am new to python. I'm confused by the .
I got a str by using:
response = urllib.request.urlopen(req).read().decode()
The type of 'response' is , not .
When I try to manipulate this str in 'for loop':
for ID…

dom free
- 1,095
- 1
- 9
- 8
19
votes
10 answers
Decoding Base64 Images
I have recently found a file on the web, and I really need the original url to it, but it's encoded into Base64. It's an image.
The URL Starts with something like this: data:image/png;base64, and then there are loads of numbers and letters.
My…

Nick
- 352
- 2
- 5
- 20
18
votes
3 answers
Cannot split, a bytes-like object is required, not 'str'
I am trying to write a tshark (or any shell command for that matter) to a file. I've tried using decode and encode but it still yells at me that the split method cannot use the datatype.
My attempts are still in the code as comments, after the…

axxic3
- 311
- 1
- 3
- 12
18
votes
1 answer
Cross platform (php to C# .NET) encryption/decryption with Rijndael
I'm currently having a bit of problem with decrypting a message encrypted by php mcrypt.
The php code is as following:

user527113
- 183
- 1
- 1
- 5
18
votes
7 answers
decode base64 svg data to a svg file
I have a file containing a svg image which is base64 encoded (data-uri). The file starts with
data:image/svg+xml;base64,PHN....
How to decode this to a .svg file in linux ?

ni_hao
- 404
- 2
- 5
- 16
17
votes
3 answers
python: Invalid base64-encoded string: number of data characters (5) cannot be 1 more than a multiple of 4
output the following error:
Exception Value:
Invalid base64-encoded string: number of data characters (5) cannot be 1 more than a multiple of 4
Exception Location: D:\Program Files\Python\lib\base64.py in b64decode, line 87
"
I input python…

faye rao
- 201
- 1
- 3
- 6
17
votes
5 answers
opencv read error:[h264 @ 0x8f915e0] error while decoding MB 53 20, bytestream -7
My configuration:
ubuntu 16.04
opencv 3.3.1
gcc version 5.4.0 20160609
ffmpeg version 3.4.2-1~16.04.york0
and I built opencv with:
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D PYTHON_EXECUTABLE=$(which python) -D…

Alex Luya
- 9,412
- 15
- 59
- 91
17
votes
7 answers
Decoding JSON and a base64-encoded value in a shell script
I have a JSON and I need to extract a base64-encoded value by particular key and decode it.
JSON has the following structure:
[
{
"LockIndex": 0,
"Key": "Arul/key1",
"Flags": 0,
"Value": "MzAKCg==",
"CreateIndex": 369,
…

Arul
- 349
- 2
- 4
- 10
17
votes
2 answers
Decode video in Raspberry Pi without using OpenMAX?
I am looking for an example of decoding video on Raspberry Pi directly, without using OpenMAX.
This explains the different layers of multimedia software:
There is an additional layer which is not shown in here, the "MMAL" layer which is (I…

Alex I
- 19,689
- 9
- 86
- 158
17
votes
4 answers
I don't understand encode and decode in Python (2.7.3)
I tried to understand by myself encode and decode in Python but nothing is really clear for me.
str.encode([encoding,[errors]])
str.decode([encoding,[errors]])
First, I don't understand the need of the "encoding" parameter in these two…

Narcisse Doudieu Siewe
- 297
- 2
- 4
- 17
16
votes
5 answers
Decoding Base64 Image
I have got a Base64 image in an HTML embedded, how can I decode this using C# or VB.net.

Ploetzeneder
- 1,281
- 4
- 20
- 34