Programming2019. 8. 20. 03:03

아래 두가지 방법이 가장 간단한듯. 아래글중 10초씩 자르는것과 붙이는 것, 앞에 Title자동으로 넣는것까지 3가지만 있으면 될듯.

 

*concat demuxer

$ cat mylist.txt
file '/path/to/file1'
file '/path/to/file2'
file '/path/to/file3'

$ ffmpeg -f concat -i mylist.txt -c copy output.mp4
$ ffmpeg -f concat -safe 0 -i mylist.txt -c copy output.mp4

Note: -safe 0 is not required if the paths are relative but it seems required.

 

*concat protocol

ffmpeg -i "concat:input1|input2" -codec copy output.mkv

 

https://superuser.com/questions/1059245/ffmpeg-join-two-mp4-files-with-ffmpeg-on-command-line

 

ffmpeg join two mp4 files with ffmpeg on command line

I can successfully join multiple files using the following command: ffmpeg -f concat -i input.txt -codec copy output.mp4 The only problem with this command is that you need to read the filepaths ...

superuser.com

https://stackoverflow.com/questions/7333232/how-to-concatenate-two-mp4-files-using-ffmpeg

 

How to concatenate two MP4 files using FFmpeg?

I'm trying to concatenate two mp4 files using ffmpeg. I need this to be an automatic process hence why I chose ffmpeg. I'm converting the two files into .ts files and then concatenating them and ...

stackoverflow.com

 

Posted by 쁘레드
IT이야기2019. 8. 20. 03:00

예전에는 웹서버랑 어떤 프레임워크 및 언어 이런것만 나오더니 요즘은 광고 platform, Docker 등 엄청 뭐가 많이 붙어있어요. 이 웹사이트는 어떻게 만들어졌을까 궁금할때 참 좋습니다.

https://www.wappalyzer.com/ 

 

클리앙은 아주 깔끔한 편이네요.

Posted by 쁘레드
Programming2019. 8. 20. 02:11

lsof - list open files

!{command} ; last command 
vi !$   ; last argument 
!! ; last command 
"CTRL+R" for Repeating the Last Matching Command 
history | grep "keyword" 
egrep "ERROR|Exception" *.xml 
grep Exception logfile.txt | grep -v ERROR 
grep -c "Error" logfile.txt 
grep --context=6 successful logfile.txt 
grep 'Error|Exception' logfile.txt 
grep -i Error logfile.txt 
zgrep -i Error *.gz 
grep -w ERROR logfile.txt ; search whole word 
grep -l ERROR *.log  ; display file name which contains pattern 

Using Alias .bashrc or .profile 
pushd, popd, cd --- and cd ~ command. cd --- is best 

Ctrl+Z to suspend it and fg 1 or fg 2

 

https://dev.to/javinpaul/10-simple-linux-tips-which-save-50-of-my-time-in-the-command-line-4moo

 

10 simple Linux tips which save 50% of my time in the command line

My favorite Linux commands, tips, and tricks to work fast in the UNIX terminal. Every programmer or Linux user should know this to save time and typing.

dev.to

 

 

• finding host/domain name and IP address - hostname
• test network connection – ping
• getting network configuration – ifconfig
• Network connections, routing tables, interface statistics – netstat
• query DNS lookup name – nslookup
• communicate with another hostname – telnet
• outing steps that packets take to get to network host – traceroute
• view user information – finger
• checking status of destination host - telnet

 


hostname with no options displays the machine's hostname
hostname –d displays the domain name the machine belongs to
hostname –f displays the fully qualified host and domain name
hostname –i displays the IP address for the current machine

netstat -nap | grep port  #will display process id of application which is using that port
netstat -a  or netstat –all #will display all connections including TCP  and UDP  
netstat --tcp  or netstat –t #will display only TCP  connection
netstat --udp or netstat –u #will display only UDP  connection
netstat -g #will display all multicast network subscribed by this host.

nslookup blogger.com # find IP address of the SITE

#A handy utility to view the number of hops and response time to get to a remote system or website is traceroute
traceroute

#View user information, displays a user’s login name, real name, terminal name and write status.
#this is pretty old Unix command and rarely used nowadays.
finger

 



Read more: https://javarevisited.blogspot.com/2010/10/basic-networking-commands-in-linuxunix.html#ixzz5x4Ghj3Gd

Posted by 쁘레드
재밌는세상2019. 8. 17. 05:29

21세기에도 경제적으로 저주받은 대륙이 두군데가 있는데, 남미와 아프리카. 남미는 아프리카대륙의 아래쪽이라 크기라도 좀 작은편인데, 아프리카는 저렇게 어마어마한 땅을 가지고 경제적으로 바닦에 있다는 것이 말이 되는 이야기 인지. 

 

제국주의의 최대피해자들. 죽을때까지 피해보며 살아갈듯.

 

https://en.wikipedia.org/wiki/French_West_Africa : 프랑스 아프리카 식민지

 

French West Africa - Wikipedia

For the entire area in Africa colonized by France, see French Africa. Afrique occidentale française Commercial Relations Report, showing the profile of a Fula woman. January–March 1938. French West Africa (French: Afrique occidentale française, AOF) was a

en.wikipedia.org

https://ko.wikipedia.org/wiki/프랑스령_서아프리카

 

프랑스령 서아프리카 - 위키백과, 우리 모두의 백과사전

위키백과, 우리 모두의 백과사전.

ko.wikipedia.org

기니 
말리 
코트디부아르 
니제르 
베냉 
모리타니 
부르키나파소 
세네갈

 

 

https://ko.wikipedia.org/wiki/아프리카_분할

 

아프리카 분할 - 위키백과, 우리 모두의 백과사전

위키백과, 우리 모두의 백과사전. 아프리카 분할( - 分割, 영어: Scramble for Africa, Partition of Africa, Conquest of Africa, 프랑스어: Partage de l'Afrique,독일어: Wettlauf um Afrika 스페인어: Reparto de África, 이탈리아어: Spartizione dell'Africa)은 1880년대에서부터 제1차 세계대전이 있었던 1914년까지 유럽의 제국주의적 침략으로

ko.wikipedia.org

 

https://namu.wiki/w/식민지

 

식민지 - 나무위키

애국심 고취, 사회갈등 해소, 군사적 필요 등과 같은 비경제적 목적이 강했던 식민지 시대. 어떻게 보면 이것이 식민모국에게 더 굴욕적일 수 있다. 국력은 규모와 정치적 상황으로 식민지가 더 강해질 수 있지만 1인당 소득이 뒤쳐졌다는 것은 더 못 산다는 의미이기 때문이다.

namu.wiki

대표적으로 미국, 영국, 프랑스, 네덜란드, 스페인, 포르투갈, 호주, 뉴질랜드 같은 서방 세계 국가들이 오세아니아나 카리브 지역, 남미, 아프리카 등지에 소유하고 있는 누벨칼레도니, 프랑스령 폴리네시아, 왈리스 퓌튀나, 마르티니크, 과들루프, 생바르텔레미, 세인트마틴 섬, 프랑스령 기아나, 마요트, 레위니옹, 케이맨 제도, 앵귈라, 몬트세랫, 터크스 케이커스 제도, 버뮤다, 버진 제도, 포클랜드 제도, 이스터 섬, 아루바, 퀴라소, 카리브 네덜란드, 카나리아 제도, 세우타, 멜리야, 마데이라 제도, 괌, 북마리아나 제도, 미국령 사모아, 하와이, 푸에르토리코, 코코스 제도, 크리스마스 섬, 노퍽 섬, 쿡 제도, 니우에, 토켈라우 등이 있다. 아시아에도 위구르와 티베트가 중국의 식민지인 상태이고, 류큐 역시 일본의 식민지인 상태이다.

 

 

 

Posted by 쁘레드
Programming2019. 8. 15. 01:42

18.10 Cosmic Cuttlefish

19.04 Disco Dingo

 

최근에 NVidia 드라이버 문제로 귀찮게 되어 잘 돌아가는 빌드머신을 Ubuntu 18.10 -> Ubuntu 19.04로 upgrade. USB가 있는데, 그거 꼽고 upgrade 쉽게할수 있으면 참 좋을텐데. 19.04 설치로 들어가니 upgrade는 안된다고 나와서 맨붕.


$ sudo apt update 
$ sudo apt upgrade
$ sudo apt dist-upgrade

#Remove all no longer required packages:
$ sudo apt autoremove

#Make sure release upgrade is normal
#this can be normal, lts, never. GUI setting is Software Updater
$vi /etc/update-manager/release-upgrades

$ sudo do-release-upgrade

역시나 NVidia! 430.40 버전이 계속 문제를 일으킴.

 


sudo add-apt-repository ppa:graphics-drivers
sudo apt-get update
ubuntu-drivers devices
ubuntu-drivers autoinstall

 

하니 418.56 버전이 설치되었음. 그리고 정상으로. 헐~

Posted by 쁘레드
Programming2019. 8. 14. 06:31

가끔씩 핸드폰 비디오가 90도 돌아가 있는 상태로 저장된것을 봅니다. MP4 header에 orientation이 있어서 새로 transcoding하는 것은 안좋은 상황. 비손실과 속도까지 고려하면 헤더만 change하는것이 좋음

 

1. FFMPEG으로 transcoding

# rotate video 1=90 cw, 2=90 ccw
# -filter:v transpose=1

ffmpeg -n -i 20190811_000.mp4 -filter:v transpose=2 20190811_000_r.mp4

 

ffmpeg -i in.mov -vf "transpose=1" out.mov

0 = 90CounterCLockwise and Vertical Flip (default)

1 = 90Clockwise

2 = 90CounterClockwise

3 = 90Clockwise and Vertical Flip

 

2. VLCPlayer로

Tools >> Preferences, Show settings->check "All"

Video >> Filters >> check Rotate video filter

Tools > Effects and Filters > Video Effects > Geometry

TODO:저장되나?

 

3. MP4 Header만 손수 update

https://superuser.com/questions/1307158/change-rotation-flag-in-mp4-video-without-losing-metadata

 

Change rotation flag in MP4 video (without losing metadata)

I just want to change the rotation flag in a .mp4 video file. Many similar questions exist, most answers suggest using ffmpeg -i input.mp4 -map_metadata 0 -metadata:s:v rotate=90 -codec copy outpu...

superuser.com

open mp4 with hex editor and search for vide to find the metadata of the video track
some rows above (for my files mostly 9, sometimes 12) you should see trak...\tkhd

  • no rotation:

    00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 40
  • 180°:

    FF FF 00 00 00 00 00 00 00 00 00 00 00 00 00 00 FF FF 00 00 00 00 00 00 00 00 00 00 00 00 00 00 40
  • 90° cw:

    00 00 00 00 00 01 00 00 00 00 00 00 FF FF 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 40
  • 90° ccw:

    00 00 00 00 FF FF 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 40

 

4. EXIF 정보만 update

program이 EXIF을 읽는다면

http://owl.phy.queensu.ca/~phil/exiftool/

 

ExifTool by Phil Harvey

0 (Information Type) AFCP, AIFF, APE, APP0, APP1, APP11, APP12, APP13, APP14, APP15, APP4, APP5, APP6, APP8, ASF, Audible, CanonVRD, Composite, DICOM, DNG, DV, DjVu, Ducky, EXE, EXIF, ExifTool, FITS, FLAC, FLIR, File, Flash, FlashPix, Font, FotoStation, GI

owl.phy.queensu.ca

exiftool -Orientation='Rotate 90 CW' INPUT_FILE

exiftool -Orientation='Rotate 270 CW' INPUT_FILE

 

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

핸드폰으로 찍은 비디오가 참 화질이 좋은데, mediainfo로 보면 진자 기가맥히게 설정이 잘 되어있네요. transcoding/다시encoding해서 퀄리티를 유지하기가 진짜 어려울 정도


Video
ID                                       : 1
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : High@L4.2
Format settings                          : CABAC / 1 Ref Frames

Audio
ID                                       : 2
Format                                   : AAC LC
Format/Info                              : Advanced Audio Codec Low Complexity
Codec ID                                 : mp4a-40-2

'Programming' 카테고리의 다른 글

10 simple Linux tips in the command line  (0) 2019.08.20
Ubuntu upgrade 18.10 -> 19.04  (0) 2019.08.15
FFMPEG으로 비디오 파일에서 10초만 짤라서 만들기  (0) 2019.08.13
linux kernel build on ubuntu  (0) 2019.03.07
MinGW-w64 install  (0) 2017.01.22
Posted by 쁘레드
IT이야기2019. 8. 13. 11:55

아 된장. NVidia 이놈들....

완전 이상해졌네...

FFMPEG자동화 한다고 NVidia HW좀 이용하볼라니까 뭔 드라이버 버전이 낮다고 해서 시작한 뻘짓이...

 

430.40이 최신버전인데 최신버전 설치하다가 X Server가 완전 맛갔다. 예전에도 최신버전깔으려다가 겨우겨우 이 사이트에서 하라는 대로 하니까 돌아왔는데... 이번엔 확실히 한다고 390 싹 다지우고 깔았더니 완전....

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

https://www.mvps.net/docs/install-nvidia-drivers-ubuntu-18-04-lts-bionic-beaver-linux/

 

How to install NVIDIA drivers on Ubuntu 18.04 LTS Bionic Beaver Linux

This tutorial will help users that want to install drivers for their NVIDIA GPU...

www.mvps.net

sudo apt-get purge nvidia*
sudo add-apt-repository ppa:graphics-drivers
sudo apt-get update
sudo apt-get install nvidia-390
sudo reboot

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

최신버전 설치하려고 홈페이지까지 들어가서 현재 그래픽카드랑 호환되는지도 체크해보고, 최신것으로 받았는데. Installer같은것을 받게해주는데,

111258448 Aug 12 19:00 NVIDIA-Linux-x86_64-430.40.run

설치해도 뭐 안되고, dmesg에 딱히 error도 없고.

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

http://us.download.nvidia.com/XFree86/Linux-x86_64/430.40/README/installdriver.html

NVidia그래도 많이 좋아졌다는데도 아직도 문서도 그지같고. 불친절하기 그지없다.

Posted by 쁘레드
Programming2019. 8. 13. 07:06

핸드폰으로 비디오 찍어서 후딱 편집해서 공유할때 좋은 tip1,

FFMPEG으로 자동으로 10초씩 짤라놓는 방법

ffmpeg -loglevel quiet -n -r 60 -ss 2 -t 10 -i 0613/20190613_000.mp4 test_10_sec.mp4
ffmpeg -loglevel quiet -n -r 60 -ss 2 -t 10 -c:v h264 -i 0613/20190613_000.mp4 test_10_sec2.mp4

ffmpeg -loglevel quiet -n -ss 2 -t 10 -i 0613/20190613_000.mp4 -c:v h264 test_10_sec3.mp4

 

h264 codec이 NVidia Card를 이용하지 않으면 최신 드라이버로 update하고 FFMPEG을 다시 빌드하면 저절로 nvenc_h264 codec을 선택하게 됨. 엄청 빠름.

 

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

-loglevel 
-n : never overwrite output file
-i : input file
-r : frame rate
-vcodec : video codec
-s : frame size WxH
-ss : start offset 00:00:30
-t : time duration 00:00:05

 

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

$ ffmpeg -hwaccels
ffmpeg version N-94455-g01994c93db Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 8 (Ubuntu 8.3.0-6ubuntu1~18.10.1)
  configuration: 
  libavutil      56. 33.100 / 56. 33.100
  libavcodec     58. 55.100 / 58. 55.100
  libavformat    58. 30.100 / 58. 30.100
  libavdevice    58.  9.100 / 58.  9.100
  libavfilter     7. 58.100 /  7. 58.100
  libswscale      5.  6.100 /  5.  6.100
  libswresample   3.  6.100 /  3.  6.100
Hardware acceleration methods:
vdpau
cuda
vaapi
cuvid

.....

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

$ ffmpeg -codecs
ffmpeg version N-94455-g01994c93db Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 8 (Ubuntu 8.3.0-6ubuntu1~18.10.1)
  configuration: 
  libavutil      56. 33.100 / 56. 33.100
  libavcodec     58. 55.100 / 58. 55.100
  libavformat    58. 30.100 / 58. 30.100
  libavdevice    58.  9.100 / 58.  9.100
  libavfilter     7. 58.100 /  7. 58.100
  libswscale      5.  6.100 /  5.  6.100
  libswresample   3.  6.100 /  3.  6.100
Codecs:
 D..... = Decoding supported
 .E.... = Encoding supported
 ..V... = Video codec
 ..A... = Audio codec
 ..S... = Subtitle codec
 ...I.. = Intra frame-only codec
 ....L. = Lossy compression
 .....S = Lossless compression
 -------

 D.V.L. h263i                Intel H.263
 DEV.L. h263p                H.263+ / H.263-1998 / H.263 version 2
 DEV.LS h264                 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 (decoders: h264 h264_v4l2m2m h264_cuvid ) (encoders: h264_nvenc h264_v4l2m2m h264_vaapi nvenc nvenc_h264 )
 D.VIL. hap                  Vidvox Hap
 DEV.L. hevc                 H.265 / HEVC (High Efficiency Video Coding) (decoders: hevc hevc_v4l2m2m hevc_cuvid ) (encoders: nvenc_hevc hevc_nvenc hevc_v4l2m2m hevc_vaapi )

 D.V.L. msmpeg4v1            MPEG-4 part 2 Microsoft variant version 1
 DEV.L. msmpeg4v2            MPEG-4 part 2 Microsoft variant version 2
 DEV.L. msmpeg4v3            MPEG-4 part 2 Microsoft variant version 3 (decoders: msmpeg4 ) (encoders: msmpeg4 )

.....

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

$ ffmpeg -encoders
ffmpeg version N-94455-g01994c93db Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 8 (Ubuntu 8.3.0-6ubuntu1~18.10.1)
  configuration: 
  libavutil      56. 33.100 / 56. 33.100
  libavcodec     58. 55.100 / 58. 55.100
  libavformat    58. 30.100 / 58. 30.100
  libavdevice    58.  9.100 / 58.  9.100
  libavfilter     7. 58.100 /  7. 58.100
  libswscale      5.  6.100 /  5.  6.100
  libswresample   3.  6.100 /  3.  6.100
Encoders:
 V..... = Video
 A..... = Audio
 S..... = Subtitle
 .F.... = Frame-level multithreading
 ..S... = Slice-level multithreading
 ...X.. = Codec is experimental
 ....B. = Supports draw_horiz_band
 .....D = Supports direct rendering method 1

....

 V..... h263                 H.263 / H.263-1996
 V..... h263_v4l2m2m         V4L2 mem2mem H.263 encoder wrapper (codec h263)
 V.S... h263p                H.263+ / H.263-1998 / H.263 version 2
 V..... h264_nvenc           NVIDIA NVENC H.264 encoder (codec h264)
 V..... h264_v4l2m2m         V4L2 mem2mem H.264 encoder wrapper (codec h264)
 V..... h264_vaapi           H.264/AVC (VAAPI) (codec h264)
 V..... nvenc                NVIDIA NVENC H.264 encoder (codec h264)
 V..... nvenc_h264           NVIDIA NVENC H.264 encoder (codec h264)
 V..... nvenc_hevc           NVIDIA NVENC hevc encoder (codec hevc)
 V..... hevc_nvenc           NVIDIA NVENC hevc encoder (codec hevc)
 V..... hevc_v4l2m2m         V4L2 mem2mem HEVC encoder wrapper (codec hevc)
 V..... hevc_vaapi           H.265/HEVC (VAAPI) (codec hevc)

.....

.....

FFMPEG으로 Rotate하기

# rotate video -filter:v transpose=1 or 2. 1=90 cw, 2=90 ccw
# -filter:v transpose=1

'Programming' 카테고리의 다른 글

Ubuntu upgrade 18.10 -> 19.04  (0) 2019.08.15
핸드폰 비디오 rotate하기  (0) 2019.08.14
linux kernel build on ubuntu  (0) 2019.03.07
MinGW-w64 install  (0) 2017.01.22
github에서 배우는 machine learning, deep learning  (0) 2017.01.07
Posted by 쁘레드
IT이야기2019. 4. 10. 09:31

Ubuntu 우분투에서도 젤 좋다는 의견이 많음. 그런데 개발자가 마인드가 유리마인드임. 자신을 개발자가 아닌데 기본적인게 안되서 공부해서 개발자가 되었다고 소개하고 있음. 그런데 안티들에게 일일이 대응하면서 폭주하고 말았음.

 

우분투에서...

Settings->Region & Language

Input Sources = Korean (101/104 Key compatible)

 

sudo add-apt-repository ppa:hodong/nimf  ;// 여기서 멈쳐져 있음

sudo apt-get update

sudo apt install nimf nimf-libhangul

im-config -n nimf

 

add repository가 안됨. T.T 그래서 opensource 오픈소스를 받아서 compile해서 설치

https://gitlab.com/nimf-i18n/nimf.git  // c project

 

nimf-i18n / nimf

Nimf is an input method framework

gitlab.com

$ git clone https://gitlab.com/nimf-i18n/nimf.git

sudo apt install devscripts build-essential debhelper

 

dpkg-checkbuilddeps  ;// dependencies check

dpkg-checkbuilddepsdpkg-checkbuilddeps: error: Unmet build dependencies: libgtk2.0-dev libqt4-dev qtbase5-dev qtbase5-private-dev libappindicator3-dev librsvg2-bin libhangul-dev libanthy-dev anthy librime-dev libxklavier-dev libm17n-dev

 

sudo apt install [위 리스트]

 

$ debuild
$ cd ..

$ sudo dpkg -i nimf_2019.03.31_amd64.deb \
libnimf1_2019.03.31_amd64.deb nimf-anthy_2019.03.31_amd64.deb \
nimf-libhangul_2019.03.31_amd64.deb nimf-m17n_2019.03.31_amd64.deb \
nimf-rime_2019.03.31_amd64.deb

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

https://launchpad.net/~hodong/+archive/ubuntu/nimf 

https://gitlab.com/hodong/

https://hodong.gitlab.io/ ; 여기에 최근 글도 있네요

https://cogniti-works.blogspot.com/2016/07/manjaro-xfce-nimf.html

불러오는 중입니다...

https://www.youtube.com/watch?v=6Q6xkidRDmI

 

http://blog.daum.net/bagjunggyu/321

 

우분투 18.04.1 한글 입력 설정 및 플래시 플러그인 설치

우분투 18.04가 나온지 한참 만에 18.04.1로 포인트 릴리스를 했습니다. 그래서 이번에 우분투 18.04.1을 설치해봤습니다. 다운로드 : https://www.ubuntu.com/download/d

blog.daum.net

4) 나눔 폰트를 좋아하시는 분들은 따로 설치하시면 됩니다.

sudo apt install fonts-nanum fonts-nanum-coding

Posted by 쁘레드

 

행복이야 주관적이고 이걸 어떻게 메져-수치화-정량화 있을까하는 생각도 들지만, 이명박근혜 무리들이 만든 헬조선을 보며 행복한 나라는 어떤것인까 생각하게됨. UN에서 제공하는 리포트.

-----------

http://worldhappiness.report/ed/2019/#read

 

Home

The World Happiness Report is a landmark survey of the state of global happiness that ranks 156 countries by how happy their citizens perceive themselves to be. The report is produced by the United Nations Sustainable Development Solutions Network in partn

worldhappiness.report

-----------

Finland: Still the happiest country in the world (says UN report)

https://yle.fi/uutiset/osasto/news/finland_still_the_happiest_country_in_the_world_says_un_report/10698146

불러오는 중입니다...

2019 World Happiness Report top ten

  1. Finland (1)
  2. Denmark (3)
  3. Norway (2)
  4. Iceland (4)
  5. Netherlands (6)
  6. Switzerland (5)
  7. Sweden (9)
  8. New Zealand (8)
  9. Canada (7)
  10. Austria (12)
Posted by 쁘레드