Skip to content
New issue

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

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

Already on GitHub? # to your account

No audio/file does not play #9

Closed
ordinarygulp opened this issue Apr 15, 2018 · 13 comments
Closed

No audio/file does not play #9

ordinarygulp opened this issue Apr 15, 2018 · 13 comments

Comments

@ordinarygulp
Copy link

Command:

php m4b-tool.phar merge "X:\ToSort\Anthology - Star Wars-- Canto Bight (Read by Multiple Narrators)" --output-file="X:\ToSort\Anthology - Star Wars-- Canto Bight (Read by Multiple Narrators)\Canto Bight.m4b" --ffmpeg-threads=8 --convert-charset --audio-format="m4b" --audio-bitrate="62k" --audio-codec="aac" --artist="Sean Kenin, Saskia Maarleveld, Marc Thompson, Jonathan Davis"  --albumartist="Saladin Ahmed, Rae Carson, Mira Grant, John Jackson Miller" -f -v --no-cache

first file mediainfo

General
Complete name                            : X:\ToSort\Anthology - Star Wars-- Canto Bight (Read by Multiple Narrators)\02 - Saladin Ahmed - Rules of the Game - Chapter 1 (Read by Sean Kenin).m4b
Format                                   : MPEG-4
Format profile                           : Base Media / Version 2
Codec ID                                 : mp42 (isom/mp42/3gp5)
File size                                : 7.09 MiB
Duration                                 : 15 min 27 s
Overall bit rate mode                    : Variable
Overall bit rate                         : 64.1 kb/s
Album                                    : Star Wars: Canto Bight
Track name                               : Rules of the Game - Chapter 1
Track name/Position                      : 2
Performer                                : Saladin Ahmed
Genre                                    : Audiobook - Science Fantasy
Description                              : Soon to be seen in Star Wars: The Last Jedi, welcome to the casino city of Canto Bight. A place where exotic aliens, captivating creatures, and other would-be high rollers are willing to risk everything to make their fortunes. Set across one fateful even
Recorded date                            : 2017
Encoded date                             : UTC 2017-12-07 19:08:29
Tagged date                              : UTC 2017-12-07 19:08:29
Cover                                    : Yes
Comment                                  : Read by Sean Kenin

Audio
ID                                       : 101
Format                                   : AAC
Format/Info                              : Advanced Audio Codec
Format profile                           : LC
Codec ID                                 : mp4a-40-2
Duration                                 : 15 min 27 s
Bit rate mode                            : Variable
Bit rate                                 : 62.8 kb/s
Maximum bit rate                         : 70.4 kb/s
Channel(s)                               : 2 channels
Channel positions                        : Front: L R
Sampling rate                            : 22.05 kHz
Frame rate                               : 21.533 FPS (1024 SPF)
Compression mode                         : Lossy
Stream size                              : 6.95 MiB (98%)
Encoded date                             : UTC 2017-12-07 19:08:29
Tagged date                              : UTC 2017-12-07 19:08:30

Other #1
ID                                       : 2
Type                                     : Object description
Format                                   : System
Codec ID                                 : mp4s-01
Duration                                 : 1 s 0 ms
Encoded date                             : UTC 2017-12-07 19:08:30
Tagged date                              : UTC 2017-12-07 19:08:30

Other #2
ID                                       : 1
Type                                     : Scene description
Format                                   : System Core
Codec ID                                 : mp4s-02
Duration                                 : 1 s 0 ms
Encoded date                             : UTC 2017-12-07 19:08:30
Tagged date                              : UTC 2017-12-07 19:08:30

Merged file mediainfo

General
Complete name                            : X:\ToSort\Anthology - Star Wars-- Canto Bight (Read by Multiple Narrators)\Canto Bight.m4b
Format                                   : MPEG-4
Format profile                           : Base Media
Codec ID                                 : isom (isom/iso2/avc1/mp41)
File size                                : 302 MiB
Duration                                 : 11 h 5 min
Overall bit rate mode                    : Variable
Overall bit rate                         : 63.4 kb/s
Movie name                               : Star Wars: Canto Bight
Album/Performer                          : Saladin Ahmed, Rae Carson, Mira Grant, John Jackson Miller
Performer                                : Sean Kenin, Saskia Maarleveld, Marc Thompson, Jonathan Davis
Genre                                    : Audiobook - Science Fantasy
Recorded date                            : 2017
Tagged date                              : UTC 2018-04-15 06:46:04
Writing application                      : Lavf58.11.101

Video
ID                                       : 1
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : High@L6.2
Format settings                          : CABAC / 4 Ref Frames
Format settings, CABAC                   : Yes
Format settings, RefFrames               : 4 frames
Format settings, GOP                     : N=1
Codec ID                                 : avc1
Codec ID/Info                            : Advanced Video Coding
Duration                                 : 11 h 4 min
Bit rate mode                            : Constant
Bit rate                                 : 170 b/s
Width                                    : 500 pixels
Height                                   : 500 pixels
Display aspect ratio                     : 1.000
Frame rate mode                          : Variable
Frame rate                               : 0.001 FPS
Minimum frame rate                       : 0.000 FPS
Maximum frame rate                       : 1 000.000 FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 0.680
Stream size                              : 1.06 MiB (0%)
Writing library                          : x264 core 155 r2901 7d0ff22
Encoding settings                        : 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=12 / lookahead_threads=2 / 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
Color range                              : Full
Menus                                    : 3

Audio
ID                                       : 2
Format                                   : AAC
Format/Info                              : Advanced Audio Codec
Format profile                           : LC
Codec ID                                 : mp4a-40-2
Duration                                 : 11 h 5 min
Source duration                          : 11 h 5 min
Bit rate mode                            : Variable
Bit rate                                 : 62.5 kb/s
Maximum bit rate                         : 119 kb/s
Channel(s)                               : 2 channels
Channel positions                        : Front: L R
Sampling rate                            : 22.05 kHz
Frame rate                               : 21.533 FPS (1024 SPF)
Compression mode                         : Lossy
Stream size                              : 297 MiB (99%)
Source stream size                       : 297 MiB (99%)
Default                                  : Yes
Alternate group                          : 1

Menu #1
00:00:00.000                             : Introduction
00:01:49.876                             : Rules of the Game - Chapter 1
00:17:17.791                             : Rules of the Game - Chapter 2
00:27:39.621                             : Rules of the Game - Chapter 3
00:38:31.172                             : Rules of the Game - Chapter 4
00:42:50.538                             : Rules of the Game - Chapter 5
00:57:33.314                             : Rules of the Game - Chapter 6
01:12:20.362                             : Rules of the Game - Chapter 7
01:29:38.897                             : Rules of the Game - Chapter 8
01:33:51.344                             : Rules of the Game - Chapter 9
01:40:58.916                             : Rules of the Game - Chapter 10
01:45:44.428                             : Rules of the Game - Chapter 11
02:01:56.508                             : The Wine in Dreams - Chapter 1
02:09:48.616                             : The Wine in Dreams - Chapter 2
02:22:55.075                             : The Wine in Dreams - Chapter 3
02:46:52.390                             : The Wine in Dreams - Chapter 4
02:54:19.699                             : The Wine in Dreams - Chapter 5
03:02:09.531                             : The Wine in Dreams - Chapter 6
03:18:00.806                             : The Wine in Dreams - Chapter 7
03:48:33.139                             : The Wine in Dreams - Chapter 8
03:57:07.135                             : The Wine in Dreams - Chapter 9
04:22:17.871                             : The Wine in Dreams - Chapter 10
04:47:29.397                             : The Wine in Dreams - Chapter 11
04:52:10.590                             : Hear Nothing, See Nothing, Say Nothing - Chapter 1
05:04:55.780                             : Hear Nothing, See Nothing, Say Nothing - Chapter 2
05:40:35.220                             : Hear Nothing, See Nothing, Say Nothing - Chapter 3
05:55:51.247                             : Hear Nothing, See Nothing, Say Nothing - Chapter 4
06:05:16.838                             : Hear Nothing, See Nothing, Say Nothing - Chapter 5
06:34:16.198                             : Hear Nothing, See Nothing, Say Nothing - Chapter 6
06:51:56.839                             : Hear Nothing, See Nothing, Say Nothing - Chapter 7
07:16:13.984                             : Hear Nothing, See Nothing, Say Nothing - Chapter 8
07:23:49.373                             : Hear Nothing, See Nothing, Say Nothing - Chapter 9
07:41:24.534                             : Hear Nothing, See Nothing, Say Nothing - Chapter 10
07:53:59.368                             : The Ride - The Grinder - 1
08:08:39.218                             : The Ride - The Trips - 2
08:18:21.342                             : The Ride - The Gutshot - 3
08:29:57.987                             : The Ride - The Bad Beat - 4
08:40:20.746                             : The Ride - The Sharp - 5
08:51:04.867                             : The Ride - The Bust Out - 6
08:59:07.656                             : The Ride - The Edge - 7
09:06:48.572                             : The Ride - The Buy-in - 8
09:18:32.461                             : The Ride - The Tell - 9
09:26:51.968                             : The Ride - The Stretch - 10
09:41:57.406                             : The Ride - The Turn - 11
09:50:23.368                             : The Ride - The Wire - 12
10:03:10.741                             : The Ride - The Breakdown - 13
10:15:24.398                             : The Ride - The Surrender - 14
10:25:03.085                             : The Ride - The Freeroll - 15
10:36:03.692                             : The Ride - The Showdown - 16
10:45:15.073                             : The Ride - The Kicker - 17
10:55:01.376                             : The Ride - The Rake - 18
11:04:44.754                             : Credits & Copyright

Menu #2
ID                                       : 3
Codec ID                                 : text
Duration                                 : 11 h 4 min
Encoded date                             : UTC 2018-04-15 06:45:54
Tagged date                              : UTC 2018-04-15 06:45:54
Menu For                                 : 1
00:00:00.000                             : Introduction
00:01:49.876                             : Rules of the Game - Chapter 1
00:17:17.791                             : Rules of the Game - Chapter 2
00:27:39.621                             : Rules of the Game - Chapter 3
00:38:31.172                             : Rules of the Game - Chapter 4
00:42:50.538                             : Rules of the Game - Chapter 5
00:57:33.314                             : Rules of the Game - Chapter 6
01:12:20.362                             : Rules of the Game - Chapter 7
01:29:38.897                             : Rules of the Game - Chapter 8
01:33:51.344                             : Rules of the Game - Chapter 9
01:40:58.916                             : Rules of the Game - Chapter 10
01:45:44.428                             : Rules of the Game - Chapter 11
02:01:56.508                             : The Wine in Dreams - Chapter 1
02:09:48.616                             : The Wine in Dreams - Chapter 2
02:22:55.075                             : The Wine in Dreams - Chapter 3
02:46:52.390                             : The Wine in Dreams - Chapter 4
02:54:19.699                             : The Wine in Dreams - Chapter 5
03:02:09.531                             : The Wine in Dreams - Chapter 6
03:18:00.806                             : The Wine in Dreams - Chapter 7
03:48:33.139                             : The Wine in Dreams - Chapter 8
03:57:07.135                             : The Wine in Dreams - Chapter 9
04:22:17.871                             : The Wine in Dreams - Chapter 10
04:47:29.397                             : The Wine in Dreams - Chapter 11
04:52:10.590                             : Hear Nothing, See Nothing, Say Nothing - Chapter 1
05:04:55.780                             : Hear Nothing, See Nothing, Say Nothing - Chapter 2
05:40:35.220                             : Hear Nothing, See Nothing, Say Nothing - Chapter 3
05:55:51.247                             : Hear Nothing, See Nothing, Say Nothing - Chapter 4
06:05:16.838                             : Hear Nothing, See Nothing, Say Nothing - Chapter 5
06:34:16.198                             : Hear Nothing, See Nothing, Say Nothing - Chapter 6
06:51:56.839                             : Hear Nothing, See Nothing, Say Nothing - Chapter 7
07:16:13.984                             : Hear Nothing, See Nothing, Say Nothing - Chapter 8
07:23:49.373                             : Hear Nothing, See Nothing, Say Nothing - Chapter 9
07:41:24.534                             : Hear Nothing, See Nothing, Say Nothing - Chapter 10
07:53:59.368                             : The Ride - The Grinder - 1
08:08:39.218                             : The Ride - The Trips - 2
08:18:21.342                             : The Ride - The Gutshot - 3
08:29:57.987                             : The Ride - The Bad Beat - 4
08:40:20.746                             : The Ride - The Sharp - 5
08:51:04.867                             : The Ride - The Bust Out - 6
08:59:07.656                             : The Ride - The Edge - 7
09:06:48.572                             : The Ride - The Buy-in - 8
09:18:32.461                             : The Ride - The Tell - 9
09:26:51.968                             : The Ride - The Stretch - 10
09:41:57.406                             : The Ride - The Turn - 11
09:50:23.368                             : The Ride - The Wire - 12
10:03:10.741                             : The Ride - The Breakdown - 13
10:15:24.398                             : The Ride - The Surrender - 14
10:25:03.085                             : The Ride - The Freeroll - 15
10:36:03.692                             : The Ride - The Showdown - 16
10:45:15.073                             : The Ride - The Kicker - 17
10:55:01.376                             : The Ride - The Rake - 18
11:04:44.754                             : Credits & Copyright
Bit rate mode                            : VBR
@sandreas
Copy link
Owner

sandreas commented Apr 15, 2018

Well, i'm not sure you implied the usage of --audio-bitrate="62k", because it is not in the specs for every player.

  • What player did you use?

  • Does using m4b-tool with defaults produce unplayable files? php m4b-tool.phar merge "data/my-audio-book" --output-file="data/my-audio-book.m4b"

  • Try using m4b-tool WITHOUT these params: --convert-charset --audio-format="m4b" --audio-bitrate="62k" --audio-codec="aac"

  • Try to change the --audio-bitrate to 64k instead of 62k.

@ordinarygulp
Copy link
Author

I intentionally used bitrate at 62k, because that was source bitrate.

I tried: Windows Media Player, Groove, and MPC-HC (Media Player Classic).

Doing just this command, results in unplayable file:
php m4b-tool.phar merge "X:\ToSort\Anthology - Star Wars-- Canto Bight (Read by Multiple Narrators)" --output-file="X:\ToSort\Anthology - Star Wars-- Canto Bight (Read by Multiple Narrators)\Canto Bight.m4b" --ffmpeg-threads=8 --artist="Sean Kenin, Saskia Maarleveld, Marc Thompson, Jonathan Davis" --albumartist="Saladin Ahmed, Rae Carson, Mira Grant, John Jackson Miller" -f -v --no-cache

@sandreas
Copy link
Owner

Ok, if you append the --debug flag, m4b-tool creates a dump file, in which the shell commands should be listed (every call of mp4tools and ffmpeg with params).

Could you provide this dump as file? I'll take a look at it.

@ordinarygulp
Copy link
Author

Here is the dump file:
m4b-tool_debug.log

@sandreas
Copy link
Owner

sandreas commented Apr 16, 2018

It seems to be an ffmpeg bug with some input files.
Message: Too many packets buffered for output stream 0:1.
See https://trac.ffmpeg.org/ticket/6375 for details.

The linked ticket describes a workaround, I'll try to implement this in the next version as well as an "--ffmpeg-params" argument for providing global extra ffmpeg parameters.

@sandreas
Copy link
Owner

sandreas commented Apr 16, 2018

Ok, I published a pre-release v.0.3-beta2:
https://github.com/sandreas/m4b-tool/releases/download/v.0.3-beta2/m4b-tool.phar

Running your command with --ffmpeg-param="-max_muxing_queue_size" --ffmpeg-param="1000" appends -max_muxing_queue_size 1000 to every ffmpeg call, like it is described in the workaround. This might work, but it seems that ffmpeg does not handle arguments the same way on any position (order of arguments can be important, depending if it should affect input or output files), so it is very difficult to implement this in a generic way.

If this does not work, i could add another option for exactly this workaround but i would prefer waiting for ffmpeg to fix this issue.

You could also convert your sourcefiles to another format before feeding it into m4b-tool, so that this issue would not affect your files... but i understand if this is a step you want to avoid.

I really hope this does the job for you and the --ffmpeg-param options should help expierienced users to get the best out of m4b-tools ffmpeg wrapping now.

@ordinarygulp
Copy link
Author

ordinarygulp commented Apr 20, 2018

The command you specified does not work on the latest beta:

In MergeCommand.php line 325:

  could not convert X:\ToSort\Anthology - Star Wars-- Canto Bight (Read by Multiple Narrators)\01 - Introduction.m4b
  to -tmpfiles\52-01 - Introduction-converting.m44
ffmpeg -hide_banner -codecs -max_muxing_queue_size 1000
== load input files ==
ffmpeg -vn -i "X:\ToSort\Anthology - Star Wars-- Canto Bight (Read by Multiple Narrators)\01 - Introduction.m4b" -map_metadata 0 -strict experimental -vf scale=trunc(iw/2)*2:trunc(ih/2)*2 -movflags +faststart -y -acodec aac -f mp4 "-tmpfiles\52-01 - Introduction-converting.m4b" -max_muxing_queue_size 1000
ffmpeg version N-90667-g8d381b57fd Copyright (c) 2000-2018 the FFmpeg developers
  built with gcc 7.3.0 (GCC)
  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-bzlib --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth
  libavutil      56. 13.100 / 56. 13.100
  libavcodec     58. 17.100 / 58. 17.100
  libavformat    58. 11.101 / 58. 11.101
  libavdevice    58.  2.100 / 58.  2.100
  libavfilter     7. 14.100 /  7. 14.100
  libswscale      5.  0.102 /  5.  0.102
  libswresample   3.  0.101 /  3.  0.101
  libpostproc    55.  0.100 / 55.  0.100
Unrecognized option 'tmpfiles\52-01 - Introduction-converting.m4b'.
Error splitting the argument list: Option not found

@sandreas
Copy link
Owner

sandreas commented Apr 22, 2018

This seems to be a totally different error, since the filename is not even close to m4b (.m44). If this is not a typo, it is, because you tried to convert the files on a Shared drive (X:) - this is not supported in any case AFAIK. What you could to instead is to use so called UNC Paths (\\servername\sharename\audiobook-name) instead of mounting the drive as network share. If you are still experiencing those errors using a local file (C:...), i would ask you kindly to add a new issue for this problem.

But to come back to this issue with converting (Too many packets buffered for output stream 0:1):
I think there is not much i can do here, because i suspect ffmpeg not supporting this special kind of file you are trying to use.
Perhaps the next step would be to provide a statically linked version of ffmpeg and mp4tools for each OS in this repository, but therefore i have to check the licensing.

@sandreas
Copy link
Owner

sandreas commented Apr 25, 2018

So here we go... next beta with some general improvements and the workaround suggested in the ffmpeg issue...
Since i did not notice any side effects using -max_muxing_queue_size=9999 except for the fact that older ffmpeg versions are no longer supported, its integrated now by default.

If this does not fix the issue, I've run out of ideas...

@sandreas
Copy link
Owner

@d2dyno Did the latest beta fix the issue for you?

@ordinarygulp
Copy link
Author

I am trying a few things:

  1. Re-run latest beta on previous Windows box.
  2. Run m4b tool on Ubuntu box. If it works, script the shit out of it, so I can just input a folder and it will run in the background.

@ordinarygulp
Copy link
Author

This is now fixed on Windows. Playable files are created without any special settings.

Thanks for all the hard work! Let me know when donations open.

@sandreas
Copy link
Owner

sandreas commented May 5, 2018

Glad to hear it worked.

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

No branches or pull requests

2 participants