Transport Stream video encoded by VLC doesn't play on iPhone

macOS specific usage questions
The DJ
Cone Master
Cone Master
Posts: 5987
Joined: 22 Nov 2003 21:52
VLC version: git
Operating System: Mac OS X
Location: Enschede, Holland
Contact:

Re: Transport Stream video encoded by VLC doesn't play on iPhone

Postby The DJ » 24 Jun 2009 16:49

and all the options in the command line are adjustable in the VLC preferences?
Correct.
Don't use PMs for support questions.

jaimed
Blank Cone
Blank Cone
Posts: 21
Joined: 16 Jun 2009 08:54

Re: Transport Stream video encoded by VLC doesn't play on iPhone

Postby jaimed » 02 Jul 2009 12:22

hello

I go on with this. I have another question related to the conversion. I have a "well encoded" video, send it through a rtsp stream in a 3GP container, open the stream with VLC and try to emit it using UDP; but don't use transcoding (i.e. I only change the container to MPEG TS). Will this affect to the video and audio encoding or leave them intact?

thanks

The DJ
Cone Master
Cone Master
Posts: 5987
Joined: 22 Nov 2003 21:52
VLC version: git
Operating System: Mac OS X
Location: Enschede, Holland
Contact:

Re: Transport Stream video encoded by VLC doesn't play on iPhone

Postby The DJ » 02 Jul 2009 13:53

Depends. VLC won't support re-packing h264 video retrieved from RTSP atm. The reason for this is that using RTSP, you loose the DTS timestamps, and thus a piece of software is required (packetizer) to "recreate" this value. Unfortunately for h264 this is very complex and the packetizer is not finished yet.
Don't use PMs for support questions.

jaimed
Blank Cone
Blank Cone
Posts: 21
Joined: 16 Jun 2009 08:54

Re: Transport Stream video encoded by VLC doesn't play on iPhone

Postby jaimed » 03 Jul 2009 13:25

Hi DJ

I have a ffmpeg command that results in a mpeg ts playable in the iPhone!!! Here it is...

Code: Select all

ffmpeg -i input.mp4 -f mpegts -acodec libmp3lame -ar 48000 -ab 128k -s 320×240 -vcodec libx264 -b 384k -flags +loop -cmp +chroma -subq 5 -trellis 1 -refs 1 -coder 0 -me_range 16 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -bt 200k -maxrate 384k -bufsize 384k -rc_eq 'blurCplx^(1-qComp)' -qcomp 0.6 -qmin 10 -qmax 51 -qdiff 4 -level 30 -aspect 320:240 -g 30 -async 2 output.ts
( from http://www.ioncannon.net/programming/45 ... segmenter/ )

If we translate this into a vlc command then we'll have http live streaming support on vlc :) If you know an approximated answer I could test it myself and give feedback

cheers

jaimed
Blank Cone
Blank Cone
Posts: 21
Joined: 16 Jun 2009 08:54

Re: Transport Stream video encoded by VLC doesn't play on iPhone

Postby jaimed » 06 Jul 2009 13:34

hello again,

I'm trying to replicate the command without success, but think I'm near...

Code: Select all

"/Applications/VLC.app/Contents/MacOS/VLC" -vvv -I dummy "/Users/ajln/Desktop/batman.mp4" --sout='#transcode{vcodec=h264,venc=x264{no-cabac,level=3.0,subme=5,trellis=1,merange=16,min-keyint=25,scenecut=40,ipratio=0.71,ratetol=20k,vbv-maxrate=96k,vbv-bufsize=96k,,qcomp=0.6,qpmin=10,qpmax=51,qpstep=4,keyint=30,ref=1,deblock=0:0},scale=1,acodec=mp4a,ab=128,samplerate=48000,channels=2,width=320,height=240}:duplicate{dst=std{access=udp,mux=ts,dst=127.0.0.1:1234}}'
apparently the x264 options are the same, but:

- no rc_eq option found
- no param equivalent to "-bt"

What should I do to use ffmpeg instead of x264 as venc?

regards

whyz
New Cone
New Cone
Posts: 1
Joined: 06 Jul 2009 13:56

Re: Transport Stream video encoded by VLC doesn't play on iPhone

Postby whyz » 06 Jul 2009 23:08

Hi,

If you're making any progress, I would like to hear about it. :)

wooo
Blank Cone
Blank Cone
Posts: 11
Joined: 04 Aug 2008 18:14

Re: Transport Stream video encoded by VLC doesn't play on iPhone

Postby wooo » 07 Jul 2009 06:55

Hi Folks,
I've got a command that works for "Many" videos (pre-recorded, haven't done any live transcoding). This is using a recent VLC nightly build, btw.

/Applications/VLC.app/Contents/MacOS/VLC -vvv -I dummy "/Users/[..snip..]/Movies/History of House.mp4" --sout="#transcode{width=160,canvas-height=120,vcodec=h264,samplerate=44100,vb=64,fps=15,acodec=mp3,ab=64}:standard{access=file,mux=ts,dst='-'}" | segmenter .... etc.

So here's what I've found...
I'm using the open source "segmenter" based on ffmpeg (same one that this is based on: http://www.ioncannon.net/programming/45 ... segmenter/ )

I've got this working fine actually, except that the last segment appears to be corrupted so the video doesn't finish playing. This is something that might be able to be fixed by the segmenter itself, but is probably due to a difference in the mpegts stream from VLC vs. ffmpeg, because...

this command (using ffmpeg on the same video) DOES work, all the way to the end :)

/opt/local/bin/ffmpeg -i "/Users/[..snip..]/Movies/History of House.mp4" -acodec libmp3lame -vcodec libx264 -f mpegts -ab 64kb -b 128kb -s 320x192 - | segmenter ...

Btw, I've used identical width/height for both and there is no difference, I just had this one ready to paste...

So the creator of the ffmpeg dependent segmenter had a patch to the mpegts muxer that was accepted into ffmpeg to fix a bug that caused it not to work right. I know vlc uses ffmpeg, but I'm not sure if it's always the latest from head and I'm not sure if the mpegts muxer in vlc is actually ffmpeg's or VLC's own. I'd really like to get it working on ALL videos that VLC can play, and I'd also like to figure out what's going wrong with the last segment not converting right.

loretta80
New Cone
New Cone
Posts: 2
Joined: 07 Jul 2009 07:00

Re: Transport Stream video encoded by VLC doesn't play on iPhone

Postby loretta80 » 07 Jul 2009 07:08

@ Wooo
You build a file (:standard{access=file,mux=ts,dst='-'}") but this thread is about to stream with live transcoding i think.

And thats my problem too. I tried the command line from above and thats the error message:

access_output_udp error: failed to create raw UDP socket
stream_out_standard error: no suitable sout access module for `udp/ts://0.0.0.0:27010'
stream_out_duplicate error: no destination given
stream_out_transcode error: cannot create chain
main error: stream chain failed for `transcode{vcodec=h264,venc=x264{no-cabac,level=3.0,subme=5,trellis=1,merange=16,min-keyint=25,scenecut=40,ipratio=0.71,ratetol=20k,vbv-maxrate=96k,vbv-bufsize=96k,,qcomp=0.6,qpmin=10,qpmax=51,qpstep=4,keyint=30,ref=1,deblock=0:0},scale=1,acodec=mp4a,ab=128,samplerate=48000,channels=2,width=320,height=240}:duplicate{dst=std{access=udp,mux=ts,dst=0.0.0.0:27010}}'
main error: cannot start stream output instance, aborting

So i think the container format and the udp stream doesn't work together, right? So i think the first step must be which container,videocodec and audiocodec combination is allowed to stream via http or udp.
I think the nicest way would be Video on demand, but i dont have expirience with that.

wooo
Blank Cone
Blank Cone
Posts: 11
Joined: 04 Aug 2008 18:14

Re: Transport Stream video encoded by VLC doesn't play on iPhone

Postby wooo » 07 Jul 2009 07:25

@loretta80
Sure, but the only difference is I'm using the open source ffmpeg based segmenter which supports stdin and the other person was using the apple provided segmenter, which is closed source, protected by a NDA, and only runs on an intel mac (have I said too much ;).

What I'm saying is that you can accomplish the same goal: live streaming to iPhone using the same command I gave above, but changing the input source from a file to be "qtcapture://" I'm doing a live transcode to "ts" stream to segmenter. The only difference was the source, and the segmenter, and the errors I've mentioned.

loretta80
New Cone
New Cone
Posts: 2
Joined: 07 Jul 2009 07:00

Re: Transport Stream video encoded by VLC doesn't play on iPhone

Postby loretta80 » 07 Jul 2009 07:48

Now i just tried this
:sout=#transcode{vcodec=h264,vb=800,scale=0.5,acodec=mp4a,ab=128,channels=2}:duplicate{dst=display,dst=std{access=udp,mux=ts,dst=192.168.1.127:27010}}

an VLC 0.9.9.0 hangs up with an error in libx264_plugin.dll

tried to stream a avi file with this values:

Format : AVI
Format/Info : Audio Video Interleave
File size : 346 MiB
Duration : 41min
Overall bit rate : 1 168 Kbps
Writing application : Nandub v1.0rc2
Writing library : Nandub build 1852/release

Video
ID : 0
Format : MPEG-4 Visual
Format profile : Streaming Video@L1
Format settings, BVOP : Ja
Format settings, QPel : Nein
Format settings, GMC : Keine warppoints
Format settings, Matrix : Default (MPEG)
Muxing mode : Packed bitstream
Codec ID : XVID
Codec ID/Hint : XviD
Duration : 41min
Bit rate : 977 Kbps
Width : 640 Pixel
Height : 352 Pixel
Display aspect ratio : 16/9
Frame rate : 25,000 FPS
Original frame rate : 23,976 FPS
Resolution : 24 bits
Colorimetry : 4:2:0
Scan type : progressiv
Bits/(Pixel*Frame) : 0.173
Stream size : 289 MiB (84%)
Writing library : XviD 1.1.0 (UTC 2005-11-22)

Audio
ID : 1
Format : MPEG Audio
Format version : Version 1
Format profile : Layer 3
Codec ID : 55
Codec ID/Hint : MP3
Duration : 41min
Bit rate mode : variabel
Bit rate : 178 Kbps
Channel(s) : 2 Kanäle
Sampling rate : 48,0 KHz
Resolution : 16 bits
Stream size : 52,7 MiB (15%)
Alignment : Ausgerichtet an Interleaves
Interleave, duration : 24 ms (0,60 Video-Frame)
Interleave, preload duration : 103 ms

Tried some more else with the same error. Is this a bug or is the combination incorrect?

physicsguy
New Cone
New Cone
Posts: 5
Joined: 16 Jul 2004 05:42
Location: Cupertino, CA, USA

Re: Transport Stream video encoded by VLC doesn't play on iPhone

Postby physicsguy » 10 Jul 2009 01:30

For what it's worth, Mpeg Streamclip has similar problems with H.264+AAC encapsulated by VLC into MPEG2 TS. The video won't play.

jaimed
Blank Cone
Blank Cone
Posts: 21
Joined: 16 Jun 2009 08:54

Re: Transport Stream video encoded by VLC doesn't play on iPhone

Postby jaimed » 16 Jul 2009 12:57

from the apple forums:

"VLC does not work with our client (iPhone). It does not add the required H.264 Access Unit NAL between access units."

jaimed
Blank Cone
Blank Cone
Posts: 21
Joined: 16 Jun 2009 08:54

Re: Transport Stream video encoded by VLC doesn't play on iPhone

Postby jaimed » 17 Aug 2009 14:12

from viewtopic.php?f=4&t=63082&p=210918#p212377 :

In "Tools" -> "Preferences", select "All" in the Show settings box to display the advanced options. Then go to "Input/Codecs" -> "Video Codecs" -> "x264", and at the bottom of the list, tick the "Access unit delimiters" box. This will generate the NAL units required by the segmenter.

The segmenter doesn't give errors any more! but the video won't play on the iPhone, as before :( This is my command line:

Code: Select all

"/Applications/VLC.app/Contents/MacOS/VLC" -vvv -I dummy "/Users/ajln/Desktop/batman.mp4" --sout='#transcode{vcodec=h264,venc=x264{no-cabac,level=3.0,subme=5,trellis=1,merange=16,min-keyint=25,scenecut=40,ipratio=0.71,ratetol=20k,vbv-maxrate=96k,vbv-bufsize=96k,qcomp=0.6,qpmin=10,qpmax=51,qpstep=4,keyint=30,ref=1,deblock=0:0,aud},scale=1,acodec=mp4a,ab=128,samplerate=48000,channels=2,width=320,height=240}:duplicate{dst=std{access=udp,mux=ts,dst=127.0.0.1:1234}}'

arai
New Cone
New Cone
Posts: 2
Joined: 12 Dec 2009 02:28

Re: Transport Stream video encoded by VLC doesn't play on iPhone

Postby arai » 12 Dec 2009 02:38

Hi jaimed.
Here is my workaround.

VLC command line:

Code: Select all

/Applications/VLC.app/Contents/MacOS/VLC --intf=dummy --sout=#transcode{width=320,height=240,fps=25,vcodec=h264,vb=256,venc=x264{aud,profile=baseline,level=30,keyint=30,bframes=0,ref=1,nocabac},acodec=mp4a,ab=56}:duplicate{dst=std{access=udp,mux=ts,dst=127.0.0.1:54321}} http://streaming-server-address/
mediastreamsegmenter command line:

Code: Select all

mediastreamsegmenter -b http://web-server/stream-dir -f /path/to/stream-dir -t 10 -s 4 -D 127.0.0.1:54321
and HTML:

Code: Select all

<video width="320" height="240"> <source src="./prog_index.m3u8" /> </video>
I hope this helps you :D

arai
New Cone
New Cone
Posts: 2
Joined: 12 Dec 2009 02:28

Re: Transport Stream video encoded by VLC doesn't play on iPhone

Postby arai » 12 Dec 2009 04:33

Here is more simple way.
Instead of using UDP stream, use stdout/stdin.

Code: Select all

/Applications/VLC.app/Contents/MacOS/VLC --intf=dummy --sout=#transcode{width=320,height=240,fps=25,vcodec=h264,vb=256,venc=x264{aud,profile=baseline,level=30,keyint=30,bframes=0,ref=1,nocabac},acodec=mp4a,ab=56}:duplicate{dst=std{access=file,mux=ts,dst=-}} http://streaming-server-address/ | mediastreamsegmenter -b http://web-server/stream-dir -f /path/to/stream-dir -t 10 -s 4 -D

gcollette
New Cone
New Cone
Posts: 1
Joined: 01 Nov 2012 19:43

Re: Transport Stream video encoded by VLC doesn't play on iP

Postby gcollette » 01 Nov 2012 21:26

You should consider using InStream Mobile app to play natively UDP MPEG Transport Stream with H.264 video / AAC-LC audio on iOS

http://itun.es/us/Jq0QH.i

Pretty simple to use and it works well over both unicast & multicast-capable wireless networks


Return to “VLC media player for macOS Troubleshooting”

Who is online

Users browsing this forum: No registered users and 15 guests