playing h264 from stdin vs file shows no video

For questions and discussion that is NOT (I repeat NOT) specific to a certain Operating System.
edjames
New Cone
New Cone
Posts: 1
Joined: 28 Apr 2017 20:11

playing h264 from stdin vs file shows no video

Postby edjames » 28 Apr 2017 21:13

I have an annex B stream starting with 00 00 00 01 67 that plays fine with:

cvlc xxx.h264

but when I try with

cvlc - < xxx.h264
or
cat xxx.h264 | cvlc -

I get a black window of the correct size (1080p) for several seconds, then it closes.

WIth verbose logging, this appears to be the difference:

main input debug: Buffering 0%
main input debug: Buffering 0%
main input debug: Buffering 0%
main input debug: Buffering 0%
main input debug: Buffering 0%
main input debug: Buffering 0%
main input debug: Buffering 0%
main input debug: Buffering 0%

vs

main input debug: Buffering 0%
main input debug: Buffering 13%
main input debug: Buffering 26%
main input debug: Buffering 40%
main input debug: Buffering 53%
main input debug: Buffering 66%
main input debug: Buffering 80%

I tried adding things like --codec h264 but they have no effect. It's not my video file, I get the same results with a reference video made with avconv, eg

ppmmake white 640 480 > white.ppm
ppmmake red 100 100 > red.ppm
for n in $(seq 0 540); do
pnmpaste red.ppm $n 240 < white.ppm | ppmtojpeg
done | avconv -f image2pipe -c:v mjpeg -i - -r 25 -map 0 xxx.h264

What are the correct args to cvlc to make it play a file like this from stdin? Thanks! --ed

Rémi Denis-Courmont
Developer
Developer
Posts: 15317
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: playing h264 from stdin vs file shows no video

Postby Rémi Denis-Courmont » 06 May 2017 19:15

In principles, VLC treats a file opened explicitly or through the shell the same way:

Code: Select all

cvlc xxx.h264 cvlc - < xxx.h264
There may be some differences however, as the current implementation will not seek. I am not sure if this should be considered a bug. In any case, piping to VLC is intrinsically different:

Code: Select all

cat xxx.h264 | vlc -
In that case, VLC gets a pipe, not a regular file. So it cannot seek and cannot know if the stream is paced/live or not. This messes up buffering. You should only use a pipe if the file is actually a live stream.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded


Return to “General VLC media player Troubleshooting”

Who is online

Users browsing this forum: No registered users and 39 guests