I can't copy or embed a picture to an output audio (A-A conversion)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

I can't copy or embed a picture to an output audio (A-A conversion)

ILJA SHEBALIN
Hello,

Reading the manual I tried to execute the following variants of the command to either copy the picture from the input or add it to the output.

ffprobe returned the following info about the input file:

ffprobe -hide_banner -show_streams /Users/home/Music/iTunes/iTunes\ Media/Music/Black\ Sabbath/Born\ Again/01\ Trashed.aiff — the command

##Result:

Input #0, aiff, from '/Users/home/Music/iTunes/iTunes Media/Music/Black Sabbath/Born Again/01 Trashed.aiff':
  Metadata:
    title           : Trashed
    album_artist    : Black Sabbath
    genre           : Rock
    track           : 1/9
    artist          : Ian Gillan
    iTunes_CDDB_1   : 8C2A9E09+818435+9+150+84721+124122+238843+255170+404721+478190+608803+706435
    iTunes_CDDB_TrackNumber: 1
    album           : Born Again
    lyrics-eng      : It really was a meeting
                    : The bottle took a beating
                    : The ladies of the manor
                    : Watched me climb into my car
                    :
                    : And I was going down the track about 105
                    : They had the stopwatch rolling
                    : I had the headlights blazing, I was really alive
                    : And yet my mind was blowing
                    :
                    : I drank a bottle of tequila and I felt real good
                    : I had the tape deck roaring
                    : But on the twenty-fifth lap at the canal turn
                    : I went off exploring
                    :
                    : I knew I wouldn't make it, the car just couldn't take it
                    : I was turning, the tires burning
                    : The ground was in my sky
                    : I was laughing, the bitch was trashed
                    : And death was in my eye
                    :
                    : I had started pretty good and I was feeling my way
                    : I had the wheels in motion
                    : There was Peter and the Greenfly laughing like drains
                    : Inebriation
                    :
                    : The crowd was roaring, I was at Brands Hatch
                    : In my imagination
                    : But at the canal turn I hit an oily patch
                    : Inebriation
                    :
                    : I knew I wouldn't make it, the car just couldn't take it
                    : I was turning, the tires burning
                    : The ground was in my sky
                    : I was laughing, the bitch was trashed
                    : And death was in my eye
                    :
                    : Ooh Mr. Miracle, you saved me from some pain
                    : I thank you Mr. Miracle, I won't get trashed again
                    : Ooh, can you hear my lies?
                    : Don't you bother with this fool, just laugh into my eyes
                    :
                    : I was turning, the tires burning
                    : The ground was in my sky
                    : I was laughing, the bitch was trashed
                    : And death was in my eye
                    :
                    : Ooh Mr. Miracle, you saved me from some pain
                    : I thank you Mr. Miracle, I won't get trashed again
                    : Ooh, can you hear my lies?
                    : Don't you bother with this fool, just laugh into my eyes
                    :
                    : So we went back to the bar and hit the bottle again
                    : But there was no tequila
                    : Then we started on the whiskey just to steady our brains
                    : 'Cause there was no tequila
                    :
                    : As we drank a little faster at the top of our hill
                    : We began to roll
                    : And as we got trashed we were laughing still
                    : Well, bless my soul
    date            : 1983
  Duration: 00:04:19.00, start: 0.000000, bitrate: 12309 kb/s
    Stream #0:0: Audio: pcm_f32be (fl32 / 0x32336C66), 192000 Hz, 2 channels, flt, 12288 kb/s
    Stream #0:1: Video: png, rgb24(pc), 732x745, 90k tbr, 90k tbn, 90k tbc (attached pic)
    Metadata:
      comment         : Other
[STREAM]
index=0
codec_name=pcm_f32be
codec_long_name=PCM 32-bit floating point big-endian
profile=unknown
codec_type=audio
codec_time_base=1/192000
codec_tag_string=fl32
codec_tag=0x32336c66
sample_fmt=flt
sample_rate=192000
channels=2
channel_layout=unknown
bits_per_sample=32
id=N/A
r_frame_rate=0/0
avg_frame_rate=0/0
time_base=1/192000
start_pts=0
start_time=0.000000
duration_ts=49728000
duration=259.000000
bit_rate=12288000
max_bit_rate=N/A
bits_per_raw_sample=N/A
nb_frames=49728000
nb_read_frames=N/A
nb_read_packets=N/A
DISPOSITION:default=0
DISPOSITION:dub=0
DISPOSITION:original=0
DISPOSITION:comment=0
DISPOSITION:lyrics=0
DISPOSITION:karaoke=0
DISPOSITION:forced=0
DISPOSITION:hearing_impaired=0
DISPOSITION:visual_impaired=0
DISPOSITION:clean_effects=0
DISPOSITION:attached_pic=0
DISPOSITION:timed_thumbnails=0
[/STREAM]
[STREAM]
index=1
codec_name=png
codec_long_name=PNG (Portable Network Graphics) image
profile=unknown
codec_type=video
codec_time_base=0/1
codec_tag_string=[0][0][0][0]
codec_tag=0x0000
width=732
height=745
coded_width=732
coded_height=745
closed_captions=0
has_b_frames=0
sample_aspect_ratio=N/A
display_aspect_ratio=N/A
pix_fmt=rgb24
level=-99
color_range=pc
color_space=unknown
color_transfer=unknown
color_primaries=unknown
chroma_location=unspecified
field_order=unknown
timecode=N/A
refs=1
id=N/A
r_frame_rate=90000/1
avg_frame_rate=0/0
time_base=1/90000
start_pts=0
start_time=0.000000
duration_ts=23310000
duration=259.000000
bit_rate=N/A
max_bit_rate=N/A
bits_per_raw_sample=N/A
nb_frames=N/A
nb_read_frames=N/A
nb_read_packets=N/A
DISPOSITION:default=0
DISPOSITION:dub=0
DISPOSITION:original=0
DISPOSITION:comment=0
DISPOSITION:lyrics=0
DISPOSITION:karaoke=0
DISPOSITION:forced=0
DISPOSITION:hearing_impaired=0
DISPOSITION:visual_impaired=0
DISPOSITION:clean_effects=0
DISPOSITION:attached_pic=1
DISPOSITION:timed_thumbnails=0
TAG:comment=Other
[/STREAM]


Based on that info I tried execute the following reincarnations of the command to copy what ffprobe  interpreted as a video stream but unsuccessfully:

ffmpeg -y  -i /Users/home/Music/iTunes/iTunes\ Media/Music/Black\ Sabbath/Born\ Again/01\ Trashed.aiff -i /Users/home/Pictures/iTunes\ cover\ art/born-again.png  -map 0:v -c:a pcm_s24be -c:v png _desposition:v attached_pic   /Users/home/Desktop/01\ Trashed.aiff


ffmpeg -y  -i /Users/home/Music/iTunes/iTunes\ Media/Music/Black\ Sabbath/Born\ Again/01\ Trashed.aiff -i /Users/home/Pictures/iTunes\ cover\ art/born-again.png  -map 0:v:1 -c:a pcm_s24be -c:v:1 png _desposition:v:1 attached_pic   /Users/home/Desktop/01\ Trashed.aiff


ffmpeg -y  -i /Users/home/Music/iTunes/iTunes\ Media/Music/Black\ Sabbath/Born\ Again/01\ Trashed.aiff -map 0:v -map 0:a -vcodec: copy -c:a pcm_s24be   /Users/home/Desktop/01\ Trashed.aiff


The commands either fail, show warnings such as “the video stream doesn’t exist” when I’m trying to map it, or transcode only the audio stream when I use -vcodec:copy or -c:v copy. Running ffprobe on newly created file shows the single audio stream as well.

A stunning revelation awaited me when I passed the input through MediaInfo application. It showed only the audio-stream and no metadata reported by ffprobe hence the “no videostream exists” - or smth to the effect of that - message I mentioned above. What’s going on and where did ffprobe retrieve the metadata and cover information from? Is it a way to copy or embed an artwork or/and metadata to a new audio?

The same situation with copying metadata under “Metadata” section. It returned errors too of which I don’t remember any now.

ffmpeg -y m:date m:lyrics-eng m:album m:iTunes_CDDB_TrackNumber m:artist m:track m:genre m:album_artist m:title m:iTunes_CDDB_1 -i /Users/home/Music/iTunes/iTunes\ Media/Music/Black\ Sabbath/Born\ Again/01\ Trashed.aiff -map 0:v -map 0:a -vcodec: copy -c:a pcm_s24be   /Users/home/Desktop/01\ Trashed.aiff

The manual page explains what every option does but doesn’t say anything about how to use them.
_______________________________________________
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: I can't copy or embed a picture to an output audio (A-A conversion)

Moritz Barsnick
On Mon, Sep 07, 2020 at 05:11:53 +0300, Ilja wrote:
> ffprobe -hide_banner -show_streams /Users/home/Music/iTunes/iTunes\ Media/Music/Black\ Sabbath/Born\ Again/01\ Trashed.aiff — the command

Please don't use "-hide_banner", especially if it's the only console
output you are showing.

>   Duration: 00:04:19.00, start: 0.000000, bitrate: 12309 kb/s
>     Stream #0:0: Audio: pcm_f32be (fl32 / 0x32336C66), 192000 Hz, 2 channels, flt, 12288 kb/s
>     Stream #0:1: Video: png, rgb24(pc), 732x745, 90k tbr, 90k tbn, 90k tbc (attached pic)

Okay, two "streams" there.

> Based on that info I tried execute the following reincarnations of the command to copy what ffprobe  interpreted as a video stream but unsuccessfully:
>
> ffmpeg -y  -i /Users/home/Music/iTunes/iTunes\ Media/Music/Black\ Sabbath/Born\ Again/01\ Trashed.aiff -i /Users/home/Pictures/iTunes\ cover\ art/born-again.png  -map 0:v -c:a pcm_s24be -c:v png _desposition:v attached_pic   /Users/home/Desktop/01\ Trashed.aiff

I would assume "-map 0:v" *only* tries to map image attachment, no
audio. What's the second file good for anyway, if you're taking the
image from the first one?

And "_desposition:v" should throw a warning or an error. It will be
interpreted as an output file, not an option. (Even if you replaced "_"
with "-", the option is still misspelt.

> ffmpeg -y  -i /Users/home/Music/iTunes/iTunes\ Media/Music/Black\ Sabbath/Born\ Again/01\ Trashed.aiff -i /Users/home/Pictures/iTunes\ cover\ art/born-again.png  -map 0:v:1 -c:a pcm_s24be -c:v:1 png _desposition:v:1 attached_pic   /Users/home/Desktop/01\ Trashed.aiff

Same here. And your stream indices are incorrect.

> ffmpeg -y  -i /Users/home/Music/iTunes/iTunes\ Media/Music/Black\ Sabbath/Born\ Again/01\ Trashed.aiff -map 0:v -map 0:a -vcodec: copy -c:a pcm_s24be   /Users/home/Desktop/01\ Trashed.aiff
> The commands either fail, show warnings such as “the video stream doesn’t exist” when I’m trying to map it, or transcode only the audio stream when I use -vcodec:copy or -c:v copy. Running ffprobe on newly created file shows the single audio stream as well.

This is not useful. Show us the actual command you tried, and its
complete, uncut console output. Then we can correlate the input and
your options to your error messages, and point out where you are going
wrong.

> A stunning revelation awaited me when I passed the input through
> MediaInfo application. It showed only the audio-stream and no
> metadata reported by ffprobe hence the “no videostream exists”

I would say metadata and video "stream" (attachment) do not relate, but
I may be wrong and Mediainfo may be weak with AIFF files - I don't
know.

> - or smth to the effect of that - message I mentioned above. What’s
> going on and where did ffprobe retrieve the metadata and cover
> information from?

Each and every format has it quirks on where that is stored, and ffmpeg
tries to implement that best it can.

> Is it a way to copy or embed an artwork or/and metadata to a new
> audio?

Generally, there should be. ffmpeg did have some limitations in the
past, and may still have some.

> The same situation with copying metadata under “Metadata” section. It
> returned errors too of which I don’t remember any now.

Well, then we can't interpret the errors. ;-)

> ffmpeg -y m:date m:lyrics-eng m:album m:iTunes_CDDB_TrackNumber m:artist m:track m:genre m:album_artist m:title m:iTunes_CDDB_1 -i /Users/home/Music/iTunes/iTunes\ Media/Music/Black\ Sabbath/Born\ Again/01\ Trashed.aiff -map 0:v -map 0:a -vcodec: copy -c:a pcm_s24be   /Users/home/Desktop/01\ Trashed.aiff

What?

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: I can't copy or embed a picture to an output audio (A-A conversion)

kumowoon1025
In reply to this post by ILJA SHEBALIN
Hi,

> ffprobe -hide_banner -show_streams /Users/home/Music/iTunes/iTunes\ Media/Music/Black\ Sabbath/Born\ Again/01\ Trashed.aiff — the command
>
> ##Result:
>
> Input #0, aiff, from '/Users/home/Music/iTunes/iTunes Media/Music/Black Sabbath/Born Again/01 Trashed.aiff':
...
>  Duration: 00:04:19.00, start: 0.000000, bitrate: 12309 kb/s
>    Stream #0:0: Audio: pcm_f32be (fl32 / 0x32336C66), 192000 Hz, 2 channels, flt, 12288 kb/s
>    Stream #0:1: Video: png, rgb24(pc), 732x745, 90k tbr, 90k tbn, 90k tbc (attached pic)
...
> [STREAM]
> index=0
> codec_name=pcm_f32be
> codec_long_name=PCM 32-bit floating point big-endian
> profile=unknown
> codec_type=audio
...
> [/STREAM]
> [STREAM]
> index=1
> codec_name=png
> codec_long_name=PNG (Portable Network Graphics) image
> profile=unknown
> codec_type=video
...
> [/STREAM]
>
>
> Based on that info I tried execute the following reincarnations of the command to copy what ffprobe  interpreted as a video stream but unsuccessfully:
...
> The commands either fail, show warnings such as “the video stream doesn’t exist” when I’m trying to map it, or transcode only the audio stream when I use -vcodec:copy or -c:v copy. Running ffprobe on newly created file shows the single audio stream as well.

Yes, it's rather misleading isn't it. Based on what the ff* tools tell you,  what you tried (or at least one of them) should definitely have worked. The problem is that the output from the commands you used to determine your plan is not really an accurate description.

> A stunning revelation awaited me when I passed the input through MediaInfo application. It showed only the audio-stream and no metadata reported by ffprobe hence the “no videostream exists” - or smth to the effect of that - message I mentioned above. What’s going on and where did ffprobe retrieve the metadata and cover information from? Is it a way to copy or embed an artwork or/and metadata to a new audio?

The output from mediainfo gives some indication that something is different; unusual; the video "stream" reported by ffprobe isn't really another stream. And when you think about it, it makes sense. It's an aiff format file, how is it going to have a video stream?? I don't even think it can have multiple streams of any kind (at least the "simple" kind, not the ones that are saved by drum machines and sequencers and whatnot. Think those get a different extension anyhow).

The answer is that the metadata and cover image are in an id3 tag. Use -write_id3v2 true with the aiff muxer to force it to write one. It's disabled by default for good reason though, chances are other applications than iTunes (and now its various spawns) won't expect, or look for one.

Regards,
Ted Park

_______________________________________________
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".