converter

ffmpeg convert from H.264 (High 4:4:4 Profile) to H.264 (Main Profile)

我的未来我决定 提交于 2021-02-17 15:20:08
问题 How can I convert a video from H.264 (High 4:4:4 Profile) to H.264 (Main Profile) using ffmpeg? I can't do that with this command: ffmpeg -i 1/25359.mp4 -profile:v main out.mp4 . That'd return an error: ... That'd return an error: Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '1/25359.mp4': Metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2avc1mp41 encoder : Lavf56.40.101 Duration: 00:00:06.08, start: 0.000000, bitrate: 1059 kb/s Stream #0:0(und): Video: h264 (High 4:4:4

Convert h:selectBooleanCheckbox value between boolean and String

|▌冷眼眸甩不掉的悲伤 提交于 2021-02-07 20:44:46
问题 I have a backing bean containing a field creditCard which can have two string values y or n populated from the DB. I would like to display this in checkbox so that y and n gets converted to boolean . How can I implement it? I can't use a custom converter as getAsString() returns String while rendering the response whereas I need a boolean . 回答1: The <h:selectBooleanCheckbox> component does not support a custom converter. The property has to be a boolean . Period. Best what you can do is to do

Convert h:selectBooleanCheckbox value between boolean and String

有些话、适合烂在心里 提交于 2021-02-07 20:39:14
问题 I have a backing bean containing a field creditCard which can have two string values y or n populated from the DB. I would like to display this in checkbox so that y and n gets converted to boolean . How can I implement it? I can't use a custom converter as getAsString() returns String while rendering the response whereas I need a boolean . 回答1: The <h:selectBooleanCheckbox> component does not support a custom converter. The property has to be a boolean . Period. Best what you can do is to do

Convert h:selectBooleanCheckbox value between boolean and String

徘徊边缘 提交于 2021-02-07 20:38:16
问题 I have a backing bean containing a field creditCard which can have two string values y or n populated from the DB. I would like to display this in checkbox so that y and n gets converted to boolean . How can I implement it? I can't use a custom converter as getAsString() returns String while rendering the response whereas I need a boolean . 回答1: The <h:selectBooleanCheckbox> component does not support a custom converter. The property has to be a boolean . Period. Best what you can do is to do

Java: convert byte[] to base36 String

主宰稳场 提交于 2021-02-07 12:29:19
问题 I'm a bit lost. For a project, I need to convert the output of a hash-function (SHA256) - which is a byte array - to a String using base 36. So In the end, I want to convert the (Hex-String representation of the) Hash, which is 43A718774C572BD8A25ADBEB1BFCD5C0256AE11CECF9F9C3F925D0E52BEAF89 to base36, so the example String from above would be: 3SKVHQTXPXTEINB0AT1P0G45M4KI8U0HR8PGB96DVXSTDJKI1 For the actual conversion to base36, I found some piece of code here on StackOverflow: public static

Java: convert byte[] to base36 String

夙愿已清 提交于 2021-02-07 12:29:18
问题 I'm a bit lost. For a project, I need to convert the output of a hash-function (SHA256) - which is a byte array - to a String using base 36. So In the end, I want to convert the (Hex-String representation of the) Hash, which is 43A718774C572BD8A25ADBEB1BFCD5C0256AE11CECF9F9C3F925D0E52BEAF89 to base36, so the example String from above would be: 3SKVHQTXPXTEINB0AT1P0G45M4KI8U0HR8PGB96DVXSTDJKI1 For the actual conversion to base36, I found some piece of code here on StackOverflow: public static

Code golf! Is there a simple way to convert letters to numbers in Python?

偶尔善良 提交于 2021-02-05 12:34:24
问题 You know, like A = 1, B = 2 etc. I could just make a long list of if-thens, but maybe there's already a module for it. Bonus if it works like it does in "Excel Coordinates" where AA = 27 and continues. (Does this count as base26 numbers?) 回答1: def foo(c): return ord(c) - 64 foo('A') 1 foo('B') 2 off the top of my head :p 回答2: from string import ascii_uppercase letterKey = dict(list(zip( ascii_uppercase, range(1, 27)))) And as for the excel cords: geExceltValue = lambda string: sum([26**i *

Encoding issue with apache poi converter

我的未来我决定 提交于 2021-02-05 11:19:12
问题 I have an ms word doc file that i'm converting to an html document using apache poi. this is the code i'm running InputStream input = new FileInputStream (path); HWPFDocument wordDocument = new HWPFDocument (input); WordToHtmlConverter wordToHtmlConverter = new WordToHtmlConverter (DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument() ); List<Picture> pics = wordDocument.getPicturesTable().getAllPictures(); if (pics != null) { for (int i = 0; i <pics.size(); i++) { Picture

JNA Convert HICON to Java Image

房东的猫 提交于 2021-01-29 09:56:16
问题 I knwo there is already an question like this. But its solution was not suitable for me because with the Sehellfolder Methode you can only get 16x16 and 32x32 sized icons. I have extracted a HICO with size of 256x256 and want to convert it into and Java Image like BufferedImage. I found and method for it to. But it does not work properly: public static BufferedImage getIcon(final WinDef.HICON hIcon,int ICON_SIZE,short ICON_DEPTH,int ICON_BYTE_SIZE) { final int width = ICON_SIZE; final int

Converting text to a binary file

最后都变了- 提交于 2021-01-28 06:10:53
问题 I need to convert a text file of the following format to binary: The first line contains the number of products in the inventory, The following lines contains: product name '\t' product price '\t' quantity '\n' (there can be more than one \t between columns) For every product the binary output file will contain an int representing the length of the product name, the chars that hold the product name, an int representing the price and an int representing the quantity. Sample input file: Asus