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 쁘레드
IT이야기2019. 4. 2. 02:33

윈도우 머신이 꼭 필요한 이유중에 하나가(Mac은 비싸서 안되고) Lightroom이고 간혹 비디오 편집을 하려고 하면 Sony Vegas가 참 간단하고 좋은데, Lightroom 대체할 만한것은 아직 없다고 보여지고요. 비디오 편집은 요구사항이 많지 않아서 어디 있을것 같아서 찾아봤는데...

리눅스에서 비디오 편집하는것이 아주 나쁘지는 않네요. kdenlive라는 툴이 KDE env인데, 괜찮은것 같네요. 버전도 높고요. GNome도 곧 V1.0으로 발표하는듯. 그런데 NVidia 카드가 있어서 GPU Agpu acceleration(하드웨어 가속기)를 enable하려고 하니 역시 리눅스는 복잡해...

 

FFMpeg을 다시 컴파일하면 되는데, NVidia 얘네들은 리눅스 지원이 진짜 지랄같애서(요즘 많이 좋아졌다는데) 하다가 욕나오는데... shotcut이라는 얘가 이미 다 포함시켜 놨네요.

-----------

https://shotcut.com/

 

Shotcut - Home

Wide Format Support Supports hundreds of audio and video formats and codecs thanks to FFmpeg. No import required which means native editing, plus multi-format timelines, resolutions and frame-rates within a project. Frame accurate seeking supported for man

shotcut.com

 

https://www.youtube.com/watch?v=X14GvmBpq08

*H.264 Dominant
properties=x264-medium f=mp4 vcodec=libx264 acodec=aac g=120 crf=%quality ab=%audiobitrate+'k'
properties=x264-medium f=mp4 vcodec=nvenc_h264 acodec=aac g=120 crf=%quality ab=%audiobitrate+'k'

*NVENC_H264
f=mp4 vcodec=nvenc acodec=aac g=120 global_quality=21 ab=385k vq=21 r=60 preset=slow bf=2

Posted by 쁘레드
재밌는세상2019. 4. 1. 14:02

이름이 황교환인줄 알았다가 황교안인지 지난주에 알았는데, 법무부 장관까지 한 사람이 선거법을 몰랐을 수 있냐고 하는데, 나는 얘는 진짜 몰랐을 거라고 믿음. 게다가 말리는 사람을 사람으로도 안봤을거라 생각함. 내가 한다는데 감히 누가 뭐라고 해 하면서 그냥 밀고 들어갔을거라 생각함. 선거법 위반이 엄청 무서워야 하는데 솜방망이 일거라고도 생각함.

 

P.S 걔다가 얘는 총리, 대통령 권한대행까지 했지만 총리가 뭐하는 직책인지 대통령은 무슨일을 해야하는지 진짜 모를거라고 생각함.

----------

http://www.hani.co.kr/arti/politics/assembly/888098.html

 

황교안 ‘경남FC 난입사태’에 ‘불법 선거운동’ 논란

‘경기장 내 선거운동 금지’ 한국프로축구연맹 지침 어겨 경남FC 중징계 위기…승점 삭감시 2부리그 강등도 바른미래 “교활한 오버슈팅 자책골” 민주평화 “‘반칙왕’ 민낯 보여준 것” 황교안 “부족한 부분 있었다면 앞으로 없도록 하겠다”

www.hani.co.kr

http://www.shinmoongo.net/125960

 

≪신문고뉴스≫ 황교안 경남FC 축구장 유세, 불법에 대한 댓가 받아야...

 [신문고뉴스]임두만편집위원장=자유한국당의황교안대표는4.3보궐선거창원성산에출마한강기윤후보를지원하기위해현재총력을기울이고있다.이는자신

www.shinmoongo.net

 

Posted by 쁘레드
IT이야기2019. 3. 20. 15:04

ㅋㅋㅋㅋ clien.net 눈팅만하다가 새소식 좀 전할까 했더니

이건 뭥미... 오늘 열심히 댓글달았는데 30개개면 되나 했더니 5000개? 안되겠다...


Posted by 쁘레드
재밌는세상2019. 3. 19. 01:39

요즘 장자연, 김학의 사건을 다음하고 네이버에서 같은 검색어로 검색해보면. 네이버는 쓰리기인가 하는 생각이 저절로 든다.

이명박, 최순실, 박근혜로 검색해봐도 아주 웃기게 나오더니, 네이버는 욕 진짜 많이 먹어도 정신못차리네.

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

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

'김학의 성접대 의혹'을 무혐의 처리한 검사들 살펴보니

http://www.ohmynews.com/NWS_Web/View/at_pg.aspx?CNTN_CD=A0002519573&CMPT_CD=P0001&utm_campaign=daum_news&utm_source=daum&utm_medium=daumnews


[주장] '정치검찰' 일색, 국정원 대선개입 수사 외압부터 BBK 특검 다스 수사까지

황교안 최순실 김학의

허준영 경찰청장

윤중천 회장

김진태 경찰총장

조영곤 검사

박정식 검사

윤재필 검사

김수남 중앙지검장

유상범 검사

강해운 검사



Posted by 쁘레드