m4v through mt-daapd

Viewing 10 posts - 1 through 10 (of 14 total)
  • Author
    Posts
  • #561
    dr_s
    Guest

    Please forgive this borderline off-topic post. I’ve been trying to stream m4v’s through mt-daapd and running into problems. iTunes (with svn-1372) now recognizes the m4v as video, and shows the correct length, which is good. Unfortunately when I try to play, it (iTunes 6.0.5) hangs for a while, and then never plays the video. After some testing, I found that…

    – m4v files encoded using QuickTime Pro’s Export to iPod work
    – m4v files that are DRM’ed (iTunes music store) apparently do not work, and also cause iTunes to hang (although I didn’t wait for the hanging to end to verify that the video would never play)

    So I guess that means there is something wrong with my m4v encoding method, which is this:

    ffmpeg -i input_file.mpg -vcodec xvid -s 320x240 -b 300 -qmin 3 -qmax 5 -bufsize 4096 -g 300 -acodec aac -ab 96 output_file.m4v

    These videos play fine locally in iTunes, but do not stream through mt-daapd. If anyone has any more information, or can give me their ffmpeg command line options that create an m4v that successfully streams, please reply. Thanks!

    #6240
    rpedde
    Participant

    @dr_s wrote:

    These videos play fine locally in iTunes, but do not stream through mt-daapd. If anyone has any more information, or can give me their ffmpeg command line options that create an m4v that successfully streams, please reply. Thanks!

    Any problem with local versus streaming almost *always* has to do with the file in question not being “fast-start”… that is, with the metainfo *before* the data.

    I *though* ffmpeg had a faststart remuxer, but maybe not. If not, you can try a post-remuxer like this one:

    http://www.multimedia.cx/qt-faststart.c

    Fair warning: haven’t tried it, but it looks right.

    — Ron

    #6241
    dr_s
    Guest

    rpedde, thanks so much! Works great….

    Finally, the missing piece in my all-in-one TiVo to iTunes TV share Linux solution is complete. Now just to install this perl script as a cron job and any TV shows I record on TiVo will be available on iTunes… ๐Ÿ™‚

    #6242
    rpedde
    Participant

    @dr_s wrote:

    rpedde, thanks so much! Works great….

    Finally, the missing piece in my all-in-one TiVo to iTunes TV share Linux solution is complete. Now just to install this perl script as a cron job and any TV shows I record on TiVo will be available on iTunes… ๐Ÿ™‚

    Nice… still waiting for series 3 so I can punt this stupid sci-atlanta box. What junk. Just a couple more weeks, if the rumor mills are right.

    — Ron

    #6243
    dr_s
    Guest

    Sadly, my joy was premature.

    Although the qt-faststart code fixes the ffmpeg-generated files (they will now play through iTunes video sharing), my test video was a paltry 1.5 mb xvid mp4. When I tried with a larger, 80 mb file, iTunes hung again… for approximately the amount of time that it would take to download that file in entirety. I only didn’t notice the downloading of the file with the small test video. I believe that iTunes may require something else in the video file that qt-faststart doesn’t supply (hinting, perhaps?).

    Again, these files are playing fine locally.

    I’m going to take a closer look at the video format created by QTPro’s “Export to iPod” functionality. I think it’s encoding to H.264, which I may need to switch to (sigh).

    Again, if anyone has successfully encoded mpeg2 video to mp4 on Linux and streamed it over iTunes video sharing, please let me know your method.

    #6244
    rpedde
    Participant

    @dr_s wrote:

    Although the qt-faststart code fixes the ffmpeg-generated files (they will now play through iTunes video sharing), my test video was a paltry 1.5 mb xvid mp4. When I tried with a larger, 80 mb file, iTunes hung again… for approximately the amount of time that it would take to download that file in entirety. I only didn’t notice the downloading of the file with the small test video. I believe that iTunes may require something else in the video file that qt-faststart doesn’t supply (hinting, perhaps?).

    I don’t belive iTunes does streaming at all. I think it always pulls the whole file and then plays it locally. That’s why there is no motion on doing server side video transcoding.

    I’m going to take a closer look at the video format created by QTPro’s “Export to iPod” functionality. I think it’s encoding to H.264, which I may need to switch to (sigh).

    Your contention is that h.264 *does* stream? That would be news to me, and welcome to hear.

    #6245
    dr_s
    Guest

    I’m beginning to think this might be an issue with mt-daapd’s video streaming…. ๐Ÿ˜•

    I tried streaming the same file from mt-daapd (causing a long beachball hang) as well as an old Powerbook G4 through iTunes 6.0.5 (a short beachball hang ~4s, then a dialog pops up saying “Connecting…”, and then streaming begins).

    Both systems are set up with similar bandwidth constraints (802.11) (I noticed that when I connected to the Linux machine via gigabit eth, the videos played over sharing without a problem, but they could have been just downloaded locally and I would not have noticed the time delay, since it was gigabit….)

    I’m going to compare packet dumps and see if anything looks fishy…

    #6246
    dr_s
    Guest

    I’ve basically given up at this point on using mt-daapd to stream these video files. The only thing I noticed while comparing packet dumps is that when connecting to the iTunes server, the client actually makes TWO simultaneous connections. The first downloads the file in its entirety. The second begins after about 5 seconds, and downloads the file using bytes ranges (essentially streaming). I’m not sure if the first connection is terminated at some point.

    While connecting to mt-daapd, the second connection is never initiated. Not sure why, but I didn’t spend all that much time trying to figure it out. I made a few simple/superficial changes to mt-daapd to try to make mt-daapd appear more like iTunes server in its response headers, but it had no positive effect (e.g. mt-daapd returns audio/mp4 as content-type instead of video/mp4, etc).

    Since streaming seems to work just fine (using qt-faststart) over httpd, I just wrote a little website to serve my videos over http (which also makes access via the web easier). Though it would be nice to also share over iTunes if that gets worked out at some point in the future.

    In regards to your uncertainty about iTunes streaming and H.264 streaming, I’m certain that iTunes is doing streaming in its sharing of video files. About H.264 vs Xvid, my knowledge in this area is very limited, but I believe that streaming occurs just fine with either codec within iTunes.

    #6247
    rpedde
    Participant

    @dr_s wrote:

    The first downloads the file in its entirety. The second begins after about 5 seconds, and downloads the file using bytes ranges (essentially streaming). I’m not sure if the first connection is terminated at some point.

    I’ve seen that on protected movies.. it looks like it’s grabbing the headers to see if it has (or needs) the encryption key for it, then does a fresh fetch if it can play it.

    Since streaming seems to work just fine (using qt-faststart) over httpd, I just wrote a little website to serve my videos over http (which also makes access via the web easier). Though it would be nice to also share over iTunes if that gets worked out at some point in the future.

    I’ll take a closer look at it. It probably is related to the problems I’m having with FrontRow. I think once I get those worked out, the streaming will probably come with it.

    Thanks for looking at this, though.

    In regards to your uncertainty about iTunes streaming and H.264 streaming, I’m certain that iTunes is doing streaming in its sharing of video files. About H.264 vs Xvid, my knowledge in this area is very limited, but I believe that streaming occurs just fine with either codec within iTunes.

    Good to hear, anyway… if I can make it go, then I might be able to do server-side transocoding of video, which would be nice.

    — Ron

    #6248
    nathanziarek
    Participant

    How is work progressing on this?

    I’ve noticed the same (or similar) thing: If I use QuickTime to export the movie to an AppleTV profile, the movie appears to stream through mt-daap no problem (not sure how to tell if it is actually streaming vs. copying, but at 50MB, it starts pretty quick). If I just straight rip it with Handbrake (essentially ffmpeg), it doesn’t work at all.

    I’m mostly interested in getting video to work, but I’ve got no real programming skill to offer. I’d be happy to continually test out new versions, though and see what I find.

    This latest test was on svn-1539.

    nate

Viewing 10 posts - 1 through 10 (of 14 total)
  • The forum ‘Setup Issues’ is closed to new topics and replies.