[FFmpeg-user] I can't copy or embed a picture to an output audio (A-A conversion)
Ilja
iljashebalin2 at gmail.com
Mon Sep 7 05:11:53 EEST 2020
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.
More information about the ffmpeg-user
mailing list