Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Video Encoding > MPEG-4 AVC / H.264

Reply
 
Thread Tools Search this Thread Display Modes
Old 11th October 2007, 18:19   #1  |  Link
ohropax
Registered User
 
Join Date: Sep 2007
Posts: 16
Which container/program for http progressive playback of h264/aac

Hi all,

i am working on a plugin for VDR and want to create a low bandwidth stream from live tv. However i have problems finding a combination of container/software and player that actually works well. Usually this would be a case for RTP transmission, however the application can not serve data as RTP livestream and can not be modified in that direction for various reasons. Instead the clients must connect to the application by HTTP and receive the data through this connection. As clients (VLC,mplayer,etc) have been supporting this for ages, this should not be too difficult. this prooved to be wrong.

The part that i am working on can be seen as a pipe. It receives a filtered MPEG transport stream containing MPEG2 audio+video and must output a stream containing h.264 video and AAC audio.

The simplest implementation uses the ffmpeg commandline utility and muxes the converted streams into MPEG TS. This creates a number of problems:
1. All clients that i have tested so far, fail to display the video stream properly, news tickers jump back and forth - it looks as if the presentation timestamps on the frames are wrong. If i change the video codec to (ffmpeg -vcodec mpeg4) everything is working nicely.
2. Muxing to TS creates huge overhead, about 70-90% for AAC audio caused by the small size of the compressed audio packages.

Point (2) is only an annoyance but point (1) is the major blocker right now. Does anyone have an idea on how to achieve better results?

Thanks for any help,
Marcus

commandline for reference reasons:
"ffmpeg -i - -acodec libfaac -ab 64k -vcodec libx264 -b 240k -bt 240k ...somex264options... -f mpegts -"
ohropax is offline   Reply With Quote
Old 11th October 2007, 18:27   #2  |  Link
Sharktooth
Mr. Sandman
 
Sharktooth's Avatar
 
Join Date: Sep 2003
Location: Haddonfield, IL
Posts: 11,768
1 - look at the x264 options and disable b-pyramid AND use only 1 reference frame as a starting point.
Sharktooth is offline   Reply With Quote
Old 12th October 2007, 08:27   #3  |  Link
ohropax
Registered User
 
Join Date: Sep 2007
Posts: 16
Hi,

i've tried it and it does not help. Below is the full commandline. On your suggestion i added the last two flags (bpyramid and refs). The reason behind the other options is to have x264 cli defaults in ffmpeg.

/usr/local/bin/ffmpeg -i - -acodec libfaac -ab 64k -cutoff 15000 -vcodec libx264 -s cif -b 240k -bt 240k -coder 1 -flags +loop -cmp +chroma -partitions +parti4x4+partp8x8+partb8x8 -me hex -subq 5 -me_range 16 -g 250 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -qdiff 4 -qmax 51 -qmin 10 -qcomp 0.6 -rc_eq blurCplx^(1-qComp) -refs 1 -flags2 -bpyramid -f mpegts -

I also tested it without the 'default' options and it does not help either. This time the commandline was:

/usr/local/bin/ffmpeg -i - -acodec libfaac -ab 64k -cutoff 15000 -vcodec libx264 -s cif -b 240k -bt 240k -refs 1 -flags2 -bpyramid -f mpegts -

Best regards, Marcus
ohropax is offline   Reply With Quote
Old 12th October 2007, 08:31   #4  |  Link
ohropax
Registered User
 
Join Date: Sep 2007
Posts: 16
BTW the software versions are sufficiently recent checkouts

FFmpeg version SVN-r10700, Copyright (c) 2000-2007 Fabrice Bellard, et al.
configuration: --enable-shared --enable-pthreads --enable-gpl --enable-liba52 --enable-libx264 --enable-libfaac --enable-libmp3lame --enable-libfaad
libavutil version: 49.5.0
libavcodec version: 51.45.0
libavformat version: 51.14.0
built on Oct 11 2007 15:00:57, gcc: 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)

x264 core:56 svn-680
ohropax is offline   Reply With Quote
Old 12th October 2007, 08:41   #5  |  Link
ohropax
Registered User
 
Join Date: Sep 2007
Posts: 16
Another sidenote regarding MPEG TS: If i change the commandline from -f mpegts to any of (mpeg,vob,dvd) the resulting stream saved to a file can be played without problems.

But it cannot be played 'live' through http, because programs do not find the necessary codec information. I took a look at the MPEG file with Elecard Stream Analyzer and discovered that (vob,dvd) files do not begin with a 'sequence header' packet but with the following packet, iow: somehow ffmpeg omits writing the first header. This has the result that when piping this file back to ffmpeg as input and only giving it the section from beginning of the file up to right before the start of the 'next' sequence header, it does not find the correct codec parameters. If i start feeding right before the 'next' sequence header it finds them immediately. So i think this is probably related to client programs not being able to start playing at all.
ohropax is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 07:10.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.