Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please add an audio-only option to the load and playlist commands #188

Open
q2go opened this issue Apr 23, 2024 · 0 comments
Open

Please add an audio-only option to the load and playlist commands #188

q2go opened this issue Apr 23, 2024 · 0 comments

Comments

@q2go
Copy link

q2go commented Apr 23, 2024

With go-chromecast v0.3.1 on a MacBook Pro M1 running Ventura 13.6.6 and ffmpeg v7.0 from Homebrew, I get a transcoding error when trying to play M4A files containing album artwork to a Chromecast Audio:

$ go-chromecast -d "Chromecast Audio" load sb.m4a 
ERRO[0000] error transcoding                             error="exit status 234" filename="sb.m4a" package=application

This happens because the M4A file apparently includes the album cover picture as an mjpeg video stream which my ffmpeg cannot handle:

$ go-chromecast -v -d "Chromecast Audio" load sb.m4a
[..]
    encoder         : iTunes v7.7.1, QuickTime 7.5
    ArtworkDescriptor: 0,3,
    comment         : 
    lyrics          : 
    iTunSMPB        :  00000000 00000840 000002A8 0000000000A64118 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
    iTunNORM        :  000003B6 000003ED 000038BF 0000395D 00015779 00002504 00007BD0 000077CB 00013230 00013230
    iTunes_CDDB_IDs : 10+0F4C55F9F9E6C54ADC2BBE08006DF34C+712554
    Encoding Params : vers
    rating          : 0
  Duration: 00:04:07.13, start: 0.047889, bitrate: 135 kb/s
  Stream #0:0[0x1](und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 133 kb/s (default)
      Metadata:
        creation_time   : 2008-09-01T22:38:55.000000Z
        vendor_id       : [0][0][0][0]
  Stream #0:1[0x0]: Video: mjpeg (Baseline), yuvj420p(pc, bt470bg/unknown/unknown), 320x320 [SAR 72:72 DAR 1:1], 90k tbr, 90k tbn (attached pic)
Stream mapping:
  Stream #0:1 -> #0:0 (mjpeg (native) -> h264 (libx264))
  Stream #0:0 -> #0:1 (aac (native) -> aac (native))
Press [q] to stop, [?] for help
[libx264 @ 0x11e606a30] using SAR=1/1
[libx264 @ 0x11e606a30] MB rate (36000000) > level limit (16711680)
[libx264 @ 0x11e606a30] using cpu capabilities: ARMv8 NEON
[libx264 @ 0x11e606a30] profile High, level 6.2, 4:2:0, 8-bit
[libx264 @ 0x11e606a30] 264 - core 164 r3108 31e19f9 - H.264/MPEG-4 AVC codec - Copyleft 2003-2023 - http://www.videolan.org/x264.html - options: 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=10 lookahead_threads=1 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
[mp4 @ 0x120004be0] Could not find tag for codec h264 in stream #0, codec not currently supported in container
[out#0/mp4 @ 0x6000035280c0] Could not write header (incorrect codec parameters ?): Invalid argument
[vf#0:0 @ 0x60000322d5f0] Error sending frames to consumers: Invalid argument
[vf#0:0 @ 0x60000322d5f0] Task finished with error code: -22 (Invalid argument)
[vf#0:0 @ 0x60000322d5f0] Terminating thread with return code -22 (Invalid argument)
[out#0/mp4 @ 0x6000035280c0] Nothing was written into output file, because at least one of its streams received no packets.
frame=    0 fps=0.0 q=0.0 Lsize=       0KiB time=N/A bitrate=N/A speed=N/A    
[aac @ 0x11e608e50] Qavg: 62904.484
Conversion failed!
ERRO[0002] error transcoding                             error="exit status 234" filename="sb.m4a" package=application
[..]

(The lines between the two [..] have all been included without omissions.)

After creating an audio-only version of the sb.m4a file by means of ffmpeg -c:a copy -vn this latter file will play just fine using both go-cromecast load and go-chromecast playlist.

I don't know if the problems outlined above could possibly be caused by my copy of ffmpeg (now v7.0, but previously v6.6.1 failed just the same) installed from Homebrew or the fact that the M4A file was already created back in 2008 with an old version of iTunes, but a great solution would be if go-chromecast could be switched to audio-only processing by means of an --audio-only option to the load and playlist commands.

Thank you very much for your great work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant