프로그램 사용/VLC2010. 4. 15. 22:47
x264 is a free library for encoding H264/AVC video streams.

중요한건 videolan.org 의 x264 개발자 페이지의 첫 줄에 나와있다.
library for encoding
H.264는 Encoding / Decoding 으로 보이고.
X.264는 opensource GPL Encoding으로 보인다.
간단하게 H.264의 반쪽 버전이라고 해야하려나?

H.264는
MPEG-4 part 10
AVC(Advanced Video Codec)

H.263은(3gpp / 영상통화)
MPEG-2
MPEG-4 Part 2

[링크 : http://www.videolan.org/developers/x264.html]
[링크 : http://en.wikipedia.org/wiki/X264]
[링크 : http://ko.wikipedia.org/wiki/X264]

[링크 : http://ko.wikipedia.org/wiki/H.264]
[링크 : http://en.wikipedia.org/wiki/H.264/MPEG-4_AVC]

http://en.wikipedia.org/wiki/H.263

Posted by 구차니
wget으로 손쉽게 다운로드 받는방법중에 찾은건 &t 값이 필요하다.
token 인지 table 인지는 모르겠지만, 이 값을 받을려고 동영상 페이지 300k 가량하는걸 받기도 모호하고
이래저래 찾아보는데 편하게 받는 법은 없는듯 하다.

http://www.youtube.com/v/BzbbpxR7ZTc
이런식으로 열면 리턴 URL로 t 값이 주어진다는데 오지도 않고..
정작 받아도 이상한 바이너리 파일이라.. 안드로메다로.. OTL

Firefox에서 열면 플래시인지 바로 전체화면(!) 플래시무비가 나온다.

유투브 H.264 인코딩 동영상 소스
요청 URL : http://www.youtube.com:80/get_video?video_id=[비디오ID]&t=[트랙 or 테이블 값]&fmt=18

파라미터
   - 비디오 아이디 : 유투브 검색 API로 쉽게 비디오 ID를 얻을 수 있습니다.
   - 트랙 or 테이블 값
      http://www.youtube.com:80/v/[비디오ID] 로 쿼리를 요청하면 Respone URI안에 t값이 포함되어져 있습니다.
   - fmt=18 : 이 파라미터를 붙이면 H.264 동영상 소스가, 붙이지 않으며 FLV 소스가 날라옵니다.

[링크 : http://blog.naver.com/cybersol/10029106108]

Fmt ID

포멧

픽셀 해상도

비디오 코덱

음성 코덱

해상도

비 고

fmt=0 

flv

320x240

flv1

mp3 1.0 22KHz

[ ]

( fmt=5와 같음)

fmt=5 

flv

320x240

flv1

mp3 1.0 22KHz

[small ]

 

fmt=6 

flv

480x360

flv1

mp3 1.0 44KHz

[ ]

(No more...)

fmt=13 

3gp

176x144

H263

AMR 2.0 8KHz

[ ]

(핸드폰 용)

fmt=17 

3gp

176x144

mpg4

AAC 1.0 22KHz

[ ]

(핸드폰 용)

fmt=18 

mp4

480x360

H264

AAC 2.0 44KHz

[large ]

 

fmt=22 

mp4

1280x720

H264

AAC 2.0 44KHz

[HD720 ]

 

fmt=34 

flv

640x480

H264

AAC 2.0 44KHz

[medium]

(기본값)

fmt=35 

flv

854x640

H264

AAC 2.0 44KHz

[large ]

 

fmt=37 

mp4

1920x1080

H264

AAC 2.0 44KHz

[HD1080]

 

[링크 : http://bluemarble.tistory.com /entry/YouTube-비디오-다운로드]

fmt는 format의 약자로, 모바일 기기나 임베디드 기기에서
특정 코덱만을 지원할 경우, 원하는 코덱/해상도를 선택하는데 이용될수 있다.
(전에 이 파일을 그렇게 찾았는데 블로그 폭발시켰는지 안떠서 OTL)

[링크 : http://hallang.tistory.com/218]

Comparison of YouTube media types

Standard Medium High 720p 1080p Mobile Old formats (pre Feb 2009)
Standard High Mobile
fmt value 34 18 35 22 37 17 0, 5 6 13
Container FLV MP4 FLV MP4 3GP FLV 3GP
Video Encoding MPEG-4 AVC (H.264) MPEG-4 Visual H.263
Aspect ratio 4:3, 16:9 16:9 11:9 4:3 11:9
Max Resolution 320×240
400×226
640×360
480×270
480×360
640×480
854×480
1280×720 1920×1080 176×144 320×240 480×360 176×144
Audio Encoding AAC MP3 AMR
Channels 2 (stereo) 1 (mono)
Sampling rate (Hz) 44100 22050 44100 8000

[링크 : http://en.wikipedia.org/wiki/YouTube#Quality_and_codecs]


Posted by 구차니
2010.07.06 추가
The Free, Cross-Platform Sound Editor

리눅스 / 윈도우 / MacOSX 지원


집에서 굴러다니는 스테레오 마이크를 사용하여 녹음하려고 하니
이상하게 윈도우 내장 녹음기는 메모리 부족이라고 배를째고..
그래서 부랴부랴 open source recorder라고 검색을 해보니 아래 녀석이 딱! 하고 나왔다.

그런데... 솔찍히.. 쓰는법을 모르겠다. ㄱ-


아래는 About 다이얼로그, 아이콘 이쁘네 -ㅁ-!

스테레오로 녹음하려면 Project - New Stereo Track 을 선택하면 된다.

그러면 익숙한(?) 좌우 채널이 분리된 하나의 Audio Track이 생성된다.

상단의 빨간 원형 버튼(일반적인 녹음)을 누르면 녹음이 된다.

[링크 : http://audacity.sourceforge.net/]


사족
 TC-1100 노트북에서는 스테레오 마이크가 크게 녹음되지만, mono로만 되고
 데스크탑에서는  stereo로 녹음되나, 소리가 거의 들릴락 말락한다. 물론 음질은 매우 좋다.
 아마도, 스테레오 마이크가 다이나믹(패시브)가 아닌 액티브(콘덴서) 마이크라서 그런듯 싶다.

[링크 : http://www.digitalaudio.co.kr/good/sa442.html]
이녀석이랑 동일하게 생겼는데.. 음.. 콘덴서 마이크라서 전원공급이 안되서 작게 녹음되는건가..
Posted by 구차니
저번에 안되도록 막힌 방법처럼 간단하진 않지만.
어쩌면 구식 방법으로 다운로드 하는것과 유사한 방법으로 VLC에서 동영상 재생이 가능한 방법이다.

1. video ID를 알아낸다.
2. token을 알아낸다.
3. vlc에 네트워크 스트림에 붙여넣는다.
http://www.youtube.com/get_video?video_id=[video_id]&t=[token_value]

video ID는 주소표시줄에 나오지만,
token은 그 페이지에서 java script중에 &t= 으로 검색하면 나온다.

2010/04/13 - Dreambox youtube VLC
Posted by 구차니
프로그램 사용/VLC2010. 4. 13. 13:55
매일매일 빌드하는 버전으로, 일종의 개발버전 릴리즈이다.

[링크 : http://nightlies.videolan.org/]
Posted by 구차니
linux에서 제공하는 표준 API는 존재하지 않아
C++에서도 클래스를 만들어 쓰거나, 별도의 함수를 만들어 써야 한다고 한다.

일단 Encoding은 isalnum() 이 아닐경우에는 %02X로 출력해주면 될 것으로 보이고
Decoding은 %[0-9a-f][0-9a-f] 일 경우에는 %c로 출력해주면 될 것으로 보인다.

Encoding은 한글자만 보면 되지만
Decoding은 두글자를 보면서 해야 해서 귀찮을듯..


아래는 소스가 있는 페이지 이지만, 검증은 아직 해보지 않았음
  [링크 : http://tistory.izyou.net/entry/URL-인코딩, 디코딩 클래스]
  [링크 : http://remipa.pe.kr/zog/?no=118]
  [링크 : http://demo.initech.com/?document_srl=237]
  [링크 : http://smok95.tistory.com/entry/URL-EncodeDecode]
Posted by 구차니
웹(HTML)      http://www.youtube.com/results?search_query=검색어
RSS(XML)     http://gdata.youtube.com/feeds/base/videos?q=검색어
api(XML)       http://gdata.youtube.com/feeds/api/videos?q=검색어
Posted by 구차니
wget은 HTTP나 FTP 등의 프로토콜을 통해 웹페이지나 파일을 다운받는 유틸리티이다.
아무튼 youtube에서 파일로 다운로드 받기위해 주소를 변환해서 시도를 해도
403 Forbidden 에러만 날뿐 다운로드 되지 않는다.

아무튼 쿠키를 저장하고, 이를 다시 불러들여 다운로드를 시도하면 제대로 받아진다.
쿠키를 이용해서 세션이 달라지면, 이전의 내용은 무효화 되서 그런것으로 생각된다.

--no-cookies
Disable the use of cookies. Cookies are a mechanism for maintaining server-side state. The server sends the client a cookie using the Set-Cookie header, and the client responds with the same cookie upon further requests. Since cookies allow the server owners to keep track of visitors and for sites to exchange this information, some consider them a breach of privacy. The default is to use cookies; however, storing cookies is not on by default.


--load-cookies file
Load cookies from file before the first HTTP retrieval. file is a textual file in the format originally used by Netscape's cookies.txt file.

You will typically use this option when mirroring sites that require that you be logged in to access some or all of their content. The login process typically works by the web server issuing an http cookie upon receiving and verifying your credentials. The cookie is then resent by the browser when accessing that part of the site, and so proves your identity.

Mirroring such a site requires Wget to send the same cookies your browser sends when communicating with the site. This is achieved by ‘--load-cookies’—simply point Wget to the location of the cookies.txt file, and it will send the same cookies your browser would send in the same situation. Different browsers keep textual cookie files in different locations:

Netscape 4.x.
The cookies are in ~/.netscape/cookies.txt.
Mozilla and Netscape 6.x.
Mozilla's cookie file is also named cookies.txt, located somewhere under ~/.mozilla, in the directory of your profile. The full path usually ends up looking somewhat like ~/.mozilla/default/some-weird-string/cookies.txt.
Internet Explorer.
You can produce a cookie file Wget can use by using the File menu, Import and Export, Export Cookies. This has been tested with Internet Explorer 5; it is not guaranteed to work with earlier versions.
Other browsers.
If you are using a different browser to create your cookies, ‘--load-cookies’ will only work if you can locate or produce a cookie file in the Netscape format that Wget expects.

If you cannot use ‘--load-cookies’, there might still be an alternative. If your browser supports a “cookie manager”, you can use it to view the cookies used when accessing the site you're mirroring. Write down the name and value of the cookie, and manually instruct Wget to send those cookies, bypassing the “official” cookie support:

          wget --no-cookies --header "Cookie: name=value"


--save-cookies file
Save cookies to file before exiting. This will not save cookies that have expired or that have no expiry time (so-called “session cookies”), but also see ‘--keep-session-cookies’.


--keep-session-cookies
When specified, causes ‘--save-cookies’ to also save session cookies. Session cookies are normally not saved because they are meant to be kept in memory and forgotten when you exit the browser. Saving them is useful on sites that require you to log in or to visit the home page before you can access some pages. With this option, multiple Wget runs are considered a single browser session as far as the site is concerned.

Since the cookie file format does not normally carry session cookies, Wget marks them with an expiry timestamp of 0. Wget's ‘--load-cookies’ recognizes those as session cookies, but it might confuse other browsers. Also note that cookies so loaded will be treated as other session cookies, which means that if you want ‘--save-cookies’ to preserve them again, you must use ‘--keep-session-cookies’ again.


[링크 : http://www.gnu.org/software/wget/manual/html_node/HTTP-Options.html]

--save-cookies 로 저장한 youtube 쿠키이다. 음.. 무슨 의미지 -ㅁ-?
$ cat yt.cookie
# HTTP cookie file.
# Generated by Wget on 2010-04-10 11:57:59.
# Edit at your own risk.

.youtube.com    TRUE    /       FALSE   1586228278      PREF    f1=50000000&f2=8000000
.youtube.com    TRUE    /       FALSE   1291604278      VISITOR_INFO1_LIVE      FNfBrJzTQY

$ wget "http://www.youtube.com/watch?v=mdljV2uEs1A" --save-cookies yt.cookie
$ wget --load-cookies=yt.cookie "http://v22.lscache2.c.youtube.com/videoplayback?ip=211.0.0.0&sparams=id%2Cexpire%2Cip%2Cipbits%2Ci
tag%2Calgorithm%2Cburst%2Cfactor&fexp=904405%2C900037&algorithm=throttle-factor&itag=35&ipbits=8&burst=40&sver=3&expire=1270890000&key=yt1&signature=5C611E956FB97E74D3435F8815A7A2376E3C61D4.C2C593CDDE0C15671462BB13C5404EC6927F7F7D&factor=1.25&id=99d963576b84b350" -O file.mp4
--2010-04-10 12:33:26--  http://v22.lscache2.c.youtube.com/videoplayback?ip=211.0.0.0&sparams=id%2Cexpire%2Cip%2Cipbits%2Citag%2Calgorithm%2Cburst%2Cfactor&fexp=904405%2C900037&algorithm=throttle-factor&itag=35&ipbits=8&burst=40&sver=3&expire=1270890000&key=yt1&signature=5C611E956FB97E74D3435F8815A7A2376E3C61D4.C2C593CDDE0C15671462BB13C5404EC6927F7F7D&factor=1.25&id=99d963576b84b350
Resolving v22.lscache2.c.youtube.com... 74.125.167.33
접속 v22.lscache2.c.youtube.com|74.125.167.33|:80... 접속됨.
HTTP request sent, awaiting response... 200 OK
Length: 15708973 (15M) [video/x-flv]
Saving to: `file.mp4'

100%[==========================================================================>] 15,708,973   105K/s   in 2m 0s

2010-04-10 12:35:27 (128 KB/s) - `file.mp4' saved [15708973/15708973]

URL이 너무 길어서 별도의 파일이름을 지정해주지 않으면
Cannot write to `videoplayback?ip=211.0.0.0&sparams=id,expire,ip,ipbits,itag,algorithm,burst,factor&fexp=904405,900037&algorithm=throttle-factor&itag=35&ipbits=8&burst=40&sver=3&expire=1270890000&key=yt1&signature=5C611E956FB97E74D3435F8815A7A2376E3C61D4.C2C593CDDE0C15671462BB13C5404EC6927F7F7D&factor=1.25&id=99d963576b84b350' (File name too long).
주소가 255자를 넘어서는 관계로, 파일 이름으로 하기에는 너무 길다고 에러가 발생한다.
반드시 -O filename 으로 별도의 이름을 지정해 주어야 한다.

2010/04/09 - youtube 동영상 페이지 fmt_map, fmt_url_map, fmt_list, fmt_stream_map
[링크 : http://kldp.org/node/75150]


Posted by 구차니
유튜브 페이지에는 4개의 변수가 존재한다.
일단 이 녀석들을 URL decoding 해주면 아래와 같은 값으로 나오게 된다.

fmt_mapfmt_list와 내용이  유사하며
fmt_url_mapfmt_stream_map 과 내용이 유사하다.

아무튼 다운로드 주소를 얻을려면 fmt_url_map / fmt_stream_map 중에 하나에서 빼내면 된다.

fmt_map=22/2000000/9/0/115,35/640000/9/0/115,34/0/9/0/115,5/0/7/0/0&mpu=True&hl=ko_KR&ad_flags=0&rv.5.length_seconds=243&rv.0.thumbnailUrl=http://i1.ytimg.com/vi/lzVFyWNzjtE/default.jpg&rv.7.author=allkpop&cid=11332&rv.1.length_seconds=240&ad_logging_flag=1&rv.2.id=2f5hg3FlYc4

fmt_url_map=22|http://v15.lscache4.c.youtube.com/videoplayback?ip=0.0.0.0&sparams=id%2Cexpire%2Cip%2Cipbits%2Citag%2Cratebypass%2Coc%3AU0dWRVhNU19FSkNNNl9QR1dD&fexp=900023%2C901802&itag=22&ipbits=0&sver=3&ratebypass=yes&expire=1270825200&key=yt1&signature=428B55DAF445D856E5F8A704C91B635776474DC3.B807EF9FE3245923257F82EDCDDD2FB7EFC4CFAF&id=4c66f02fc912a449,


하지만.. 리눅스에서 wget으로는 다운로드 되지 않는다 OTL

$ wget "http://v15.lscache4.c.youtube.com/videoplayback?ip=0.0.0.0&sparams=id%2Cexpire%2Cip%2Cipbits%2Citag%2Cratebypass%2Coc%3AU0dWRVhNU19FSkNNNl9QR1dD&fexp=900023%2C901802&itag=22&ipbits=0&sver=3&ratebypass=yes&expire=1270825200&key=yt1&signature=428B55DAF445D856E5F8A704C91B635776474DC3.B807EF9FE3245923257F82EDCDDD2FB7EFC4CFAF&id=4c66f02fc912a449"
--17:55:02--  http://v15.lscache4.c.youtube.com/videoplayback?ip=0.0.0.0&sparams=id%2Cexpire%2Cip%2Cipbits%2Citag%2Cratebypass%2Coc%3AU0dWRVhNU19FSkNNNl9QR1dD&fexp=900023%2C901802&itag=22&ipbits=0&sver=3&ratebypass=yes&expire=1270825200&key=yt1&signature=428B55DAF445D856E5F8A704C91B635776474DC3.B807EF9FE3245923257F82EDCDDD2FB7EFC4CFAF&id=4c66f02fc912a449
Resolving v15.lscache4.c.youtube.com... 74.125.107.35
Connecting to v15.lscache4.c.youtube.com|74.125.107.35|:80... connected.
HTTP request sent, awaiting response... 403 Forbidden
17:55:02 ERROR 403: Forbidden.


2010/02/26 - [프로그램 사용/유튜브 (youtube)] - 유튜브 파일 다운로드 하기(download youtube as file)

Posted by 구차니
XML_SetCharacterDataHandler() 함수는 prototype에서 보이는 대로
XML_char *s, int len 두개의 변수를 이용한다.

즉, 이 함수를 통해 받아들여지는 내용을 출력하기 위해서는
printf("%s",s); 가 아닌

for (int i = 0; i < len; i++) printf("%c",s[i]);
로 한글자씩 len에 맞게 출력을 해주어야 한다.

XML_SetCharacterDataHandler(XML_Parser p, XML_CharacterDataHandler charhndl)

typedef void (*XML_CharacterDataHandler)(void *userData, const XML_Char *s, int len);

Set a text handler. The string your handler receives is NOT zero terminated. You have to use the length argument to deal with the end of the string. A single block of contiguous text free of markup may still result in a sequence of calls to this handler. In other words, if you're searching for a pattern in the text, it may be split across calls to this handler.

[링크 : http://www.xml.com/pub/a/1999/09/expat/index.html?page=3#chardatahandler]

<media:description type='plain'>The funniest 6 minutes you will ever see! Remember how many of these you have done! Follow @ http://www.twitter.com/judsonlaipply Check my book out at http://www.mightaswelldance.com
http://www.theevolutionofdance.com -
for more info including song list!</media:description>

                        <media:description type="plain">
========== [4]
The funniest 6 minutes you will ever see! Remember how many of these you have done! Follow @ http://www.twitter.com/judsonlaipply Ch
eck my book out at http://www.mightaswelldance.com
========== [4]


========== [4]
http://www.theevolutionofdance.com -
========== [4]


========== [4]
for more info including song list!
                        </media:description>

그리고, 위에 보이듯이, 줄단위로 받아들이므로
단순하게 한번 복사하는 걸로는 충분하지 않아 보인다.(어떻게 할지 모호하면.. realloc 해주어야 하나..)

'프로그램 사용 > expat & XML' 카테고리의 다른 글

SAX (Simple API for XML)  (0) 2010.04.23
xml 트리 탐색 - XML tree navigation  (0) 2010.04.17
&amp; &lt; &gt; &quot; 는 머지?  (0) 2010.03.31
expat '간략한' 사용법  (0) 2010.03.28
expat-2.0.1 example  (11) 2010.03.23
Posted by 구차니