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

WARN: [FFmpeg] track 1: codec frame size is not set #4309

Open
macasas opened this issue Sep 22, 2023 · 9 comments
Open

WARN: [FFmpeg] track 1: codec frame size is not set #4309

macasas opened this issue Sep 22, 2023 · 9 comments

Comments

@macasas
Copy link

macasas commented Sep 22, 2023

  • [x ] I have read the FAQ.
  • [x ] I have searched in existing issues.

Environment
macOS 12.6
scrcpy 2.1.1 https://github.com/Genymobile/scrcpy

Dependencies (compiled / linked):

  • SDL: 2.28.1 / 2.28.3

  • libavcodec: 60.3.100 / 60.3.100

  • libavformat: 60.3.100 / 60.3.100

  • libavutil: 58.2.100 / 58.2.100

  • libusb: - / 1.0.26

  • installation method: brew

  • device model: Samsung S8 Ultra Tablet

  • Android version: [13]

Describe the bug
Running various variations of
scrcpy --always-on-top --record=junction_idea2.mp4 --time-limit=300 --audio-codec=aac --audio-encoder=c2.android.aac.encoder --disable-screensaver --fullscreen --require-audio

With or without audio-codec and audio-encoder.

Records video fine, but never any audio
Suspect WARN: [FFmpeg] track 1: codec frame size is not set. but cannot find a way to set this nor at https://developer.android.com/reference/android/media/MediaFormat

scrcpy 2.1.1 <https://github.com/Genymobile/scrcpy>
INFO: ADB device found:
INFO:     -->   (usb)  R52W10A5KJZ                     device  SM_X906B
/usr/local/Cellar/scrcpy/2.1.1/share/scrcpy/scrcpy-server: 1 file pushed, 0 skipped. 28.7 MB/s (56995 bytes in 0.002s)
[server] INFO: Device: [samsung] samsung SM-X906B (Android 13)
INFO: Recording started to mp4 file: junction_idea2.mp4
INFO: Renderer: metal
INFO: Texture: 2960x1848
WARN: [FFmpeg] track 1: codec frame size is not set
^CWARN: Device disconnected  (When I press Ctrl-C to end)
INFO: Recording complete to mp4 file: junction_idea2.mp4

How to get audio?

@rom1v
Copy link
Collaborator

rom1v commented Sep 24, 2023

WARN: [FFmpeg] track 1: codec frame size is not set

This warning is "expected" (MediaCodec does not provide the audio frame size), and is harmless.

Records video fine, but never any audio

Do you have audio when you don't record?

What player do you use to play your recorded file? Try with VLC (or even Firefox).

@macasas
Copy link
Author

macasas commented Sep 25, 2023 via email

@rom1v
Copy link
Collaborator

rom1v commented Sep 25, 2023

When I just run scrcpy from Terminal I get the video on screen, but where am I going to see an audio signal/feed to know if I have audio?

Audio forwarding means that the Android device audio output (for example if you play a video on your device) is played on your computer on the default audio output.

I thought the only place would be in the scrcpy recording, but theres no audio in VLC, quicktime or just quick preview is there any audio. Load a recording into a video editor and there is nothing in the audio track.

OK so it seems your audio is not recorded on your device for some reason. Do you have any bluetooth earphones connected on the device (they might disable audio capture on the device)?

MP4 is being saved to MacBook, which seems to be against readme description of it being saved onto android device.

In scrcpy, the file is recorded on the computer.

@macasas
Copy link
Author

macasas commented Sep 25, 2023 via email

@macasas
Copy link
Author

macasas commented Sep 25, 2023 via email

@rom1v
Copy link
Collaborator

rom1v commented Sep 25, 2023

Ultiimately i am trying to record the screen of the tablet while talking about what I am sketching.

Do not connect any bluetooth earphone, and use:

scrcpy --audio-source=mic --record=file.mp4

(you will get the device screen capture with the audio capture from your phone microphone)

@macasas
Copy link
Author

macasas commented Sep 25, 2023 via email

@Lerduzz
Copy link

Lerduzz commented Jul 24, 2024

I have the same warning but my Galaxy S23 Ultra does record audio and video fine.

Screen res 1080x2312 for reference.

@Ilya1510
Copy link

I have the same warning but my Galaxy S23 Ultra does record audio and video fine.

Screen res 1080x2312 for reference.

Are you on mac, windows or linus?

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

4 participants