Video saved using mp4mux is not playable in android default media player

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Video saved using mp4mux is not playable in android default media player

k4ustav
I send video stream using gstreamer using the below pipeline from desktop

    gst-launch-1.0 v4l2src ! video/x-raw,width=640,height=480 ! x264enc !
h264parse ! rtph264pay pt=96 ! udpsink host=ip_address port=5000

and then receive and save the stream using the below pipeline on another
desktop

    gst-launch-1.0 -e udpsrc port=5000 !
application/x-rtp,clock-rate=90000,payload=96 ! rtph264depay ! h264parse !
mp4mux ! filesink location=a.mp4

But when I transfer this saved video to android phone this video is not
playable using default media player. But is playable on other media players
like vlc or mx player. If I decode and re-encode the stream on the receiver
then the saved video is playable on android using default media player. The
modified receiver pipeline is as below

    gst-launch-1.0 -e udpsrc port=5000 !
application/x-rtp,clock-rate=90000,payload=96 ! rtph264depay ! h264parse !
avdec_h264 ! x264enc ! mp4mux ! filesink location=aa.mp4

I don't wanna do this decode/re-encode thing. So can you tell me why this
weird issue is happening or where do I need to change in the pipelines?





--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

AW: Video saved using mp4mux is not playable in android default media player

Thornton, Keith
Hi, do you know if the video is being streamed with stream-format=byte-stream. Maybe with the first pipeline it is being stored to file as byte-stream. If this were the case, a caps-filter after the h264parser, converting the stream-format to avc might help.

-----Urspr√ľngliche Nachricht-----
Von: gstreamer-devel [mailto:[hidden email]] Im Auftrag von k4ustav
Gesendet: Dienstag, 10. April 2018 14:52
An: [hidden email]
Betreff: Video saved using mp4mux is not playable in android default media player

I send video stream using gstreamer using the below pipeline from desktop

    gst-launch-1.0 v4l2src ! video/x-raw,width=640,height=480 ! x264enc !
h264parse ! rtph264pay pt=96 ! udpsink host=ip_address port=5000

and then receive and save the stream using the below pipeline on another desktop

    gst-launch-1.0 -e udpsrc port=5000 !
application/x-rtp,clock-rate=90000,payload=96 ! rtph264depay ! h264parse !
mp4mux ! filesink location=a.mp4

But when I transfer this saved video to android phone this video is not playable using default media player. But is playable on other media players like vlc or mx player. If I decode and re-encode the stream on the receiver then the saved video is playable on android using default media player. The modified receiver pipeline is as below

    gst-launch-1.0 -e udpsrc port=5000 !
application/x-rtp,clock-rate=90000,payload=96 ! rtph264depay ! h264parse !
avdec_h264 ! x264enc ! mp4mux ! filesink location=aa.mp4

I don't wanna do this decode/re-encode thing. So can you tell me why this weird issue is happening or where do I need to change in the pipelines?





--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Video saved using mp4mux is not playable in android default media player

Baby Octopus
In reply to this post by k4ustav
Your pipeline seems to be missing EOS. Add -e to the pipeline

~BO



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: AW: Video saved using mp4mux is not playable in android default media player

k4ustav
In reply to this post by Thornton, Keith
Yes, the video is being streamed with stream-format=byte-stream. So as
suggested by you, I modified the receiver pipeline to add caps-filter
video/x-h264, stream-format=avc  after the h264parser.

But it still doesn't work.



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Video saved using mp4mux is not playable in android default media player

k4ustav
In reply to this post by Baby Octopus
-e is already there in the receiver pipeline. That's why the video is not a
corrupted one. My problem here is the video is not playable in android
default media player, but can be played in other media player apps like vlc
or mx player.



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

AW: Video saved using mp4mux is not playable in android default media player

Thornton, Keith
Hi, this is a bit of a guessing game but is alignment=au or alignment=nal. Try adding alignment=au to the caps after h264parser

-----Urspr√ľngliche Nachricht-----
Von: gstreamer-devel [mailto:[hidden email]] Im Auftrag von k4ustav
Gesendet: Mittwoch, 11. April 2018 08:12
An: [hidden email]
Betreff: Re: Video saved using mp4mux is not playable in android default media player

-e is already there in the receiver pipeline. That's why the video is not a corrupted one. My problem here is the video is not playable in android default media player, but can be played in other media player apps like vlc or mx player.



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: AW: Video saved using mp4mux is not playable in android default media player

k4ustav
Hi,
I modified both the sender and receiver pipeline and still it doesn't work.

The modified pipelines are below,

gst-launch-1.0 v4l2src ! video/x-raw,width=640,height=480 ! x264enc !
video/x-h264,stream-format=byte-stream,alignment=au ! h264parse ! rtph264pay
pt=96 ! udpsink host=192.168.2.203 port=5005

gst-launch-1.0 -e udpsrc port=5005 !
application/x-rtp,media=video,encoding-name=H264,clock-rate=90000,payload=96
! rtph264depay ! h264parse ! video/x-h264,stream-format=avc,alignment=au !
mp4mux ! filesink location=a.mp4





--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: AW: Video saved using mp4mux is not playable in android default media player

k4ustav
In reply to this post by Thornton, Keith
Hi,
I found the issue. I compared the logs generated by ffprobe of the streams
of one working video using the decoding/re-encoding elements and non-working
video. This is the diff of the two log files

30c30
< avg_frame_rate=109500/3667
---
> avg_frame_rate=1236000/41417
32,36c32,36
< start_pts=-1
< start_time=-0.000333
< duration_ts=7334
< duration=2.444667
< bit_rate=1985134
---
> start_pts=0
> start_time=0.000000
> duration_ts=41417
> duration=13.805667
> bit_rate=1968052
39c39
< nb_frames=73
---
> nb_frames=412
53c53
< TAG:creation_time=2018-04-11 08:26:33
---
> TAG:creation_time=2018-04-11 08:37:46


So, from the diff we can see that start_pts time is -1  and start_time is
negative for the non-working video. So can you please tell me why start_pts
and  start_time is getting invalid or how can I fix this?



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel