Diff
checker
Text
Text
Images
Documents
Excel
Folders
Legal
Enterprise
Desktop
Pricing
Sign in
Download Diffchecker Desktop
Compare text
Find the difference between two text files
Tools
History
Real-time editor
Hide unchanged lines
Disable line wrap
Layout
Split
Unified
Diff precision
Smart
Word
Char
Syntax highlighting
Choose syntax
Ignore
Transform text
Go to first change
Edit input
Diffchecker Desktop
The most secure way to run Diffchecker. Get the Diffchecker Desktop app: your diffs never leave your computer!
Get Desktop
Untitled diff
Created
7 years ago
Diff never expires
Clear
Export
Share
Explain
6 removals
Lines
Total
Removed
Characters
Total
Removed
To continue using this feature, upgrade to
Diff
checker
Pro
View Pricing
56 lines
Copy
4 additions
Lines
Total
Added
Characters
Total
Added
To continue using this feature, upgrade to
Diff
checker
Pro
View Pricing
54 lines
Copy
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()
Copy
Copied
Copy
Copied
const
multiPass
= new PassThrough()
const
lenPass
= new PassThrough()
const ffmpegPass = new PassThrough()
const ffmpegPass = new PassThrough()
Copy
Copied
Copy
Copied
const multistream = new MultiStream([multiPass])
res.data.pipe(tee)
res.data.pipe(tee)
Copy
Copied
Copy
Copied
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
Copy
Copied
Copy
Copied
multistream
.on('data', chunk => {
lenPass
.on('data', chunk => {
len += chunk.length
len += chunk.length
})
})
Copy
Copied
Copy
Copied
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()
Saved diffs
Original text
Open file
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()
Changed text
Open file
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()
Find difference