Requests For Features

Vangelis forthnet northmedia1 at the.forthnet.gr
Tue Jul 21 15:40:00 PDT 2015


On Tue Jul 21 18:08:04 BST 2015, Jim web wrote:

> IIRC I always tend to use
>
> -acodec copy -vcodec copy

Hi Jim...

"-c copy" (also "-codec copy" or "-codec: copy")
in fact means "copy all the streams without reencoding";
there exist two elementary streams inside the FLV
container (video+audio), so in this case:

"-c copy" = "-acodec copy -vcodec copy"

(and "-acodec copy"/"-vcodec copy" is a slightly
older wording, though still backwards compatible;
the ffmpeg devs propose we use
"-c:a copy"/"-c:v copy" instead...)

>> ffmpeg -i foo.flv -c copy -bsf:a aac_adtstoasc foo.mp4
>
> curious to know what the -bsf option choice does.
> I'll have a man read. :-)

https://www.ffmpeg.org/ffmpeg-bitstream-filters.html#toc-aac_005fadtstoasc

> 2.1 aac_adtstoasc
>
> Convert MPEG-2/4 AAC ADTS to MPEG-4 Audio Specific Configuration bitstream 
> filter.
> This filter creates an MPEG-4 AudioSpecificConfig from an MPEG-2/4 ADTS 
> header and removes the ADTS header.
> This is required for example when copying an AAC stream from a raw ADTS 
> AAC container to a FLV or a MOV/MP4 file.

It turns out this filter is not actually needed
in the lossless remux of FLV to MP4; I remember
reading many moons ago in the "videohelp" forums
that it doesn't hurt including it in the command; I did some
fresh tests with an FFmpeg 2.7.1 win32 binary and indeed
I see no difference with it included or not.
HOWEVER, you should use this audio filter when:

1. an elementary audio stream with the ADTS header
is muxed into the MP4 container:

ffmpeg -loglevel 16 -stats -i EV.h264 -i EA.aac -c copy -bsf:a aac_adtstoasc 
AV.mp4

2. you remux losslessly from the MPEG-TS container
to the MP4 one:

ffmpeg -i AV.ts  -c copy -bsf:a aac_adtstoasc AV.mp4

(.ts files often the product of ffmpeg recording
AppleHLS live or on-demand streams...)

If you can read Perl, you can see how this filter is
already used in GiP 2.94, if you search
http://git.infradead.org/get_iplayer.git/blob/refs/heads/master:/get_iplayer
for the term: "aac_adtstoasc"

Regards,
Vangelis. 




More information about the get_iplayer mailing list