Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Video Encoding > MPEG-4 AVC / H.264

Reply
 
Thread Tools Search this Thread Display Modes
Old 29th March 2020, 00:51   #1  |  Link
AltairAC
Registered User
 
Join Date: Jun 2011
Posts: 19
Changing the container from ts to mp4 significantly reduces file size

I downloaded a video using streamlink and got a .ts file. I changed the container with ffmpeg:
Code:
ffmpeg -i 14211.ts -vcodec copy -acodec copy out.mp4
The .mp4 file is ~50MB less in size and I would like to understand why.


Code:
General
ID                                       : 1 (0x1)
Complete name                            : C:\Users\...\14211.ts
Format                                   : MPEG-TS
File size                                : 413 MiB
Duration                                 : 47 min 55 s
Overall bit rate mode                    : Variable
Overall bit rate                         : 1 205 kb/s

Video
ID                                       : 256 (0x100)
Menu ID                                  : 1 (0x1)
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : High@L3.1
Format settings                          : CABAC / 4 Ref Frames
Format settings, CABAC                   : Yes
Format settings, Reference frames        : 4 frames
Codec ID                                 : 27
Duration                                 : 47 min 55 s
Width                                    : 1 280 pixels
Height                                   : 720 pixels
Display aspect ratio                     : 16:9
Frame rate mode                          : Variable
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Writing library                          : x264 core 123 r2189 35cf912
Encoding settings                        : cabac=1 / ref=3 / deblock=1:0:0 / analyse=0x3:0x113 / me=hex / subme=7 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=24 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=3 / b_pyramid=2 / b_adapt=1 / b_bias=0 / direct=1 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 / keyint_min=25 / scenecut=40 / intra_refresh=0 / rc_lookahead=40 / rc=crf / mbtree=1 / crf=23.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / ip_ratio=1.40 / aq=1:1.00

Audio
ID                                       : 257 (0x101)
Menu ID                                  : 1 (0x1)
Format                                   : AAC LC
Format/Info                              : Advanced Audio Codec Low Complexity
Format version                           : Version 4
Muxing mode                              : ADTS
Codec ID                                 : 15-2
Duration                                 : 47 min 54 s
Bit rate mode                            : Variable
Channel(s)                               : 2 channels
Channel layout                           : L R
Sampling rate                            : 44.1 kHz
Frame rate                               : 43.066 FPS (1024 SPF)
Compression mode                         : Lossy
Delay relative to video                  : -23 ms

Menu
ID                                       : 4096 (0x1000)
Menu ID                                  : 1 (0x1)
Duration                                 : 47 min 55 s
List                                     : 256 (0x100) (AVC) / 257 (0x101) (AAC)
Service name                             : Service01
Service provider                         : FFmpeg
Service type                             : digital television
Code:
General
Complete name                            : C:\Users\...\out.mp4
Format                                   : MPEG-4
Format profile                           : Base Media
Codec ID                                 : isom (isom/iso2/avc1/mp41)
File size                                : 359 MiB
Duration                                 : 47 min 55 s
Overall bit rate mode                    : Variable
Overall bit rate                         : 1 048 kb/s
Writing application                      : Lavf58.42.100

Video
ID                                       : 1
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : High@L3.1
Format settings                          : CABAC / 4 Ref Frames
Format settings, CABAC                   : Yes
Format settings, Reference frames        : 4 frames
Codec ID                                 : avc1
Codec ID/Info                            : Advanced Video Coding
Duration                                 : 47 min 55 s
Bit rate                                 : 911 kb/s
Width                                    : 1 280 pixels
Height                                   : 720 pixels
Display aspect ratio                     : 16:9
Frame rate mode                          : Constant
Frame rate                               : 29.970 (30000/1001) FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 0.033
Stream size                              : 312 MiB (87%)
Writing library                          : x264 core 123 r2189 35cf912
Encoding settings                        : cabac=1 / ref=3 / deblock=1:0:0 / analyse=0x3:0x113 / me=hex / subme=7 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=24 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=3 / b_pyramid=2 / b_adapt=1 / b_bias=0 / direct=1 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 / keyint_min=25 / scenecut=40 / intra_refresh=0 / rc_lookahead=40 / rc=crf / mbtree=1 / crf=23.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / ip_ratio=1.40 / aq=1:1.00
Codec configuration box                  : avcC

Audio
ID                                       : 2
Format                                   : AAC LC
Format/Info                              : Advanced Audio Codec Low Complexity
Codec ID                                 : mp4a-40-2
Duration                                 : 47 min 55 s
Bit rate mode                            : Variable
Bit rate                                 : 129 kb/s
Maximum bit rate                         : 134 kb/s
Channel(s)                               : 2 channels
Channel layout                           : L R
Sampling rate                            : 44.1 kHz
Frame rate                               : 43.066 FPS (1024 SPF)
Compression mode                         : Lossy
Stream size                              : 44.1 MiB (12%)
Default                                  : Yes
Alternate group                          : 1
AltairAC is offline   Reply With Quote
Old 29th March 2020, 01:04   #2  |  Link
manolito
Registered User
 
manolito's Avatar
 
Join Date: Sep 2003
Location: Berlin, Germany
Posts: 3,078
This is normal...

A TS container often contains a lot of padding which seems to be necessary for broadcasting. Tools like TSDoctor can remove this padding while still keeping the TS container format. And repacking to other containers like MP4 or MKV also removes at least some of this padding.

In my experience if the TS file comes from a broadcast then it is always a good idea to repack to a different container before doing anything else to it. Seeking in a HD TS file is a nightmare because there are no timecodes in it. After repacking such a file to MKV editing it is much easier.
manolito is offline   Reply With Quote
Old 29th March 2020, 01:15   #3  |  Link
AltairAC
Registered User
 
Join Date: Jun 2011
Posts: 19
Quote:
Originally Posted by manolito View Post
This is normal...

A TS container often contains a lot of padding which seems to be necessary for broadcasting. Tools like TSDoctor can remove this padding while still keeping the TS container format. And repacking to other containers like MP4 or MKV also removes at least some of this padding.

In my experience if the TS file comes from a broadcast then it is always a good idea to repack to a different container before doing anything else to it. Seeking in a HD TS file is a nightmare because there are no timecodes in it. After repacking such a file to MKV editing it is much easier.
Thank you very much!
AltairAC is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 08:12.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.