quarta-feira, 9 de setembro de 2020

Java application for converting 264 files produced by some Chinese IP cameras

 

chipcaco-java

Commandline Java tool for converting .264 files produced by some Chinese IP cameras

chipcaco-java (Chinese IP Camera Converter) is a Java application for converting .264 files produced by some Chinese IP cameras like TPTEK, IeGeek, and other brands that uses CamHi software.

The H.264 recordings downloaded from the camera can't be played or converted by common applications like VLC.

This software remove the proprietary extensions from the video so can be played on any video player.

This is a JAVA port of the C application by Ralph Spitzner, and also based on the node-JS port by Sven Jacobs

If you are looking for a video player and  Converter for Windows/Mac with Graphical Interface for Chinese Cameras recordings I recomend to try HIP2P Client (from IPCAM XIN). Chipcaco-java is better used when command-line tool is needed, and works on any Operational System with Java Virtual Machine 8 or newest.

Installation

Download JAR file chipcaco.jar: chipcaco.jar

Source Code: https://github.com/rodrigoeggea/chipcaco-java

Usage

java -jar chipcaco.jar <source file> 

where <src> is the source file produced by the camera. The output file has same name but with .h264 extension.

Note: The produced file must likely be additionally processed by ffmpeg or similar applications before it can be played. Example:

Only copy H264 frames and fix FPS (can be played only in VLC)

ffmpeg -framerate 25 -i intermediate.h264 -c copy video.h264

Converting to MP4 and fix FPS (can be player in any Video Player or Browser)

ffmpeg -framerate 25 -i intermediate.264 video.mp4  

sábado, 5 de setembro de 2020

JavaInterface jipopt.dll compiled in 64-bits for Windows with HS71 example

 

JavaInterface jipopt.dll compiled in 64-bits for Windows with HS71 example



Ipopt is a solver for large scale nonlinear optimization problems (NLP) with non-linear contraints. The Java Native Interface (JNI) is a programming framework that allows Java code running in the Java Virtual Machine (JVM) to call and be called by native applications and libraries written in languages such as C and C++. JIpopt requires Java 5 or higher.

The Official Jipopt website provides pre-compiled DLL's with Ipopt+MUMPS for Win32 platforms and for Ubuntu Linux i386.

Due to the lack of this jipopt library compiled for Java Runtime 64-bits, I compiled and providing in this repository with the original sample code HS71 together with the 64-bit compiled jipopt.dll.

This jipopt library was compiled by the source Ipopt-3.12.13 in Windows10 using MSYS2-64bits and following the instructions Installing Ipopt with some workarounds.

Prerequisites

Java JDK 64-bits for Windows - Java SE Development Kit

Eclipse IDE - Eclipse IDE

Installing

  1. Clone this GIT Project to Eclipse

  2. Add the folder "jni_dependency" to Windows PATH variable (See README.TXT)

  3. Restart Eclipse

  4. Run the java example "HS01.java"

Authors

domingo, 19 de abril de 2020

Instalando Python3 + Selenium + PhantomJS no UBUNTU


INSTALAÇÃO


O Selenium é um conjunto de ferramentas que permite realizar testes automatizados ou buscar dados em páginas web ou realizar webcrawler (realizar buscas automatizadas em websites).
O Selenium precisa se comunicar com um Navegador que ele vai controlar e realizar todos os comandos solicitados, como procurar um botão na página e clicar nele. 
Ele consegue se comunicar com praticamente todos os navegadores (Firefox, Chrome, IE, Safari, Opera, PhamtomJS, etc...)
Neste tutorial vou ensinar a utilizar o PhantomJS, pois é um browser headless (sem necessidade de interface gráfica), ou seja pode ser utilizado em servidores.

1) Instalação dos pacotes necessários:


--------------------------------------------------------    
# apt-get install nodejs npm python3 python3-pip python3-selenium 
--------------------------------------------------------

Obs.: NÃO instale o PhantomJS do repositório via apt-get, a versão que está no repositório do Ubuntu/Debian é compilado com interface gráfica, e não é compatível com a biblioteca do Selenium para Python. Caso tenha instalado, desinstale com #apt-get purge PhamtomJS e siga passo 2.

2) Baixe o PhamtomJS do site oficial https://phantomjs.org, a versão correspondente ao seu servidor (32 ou 64 bits):

--------------------------------------------------------

cd /usr/src
# wget https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2
# tar -jzvf phantomjs-2.1.1-linux-x86_64.tar.bz2
---------------------------------------------------------

Adicione no PATH temporariamente para teste: 


------------------------------------------------------------
# PATH=$PATH: /usr/src/phantomjs-2.1.1-linux-x86_64/bin
------------------------------------------------------------

Adicione no PATH permanentemente também: 

------------------------------------------------------------
echo "export PATH=$PATH:/usr/src/phantomjs-2.1.1-linux-x86_64/bin/" >> ~/.bashrc
------------------------------------------------------------

Verifique se o PhantomJS está executando corretamente:

------------------------------------------------------------
# phantomjs --version
2.1.1
------------------------------------------------------------

CRIE UM SCRIPT SIMPLES EM PYTHON3 COM SELENIUM PARA TESTE:

testeselenium.py ----------------------------------------------------------
#!/usr/bin/env python3
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC

driver = webdriver.PhantomJS()
driver.get("http://www.google.com")
input_element = driver.find_element_by_name("q")
input_element.send_keys("python")
input_element.submit()
html_source=driver.page_source
print(html_source)
----------------------------------------------------------
Neste exemplo, o Selenium utiliza o browser PhantomJS, abre a página do Google, procura pelo campo de pesquisa (find_element_by_name("q")) digita "python" e manda pesquisar.


Executo o código:

# ./testeselenium.py  

Vai retornar todo o código HTML com a resposta da pesquisa. Para poder visualizar melhor utilize o Lynx para remover as tags.

# ./testeselenium.py | lynx --dump -stdin | more 

DICAS


  • A melhor forma para encontrar o nome dos campos, utilize o browser Firefox ou Chrome no "Modo desenvolvedor", basta abrir a página, clicar com o botão direito e escolher "Inspecionar", ao lado direito vai abrir o DevTools, onde é possível navegar pelo código fonte e elementos da página.

  • Nunca utilize o nome selenium.py para o seu script, pois ele conflita com a biblioteca do Selenium.


Referências:

Realizando pesquisa nos elementos:


Examples, benchmark, video.
https://realpython.com/headless-selenium-testing-with-python-and-phantomjs/

Unit Test:
https://medium.com/@yareda/automating-tests-with-python-selenium-and-phantomjs-db37726b381








segunda-feira, 24 de fevereiro de 2020

NETFLIX no HTVBOX 5

Problema do NETFLIX no HTVBOX 5 [Resolvido]

Para rodar o NETFLIX no seu HTVBOX5 siga o procedimento descrito no vídeo abaixo:

https://www.youtube.com/watch?v=-XSHU9FQqoU

A versão do Netflix do Google Play da HTVBOX 5 parou de funcionar, primeiro passo é desinstalar, e instalar manualmente o APK do Netflix disponibilizado no link abaixo.

Arquivo direto para baixar o APK do Netflix para HTVBOX 5.


Retirado do site: https://www.canaldeixaqueeuresumo.com

Se ao abrir o NETFLIX ele reclamar que sua versão do Google Play Services é muito antiga, e ao clicar no botão de "atualizar" ele vai abrir a Google Play Store do seu HTVBOX 5 dizendo que seu Google Play Services está atualizado.

Para resolver isso baixe uma versão mais recente do Google Play Services para Android TV do link abaixo:

Google Play services (Android TV) 20.04.14 (080306-294335909) (080306)


Baixe e instale manualmente o APK no seu HTVBOX 5, ele demora um pouco para instalar mesmo.
Após instalado o seu NETFLIX deverá abrir normalmente.

Recomendo também que utilizem um Airmouse, que facilita e muito a navegação pelo Netflix, pois o controle remoto do HTVBOX é muito ruim para navegar.
Segue link do Aliexpress para o AIRMOUSE G10S (Compre a versão com G10S pois esse possui o giroscópio! a versão G10 não possui!)


LINK PARA PRODUTO|























Atualização DELL INSPIRON 15R com Update para Windows 10 22H2 travado em 61% ou 99%

 Como atualizar notebook DELL INSPIRON 15R com Windows 10 que está com a atualização travada em 61% ou 99%: Processo de atualização manual d...