Re: [FFmpeg-user] Naming an audio track
On Mon, Nov 03, 2014 at 12:12:21 +0100, Moritz Barsnick wrote: > I do see ffmpeg has a function named mov_write_track_udta_tag(), > called from mov_write_trak_tag(), called from mov_write_moov_tag(), > but I don't know if it gets used and whether it does the "right > thing" from VLC's point of view, and how to get it to write the > "right thing". I looked at ffmpeg's source, and figured out that it uses the above functions to write the trak.udta.name atom for its metadata "title": $ ffmpeg -y -f lavfi -i testsrc -f lavfi -i sine=f=880 -f lavfi -i sine=f=1000 -map 0 -map 1 -map 2 -t 0.5 -metadata:s:a:0 title="880 sine" -metadata:s:a:1 title="1000 sine" out_ffmpeg.mp4 AtomicParsley now sees reports the tag, just like it did for HandBrake's file: $ AtomicParsley out_ffmpeg.mp4 -t 1 [...] User data; level: track=2; atom "name" : 880 sine User data; level: track=3; atom "name" : 1000 sine So ffmpeg is basically doing the right thing with "title". Unfortunately, VLC seems picky about this, and still doesn't display it. This may or may not have to do with the differing major_brand, compatible_brands, or the structure of the MOOV atoms. *shrug* At this point, we'd probably need to look at VLC's source code to figure this out. :-P There is some udta parsing in VLC's modules/demux/mp4/mp4.c, in function MP4_TrackCreate(). It doesn't look picky, but what do I know. Moritz ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Re: [FFmpeg-user] Naming an audio track
[Replying to self] On Mon, Nov 03, 2014 at 10:21:39 +0100, Moritz Barsnick wrote: > I do not know, though, whether "name" is a header such as "stco" or > "udta". So apparently we're looking as MPEG4/MOV containers here. That's what Tomáš was using as well, and where I managed to reproduce. Using AtomicParsley, I managed to "see" that the tag in use is an atom trak.udta.name: Atom trak @ 8193 of size: 560, ends @ 8753 Atom tkhd @ 8201 of size: 92, ends @ 8293 Atom mdia @ 8293 of size: 428, ends @ 8721 [...] Atom udta @ 8721 of size: 32, ends @ 8753 Atom name @ 8729 of size: 24, ends @ 8753 The atom is described here: https://developer.apple.com/library/mac/documentation/QuickTime/QTFF/QTFFChap2/qtff2.html#//apple_ref/doc/uid/TP4939-CH204-BBCCFFGD I have found a mention that HandBrake and subler use this atom: https://github.com/pjan/osx-dotfiles/blob/55d452fae4037a019c85a6095a5b3a0bd11e3d15/.dotfiles/.encode-handheld.pl#L2907 I couldn't figure how to add arbitrary atoms with AtomicParsley, only how to delete them. I do see ffmpeg has a function named mov_write_track_udta_tag(), called from mov_write_trak_tag(), called from mov_write_moov_tag(), but I don't know if it gets used and whether it does the "right thing" from VLC's point of view, and how to get it to write the "right thing". Getting closer, Moritz P.S.: Interesting, because it follows a question I never dared to ask: Where does my PVR/STB get the names of its audio tracks from? (Albeit MPEG-TS.) ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Re: [FFmpeg-user] Naming an audio track
On Mon, Nov 03, 2014 at 01:47:23 +, Carl Eugen Hoyos wrote: > > $ HandBrakeCLI [...] --aname "Name of audio track 1,Name of audio track 2" > If somebody could now either upload a small sample or > provide an actual command line, we could try to > implement the missing feature... Sorry, I was quite tired and didn't know what I was thinking. I'm attaching an artificially created file, as it's smaller than most log files. ;-) Created as such: $ ffmpeg -y -f lavfi -i testsrc -f lavfi -i sine=f=880 -f lavfi -i sine=f=1000 -map 0 -map 1 -map 2 -t 0.5 in.mkv $ HandBrakeCLI -i in.mkv -o out.mp4 --audio 1,2 --aname "880 Hz sine wave,1 kHz sine wave" Sorry, my HandBrake is really old and has problems with the video, but the point is moot: VLC shows the two audio tracks of out.mp4 exactly as I tagged them with the HandBrake command line. BTW, using ffmpeg, I notice that when I use '-metadata:s:a:0 name="880 sine"', the file creation process shows me: Stream #0:1: Audio: aac (libfdk_aac) ([64][0][0][0] / 0x0040), 44100 Hz, mono, s16, 96 kb/s (default) Metadata: name: 880 sine encoder : Lavc56.10.100 libfdk_aac yet ffprobe fails to display the "name" metadata in the resulting file. This field - if it is a metadata field - does not seem to be supported by the MP4 muxer, and again ffmpeg is "lying" ;-) about its metadata creation - similar to the thread I started recently. Moritz P.S.: I can actually see the "tags" in a hexdump of the HandBrake created file: -21E0: A6 00 00 00 1C 73 74 73 - 63 00 00 00 00 00 00 00 .stsc... -21F0: 01 00 00 00 01 00 00 00 - 17 00 00 00 01 00 00 00 -2200: 14 73 74 63 6F 00 00 00 - 00 00 00 00 01 00 00 05 .stco... -2210: 56 00 00 00 20 75 64 74 - 61 00 00 00 18 6E 61 6D V... udtanam -2220: 65 38 38 30 20 48 7A 20 - 73 69 6E 65 20 77 61 76 e880 Hz sine wav -2230: 65 00 00 02 2F 74 72 61 - 6B 00 00 00 5C 74 6B 68 e.../trak...\tkh -2240: 64 00 00 00 02 D0 7C F6 - 53 D0 7C F6 53 00 00 00 d.|.S.|.S... -2250: 03 00 00 00 00 00 00 5C - 00 00 00 00 00 00 00 00 ...\ I do not know, though, whether "name" is a header such as "stco" or "udta". out.mp4 Description: Binary data ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Re: [FFmpeg-user] Naming an audio track
Moritz Barsnick gmx.net> writes: > Okay, now we know how to produce a file in which > VLC recognizes the names of audio streams: > $ HandBrakeCLI [...] --aname "Name of audio track 1,Name of audio track 2" If somebody could now either upload a small sample or provide an actual command line, we could try to implement the missing feature... Carl Eugen ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Re: [FFmpeg-user] Naming an audio track
On Mon, 03 Nov 2014 00:28:41 +0100, Moritz Barsnick wrote: On Sun, Nov 02, 2014 at 23:24:58 +0100, Tomáš Hnyk wrote: encoder : HandBrake 0.9.9 2013051800 Okay, now we know how to produce a file in which VLC recognizes the names of audio streams: $ HandBrakeCLI [...] --aname "Name of audio track 1,Name of audio track 2" Only HandBrake and VLC seem to agree on this info, neither ffprobe (with any -show_* option) or mediainfo show this track name (in my experiments with an MP4 container). Too tired to try to disassemble the MP4, and my AtomicParsley is segfaulting. Your turn. :) Good night, Moritz Hm, if it is something proprietary to VLC and Handbrake, I can probably let it be... Good night, Tomas ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Re: [FFmpeg-user] Naming an audio track
On Sun, Nov 02, 2014 at 23:24:58 +0100, Tomáš Hnyk wrote: > encoder : HandBrake 0.9.9 2013051800 Okay, now we know how to produce a file in which VLC recognizes the names of audio streams: $ HandBrakeCLI [...] --aname "Name of audio track 1,Name of audio track 2" Only HandBrake and VLC seem to agree on this info, neither ffprobe (with any -show_* option) or mediainfo show this track name (in my experiments with an MP4 container). Too tired to try to disassemble the MP4, and my AtomicParsley is segfaulting. Your turn. :) Good night, Moritz ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Re: [FFmpeg-user] Naming an audio track
On Sun, 02 Nov 2014 22:50:22 +0100, James Darnley wrote: On 2014-11-02 22:39, Tomáš Hnyk wrote: Unfortunately, no, the file in question has 7,2 GB. I attach a screenshot of what I mean. Tomas Can you post what gets printed when you run: ffmpeg -i BIGFILE Sure, here it goes: ffmpeg -i BIGFILE fmpeg version 2.3.git-1ace957 Copyright (c) 2000-2014 the FFmpeg developers built on Jul 26 2014 20:25:06 with gcc 4.8 (Ubuntu 4.8.2-19ubuntu1) configuration: --extra-libs=-ldl --prefix=/opt/ffmpeg --enable-avresample --disable-debug --enable-nonfree --enable-gpl --enable-version3 --enable-x11grab --enable-libpulse --enable-libopencore-amrnb --enable-libopencore-amrwb --disable-decoder=amrnb --disable-decoder=amrwb --enable-libx264 --enable-libx265 --enable-libfdk-aac --enable-libvorbis --enable-libmp3lame --enable-libopus --enable-libvpx --enable-libspeex --enable-libass --enable-avisynth --enable-libsoxr libavutil 52. 92.101 / 52. 92.101 libavcodec 55. 69.100 / 55. 69.100 libavformat55. 49.100 / 55. 49.100 libavdevice55. 13.102 / 55. 13.102 libavfilter 4. 11.102 / 4. 11.102 libavresample 1. 3. 0 / 1. 3. 0 libswscale 2. 6.100 / 2. 6.100 libswresample 0. 19.100 / 0. 19.100 libpostproc52. 3.100 / 52. 3.100 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'BIGFILE': Metadata: major_brand : mp42 minor_version : 0 compatible_brands: mp42isomavc1 creation_time : 2014-10-04 00:16:47 encoder : HandBrake 0.9.9 2013051800 Duration: 00:51:22.63, start: 0.00, bitrate: 19802 kb/s Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 1920x1080 [SAR 1:1 DAR 16:9], 18780 kb/s, 24 fps, 24 tbr, 90k tbn, 180k tbc (default) Metadata: creation_time : 2014-10-04 00:16:47 encoder : JVT/AVC Coding Stream #0:1(und): Audio: ac3 (ac-3 / 0x332D6361), 48000 Hz, 5.1(side), fltp, 640 kb/s (default) Metadata: creation_time : 2014-10-04 00:16:47 Stream #0:2(und): Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 197 kb/s Metadata: creation_time : 2014-10-12 23:08:29 Tomas ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Re: [FFmpeg-user] Naming an audio track
On 2014-11-02 22:39, Tomáš Hnyk wrote: > Unfortunately, no, the file in question has 7,2 GB. I attach a > screenshot of what I mean. > Tomas Can you post what gets printed when you run: ffmpeg -i BIGFILE signature.asc Description: OpenPGP digital signature ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Re: [FFmpeg-user] Naming an audio track
On Sun, 02 Nov 2014 22:28:22 +0100, Moritz Barsnick wrote: On Sun, Nov 02, 2014 at 22:20:58 +0100, Tomáš Hnyk wrote: I tried both name and title and it does not show in VLC (it shows them in the source file). Do you happen to have a (short) sample which shows your desired behavior in VLC? Thanks, Moritz Unfortunately, no, the file in question has 7,2 GB. I attach a screenshot of what I mean. Tomas___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Re: [FFmpeg-user] Naming an audio track
On Sun, Nov 02, 2014 at 22:20:58 +0100, Tomáš Hnyk wrote: > I tried both name and title and it does not show in VLC (it shows them in > the source file). Do you happen to have a (short) sample which shows your desired behavior in VLC? Thanks, Moritz ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Re: [FFmpeg-user] Naming an audio track
On Sun, 02 Nov 2014 22:15:29 +0100, James Darnley wrote: On 2014-11-02 22:10, Tomáš Hnyk wrote: On Sun, 02 Nov 2014 21:06:46 +0100, DopeLabs wrote: streams are identified using numbers, starting from 0 https://ffmpeg.org/ffmpeg-all.html#Stream-specifiers-1 Yes, I know. I could use metadata:s:a:1 language=eng to set the language of the second audios stream, but how would I set its name? Tomas Set the right metadata. "name"? "title"? "title" probably. Look at one that already does the Right Thing (TM) I tried both name and title and it does not show in VLC (it shows them in the source file). This does not list per stream metadata: http://wiki.multimedia.cx/index.php?title=FFmpeg_Metadata Tomas ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Re: [FFmpeg-user] Naming an audio track
On 2014-11-02 22:10, Tomáš Hnyk wrote: > > On Sun, 02 Nov 2014 21:06:46 +0100, DopeLabs wrote: > >> streams are identified using numbers, starting from 0 >> >> https://ffmpeg.org/ffmpeg-all.html#Stream-specifiers-1 > > Yes, I know. I could use metadata:s:a:1 language=eng to set the > language of the second audios stream, but how would I set its name? > Tomas Set the right metadata. "name"? "title"? "title" probably. Look at one that already does the Right Thing (TM) signature.asc Description: OpenPGP digital signature ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Re: [FFmpeg-user] Naming an audio track
On Sun, 02 Nov 2014 21:06:46 +0100, DopeLabs wrote: streams are identified using numbers, starting from 0 https://ffmpeg.org/ffmpeg-all.html#Stream-specifiers-1 Yes, I know. I could use metadata:s:a:1 language=eng to set the language of the second audios stream, but how would I set its name? Tomas ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Re: [FFmpeg-user] Naming an audio track
streams are identified using numbers, starting from 0 https://ffmpeg.org/ffmpeg-all.html#Stream-specifiers-1 > On Nov 2, 2014, at 11:55 AM, Tomáš Hnyk wrote: > > Hello, > When a file has more audio tracks, it is handy to name them and at least VLC > can show their names - or titles, I am not sure about the terminology - in > menu under Audio>Audio Track. How do I set the names using ffmpeg? I know how > to set the language using -metadata:s:a:0 language=eng but this is something > else. What is the right syntax? > Regards, > Tomas > ___ > ffmpeg-user mailing list > ffmpeg-user@ffmpeg.org > http://ffmpeg.org/mailman/listinfo/ffmpeg-user ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user
[FFmpeg-user] Naming an audio track
Hello, When a file has more audio tracks, it is handy to name them and at least VLC can show their names - or titles, I am not sure about the terminology - in menu under Audio>Audio Track. How do I set the names using ffmpeg? I know how to set the language using -metadata:s:a:0 language=eng but this is something else. What is the right syntax? Regards, Tomas ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user