decode

Reverse video playback through ffmpeg

ぃ、小莉子 提交于 2021-02-18 18:02:14
问题 I am implementing a video player using ffmpeg multimedia framework. I am able to achieve play, pause, increase speed, decrease speed, forward seek, backward seek functionalities. But reverse playback of the video is not so smooth, it stutters a lot. Please help me in understanding video reverse playback. What is the better approach for this? Is there any other multimedia framework which support reverse video playback? Many thanks in advance. 回答1: So, first, some framing of this issue. FFmpeg

UnicodeEncodeError in python3 when redirection is used

ⅰ亾dé卋堺 提交于 2021-02-10 20:14:13
问题 What I want to do: extract text information from a pdf file and redirect that to a txt file. What I did: pip install pdfminor pdf2txt.py file.pdf > output.txt What I got: UnicodeEncodeError: 'gbk' codec can't encode character '\u2022' in position 0: illegal multibyte sequence My observation: \u2022 is bullet point, • . pdf2txt.py works well without redirection: the bullet point character is written to stdout without any error. My question: Why does redirection cause a python error? As far as

UnicodeEncodeError in python3 when redirection is used

喜你入骨 提交于 2021-02-10 20:11:18
问题 What I want to do: extract text information from a pdf file and redirect that to a txt file. What I did: pip install pdfminor pdf2txt.py file.pdf > output.txt What I got: UnicodeEncodeError: 'gbk' codec can't encode character '\u2022' in position 0: illegal multibyte sequence My observation: \u2022 is bullet point, • . pdf2txt.py works well without redirection: the bullet point character is written to stdout without any error. My question: Why does redirection cause a python error? As far as

How to auto detect a String encoding?

匆匆过客 提交于 2021-02-10 15:38:35
问题 I have a String which contains some encoded values in some way like Base64. The problem is that I really don't know if it's actually Base64 (there are A-Z, a-z. 0-9, +, /) so it can be some any other code that i'm not familiar with. Is there a way or any other online site to send him an encoded input and it can tell me in which code is it? NOTE: I'm not asking how to know if my String is UTF-8 or iso-8859-1 or something like that. What I need is to know in which is my code is encoded. EDIT:

python encoding chinese to special character

本小妞迷上赌 提交于 2021-02-10 14:57:43
问题 I have scrap/curl request to get html from other site, that have chinese language but some text result is weird, it showing like this: °¢Àï°Í°ÍΪÄúÌṩÁË×ÔÁµÕß¹¤³§Ö±ÏúÆ·ÅƵç×Ó±í ÖÇÄÜʱÉг±Á÷ŮʿÊÖ»·ÊÖÁ´Ê×Êαí´øµÈ²úÆ·£¬ÕâÀïÔƼ¯ÁËÖÚ¶àµÄ¹©Ó¦ÉÌ£¬²É¹ºÉÌ£¬ÖÆÔìÉÌ¡£ÓûÁ˽â¸ü¶à×ÔÁµÕß¹¤³§Ö±ÏúÆ·ÅƵç×Ó±í ÖÇÄÜʱÉг±Á÷ŮʿÊÖ»·ÊÖÁ´Ê×Êαí´øÐÅÏ¢£¬Çë·ÃÎÊ°¢Àï°Í°ÍÅú·¢Íø£¡ that should be in chinese language, and this is my code: str(result.decode('ISO-8859-1')) If without decode 'ISO-8859-1' (only return result

python encoding chinese to special character

空扰寡人 提交于 2021-02-10 14:57:27
问题 I have scrap/curl request to get html from other site, that have chinese language but some text result is weird, it showing like this: °¢Àï°Í°ÍΪÄúÌṩÁË×ÔÁµÕß¹¤³§Ö±ÏúÆ·ÅƵç×Ó±í ÖÇÄÜʱÉг±Á÷ŮʿÊÖ»·ÊÖÁ´Ê×Êαí´øµÈ²úÆ·£¬ÕâÀïÔƼ¯ÁËÖÚ¶àµÄ¹©Ó¦ÉÌ£¬²É¹ºÉÌ£¬ÖÆÔìÉÌ¡£ÓûÁ˽â¸ü¶à×ÔÁµÕß¹¤³§Ö±ÏúÆ·ÅƵç×Ó±í ÖÇÄÜʱÉг±Á÷ŮʿÊÖ»·ÊÖÁ´Ê×Êαí´øÐÅÏ¢£¬Çë·ÃÎÊ°¢Àï°Í°ÍÅú·¢Íø£¡ that should be in chinese language, and this is my code: str(result.decode('ISO-8859-1')) If without decode 'ISO-8859-1' (only return result

Python decoding from iso-8859-5

荒凉一梦 提交于 2021-02-08 08:34:13
问题 When I parse my email messages via python email.parser.Parser, I had a lot of strings like this: =?ISO-8859-5?Q?=C0=D5=D5=E1=E2=E0_=BF=DB=D0=E2=D5=D6=D5=D9_?= How can i decode this to utf-8 using python? 回答1: Your input is quoted-printable encoded text. You can use the module quopri to handle that: import quopri incode = '=?ISO-8859-5?Q?=C0=D5=D5=E1=E2=E0_=BF=DB=D0=E2=D5=D6=D5=D9_?=' inencoding = incode[2:12] # 'ISO-8859-5' intext = incode[15:-2] result = quopri.decodestring(intext).encode

ffmpeg decoding slow calling without avformat_find_stream_info

江枫思渺然 提交于 2021-02-08 00:24:05
问题 I am decoding h264 rtp stream with ffmpeg on android. I found a strange problem: if I don't call avformat_find_stream_info ,decoding P frame takes tens of micro seconds, by contrast, calling avformat_find_stream_info before decoding will reduce P frame decoding time to less than 1 ms on average. However, avformat_find_stream_info itself is time consuming on network streams. Are there anything I can do to make decoding fast without calling avformat_find_stream_info ? 回答1: When avformat_find

ffmpeg decoding slow calling without avformat_find_stream_info

China☆狼群 提交于 2021-02-08 00:22:27
问题 I am decoding h264 rtp stream with ffmpeg on android. I found a strange problem: if I don't call avformat_find_stream_info ,decoding P frame takes tens of micro seconds, by contrast, calling avformat_find_stream_info before decoding will reduce P frame decoding time to less than 1 ms on average. However, avformat_find_stream_info itself is time consuming on network streams. Are there anything I can do to make decoding fast without calling avformat_find_stream_info ? 回答1: When avformat_find

ffmpeg decoding slow calling without avformat_find_stream_info

拥有回忆 提交于 2021-02-08 00:20:27
问题 I am decoding h264 rtp stream with ffmpeg on android. I found a strange problem: if I don't call avformat_find_stream_info ,decoding P frame takes tens of micro seconds, by contrast, calling avformat_find_stream_info before decoding will reduce P frame decoding time to less than 1 ms on average. However, avformat_find_stream_info itself is time consuming on network streams. Are there anything I can do to make decoding fast without calling avformat_find_stream_info ? 回答1: When avformat_find