Equivalent of "-f rawvideo" but for audio?

classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|

Equivalent of "-f rawvideo" but for audio?

Peter B.
Hi everyone :)

Is it possible somehow to transcode any source audio format type to its
raw, uncompressed format that matches the source?

I'm dealing with collections of mixed input format combinations, and am
trying to find a way to bash-automate something.


For video "-f rawvideo" seems to do the trick.
But according to the "audio types" documentation [1] it seems I have to
know define the (and therefore already know) the format.

So, instead of specifying "-f s16le" or "-f s24le", is there something
like "-f rawaudio"?



I'm grateful for any hints or input!


Thanks in advance,
Peter B.



## Links:
[1] https://trac.ffmpeg.org/wiki/audio%20types
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Equivalent of "-f rawvideo" but for audio?

H. Vidal, Jr.
On 6/25/19 6:11 PM, Peter B. wrote:

> Hi everyone :)
>
> Is it possible somehow to transcode any source audio format type to its
> raw, uncompressed format that matches the source?
>
> I'm dealing with collections of mixed input format combinations, and am
> trying to find a way to bash-automate something.
>
>
> For video "-f rawvideo" seems to do the trick.
> But according to the "audio types" documentation [1] it seems I have to
> know define the (and therefore already know) the format.
>
> So, instead of specifying "-f s16le" or "-f s24le", is there something
> like "-f rawaudio"?
>
>
>
> I'm grateful for any hints or input!
>
>
> Thanks in advance,
> Peter B.
>
>
>
> ## Links:
> [1] https://trac.ffmpeg.org/wiki/audio%20types

Maybe 'sox' can help if this is purely an audio-to-audio
application. I have used it to useful effect reliably in signal
processing applications; your mileage may vary.

http://sox.sourceforge.net/

hv

_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Equivalent of "-f rawvideo" but for audio?

Carl Eugen Hoyos-2
In reply to this post by Peter B.
Am Mi., 26. Juni 2019 um 00:11 Uhr schrieb Peter B. <[hidden email]>:

> Is it possible somehow to transcode any source audio format type to its
> raw, uncompressed format that matches the source?
>
> I'm dealing with collections of mixed input format combinations, and am
> trying to find a way to bash-automate something.
>
>
> For video "-f rawvideo" seems to do the trick.
> But according to the "audio types" documentation [1] it seems I have to
> know define the (and therefore already know) the format.
>
> So, instead of specifying "-f s16le" or "-f s24le", is there something
> like "-f rawaudio"?

Yes, there is a muxer that happily accepts audio and writes
it to a file (unchanged), it is the "rawvideo" muxer.
(Use -map)

Not all audio formats are playable in rawvideo format
(just as not all video formats are)

Carl Eugen
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Equivalent of "-f rawvideo" but for audio?

Peter B.
On 26/06/2019 01:22, Carl Eugen Hoyos wrote:
> Am Mi., 26. Juni 2019 um 00:11 Uhr schrieb Peter B. <[hidden email]>:
>
>> So, instead of specifying "-f s16le" or "-f s24le", is there something
>> like "-f rawaudio"?
> Yes, there is a muxer that happily accepts audio and writes
> it to a file (unchanged), it is the "rawvideo" muxer.
> (Use -map)

Thanks!
Will give that a try.


> Not all audio formats are playable in rawvideo format
> (just as not all video formats are)

It's actually just for hashing the content (single hash, instead of
framemd5), so playability is not really a concern.


Will test and report :)


Thanks and nice greetings,
Peter
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Equivalent of "-f rawvideo" but for audio?

Carl Eugen Hoyos-2
Am Do., 27. Juni 2019 um 18:57 Uhr schrieb Peter B. <[hidden email]>:

> > Not all audio formats are playable in rawvideo format
> > (just as not all video formats are)
>
> It's actually just for hashing the content (single hash, instead
> of framemd5), so playability is not really a concern.

libavutil also supports (several) single hash functions.

Carl Eugen
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Equivalent of "-f rawvideo" but for audio?

Moritz Barsnick
On Thu, Jun 27, 2019 at 20:35:51 +0200, Carl Eugen Hoyos wrote:
> Am Do., 27. Juni 2019 um 18:57 Uhr schrieb Peter B. <[hidden email]>:
>
> > It's actually just for hashing the content (single hash, instead
> > of framemd5), so playability is not really a concern.
>
> libavutil also supports (several) single hash functions.

There's also the "hash" muxer with various hash functions (and its
alias muxer "md5").

$ ffmpeg -i input -map 0:a -c:a copy -f hash -
or
$ ffmpeg -i input -map 0:a -c:a copy -hash md5 -f hash -
if you prefer MD5.

Moritz
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Equivalent of "-f rawvideo" but for audio?

Kieran O Leary
On Thu, 27 Jun 2019, 23:32 Moritz Barsnick, <[hidden email]> wrote:

> On Thu, Jun 27, 2019 at 20:35:51 +0200, Carl Eugen Hoyos wrote:
> > Am Do., 27. Juni 2019 um 18:57 Uhr schrieb Peter B. <
> [hidden email]>:
> >
> > > It's actually just for hashing the content (single hash, instead
> > > of framemd5), so playability is not really a concern.
> >
> > libavutil also supports (several) single hash functions.
>
> There's also the "hash" muxer with various hash functions (and its
> alias muxer "md5").
>
> $ ffmpeg -i input -map 0:a -c:a copy -f hash -
> or
> $ ffmpeg -i input -map 0:a -c:a copy -hash md5 -f hash -
> if you prefer MD5



Out of curiosity,what is the difference between this and -f md5 -
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Equivalent of "-f rawvideo" but for audio?

Moritz Barsnick
On Thu, Jun 27, 2019 at 23:36:12 +0100, Kieran O Leary wrote:
> On Thu, 27 Jun 2019, 23:32 Moritz Barsnick, <[hidden email]> wrote:
> > $ ffmpeg -i input -map 0:a -c:a copy -f hash -
> > or
> > $ ffmpeg -i input -map 0:a -c:a copy -hash md5 -f hash -
> > if you prefer MD5
>
> Out of curiosity,what is the difference between this and -f md5 -

Nothing. (I did mention the word "alias" in my text. ;-))
As the docs say:
  21.18 md5

  MD5 testing format.

  This is a variant of the hash muxer. Unlike that muxer, it defaults to using the MD5 hash function.

I was one of those who converted the "md5" muxer to a more generic
"hash" muxer with various hashing algorithms, defaulting to a more
modern algorithm (SHA256). The "md5" muxer was retained as an alias for
backward compatibility.

(Analogously for "framehash" and "framemd5".)

Cheers,
Moritz
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Equivalent of "-f rawvideo" but for audio?

Paul B Mahol
On 6/28/19, Moritz Barsnick <[hidden email]> wrote:

> On Thu, Jun 27, 2019 at 23:36:12 +0100, Kieran O Leary wrote:
>> On Thu, 27 Jun 2019, 23:32 Moritz Barsnick, <[hidden email]> wrote:
>> > $ ffmpeg -i input -map 0:a -c:a copy -f hash -
>> > or
>> > $ ffmpeg -i input -map 0:a -c:a copy -hash md5 -f hash -
>> > if you prefer MD5
>>
>> Out of curiosity,what is the difference between this and -f md5 -
>
> Nothing. (I did mention the word "alias" in my text. ;-))
> As the docs say:
>   21.18 md5
>
>   MD5 testing format.
>
>   This is a variant of the hash muxer. Unlike that muxer, it defaults to
> using the MD5 hash function.
>
> I was one of those who converted the "md5" muxer to a more generic
> "hash" muxer with various hashing algorithms, defaulting to a more
> modern algorithm (SHA256). The "md5" muxer was retained as an alias for
> backward compatibility.
>
> (Analogously for "framehash" and "framemd5".)

People just follow old bad habits, its hard to change them.

>
> Cheers,
> Moritz
> _______________________________________________
> ffmpeg-user mailing list
> [hidden email]
> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> [hidden email] with subject "unsubscribe".
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Equivalent of "-f rawvideo" but for audio?

Peter B.
In reply to this post by Moritz Barsnick
On 28/06/2019 00:32, Moritz Barsnick wrote:
> There's also the "hash" muxer with various hash functions (and its
> alias muxer "md5").
> $ ffmpeg -i input -map 0:a -c:a copy -f hash -
> or
> $ ffmpeg -i input -map 0:a -c:a copy -hash md5 -f hash -
> if you prefer MD5.

Ooooh! Excellent!
Didn't know that, and obviously overlooked it.


Thank you so much!
Peter
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Equivalent of "-f rawvideo" but for audio?

Dave Rice-3
In reply to this post by Carl Eugen Hoyos-2

> On Jun 25, 2019, at 7:22 PM, Carl Eugen Hoyos <[hidden email]> wrote:
>
> Am Mi., 26. Juni 2019 um 00:11 Uhr schrieb Peter B. <[hidden email]>:
>
>> Is it possible somehow to transcode any source audio format type to its
>> raw, uncompressed format that matches the source?
>>
>> I'm dealing with collections of mixed input format combinations, and am
>> trying to find a way to bash-automate something.
>>
>>
>> For video "-f rawvideo" seems to do the trick.
>> But according to the "audio types" documentation [1] it seems I have to
>> know define the (and therefore already know) the format.
>>
>> So, instead of specifying "-f s16le" or "-f s24le", is there something
>> like "-f rawaudio"?
>
> Yes, there is a muxer that happily accepts audio and writes
> it to a file (unchanged), it is the "rawvideo" muxer.
> (Use -map)
>
> Not all audio formats are playable in rawvideo format
> (just as not all video formats are)

There’s still a mismatch here. With the framehash muxer, the video is converted to rawvideo, but with audio it is converted to a specific signed 16 bit audio format. Thus lesser significant bits in video impact the framehash output but in audio, bit positions >16 don’t have any impact. At the moment ffmpeg doesn’t appear to have an audio equivalent for the rawvideo format.

Dave Rice

_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Equivalent of "-f rawvideo" but for audio?

Carl Eugen Hoyos-2
Am Mo., 1. Juli 2019 um 22:25 Uhr schrieb Dave Rice <[hidden email]>:

>
>
> > On Jun 25, 2019, at 7:22 PM, Carl Eugen Hoyos <[hidden email]> wrote:
> >
> > Am Mi., 26. Juni 2019 um 00:11 Uhr schrieb Peter B. <[hidden email]>:
> >
> >> Is it possible somehow to transcode any source audio format type to its
> >> raw, uncompressed format that matches the source?
> >>
> >> I'm dealing with collections of mixed input format combinations, and am
> >> trying to find a way to bash-automate something.
> >>
> >>
> >> For video "-f rawvideo" seems to do the trick.
> >> But according to the "audio types" documentation [1] it seems I have to
> >> know define the (and therefore already know) the format.
> >>
> >> So, instead of specifying "-f s16le" or "-f s24le", is there something
> >> like "-f rawaudio"?
> >
> > Yes, there is a muxer that happily accepts audio and writes
> > it to a file (unchanged), it is the "rawvideo" muxer.
> > (Use -map)
> >
> > Not all audio formats are playable in rawvideo format
> > (just as not all video formats are)
>
> There’s still a mismatch here. With the framehash muxer, the video is
> converted to rawvideo,

Which may or may not be bit-exact, so using -vcodec copy is often useful.

> but with audio it is converted to a specific signed 16 bit audio format.

Only if you want it to.
(Yes, default encoders are usually defined but you don't have to use them,
just as with video in the rawvideo muxer)

> Thus lesser significant bits in video impact the framehash output but in
> audio, bit positions >16 don’t have any impact.

The same issue can exist with video.
(Apart from the fact that typically there is no "position >16 bit" for audio,
there are just coefficients, while it often exists for video)

> At the moment ffmpeg doesn’t appear to have an audio equivalent
> for the rawvideo format.

The rawvideo muxer accepts both audio and video without any
lmitation (apart from the usability of the output file which again is a
limitation for both audio and video).

Carl Eugen
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".