GStreamer profile for Transmageddon/Arista for the Meizu M6 player

View: New views
8 Messages — Rating Filter:   Alert me  

GStreamer profile for Transmageddon/Arista for the Meizu M6 player

by Luis Menina-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi list,

I'm still a noob in GStreamer stuff, so don't hit me too hard. If you
think that this is not the right mailing list, and that I should use the
"gstreamer-devel" one, please tell me.

Here's my goal: I want to produce a GStreamer pipeline to transcode
videos for the Meizu M6 miniplayer, which is a chinese audio/video
player. I have an 8GB SL version.
http://en.wikipedia.org/wiki/Meizu_M6_miniPlayer

The fact is, I could find information on the web on how to transcode
videos for this player using ffmpeg, or mencoder, but nothing using
GStreamer. That's why I'm a bit struggling to find the right pipeline...

I already asked for help on IRC, but couldn't find how to solve my
problem. Which is : none of the videos I produce with GStreamer do work.
I've tried to use the following command:
GST_DEBUG=avidemux:3,riff:3 gst-launch-0.10 playbin2
uri=file:///home/user/testfile.avi

...to find differences between te way mencoder has encoded my sample
file, to produce a working file, and the one that GStreamer produced,
which miserably fails on the player (shows a black screen showing it's
loading and exits after 1 second).

The player is also shipped with a video that perfectly works on the
player. Under Windows, transcoding is done by using (a customized ?)
Virtualdub, shipped with the player.

Here are the specs:

Specifications:
===============
Framerate:           15-20 fps
Resolution:          320x240
Video Codec:         XVID
Video bitrate:       200-500 kbps
Audio Codec:         MP3
Audio bitrate:       56-256 kbps
Audio sampling freq: 44kHz


mencoder command (works):
=========================
mencoder input.mp4 -idx -noodml -ofps 20 -vf
scale=320:-2,expand=:240:::1,crop=320:240,rotate=1 -ovc lavc -ffourcc
XVID -lavcopts vcodec=mpeg4:vbitrate=384:vmax_b_frames=0:vhq -sws 9
-srate 44100 -oac mp3lame -lameopts cbr:br=128:mode=0 -o output.avi

GStreamer pipeline (doesn't work):
==================================
gst-launch-0.10 filesrc location=/home/luis/input.mp4 ! decodebin
name=decoder decoder.! queue ! videorate ! videoscale !
'video/x-raw-yuv,framerate=(fraction)20/1,width=320,height=240' !
videoflip method=clockwise ! xvidenc bitrate=384000 ! queue ! avimux
name=mux ! progressreport ! filesink location=/home/luis/output.avi
decoder.! queue ! audioconvert ! audioresample !
'audio/x-raw-int,channels=2,rate=44100' ! lame mode=stereo vbr=none
bitrate=128 ! mux.

Note that the video is rotated 90° clockwise. If this is ommited, the
mencoder encoded version still plays, but is very laggy.

What kind of information/trace could I provide to you to help diagnose
the origin of the problem ?

Thanks in advance,

Cheers,
--
Luis


_______________________________________________
gnome-multimedia mailing list
gnome-multimedia@...
http://mail.gnome.org/mailman/listinfo/gnome-multimedia

Re: GStreamer profile for Transmageddon/Arista for the Meizu M6 player

by Daniel Taylor-6 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Luis,

On Fri, 2009-09-11 at 01:31 +0200, Luis Menina wrote:

> * snip *
>
> Specifications:
> ===============
> Framerate:           15-20 fps
> Resolution:          320x240
> Video Codec:         XVID
> Video bitrate:       200-500 kbps
> Audio Codec:         MP3
> Audio bitrate:       56-256 kbps
> Audio sampling freq: 44kHz
>
>
> mencoder command (works):
> =========================
> mencoder input.mp4 -idx -noodml -ofps 20 -vf
> scale=320:-2,expand=:240:::1,crop=320:240,rotate=1 -ovc lavc -ffourcc
> XVID -lavcopts vcodec=mpeg4:vbitrate=384:vmax_b_frames=0:vhq -sws 9
> -srate 44100 -oac mp3lame -lameopts cbr:br=128:mode=0 -o output.avi
>
> GStreamer pipeline (doesn't work):
> ==================================
> gst-launch-0.10 filesrc location=/home/luis/input.mp4 ! decodebin
> name=decoder decoder.! queue ! videorate ! videoscale !
> 'video/x-raw-yuv,framerate=(fraction)20/1,width=320,height=240' !
> videoflip method=clockwise ! xvidenc bitrate=384000 ! queue ! avimux
> name=mux ! progressreport ! filesink location=/home/luis/output.avi
> decoder.! queue ! audioconvert ! audioresample !
> 'audio/x-raw-int,channels=2,rate=44100' ! lame mode=stereo vbr=none
> bitrate=128 ! mux.

Some stuff to try:

 * Encode just video or audio to see which is causing problems
 * Add max-bframes=0 to xvidenc
 * If the FOURCC isn't being set you could add it manually

I'm not 100% sure about the FOURCC thing but you might be able to do
something along the lines of ... ! 'video/x-xvid,
format=(fourcc)XVID' ! ... just after the xvidenc element.

Good luck and if you get it working I'll add the preset to Arista.
--
Daniel G. Taylor
http://programmer-art.org/

_______________________________________________
gnome-multimedia mailing list
gnome-multimedia@...
http://mail.gnome.org/mailman/listinfo/gnome-multimedia

Re: GStreamer profile for Transmageddon/Arista for the Meizu M6 player

by Luis Menina-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Daniel, thanks for your answer and sorry for the late reply !

Daniel G. Taylor a écrit :

> On Fri, 2009-09-11 at 01:31 +0200, Luis Menina wrote:
>> * snip *
>>
>> Specifications:
>> ===============
>> Framerate:           15-20 fps
>> Resolution:          320x240
>> Video Codec:         XVID
>> Video bitrate:       200-500 kbps
>> Audio Codec:         MP3
>> Audio bitrate:       56-256 kbps
>> Audio sampling freq: 44kHz
>>
>>
>> mencoder command (works):
>> =========================
>> mencoder input.mp4 -idx -noodml -ofps 20 -vf
>> scale=320:-2,expand=:240:::1,crop=320:240,rotate=1 -ovc lavc -ffourcc
>> XVID -lavcopts vcodec=mpeg4:vbitrate=384:vmax_b_frames=0:vhq -sws 9
>> -srate 44100 -oac mp3lame -lameopts cbr:br=128:mode=0 -o output.avi
>>
>> GStreamer pipeline (doesn't work):
>> ==================================
>> gst-launch-0.10 filesrc location=/home/luis/input.mp4 ! decodebin
>> name=decoder decoder.! queue ! videorate ! videoscale !
>> 'video/x-raw-yuv,framerate=(fraction)20/1,width=320,height=240' !
>> videoflip method=clockwise ! xvidenc bitrate=384000 ! queue ! avimux
>> name=mux ! progressreport ! filesink location=/home/luis/output.avi
>> decoder.! queue ! audioconvert ! audioresample !
>> 'audio/x-raw-int,channels=2,rate=44100' ! lame mode=stereo vbr=none
>> bitrate=128 ! mux.
>
> Some stuff to try:
>
>  * Encode just video or audio to see which is causing problems

I tried with the video only, and it didn't work.

I tried with a simple videotestsrc, and it didn't work:
gst-launch-0.10 videotestsrc num-buffers=200 !
'video/x-raw-yuv,framerate=(fraction)20/1,width=320,height=240' !
videoflip method=clockwise ! xvidenc bitrate=384000 ! queue ! avimux
name=mux ! progressreport ! filesink location=/home/luis/videotestsrc.avi

I tried with sound only, and it didn't work either:
gst-launch-0.10 filesrc location=/home/luis/input.mp4 ! decodebin
name=decoder avimux name=mux ! progressreport ! filesink
location=/home/luis/sound-only.avi decoder.! queue ! audioconvert !
audioresample ! 'audio/x-raw-int,channels=2,rate=44100' ! lame
mode=stereo vbr=none bitrate=128 ! mux.

>  * Add max-bframes=0 to xvidenc

Nope, doesn't work either...

>  * If the FOURCC isn't being set you could add it manually
 > I'm not 100% sure about the FOURCC thing but you might be able to do
 > something along the lines of ... ! 'video/x-xvid,
 > format=(fourcc)XVID' ! ... just after the xvidenc element.

I use this command to generate trace files:
GST_DEBUG=avidemux:3,riff:3 gst-launch-0.10 playbin2
uri=file:///home/luis/testfile.avi

In the traces, I find this:
riff riff-read.c:302:gst_riff_parse_strh:<avidemux0>  fcc_handler XVID

 From what I understand, this seems ok...

> Good luck and if you get it working I'll add the preset to Arista.

What I'd like to know is why mencoder and virtualdub can make it work,
but not gstreamer...

Do you have more ideas I could follow ?

Thanks again for your help.
--
Luis

_______________________________________________
gnome-multimedia mailing list
gnome-multimedia@...
http://mail.gnome.org/mailman/listinfo/gnome-multimedia

Re: GStreamer profile for Transmageddon/Arista for the Meizu M6 player

by Christian Fredrik Kalager Schaller-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Luis,
What would help is if you can create two small clips, one with mencoder
that works on your device and one with GStreamer that doesn't. Using the
same input source. If you attach those two small clips to a GStreamer
bugreport we will be able to compare them and try to figure out the
problem.

Christian

On Fri, 2009-10-09 at 01:08 +0200, Luis Menina wrote:

> Hi Daniel, thanks for your answer and sorry for the late reply !
>
> Daniel G. Taylor a écrit :
> > On Fri, 2009-09-11 at 01:31 +0200, Luis Menina wrote:
> >> * snip *
> >>
> >> Specifications:
> >> ===============
> >> Framerate:           15-20 fps
> >> Resolution:          320x240
> >> Video Codec:         XVID
> >> Video bitrate:       200-500 kbps
> >> Audio Codec:         MP3
> >> Audio bitrate:       56-256 kbps
> >> Audio sampling freq: 44kHz
> >>
> >>
> >> mencoder command (works):
> >> =========================
> >> mencoder input.mp4 -idx -noodml -ofps 20 -vf
> >> scale=320:-2,expand=:240:::1,crop=320:240,rotate=1 -ovc lavc -ffourcc
> >> XVID -lavcopts vcodec=mpeg4:vbitrate=384:vmax_b_frames=0:vhq -sws 9
> >> -srate 44100 -oac mp3lame -lameopts cbr:br=128:mode=0 -o output.avi
> >>
> >> GStreamer pipeline (doesn't work):
> >> ==================================
> >> gst-launch-0.10 filesrc location=/home/luis/input.mp4 ! decodebin
> >> name=decoder decoder.! queue ! videorate ! videoscale !
> >> 'video/x-raw-yuv,framerate=(fraction)20/1,width=320,height=240' !
> >> videoflip method=clockwise ! xvidenc bitrate=384000 ! queue ! avimux
> >> name=mux ! progressreport ! filesink location=/home/luis/output.avi
> >> decoder.! queue ! audioconvert ! audioresample !
> >> 'audio/x-raw-int,channels=2,rate=44100' ! lame mode=stereo vbr=none
> >> bitrate=128 ! mux.
> >
> > Some stuff to try:
> >
> >  * Encode just video or audio to see which is causing problems
>
> I tried with the video only, and it didn't work.
>
> I tried with a simple videotestsrc, and it didn't work:
> gst-launch-0.10 videotestsrc num-buffers=200 !
> 'video/x-raw-yuv,framerate=(fraction)20/1,width=320,height=240' !
> videoflip method=clockwise ! xvidenc bitrate=384000 ! queue ! avimux
> name=mux ! progressreport ! filesink location=/home/luis/videotestsrc.avi
>
> I tried with sound only, and it didn't work either:
> gst-launch-0.10 filesrc location=/home/luis/input.mp4 ! decodebin
> name=decoder avimux name=mux ! progressreport ! filesink
> location=/home/luis/sound-only.avi decoder.! queue ! audioconvert !
> audioresample ! 'audio/x-raw-int,channels=2,rate=44100' ! lame
> mode=stereo vbr=none bitrate=128 ! mux.
>
> >  * Add max-bframes=0 to xvidenc
>
> Nope, doesn't work either...
>
> >  * If the FOURCC isn't being set you could add it manually
>  > I'm not 100% sure about the FOURCC thing but you might be able to do
>  > something along the lines of ... ! 'video/x-xvid,
>  > format=(fourcc)XVID' ! ... just after the xvidenc element.
>
> I use this command to generate trace files:
> GST_DEBUG=avidemux:3,riff:3 gst-launch-0.10 playbin2
> uri=file:///home/luis/testfile.avi
>
> In the traces, I find this:
> riff riff-read.c:302:gst_riff_parse_strh:<avidemux0>  fcc_handler XVID
>
>  From what I understand, this seems ok...
>
> > Good luck and if you get it working I'll add the preset to Arista.
>
> What I'd like to know is why mencoder and virtualdub can make it work,
> but not gstreamer...
>
> Do you have more ideas I could follow ?
>
> Thanks again for your help.
> --
> Luis
>
> _______________________________________________
> gnome-multimedia mailing list
> gnome-multimedia@...
> http://mail.gnome.org/mailman/listinfo/gnome-multimedia

_______________________________________________
gnome-multimedia mailing list
gnome-multimedia@...
http://mail.gnome.org/mailman/listinfo/gnome-multimedia

Re: GStreamer profile for Transmageddon/Arista for the Meizu M6 player

by Luis Menina-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Christian Fredrik Kalager Schaller a écrit :
> Hi Luis,
> What would help is if you can create two small clips, one with mencoder
> that works on your device and one with GStreamer that doesn't. Using the
> same input source. If you attach those two small clips to a GStreamer
> bugreport we will be able to compare them and try to figure out the
> problem.

Hi Christian, thanks for your advice. Do you have a prefered input file
I could work on ? ATM I work on some videoclips wich are copyrighted. If
you know how to encode only a few seconds of the original source, it
would be considered IMHO as « fair use » or similar. A small Creative
Commons video would also do the trick too (the only one I can think of
is Big Buck Bunny which is a little too big ;-)).

Thanks again,
--
Luis

_______________________________________________
gnome-multimedia mailing list
gnome-multimedia@...
http://mail.gnome.org/mailman/listinfo/gnome-multimedia

Re: GStreamer profile for Transmageddon/Arista for the Meizu M6 player

by Tim-Philipp Müller :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Tue, 2009-10-13 at 03:06 +0200, Luis Menina wrote:

> ATM I work on some videoclips wich are copyrighted. If
> you know how to encode only a few seconds of the original source, it
> would be considered IMHO as « fair use » or similar. A small Creative
> Commons video would also do the trick too (the only one I can think of
> is Big Buck Bunny which is a little too big ;-)).

You can find some smaller ogg/theora clips here:
http://commons.wikimedia.org/wiki/Category:OGV_files

 Cheers
  -Tim


_______________________________________________
gnome-multimedia mailing list
gnome-multimedia@...
http://mail.gnome.org/mailman/listinfo/gnome-multimedia

Re: GStreamer profile for Transmageddon/Arista for the Meizu M6 player

by Daniel Taylor-6 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Tue, 2009-10-13 at 03:06 +0200, Luis Menina wrote:
> Hi Christian, thanks for your advice. Do you have a prefered input file
> I could work on ? ATM I work on some videoclips wich are copyrighted. If
> you know how to encode only a few seconds of the original source, it
> would be considered IMHO as « fair use » or similar. A small Creative
> Commons video would also do the trick too (the only one I can think of
> is Big Buck Bunny which is a little too big ;-)).

You can generate small clips using GStreamer or FFmpeg pretty easily,
e.g.

ffmpeg -i infile -t 60 ... outfile.mp4

Will only encode the first 60 seconds of your input file. If you don't
have any input files you want to use then use a test source to generate
a small video:

gst-launch-0.10 videotestsrc num-buffers=500 ! x264enc crf=23 ! qtmux !
filesink location="test.mp4"

The GStreamer filesrc also supports num-buffers so you can limit the
amount of an input file that is encoded.

Take care,
--
Daniel G. Taylor
http://programmer-art.org/

_______________________________________________
gnome-multimedia mailing list
gnome-multimedia@...
http://mail.gnome.org/mailman/listinfo/gnome-multimedia

Re: GStreamer profile for Transmageddon/Arista for the Meizu M6 player

by Luis Menina-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi all,
seems that my mail with the videos attached was too big for the list. As
no admin unblocked it, it never reached the list... So here it goes
again. I now give you the URLs where you can download the files.

Daniel G. Taylor a écrit :
 > If you don't
 > have any input files you want to use then use a test source to generate
 > a small video:
 >
 > gst-launch-0.10 videotestsrc num-buffers=500 ! x264enc crf=23 ! qtmux
 > ! filesink location="test.mp4"

= Original =
Thanks for the tip. Here is how I generated the attached test file :

gst-launch-0.10 videotestsrc num-buffers=100 ! theoraenc ! queue !
oggmux name=mux audiotestsrc num-buffers=100 ! audioconvert ! vorbisenc
! queue ! mux. mux. ! queue ! filesink location=test.ogv

Download it at http://liberforce.perso.sfr.fr/tmp/test.ogv


= GStreamer test =
Then for the test file converted with gstreamer (doesn't play in the
Meizu device) :

gst-launch-0.10 filesrc location=test.ogv ! decodebin name=decoder
decoder.! queue ! videorate ! videoscale !
'video/x-raw-yuv,framerate=(fraction)20/1,width=320,height=240' !
videoflip method=clockwise ! xvidenc bitrate=384000 max-bframes=0 !
queue ! avimux name=mux ! progressreport ! filesink
location=test-gstreamer.avi decoder.! queue ! audioconvert !
audioresample ! 'audio/x-raw-int,channels=2,rate=44100' ! lame
mode=stereo vbr=none bitrate=128 ! mux.

Download it at http://liberforce.perso.sfr.fr/tmp/test-gstreamer.avi

= Mencoder test =
And finally, the test file converted with mencoder (plays in the Meizu
device) :

mencoder test.ogv -idx -noodml -ofps 20 -vf
scale=320:-2,expand=:240:::1,crop=320:240,rotate=1 -ovc lavc -ffourcc
XVID -lavcopts vcodec=mpeg4:vbitrate=384:vmax_b_frames=0:vhq -sws 9
-srate 44100 -oac mp3lame -lameopts cbr:br=128:mode=0 -o test-mencoder.avi

http://liberforce.perso.sfr.fr/tmp/test-mencoder.avi

Thanks everyone for your help, don't hesitate to ask for more info.
--
Luis


_______________________________________________
gnome-multimedia mailing list
gnome-multimedia@...
http://mail.gnome.org/mailman/listinfo/gnome-multimedia