merging two files without loosing chromecast compatibility

Discuss encoding for devices and presets.
Forum rules
An Activity Log is required for support requests. Please read How-to get an activity log? for details on how and why this should be provided.
Post Reply
mikovich
Posts: 3
Joined: Fri Apr 01, 2022 11:06 am

merging two files without loosing chromecast compatibility

Post by mikovich »

Hello.

Description of problem or question:
I have got two video files created with the Chromecast 1080 preset. They have to be compatible with Chromecast 3rd Gen.
I am trying to merge the audio from one with the other video file.
I have tried simple ffmpeg command and avidemux. But I loose the compability of the container and the file has to be repackaged when streaming from jellyfin to Chromecast 3rd Gen. This is not a challenge for the setup but I want to do it the right way.

Sorry for the "off topic", but I thought maybe you guys could help with the preservation of compability.

HandBrake version (e.g., 1.0.0):
1.3.1 (x86_64)

Operating system and version (e.g., Ubuntu 16.04 LTS, macOS 10.13 High Sierra, Windows 10 Creators Update):
Ubuntu 20.04.4 LTS
Jellyfin Version: 10.7.7
Chromecast 3rd Gen
Woodstock
Veteran User
Posts: 4614
Joined: Tue Aug 27, 2013 6:39 am

Re: merging two files without loosing chromecast compatibility

Post by Woodstock »

MKV files can be merged using mkvmerge in mkvtoolnix. There is a graphic interface available for it. That's probably the simplest. You can open both source files, and select the tracks you want in the output. Just make sure you don't select the two source files as "concat".

If you're dealing with MP4 files, that complicates things a bit, although I think you could use mkvmerge to combine them into an MKV, then have ffmpeg simply convert the container to MP4.
mikovich
Posts: 3
Joined: Fri Apr 01, 2022 11:06 am

Re: merging two files without loosing chromecast compatibility

Post by mikovich »

Hi. Thanks for the fast answer.

Yes, Mkvtoolnix works good for merging. I use it regularly.
I am struggling with putting it again in a chromcast3 compatible mp4 container.

The following ffmpeg command does not do the job.
ffmpeg -i input.mkv -map 0 -acodec copy -vcodec copy output.m4v
(also not ...output.mp4)

Jellyfin reports:
"The media is in an incompatible file container (MKV, AVI, WMV, etc) but both the video stream and audio stream are compatible with the device. The media will be repackaged losslessly on the fly before being sent to the device.
Remux uses very little processing power with a completely lossless media quality."

In Browsers and on semi-new Androids it is fully compatible.
Once again, sorry or "off topic". Remuxing it is not the end of the world. I just thought, that there was some secret chromecast container command magic. ;-)
Maybe it is just an issue with the old chromecast device.
rollin_eng
Veteran User
Posts: 4840
Joined: Wed May 04, 2011 11:06 pm

Re: merging two files without loosing chromecast compatibility

Post by rollin_eng »

Can you please post mediainfo reports for your compatible and not compatible files.
mikovich
Posts: 3
Joined: Fri Apr 01, 2022 11:06 am

Re: merging two files without loosing chromecast compatibility

Post by mikovich »

input.m4v - created with Chromecast 1080 preset

Code: Select all

General
Complete name                            : input.m4v
Format                                   : MPEG-4
Format profile                           : Base Media / Version 2
Codec ID                                 : mp42 (isom/iso2/avc1/mp41)
File size                                : 908 MiB
Duration                                 : 1 h 37 min
Overall bit rate                         : 1 299 kb/s
Movie name                               : ###
Encoded date                             : UTC 2022-03-08 12:56:18
Tagged date                              : UTC 2022-03-08 12:56:18
Writing application                      : HandBrake 1.3.1 2020032300

Video
ID                                       : 1
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : High@L4
Format settings                          : CABAC / 16 Ref Frames
Format settings, CABAC                   : Yes
Format settings, Reference frames        : 16 frames
Codec ID                                 : avc1
Codec ID/Info                            : Advanced Video Coding
Duration                                 : 1 h 37 min
Bit rate                                 : 805 kb/s
Width                                    : 720 pixels
Height                                   : 434 pixels
Display aspect ratio                     : 2.35:1
Frame rate mode                          : Constant
Frame rate                               : 25.000 FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 0.103
Stream size                              : 563 MiB (62%)
Writing library                          : x264 core 155 r2917 0a84d98
Encoding settings                        : cabac=1 / ref=16 / deblock=1:0:0 / analyse=0x3:0x133 / me=umh / subme=10 / psy=1 / psy_rd=1,00:0,00 / mixed_ref=1 / me_range=24 / chroma_me=1 / trellis=2 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=6 / lookahead_threads=1 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=8 / b_pyramid=2 / b_adapt=2 / b_bias=0 / direct=3 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 / keyint_min=25 / scenecut=40 / intra_refresh=0 / rc_lookahead=60 / rc=crf / mbtree=1 / crf=19,0 / qcomp=0,60 / qpmin=0 / qpmax=69 / qpstep=4 / vbv_maxrate=25000 / vbv_bufsize=31250 / crf_max=0,0 / nal_hrd=none / filler=0 / ip_ratio=1,40 / aq=1:1,00
Encoded date                             : UTC 2022-03-08 12:56:18
Tagged date                              : UTC 2022-03-08 12:56:18
Color range                              : Limited
Color primaries                          : BT.601 PAL
Transfer characteristics                 : BT.709
Matrix coefficients                      : BT.601
Menus                                    : 5
Codec configuration box                  : avcC

Audio #1
ID                                       : 2
Format                                   : AAC LC
Format/Info                              : Advanced Audio Codec Low Complexity
Codec ID                                 : mp4a-40-2
Duration                                 : 1 h 37 min
Bit rate mode                            : Constant
Bit rate                                 : 161 kb/s
Channel(s)                               : 2 channels
Channel layout                           : L R
Sampling rate                            : 48.0 kHz
Frame rate                               : 46.875 FPS (1024 SPF)
Compression mode                         : Lossy
Stream size                              : 112 MiB (12%)
Title                                    : German / German
Language                                 : German
Default                                  : Yes
Alternate group                          : 1
Encoded date                             : UTC 2022-03-08 12:56:18
Tagged date                              : UTC 2022-03-08 12:56:18
Menus                                    : 5

Audio #2
ID                                       : 3
Format                                   : AAC LC
Format/Info                              : Advanced Audio Codec Low Complexity
Codec ID                                 : mp4a-40-2
Duration                                 : 1 h 37 min
Bit rate mode                            : Constant
Bit rate                                 : 161 kb/s
Channel(s)                               : 2 channels
Channel layout                           : L R
Sampling rate                            : 48.0 kHz
Frame rate                               : 46.875 FPS (1024 SPF)
Compression mode                         : Lossy
Stream size                              : 112 MiB (12%)
Title                                    : English / English
Language                                 : English
Default                                  : No
Alternate group                          : 1
Encoded date                             : UTC 2022-03-08 12:56:18
Tagged date                              : UTC 2022-03-08 12:56:18
Menus                                    : 5

Audio #3
ID                                       : 4
Format                                   : AAC LC
Format/Info                              : Advanced Audio Codec Low Complexity
Codec ID                                 : mp4a-40-2
Duration                                 : 1 h 37 min
Bit rate mode                            : Constant
Bit rate                                 : 161 kb/s
Channel(s)                               : 2 channels
Channel layout                           : L R
Sampling rate                            : 48.0 kHz
Frame rate                               : 46.875 FPS (1024 SPF)
Compression mode                         : Lossy
Stream size                              : 112 MiB (12%)
Title                                    : French / French
Language                                 : French
Default                                  : No
Alternate group                          : 1
Encoded date                             : UTC 2022-03-08 12:56:18
Tagged date                              : UTC 2022-03-08 12:56:18
Menus                                    : 5

Menu
ID                                       : 5
Codec ID                                 : text
Duration                                 : 1 h 37 min
Language                                 : English
Encoded date                             : UTC 2022-03-08 12:56:18
Tagged date                              : UTC 2022-03-08 12:56:18
Menu For                                 : 1,2,3,4
00:00:00.000                             : Chapter 1
00:10:56.560                             : Chapter 2
00:19:16.800                             : Chapter 3
00:29:29.680                             : Chapter 4
00:40:30.680                             : Chapter 5
00:51:18.240                             : Chapter 6
01:03:55.840                             : Chapter 7
01:11:02.280                             : Chapter 8
01:20:16.000                             : Chapter 9
01:23:19.640                             : Chapter 10
01:31:21.000                             : Chapter 11
01:34:45.360                             : Chapter 12

merged.mp4 - merged input.m4v and audio from input2.m4v with Mkvtoolnix + put in mp4 container with ffmpeg command (see above)

Code: Select all

General
Complete name                            : merged.mp4
Format                                   : MPEG-4
Format profile                           : Base Media
Codec ID                                 : isom (isom/iso2/avc1/mp41)
File size                                : 1.00 GiB
Duration                                 : 1 h 37 min
Overall bit rate                         : 1 467 kb/s
Writing application                      : Lavf58.29.100

Video
ID                                       : 1
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : High@L4
Format settings                          : CABAC / 16 Ref Frames
Format settings, CABAC                   : Yes
Format settings, Reference frames        : 16 frames
Codec ID                                 : avc1
Codec ID/Info                            : Advanced Video Coding
Duration                                 : 1 h 37 min
Bit rate                                 : 805 kb/s
Width                                    : 720 pixels
Height                                   : 434 pixels
Display aspect ratio                     : 2.35:1
Frame rate mode                          : Constant
Frame rate                               : 25.000 FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 0.103
Stream size                              : 563 MiB (55%)
Writing library                          : x264 core 155 r2917 0a84d98
Encoding settings                        : cabac=1 / ref=16 / deblock=1:0:0 / analyse=0x3:0x133 / me=umh / subme=10 / psy=1 / psy_rd=1,00:0,00 / mixed_ref=1 / me_range=24 / chroma_me=1 / trellis=2 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=6 / lookahead_threads=1 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=8 / b_pyramid=2 / b_adapt=2 / b_bias=0 / direct=3 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 / keyint_min=25 / scenecut=40 / intra_refresh=0 / rc_lookahead=60 / rc=crf / mbtree=1 / crf=19,0 / qcomp=0,60 / qpmin=0 / qpmax=69 / qpstep=4 / vbv_maxrate=25000 / vbv_bufsize=31250 / crf_max=0,0 / nal_hrd=none / filler=0 / ip_ratio=1,40 / aq=1:1,00
Color range                              : Limited
Color primaries                          : BT.601 PAL
Transfer characteristics                 : BT.709
Matrix coefficients                      : BT.601
Menus                                    : 6
Codec configuration box                  : avcC

Audio #1
ID                                       : 2
Format                                   : AAC LC
Format/Info                              : Advanced Audio Codec Low Complexity
Codec ID                                 : mp4a-40-2
Duration                                 : 1 h 37 min
Bit rate mode                            : Constant
Bit rate                                 : 161 kb/s
Channel(s)                               : 2 channels
Channel layout                           : L R
Sampling rate                            : 48.0 kHz
Frame rate                               : 46.875 FPS (1024 SPF)
Compression mode                         : Lossy
Stream size                              : 112 MiB (11%)
Language                                 : German
Default                                  : Yes
Alternate group                          : 1
Menus                                    : 6

Audio #2
ID                                       : 3
Format                                   : AAC LC
Format/Info                              : Advanced Audio Codec Low Complexity
Codec ID                                 : mp4a-40-2
Duration                                 : 1 h 37 min
Bit rate mode                            : Constant
Bit rate                                 : 161 kb/s
Channel(s)                               : 2 channels
Channel layout                           : L R
Sampling rate                            : 48.0 kHz
Frame rate                               : 46.875 FPS (1024 SPF)
Compression mode                         : Lossy
Stream size                              : 112 MiB (11%)
Language                                 : English
Default                                  : No
Alternate group                          : 1
Menus                                    : 6

Audio #3
ID                                       : 4
Format                                   : AAC LC
Format/Info                              : Advanced Audio Codec Low Complexity
Codec ID                                 : mp4a-40-2
Duration                                 : 1 h 37 min
Bit rate mode                            : Constant
Bit rate                                 : 161 kb/s
Channel(s)                               : 2 channels
Channel layout                           : L R
Sampling rate                            : 48.0 kHz
Frame rate                               : 46.875 FPS (1024 SPF)
Compression mode                         : Lossy
Stream size                              : 112 MiB (11%)
Language                                 : French
Default                                  : No
Alternate group                          : 1
Menus                                    : 6

Audio #4
ID                                       : 5
Format                                   : AAC LC
Format/Info                              : Advanced Audio Codec Low Complexity
Codec ID                                 : mp4a-40-2
Duration                                 : 1 h 37 min
Bit rate mode                            : Constant
Bit rate                                 : 160 kb/s
Channel(s)                               : 2 channels
Channel layout                           : L R
Sampling rate                            : 48.0 kHz
Frame rate                               : 46.875 FPS (1024 SPF)
Compression mode                         : Lossy
Stream size                              : 112 MiB (11%)
Language                                 : English
Default                                  : No
Alternate group                          : 1
Menus                                    : 6

Menu #1
ID                                       : 6
Codec ID                                 : text
Duration                                 : 1 h 37 min
Language                                 : English
Menu For                                 : 1,2,3,4,5
00:00:00.000                             : Chapter 1
00:10:56.560                             : Chapter 2
00:19:16.800                             : Chapter 3
00:29:29.680                             : Chapter 4
00:40:30.680                             : Chapter 5
00:51:18.240                             : Chapter 6
01:03:55.840                             : Chapter 7
01:11:02.280                             : Chapter 8
01:20:16.000                             : Chapter 9
01:23:19.640                             : Chapter 10
01:31:21.000                             : Chapter 11
01:34:45.360                             : Chapter 12

Menu #2
00:00:00.000                             : Chapter 1
00:10:56.560                             : Chapter 2
00:19:16.800                             : Chapter 3
00:29:29.680                             : Chapter 4
00:40:30.680                             : Chapter 5
00:51:18.240                             : Chapter 6
01:03:55.840                             : Chapter 7
01:11:02.280                             : Chapter 8
01:20:16.000                             : Chapter 9
01:23:19.640                             : Chapter 10
01:31:21.000                             : Chapter 11
01:34:45.360                             : Chapter 12


Post Reply