하늘높이의 프로그래밍 이야기

인코딩 스크립트를 이용해 동영상을 H.264로 인코딩한 후
자막을 쉽게 추가 하는 방법이 없을까 생각되서 찾아봤습니다.
2010/01/07 - [OS, DB/Linux,Unix] - 리눅스에서 iPod/iPhone 인코딩하자!!!
MP4Box라는 프로그램이 쉽게 지원하더군요.^^

먼저 mp4 동영상에 자막을 넣기 위해서는 아래와 같은 과정을 거쳐야 합니다.
smi to srt[UTF-8]
mplayer -dumpsrtsub [동영상 파일] -sub [자막파일] -subcp cp949  -vc null -vo null -noframedrop -benchmark -speed 100

만약 동영상 파일이 mplayer 에서 오류가 난다면...
mplayer /dev/zero -rawvideo ntsc:fps=1 -demuxer rawvideo -vc null -vo null -noframedrop -benchmark -sub [자막파일] -dumpsrtsub -subcp cp949 

이런 방식도 가능합니다. 대신 조금 느리죠.
smi2srt라는 Window C 프로그램도 리눅스용으로 컨버팅 해봤지만 생각보다 좋지는 않더군요 @.@

Mp4box Add
MP4Box -add dumpsub.srt:lang=ko:hdlr=sbtl [인코딩된 mp4 파일]

이제 아이팟에 넣어 볼까요?
간단한 샘플로 러브 액츄얼리를 해보았네요.




* 나중에 시간이 되면 쉘 스크립트로 하나 짜야겠네요.^^ 이놈의 감기 몸살이 떨어지면요. @.@
* 리눅스의 오픈소스로 가능하니 사용자가 소스를 올리면 IPOD용 파일(h.264)로 인코딩 해서 돌려주는 서비스도 가능 할 것으로 보입니다.

즐거운 아이팟/아이폰 라이프들 하고 계신가요?

저도 지하철에서 많이 이용하고 있습니다.
앱들을 이용하는것도 좋지만 음악이나 동영상을 보기에도 아이팟이 참 좋은데요.

그 때마다 인코딩을 하려니 쩝.... H.264 인코딩 시간이 엄청나게 걸리네요.
인코딩은 해야하는데 지금 사용하는 컴퓨터가 인코딩으로 느려지는 건 싫구요.
하여 항상 켜져있는 제 Linux 서버[넷탑]의 FFMpeg을 이용해서 인코딩 하는 방법이 없을까? 하고 찾아보았는데 아래와 같은 스크립트가 있더군요.^^

http://slated.org/howto_transcode_h264_for_ipod_with_ffmpeg
[IE로는 접속이 안되니 놀라지 마시길...@.@]

그중에 몇가지를 수정해 보았습니다.
필요 하신분은 참고하세요.^^

[주의] 이 스크립트가 돌아갈려면 mplayer,ffmpeg,gpac[MP4Box] 등이 설치 되어 있어야 합니다.

#]ipod.sh *.avi 가능!!


 

 

다윈 퀵타임 스트리밍 서버를 현재 쓰고 있는 리눅스(Fedora 10)에 깔아 보려고 만만한 문서를 검색해 보았다. 아래와 같이 CentOS에 설치하는 문서를 발견.

RPM 시스템이니 약간의 경로만 바꾸니 바로 설치가 가능했다.

 

출저: http://www.howtoforge.com/apples-darwin-streaming-server-on-centos-5.2

 

Introduction

This tutorial will run you through the installation, configuration and preparation of media for Apple’s Darwin QuickTime Streaming Server on Centos/RHEL 5.2. Darwin QuickTime Streaming Server is capable of serving H.264 and mpeg4 file formats via the RTP/RTSP streaming protocols.

Prerequisites
  1. CentOS 5.2 x86 installed
  2. Development tools must be installed (can be installed after install with

    yum groupinstall "Development Tools"

    )

  3. Static IP address and hostname; I used 192.168.0.10 and example.org as my hostname
  4. Disable firewall and SELinux (configure later)
Installing Darwin Streaming Server 6.0.3

Currently there are no official binary packages of the current version so we will grab a source RPM. Apple’s current source package dose not compile on a Linux system without being patched. Enter the following command by command!

su -
wget http://www.abrahamsson.com/DarwinStreamingServer-6.0.3-2.src.rpm
rpm -i DarwinStreamingServer-6.0.3-2.src.rpm
cd /root/rpmbuild/SPECS/
rpmbuild -bb DarwinStreamingServer.spec
cd /root/rpmbuild/RPMS/i386/
yum –y install perl-Net-SSLeay
rpm -U DarwinStreamingServer*

When installing the RPMs the install hangs when trying to start Darwin so wait a few minutes then open another terminal session using Alt + F2 and run the following as root:

killall -9 DarwinStreamingServer

To change the administrator account from the default password of “password” use the following command:

qtpasswd administrator

So DSS starts at boot up run the following:

chkconfig --level 345 dss on

'Media Tech > H.264,VC-1,Codec' 카테고리의 다른 글

FFMPEG 옵션  (0) 2012.05.11
FFMPEG Rebuild  (0) 2009.12.09
VLC 로 트랜스코딩하기  (0) 2009.02.11
MKV 포맷...  (3) 2008.09.22
Video codecs tutorial  (0) 2007.07.12

실버라이트의 H.264 지원 계획 글 이후로….

인코딩 소프트웨어인 Expression Encoder 2 서비스 팩 1에서 H.264를 지원하겠다는

계획의 글이 포스트 되었습니다.

관심 있으신 분은 아래의 글을 확인해 보시기 바랍니다.

 

http://blogs.msdn.com/expressionencoder/archive/2008/09/23/8962401.aspx

'Media Tech > Expression Encoder' 카테고리의 다른 글

Expression Encoder 3  (1) 2009.11.05



요즘에는 어둠의 경로에서 HD 동영상을 구하다 보면 문득 MKV라는 확장자가 많은것 같다.
H.264 코덱의 컨테이너로 많이 사용되는데.......

이 파일들을 집에 웹서버에 올려놓고......
다운받지 않고 스트리밍으로 보는 방법이 없을까?
생각해 보았는데....

웹서버 + MKV +  VLC 조합에서 놀라운 결과를 보여주었다.
생각도 안했던 동영상 스킵(동영상 위치 점프), 1~2초가 안되는 버퍼링... 등이 가능했다.

단 최신버전에서 한글이 잘안나오는 문제 발견.....
SMI와 기타 메시지가 ㅁㅁㅁㅁ로 표현...

어쨌든 당분간은 이조합으로 HD영화를 봐야겠다.
* VLC 최신버전은 UI도 괜찮아 졌더라....(http://videolan.org)


2007/07/19 - [Media/Open Project] - VLC 다운로드 경로와 매뉴얼 링크

'Media Tech > H.264,VC-1,Codec' 카테고리의 다른 글

FFMPEG Rebuild  (0) 2009.12.09
Apple's Darwin Streaming Server On Fedora 10  (0) 2009.04.16
VLC 로 트랜스코딩하기  (0) 2009.02.11
Video codecs tutorial  (0) 2007.07.12
[본문 스크랩] ADPCM/PCM  (0) 2006.05.29

출저 : http://www.eetimes.com/news/latest/showArticle.jhtml?articleID=184417335&pgno=1
비디오 코덱 튜토리얼

오늘 서핑하다 재미있는 글을 발견해서 원본글은 출저 링크를 눌러보시라...

그런데 일단 영어의 압박이 있으니 그림만이라도 자세히 보자!!
시간날때 영어는 사전 펴가며 -.-


Figure 1: Chronological progression of ITU and MPEG standard [10]


Figure 2: Standard Motion Compensated Video Coding


Figure 3: An illustration of inter-frame prediction in I, P and B Frames


Figure 4: Effectiveness of basic techniques. 1) No MC; 2) Adding Skip mode to form a CR coder. Case 3) Allow only zero-valued MVs. 4) Allow integer-pel MC. 5) Allow half-pel MC 6) Allowing 4-MV; 7) Allowing quarter-pel MC. Refer to [7] for additional details


View full size
Figure 5: H.264 Block diagram and features [10]


View full size

Table 1: Key compression features in standard codecs


View full size

Table 2: Codecs typically used in standard applications and roadmap

'Media Tech > H.264,VC-1,Codec' 카테고리의 다른 글

FFMPEG Rebuild  (0) 2009.12.09
Apple's Darwin Streaming Server On Fedora 10  (0) 2009.04.16
VLC 로 트랜스코딩하기  (0) 2009.02.11
MKV 포맷...  (3) 2008.09.22
[본문 스크랩] ADPCM/PCM  (0) 2006.05.29