[FFmpeg-user] Does "cat" degrade video quality?
Dan Harkless
ffmpeg at harkless.org
Fri Dec 2 17:45:09 EET 2022
On 12/2/2022 4:36 AM, MyCraigs List via ffmpeg-user wrote:
> I'm running Debian 11.
> I use the command line "cat" to concatenate videos of all the same quality together. All VOB files are cat'd together and none others. The second bunch of videos I cat together are from a Sony video camera and are "MTS" files. That's to say I do not cat VOB and MTS files together.
> The command I use for VOB is (at command line) $ cat File_1.VOB File_2.VOB> New_File_1.VOBThe command I use for MTS is (at command line) $ cat File_1.MTS File_2.MTS> New_File_2.MTS
>
> Not wanting to lose any video or audio quality, does "cat" files degrade their quality? If it does can you recommend a code line that'll preserve the quality?
>
> VOB file example;
> Input #0, mpeg, from 'VTS_06_1.VOB':
> Duration: 00:00:32.53, start: 0.213367, bitrate: 6688 kb/s
> Stream #0:0[0x1bf]: Data: dvd_nav_packet
> Stream #0:1[0x1e0]: Video: mpeg2video (Main), yuv420p(tv, bottom first), 720x480 [SAR 8:9 DAR 4:3], 5000 kb/s, 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc
> Side data:
> cpb: bitrate max/min/avg: 5000000/0/0 buffer size: 1835008 vbv_delay: N/A
> Stream #0:2[0xa0]: Audio: pcm_dvd, 48000 Hz, stereo, s16, 1536 kb/s
>
>
> MTS file example;
> Input #0, mpegts, from '00105.MTS':
> Duration: 00:00:49.06, start: 1.033367, bitrate: 22411 kb/s
> Program 1
> Stream #0:0[0x1011]: Video: h264 (High) (HDMV / 0x564D4448), yuv420p(top first), 1920x1080 [SAR 1:1 DAR 16:9], 29.97 fps, 59.94 tbr, 90k tbn, 59.94 tbc
> Stream #0:1[0x1100]: Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz, stereo, fltp, 256 kb/s
> Stream #0:2[0x1200]: Subtitle: hdmv_pgs_subtitle ([144][0][0][0] / 0x0090), 1920x1080
I've never dug into the technicalities of VOB files (nor MTS). The most
I've done with them aside from extracting them into more conventional
video containers with DVD-ripping software such as MakeMKV is to play
them with VLC Media Player.
'cat' just does a straight binary concatenation of files, without
touching their contents (assuming you don't give it any commandline
options), so no, there's no quality degradation. However, I'm unaware if
VOB or MTS files have headers that need to be preserved and that need to
match things like the time duration of the file.
Have you tried watching / listening to the concatenated files with a
player (e.g. VLC)? Do they look and sound OK when you cross the time
index of the concatenation point? If so, I think you're probably fine
(though depending on what your intended use is, you might run into
trouble in the future due to
the files not being standards-compliant thanks to header issues).
If you have problems, you could try concatenating them with ffmpeg
instead, à la the examples here:
https://stackoverflow.com/questions/7333232/how-to-concatenate-two-mp4-files-using-ffmpeg
--
Dan Harkless
http://harkless.org/dan/
More information about the ffmpeg-user
mailing list