Diff
checker
텍스트
텍스트
이미지
문서
Excel
폴더
Legal
Enterprise
데스크톱
요금제
로그인
데스크톱 앱 다운로드
텍스트 비교
두 텍스트 파일의 차이점을 찾아보세요
도구
기록
실시간 편집
변경 없는 행 숨기기
줄바꿈 비활성화
레이아웃
나란히 보기
합쳐 보기
비교 단위
스마트
단어
글자
구문 강조
언어 선택
제외
텍스트 변환
첫 변경으로
수정
Diffchecker Desktop
가장 안전하게 Diffchecker를 사용하는 방법. 데스크톱 앱을 사용하면 비교 데이터가 외부로 전송되지 않습니다!
데스크톱 앱 받기
Untitled diff
생성일
7년 전
비교 결과 만료 없음
초기화
내보내기
공유
설명
6 삭제
행
총
삭제
글자
총
삭제
이 기능을 계속 사용하려면 업그레이드해 주세요
Diff
checker
Pro
요금제 보기
56 행
복사
4 추가
행
총
추가
글자
총
추가
이 기능을 계속 사용하려면 업그레이드해 주세요
Diff
checker
Pro
요금제 보기
54 행
복사
const { PassThrough } = require('stream')
const { PassThrough } = require('stream')
const { promisify } = require('util')
const { promisify } = require('util')
const axios = require('axios')
const axios = require('axios')
const MultiStream = require('multistream')
const MultiStream = require('multistream')
const ffprobePath = require('@ffprobe-installer/ffprobe').path
const ffprobePath = require('@ffprobe-installer/ffprobe').path
const ffmpeg = require('fluent-ffmpeg')
const ffmpeg = require('fluent-ffmpeg')
ffmpeg.setFfprobePath(ffprobePath)
ffmpeg.setFfprobePath(ffprobePath)
const ffprobeAsync = promisify(ffmpeg.ffprobe)
const ffprobeAsync = promisify(ffmpeg.ffprobe)
const cl = console.log
const cl = console.log
async function run () {
async function run () {
const url = 'https://storage.arc.io/arc/homepage_demo_files/vacations.mp4'
const url = 'https://storage.arc.io/arc/homepage_demo_files/vacations.mp4'
const res = await axios.get(url, { responseType: 'stream' })
const res = await axios.get(url, { responseType: 'stream' })
const contentLength = Number(res.headers['content-length'])
const contentLength = Number(res.headers['content-length'])
const tee = new PassThrough()
const tee = new PassThrough()
복사
복사됨
복사
복사됨
const
multiPass
= new PassThrough()
const
lenPass
= new PassThrough()
const ffmpegPass = new PassThrough()
const ffmpegPass = new PassThrough()
복사
복사됨
복사
복사됨
const multistream = new MultiStream([multiPass])
res.data.pipe(tee)
res.data.pipe(tee)
복사
복사됨
복사
복사됨
tee.pipe(
multiPass
)
tee.pipe(
lenPass
)
tee.pipe(ffmpegPass)
tee.pipe(ffmpegPass)
const p1 = ffprobeAsync(ffmpegPass).then(metadata => {
const p1 = ffprobeAsync(ffmpegPass).then(metadata => {
tee.unpipe(ffmpegPass)
tee.unpipe(ffmpegPass)
// ffmpegPass.destroy()
// ffmpegPass.destroy()
return metadata
return metadata
})
})
const p2 = new Promise(resolve => {
const p2 = new Promise(resolve => {
let len = 0
let len = 0
복사
복사됨
복사
복사됨
multistream
.on('data', chunk => {
lenPass
.on('data', chunk => {
len += chunk.length
len += chunk.length
})
})
복사
복사됨
복사
복사됨
multistream
.on('end', () => {
lenPass
.on('end', () => {
resolve(len)
resolve(len)
})
})
})
})
const [res1, length] = await Promise.all([p1, p2])
const [res1, length] = await Promise.all([p1, p2])
console.log(contentLength, length)
console.log(contentLength, length)
if (contentLength !== length) {
if (contentLength !== length) {
cl('LENGTH MISMATCH')
cl('LENGTH MISMATCH')
} else {
} else {
cl('okay')
cl('okay')
}
}
}
}
run()
run()
저장된 비교 결과
원본
파일 열기
const { PassThrough } = require('stream') const { promisify } = require('util') const axios = require('axios') const MultiStream = require('multistream') const ffprobePath = require('@ffprobe-installer/ffprobe').path const ffmpeg = require('fluent-ffmpeg') ffmpeg.setFfprobePath(ffprobePath) const ffprobeAsync = promisify(ffmpeg.ffprobe) const cl = console.log async function run () { const url = 'https://storage.arc.io/arc/homepage_demo_files/vacations.mp4' const res = await axios.get(url, { responseType: 'stream' }) const contentLength = Number(res.headers['content-length']) const tee = new PassThrough() const multiPass = new PassThrough() const ffmpegPass = new PassThrough() const multistream = new MultiStream([multiPass]) res.data.pipe(tee) tee.pipe(multiPass) tee.pipe(ffmpegPass) const p1 = ffprobeAsync(ffmpegPass).then(metadata => { tee.unpipe(ffmpegPass) // ffmpegPass.destroy() return metadata }) const p2 = new Promise(resolve => { let len = 0 multistream.on('data', chunk => { len += chunk.length }) multistream.on('end', () => { resolve(len) }) }) const [res1, length] = await Promise.all([p1, p2]) console.log(contentLength, length) if (contentLength !== length) { cl('LENGTH MISMATCH') } else { cl('okay') } } run()
수정본
파일 열기
const { PassThrough } = require('stream') const { promisify } = require('util') const axios = require('axios') const MultiStream = require('multistream') const ffprobePath = require('@ffprobe-installer/ffprobe').path const ffmpeg = require('fluent-ffmpeg') ffmpeg.setFfprobePath(ffprobePath) const ffprobeAsync = promisify(ffmpeg.ffprobe) const cl = console.log async function run () { const url = 'https://storage.arc.io/arc/homepage_demo_files/vacations.mp4' const res = await axios.get(url, { responseType: 'stream' }) const contentLength = Number(res.headers['content-length']) const tee = new PassThrough() const lenPass = new PassThrough() const ffmpegPass = new PassThrough() res.data.pipe(tee) tee.pipe(lenPass) tee.pipe(ffmpegPass) const p1 = ffprobeAsync(ffmpegPass).then(metadata => { tee.unpipe(ffmpegPass) // ffmpegPass.destroy() return metadata }) const p2 = new Promise(resolve => { let len = 0 lenPass.on('data', chunk => { len += chunk.length }) lenPass.on('end', () => { resolve(len) }) }) const [res1, length] = await Promise.all([p1, p2]) console.log(contentLength, length) if (contentLength !== length) { cl('LENGTH MISMATCH') } else { cl('okay') } } run()
비교하기