Quantcast

ffmpeg treats m4v as container not elementry video format

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

ffmpeg treats m4v as container not elementry video format

Yogesh Tyagi
I tried to extract video elementary stream from a 3gp file

./ffmpeg -i Nachde+Punjabi-Ajab+Gazabb+Love.3gp -vcodec copy temp.m4v
ffmpeg version N-31423-g896e597, Copyright (c) 2000-2011 the FFmpeg developers
  built on Dec 21 2012 16:44:03 with gcc 4.4.5
  configuration: --enable-libx264 --enable-gpl --enable-static --disable-shared
  libavutil    51. 11. 0 / 51. 11. 0
  libavcodec   53.  7. 0 / 53.  7. 0
  libavformat  53.  5. 0 / 53.  5. 0
  libavdevice  53.  2. 0 / 53.  2. 0
  libavfilter   2. 24. 4 /  2. 24. 4
  libswscale    2.  0. 0 /  2.  0. 0
  libpostproc  51.  2. 0 / 51.  2. 0


Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'Nachde+Punjabi-Ajab+Gazabb+Love.3gp':
  Metadata:
    major_brand     : 3gp6
    minor_version   : 256
    compatible_brands: isom3gp6
    creation_time   : 2012-10-17 15:07:41
  Duration: 00:02:53.58, start: 0.000000, bitrate: 227 kb/s
    Stream #0.0(und): Video: mpeg4, yuv420p, 320x180 [PAR 1:1 DAR
16:9], 193 kb/s, 24 fps, 24 tbr, 24 tbn, 24 tbc
    Metadata:
      creation_time   : 2012-10-17 15:07:41
    Stream #0.1(und): Audio: aac, 22050 Hz, mono, s16, 31 kb/s
    Metadata:
      creation_time   : 2012-10-17 15:07:41
File 'temp.m4v' already exists. Overwrite ? [y/N] y
Output #0, ipod, to 'temp.m4v':
  Metadata:
    major_brand     : 3gp6
    minor_version   : 256
    compatible_brands: isom3gp6
    creation_time   : 2012-10-17 15:07:41
    encoder         : Lavf53.5.0
    Stream #0.0(und): Video: mpeg4, yuv420p, 320x180 [PAR 1:1 DAR
16:9], q=2-31, 193 kb/s, 24 tbn, 24 tbc
    Metadata:
      creation_time   : 2012-10-17 15:07:41
    Stream #0.1(und): Audio: aac, 22050 Hz, mono, s16, 64 kb/s
    Metadata:
      creation_time   : 2012-10-17 15:07:41
Stream mapping:
  Stream #0.0 -> #0.0
  Stream #0.1 -> #0.1
Press [q] to stop, [?] for help
frame= 4166 fps=1326 q=-1.0 Lsize=    5492kB time=00:02:53.54 bitrate=
259.2kbits/s
video:4108kB audio:1321kB global headers:0kB muxing overhead 1.165175%

when I tried to see what went inside transcoded file I was surprised
to see both audio as well video in m4v file:

root@yogesh-desktop:~/ffmpeg_git/ffmpeg# ffmpeg -i temp.m4v
ffmpeg version 0.9, Copyright (c) 2000-2011 the FFmpeg developers
  built on Dec  6 2012 19:13:59 with gcc 4.4.5
  configuration: --enable-libx264 --enable-gpl
  libavutil    51. 32. 0 / 51. 32. 0
  libavcodec   53. 42. 0 / 53. 42. 0
  libavformat  53. 24. 0 / 53. 24. 0
  libavdevice  53.  4. 0 / 53.  4. 0
  libavfilter   2. 53. 0 /  2. 53. 0
  libswscale    2.  1. 0 /  2.  1. 0
  libpostproc  51.  2. 0 / 51.  2. 0
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'temp.m4v':
  Metadata:
    major_brand     : M4V
    minor_version   : 512
    compatible_brands: isomiso2
    creation_time   : 1970-01-01 00:00:00
    encoder         : Lavf53.5.0
  Duration: 00:02:53.58, start: 0.000000, bitrate: 259 kb/s
    Stream #0:0(und): Video: mpeg4 (Simple Profile) (mp4v /
0x7634706D), yuv420p, 320x180 [SAR 1:1 DAR 16:9], 193 kb/s, 24 fps, 24
tbr, 24 tbn, 24 tbc
    Metadata:
      creation_time   : 1970-01-01 00:00:00
      handler_name    : VideoHandler
    Stream #0:1(und): Audio: aac (mp4a / 0x6134706D), 22050 Hz, mono,
s16, 62 kb/s
    Metadata:
      creation_time   : 1970-01-01 00:00:00
      handler_name    :
At least one output file must be specified

What format should I use so that I get mpeg4 video elementary stream.

Thanks,
Yogesh
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: ffmpeg treats m4v as container not elementry video format

Carl Eugen Hoyos
Yogesh Tyagi <yogesh.bit2006 <at> gmail.com> writes:

> I tried to extract video elementary stream from a 3gp file
>
> ./ffmpeg -i Nachde+Punjabi-Ajab+Gazabb+Love.3gp -vcodec copy temp.m4v

> What format should I use so that I get mpeg4 video elementary stream.

You have to use -f m4v to choose the right format:
$ ffmpeg -i input -vcodec copy -f m4v out.m4v

(The reason is probably that more people need iDevice output
than MPEG-4 elemetary stream.)

Carl Eugen

_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: ffmpeg treats m4v as container not elementry video format

Yogesh Tyagi
On Tue, Jan 22, 2013 at 7:03 PM, Carl Eugen Hoyos <[hidden email]> wrote:

> Yogesh Tyagi <yogesh.bit2006 <at> gmail.com> writes:
>
>> I tried to extract video elementary stream from a 3gp file
>>
>> ./ffmpeg -i Nachde+Punjabi-Ajab+Gazabb+Love.3gp -vcodec copy temp.m4v
>
>> What format should I use so that I get mpeg4 video elementary stream.
>
> You have to use -f m4v to choose the right format:
> $ ffmpeg -i input -vcodec copy -f m4v out.m4v
>
> (The reason is probably that more people need iDevice output
> than MPEG-4 elemetary stream.)
>
> Carl Eugen
>
> _______________________________________________
> ffmpeg-user mailing list
> [hidden email]
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user

Hi,

If I use "-f m4v" to generate mpeg4 video elementary stream from a 3gp
file and I try to play this file with ffplay, It throws following
error:
"Invalid data found when processing input"

I have previous extracted mpeg video elementary stream from mp4
container using "-f m4v" but somehow it's not working with 3gp.

root@yogesh-desktop:~/SDK/27.0.12132.316788/IntelCE-27.0.12132.316788/project_build_i686/IntelCE/root/mnt#
ffplay out.m4v
ffplay version 0.9, Copyright (c) 2003-2011 the FFmpeg developers
  built on Dec  6 2012 19:13:59 with gcc 4.4.5
  configuration: --enable-libx264 --enable-gpl
  libavutil    51. 32. 0 / 51. 32. 0
  libavcodec   53. 42. 0 / 53. 42. 0
  libavformat  53. 24. 0 / 53. 24. 0
  libavdevice  53.  4. 0 / 53.  4. 0
  libavfilter   2. 53. 0 /  2. 53. 0
  libswscale    2.  1. 0 /  2.  1. 0
  libpostproc  51.  2. 0 / 51.  2. 0
Home directory /home/yogesh not ours.
Home directory /home/yogesh not ours.
out.m4v: Invalid data found when processing input

Thanks,
Yogesh
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: ffmpeg treats m4v as container not elementry video format

Carl Eugen Hoyos
Yogesh Tyagi <yogesh.bit2006 <at> gmail.com> writes:

> >> What format should I use so that I get mpeg4 video elementary stream.
> >
> > You have to use -f m4v to choose the right format:
> > $ ffmpeg -i input -vcodec copy -f m4v out.m4v

> If I use "-f m4v" to generate mpeg4 video elementary stream from a 3gp
> file and I try to play this file with ffplay, It throws following
> error:
> "Invalid data found when processing input"

You have to add the extradata to the output file:
$ ffmpeg -i input -vcodec copy -f m4v -vbsf dump_extra out.m4v

Carl Eugen

_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: ffmpeg treats m4v as container not elementry video format

Yogesh Tyagi
On Tue, Jan 22, 2013 at 7:32 PM, Carl Eugen Hoyos <[hidden email]> wrote:

> Yogesh Tyagi <yogesh.bit2006 <at> gmail.com> writes:
>
>> >> What format should I use so that I get mpeg4 video elementary stream.
>> >
>> > You have to use -f m4v to choose the right format:
>> > $ ffmpeg -i input -vcodec copy -f m4v out.m4v
>
>> If I use "-f m4v" to generate mpeg4 video elementary stream from a 3gp
>> file and I try to play this file with ffplay, It throws following
>> error:
>> "Invalid data found when processing input"
>
> You have to add the extradata to the output file:
> $ ffmpeg -i input -vcodec copy -f m4v -vbsf dump_extra out.m4v
>
> Carl Eugen
>
> _______________________________________________
> ffmpeg-user mailing list
> [hidden email]
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user

It works.Thanks
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: ffmpeg treats m4v as container not elementry video format

Francois Visagie
In reply to this post by Carl Eugen Hoyos
> -----Original Message-----
> From: [hidden email] [mailto:ffmpeg-user-
> [hidden email]] On Behalf Of Carl Eugen Hoyos
> Sent: 22 January 2013 16:03
> To: [hidden email]
> Subject: Re: [FFmpeg-user] ffmpeg treats m4v as container not elementry
> video format
>
> Yogesh Tyagi <yogesh.bit2006 <at> gmail.com> writes:
>
> > >> What format should I use so that I get mpeg4 video elementary stream.
> > >
> > > You have to use -f m4v to choose the right format:
> > > $ ffmpeg -i input -vcodec copy -f m4v out.m4v
>
> > If I use "-f m4v" to generate mpeg4 video elementary stream from a 3gp
> > file and I try to play this file with ffplay, It throws following
> > error:
> > "Invalid data found when processing input"
>
> You have to add the extradata to the output file:
> $ ffmpeg -i input -vcodec copy -f m4v -vbsf dump_extra out.m4v

What is this extradata and why does it need to be added in this instance and
not normally when using iDevice format? Thanks.

>
> Carl Eugen
>
> _______________________________________________
> ffmpeg-user mailing list
> [hidden email]
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user

_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: ffmpeg treats m4v as container not elementry video format

Carl Eugen Hoyos
Francois Visagie <francois.visagie <at> gmail.com> writes:

> > You have to add the extradata to the output file:
> > $ ffmpeg -i input -vcodec copy -f m4v -vbsf dump_extra out.m4v
>
> What is this extradata and why does it need to be added in this
> instance and not normally when using iDevice format? Thanks.

The extradata is always required for MPEG4 decoding.
(That is what I assume because of the report, I did
not check.)
If a "real" container (like mov) is chosen for
output, the muxer places the extradata into the
header of the output file where decoders will
find it.
If instead of a "real" container "m4v" (MPEG-4
elementary stream as opposed to mov variant "ipod")
is chosen, no extradata can be written by the muxer,
it gets lost and decoding is impossible.
The bitstream filter apparently takes the extradata
and places it into the first packet of the
videostream (or something similar).

Carl Eugen

_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: ffmpeg treats m4v as container not elementry video format

Francois Visagie
> -----Original Message-----
> From: [hidden email] [mailto:ffmpeg-user-
> [hidden email]] On Behalf Of Carl Eugen Hoyos
> Sent: 23 January 2013 10:43
> To: [hidden email]
> Subject: Re: [FFmpeg-user] ffmpeg treats m4v as container not elementry
> video format
>
> Francois Visagie <francois.visagie <at> gmail.com> writes:
>
> > > You have to add the extradata to the output file:
> > > $ ffmpeg -i input -vcodec copy -f m4v -vbsf dump_extra out.m4v
> >
> > What is this extradata and why does it need to be added in this
> > instance and not normally when using iDevice format? Thanks.
>
> The extradata is always required for MPEG4 decoding.
> (That is what I assume because of the report, I did not check.) If a
"real"
> container (like mov) is chosen for output, the muxer places the extradata
> into the header of the output file where decoders will find it.
> If instead of a "real" container "m4v" (MPEG-4 elementary stream as
> opposed to mov variant "ipod") is chosen, no extradata can be written by
the
> muxer, it gets lost and decoding is impossible.
> The bitstream filter apparently takes the extradata and places it into the
first
> packet of the videostream (or something similar).

Got it, thanks for the thorough explanation.


_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Loading...