-
Notifications
You must be signed in to change notification settings - Fork 9
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
Unsupported Audio Codecs (common) #41
Comments
Does /var/cache... exist as its trying to say? What permissions does that folder have? |
Yes the folder exists and it's owned by www-data. However, i notice that there is no video.mp4 there, so its not being created at all. Any idea what could cause that? these logs don't tell me that some dependency is maybe missing |
New log
|
The important line here is the Can''t open in codec! Meaning for some reason ffmpeg couldn't open the AAC encoder to encode audio. So you can turn off recording audio for now while we try to figure this out. Your ffmpeg is pretty old, maybe it doesn't have the AAC encoder built into it. Still, we shouldn't crash, so I will have to fix that. |
Hi, I have updated ffmpeg to 3.4, i turned off audio in ZM and also in the stream. Rexd666 also suggested to set ffmpeg as the source instead of remote. After doing these things it started to write the file which is good. However it will not play or download through the UI it just gives a 404. The file is there however so I'm not sure why, any ideas on this part? |
I'd double check that the web UI is looking in exactly the right directory. I suspect php.ini not having the correct timezone but as I recall that gave a different error. Still, a place to start. |
@digital-gnome that was it! System time was UTC but php was Europe/London. Changed this to UTC and it now works! Not sure why the trace about codec happened, maybe that was audio related. Now i can easily view events i can debug that more |
Awesome. That's bit me several times. I believe the audio part is a bit picky. I have a camera that works fine with aac but chokes on g711a. |
I'm not even sure what audio my camera uses, will have to research as there
is nothing in the UI to change etc.
It would be a shame if ZM didn't support more than a single type as I'm not
replacing these cameras!
…On 23 Oct 2017 20:24, "digital-gnome" ***@***.***> wrote:
Awesome. That's bit me several times.
I believe the audio part is a bit picky. I have a camera that works fine
with aac but chokes on g711a.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#41 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ADL1Q6zZ4c5NZHBqfOULD4gO6E12afQlks5svOf6gaJpZM4QCevq>
.
|
Both AAC and non-AAC should work if your ffmpeg supports AAC encoding. They do on my systems. |
@connortechnology How can i debug this? I've enabled audio with the tick box option in storage tab. Stream works fine but when an alarm triggers this happens (trace below). I've checked my camera and it supports various G.7x codecs, and MP2L2. Do i need some special flag in the storage options for ffmpeg to tell it this is what codec it's expecting ?
does list DEA.L. pcm_alaw PCM A-law / G.711 A-law
|
I think this is the important bit.
Using ffmpeg from 16.04 repos which is 2.8.11-0ubuntu0.16.04.1. If I just run ffmpeg from the command line against the stream it gives
Add -strict -2 and it runs and makes a usable video file. So as far as I can tell it should work. |
I don't think that's it. We set that flag internally. The sample rate not being set is a problem. Without that, the codec doesn't know what to do. Which is funny because we make a point of setting it, and we print it out above... |
Is that 0 channels part of the problem? |
Could be but we check for that and set it to 1 in the output. Ffmpeg can be very finicky. Not much documentation either.
…On October 26, 2017 7:04:38 AM PDT, digital-gnome ***@***.***> wrote:
> [: Audio: aac, 0 channels, 128 kb/s]
Is that 0 channels part of the problem?
--
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub:
#41 (comment)
--
Sent from my Android device with K-9 Mail. Please excuse my brevity.
|
I'm reviewing a lot of this code, although more to the video stream today. Maybe I'll spot something. |
Is this still an issue? |
Have you made changes to introduce support that I should test?
…On 1 Jan 2018 20:32, "Isaac Connor" ***@***.***> wrote:
Is this still an issue?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#41 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ADL1QwRXqbCDfxA7_fqNGLewNATPm9UPks5tGUDEgaJpZM4QCevq>
.
|
@connortechnology Yes i'm still getting the backtrace error logs when i turn audio on |
@connortechnology So I've tried capturing from my camera using my laptop and get this result, can you spot anything? All i can see is that the resulting output doesn't have an audio stream. Command: ffmpeg -i "url//Streaming/Channels/1" -c:v libx264 -acodec pcm_alaw -ar 8000 -an output.mp4 [rtsp @ 0x56538ade9900] max delay reached. need to consume packet
[rtsp @ 0x56538ade9900] RTP: missed 88 packets
[h264 @ 0x56538aded4a0] error while decoding MB 93 23, bytestream -19
[h264 @ 0x56538aded4a0] concealing 5356 DC, 5356 AC, 5356 MV errors in I frame
Guessed Channel Layout for Input Stream #0.1 : mono
Input #0, rtsp, from 'rtsp://admin:Saphia122014@192.168.1.154//Streaming/Channels/1':
Metadata:
title : Media Presentation
Duration: N/A, start: 0.000000, bitrate: N/A
Stream #0:0: Video: h264 (Main), yuvj420p(pc, bt709, progressive), 1920x1080 [SAR 1:1 DAR 16:9], 16 fps, 25 tbr, 90k tbn, 32 tbc
Stream #0:1: Audio: pcm_alaw, 8000 Hz, mono, s16, 64 kb/s
File 'output.mp4' already exists. Overwrite ? [y/N] y
Stream mapping:
Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
Press [q] to stop, [?] for help
[h264 @ 0x56538afe5d40] error while decoding MB 93 23, bytestream -19
[h264 @ 0x56538afe5d40] concealing 5356 DC, 5356 AC, 5356 MV errors in I frame
[libx264 @ 0x56538ae4d320] using SAR=1/1
[libx264 @ 0x56538ae4d320] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 @ 0x56538ae4d320] profile High, level 4.0
[libx264 @ 0x56538ae4d320] 264 - core 152 r2854 e9a5903 - H.264/MPEG-4 AVC codec - Copyleft 2003-2017 - 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=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=16 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
Output #0, mp4, to 'output.mp4':
Metadata:
|
@connortechnology I found something out, i added "-v verbose" to the above and got this:
So it turns out this codec isn't supported with MP4. So i added "-c:a aac" and it works (command line ffmpeg). So the question is do you not have handling for this already in Zoneminder? Can I add this command to the ffmpeg options? EDIT: I tried adding "-v", "v", "loglevel", "-c:a" etc to "options", but debug logs all say they aren't supported by FFMPEG. 09/09/18 10:32:41.548345 zmc_m2[18239].INF-zm_monitor.cpp/2474 [Hallway: images:1 - Capturing at 500.00 fps, capturing bandwidth 336925bytes/sec]
09/09/18 10:32:57.271224 zmc_m2[18239].INF-zm_videostore.cpp/54 [Opening video storage stream /var/cache/zoneminder/events/2/2018-09-09/159102/159102-video.mp4 format: mp4]
09/09/18 10:32:57.272978 zmc_m2[18239].WAR-zm_videostore.cpp/333 [Unable to set movflags to frag_custom+dash+delay_moov]
09/09/18 10:32:57.273003 zmc_m2[18239].ERR-zm_videostore.cpp/341 [Error occurred when writing out file header to /var/cache/zoneminder/events/2/2018-09-09/159102/159102-video.mp4: Invalid argument
] |
Yeah MP4 can only store AAC. The debug logs you posted show ZM detecting that it's not AAC, at which point it sets up an encoder. Most cameras don't send AAC. I have 1 that does aac, and 4 that don't. This code works great for me... not sure why it isn't working for you. I'll have to look closer. The only thing I can think of is that the encoder is failing to setup properly but I would expect more errors in the logs. |
I am eager to get this sorted, had the issue for a year now so very happy
to help where I can.
As I say I can now capture using -c:a aac, but the UI doesn't except any
parameters without erroring.
…On Sun, 9 Sep 2018, 14:51 Isaac Connor, ***@***.***> wrote:
Yeah MP4 can only store AAC. The debug logs you posted show ZM detecting
that it's not AAC, at which point it sets up an encoder.
Most cameras don't send AAC. I have 1 that does aac, and 4 that don't.
This code works great for me... not sure why it isn't working for you. I'll
have to look closer. The only thing I can think of is that the encoder is
failing to setup properly but I would expect more errors in the logs.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#41 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ADL1QyJpV75U49sjxiYzLXWDnyDvgXaWks5uZRzcgaJpZM4QCevq>
.
|
Good news, I've been able to reproduce it. Should be able to fix it today. Hurray! |
Ah so good!
…On Sun, 9 Sep 2018, 15:42 Isaac Connor, ***@***.***> wrote:
Good news, I've been able to reproduce it. Should be able to fix it today.
Hurray!
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#41 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ADL1QxDb29Cf48_qdSiHO4iI7USMagQuks5uZSjDgaJpZM4QCevq>
.
|
I believe I have it fixed. Building packages now. |
Apparently it still crashes, just in a different spot. |
@connortechnology So more work needed I take it? |
Oh I think I fixed that crash too. I think it's solid. You will have to let me know though. |
Ok I will test now, I'm still stuck on an older version as I think I have
lots of crashing issues on the newer ones, but will clone and give it a try.
Thanks!
…On Tue, 11 Sep 2018, 16:52 Isaac Connor, ***@***.***> wrote:
Oh I think I fixed that crash too. I think it's solid. You will have to
let me know though.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#41 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ADL1Q9FHYUYrJ6aCBcKu8-pZEQ9MDICaks5uZ9xIgaJpZM4QCevq>
.
|
So how did testing go, can we close this out? |
@connortechnology I've not been at PC for a while so havent been able to test, I'll try and get it done ASAP and let you know! |
@connortechnology I've got around to testing, upgraded to 1.32.0 and hit record on the monitor with audio stream. No errors like before but I am unable to view events, back to getting these errors as I always seen to get when upgrading:
Apache error logs: [Thu Sep 20 10:20:38.843418 2018] [:error] [pid 237] [client 192.168.1.35:39162] PHP Notice: Use of undefined constant MonitorId - assumed 'MonitorId' in /usr/share/zoneminder/www/includes/Event.php on line 88, referer: http://192.168.1.104/zm/index.php?view=events&page=1&filter%5BQuery%5D%5Bterms%5D%5B0%5D%5Battr%5D=MonitorId&filter%5BQuery%5D%5Bterms%5D%5B0%5D%5Bop%5D=%3D&filter%5BQuery%5D%5Bterms%5D%5B0%5D%5Bval%5D=2&sort_field=StartTime&sort_asc=&limit=
[Thu Sep 20 10:20:38.937395 2018] [:error] [pid 237] [client 192.168.1.35:39162] PHP Notice: Use of undefined constant MonitorId - assumed 'MonitorId' in /usr/share/zoneminder/www/includes/Event.php on line 88, referer: http://192.168.1.104/zm/index.php?view=events&page=1&filter%5BQuery%5D%5Bterms%5D%5B0%5D%5Battr%5D=MonitorId&filter%5BQuery%5D%5Bterms%5D%5B0%5D%5Bop%5D=%3D&filter%5BQuery%5D%5Bterms%5D%5B0%5D%5Bval%5D=2&sort_field=StartTime&sort_asc=&limit=
[Thu Sep 20 10:20:38.937469 2018] [:error] [pid 237] [client 192.168.1.35:39162] PHP Fatal error: Uncaught Error: Call to a member function ServerId() on array in /usr/share/zoneminder/www/includes/Event.php:206\nStack trace:\n#0 /usr/share/zoneminder/www/skins/classic/views/event.php(141): Event->getStreamSrc(Array)\n#1 /usr/share/zoneminder/www/index.php(254): require_once('/usr/share/zone...')\n#2 {main}\n thrown in /usr/share/zoneminder/www/includes/Event.php on line 206, referer: http://192.168.1.104/zm/index.php?view=events&page=1&filter%5BQuery%5D%5Bterms%5D%5B0%5D%5Battr%5D=MonitorId&filter%5BQuery%5D%5Bterms%5D%5B0%5D%5Bop%5D=%3D&filter%5BQuery%5D%5Bterms%5D%5B0%5D%5Bval%5D=2&sort_field=StartTime&sort_asc=&limit= |
Just pushed a couple of fixes for those files. I think we will need debug logs for zmc and zms. |
I'm pretty sure this is related to apache and all those forum threads which is why I stayed on 1.31.44 until it was fixed, i think it broke in 1.31.46 ? Did you push a new PPA version with the changes? unfortunately i'm using PPA not building from source. If not and they are apache changes let me know and i can take them from source I have debug logging enabled, but this seems frontend related only so not sure what i'm looking for there? The videos record fine, and the audio is there also! |
This issue is resolved (audio codecs) - Thank you! Moving topic switch to new issue. |
So i've trying this branch again but so far it isn't usable for me, I'll log some issues here.
The first is events cannot be played in browser, I received the message "The video could not be loaded, either because the server or network failed, or the format is not supported"
Here are some relevant logs:
The text was updated successfully, but these errors were encountered: