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

error in transcoding audio from mp3 to aac #123

Open
EdsionYeh opened this issue Mar 30, 2023 · 2 comments
Open

error in transcoding audio from mp3 to aac #123

EdsionYeh opened this issue Mar 30, 2023 · 2 comments

Comments

@EdsionYeh
Copy link

I tried 3_transcoding.c to transcode audio.

  StreamingParams sp = {0};
  sp.copy_audio = 0;
  sp.copy_video = 0;
  sp.video_codec = "libx264";
  sp.codec_priv_key = "x264-params";
  sp.codec_priv_value = "keyint=60:min-keyint=60:scenecut=0:force-cfr=1";
  sp.audio_codec = "aac";

The format of the input video file is as below.

  Stream #0:0[0x1](und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(progressive), 1280x720, 1718 kb/s, 30.20 fps, 30 tbr, 15360 tbn (default)
    Metadata:
      handler_name    : VideoHandler
      vendor_id       : [0][0][0][0]
  Stream #0:1[0x2](und): Audio: mp3 (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 255 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
      vendor_id       : [0][0][0][0]

when transcoding from mp3 to aac, I got the error msg

[aac @ 0x55e811fab600] nb_samples (1152) > frame_size (1024)
@leandromoreira
Copy link
Owner

@EdsionYeh the msg you're posting as an error message seems to be a warn only, what was the output?

@EdsionYeh
Copy link
Author

with

  sp.copy_video = 1;

I got a bunch of such msgs and then Segmentation fault

[aac @ 0x5633867f8a80] nb_samples (1152) > frame_size (1024)
[aac @ 0x5633867f8a80] nb_samples (1152) > frame_size (1024)
[aac @ 0x5633867f8a80] nb_samples (1152) > frame_size (1024)
[aac @ 0x5633867f8a80] nb_samples (1152) > frame_size (1024)
[aac @ 0x5633867f8a80] nb_samples (1152) > frame_size (1024)
[aac @ 0x5633867f8a80] nb_samples (1152) > frame_size (1024)
[aac @ 0x5633867f8a80] nb_samples (1152) > frame_size (1024)
[aac @ 0x5633867f8a80] nb_samples (1152) > frame_size (1024)
Segmentation fault

The output file size looks reasonable, but it is not playable, It is very likely that av_write_trailer didn't get a chance to be called.

with

  sp.copy_video = 0;

I got

[aac @ 0x561f16315600] nb_samples (1152) > frame_size (1024)
[aac @ 0x561f16315600] nb_samples (1152) > frame_size (1024)
[aac @ 0x561f16315600] nb_samples (1152) > frame_size (1024)
[mp4 @ 0x561f15f32280] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 512 >= 0
LOG: Error -22 while receiving packet from decoder: Invalid argument

The output video file is only 48 bytes in size

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

2 participants