FireFly Media Server › Firefly Media Server Forums › Firefly Media Server › General Discussion › iTunes internals
- This topic has 22 replies, 6 voices, and was last updated 16 years, 11 months ago by rpedde.
-
AuthorPosts
-
06/12/2007 at 6:53 PM #14960AnonymousInactive
@sonichouse wrote:
I found this on a posting
-async 1 -deinterlace -vcodec libx264 -b 384000 -maxrate 768k -bufsize 384 -coder 0 -level 13
-acodec libfaac -ab 128000Not sure if it helps π
It didn’t, but thanx…
11/12/2007 at 8:55 AM #14961AnonymousInactive@turbo wrote:
@rpedde wrote:
Look around on the net for fast-start enabled aac. That’s what you need — metadata at the head of the file, not the tail. iTunes can play that.
Running the MOV file through qt-faststart and send that (i.e. without going through ffmpeg) doesn’t seem to help. iTunes still hangs up.
Could we please revisit this – it doesn’t compute…
I’ve converted my AVI to MP4, ran it through MP4Box (http://castfortwo.blogspot.com/2007/10/make-mp4-files-faststart-with-mp4box.html) to make it faststart… Streaming that file still makes iTunes to hangup…
[celia.pts/6]$ ll -h tempfile.mp4
-rw-r--r-- 1 turbo turbo 198M 2007-12-11 09:45 tempfile.mp4
[celia.pts/6]$ MP4Box -info tempfile.avi
Import probing results for tempfile.avi:
File has 2 tracks
Track 1 type: Video (XVID)
Track 2 type: Audio (....)
[celia.pts/6]$ MP4Box -inter 500 tempfile.mp4
Saving tempfile.mp4: 0.500 secs Interleaving
[celia.pts/6]$ MP4Box -info tempfile.mp4
* Movie Info *
Timescale 1000 - Duration 01:43:19.480
Fragmented File no - 2 track(s)
File Brand isom - version 512
Created: GMT Fri Jan 2 00:00:00 1970
File has no MPEG4 IOD/OD
Track # 1 Info - TrackID 1 - TimeScale 25 - Duration 01:43:19.480
Media Info: Language "Undetermined" - Type "vide:mp4v" - 154987 samples
MPEG-4 Config: Visual Stream - ObjectTypeIndication 0x20
MPEG-4 Visual Size 640 x 240 - Simple Profile @ Level 1
Pixel Aspect Ratio 1:1 - Indicated track size 640 x 240
Self-synchronized
Track # 2 Info - TrackID 2 - TimeScale 48000 - Duration 01:43:19.424
Media Info: Language "Undetermined" - Type "soun:mp4a" - 290598 samples
MPEG-4 Config: Audio Stream - ObjectTypeIndication 0x40
MPEG-4 Audio AAC LC - 2 Channel(s) - SampleRate 48000
Synchronized on stream 1And the -hint option didn’t help either…
I read somewhere that the version of iTunes matters – mine is 7.5 (19)…11/12/2007 at 7:17 PM #14962AnonymousInactiveAccording to http://lists.mplayerhq.hu/pipermail/ffmpeg-user/2007-December/012802.html the Fast Start thingie isn’t needed any more…
> Search the net for NicMP4Box.ese and take the ffmpeg h264 file and run
> it through the program. It adjusts the stream by adding a iTunes
> required uuid atom.the atom is nolonger needed in itunes versions since 7.4.2. tested with both ipod and ipod touch, and iphone very soon π
11/12/2007 at 8:17 PM #14963jtbseParticipant@turbo wrote:
According to http://lists.mplayerhq.hu/pipermail/ffmpeg-user/2007-December/012802.html the Fast Start thingie isn’t needed any more…
the atom is nolonger needed in itunes versions since 7.4.2. tested with both ipod and ipod touch, and iphone very soon π
Hmm, might be true for iTunes, but what about Firefly?
I’m guessing this has to do with the specific DAAP implementation in question…I guess Ron would have to comment on that, but I would be surprised if he’s made any major changes to DAAP in Firefly in awhile.
Also not sure what DAPs (i.e. ipod, ipod touch, and iphone) really have to do with this since as I have always understood it, the fast-start streaming issue with mp4 metadata has to do with streaming/sharing…not strictly decoding/playing.
12/12/2007 at 6:32 AM #14964rpeddeParticipant@jtbse wrote:
@turbo wrote:
According to http://lists.mplayerhq.hu/pipermail/ffmpeg-user/2007-December/012802.html the Fast Start thingie isn’t needed any more…
the atom is nolonger needed in itunes versions since 7.4.2. tested with both ipod and ipod touch, and iphone very soon π
Hmm, might be true for iTunes, but what about Firefly?
I’m guessing this has to do with the specific DAAP implementation in question…I guess Ron would have to comment on that, but I would be surprised if he’s made any major changes to DAAP in Firefly in awhile.
Also not sure what DAPs (i.e. ipod, ipod touch, and iphone) really have to do with this since as I have always understood it, the fast-start streaming issue with mp4 metadata has to do with streaming/sharing…not strictly decoding/playing.
Right. First, fast start is completely unrelated to the uuid atom. As mentioned previously, playing from a local file system is completely different from streaming. Playing from a seekable file system, iTunes doesn’t care about metadata arrangement. But for streaming, the metadata has to be front-loaded, or itunes simply won’t stream it.
As far as why your fast start streaming file wont’ play, have you verified the metadata is front loaded? Use something that will show you the real tag order (like atomicparsley) so you can actually verify that the metadata is right.
If the metadata is right, and it plays from a seekable file system, but not streamed, then I don’t really have a good answer. Something about the headers that iTunes still doesn’t like? Not sure.
But it’s isn’t a firefly thing, I’d wager. I’d guess it wouldn’t stream itunes to itunes either.
— Ron
12/12/2007 at 1:18 PM #14965AnonymousInactive@rpedde wrote:
But for streaming, the metadata has to be front-loaded, or itunes simply won’t stream it.
Do you have any idea how to do this in a stream? I.e., to avoid first converting the AVI to a file, modify that (for streaming) and then send it to the client? It takes ~38 minutes to convert the AVI to any format, which is ‘a little lengthy’ π
@rpedde wrote:As far as why your fast start streaming file wont’ play, have you verified the metadata is front loaded? Use something that will show you the real tag order (like atomicparsley) so you can actually verify that the metadata is right.
Got a command line for that? Downloaded AtomicParsley, but I don’t know which atom to modify/check…
@rpedde wrote:If the metadata is right, and it plays from a seekable file system, but not streamed, then I don’t really have a good answer. Something about the headers that iTunes still doesn’t like? Not sure.
The file converted with MP4Box (MP4Box -hint filename.mov ) don’t play from FS at all – neither from iTunes nor QuickTime.
SUCCESS: The MPEG4IP (mp4creator -optimize filename.mov) one do play from FS in both iTunes and Quicktime though.
With this success, I had to modifying the way I test streaming a little – I got the latter to stream, where as the original (non fixed MOV) do not so I’m getting closer!
The changed testing phase is to set mp4v files to be SSC transcoded, make sure the script simply cat’s the file to STDOUT. This works when clicking on the actual file I want streamed.. But if clicking the AVI file (still cat’ing the streamable – working – MPEG4IP converted/fixed file though!) will (still!) make iTunes to hang up.. This is how I’ve been testing this previously, so apparently iTunes notices that it isn’t getting the file requested… ?!?Does the way I’m/have been testing makes sence? I’ll describe it in detail any way, just in case so if it’s clear, skip the rest of the post… It will also help me get my thoughs in order – I’ve tested so many ways, I’m starting to lose track of which π
mt-daapd.conf file:
mp3_dir = /share/Movies/tmp
extensions = .avi,.AVI,.mp4,.m4a,.m4v,.mov
ssc_codectypes = avi,mp4v
always_transcode = avi,mp4v
ssc_prog = /usr/local/bin/mt-daapd-ssc.plYes, I’m fully aware that Firefly do mp4v transcoding nativly, but this is just for test – forcing Firefly to go through the perl script for MOV files!.
The ssc_prog is basically the mt-daapd-ssc.pl distributed with Firefly, with some changes (see previous post for URL to modified version).These are the files in the directory specified:
[celia.pts/6]$ /bin/ls -CFln
total 7283480
-rw-rw-r-- 1 1000 3001 217938629 2007-12-03 11:51 Filename_asf-asf.asf
-rw-rw-r-- 1 1000 3001 733779968 2007-11-30 23:26 Filename_avi-avi.avi
-rw-rw-r-- 1 1000 3001 733779968 2007-11-30 11:52 Filename_avi-m4v.m4v
-rw-rw-r-- 1 1000 3001 733779968 2007-11-30 23:26 Filename_avi-mp4.mp4
-rw-rw-r-- 1 1000 3001 156982616 2007-11-29 10:36 Filename_m4v-m4v.m4v
-rw-rw-r-- 1 1000 3001 210032687 2007-11-29 09:19 Filename_mov-m4v.m4v
-rw-rw-r-- 1 1000 3001 210032687 2007-11-29 10:29 Filename_mov-mov.mov
-rw-rw-r-- 1 1000 3001 208910498 2007-12-03 12:24 Filename_mp4-mp4.mp4
-rw-rw-r-- 1 1000 3001 706084324 2007-11-29 15:05 Filename_mpg-mp4.mp4
-rw-rw-r-- 1 1000 3001 50305682 2007-11-30 11:52 Filename_ogg-m4v.m4v
-rw-rw-r-- 1 1000 3001 1190297644 2007-11-30 13:26 Filename_wav-m4v.m4v
-rw-rw-r-- 1 1000 3001 1190301740 2007-11-29 13:20 Filename_wav-wav.wav
-rw-r--r-- 1 1000 1000 290675860 2007-12-12 13:10 Filename_x264aac-mov_fixed-mp4box.mov
-rw-r--r-- 1 1000 1000 275112028 2007-12-12 13:07 Filename_x264aac-mov_fixed-mp4creator.mov
-r--r--r-- 1 1000 1000 275112028 2007-12-11 16:14 Filename_x264aac-mov.movAll files here originate from the Filename_avi-avi.avi file. They have been transcoded manually with ffmpeg… The *fixed* files have had additional runs through respective program.
Removing, creating and then modifying the db (basically setting has_video=1,codectype=’avi’ for all ‘%.avi‘ files and removing the extension from the title column) before restarting Firefly will show the following in iTunes:Name Time
Filename_avi-aviPreviously, I have always been double clicking the first file (Filename_avi-avi). Everything have failed (streaming working files etc). But with the fixed/changed test procedure (described above), I now double click on the last file. And it streams just fine! This is also the exact same physical file that is cat’ed from the perl script…
But if I then double click on the first file again (the pure AVI file), it (iTunes) hangs up. Even though it will receive a perfectly working file!!!
What’s going on here!?
12/12/2007 at 6:03 PM #14966AnonymousInactive@turbo wrote:
What’s going on here!?
And there it don’t work again…. WTF!? I’ve logged out and then in again. I’ve restarted Firefly, I’ve recreated the DB, but still… I’ll try rebooting the client and see if it’s something like ‘the Windows effect’ on OSX as well…
[UPDATE: No change after a client reboot and the server was rebooted a couple of weeks ago with plenty (256Mb) free mem and no high load average (0.00/0.02/0.10)].
12/12/2007 at 8:21 PM #14967AnonymousInactive@turbo wrote:
And there it don’t work again…. WTF!?
And back to working again…
1. Change Firefly to not transcode mp4v files, restart
2. Restart iTunes
3. Play a file that works (Filename_mpg-mp4.mp4 – it only plays sound but that don’t seem to matter). Cancel any time (couple of seconds is ok).
4. Play the sometimes working, sometimes not file (Filename_x264aac-mov_fixed-mp4creator.mov).Works fine. I don’t even have to do point 3. I can restart iTunes there instead:
1. Restart iTunes
2. Play the weird file…I’m not any wiser, but… Maybe there’s some caching somewhere?!
12/12/2007 at 10:21 PM #14968johnbladeGuestI think you have to specify that it is a video file in Firefly.
stolen from turbo’s post:celia:~# sqlite3 -column -header /var/cache/mt-daapd-test/songs3.db
SQLite version 3.3.8
Enter ".help" for instructions
sqlite> update songs set has_video=1,type='m4v',codectype='mp4v' where path like '%.mp4';
sqlite> select id,title,type,codectype,has_video from songs where path like '%.mp4';
id title type codectype has_video
4 Filename1 (mpg-mp4).mp4 m4v mp4v 1
9 Filename2 (avi-mp4).mp4 m4v mp4v 1
10 Filename3 (mp4-mp4).mp4 m4v mp4v 114/12/2007 at 4:59 AM #14969rpeddeParticipant@turbo wrote:
Got a command line for that? Downloaded AtomicParsley, but I don’t know which atom to modify/check…
-T I think shows the metadata tree. You’re checking if the mdat atom is at the end, not at the beginning.
Or whatever atom it is. Point is, all the metadata has be be before the huge atom that has all the movie data. If it doesn’t, won’t stream.
@rpedde wrote:
If the metadata is right, and it plays from a seekable file system, but not streamed, then I don’t really have a good answer. Something about the headers that iTunes still doesn’t like? Not sure.
The file converted with MP4Box (MP4Box -hint filename.mov ) don’t play from FS at all – neither from iTunes nor QuickTime.
That’s your first test. If it wont’ play off the fs, it will never stream.
The changed testing phase is to set mp4v files to be SSC transcoded, make sure the script simply cat’s the file to STDOUT. This works when clicking on the actual file I want streamed.. But if clicking the AVI file (still cat’ing the streamable – working – MPEG4IP converted/fixed file though!) will (still!) make iTunes to hang up.. This is how I’ve been testing this previously, so apparently iTunes notices that it isn’t getting the file requested… ?!?
probably from a different codec type.
What’s going on here!?
Nary a clue. But as mentioned before, you aren’t going to get this work with simple shell scripts. You’re going to *have* to have something to synthesize headers, like wavstreamer does only with m4v. That’s why wavstreamer is there (well, in addition to doing block reads — most transcoders output as they reach the ends of an encoding block, which might be pretty small — a few bytes in the case of some audio formats, which kills performance).
Also, I’m not sure you are going to be able to stream anything but m4v (or something transcoded to m4v), since most of the quicktime plugins require seekable streams. All the ogg stuff does, flac does, and I don’t know for sure, but I bet the perian stuff does too.
The only think I *know* will stream with quicktime is m4v.
I think you can get most of the way with shell scripts and small patches to the daap server, but I don’t think you can avoid an “m4vstreamer” type application.
– Ron
-
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.