Unable to re-open MP4 file

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

Unable to re-open MP4 file

SyRenity
Hi.

I'm trying to reopen existing video files, which were interrupted
during writing (and the trailer was not written yet), in order to
salvage as many frames as possible.

It works with MPEG2 and WMV for example, but MPEG4 files can't be even
opened - url_open returns an error.

Does anyone know how it can be solved, or can advice an alternative way?

Thanks.
_______________________________________________
libav-user mailing list
[hidden email]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user
Reply | Threaded
Open this post in threaded view
|

Re: Unable to re-open MP4 file

Luca Abeni
Stas Oskin wrote:
> Hi.
>
> I'm trying to reopen existing video files, which were interrupted
> during writing (and the trailer was not written yet), in order to
> salvage as many frames as possible.

I suspect this mp4 file is broken: AFAIK, av_write_trailer() is
needed to write some atoms that make the file readable. If you do
not write them, opening the file will always fail.


> It works with MPEG2 and WMV for example, but MPEG4 files can't be even
> opened - url_open returns an error.

mpg and wmv files do not probably need headers that are written at
av_write_trailer() time. If I understand well, this is due to how the
file format is structured.


> Does anyone know how it can be solved, or can advice an alternative way?

I believe the simplest solution is calling av_write_trailer() when
closing the file... Or using a different file format.
But maybe there are some utilities around that can repair these broken
mp4 files, I do not know.



                                Luca
_______________________________________________
libav-user mailing list
[hidden email]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user
Reply | Threaded
Open this post in threaded view
|

Re: Unable to re-open MP4 file

SyRenity
> I believe the simplest solution is calling av_write_trailer() when
>  closing the file... Or using a different file format.
>  But maybe there are some utilities around that can repair these broken
>  mp4 files, I do not know.

Problem is when the app/computer crashes - thus making file non-usable.

I do know that there are some tools which move the atoms to file
header, in order to later stream it via Flash. Any idea if FFMPEG
provides similar facilities?
_______________________________________________
libav-user mailing list
[hidden email]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user