Open Sidonai-1 opened 5 months ago
Also I cannot find how to record in qtrle with alpha.
When I add -c:v qtrle
it says "unused"
Edit: Nevermind, using the long label for the qtrle codec works: add 1-1 FILE test.mov -codec:v qtrle
, but they have the same issue I mention above when playing.
I tried playing those files with version 2.0.7 and they play no problem.
Problem seems to be a lack of ffmpeg parameters when creating the file. It plays fine when declaring the format option:
add 1 file test3.mp4 -format mpegts
Mediainfo:
General
ID : 1 (0x1)
Complete name : C:\APP_VID\MEDIA\test3.mp4
Format : MPEG-TS
File size : 6.47 MiB
Duration : 15 s 420 ms
Overall bit rate mode : Variable
Overall bit rate : 3 515 kb/s
FileExtension_Invalid : ts m2t m2s m4t m4s tmf ts tp trp ty
Video
ID : 256 (0x100)
Menu ID : 1 (0x1)
Format : MPEG Video
Format version : Version 2
Format profile : 4:2:2@High
Format settings, BVOP : No
Format settings, Matrix : Default
Format settings, GOP : N=12
Codec ID : 2
Duration : 15 s 440 ms
Bit rate mode : Variable
Bit rate : 2 953 kb/s
Width : 1 920 pixels
Height : 1 080 pixels
Display aspect ratio : 16:9
Frame rate : 50.000 FPS
Color space : YUV
Chroma subsampling : 4:2:2
Bit depth : 8 bits
Scan type : Progressive
Compression mode : Lossy
Bits/(Pixel*Frame) : 0.028
Time code of first frame : 00:00:00:00
Time code source : Group of pictures header
GOP, Open/Closed : Open
GOP, Open/Closed of first frame : Closed
Stream size : 5.44 MiB (84%)
Audio
ID : 257 (0x101)
Menu ID : 1 (0x1)
Format : MPEG Audio
Format version : Version 1
Format profile : Layer 2
Codec ID : 3
Duration : 15 s 456 ms
Bit rate mode : Constant
Bit rate : 384 kb/s
Channel(s) : 2 channels
Sampling rate : 48.0 kHz
Frame rate : 41.667 FPS (1152 SPF)
Compression mode : Lossy
Delay relative to video : -10 ms
Stream size : 724 KiB (11%)
Menu
ID : 4096 (0x1000)
Menu ID : 1 (0x1)
Format : MPEG Video / MPEG Audio
Duration : 15 s 420 ms
List : 256 (0x100) (MPEG Video) / 257 (0x101) (MPEG Audio)
Service name : Service01
Service provider : FFmpeg
Service type : digital television
The unplayable file created with only add 1 file test5.mp4
has this info:
General
Complete name : C:\APP_VID\MEDIA\test5.mp4
Format : MPEG-4
Format profile : Base Media
Codec ID : isom (isom/iso2/avc1/mp41)
File size : 1.80 MiB
Duration : 18 s 280 ms
Overall bit rate mode : Variable
Overall bit rate : 828 kb/s
Writing application : Lavf59.27.100
Video
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High 4:2:2@L4.2
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 : 18 s 260 ms
Bit rate : 322 kb/s
Width : 1 920 pixels
Height : 1 080 pixels
Display aspect ratio : 16:9
Frame rate mode : Constant
Frame rate : 50.000 FPS
Color space : YUV
Chroma subsampling : 4:2:2
Bit depth : 8 bits
Scan type : Progressive
Bits/(Pixel*Frame) : 0.003
Stream size : 718 KiB (39%)
Writing library : x264 core 164 r3099 e067ab0
Encoding settings : cabac=1 / ref=1 / deblock=1:0:0 / analyse=0x3:0x113 / me=hex / subme=2 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=0 / me_range=16 / chroma_me=1 / trellis=0 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=0 / threads=18 / lookahead_threads=6 / 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=1 / keyint=250 / keyint_min=25 / scenecut=40 / intra_refresh=0 / rc_lookahead=10 / 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 : 18 s 280 ms
Source duration : 18 s 301 ms
Source_Duration_LastFrame : -3 ms
Bit rate mode : Variable
Bit rate : 495 kb/s
Maximum bit rate : 1 044 kb/s
Channel(s) : 16 channels
Channel layout : ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
Sampling rate : 48.0 kHz
Frame rate : 46.875 FPS (1024 SPF)
Compression mode : Lossy
Stream size : 1.08 MiB (60%)
Source stream size : 1.08 MiB (60%)
Default : Yes
Alternate group : 1
Given that it's coming from a default state of ffmpeg format when you don't specify it, I'm not sure if it's a bug.
@Julusian feel free to close it if you think it's not a fixable bug on Caspar.
Edit: To fix the QTRLE files we have to specify some audio codec, for example -codec:a ac3_fixed
or ac3, so it all seems to be related to the default audio codec being unable to set a proper channal layout or codec, hence Mediainfo displaying ?????????? on 'Channel Layout'.
The example that worked for me: add 1 FILE test_alfa.mov -codec:v qtrle -codec:a ac3_fixed
Applying an audio filter for a set number of audio channels seems to fix the issue as well: -filter:a pan=2c|c0=c2|c1=c3
Audio
ID : 2
Format : AAC LC
Format/Info : Advanced Audio Codec Low Complexity
Codec ID : mp4a-40-2
Duration : 9 s 700 ms
Source duration : 9 s 721 ms
Source_Duration_LastFrame : -7 ms
Bit rate mode : Variable
Bit rate : 15.4 kb/s
Maximum bit rate : 128 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 : 18.1 KiB (0%)
Source stream size : 18.3 KiB (0%)
Default : Yes
Alternate group : 1
I tested mp4 and qtrle and both seem to play nicely with the following creation commands:
add 1-100 file test3.mp4 -filter:a pan=2c|c0=c2|c1=c3
add 1-100 FILE test_alfa.mov -codec:v qtrle -filter:a pan=2c|c0=c2|c1=c3
I do not know how well the audio is preserved after this. I have not tested audio retention/quality on the files.
Observed Behavior
I tried to record MP4 and MOV files, the recording works and is playable by VLC and Premiere 2024.
add 1 file test4.mp4
However, Caspar can't play those same files.
Invalid channel layout 0
seems to be the cause.Environment