[FFmpeg-user] h265 file from IP camera - audio stream

Martin Woolley martin at woolleynet.com
Sat May 15 15:29:04 EEST 2021


Hello, I'm new to the world or video and audio encoding and would
appreciate some guidance. I have an IP camera which allows me to configure
it to record in either H265 or H264 format. The smartphone app used with
the camera can play back video recordings that it makes and this includes
the associated audio stream.

But... I transfer these files by FTP to a Linux server so that I can both
archive the files and view them using VLC or on DLNA devices like my TV
(the Linux machine runs the Gebera media server). Unfortunately neither VLC
or my media server/TV are able to play the H265 files from the IP camera,
so I've been trying to convert them to an alternate format using ffmpeg.
I've managed to produce an mp4 file which contains video I can play but the
audio is missing.

When I investigate the H265 file from the camera, ffprobe produces the
following:

ffprobe version N-102545-g59032494e8 Copyright (c) 2007-2021 the FFmpeg
developers

  built with Apple clang version 12.0.0 (clang-1200.0.32.29)

  configuration: --enable-gpl --enable-libx265 --enable-libx264

  libavutil      57.  0.100 / 57.  0.100

  libavcodec     59.  1.100 / 59.  1.100

  libavformat    59.  2.100 / 59.  2.100

  libavdevice    59.  0.100 / 59.  0.100

  libavfilter     8.  0.101 /  8.  0.101

  libswscale      6.  0.100 /  6.  0.100

  libswresample   4.  0.100 /  4.  0.100

  libpostproc    56.  0.100 / 56.  0.100

[hevc @ 0x7fb0b2d0a100] Invalid NAL unit 40, skipping.

    Last message repeated 3 times

[extract_extradata @ 0x7fb0b2d0a6c0] Invalid NAL unit 40, skipping.

    Last message repeated 3 times

[hevc @ 0x7fb0b2d0a100] Invalid NAL unit 40, skipping.

    Last message repeated 511 times

Input #0, hevc, from 'A210515_130559_130613.265':

  Duration: N/A, bitrate: N/A

  Stream #0:0: Video: hevc (Main), yuvj420p(pc, bt709), 2560x1920, 25 fps,
25 tbr, 1200k tbn

This is the first time I've used ffprobe so I don't know what is usual but
it seems odd that I can see a video stream reported but no audio stream.
There is definitely audio because I can hear it when I play the file in the
camera's smartphone app.

This is the command I use to create the MP4 file:

ffmpeg -loglevel quiet -y -i ${FILE} -map 0:v -c:v copy -bsf:v
hevc_mp4toannexb /home/pi/work/raw.h265 < /dev/null 2> /de
v/null

I confess I copied this from a Stackoverflow post that I found.

I'd really appreciate some advice. I'm happy to share a sample file if it
would help.

Thanks in anticipation

-- 
Martin Woolley


More information about the ffmpeg-user mailing list